A* & Heuristic Search
In short: A* is Dijkstra with one change: instead of ordering the heap by
g (cost so far), it orders by f = g + h, where h is a heuristic guess of
the cost still to go. As long as h never overestimates the true remaining
cost (it is admissible), A* still finds the cheapest route, but expands far
fewer junctions, because junctions pointing away from the goal get a large h
and wait. An overestimating h breaks the guarantee and can return a worse
route.

A driver at the depot, in the north-west corner of town, taps a pickup at the harbour in the south-east, and Meridian's live map has to answer at once. Dijkstra would get it right, but it settles junctions in rings around the start, spending as much effort away from the harbour as towards it. It has no idea where the harbour is.
You do. The harbour is south-east, and on a street grid you can't get there in fewer minutes than the number of blocks between you. A* is Dijkstra with that one piece of knowledge added, and it still guarantees the cheapest route.
One change to Dijkstra
Dijkstra pops the junction with the smallest g, the cost so far. A* pops the junction with the smallest
where h is a heuristic: a guess of the cost still to go from n to the goal. Junctions in the goal's direction get small h and come off the heap first; junctions behind the start get large h and wait, often forever.
The guess has one job, and one rule. It must never overestimate the true
remaining cost. A heuristic like that is called admissible. On Meridian's grid,
every road takes at least as many minutes as the blocks it spans, so the block
distance |x − gx| + |y − gy| is admissible: no real drive can beat it.
Here's A* on the town map, from the depot to the harbour. Each badge shows g + h once a junction has been reached, and the starting badges are just h:
A* orders its frontier by g + h. With a guess that never overshoots, it heads for the goal, expands five of nine junctions, and still finds the cheapest route.
Every junction starts with h, its block distance to the harbour. No road is faster than its blocks, so h never overshoots. 9 nodes, 12 edges, undirected.
The picture's claim is easy to check. Count how many junctions each search pops before it reaches the harbour:
import heapq
pos = {"depot": (0, 0), "mill": (2, 0), "quay": (4, 0), "west": (0, 2), "plaza": (2, 2),
"east": (4, 2), "park": (0, 4), "market": (2, 4), "harbour": (4, 4)}
roads = [("depot", "mill", 2), ("mill", "quay", 3), ("depot", "west", 2), ("mill", "plaza", 2),
("quay", "east", 2), ("west", "plaza", 4), ("plaza", "east", 2), ("west", "park", 3),
("plaza", "market", 3), ("east", "harbour", 2), ("park", "market", 2), ("market", "harbour", 2)]
graph = {n: [] for n in pos}
for a, b, m in roads:
graph[a].append((b, m))
graph[b].append((a, m))
def expanded(weight):
h = lambda n: weight * (abs(pos[n][0] - 4) + abs(pos[n][1] - 4))
best, heap, done = {"depot": 0}, [(h("depot"), "depot")], []
while heap:
f, n = heapq.heappop(heap)
if n in done:
continue
done.append(n)
if n == "harbour":
return len(done)
for m, w in graph[n]:
if best[n] + w < best.get(m, 99):
best[m] = best[n] + w
heapq.heappush(heap, (best[m] + h(m), m))
print(expanded(1), expanded(0))