Expand description
Dijkstra’s shortest path algorithm
Finds shortest paths from a source node to all other nodes in a graph with non-negative edge weights.
Time complexity: O((V + E) log V) using a binary heap.
Functions§
- dijkstra
- Run Dijkstra’s algorithm from a source node
- dijkstra_
with_ paths - Find shortest paths from source to all nodes, returning predecessors
- reconstruct_
path - Reconstruct path from predecessors map
- shortest_
path - Find shortest path between two nodes, returning the full node sequence.