Shortest path problem

In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. An example is finding the quickest way to get from one location to another on a road map; in this case, the vertices represent locations and the edges represent segments of road and are weighted by the time needed to travel that segment.
There are several variations according to whether the given graph is undirected, directed, or mixed. For undirected graphs, the shortest path problem can be formally defined as follows. Given a weighted graph (that is, a set V of vertices, a set E of edges, and a realvalued weight function f : E → R), and elements v and v' of V, find a path P from v to a v' of V so that
is minimal among all paths connecting v to v' .
The problem is also sometimes called the singlepair shortest path problem, to distinguish it from the following variations:
 The singlesource shortest path problem, in which we have to find shortest paths from a source vertex v to all other vertices in the graph.
 The singledestination shortest path problem, in which we have to find shortest paths from all vertices in the directed graph to a single destination vertex v. This can be reduced to the singlesource shortest path problem by reversing the arcs in the directed graph.
 The allpairs shortest path problem, in which we have to find shortest paths between every pair of vertices v, v' in the graph.
These generalizations have significantly more efficient algorithms than the simplistic approach of running a singlepair shortest path algorithm on all relevant pairs of vertices.
Contents
Algorithms
The most important algorithms for solving this problem are:
 Dijkstra's algorithm solves the singlesource shortest path problems.
 BellmanFord algorithm solves the single source problem if edge weights may be negative.
 A* search algorithm solves for single pair shortest path using heuristics to try to speed up the search.
 FloydWarshall algorithm solves all pairs shortest paths.
 Johnson's algorithm solves all pairs shortest paths, and may be faster than FloydWarshall on sparse graphs.
 Perturbation theory finds (at worst) the locally shortest path.
Additional algorithms and associated evaluations may be found in Cherkassky et al.^{[1]}
Singlesource shortest paths
Directed acyclic graphs
Directed graphs with nonnegative weights
Algorithm Time complexity Author O(V^{4}) Shimbel 1955 O(V^{2}EL) Ford 1956 Bellman–Ford algorithm O(VE) Bellman 1958, Moore 1959 O(V^{2} log V) Dantzig 1958, Dantzig 1960, Minty (cf. Pollack & Wiebenson 1960), Whiting & Hillier 1960 Dijkstra's algorithm O(V^{2}) Leyzorek et al. 1957, Dijkstra 1959 ... ... ... Dijkstra's algorithm with Fibonacci heaps O(E + V log V) Fredman & Tarjan 1984, Fredman & Tarjan 1987 O(E log log L) Johnson 1982, Karlsson & Poblete 1983 Gabow's algorithm O(V log_{E/V} L) Gabow 1983b, Gabow 1985b O(E + V√log L) Ahuja et al. 1990 
This list is incomplete; you can help by expanding it.
Planar directed graphs with nonnegative weights
Directed graphs with arbitrary weights
Planar directed graphs with arbitrary weights
Allpairs shortest paths
Directed graphs with unit weights
Undirected graphs with unit weights
Directed graphs with nonnegative weights
Planar directed graphs with nonnegative weights
Directed graphs with arbitrary weights
Planar directed graphs with arbitrary weights
Applications
Shortest path algorithms are applied to automatically find directions between physical locations, such as driving directions on web mapping websites like Mapquest or Google Maps. For this application fast specialized algorithms are available.^{[2]}
If one represents a nondeterministic abstract machine as a graph where vertices describe states and edges describe possible transitions, shortest path algorithms can be used to find an optimal sequence of choices to reach a certain goal state, or to establish lower bounds on the time needed to reach a given state. For example, if vertices represents the states of a puzzle like a Rubik's Cube and each directed edge corresponds to a single move or turn, shortest path algorithms can be used to find a solution that uses the minimum possible number of moves.
In a networking or telecommunications mindset, this shortest path problem is sometimes called the mindelay path problem and usually tied with a widest path problem. For example, the algorithm may seek the shortest (mindelay) widest path, or widest shortest (mindelay) path.
A more lighthearted application is the games of "six degrees of separation" that try to find the shortest path in graphs like movie stars appearing in the same film.
Other applications include "operations research, plant and facility layout, robotics, transportation, and VLSI design".^{[3]}
Related problems
For shortest path problems in computational geometry, see Euclidean shortest path.
The travelling salesman problem is the problem of finding the shortest path that goes through every vertex exactly once, and returns to the start. Unlike the shortest path problem, which can be solved in polynomial time in graphs without negative cycles (edges with negative weights), the travelling salesman problem is NPcomplete and, as such, is believed not to be efficiently solvable (see P = NP problem). The problem of finding the longest path in a graph is also NPcomplete.
The Canadian traveller problem and the stochastic shortest path problem are generalizations where either the graph isn't completely known to the mover, changes over time, or where actions (traversals) are probabilistic.
The shortest multiple disconnected path ^{[4]} is a representation of the primitive path network within the framework of Reptation theory.
The problems of recalculation of shortest paths arises if some graph transformations (e.g., shrinkage of nodes) are made with a graph.^{[5]}
The widest path problem seeks a path so that the minimum label of any edge is as large as possible.
Linear programming formulation
There is a natural linear programming formulation for the shortest path problem, given below. It is very trivial compared to most other uses of linear programs in discrete optimization, however it illustrates connections to other concepts.
Given a directed graph (V, A) with source node s, target node t, and cost w_{ij} for each arc (i, j) in A, consider the program with variables x_{ij}
 minimize subject to and for all i,
This LP, which is common fodder for operations research courses, has the special property that it is integral; more specifically, every basic optimal solution (when one exists) has all variables equal to 0 or 1, and the set of edges whose variables equal 1 form an consistent heuristic for the A* algorithm for shortest paths. For any feasible dual y the reduced costs w'_{ij} = w_{ij} − y_{j} + y_{i} are nonnegative and A* essentially runs Dijkstra's algorithm on these reduced costs.
See also
References
 ^ Cherkassky, Boris V.; Goldberg, Andrew V.; Radzik, Tomasz (1996). "Shortest paths algorithms: theory and experimental evaluation". Mathematical Programming. Ser. A 73 (2): 129–174. doi:10.1016/00255610(95)000216. MR1392160. http://ftp.cs.stanford.edu/cs/theory/pub/goldberg/spalg.ps.Z.
 ^ Sanders, Peter (March 23, 2009). Fast route planning. Google Tech Talk. http://www.youtube.com/watch?v=0ErpE8tQbw.
 ^ Chen, Danny Z. (December 1996). "Developing algorithms and software for geometric path planning problems". ACM Computing Surveys 28 (4es): 18. doi:10.1145/242224.242246.
 ^ Kroger, Martin (2005). "Shortest multiple disconnected path for the analysis of entanglements in two and threedimensional polymeric systems". Computer Physics Communications 168 (168): 209–232. doi:10.1016/j.cpc.2005.01.020.
 ^ Ladyzhensky Y., Popoff Y. Algorithm to define the shortest paths between all nodes in a graph after compressing of two nodes. Proceedings of Donetsk national technical university, Computing and automation. Vol.107. Donetsk, 2006, p.6875.^{[verification needed]}
 ^ Ravindra K. Ahuja, Thomas L. Magnanti, and James B. Orlin (1993). Network Flows: Theory, Algorithms and Applications. Prentice Hall. ISBN 013617549X.
 Cormen, Thomas H.; Leiserson, Charles E., Rivest, Ronald L., Stein, Clifford (2001) [1990]. "SingleSource Shortest Paths and AllPairs Shortest Paths". Introduction to Algorithms (2nd ed.). MIT Press and McGrawHill. pp. 580–642. ISBN 0262032937.
 D. Frigioni; A. MarchettiSpaccamela and U. Nanni (1998). "Fully dynamic output bounded single source shortest path problem". Proc. 7th Annu. ACMSIAM Symp. Discrete Algorithms. Atlanta, GA. pp. 212221. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.32.9856.
Further reading
 Dijkstra, E. W. (1959). "A note on two problems in connexion with graphs". Numerische Mathematik 1: 269–271. doi:10.1007/BF01386390. http://wwwm3.ma.tum.de/twiki/pub/MN0506/WebHome/dijkstra.pdf.
 Fredman, Michael Lawrence; Tarjan, Robert E. (1984). "Fibonacci heaps and their uses in improved network optimization algorithms". 25th Annual Symposium on Foundations of Computer Science (IEEE): 338–346. doi:10.1109/SFCS.1984.715934. ISBN 081860591X. http://www.computer.org/portal/web/csdl/doi/10.1109/SFCS.1984.715934.
 Fredman, Michael Lawrence; Tarjan, Robert E. (1987). "Fibonacci heaps and their uses in improved network optimization algorithms". Journal of the Association for Computing Machinery 34 (3): 596–615. doi:10.1145/28869.28874. http://portal.acm.org/citation.cfm?id=28874.
 Leyzorek, M.; Gray, R. S.; Johnson, A. A.; Ladew, W. C.; Meaker, Jr., S. R.; Petry, R. M.; Seitz, R. N. (1957). Investigation of Model Techniques — First Annual Report — 6 June 1956 — 1 July 1957 — A Study of Model Techniques for Communication Systems. Cleveland, Ohio: Case Institute of Technology.
 Moore, E.F. (1959). "The shortest path through a maze". Proceedings of an International Symposium on the Theory of Switching (Cambridge, Massachusetts, 2–5 April 1957). Cambridge: Harvard University Press. pp. 285–292.
Categories: Network theory
 Polynomialtime problems
 Graph algorithms
 Computational problems in graph theory
Wikimedia Foundation. 2010.
Look at other dictionaries:
Shortest path tree — A shortest path tree, in graph theory, is a subgraph of a given (possibly weighted) graph constructed so that the distance between a selected root node and all other nodes is minimal. It is a tree because if there are two paths between the root… … Wikipedia
ShortestPath — Unter einem kürzesten Pfad versteht man in der Graphentheorie einen Pfad zwischen zwei Knoten u und v, welcher minimale Länge hat. Haben die Kanten im Graphen alle das gleiche Kantengewicht, so ist der kürzeste Pfad äquivalent zu dem Pfad mit den … Deutsch Wikipedia
Shortest Path — Unter einem kürzesten Pfad versteht man in der Graphentheorie einen Pfad zwischen zwei Knoten u und v, welcher minimale Länge hat. Haben die Kanten im Graphen alle das gleiche Kantengewicht, so ist der kürzeste Pfad äquivalent zu dem Pfad mit den … Deutsch Wikipedia
Longest path problem — In graph theory, the longest path problem is a problem of finding the longest path in a graph. Unlike the shortest path problem, this problem is NP complete which means that the optimal solution cannot be found in polynomial time unless P=NP.The… … Wikipedia
All pairs shortest path — Finding all pairs shortest path consists of finding the shortest distance between every pair of nodes in a possibly directed graph. Various means of doing so are known, and the following list gives a few of the common methods: *Floyd Warshall… … Wikipedia
Open Shortest Path First — (OSPF) is an adaptive routing protocol for Internet Protocol (IP) networks. It uses a link state routing algorithm and falls into the group of interior routing protocols, operating within a single autonomous system (AS). It is defined as OSPF… … Wikipedia
Euclidean shortest path — This problem is studied in computational geometry: given a set of polyhedral obstacles in a Euclidean space, having a total of n vertices;design algorithms for efficient (exact or approximate) calculation of a shortest, obstacle avoiding path… … Wikipedia
Multicast Open Shortest Path First — MOSPF (Multicast open shortest path first) ist die Multicast Erweiterung zu OSPF (open shortest path first). MOSPF ermöglicht das Multicast Routing innerhalb einer OSPF Domain. Hierbei ist aber besonderes Augenmerk auf die Tatsache zu legen, dass … Deutsch Wikipedia
Path (graph theory) — In graph theory, a path in a graph is a sequence of vertices such that from each of its vertices there is an edge to the next vertex in the sequence. The first vertex is called the start vertex and the last vertex is called the end vertex . Both… … Wikipedia
Canadian traveller problem — In computer science and graph theory, the Canadian traveller problem is a generalization of the shortest path problem to graphs where the cost of traversing an edge isn t completely known until reaching it. The problem was introduced by… … Wikipedia