Overview
Multi-source Dijkstra initializes the priority queue with all source nodes at distance zero, then runs the usual Dijkstra relaxation process to assign each node its closest source distance.
Finds shortest distances from the nearest of several source nodes in a nonnegative-weight graph.
Compact metadata for implementation and discovery.
Multi-source Dijkstra initializes the priority queue with all source nodes at distance zero, then runs the usual Dijkstra relaxation process to assign each node its closest source distance.
Quick facts
Runtime and memory behavior at a glance.
Best
O(E log V)
Average
O(E log V)
Worst
O(E log V)
Space
O(V)
dist[v] = min(dist[v], dist[u] + weight(u, v))Updates a candidate distance when a route through the current node is shorter.
dist[s] = 0 for every source sStarts all source nodes as equally reachable.
Show the frontier, settled nodes, and the final path over the search space.
Multi-source Dijkstra computes nearest-source distance, not a full all-sources distance table.
What each reference supports for this entry.
Textbook support for Multi-Source Dijkstra invariants, recurrences, relaxation rules, or asymptotic analysis.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Multi-source Dijkstra starts with several initial sources.
Flow fields commonly use multi-source distance propagation.