加权有向图中两个节点之间的距离(Distance between two nodes in weighted directed graph)

编程入门 行业动态 更新时间:2024-10-26 15:29:08
加权有向图中两个节点之间的距离(Distance between two nodes in weighted directed graph)

哪种算法最适合搜索正加权有向图中两个节点之间的最短距离?

我知道dijkstra是一个选项,但它从src计算到所有节点。 与Floyd-Warshall相同。

另外一个问题。 对于作为源和目标的节点,我需要一个距离。

例如:

src - F,dest - F我需要它在这个例子中计算2.45,而不是dijkstra得到的0。 我可以修改dijkstra吗? 我已经实现了这个http://www.vogella.com/tutorials/JavaAlgorithmsDijkstra/article.html

图http://www.math.cornell.edu/~numb3rs/blanco/net_dif.png

which algorithm is most optimized for searching the shortest distance between two nodes in positive weighted directed graph?

I know that dijkstra is an option but it calculates from src to all nodes. Same as Floyd-Warshall.

One additional issue. I would need a distance for a node that is source and destination.

For example:

src - F, dest - F I need it to calculate 2.45 in this example, not 0 as would dijkstra get. Can I modify dijkstra? I've implemented this one http://www.vogella.com/tutorials/JavaAlgorithmsDijkstra/article.html

graph http://www.math.cornell.edu/~numb3rs/blanco/net_dif.png

更多推荐

本文发布于:2023-07-05 08:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1035452.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   图中   距离   两个   Distance

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!