$ \def\verify{ {\mathrm{verify}} } $
Two Classes of Problems:
P: decision problems solvable in polynomial time
NP: decision problems with a polynomial time verifier
A decision problem $A$ is NP complete if
Theorem [Cook, Levin]. Boolean Satisfiability (SAT) is NP complete.
Terminology:
Observation: a CNF formula evaluates to true $\iff$ all clauses evaluate to true
Definition. A 3-CNF formula is a Boolean formula in conjunctive normal form such that every clause contains 3 literals.
Example.
$\varphi(w, x, y, z) = (x \vee y \vee z) \wedge (y \vee \bar z \vee w) \wedge (\bar x \vee \bar y \vee \bar w)$
3-SAT:
Theorem (Tseytin 1970). Any Boolean formula $\varphi$ can be efficiently (in polynomial time) transformed into a 3-CNF formula $\psi$ such that:
Consequences.
In order to show a problem $A$ is NP complete, show:
Theorem. IS in NP Complete.
Question. What do we need to show?
Strategy. Reduction from 3-SAT
Question. How to transform a 3-CNF $\varphi$ into a graph $G$ such that solving IS on $G$ tells us whether $\varphi$ is satisfiable?
$\varphi(w, x, y, z) = (x \vee y \vee z) \wedge (y \vee \bar z \vee w) \wedge (\bar x \vee \bar y \vee \bar w)$
Input:
Output:
Suppose $\varphi$ a 3-SAT formula with $k$ clauses, $G$ corresponding graph. If $\varphi$ is satisfiable, then $G$ has an independent set of size $k$.
Suppose $\varphi$ a 3-SAT formula with $k$ clauses, $G$ corresponding graph. If $G$ has an independent set of size $k$, then $\varphi$ is satisfiable.
The correspondence $\varphi \to G$ is a polynomial time reduction from 3-SAT to IS.
Previously. Showed Vertex Cover (VC) satisfies IS $\leq_P$ VC
A problem $A$ is NP Hard if $B \leq_P A$ for some NP-complete problem $B$.
Examples.
Fact of Life. Many important practical problems are NP-Hard.
Question. So what do we do about it?
What if we need to solve an NP hard problem?