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

最短路徑樹

此條目已列出參考文獻,但因為沒有文內引註而使來源仍然不明。 (2018年1月5日)请加上合适的文內引註来改善这篇条目
此條目需要补充更多来源。 (2018年1月5日)请协助補充多方面可靠来源改善这篇条目无法查证的内容可能會因為异议提出而被移除。致使用者:请搜索一下条目的标题(来源搜索:"最短路徑樹"网页新闻书籍学术图像),以检查网络上是否存在该主题的更多可靠来源(判定指引)。

最短路径树(shortest-path tree),是一种使用最短路径算法生成的数据结构

定义

[编辑]

考虑一个连通无向图,一个以顶点为根节点的最短路径树是图满足下列条件的生成树——树中从根节点到其它顶点的路径距离,在图中是从的最短路径距离。

在一个所有最短路径都明确(例如没有负长度的环)的连通图中,我们可以使用如下算法构造最短路径树:

  1. 使用戴克斯特拉算法贝尔曼-福特算法计算图 G 中从根节点 v 到 顶点 u 的最短距离
  2. 对于所有的非根顶点,我们可以给分配一个父顶点 连接至u且 。当有多个满足条件时,选择从v到的最短路径中边最少的。当存在零长度环的时候,这条规则可以避免循环。
  3. 用各个顶点和它们的父节点之间的边构造最短最短路径树。

上面的算法保证了最短路径树的存在。像最小生成树一样,最短路径树通常也不是唯一的。

在所有边的权重都相同的时候,最短路径树和广度优先搜索树一致。在存在负长度的环时,从到其它顶点的最短简单路径不一定构成最短路径树。

外部文献

[编辑]

参见

[编辑]
{{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?