Dijkstra's algorithm: Difference between revisions - Wikipedia
Article Images
Content deleted Content added
m |
|||
Line 187: ===Specialized variants=== When arc weights are integers and bounded by a constant ''C'', the Also, for [[directed acyclic graph]]s, it is possible to find shortest paths from a given starting vertex in linear <math>O(|E|+|V|)</math> time, by processing the vertices in a [[Topological sorting|topological order]], and calculating the path length for each vertex to be the minimum length obtained via any of its incoming edges.<ref>http://www.boost.org/doc/libs/1_44_0/libs/graph/doc/dag_shortest_paths.html</ref><ref>{{harvnb|Cormen|Leiserson|Rivest|Stein|2001|p=655}}</ref> |