Click and drag on the grid to add walls. Hold the "w" key and click to add weighted nodes. Click on any wall or weighted nodes to remove them.
Choose a maze or pattern, or make your own!
Wall nodes are impassable.
Weighted nodes are passable, but have a higher cost associated with passing through them.
Select an algorithm...
...And then press "Visualize!"
After visualizing, move the start and end nodes to see how the path and search pattern change! Play around and add more wall or weighted nodes.
To reset the visualizer, click "Reset Visualizer." To reset the visualizer and remove all wall and weighted nodes, click "Reset All."
If the visualization is too fast or slow, you can select a different speed.
Know Your Algorithms
Dijkstra's: The father of pathfinding algorithms. Visits nodes in the order of weighted distance from the start node. A weighted algorithm. Guaranteed to find the shortest path. No heuristic applied.
A* (Euclidean Heuristic): A variation of Dijkstra's with a geometric straight-line heuristic applied. A weighted algorithm. Guaranteed to find the shortest path.
A* (Manhattan Heuristic): The strongest algorithm in this demo. A variation of Dijkstra's with a Manhattan heuristic applied. A weighted algorithm. Guaranteed to find the shortest path.
A* (Swarm Heuristic): A variation of Dijkstra's with a custom heuristic that is the sum of the Manhattan distances to the start and end nodes and has a distinctive cone-shaped search pattern. A weighted algorithm. Not guaranteed to find the shortest path.
Convergent Swarm: A more heuristic-heavy version of A* (Swarm Heuristic) that "converges" to the end node. A weighted algorithm. Not guaranteed to find the shortest path.
Greedy Best-first Search: A very heuristic-heavy and faster version of A* (Manhattan Heuristic). A weighted algorithm. Not guaranteed to find the shortest path due to its aggressive preference for nodes close to the end node.
Bidirectional Dijkstra's: A bidirectional version of Dijkstra's algorithm. Visits nodes in the order of weighted distance from the start or end nodes. A weighted algorithm. Guaranteed to find the shortest path. No heuristic applied.
Bidirectional Swarm: A bidirectional version of A* (Swarm Heuristic). A weighted algorithm. Not guaranteed to find the shortest path.
Depth-first Search: Not a very good algorithm for pathfinding, but essential to many graph algorithms. An unweighted algorithm. Not guaranteed to find the shortest path.
Breadth-first Search: Searches nodes in order of distance from the start node. An unweighted algorithm. Guaranteed to find the shortest path if no weighted nodes exist.