Computing Simplified · Chapter 15

A sense of direction

The same weighted grid, the same start and goal, the same shortest route. But A* settles each cell by its cost-so-far plus a guess of the distance still to go. That nudge toward the goal lets it skip most of the map, while Dijkstra, with no sense of direction, fans out in every direction.

Figure 15.4: A* leans toward the goal and touches a fraction of the cells

6
4

Click or drag on the grid to paint terrain or walls (depending on Mode) · drag the S (start) or G (goal) to move them.

A* explored
0
Dijkstra would explore
0
Cells saved
--
Start Goal Explored (settled) Frontier Shortest path Costly terrain (light -> deep) Wall

Interactive companion to Figure 15.4 · Computing Simplified, Chapter 15