This is an old version, saved 5 Dec 2026, 03:24 by TechWritereditor. See the current version.
Dijkstra's algorithm
Dijkstra's algorithm is a step-by-step method for finding the shortest path between points in a network, such as cities connected by roads, when every link has a length that is zero or positive.[3] It is named after the Dutch computer scientist Edsger W. Dijkstra.[2]
History
Dijkstra devised the algorithm while working at the Mathematisch Centrum in Amsterdam (now CWI), and first used it in 1956 to demonstrate a new computer, the ARMAC, at its official presentation.[2] For the demonstration he chose the problem of finding the shortest route between two Dutch cities on a simplified map.[2] He published it in 1959 in a three-page paper, "A note on two problems in connexion with graphs", in the first volume of the journal Numerische Mathematik.[1] Similar methods were found independently by several other researchers in the late 1950s.[3]
How it works
The algorithm starts from a chosen home node and repeatedly picks the unprocessed node that is currently nearest to it, records that distance as final, and then checks whether going through this node gives a shorter route to its neighbours.[3] Because it always takes the closest remaining node next, it is described as a greedy algorithm.[3] If all distances are non-negative it is guaranteed to give the correct answer; with negative distances it may fail to find the best route.[3] A simple version takes time proportional to the square of the number of nodes, and data structures such as heaps can speed up the selection step.[3]
Uses and legacy
The algorithm is widely taught in computer science and operations research and is used in applications such as online driving directions.[3] In computer networks, the Open Shortest Path First (OSPF) routing protocol used on the Internet has each router build a tree of shortest paths, which the standard states is derived using the Dijkstra algorithm.[4] In 1999 the computer scientist Mikkel Thorup observed that all theoretical developments on the single-source shortest path problem had been based on Dijkstra's algorithm.[2]
See also
References
- ^ A note on two problems in connexion with graphs. Numerische Mathematik (Springer). 1959-12. link.springer.com
- ^ E.W. Dijkstra: brilliant, colourful, and opinionated. CWI. cwi.nl
- ^ Dijkstra's Algorithm revisited: the dynamic programming connexion. University of Melbourne / IFORS. ifors.ms.unimelb.edu.au
- ^ RFC 2328: OSPF Version 2. Internet Engineering Task Force. 1998-04. rfc-editor.org