Interactive demo

Pathfinding Algorithms

How do you get from A to B? Eight search algorithms find their way through walls and mud, step by step. Each one makes a different trade-off between speed, the quality of the path and what it needs to know.

Uninformed search

Informed search

Grid techniques

Pathfinding algorithms compared

AlgorithmOptimalWeighted cellsHeuristicAny angle
Breadth-First SearchWithout mud and diagonalsNoNoNo
Depth-First SearchNoNoNoNo
Dijkstra's AlgorithmYesYesNoNo
Bidirectional SearchYesYesNoNo
Greedy Best-First SearchNoNoYesNo
A* SearchWith weight 1 and an admissible heuristicYesYesNo
Jump Point SearchWithout mudNoYesNo
Theta*NoShortcuts over open ground onlyYesYes

The previews show every algorithm on the same map with diagonal moves: walls in light gray, mud in brown.