-1

For example, how is it proven that any NP problem can reduce to subset sum, circuit satisfiability, etc.? Or could you link to a proof?

1 Answers1

1

Every known NP-hard problem (except a small number) was shown to be NP-hard by showing a polynomial reduction from another NP-hard problem. Obviously this wasn't true of the first problem, which was SAT. Apparently there have been a small number of problems which have been shown to be NP-hard after SAT was, but certainly the vast majority were proven by reduction to existing problems.

So how was the first problem shown to be NP-hard? There were two independent proofs for SAT, one by Stephen Cook in 1971 [1] and the other by Leonid Levin in 1973. We now know it as the Cook-Levin theorem. You can read the paper, or consult the Wikipedia article [2] for details, but I'll give a brief outline of the basic idea here.

Let's look at the recogniser problem. There is a language $L$, and a nondeterministic TM $M$ which recognises $L$ in polynomial time. Let $w$ be a string. The idea is to construct a boolean formula $A(w)$ in conjunctive normal form, where the number of formulas and the number of propositions is polynomial in the length of $w$ and the size of $M$ and the size of the alphabet, which is true if $M$ accepts $w$ and false if $M$ rejects $w$.

The proof depends on the fact that $M$ takes polynomial time in the length of the string. Suppose that the maximum number of steps that $M$ can take for a string of length $n$ is $Q(n)$. Then this is also an upper bound on the amount of tape that $M$ can use. We can trivially modify $M$ so that all computations take at least this time. We could, for example, modify $M$ so that it loops forever in an accepting or rejecting state, let it run for $Q(n)$ time and then see which state it was in.

We introduce the following proposition symbols:

  • $P_{i,s,t}$ is true if and only if the tape square $s$ contains symbol $i$ at time step $t$.
  • $Q_{i,t}$ is true if and only if the machine is in state $i$ at time step $t$.
  • $S_{s,t}$ is true if and only if symbol $s$ is scanned by the tape head at time step $t$.

Next, we construct formulas which model the actions of $M$ and test whether or not $w$ is accepted. We can do this using only the above proposition symbols, and in conjunctive normal form.

I encourage you to think through the details yourself by working out what the formulas might look like. The ones that Cook used are:

  • At each time step $t$, one and only one square is scanned.
  • At each time step $t$ and tape square $s$, there is one and only one symbol.
  • At each time step $t$, $M$ is in one and only one state.
  • At time step $1$, $M$ is in its start state and the tape contains exactly $w$ followed by "blank" symbols.
  • At each time step transition, the $P$, $Q$ and $S$ propositions are updated correctly, according to the transition function of $M$. Remember $M$ is nondeterministic, so you need to include all possible transitions. (If you're playing along at home, use three formulas for this.)

And the final, most important, formula states that:

  • $M$ enters the "accept" state at some time.

Then the conjunction of all of these formulas is true if and only if $M$ accepts $w$. Solve using your favourite SAT solver, and you're done.


  1. The Complexity of Theorem-Proving Procedures by Stephen A. Cook (1971).
  2. [Cook-Levin theorem] (http://en.wikipedia.org/wiki/Cook–Levin_theorem) on Wikipedia.
Pseudonym
  • 22,091
  • 2
  • 42
  • 84
  • 1
    You say that all but one of the known NP-hard problems was proven to be so by reduction, rather than directly. I'd say "all but O(1)". :-) Fagin (1974) proved NP-completeness of evaluating certain formulas of existential second-order logic by direct simulation of Turing machines -- the simulation uses essentially the same technique that Cook uses for SAT. I did the same for a fixed-point logic with nondeterminism. – David Richerby Jan 10 '14 at 08:32
  • This is a nice answer, but I'm not sure it fits the question which seem to ask a different thing. In any case, I think there may be a question around where your answer fits, but don't know one off the top of my head. – Raphael Jan 10 '14 at 09:09
  • David, I said "I'm pretty sure", and this statement was 100% accurate at the time of writing! Thanks for the additional info. I've updated my answer to reflect this. – Pseudonym Jan 13 '14 at 03:01