Graph search
↺

A Level

How does a search find the cheapest route?

Choose a blue town with the smallest priority to find a cheapest route from S to G.

priority = g

Road labels are costs. g is travelled cost; h is a fixed optimistic estimate; f = g + h.