Scipy所有最短路径算法

Scipy所有最短路径算法

本文介绍了NetworkX vs Scipy所有最短路径算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NetworkX所有最短路径算法和scipy floyd warshall算法之间有什么区别?有什么理由要优先于另一个吗?哪个最快?

What are the differences between the NetworkX all shortest paths algorithm and the scipy floyd warshall algorithm? Are there any reasons to prefer one over another? Which is fastest?

推荐答案

(对于那些不知道numpy floyd-warshall算法在networkx中可用的人)

(for those who aren't aware the numpy floyd-warshall algorithm is available in networkx)

networkx 对floyd_warshall_numpy的描述表示:

The networkx description of floyd_warshall_numpy states:

networkx single_source_shortest_path在稀疏图上效果更好.您应该意识到,如果使用各种"shortest_path"算法,这些算法将忽略边缘权重.各种Dijkstra算法都结合了边缘权重.

The networkx single_source_shortest_path works better on sparse graphs. You should be aware that if you use the various "shortest_path" algorithms, these ignore edge weights. The various Dijkstra algorithms incorporate edge weights.

此处有更多描述.

There is more description here.

这篇关于NetworkX vs Scipy所有最短路径算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 05:24