简体   繁体   English

有向图中的Prims和Bellman-Ford算法

[英]Prims and Bellman-Ford Algorithms in Directed Graphs

请提供资源,以学习如何使用Prim算法以及Bellman-Ford算法来计算有向图中的最短路径,从而找到有向图中的最小生成树。

Finding an MST from a directed graph is a different problem, for which you cannot simply adapt Prim's. 从有向图中找到一个MST是一个不同的问题,您不能简单地适应Prim的问题。 You should instead use Edmond's algorithm . 您应该改为使用Edmond的算法

Bellman Ford already works on directed graphs. Bellman Ford已经在有向图上工作。 No need to alter anything. 无需更改任何内容。

The links provided should get you started. 提供的链接应该可以帮助您入门。 Google for additional resources if necessary. 如有必要,请向Google查询其他资源。

If you'd like some actual code for the algorithms, I recently coded both of these algorithms up. 如果您想要一些实际的算法代码,我最近将这两种算法都进行了编码。

The comments at the top of these files contains an analysis of the two algorithms both from a correctness and runtime perspective, and I hope they can shed some light on how they work. 这些文件顶部的注释从正确性和运行时的角度分析了这两种算法,我希望它们能为它们的工作方式提供一些启示。

Google图书上的alsuwaiyel教科书非常好,并且有大部分可用的书。

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

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