Overview
Acyclic Shortest Path takes advantage of the graph's dependency order, making shortest paths simple even with negative edges as long as there are no cycles.
Finds shortest paths in a weighted DAG by relaxing edges in topological order.
Compact metadata for implementation and discovery.
Acyclic Shortest Path takes advantage of the graph's dependency order, making shortest paths simple even with negative edges as long as there are no cycles.
Quick facts
Runtime and memory behavior at a glance.
Best
O(V + E)
Average
O(V + E)
Worst
O(V + E)
Space
O(V)
dist[v] = min(dist[v], dist[u] + weight(u, v))Updates a neighbor distance after its predecessor is processed.
Show distance values propagating once through a topologically ordered graph.
Negative edges are safe here because a DAG cannot contain negative cycles.
What each reference supports for this entry.
Textbook support for Acyclic Shortest Path invariants, recurrences, relaxation rules, or asymptotic analysis.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Acyclic shortest paths relax vertices in topological order instead of using a priority queue.