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

发布于 2024-10-08 05:09:27 字数 74 浏览 0 评论 0原文

请推荐资源来学习如何使用 Prim 算法在有向图中查找最小生成树,以及如何使用 Bellman-Ford 算法计算有向图中的最短路径。

Please suggest resources to learn how to find a minimal spanning tree in a directed graph using Prim's algorithm, as well as Bellman-Ford algorithm to calculate the shortest path in a directed graph.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柠栀 2024-10-15 05:09:27

从有向图中查找 MST 是一个不同的问题,您不能简单地采用 Prim 的方法。您应该使用Edmond 算法

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.

浅唱ヾ落雨殇 2024-10-15 05:09:27

如果您想要一些算法的实际代码,我最近对这两种算法进行了编码。

这些文件顶部的注释包含从正确性和运行时角度对两种算法的分析,以及我希望他们能够阐明他们的工作方式。

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.

巷子口的你 2024-10-15 05:09:27

alsuwaiyel 教科书在 Google 图书上非常好,并且提供了该书的大部分内容。

The alsuwaiyel textbook on Google Books is very good and has most of the book available.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文