Lecture 20
- NP-completeness
- Independent set is NP-complete
- What to do when your problem is NP-complete
Want to show Independent Set is NP-complete by reducing Circuit SAT to it.
Circuit SAT
Inputs \( x_1, ..., x_n \) and \( g_{n+1}, ..., g_{m} \) other gates such that \( g_i = OP_i(g_j, g_k) \), \(j, k < i \). Determine whether there is an assignment to \( x_i \) such that \( g_m = 1 \).
Independent Set
Instance: \( G, 1 \leq k \leq |V| \). Solution: \( I \subseteq V \) Constraints: \( \forall u, v \in I \) we have \( {u, v} \notin E \) and \( |I| = k \).
For each gate \( g_i \) insert two nodes \( A_i \) and \( B_i \) in graph. \( A_i \in I \iff g_i = 1 \) and \( B_i \in I \iff g_i = 0 \). For the computation, will create gates \( C_i, D_i, E_i, F_i \). These correspond to each of the 4 possible values of inputs to the gate. Russell drew a diagram on the board showing how a gate from Circuit SAT can be represented as graph in the Independent Set paradigm.
Dealing with NP-complete problems
- Ask "Is this really my problem?".
- Am I defining my problem in too-general a way?
- Maybe improved exponential time is good enough and you can use a 3-SAT solver.
- Reductions to 3-SAT tend to be fairly parsimonious.
- Try to find an approximation algorithm.
- Average-case analysis.
- Smoothed analysis
- Heuristics