Decision problem: Given input of size \(n\), return Yes or No.
Two questions:
Recall: Logical operators
SAT: Given a boolean formula with variables \(x_1, x_2, \ldots, x_n\), is there an assignment of 1/0 values that satisfies the formula (i.e., makes it equal 1)?
Solve SAT for the formula: \(((x_1 \wedge x_4) \vee x_2) \wedge (\overline{x_2} \vee(x_3 \wedge \overline{x_4})) \wedge (\overline{x_5})\)
Solve SAT for the formula: \((a \vee b \vee c) \wedge (b \vee \overline{c} \vee \overline{d}) \wedge (\overline{a} \vee c \vee d) \wedge (a \vee \overline{b} \vee \overline{d})\).
Suppose you are given a formula with \(n\) variables of total length \(O(n^k)\) for some \(k\). Given a possible solution of 1/0 values, estimate the time needed to check the solution.
Given a formula with \(n\) variables, estimate the time needed to check all possible solutions by brute force.
Theorem. SAT is NP-hard.
Since SAT is in NP, SAT is NP-complete.
3SAT is like SAT, except the formula is in “3-conjunctive normal form:”
\[ (x_{i_1} \vee x_{j_1} \vee x_{k_1}) \wedge (x_{i_2} \vee x_{j_2} \vee x_{k_2}) \wedge \cdots \wedge (x_{i_m} \vee x_{j_m} \vee x_{k_m}) \]
Theorem. 3SAT is NP-hard. (It’s also in NP, so it’s NP-complete.)
Proof: Solving 3SAT in polynomial time would solve SAT in polynomial time, which would solve any problem in NP in polynomial time.
To prove that problem \(A\) is NP-hard, reduce a known NP-hard problem to \(A\).
Given an undirected graph \(G\), what is largest set of vertices in \(G\) with no edges between any of them?
Given: A 3CNF formula \((x_{i_1} \vee x_{j_1} \vee x_{k_1}) \wedge (x_{i_2} \vee x_{j_2} \vee x_{k_2}) \wedge \cdots \wedge (x_{i_m} \vee x_{j_m} \vee x_{k_m})\) with \(m\) clauses.
Make a graph for the 3CNF formula \((a \vee b \vee c) \wedge (b \vee \overline{c} \vee \overline{d}) \wedge (\overline{a} \vee c \vee d) \wedge (a \vee \overline{b} \vee \overline{d})\).
Mark the vertices that were 1 is your assignment from #2. Are these vertices independent?
Claim: The maximum independent set in this graph has size \(m\) \(\Leftrightarrow\) the formula is satisfiable.
Suppose there is a 1/0 assignment that satisfies the formula.
Suppose the graph has a maximum independent set of size \(m\).