简体   繁体   中英

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. You should instead use Edmond's algorithm .

Bellman Ford already works on directed graphs. No need to alter anything.

The links provided should get you started. Google for additional resources if necessary.

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教科书非常好,并且有大部分可用的书。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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