Can a problem be in NP but not NP-Complete or P? - complexity-theory

I am looking at the graphs in:
https://en.wikipedia.org/wiki/P_versus_NP_problem
It seems like, there is gap between P and NP-complete. So are there a class of problems that are in NP but neither in P or NP-Complete.
In other words, do the classes P, NP-complete completely cover NP?
And if so, an example is appreciated.

If P = NP, the answer to your question is that all problems in NP are both in P and in NP-Complete.
If P != NP, the answer to your question is that there are problems known to be in NP, which are known not to be NP-complete but for which no polynomial-time algorithm is yet known. I say there is none yet known because if you knew (1) the problem is in NP and (2) the problem is not in P, well then you'd know P != NP, which we don't.

Related

Does Reducing P or NP instance to NP-Complete make that instance also NP-Hard?

If a Problem X lying in P or NP can be reduced to NP-Complete, is that problem X automatically an NP-Hard problem?
Quick reply: No, it does not.
Recall the definition of NP-hard problems.
A problem X is NP-Hard if every problem in NP can be polynomially
reduced to X.
If on the other hand a problem X can be polynomially reduced to some NP-complete problem Y, it means that Y is at least as hard as X, not the other way around.
Finally, if an NP-complete problem Z can be polynomially reduced to X, then indeed X is NP-hard as every problem W in NP can be reduced to Z and by combining the two reductions we can reduce W to X, so the definition is satisfied.
Q: If a Problem X lying in P or NP can be reduced to NP-Complete, is that problem X automatically an NP-Hard problem?
A: No
Q: If a Problem X lying in P or NP is such that an NP-Complete problem can be reduced to it, is that problem X automatically an NP-Hard problem?
A: Yes

Is the NO-VERTEX-COVER in NP or not?

This is the reverse version of vertex cover problem. Consider a decision problem that asks whether, given a graph G = (V, E) and a nonnegative integer k, there does not exist a vertex cover of size no larger than k. Answer whether this problem is NP or not ? Please explain to me.
A short answer would be no (unless co-NP=NP).
Your decision problem, NO-VERTEX-COVER, is exactly the complement of the well-known VERTEX-COVER problem; the latter problem is NP-complete (and is, of course, in NP). Your problem NO-VERTEX-COVER is thus in co-NP. (Recall that a problem is in co-NP if and only if its complement is in NP.)
Because VERTEX-COVER, the complement of you problem, is NP-complete, it follows that unless co-NP=NP, the NO-VERTEX-COVER problem is not in NP. (This follows from a theorem that says that if co-NP is not equal to NP then no NP-complete problem is in co-NP.)

Why is TSP NP-hard while the Hamiltonian path NP-complete?

Why aren't these 2 problems, namely TSP and Hamiltonian path problem, both NP-complete?
They seem identical.
For a problem X to be NP-complete, it has to satisfy:
X is in NP, given a solution to X, the solution can be verified in polynomial time.
X is in NP-hard, that is, every NP problem is reduceable to it in polynomial time (you can do this through a reduction from a known NP-hard problem (e.g. Hamiltonian Path)).
There are two versions of the The Travelling Salesman Problem (TSP):
The optimization version (probably the one you are looking at), namely, find the optimum solution to the TSP. This is not a decision problem, and hence cannot be in NP, but it is however in NP-hard which can be proven via a Hamiltonian Path reduction. Therefore this isn't an NP complete problem.
The decision version - given an integer K is there a path through every vertex in the graph of length < K? This is a decision (yes/no) problem, and a solution can be verified in polynomial time (just traverse the path and see if it touches every vertex) and so it is in NP, but it is also in NP-hard (by an identical proof as above). Since it satisfies both requirements for NP-completeness, it is an NP-complete problem.
The definitions of NP-hardness and NP-completeness are related but different. Specifically, a problem is NP-hard if every problem in NP reduces to it in polynomial time, and a problem is NP-complete if it's both NP-hard and itself in NP.
The class NP consists of decision problems, problems that have a yes/no answer. As a result, TSP cannot be in NP because the expected answer is a number rather than yes or no. Therefore, TSP can be NP-hard, but it can't be NP-complete.
On the other hand, the Hamiltonian path problem asks for a yes/no answer, and it happens to be in NP. Therefore, since it's NP-hard as well, it's NP-complete.
Now, you can take TSP and convert it to a decision problem by changing the question from "what's the cheapest path?" to "is there a path that costs X or less?," and that latter formulation is in NP and also happens to be NP-complete.

How can some NP-Complete problems be also NP-Hard?

I'm trying wrap my heard around P, NP, NP-Complete and NP-Hard in an intuitive way so that I don't have to remember their definitions.
In the following image (the left hand scenario, P != NP), there's an overlapping area between NP-Complete and NP-Hard. Does it mean that some problems are both NP-Complete and NP-Hard? I find that contradictory, according to this particular answer: What are the differences between NP, NP-Complete and NP-Hard?.
The table in the above link says an NP-Complete problem is verifiable in polynomial time and an NP-Hard problem is not. So how can there be an overlap?
Part of the definition of NP-completeness is being NP hard. Therefore, every NP-complete problem is NP-hard. This is also reflected by both of your graphs.
The table you linked to was wrong until I fixed it a few hours ago. NP-Complete problems are a subset of NP problems, and all NP problems are verifiable in polynomial time by definition. NP-hard problems are those problems which are at least as hard as any other NP problem (which is sort of unintuitive, because problems not in NP can be NP-hard).
To be NP-Complete a problem must be
in NP
NP-hard
to be complete in a specific complexity class, a problem must be
in that complexity class
at least as hard as any other problem in that complexity class
We have to define "at least as hard". Suppose we have a problem A in NP. To prove it is NP-hard (and therefore NP-Complete), we show that all problems in NP can be converted to A in polynomial time. Because A takes at least polynomial time to solve, and polynomials are closed under addition, the conversion is now negligible, and the runtime is the same as the runtime of A (in terms of it being polynomial or not).
Once you have one NP-Complete problem, you can prove a problem A in NP is NP-hard (and therefore NP-Complete) by taking another NP-Complete problem B and converting it to A in polynomial time.
I hope this makes it clear that NP-Complete is a subset of NP-hard (and that the table you linked to was wrong).

How is TSP NP-Hard?

I read the following in one of the answer on SO :
The Traveling Salesman Problem, as normally posed, is to find the cheapest route connecting all cities. That isn't a decision problem, and we can't verify any proposed solution directly. We can restate it as a decision problem: given a cost C, is there a route that's cheaper than C? This problem is NP-complete, and with a little work we can solve the original TSP about as easily as the modified, NP-complete, form. Therefore, the TSP is NP-hard, since it's at least as hard as an NP-complete problem.
I understand that a TSP is NP-Complete but how the problem is NP-Hard ? I read that problems that are in NP but not in P are NP-Hard. I cannot relate this thing to the TSP . Please explain this.
NP-Hard problems are those problems for which every problem in NP has a polynomial time (Cook or Karp, multiple definitions) reduction to. These could contain problems which are not in NP and in fact need not even contain decideable problems (like the Halting problem).
NP-Complete problems are those problems in NP which are also NP-Hard.
If P is not equal to NP, then there are infinitely many problems in NP which are neither in P, nor NP-Complete (Ladner's theorem).
The optimization version of TSP problem has been shown NP-hard, but yet known whether it's in NP or not since there is yet known verification algorithms.
The decision version of the TSP problem has been shown NP-complete (both in-NP and NP-hard).

Resources