# Dijkstra's Shortest Path Algorithm

A Dijkstra's Shortest Path Algorithm is a dynamic programming-based shortest path algorithm that finds the shortest paths to to all locations between nodes in a graph.

**Context:**- It can be implemented by a Dijkstra-based Shortest Path Finding System.
- …

**Example(s):****Counter-Example(s):****See:**Graph Search Algorithm, Best-First Search, Shortest Path Problem, Shortest-Path Tree.

## References

### 2017

- (Wikipedia, 2017) ⇒ https://en.wikipedia.org/wiki/Dijkstra's_algorithm Retrieved:2017-12-5.
**Dijkstra's algorithm**is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later.^{[1]}^{[2]}The algorithm exists in many variants; Dijkstra's original variant found the shortest path between two nodes,but a more common variant fixes a single node as the "source" node and finds shortest paths from the source to all other nodes in the graph, producing a shortest-path tree.

For a given source node in the graph, the algorithm finds the shortest path between that node and every other.

^{[3]}It can also be used for finding the shortest paths from a single node to a single destination node by stopping the algorithm once the shortest path to the destination node has been determined. For example, if the nodes of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. As a result, the shortest path algorithm is widely used in network routing protocols, most notably IS-IS (Intermediate System to Intermediate System) and Open Shortest Path First (OSPF). It is also employed as a subroutine in other algorithms such as Johnson's.Dijkstra's original algorithm does not use a min-priority queue and runs in time [math]\displaystyle{ O(|V|^2) }[/math] (where [math]\displaystyle{ |V| }[/math] is the number of nodes). The idea of this algorithm is also given in . The implementation based on a min-priority queue implemented by a Fibonacci heap and running in [math]\displaystyle{ O((|E|+|V|) \log|V|) }[/math] (where [math]\displaystyle{ |E| }[/math] is the number of edges) is due to .

This is asymptotically the fastest known single-source shortest-path algorithm for arbitrary directed graphs with unbounded non-negative weights. However, specialized cases (such as bounded/integer weights, directed acyclic graphs etc.) can indeed be improved further as detailed in .

In some fields, artificial intelligence in particular, Dijkstra's algorithm or a variant of it is known as

**uninformed-search**and formulated as an instance of the more general idea of best-first search.

- ↑ Frana, Phil (August 2010). "An Interview with Edsger W. Dijkstra". Communications of the ACM. 53 (8): 41–47. doi:10.1145/1787234.1787249
- ↑ Dijkstra, E. W. (1959). "A note on two problems in connexion with graphs" (PDF). Numerische Mathematik. 1: 269–271. doi:10.1007/BF01386390. S2CID 123284777
- ↑ Mehlhorn, Kurt; Sanders, Peter (2008). "Chapter 10. Shortest Paths" (PDF). Algorithms and Data Structures: The Basic Toolbox. Springer. doi:10.1007/978-3-540-77978-0. ISBN 978-3-540-77977-3.

### 1977

- (Knuth, 1977) ⇒ D.E. Knuth (1977). “A Generalization of Dijkstra's Algorithm". In: Information Processing Letters, 6(1). doi:10.1016/0020-0190(77)90002-3

### 1959

- (Dijkstra, 1959) ⇒ E. W. Dijkstra. (1959). “A Note on Two Problems in Connexion with Graphs". In: Numerische Mathematik, 1. doi:10.1007/BF01386390