1

For k inputs, the complexity of naive algorithm is O(2^k). I understood this one.

What is meant by "the size of the instance to be solved should be polynomial in k". Is it equivalent to the statement "The number of clauses in CNF of the boolean expression is polynomial in k"?

What should be complexity of a hypothetical efficient algorithm to solve decision version of 3CNF? Can it be called efficient if it is polynomial in the number of inputs and number of clauses?

user205035
  • 13
  • 2
  • 1
    Where are you getting those quotes from? Your question indicates some confusion about some basic material in computer science theory: I recommend you study your textbook and our reference questions http://cs.stackexchange.com/q/9556/755 and http://cs.stackexchange.com/q/13669/755. In particular, the first reference question already contains an answer to the questions in the last paragraph of your post. – D.W. Mar 02 '15 at 04:41

1 Answers1

1

An algorithm runs in polynomial time if its running time on an input $x$ is $O(|x|^k)$ for some $k$. Here $x$ is a (without loss of generality, binary) string, and $|x|$ is the length of $x$.

For 3CNF it also makes sense to consider the running time as the number of different variables. This is because if there are $n$ variables then there are $O(n^3)$ different clauses. The hardest 3CNF to solve are those in which no clause appears twice, and for such 3CNF, the size of the 3CNF (as a binary string) is polynomial in $n$. Therefore for such 3CNF, an algorithm is polynomial in the input size iff it is polynomial in the number of variables. An additional easy argument shows that 3CNF can be solved in polynomial time in the input size iff it can be solved in polynomial time in the number of variables.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503