哪种算法最适合搜索正加权有向图中两个节点之间的最短距离?
我知道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
更多推荐
发布评论