[英]Is finding a simple path in a weighted undirected graph with maximum cost in polynomial time? Is it NP?
I need to know if it is possible to find a simple path with maximum cost in any weighted undirected graph. 我需要知道是否有可能在任何加权无向图中找到一条具有最大成本的简单路径。
I mean to find THE MOST expensive path of all for any pair of vertex. 我的意思是找到任何一对顶点的最昂贵的路径。
Input: Graph G = (V,E) 输入:图G =(V,E)
Output: The cost of the most expensive path in the graph G. 输出:图形G中最昂贵路径的成本。
Is this problem NP-Complete?, I think it is. 我认为是NP-Complete吗? Could you provide any reference to an article where I can review this.
您能否提供对本文的任何参考,以便我可以对此进行审查。
You're not the first to think of this problem. 您不是第一个想到此问题的人。 In fact, it was the first link in the google search results.
实际上,它是google搜索结果中的第一个链接。
edit 编辑
Guys, un-weighted graph is a special case of weighted graph: all edges have weight 1 :) 伙计们,未加权图是加权图的特例:所有边的权重为1 :)
This is similar to traveling salesman, except your heuristic is the Max and not Min. 这类似于旅行推销员,除了您的试探法是最大而不是最小。 Read up on the traveling salesman.
阅读旅行推销员上的内容。
The problem is NP complete because it can be derived from a problem that is already proven to be NP-Complete (Traveling salesman). 该问题是NP完整的,因为它可以源自已经被证明是NP完全(旅行推销员)的问题。 The answer is checkable in polynomial time, but an answer cannot be found in polynomial time.
可以在多项式时间内检查答案,但在多项式时间内找不到答案。
Read http://en.wikipedia.org/wiki/Travelling_salesman_problem 阅读http://en.wikipedia.org/wiki/Travelling_salesman_problem
Yes, this problem is NP because you are asking for the maximum which means that you'll need to go through all possible paths. 是的,这个问题是NP,因为您要索取最大值 ,这意味着您需要走所有可能的路径。 The decision version of this problem ("is there a path of length n ?") is known NP-complete (as noted above).
该问题的决策版本(“是否存在长度为n的路径”)是已知的NP完全(如上所述)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.