Data structures · Graphs

Dijkstra's algorithm

When roads have lengths, the route with the fewest roads is not always the shortest drive, and a heap finds the real one.