Implement Dijkstra's Shortest Path

heap-based shortest paths

Challenge 5 of GraphsAdvanced~60 minFree

Build Dijkstra's shortest-path algorithm from scratch on a weighted graph, the engine behind map routing and lowest-latency network paths. Across five steps you assemble a weighted graph, compute shortest distances with a heap-based priority queue, reconstruct the actual route, expose a clean distance query, and rank the nearest destination.

5 steps

  1. 1Build the weighted graph
  2. 2Shortest distances with Dijkstra
  3. 3Reconstruct the shortest path
  4. 4Numeric distance query
  5. 5Nearest destination
Start step 1