15
$\begingroup$

My lecturer made the statement

Any finite problem cannot be NP-Complete

He was talking about Sudoku's at the time saying something along the lines that for a 8x8 Sudoku there is a finite set of solutions but I can't remember exactly what he said. I wrote down the note that I've quoted but still don't really understand.

Sudoku's are NP complete if I'm not mistaken. The clique problem is also NP-Complete and if I had a 4-Clique problem is this not a finite problem that is NP-Complete?

$\endgroup$
8
  • $\begingroup$ What is 'finite problem'? Google and Wikipedia are not helping. $\endgroup$ Commented Apr 29, 2016 at 13:22
  • 3
    $\begingroup$ @AntonTrunov A problem in which the input has bounded length. $\endgroup$ Commented Apr 29, 2016 at 13:37
  • $\begingroup$ @YuvalFilmus, Isn't that true of all valid Turing machine * input pairs? IIRC one of the symbols is designated the blank symbol and the input initially has a bounded region outside which symbols other than the blank symbol cannot appear. The term "NP complete" usually isn't used in the context of operations on streams which cannot be modeled without relaxing that assumption. $\endgroup$ Commented Apr 29, 2016 at 14:49
  • $\begingroup$ @MikeSamuel When I say bounded length, I mean input of size at most 100. (Or any number other than 100.) $\endgroup$ Commented Apr 29, 2016 at 14:50
  • $\begingroup$ @YuvalFilmus, ok. I'm saying, the term "NP complete" is only used when there are no non-blank symbols on the input or there exists an integer that is the number of symbols between the leftmost non-blank symbol and the rightmost non-blank symbol. 100 would be such an example. $\endgroup$ Commented Apr 29, 2016 at 15:00

4 Answers 4

15
$\begingroup$

If a finite problem is NP-complete then P=NP, since every finite problem has a polynomial time algorithm (even a constant time algorithm).

When we say that Sudoku is NP-complete, we mean that a generalized version of Sudoku played on an $n^2 \times n^2$ board is NP-complete.

Finally, the 4-clique problem, while not a finite problem (the input graph has unbounded size), is an easy problem which has a polynomial time algorithm.

$\endgroup$
5
  • $\begingroup$ So is the 4-clique problem P since it has a polynomial time algorithm? $\endgroup$ Commented Apr 29, 2016 at 13:47
  • 1
    $\begingroup$ @Aceboy1993 Right, that's the definition of P. $\endgroup$ Commented Apr 29, 2016 at 13:48
  • $\begingroup$ But then why is K-clique considered to be in NP-Complete? Does K not just represent a number like 4? $\endgroup$ Commented Apr 29, 2016 at 13:50
  • $\begingroup$ @Aceboy1993 No, $k$ is part of the input. For constant $k$ the problem is in P. $\endgroup$ Commented Apr 29, 2016 at 13:51
  • $\begingroup$ Also, we can prove that Clique is NP-complete. $\endgroup$ Commented Apr 29, 2016 at 13:52
6
$\begingroup$

The statement of your teacher is incorrect or probably you did not hear him correctly. The correct statement is

Any finite language $L$ with $|L| \geq 1$ cannot be NP-Complete unless $P = NP$.

That is because we still don't know (as on year 2016) if $P \neq NP$. Also $|L|>1$ is important because $\emptyset$ (the empty language) can never be NP-complete whether $P=NP$ or $P \neq NP$.

Sudoku or chess in not NP-complete (as Yuval has pointed out), because their input is finite size 9x9 or 8x8 board (I am talking about the decision versions, whether sudoku has a solution or whether chess has a winning strategy). In chess, I am assuming if you repeat a position, it is considered a draw.

$\endgroup$
1
$\begingroup$

Theorem. Any finite language L is in P. Proof. Let M be a Turing machine which has all strings of L on its tape. When given an input it checks whether the input is on its tape. This is O(1) time clearly.

Theorem. If and only if P=NP, then every L in P (including thus all finite languages) are NP-Complete. Proof. Recall that a language is NP-Complete iff there exists a reduction in polynomial time of every NP problem to it. If P=NP, then for any NP problem including NPC problems, there is a polytime algorithm for deciding it. Let A be NP-Complete and L be any language in P. Let x be a satisfiable instance of L.

Algorithm. Solve A in polynomial time. Print x.

QED.

This trivially holds because of the weakness of the reduction.

If you heard right, unless your lecturer has a correct proof that P=/=NP, then he does not know and so cannot be taken to be correct.

Though it seems all that he simply meant was that particular sizes of NP-Complete problems are not NP-Complete, but the whole class as parameterized by n. No instances are NP-Complete themselves. (For eg. in a lecture in Alg Lower Bounds: Fun with Hardness Proofs series, Demaine makes a statement to such an effect.)

$\endgroup$
0
$\begingroup$

Recall: A problem X is NP-complete iff it satisfies two criteria:

a) It is in NP - I.e any guessed solution of X can be verified in polynomial time.

b) It is complete for NP - I.e Every problem Y in NP has a polynomial-time reduction which translates an instance of Y to an instance of X (so that any polynomial-time program which solves X would also solve Y in polynomial-time).

We can agree that a 9x9 Sudoku satisfies (a). It is (b) where things fall down. More generally - Problems (in NP or otherwise) typically have instances of size N for arbitrarily large values of N; certainly this is true for the known problems in NP. A reduction from such a problem to one which has a maximum possible problem size couldn't possibly be a valid instance-to-instance reduction, because the former always has (infinitely) more instances than the latter. That's why Sudoku has to be generalized to NxN matrices before one can consider NP-completeness.

$\endgroup$
2
  • 1
    $\begingroup$ This is not correct. It's perfectly possible to have a valid reduction from a problem with infinitely many instances to a problem with finitely many instances. For example, here is a reduction from SAT to the problem of determining whether a length-1 string is equal to "a": if the SAT instance is satisfiable, map it to the string "a"; otherwise, map it to the string "b". Now, that reduction (probably) isn't computable in polynomial time but it's a perfectly valid reduction. $\endgroup$ Commented Apr 29, 2016 at 21:20
  • $\begingroup$ @DavidRicherby if I recall correctly (has been some time), the fact that the reduction is itself polynomial is an essential part of the definition of "reduction". $\endgroup$
    – AnoE
    Commented Jul 15, 2021 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.