Pathfinding Visualizer

Watch algorithms find the shortest path through obstacles

Draw:
Speed:
Start Node
End Node
Wall
Visited
Shortest Path
0
Nodes Visited
0
Path Length
0
Time (ms)

Dijkstra's Algorithm

Guarantees the shortest path by exploring nodes in order of their distance from the start. Works with weighted edges but doesn't use heuristics.

Time: O((V + E) log V)

A* Search

Combines Dijkstra with a heuristic (estimated distance to goal). Faster than Dijkstra while still guaranteeing the shortest path.

Time: O(E) with good heuristic

Breadth-First Search

Explores all neighbors at the current depth before moving deeper. Guarantees shortest path for unweighted graphs.

Time: O(V + E)

Depth-First Search

Explores as far as possible along each branch before backtracking. Does NOT guarantee shortest path!

Time: O(V + E)