I have gone through all the links regarding this topic but still confused that why do we consider NP Complete to be NP. Is it only that we can verify it in polynomial time that we say that NP complete problems are NP, but we have some NP problems which can be solved in polynomial time as well but NP complete problems can't be solved in polynomial time so then doesn't this contradict the property of calling NP complete problems to be NP?
-
2"I have gone through all the links regarding this topic" - all of them? I doubt any man can do that... – Karoly Horvath Jul 14 '15 at 10:49
-
1`NP` simply means the answer is verifiable in polynomial time. `NP-Complete` means it is verifiable in polynomial time but a solution can't be found in polynomial time. This is in contrast with `P`, which is stuff that can both be solved and verified in polynomial time. If `P=NP` though (and that's as big an if as they come), that means `NP-Complete` is an empty set. (Or to be more precise it would mean that `NP-Complete` is the same set as `P`.) – biziclop Jul 14 '15 at 10:50
-
1I'm voting to close this question as off-topic because this is a very high level math question and belongs on http://mathoverflow.net/ – Aron Jul 14 '15 at 10:54
-
@Aron It's more computer science than maths. – biziclop Jul 14 '15 at 10:54
-
1@biziclop No it is not. NP complete has a VERY VERY specific meaning. What you described is NP-HARD which is a subset of NP-Complete. You forget how completely anal retentive maths is. – Aron Jul 14 '15 at 10:57
-
@Aron No, NP-HARD is a **superset** of NP-COMPLETE. Hard problems need not be in `NP` at all. [This](https://en.wikipedia.org/wiki/NP-hard#/media/File:P_np_np-complete_np-hard.svg) is a good representation of them all. – biziclop Jul 14 '15 at 11:02
-
3@biziclop `....that means NP-Complete is an empty set. (Or to be more precise it would mean that NP-Complete is the same set as P.) ` these are self contradicting:( [The later is correct, it will mean `NPC=NP=CO-NP=P != {}`] – amit Jul 14 '15 at 11:16
-
3To make answer short: NPC problem is in NP, because definition of NPC requires (1) being NP-Hard (2) being in NP. So it's true simply by definition. – amit Jul 14 '15 at 11:17
-
@Aron Do you thing it's research level math question? I don't think so either, so it's off topic for MO, as well as for CS-Theory. It would be fit for CS.SE though, but that's really a question that can be answered in a comment, "By definition". – amit Jul 14 '15 at 11:22
-
To my understanding, per definition an `NP`-complete problem is required to be contained in `NP`. – Codor Jul 14 '15 at 11:23
-
1@Aron: What biziclop described as NP-complete isn't the definition of NP-hard *either* ;) Although ít's true that no one (yet?) knows of a poly-time algorithm for an NP-hard algorithm, the *definition* of NP-hardness is that *a problem X is NP-hard iff every instance of every problem in NP can be converted in poly-time to a corresponding single instance of X whose solution gives the correct answer to the original problem*. – j_random_hacker Jul 14 '15 at 12:11
1 Answers
There's the set P of decision problems that can be solved by a deterministic Turing machine in polynomial time.
Then there's the set NP of decision problems that can be solved by a non-deterministic Turing machine in polynomial time, i.e. those whose solution can be verified in polynomial time given some witness string.
A deterministic Turing machine can simulate a non-deterministic one, so we know that there is an exponential-time algorithm to solve NP problems. We don't know however whether we don't in fact have P = NP.
An NP-complete problem is an NP problem that is at least as hard as any other NP problem. For example, SAT is NP-complete because it can effectively encode a non-deterministic Turing machine and solving SAT means simulating that machine. You can show NP-completeness of a problem decision problem A by demonstrating that a previously known to be NP-complete problem B can be reduced to A in polynomial time. This means that if A can be solved in polynomial time, B can be solved in polynomial time too, thus in a sense A is at least as hard as B.
but we have some NP problems which can be solved in polynomial time as well
Exactly, because P is a subset of NP.
NP complete problems can't be solved in polynomial time
We don't know that for sure.
doesn't this contradict the property of calling NP complete problems to be NP
Not at all. Yes there are problems in NP that we know to be also in P. That doesn't mean that there are no problems in NP that are not in P. But of course we don't know the latter. It could even be the case that every NP-complete problem is in P, in the case P = NP.

- 92,950
- 18
- 194
- 224
-
This (1) not answering the question `Why do we say that NP complete problems are NP?`. (2) Misleading: `You can show NP-completeness of a problem A by demonstrating that a previously known to be NP-complete problem B can be reduced to A in polynomial time`. No, it will show the problem (A) is NP-Hard. – amit Jul 14 '15 at 11:37
-
-
@amit And also I feel like my answer pretty much clears everything up and the last sentence is an explicit answer to the question, although reading the rest of the text should clear up any confusion anyways – Niklas B. Jul 14 '15 at 11:42
-
The answer to the question "Why NPC Problems are in NP" is short and missing from the answer. ["By definition"](https://en.wikipedia.org/wiki/NP-complete#Formal_definition_of_NP-completeness). – amit Jul 14 '15 at 11:43
-
@amit Ok, but you have to read between the lines sometimes. There's a lot of misconception in OP's question which my answer tries to clear up in a comprehensive way. I feel like your TL;DR answer provides zero value in this context, even though it is of course undeniable true – Niklas B. Jul 14 '15 at 11:45
-
This is why I did not post it as an answer, but answering a question that has a single definitive answer, without mentioning it, is missing the point. You can clarify everything as much as you want, but it does not explain the fact "Why NPC is in NP?" It explains why it "could be", or "Why it's not contradicting", but it still does not explain why it IS. – amit Jul 14 '15 at 11:48