This paper solves the optimal path cover problem for block graphs or bipartite permutation graph. In the third line of its introduction it's written that optimal path cover problem is NP-Complete and has given reference to "Computer and intractability: a guide to the theory of NP-completeness by David S. Johnson, Michael R. Garey". But I couldn't find its proof in the book. If anyone knows how to prove NP-Completeness of this problem then share your solution.
Optimal path cover problem:
Given a graph G, find a minimum number of
vertex disjoint paths which together cover all the vertices of the
graph.
Considering the obvious decision variant (ie given k, is there a cover with k paths)
OPC(k=1) detects Hamiltonian paths, so clearly it's NP-hard.
It's also in NP because given the paths, checking whether they're disjoint and covering is easy.
Related
I'm aware that the number of k-length walks between two vertices can be found by finding the kth power of the adjacency matrix, but walks include the traversal of a single edge multiple times in the calculation.
EDIT: I only want to count them not compute them, preferably using matrix algebra. I could do a modified DFS, but thats less efficient than matrix math.
In general, there is no known way to accomplish this. One way to see this is that if you pick k to be the number of nodes in the graph, then you are asking for the number of Hamiltonian paths in the graph. However, the question of determining whether a graph contains a Hamiltonian path is a canonical NP-complete problem, and unless P = NP there's no polynomial-time algorithm for it.
Stated differently - the Hamiltonian path problem reduces to your problem in polynomial time. That makes your problem NP-hard, which means there's no known polynomial-time algorithm for it.
We know about NP-Complete and NP-Hard, and NP Class. I want to conclude some tips on following problem, that take from 2008 Mid exam on MIT.
Decision Version of which of the following problem for a connected undirected weighted graph G is NP-Complete?
a) finding maximal matching.
b) finding maximum Hamiltonian cycle
c) finding maximum Eulelrian cycle
d) finding maximum cut
How can categorized these problem in a simple manner for me? i.e. NP or NP-Complete or NP-Hard.
There are poly-time algorithms for computing maximal matchings (e.g., greedy; Edmonds's Blossom algorithm computes a maximum matching in poly-time) and Eulerian cycles. The decision versions trivially belong to NP (P, in fact).
Hamilton cycle and max cut are well-known NP-hard problems. The decision versions are in NP so thus are NP-complete.
We know that the minimum vertex cover is NP complete, which means that it is in the set of problems that can be verified in polynomial time.
As I understand it, the verification process would require the following:
Verify that the solution is a vertex cover at all
Verify that the solution is the smallest possible subset of the source graph that satisfies condition #1
I'm finding it hard to establish that step #2 can be done in polynomial time. Can anyone explain how it is?
The minimum vertex cover is NP-hard. It is only NP-complete if it is restated as a decision problem which can be verified in polynomial time.
The minimum vertex cover problem is the optimization problem of finding a smallest vertex cover in a given graph.
INSTANCE: Graph G
OUTPUT: Smallest number k such that G has a vertex cover of size k.
If the problem is stated as a decision problem, it is called the vertex cover problem:
INSTANCE: Graph G and positive integer k.
QUESTION: Does G have a vertex cover of size at most k?
Restating a problem as a decision problem is a common way to make problems NP-complete. Basically you turn an open-ended problem of the form "find the smallest solution k" into a yes/no question, "for a given k, does a solution exist?"
For example, for the travelling salesman problem, verifying that a proposed solution the shortest path between all cities is NP-hard. But if the problem is restated as only having to find a solution shorter than k total distance for some k, then verifying a solution is easy. You just find the length of the proposed solution and check that it's less than k.
The decision problem formulation can be easily used to solve the general formulation. To find the shortest path all you have to do is ratchet down the value of k until there are no solutions found.
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).
What are the efficient algorithms for finding a vertex tour in a weighted undirected graph with maximum cost if we need to start from a particular vertex?
It's NPC because if you set weights as 1 for all edges, if HC exists it will be your answer, and so In all you can find HC existence from a single source which is NPC by solving this problem so your problem is NPC, but there are some polynomial approximation algorithms.
Since the problem is NP-hard, you are very unlikely to find an efficient algorithm that solves the problem exactly for all possible weighted input graphs.
However, there might be efficient algorithms that are guaranteed to find an answer that is at most a constant times away from the best possible answer, e.g. there might be an efficient algorithm that is guaranteed to find a path that has weight at least 1/2 of the maximum weight path.
If you are interested in searching for such algorithms, you could try Google searches for "weighted hamiltonian path approximation algorithm", which is close to, but not identical to, your problem. It is not the same because Hamiltonian paths are required to include all vertexes. Here is one research paper that might either contain, or have ideas that lead to, an approximation algorithm for your problem:
http://portal.acm.org/citation.cfm?id=139404.139468
"A general approximation technique for constrained forest problems" by Michel X. Goemans and David P. Williams.
Of course, if your graphs are small enough that you can enumerate all possible paths containing your desired vertex "fast enough for your purposes", then you can solve it exactly.