Find the shortest path from A to H on a random weighted graph. Each step locks in the unvisited node with the lowest tentative cost; the table shows how distances and predecessors update.
Each row shows the state after picking one node. The picked cell is green; previously-visited cells are blue. Cells read cost (predecessor); ∞ means unreachable so far. For A*, the heading also shows h (straight-line distance) for each node and an f = g + h column.