×
Welcome to the pathfinder!
This is a short guide to walk you through the working of this Pathfinder. If you want to skip it feel free to press 'X' in the top right corner.
What are pathfinding algorithms?
Pathfinding algorithms are the class of algorithms that usually attempt to solve the shortest path problem in graph theory. They try to find the best path given a starting point and ending point based on some predefined criteria.
What is Pathfinder?
Pathfinder is a visualizing tool that shows how different pathfinding algorithms work. The basic idea of it is to begin from the 'Start' and reach the 'Goal' node. A node's horizontal and vertical neighbours are considered the valid neighbours i.e. only UP, DOWN, LEFT, RIGHT movements are allowed (no diagonal crossing).
Once any algorithm starts searching for the goal node, the visited nodes would be marked in orange color. The algorithm runs untill the goal node is reached or the entire grid is searched. If the path is found it will be marked with blue color.
Select an algorithms!
Here we primarily have two classes of algorithms: weighted and unweighted.
- Weighted: These category of algorithms consider the weights of nodes while searching for the goal node.
- Unweighted: These algorithms don't consider the weights of nodes while searching for the goal node.
Also all the algorithms doesn't guarantee the shortest path. You can pick an algorithm from the algorithm drop down menu to visualize it.
Draw walls and weights
You can manipulate the grid according to your wish. If a node is marked as 'Wall' node, then it is not walkable. Weight on the otherhand is a 'walkable' node but you will cost you 5 units (walking through an empty node will cost 1 unit).
You can create walls or weights by clicking on the grid and dragging over it. You can easily switch between walls and weights from the header. Once you are done just hit 'Visualize' button!
Generate mazes!
You can play around with mazes to see how the pathfinder locates the goal node inside a maze. You can modify the mazes (by adding walls and weights at the choke points) to see how the path course for the algorithm changes. The standard mazes like recursive division, flood fill, kruskal's and prim's maze are implemented.
Running time and shortest path
I have tried to implement the execution time of the algorithm and tried to make the running time as accurate as possible, but still some of the CPU time is consumed is animation of grid.
We also have an additional functionality 'Compare' where you can see the running time of all the algorithms side by side with its path cost (I have not included the Jump point search algorithm for comparision here because an ideal Jump point search algorithm involves diagonal movements aswell. It thrills in such condition, poor Jump point search).
Others
There are some other small features to assist in visualization like: speed change, clearing grid, movable Start and Goal node, etc.
I hope you will enjoy playing with it. If you find any issue or unusual behaviour feel free to let me know.
You can find the source code of this project here
Liked this? You may also like the related project sorting visualizer