This project contains a sprite which I called RouteFinder, 'cos that's what it does. It uses Dijkstra's algorithm to find the shortest path through a maze between two objects. I've kept the logic all in one sprite so it may be easily reused. To test, you can play with TILES_PER_SLIDE, for different sized mazes. Click on RESET to randomise the maze, then SOLVE to see if a path can be found.
The algorithm, I found on Wikipedia The images, I took from my other project, The Trials of Beanie, which is the project that I needed this algorithm for (you get chased around the forest by goblins, and other bad guys).