【发布时间】:2016-02-23 16:40:31
【问题描述】:
我有一个有向图,我试图为其找到前 k 个最短路径。目前我已经在图形工具中实现了网络,它提供了最短路径算法,但据我所知没有 k 最短路径算法。我遇到过这篇文章 (All shortest paths using graph_tool),但我毕竟不是连接两个节点的路径。
NetworkX 似乎为此实现了一个功能 (https://networkx.readthedocs.org/en/stable/reference/generated/networkx.algorithms.shortest_paths.generic.all_shortest_paths.html?highlight=all_shortest_paths)。有没有办法在图形工具中以某种方式做到这一点,还是我最好切换工具箱并使用 NetworkX?
【问题讨论】:
标签: python-2.7 graph networkx graph-tool