NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH NPC HW: 36-2, p.962; 37.2-3, p.974 NP-hard NPC P NP
Satisfiability Boolean formulas: x, (x y) (x y) (xy) (xy) Satisfiability Problem (SP): given a Boolean formula is there any 0-1 input (0-1 assignment to variables) s.t. formula is true (=1)? Cook’s Theorem: SP is NP-complete. SP is an NP-problem (why?) SP is NP-hard (w/o proof)
(l11 l12 ... l1s1) ... (ln1 ln2 ... lnsn) 3-CNF Conjunctive normal form (CNF) = (l11 l12 ... l1s1) ... (ln1 ln2 ... lnsn) each literal l is either variable or negation 3-CNF: each si=3 3-CNF Satisfiability is NPC (x1 x2) (x1 x4 ) Corresponding tree y3(y1 (x1 x2)) (y2 ( x1 x4 )) Truth assignment for each clause using tables. y3 y1 y2 x1 x2 x1 x4
Independent Set Independent set in a graph G: pairwise nonadjacent vertices Max Independent Set is NPC Construct a graph G literal = vertex two vertices are adjacent iff they are in the same clause they are negations of each other 3-CNF with k clauses is satisfiable iff G has independent k-set assign 1’s to literals-vertices of independent set
MAX Clique and Vertex Cover The maximum number of pairwise adjacent vertices Vertex Cover: the set of vertices which has at least one endpoint in each edge If C is vertex cover, then V - C is an independent set MIN Vertex Cover is NPC