1s1s Pathfinder (Dijkstra's Algorithm)

2,753
0
Published 2010-05-30
This is just like my previous project, but I optimized it and made it 1s1s! It should now run slightly faster.

This project uses Dijkstra's algorithm to calculate the shortest path through a stage. This is a simplified version of the algorithm showing the recursive algorithm on a 10x10 grid of nodes creating a maze.
Unlike A*, a variant of the algorithm, this calculates the fastest path before hand, sacrificing some of the initial calculating speed but always providing the shortest path (or one of them if there are several equally short paths).

How to use:
-Set the starting and ending points of the maze at the beginning. They must be placed within the boundaries of the page and in open space (not on top of a wall).
-Wait for the algorithm to run.
-Observe the path, and you can look at information about the case shown after it is rendered.

In the future I may come up with a version where you can create your own maze, but for now you can set a path within this maze.

Feel free to use in games as long as you GIVE CREDIT PLEASE and if you can figure out how it all works. :))

Here's the wikipedia article I used and more about pathfinding and how it works (also on this page is the sample method I used.):

http://en.wikipedia.org/wiki/Pathfinding

Remember to favorite it or love it if you loved it!

Thanks for watching and please leave a comment!