简体   繁体   中英

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)

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM