Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 How to prove that a problem is NPC. 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982.

Similar presentations


Presentation on theme: "1 How to prove that a problem is NPC. 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982."— Presentation transcript:

1 1 How to prove that a problem is NPC

2 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982.

3 3 Karp R. Karp showed several NPC problems, such as 3-STA, node (vertex) cover, and Hamiltonian cycle, etc. Karp received Turing Award in 1985

4 4 NP-Completeness Proof: Reduction Vertex Cover Clique3-SAT SAT Chromatic Number Dominating Set All NP problems

5

6

7

8

9

10

11

12

13 13 NPC Problems CLIQUE(k): Does G=(V,E) contain a clique of size  k? Definition:  A clique in a graph is a set of vertices such that any pair of vertices are joined by en edge.

14 14 NPC Problems Vertex Cover(k): Given a graph G=(V, E) and an integer k, does G have a vertex cover with  k vertices? Definition: A vertex cover of G=(V, E) is V ’  V such that every edge in E is incident to some v  V ’.

15 15 Dominating Set(k): Given an graph G=(V, E) and an integer k, does G have a dominating set of size  k ? Definition:  A dominating set D of G=(V, E) is D  V such that every v  V is either in D or adjacent to at least one vertex of D. NPC Problems

16 16 SAT: Give a Boolean expression (formula) in DNF (conjunctive normal form), determine if it is satisfiable. 3SAT: Give a Boolean expression in DNF such that each clause has exactly 3 variables (literals), determine if it is satisfiable. NPC Problems

17 17 Chromatic Coloring(k): Given a graph G=(V, E) and an integer k, does G have a coloring for k Definition A coloring of a graph G=(V, E) is a function f : V  { 1, 2, 3, …, k }  if (u, v)  E, then f(u)  f(v). NPC Problems

18 18 3-Satisfiability Problem (3-SAT) Def: Each clause contains exactly three literals. (I) 3-SAT is an NP problem (obviously) (II) SAT  3-SAT Proof: (1) One literal L 1 in a clause in SAT: In 3-SAT: L 1 v y 1 v y 2 L 1 v -y 1 v y 2 L 1 v y 1 v -y 2 L 1 v -y 1 v -y 2

19 19 (2) Two literals L 1, L 2 in a clause in SAT: In 3-SAT: L 1 v L 2 v y 1 L 1 v L 2 v -y 1 (3) Three literals in a clause: remain unchanged. (4) More than 3 literals L 1, L 2, …, L k in a clause: in 3-SAT: L 1 v L 2 v y 1 L 3 v -y 1 v y 2  L k-2 v -y k-4 v y k-3 L k-1 v L k v -y k-3

20 20 The instance S in 3-SAT: x 1 v x 2 v y 1 x 1 v x 2 v -y 1 -x 3 v y 2 v y 3 -x 3 v -y 2 v y 3 -x 3 v y 2 v -y 3 -x 3 v -y 2 v -y 3 x 1 v -x 2 v y 4 x 3 v -y 4 v y 5 -x 4 v x 5 v -y 5 An instance S in SAT: x 1 v x 2 -x 3 x 1 v -x 2 v x 3 v -x 4 v x 5 SAT transform 3-SAT S S Example of Transforming a 3-SAT Instance to an SAT Instance

21 21 Chromatic Number Decision Problem (CN) Def: A coloring of a graph G = (V, E) is a functionf: V  { 1, 2, 3, …, k } such that if (u, v)  E, then f(u)  f(v). The CN problem is to determine if G has a coloring for k. E.g. Satisfiability with at most 3 literals per clause (SATY)  CN. 3-colorable f(a)=1, f(b)=2, f(c)=1 f(d)=2, f(e)=3

22 22 Set Cover Decision Problem Def: F = { S 1, S 2, …, S k } S i = { u 1, u 2, …, u n } T is a set cover of F if T  F and S i = S i The set cover decision problem is to determine if F has a cover T containing no more than c sets. Example: c=3. F = {(a 1, a 3 ), (a 2, a 4 ), (a 2, a 3 ), (a 4 ), (a 1, a 3, a 4 )} s 1 s 2 s 3 s 4 s 5 T = { s 1, s 3, s 4 } set cover T = { s 1, s 2 } another set cover

23 23 Exact Cover Problem Def: To determine if F has an exact cover T, which is a cover of F and the sets in T are pairwise disjoint. CN  exact cover

24 24 Sum of Subsets Problem Def: A set of positive numbers A = { a 1, a 2, …, a n } a constant C Determine if  A  A  a i = C e.g. A = { 7, 5, 19, 1, 12, 8, 14 } C = 21, A = { 7, 14 } C = 11, no solution Exact cover  sum of subsets.

25 25 Exact Cover  Sum of Subsets Proof: Instance of exact cover: F = { S 1, S 2, …, S n } Instance of sum of subsets: A = { a 1, a 2, …, a n } where

26 26 Partition Problem Def: Given a set of positive numbers A = { a 1,a 2, …,a n }, determine if  a partition P,   a i =  a i i  p i  p e.g. A = {3, 6, 1, 9, 4, 11} partition: {3, 1, 9, 4} and {6, 11} sum of subsets  partition

27 27 Bin Packing Problem Def: n items, each of size c i, c i > 0, a positive number k and bin capacity C, determine if we can assign the items into k bins such that the sum of c i ’ s assigned to each bin does not exceed C. partition  bin packing.

28 28 Q&A


Download ppt "1 How to prove that a problem is NPC. 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982."

Similar presentations


Ads by Google