词条 | 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. 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 of the segment. DefinitionThe shortest path problem can be defined for graphs whether undirected, directed, or mixed. It is defined here for undirected graphs; for directed graphs the definition of path requires that consecutive vertices be connected by an appropriate directed edge. Two vertices are adjacent when they are both incident to a common edge. A path in an undirected graph is a sequence of vertices such that is adjacent to for . Such a path is called a path of length from to . (The are variables; their numbering here relates to their position in the sequence and needs not to relate to any canonical labeling of the vertices.) Let be the edge incident to both and . Given a real-valued weight function , and an undirected (simple) graph , the shortest path from to is the path (where and ) that over all possible minimizes the sum When each edge in the graph has unit weight or , this is equivalent to finding the path with fewest edges. The problem is also sometimes called the single-pair shortest path problem, to distinguish it from the following variations:
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. AlgorithmsThe most important algorithms for solving this problem are:
Additional algorithms and associated evaluations may be found in {{harvtxt|Cherkassky|Goldberg|Radzik|1996}}. Single-source shortest pathsUndirected graphs
Unweighted graphs
Directed acyclic graphs (DAGs)An algorithm using topological sorting can solve the single-source shortest path problem in linear time, {{math|Θ(E + V)}}, in weighted DAGs. Directed graphs with nonnegative weightsThe following table is taken from {{harvtxt|Schrijver|2004}}, with some corrections and additions. 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.
Directed graphs with arbitrary weights without negative cycles
Planar directed graphs with arbitrary weightsAll-pairs shortest pathsThe all-pairs shortest path problem finds the shortest paths between every pair of vertices {{mvar|v}}, {{mvar|v'}} in the graph. The all-pairs shortest paths problem for unweighted directed graphs was introduced by {{harvtxt|Shimbel|1953}}, who observed that it could be solved by a linear number of matrix multiplications that takes a total time of {{math|O(V4)}}. Undirected graph
Directed graph
ApplicationsShortest 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.[1] 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 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. 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. For example, the algorithm may seek the shortest (min-delay) widest path, or widest shortest (min-delay) 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, often studied in operations research, include plant and facility layout, robotics, transportation, and VLSI design.[2] Road networksA road network can be considered as a graph with positive weights. The nodes represent road junctions and each edge of the graph is associated with a road segment between two junctions. 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. Using directed edges it is also possible to model one-way streets. Such graphs are special in the sense that some edges are more important than others for long distance travel (e.g. highways). This property has been formalized using the notion of highway dimension.[3] 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. All of these algorithms work in two phases. In the first phase, the graph is preprocessed without knowing the source or target node. The second phase is the query phase. In this phase, source and target node are known.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. 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 USA in a fraction of a microsecond.[4] Other techniques that have been used are:
Related problemsFor 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, the travelling salesman problem is NP-complete and, as such, is believed not to be efficiently solvable for large sets of data (see P = NP problem). The problem of finding the longest path in a graph is also NP-complete. 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 [5] is a representation of the primitive path network within the framework of Reptation theory. The widest path problem seeks a path so that the minimum label of any edge is as large as possible. Strategic shortest-paths{{unreferenced section|date=December 2015}}Sometimes, the edges in a graph have personalities: each edge has its own selfish interest. An example is a communication network, in which each edge is a computer that possibly belongs to a different person. 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. Our goal is to send a message between two points in the network in the shortest time possible. If we know the transmission-time of each computer (the weight of each edge), then we can use a standard shortest-paths algorithm. If we do not know the transmission times, then we have to ask each computer to tell us its transmission-time. 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. 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. Linear programming formulationThere is a natural linear programming formulation for the shortest path problem, given below. It is very simple 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 wij for each edge (i, j) in A, consider the program with variables xij minimize subject to and for all i, The intuition behind this is that is an indicator variable for whether edge (i, j) is part of the shortest path: 1 when it is, and 0 if it is not. We wish to select the set of edges with minimal weight, subject to the constraint that this set forms a path from s to t (represented by the equality constraint: for all vertices except s and t the number of incoming and outcoming edges that are part of the path must be the same (i.e., that it should be a path from s to t). This LP 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 s-t dipath. See Ahuja et al.[6] for one proof, although the origin of this approach dates back to mid-20th century. The dual for this linear program is maximize yt − ys subject to for all ij, yj − yi ≤ wij and feasible duals correspond to the concept of a consistent heuristic for the A* algorithm for shortest paths. For any feasible dual y the reduced costs are nonnegative and A* essentially runs Dijkstra's algorithm on these reduced costs. General algebraic framework on semirings: the algebraic path problem{{expand section|date=August 2014}}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. The general approach to these is to consider the two operations to be those of a semiring. Semiring multiplication is done along the path, and the addition is between paths. This general framework is known as the algebraic path problem.[7][8][9] Most of the classic shortest-path algorithms (and new ones) can be formulated as solving linear systems over such algebraic structures.[10] 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.[11] Shortest path in stochastic time-dependent networksIn real-life situations, the transportation network is usually stochastic and time-dependent. In fact, a traveler traversing a link daily may experiences different travel times on that link due not only to the fluctuations in travel demand (origin-destination matrix) but also due to such incidents as work zones, bad weather conditions, accidents and vehicle breakdowns. As a result, a stochastic time-dependent (STD) network is a more realistic representation of an actual road network compared with the deterministic one.[12][13] Despite considerable progress during the course of the past decade, it remains a controversial question how an optimal path should be defined and identified in stochastic road networks. In other words, there is no unique definition of an optimal path under uncertainty. One possible and common answer to this question is to find a path with the minimum expected travel time. The main advantage of using this approach is that efficient shortest path algorithms introduced for the deterministic networks can be readily employed to identify the path with the minimum expected travel time in a stochastic network. However, the resulting optimal path identified by this approach may not be reliable, because this approach fails to address travel time variability. To tackle this issue some researchers use distribution of travel time instead of expected value of it so they find the probability distribution of total travelling time using different optimization methods such as dynamic programming and Dijkstra's algorithm .[14] These methods use stochastic optimization, specifically stochastic dynamic programming to find the shortest path in networks with probabilistic arc length.[15] It should be noted that the concept of travel time reliability is used interchangeably with travel time variability in the transportation research literature, so that, in general, one can say that the higher the variability in travel time, the lower the reliability would be, and vice versa. In order to account for travel time reliability more accurately, two common alternative definitions for an optimal path under uncertainty have been suggested. Some have introduced the concept of the most reliable path, aiming to maximize the probability of arriving on time or earlier than a given travel time budget. Others, alternatively, have put forward the concept of an α-reliable path based on which they intended to minimize the travel time budget required to ensure a pre-specified on-time arrival probability. See also
ReferencesNotes1. ^{{Cite journal|title=Fast route planning|first=Peter|last=Sanders|authorlink=Peter Sanders (computer scientist)|publisher=Google Tech Talk|date=March 23, 2009|url=https://www.youtube.com/watch?v=-0ErpE8tQbw|ref=harv}} 2. ^{{cite journal |doi=10.1145/242224.242246 |title=Developing algorithms and software for geometric path planning problems |date=December 1996 |first=Danny Z. |last=Chen |journal=ACM Computing Surveys |volume=28 |issue=4es |at=Article 18 |ref=harv}} 3. ^Abraham, Ittai; Fiat, Amos; Goldberg, Andrew V.; Werneck, Renato F. "Highway Dimension, Shortest Paths, and Provably Efficient Algorithms". ACM-SIAM Symposium on Discrete Algorithms, pages 782–793, 2010. 4. ^Abraham, Ittai; Delling, Daniel; Goldberg, Andrew V.; Werneck, Renato F. research.microsoft.com/pubs/142356/HL-TR.pdf "A Hub-Based Labeling Algorithm for Shortest Paths on Road Networks". Symposium on Experimental Algorithms, pages 230–241, 2011. 5. ^{{cite journal |doi=10.1016/j.cpc.2005.01.020 |title=Shortest multiple disconnected path for the analysis of entanglements in two- and three-dimensional polymeric systems |year=2005 |first=Martin |last=Kroger |journal=Computer Physics Communications |volume=168 |issue=3 |pages=209–232 |ref=harv|bibcode=2005CoPhC.168..209K }} 6. ^{{cite book |first=Ravindra K. |last=Ahuja |author1-link=Ravindra K. Ahuja |first2=Thomas L. |last2=Magnanti |author2-link=Thomas L. Magnanti |first3=James B. |last3=Orlin |author3-link=James B. Orlin | title= Network Flows: Theory, Algorithms and Applications | publisher=Prentice Hall | year=1993 | isbn=978-0-13-617549-0 }} 7. ^{{citation |first = Claude | last = Pair| chapter = Sur des algorithmes pour des problèmes de cheminement dans les graphes finis (On algorithms for path problems in finite graphs)| title = Théorie des graphes (journées internationales d'études) -- Theory of Graphs (international symposium)| publisher = Dunod (Paris) et Gordon and Breach (New York)| date = 1967| location = Rome (Italy), July 1966| page = 271| editor = Rosentiehl}} 8. ^ {{citation| first1 = Jean Claude | last1 = Derniame| first2 = Claude | last2 = Pair| title = Problèmes de cheminement dans les graphes (Path Problems in Graphs)| publisher = Dunod (Paris)| year = 1971}} 9. ^{{cite book |first1=John |last1=Baras |first2=George |last2=Theodorakopoulos |title=Path Problems in Networks|url=https://books.google.com/books?id=fZJeAQAAQBAJ&pg=PA9|date=4 April 2010|publisher=Morgan & Claypool Publishers|isbn=978-1-59829-924-3|pages=9–}} 10. ^{{cite book |first1=Michel |last1=Gondran |first2=Michel |last2=Minoux |title=Graphs, Dioids and Semirings: New Models and Algorithms|year=2008|publisher=Springer Science & Business Media|isbn=978-0-387-75450-5|at=chapter 4}} 11. ^{{cite book |first1=Marc |last1=Pouly |first2=Jürg |last2=Kohlas |title=Generic Inference: A Unifying Theory for Automated Reasoning|year=2011|publisher=John Wiley & Sons|isbn=978-1-118-01086-0|at=Chapter 6. Valuation Algebras for Path Problems}} 12. ^Loui, R.P., 1983. Optimal paths in graphs with stochastic or multidimensional weights. Communications of the ACM, 26(9), pp.670-676. 13. ^{{cite journal |last1=Rajabi-Bahaabadi |first1=Mojtaba |first2=Afshin |last2=Shariat-Mohaymany |first3=Mohsen |last3=Babaei |first4=Chang Wook |last4=Ahn |title=Multi-objective path finding in stochastic time-dependent road networks using non-dominated sorting genetic algorithm |journal=Expert Systems with Applications |date=2015 |volume=42 |issue=12|pages=5056–5064 |doi=10.1016/j.eswa.2015.02.046 }} 14. ^{{cite journal |last1=Olya |first1=Mohammad Hessam |title=Finding shortest path in a combined exponential – gamma probability distribution arc length |journal=International Journal of Operational Research |date=2014 |volume=21 |issue=1|pages=25–37 |doi=10.1504/IJOR.2014.064020 }} 15. ^{{cite journal |last1=Olya |first1=Mohammad Hessam |title=Applying Dijkstra's algorithm for general shortest path problem with normal probability distribution arc length |journal=International Journal of Operational Research |date=2014 |volume=21 |issue=2|pages=143–154 |doi=10.1504/IJOR.2014.064541 }} Bibliography{{refbegin}}
| first1 = Jean Claude | last1 = Derniame | first2 = Claude | last2 = Pair | title = Problèmes de cheminement dans les graphes (Path Problems in Graphs) | publisher = Dunod (Paris) | year = 1971 }}
| last = Gabow | first = H. N. | contribution = Scaling algorithms for network problems | doi = 10.1109/SFCS.1983.68 | pages = 248–258 | title = Proceedings of the 24th Annual Symposium on Foundations of Computer Science (FOCS 1983) | year = 1983 | ref = harv| url = http://www.eecs.umich.edu/%7Epettie/matching/Gabow-scaling-algorithms-for-network-problems.pdf
| last = Gabow | first = Harold N. | year = 1985 | title = Scaling algorithms for network problems | journal = Journal of Computer and System Sciences | volume = 31 | issue = 2 | pages = 148–168 | doi = 10.1016/0022-0000(85)90039-X | mr = 828519 | ref = harv}}
| last = Johnson | first = Donald B. | authorlink = Donald B. Johnson | title = Efficient algorithms for shortest paths in sparse networks | journal = Journal of the ACM | volume = 24 | issue = 1 | pages = 1–13 | year = 1977 | doi=10.1145/321992.321993}}
| last = Johnson | first = Donald B. | date = December 1981 | title = A priority queue in which initialization and queue operations take {{math|O(log log D)}} time | journal = Mathematical Systems Theory | volume = 15 | issue = 1 | pages = 295–309 | doi = 10.1007/BF01786986 | mr = 683047 | ref = harv| authorlink = Donald B. Johnson
| last2 = Poblete | first2 = Patricio V. | year = 1983 | title = An {{math|O(m log log D)}} algorithm for shortest paths | journal = Discrete Applied Mathematics | volume = 6 | issue = 1 | pages = 91–93 | doi = 10.1016/0166-218X(83)90104-X | mr = 700028 | ref = harv| last1 = Karlsson | first1 = Rolf G.
Further reading
4 : Network theory|Polynomial-time problems|Computational problems in graph theory|Edsger W. Dijkstra |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。