Dijkstra and A* Graph Search

Shortest routes found one settled node at a time, with g, h and f updating on the map, and road changes that may or may not move the cheapest route.

Graph search
↺

A Level

How does the search keep the cheapest cost?

g: cost so far
h: estimate
f: g + h

The number on a road is its cost. g is the cost so far. h is a fixed estimate of the cost left to G, never too high. f = g + h.