计算对向环上的发散路径
我需要计算下图中从 A 到 B 的两条路径,限制路径不能共享任何边:
嗯,好吧,不能发布图像,这里有一个 链接。
所有边都有正权重;对于这个例子,我认为我们可以假设它们是相等的。我的简单方法是使用 Djikstra 算法来计算第一条路径,如上图中的第二张图所示。
然后我从图中删除边缘并尝试计算第二条路径,但失败了。是否有 Djikstra、Bellman-Ford(或其他)的变体可以计算上面第三张图中所示的路径? (没有特殊知识并删除对向链接,这就是我的意思)
I need to calculate two paths from A to B in the following graph, with the constraint that the paths can't share any edges:
hmm, okay, can't post images, here's a link.
All edges have positive weights; for this example I think we can assume that they're equal. My naive approach is to use Djikstra's algorithm to calculate the first path, shown in the second graph in the above image.
Then I remove the edges from the graph and try to calculate the second path, which fails. Is there a variation of Djikstra, Bellman-Ford (or anything else) that will calculate the paths shown in the third diagram above? (Without special knowledge and removal of the subtending link, is what I mean)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的是边不相交的路径。门格尔定理将为您提供边不相交路径的最大数量。要找到最短对,请查看边不相交最短对算法:
What you are looking for is edge-disjoint paths. Menger's Theorem will give you the maximum number of edge-disjoint paths. To find the shortest pair, take a look at the Edge disjoint shortest pair algorithm: