[英]dijkstra_shortest_paths Boost Graph Lib 1.57.0 fails
[英]Can I use dijkstra_shortest_paths in BGL on "cyclic" directed graph
首先,对不起我的英语:(
我的图表规格是
据我所知,dijsktra 算法找不到“循环”图的最短路径。 但是 BGL 文档中没有这个限制( https://www.boost.org/doc/libs/1_77_0/libs/graph/doc/dijkstra_shortest_paths.html )
所以我想知道我可以通过在 BGL 中使用 dijkstra_shortest_paths 来找到这个图的最短路径。
谢谢。
是的,您实际上可以使用该方法。
对于某些边权重为负的情况,请使用 Bellman-Ford 算法
另见https://cs.stackexchange.com/questions/101637/dijkstra-s-shortest-path-algorithm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.