Algorithm race · Dijkstra vs A*
expanded — Dijkstra 310 · A* 133 nodes
Both searches grow a frontier outwards from the start and always finish with the shortest route. Dijkstra treats every direction as equally promising, so its frontier swells as a circle; A* adds the straight-line distance still to go, which pulls the frontier towards the target and touches a fraction of the nodes. This is the difference between a naive route search and the pathfinding used in navigation, robotics and games.
right-click · learn & record