Lecture 011

Ada's Lecture

P vs. NP

P: set of languages can be decided in O(n^k) steps for some constant k.

NP: Might not be in P, but verifiable in P

Cannot prove these problems are not solvable in polynomial time.

Polynomial Time Reduction

Polynomial Time Reduction

Polynomial Time Reduction: A \leq^P B \iff M_A \text{ runs } M_B \text{ polynomial number of time to solve problem}

C-hard: Let C be a set of languages containing P. A is C-hard if (\forall L \in C)(L \leq^P A) (A is at least as hard as every language in C)

C-complete: A is C-hard and A \in C (A is a representative for hardest language in C)

picture of P vs. NP

picture of P vs. NP

Definition of NP: Nodeterministic Polynomial Time (it can be determined by nodeterministic TM in polynomial time)

Definition of EXP: all languages that can be decided in at most exponential-time (in O(2^{n^C}) for C > 0)

Facts:

Strategy:

Clique

Clique

Properties of NP:

Properties of NP-complete:

Reductions

Cook Reduction

Cook Reduction
Cook reduction: poly-time Turning reduction (A \leq^P B)

Many-one Reduction

Many-one Reduction
Karp reduction(poly-time many-one reduction): (A \leq_m^P B)

Different reduction lead to different notion of NP-hardness

Reduction Practices 1

Boolean Circuit: a directed acyclic graph where vertices are AND gates, OR gates, NOT gates, n input gates, 1 output gate, and constant gates (with reasonable input output numbers). It can be thought as function f: \{0, 1\}^n \rightarrow \{0, 1\}.

CIRCUIT-SAT: given circuit, return true iff there exists an assignment of inputs to make it output 1

kCOL: given G = \langle{V, E}\rangle, return true iff G is k-colorable.

CLIQUE: given \langle{G, k}\rangle (graph G, positive int k), return true iff G contains a clique (all connected, complete graph) of size k.

IND-SET: given \langle{G, k}\rangle (graph G, positive int k), return true iff G contains an independent set (none-connected, no edge between any two vertices in the subset) of size k.

Note:

Show CLIQUE \leq_m^P IND-SET: define f : \overrightarrow{G, k} \rightarrow \langle{G', k'}\rangle such that G has a clique of size k iff G' has an independent set of size k' (f is complement of vertices)

Reduction Practice 2

3SAT: give a clause of A_1 \land A_2 \land A_3... where A_i are connected using AND and A_i = (O_1 \lor O_2 \lor O_3) only 3 clause connected using OR. (\phi = (x_1 \lor \lnot x_2 \lor x_3) \land (\lnot x_1 \lor x_4 \lor x_5) \land (x_2 \lor \lnot x_5 \lor x_6)) Tell me whether this is satisfiable

Proof Strategy

Proof Strategy
Show 3SAT \leq_m^P CLIQUE:

Mapping Strategy

Mapping Strategy

Sutner's Lecture

NP: Language L \subseteq \Sigma^* is in NP if there is a polynomial time decidable relation R and a polynomial p such that x \in L \iff \exists w(|w| \leq p(|x|) \land R(w, x))

VERTEX-COVER: C \subseteq G such that (\forall (v, u) \in E)(v \in C \lor u \in C) and make C small.

CLIQUE: a clique for G = \langle{V, E}\rangle is C \subseteq V such that (\forall u, v \in C)(u \neq v \implies \{v, u\} \in E)

INDEPENDENT-SET: an independent set for G = \langle{V, E}\rangle is I \subseteq V such that (\forall u, v \in C)(u \neq v \implies \{v, u\} \notin E)

TSP: for n \times n positive integer distance matrix d, a bound B, is there a tour of cost at most B?

Oracle: assume O(1), used in reasoning of poly-time reduction from non-decision version to decision.

Nodeterministic Polynomial: solvable by NTM in polynomial time.

Nondeterministic TM: same idea as NFA except

\begin{cases} NTIME(f) = \{L(M) | M \text{ is a NTM s.t. } T_M(n) = O(f(n))\}\\ NSPACE(f) = \{L(M) | M \text{ is a NTM s.t. } S_M(n) = O(f(n))\}\\ \end{cases}
\begin{cases} P = TIME(poly)\\ NP = NTIME(poly)\\ \end{cases}

Reduction

Polynomial Time Turing Reduction: \leq^p_T

Polynomial Time Many-one Reduction: A \leq^p_m B if there is a polynomial time computable function f such that x \in A \iff f(x) \in B

Universal Machines:

Construct NP-complete: simulate machines in the enumeration N_e of nondeterministic, polynomial time TM.

Boolean Formulae

Boolean Function: formula using \lnot, \land, \lor

For formula \varphi, \varphi[\sigma] denotes the truth value of \varphi given \sigma.

Threshold function: a boolean function, for 0 \leq m \leq n, thr^n_m(x) = \begin{cases} 1 \text{ if } |\{i | x_i = 1\}| \geq m\\ 0 \text{ otherwise}\\ \end{cases} where x_i is ith input.

Threshold Function implemented thr^n_k(x) using boolean function: \bigvee_{I \subset [n] | |I|=k} \bigwedge_{i \in I} x_i

Counting Function implemented cnt^n_k using boolean function: thr^n_k(x) \land \lnot thr^n_{k+1}(x)

Counting with 8 Variables

Counting with 8 Variables

Application of SAT

Application of SAT

Exponential Time Hypothesis: every algorithm for SAT has running time \Omega(2^{cn}) for some c > 0

3-SAT Formal Definition:

Cook-Levin

Vertex cover is reducible to 3SAT (proof in slides)

Karp's List

Problems in P that was not known:

Still unknown complexity: Graph Isomorphism (given two graph G and G', whether G is isomorphic to G')

PARTITION: For a_1, a_2, ..., a_n \in \mathbb{N}, is there I \subset [n] such that \sum_{i \in I} a_i = \sum_{i \notin I} a_i?

BIN: Can we put a_1, a_2, ..., a_n \in \mathbb{N} in k \in \mathbb{N} bins of size C \in \mathbb{R}

Reductions

Reductions 1

Reductions 1

Reductions 2

Reductions 2
Examples of Hard reductions: See lecture slide 16.

Numerical Problems

strongly NP-hard: if we express input in unary, it will still remain NP-hard.

pseudo-polynomial time: if we express input in unary, it will be in polynomail time.

Table of Content