在图中找到一对边不相交的路径,使得每条路径的长度小于给定的常数
我知道如何找到一对长度总和最小的不相交路径(Surballe 算法)。 我还有一个 ILP 公式可以解决以下问题,它概括了我的问题: 给定图 G 中的两个顶点 u 和 v,在 G 中连接 u 和 v 的所有不相交路径对中,找到其中较长路径的最小长度的一对。 (当然,这个问题可以针对多于两条不相交路径的组重新表述)。
有谁知道解决任何这些问题的有效(多项式?)算法(标题中的问题或广义问题?)
谢谢!
I know how to find a pair of disjoint paths with the minimum sum of lengths (Surballe's algorithm).
I also have a formulation of an ILP that solves the following problem, which generalizes my problem:
Given two vertices u and v in a graph G, out of all of the disjoint pairs of paths connecting u and v in G, find a pair with the minimal length of the longer path in the pair.
(Of course, this problem may be reformulated for groups of more than two disjoint paths).
Does anyone have an idea for an efficient (polynomial?) algorithm for solving any of these problems (The problem in the title or the generalized problem?)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是一个 NP 问题,因为我可以将背包问题简化为这个问题,并且根据 这篇文章 knapsack问题是 NP 完全的。确实,背包问题在背包大小的值中有一个伪多项式时间算法,但是它在输入大小方面没有多项式时间算法。
将背包问题简化为您指定的问题:
- 我的背包问题的说明:
1- 假设您有两个背包,尺寸均为 c。
2- 您有 n 个项目,卷为 v1、v2、.. vn。
3-你想把这n件物品全部放进你的背包里。
- 将背包问题简化为您的问题:
1- 制作一个具有 (n + 1) 个顶点的图。
2- 顶点 i 使用两条边连接到顶点 (i + 1)。成本为 vi(体积
第 i 个项目)和一个成本为零的项目。
3-您想要找到从顶点 1 到顶点 (n + 1) 的两条边不相交路径,其上限等于背包大小。
所以如果你能用多项式解决你的问题,那么背包问题就可以用多项式解决,并且你已经证明了 P=NP。 :D
当然,根据上面的描述,您可以在图的边权重中以多项式时间解决您的问题,但它是一种伪多项式时间算法,而不是像 Surballe 算法那样真正的算法。
抱歉英语不好。
I think it's an NP problem, because I could reduce knapsack problem to this and according to this article knapsack problem is NP-complete. indeed knapsack problem has a Pseudo-polynomial time algorithm in the value of the knapsack size, but it has no polynomial time algorithm in the size of the input.
reducing knapsack problem to the problem you specified:
-specification of my knapsack problem:
1- assume you have two knapsacks which both have size c.
2- you have n items, with volumes v1, v2, .. vn.
3- you want to disturb all of these n items into your knapsacks.
-reducing this knapsack problem to your problem:
1- make a graph with (n + 1) vertices.
2- vertex i is connected to the vertex (i + 1) using two edges. one with cost vi (the volume
of i'th item) and one with cost zero.
3- you want to find two edge disjoint path from vertex 1 to vertex (n + 1) with upper bound equal to knapsack size.
so if you could solve your problem in polynomial, the knapsack problem is solved in polynomial and you have proved P=NP. :D
of course according to above description, you may solve your problem in polynomial time in the edge weight of the graph, but it's a Pseudo-polynomial time algorithm, not a real one unlike Surballe's algorithm.
sorry for bad English.