简体   繁体   English

Bellman-ford可以一次迭代完成吗?

[英]is bellman-ford can be done in a single iteration?

Does every graph have an order of the edges such that after running a single iteration of Bellman-Ford algorithm according to this order, every vertex is labeled with it's shortest path to the source ? 每个图是否都具有边的顺序,以便在按照此顺序运行一次Bellman-Ford算法迭代之后,每个顶点都被标记为其到源的最短路径?

i'm quiet sure that the answer is yes, but i can't think of an Algorithm that is able to find the order of edges, thanks =] 我非常确定答案是肯定的,但是我想不出能够找到边缘顺序的算法,谢谢=]

对最短路径树进行拓扑排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM