开发者

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 m开发者_运维百科aximum 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)

Output: The cost of the most expensive path in the graph G.

Is this problem NP-Complete?, I think it is. 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.

edit
Guys, un-weighted graph is a special case of weighted graph: all edges have weight 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). 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


Yes, this problem is NP because you are asking for the maximum which means that you'll need to go through all possible paths. The decision version of this problem ("is there a path of length n?") is known NP-complete (as noted above).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜