Presentation is loading. Please wait.

Presentation is loading. Please wait.

NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC

Similar presentations


Presentation on theme: "NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC"— Presentation transcript:

1 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

2 Satisfiability Boolean formulas: x, (x  y) (x  y) (xy) (xy)
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)

3 (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

4 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

5 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


Download ppt "NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC"

Similar presentations


Ads by Google