THE SCIENCE
How this simulation works
A* expands cells using f(n) = g(n) + w·h(n), where g is travelled distance and h is Manhattan-distance heuristic. With heuristic weight at most 1 it is optimal on this uniform grid.
Discover how a shortest-path search explores blocked terrain.
A* expands cells using f(n) = g(n) + w·h(n), where g is travelled distance and h is Manhattan-distance heuristic. With heuristic weight at most 1 it is optimal on this uniform grid.
Increase obstacles, then set heuristic to 0 for Dijkstra-style search. Use Play, Pause and Reset to compare outcomes. All calculations run locally inside your browser.