A* search
Find the lowest-cost route to a chosen goal, like a game character planning a route to treasure. The straight-line distance helps decide which routes to explore first.
Explore the lowest combined estimate first. The straight-line estimate is scaled by the lowest price per unit of edge length. Move towns to see how the search order changes.
The heuristic is consistent with the road weights. Scanning candidates takes O(V² + E) time.