NP-completeness of CIRCUIT-SAT, SAT, k-SAT




CS255

Chris Pollett

Apr 25, 2022

Outline

Introduction

Polynomial-Time Reducibility

Lemma. If `L_1`, `L_2` are languages such that `L_1 le_P L_2` and `L_2` is in `P`, then `L_1` is in `P`.

Proof. Let `A(y)` decide `L_2` in time `O(p(|y|))`. Let `f(x)` be a `O(q(|x|))`-time reduction from `L_1` to `L_2`. Here `p` and `q` are polynomials. Then `B(x)` which first computes `f(x)` then runs `A(f(x))`, runs in `O(p(q(|x|))`-time and decides `L_1`. So `B` runs in polynomial time.

Quiz

Which of the following statements is true?

  1. There are languages in NP that can be decided in quadratic time.
  2. RSA doesn't work in the case that the message is 0.
  3. If there exists a nontrivial square root of 1 modulo n, then n is prime.

NP-completeness

Theorem. If any `NP`-complete language is in `P`, then `P=NP`.

Proof. This follows from the lemma on the last slide.

A First NP-complete problem

Let CIRCUIT-SAT be the language:
`{langle C rangle | C` is an AND, OR, NOT circuit computing a 0-1 function which on some truth assignment to its input variables outputs 1`}`

Theorem. CIRCUIT-SAT is in NP.

Proof. Consider the following algorithm `A(langle C rangle, langle a rangle)`. First, `A` checks if `langle C rangle` is in the format of a circuit and `langle a rangle` is in the format for an assignment; if not, it rejects `A`. Otherwise, it then labels each of the inputs to `langle C rangle` with their value according to their values in `langle a rangle`. Then it loops over the combinational elements in `langle C rangle`, until there is no change doing the following:

  1. Check if the current element is not assigned a value, but its children have been assigned a value.
  2. Calculate the value of the node based on its gate type and its children.

By the `i`th iteration the nodes of depth `i` will have values. Each iteration involves less than quadratic work. So in `O((|langle C rangle|)^3)` this algorithm labels the root of the circuit with its output value on this assignment. Finally, CIRCUIT-SAT is the language `{langle C rangle in {0,1}^star : exists langle a rangle, |langle a rangle| le |langle C rangle| mbox( and ) A(langle C rangle, langle a rangle) = 1}`.