Skip to main content

๐ŸŽฎ Shortest Path (Practice)

Companion to the Shortest Path Algorithms guide. Implement Dijkstra with a min-heap on a weighted graph. Edit and run the code right here โ€” it executes in your browser.

๐Ÿ Your turnโ€‹

Loading editorโ€ฆ

๐Ÿง  Challenge yourselfโ€‹

  1. Reconstruct the actual path, not just distances.
  2. Why does Dijkstra fail with negative edges? (try Bellman-Ford)
  3. Add a heuristic to turn this into A*.

Continue the learning path โ†’ Union Find