For faster navigation, this Iframe is preloading the Wikiwand page for 最短路问题.

最短路问题

本條目存在以下問題,請協助改善本條目或在討論頁針對議題發表看法。 此條目没有列出任何参考或来源。 (2015年2月15日)維基百科所有的內容都應該可供查證。请协助補充可靠来源改善这篇条目。无法查证的內容可能會因為異議提出而被移除。 此條目可参照英語維基百科相應條目来扩充。 (2020年10月1日)若您熟悉来源语言和主题,请协助参考外语维基百科扩充条目。请勿直接提交机械翻译,也不要翻译不可靠、低品质内容。依版权协议,译文需在编辑摘要注明来源,或于讨论页顶部标记((Translated page))标签。
一个有6个节点和7条边的图

最短路径问题是图论研究中的一个经典算法问题,旨在寻找图(由结点和路径组成的)中两结点之间的最短路径。算法具体的形式包括:

  • 确定起点的最短路径问题 - 也叫单源最短路问题,即已知起始结点,求最短路径的问题。在边权非负时适合使用Dijkstra算法,若边权为负时则适合使用Bellman-ford算法或者SPFA算法
  • 确定终点的最短路径问题 - 与确定起点的问题相反,该问题是已知终结结点,求最短路径的问题。在无向图中该问题与确定起点的问题完全等同,在有向图中该问题等同于把所有路径方向反转的确定起点的问题。
  • 确定起点终点的最短路径问题 - 即已知起点和终点,求两结点之间的最短路径。
  • 全局最短路径问题 - 也叫多源最短路问题,求图中所有的最短路径。适合使用Floyd-Warshall算法

用于解决最短路径问题的算法被称做“最短路径算法”,有时被简称作“路径算法”。最常用的路径算法有:

单源最短路径算法

[编辑]

无向图

[编辑]
权值要求 时间复杂度 作者
+ Dijkstra 1959
+ Johnson 1977 (二叉堆)
+ Fredman & Tarjan 1984 (斐波那契堆)
Thorup 1999 (要求常数时间复杂度的乘法)。

无权图

[编辑]
算法 时间复杂度 作者
广度优先搜索 Konrad Zuse 1945,Moore 1959

有向无环图

[编辑]

使用拓扑排序算法可以在有权值的DAG中以线性时间()求解单源最短路径问题。

无负权的有向图

[编辑]

假设边缘权重均为整数。

算法 时间复杂度 作者
O(V 2EL) Ford 1956
Bellman–Ford 算法 O(VE) Shimbel 1955, Bellman 1958, Moore 1959
O(V 2 log V) Dantzig 1960
Dijkstra's 算法(列表) O(V 2) Leyzorek et al. 1957, Dijkstra 1959, Minty (see Pollack & Wiebenson 1960), Whiting & Hillier 1960
Dijkstra's 算法(二叉堆) O((E + V) log V) Johnson 1977
…… …… ……
Dijkstra's 算法(斐波那契堆) O(E + V log V) Fredman & Tarjan 1984, Fredman & Tarjan 1987
O(E log log L) Johnson 1981, Karlsson & Poblete 1983
Gabow's 算法 O(E logE/V L) Gabow 1983, Gabow 1985
Ahuja et al. 1990
Thorup O(E + V log log V) Thorup 2004


参见

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
最短路问题
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?