encyclopegia.org

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.[src] The problem of finding the shortest path between two intersections on a road map may be modeled as a special case of the shortest path problem in graphs, where the vertices correspond to intersections and the edges correspond to road segments, each weighted by the length or distance of each segment.[src]

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.[src] The problem of finding the shortest path between two intersections on a road map may be modeled as a special case of the shortest path problem in graphs, where the vertices correspond to intersections and the edges correspond to road segments, each weighted by the length or distance of each segment.[src] Two vertices are adjacent when they are both incident to a common edge.[src] A path in an undirected graph is a sequence of vertices P = ( v_1, v_2, \ldots, v_n ) \in V \times V \times \cdots \times V such that v_i is adjacent to v_{i+1} for 1 \leq i .[src] Such a path P is called a path of length n-1 from v_1 to v_n .[src] (The v_i are variables; their numbering relates to their position in the sequence and need not relate to a canonical labeling.) Let E = \{e_{i, j}\} where e_{i, j} is the edge incident to both v_i and v_j .[src] Given a real-valued weight function f: E \rightarrow \mathbb{R} , and an undirected (simple) graph G , the shortest path from v to v' is the path P = ( v_1, v_2, \ldots, v_n ) (where v_1 = v and v_n = v' ) that over all possible n minimizes the sum \sum_{i =1}^{n-1} f(e_{i, i+1}).[src] When each edge in the graph has unit weight or f: E \rightarrow \{1\} , this is equivalent to finding the path with fewest edges.[src] The problem is also sometimes called the single-pair shortest path problem, to distinguish it from the following variations: The single-source shortest path problem, in which we have to find shortest paths from a source vertex v to all other vertices in the graph.[src] The single-destination shortest path problem, in which we have to find shortest paths from all vertices in the directed graph to a single destination vertex v.[src] This can be reduced to the single-source shortest path problem by reversing the arcs in the directed graph.[src] The all-pairs shortest path problem, in which we have to find shortest paths between every pair of vertices v, v' in the graph.[src] These generalizations have significantly more efficient algorithms than the simplistic approach of running a single-pair shortest path algorithm on all relevant pairs of vertices.[src] ==Algorithms== Several well-known algorithms exist for solving this problem and its variants.[src] Dijkstra's algorithm solves the single-source shortest path problem with only non-negative edge weights.[src] Bellman–Ford algorithm solves the single-source problem if edge weights may be negative.[src] A* search algorithm solves for single-pair shortest path using heuristics to try to speed up the search.[src] Floyd–Warshall algorithm solves all pairs shortest paths.[src] Johnson's algorithm solves all pairs shortest paths, and may be faster than Floyd–Warshall on sparse graphs.[src] Viterbi algorithm solves the shortest stochastic path problem with an additional probabilistic weight on each node.[src] Additional algorithms and associated evaluations may be found in .[src] ==Single-source shortest paths== ===Undirected graphs=== ===Unweighted graphs=== ===Directed graphs with nonnegative weights=== The following table is taken from , with some corrections and additions.[src] A green background indicates an asymptotically best bound in the table; L is the maximum length (or weight) among all edges, assuming integer edge weights.[src] ===Directed graphs with arbitrary weights without negative cycles=== ===Directed graphs with arbitrary weights with negative cycles=== Finds a negative cycle or calculates distances to all vertices.[src] ===Planar graphs with nonnegative weights=== ==All-pairs shortest paths== The all-pairs shortest path problem finds the shortest paths between every pair of vertices , in the graph.[src] The all-pairs shortest paths problem for unweighted directed graphs was introduced by , who observed that it could be solved by a linear number of matrix multiplications that takes a total time of .[src] For undirected and unweighted graphs, Dory et al.[src] gives an algorithm computing a 2-approximation for all pairs of vertices in O(n^{2.032}) time.[src] In 2026, Gupta and Shandilya gives a randomized algorithm running in \tilde O(n^2) time that yields a 2-approximation for all pairs whose distance is at least a fixed constant, with high probability.[src] ===Undirected graph=== ===Directed graph=== ==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.[src] For this application fast specialized algorithms are available.[src] 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.[src] For example, if vertices represent 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.[src] In a networking or telecommunications mindset, this shortest path problem is sometimes called the min-delay path problem and usually tied with a widest path problem.[src] For example, the algorithm may seek the shortest (min-delay) widest path, or widest shortest (min-delay) path.[src] Another 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.[src] Other applications, often studied in operations research, include plant and facility layout, robotics, transportation, and VLSI design.[src] ===Road networks=== A road network can be considered as a graph with positive weights.[src] The nodes represent road junctions and each edge of the graph is associated with a road segment between two junctions.[src] The weight of an edge may correspond to the length of the associated road segment, the time needed to traverse the segment, or the cost of traversing the segment.[src] Using directed edges it is also possible to model one-way streets.[src] Such graphs are special in the sense that some edges are more important than others for long-distance travel (e.g.[src] highways).[src] This property has been formalized using the notion of highway dimension.[src] There are a great number of algorithms that exploit this property and are therefore able to compute the shortest path a lot quicker than would be possible on general graphs.[src] All of these algorithms work in two phases.[src] In the first phase, the graph is preprocessed without knowing the source or target node.[src] The second phase is the query phase.[src] In this phase, source and target node are known.[src] The idea is that the road network is static, so the preprocessing phase can be done once and used for a large number of queries on the same road network.[src] The algorithm with the fastest known query time is called hub labeling and is able to compute shortest path on the road networks of Europe or the US in a fraction of a microsecond.[src] Other techniques that have been used are: ALT (A* search, landmarks, and triangle inequality) Arc flags Contraction hierarchies Transit node routing Reach-based pruning Labeling Hub labels ==Related problems== For shortest path problems in computational geometry, see Euclidean shortest path.[src] The shortest multiple disconnected path is a representation of the primitive path network within the framework of Reptation theory.[src] The widest path problem seeks a path so that the minimum label of any edge is as large as possible.[src] Other related problems may be classified into the following categories.[src] ===Paths with constraints=== Unlike the shortest path problem, which can be solved in polynomial time in graphs without negative cycles, shortest path problems which include additional constraints on the desired solution path are called Constrained Shortest Path First, and are harder to solve.[src] One example is the constrained shortest path problem, which attempts to minimize the total cost of the path while at the same time maintaining another metric below a given threshold.[src] This makes the problem NP-complete (such problems are not believed to be efficiently solvable for large sets of data, see P = NP problem).[src] Another NP-complete example requires a specific set of vertices to be included in the path, which makes the problem similar to the Traveling Salesman Problem (TSP).[src] The TSP is the problem of finding the shortest path that goes through every vertex exactly once, and returns to the start.[src] The problem of finding the longest path in a graph is also NP-complete.[src] ===Partial observability=== The Canadian traveller problem and the stochastic shortest path problem are generalizations where either the graph is not completely known to the mover, changes over time, or where actions (traversals) are probabilistic.[src] ===Strategic shortest paths=== Sometimes, the edges in a graph have personalities: each edge has its own selfish interest.[src] An example is a communication network, in which each edge is a computer that possibly belongs to a different person.[src] Different computers have different transmission speeds, so every edge in the network has a numeric weight equal to the number of milliseconds it takes to transmit a message.[src] Our goal is to send a message between two points in the network in the shortest time possible.[src] If we know the transmission-time of each computer (the weight of each edge), then we can use a standard shortest-paths algorithm.[src] If we do not know the transmission times, then we have to ask each computer to tell us its transmission-time.[src] But, the computers may be selfish: a computer might tell us that its transmission time is very long, so that we will not bother it with our messages.[src] A possible solution to this problem is to use a variant of the VCG mechanism, which gives the computers an incentive to reveal their true weights.[src] ==General algebraic framework on semirings: the algebraic path problem== Many problems can be framed as a form of the shortest path for some suitably substituted notions of addition along a path and taking the minimum.[src] The general approach to these is to consider the two operations to be those of a semiring.[src] Semiring multiplication is done along the path, and the addition is between paths.[src] This general framework is known as the algebraic path problem.[src] Most of the classic shortest-path algorithms (and new ones) can be formulated as solving linear systems over such algebraic structures.[src] More recently, an even more general framework for solving these (and much less obviously related problems) has been developed under the banner of valuation algebras .[src] ==Shortest path in stochastic time-dependent networks== In real-life, a transportation network is usually stochastic and time-dependent.[src] The travel duration on a road segment depends on many factors such as the amount of traffic (origin-destination matrix), road work, weather, accidents and vehicle breakdowns.[src] A more realistic model of such a road network is a stochastic time-dependent (STD) network.[src] There is no accepted definition of optimal path under uncertainty (that is, in stochastic road networks).[src] It is a controversial subject, despite considerable progress during the past decade.[src] One common definition is a path with the minimum expected travel time.[src] The main advantage of this approach is that it can make use of efficient shortest path algorithms for deterministic networks.[src] However, the resulting optimal path may not be reliable, because this approach fails to address travel time variability.[src] To tackle this issue, some researchers use travel duration distribution instead of its expected value.[src] So, they find the probability distribution of total travel duration using different optimization methods such as dynamic programming and Dijkstra's algorithm .[src] These methods use stochastic optimization, specifically stochastic dynamic programming to find the shortest path in networks with probabilistic arc length.[src] The terms travel time reliability and travel time variability are used as opposites in the transportation research literature: the higher the variability, the lower the reliability of predictions.[src] To account for variability, researchers have suggested two alternative definitions for an optimal path under uncertainty.[src] The most reliable path is one that maximizes the probability of arriving on time given a travel time budget.[src] An α-reliable path is one that minimizes the travel time budget required to arrive on time with a given probability.[src] In the shared-multi-CSP problem, there can be several source-target pairs (s j ,t j ), for j=1,2,..[src] Here, the goal is to find a path for each source-target pair, with a minimum total cost, subject to the total delay being at most the delay budget.[src] Fractional RSP is a linear programming relaxation of RSP.[src] Handler and Zang introduced it and gave a combinatorial algorithm for solving it (in the case of one resource).[src] Mehlhorn and Ziegelmann proved that, in the case of one resource, the combinatorial algorithm runs in polytime, O(log (n C D)), where n is the number of nodes, the costs are integers in 0..C, and the delays are integers in 0..D.[src] For many resources the runtime of the combinatorial algorithm remains open, but the LP can be solved in weakly polynomial time using the ellipsoid method.[src] ==See also== Bidirectional search – An algorithm that finds the shortest path between two vertices on a directed graph Shortest Path Bridging TRILL (TRansparent Interconnection of Lots of Links) ==References== ===Notes=== ===Bibliography=== Attributes Dijkstra's algorithm to Minty ("private communication") on p. 225.[src] ==Further reading== DTIC AD-661265.[src]

101 sentences · 101 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"shortest path problem." encyclopegia.org, 2026, https://encyclopegia.org/wiki/shortest-path-problem. Accessed 28 November 2026.

Chicago

"shortest path problem." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/shortest-path-problem.

APA

encyclopegia.org. (2026). shortest path problem. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/shortest-path-problem

Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

promise problem

stub · references available

Open Shortest Path First

stub · references available

two emperor problem

stub · references available

On the Path

stub · references available

Cyprus problem

stub · references available

symbol grounding problem

stub · references available

free-space path loss

stub · references available

The Three-Body Problem

stub · references available
CC BY-SA 4.0 · tier1-factual · https://en.wikipedia.org/w/index.php?oldid=1378000804 · 0.55 · snapshot shortest-path-problem-122965-17400d54dd811a56 · QID Q1058754

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.