15

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?

TheRapture87
  • 271
  • 2
  • 4

4 Answers4

15

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.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
6

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.

D.W.
  • 167,959
  • 22
  • 232
  • 500
Sarvottamananda
  • 4,877
  • 1
  • 14
  • 19
1

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

Z_22
  • 11
  • 2
0

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.

PMar
  • 9