Chapter 3: Proving NP-completeness Results

Size: px
Start display at page:

Download "Chapter 3: Proving NP-completeness Results"

Transcription

1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises 1.1

2 Six Basic NP-Complete Problems 3-SATISFIABILITY (3SAT) 3-DIMENSIONAL MATCHING (3DM) VERTEX COVER (VC) CLIQUE HAMILTONIAN CIRCUIT (HC) PARTITION First, a tour 1.2

3 3-Satisfiability 3-SATISFIABILITY (3-SAT) INSTANCE: Collection C = {c 1, c 2,,c m } of clauses on a finite set U of variables such that {c j } = 3, for 1 j m. QUESTION: Is there a truth assignment for U that satisfies all the clauses in C? 1.3

4 3-Dimensional Matching 3-DIMENSIONAL MATCHING (3-DM) INSTANCE: A set M W X Y, where W, X and Y are disjoint sets having the same number q of elements. QUESTION: Does M contain a matching, that is, a subset M M such at M = q and no two elements of M agree in any coordinate? Example #1: q = 3 (not part of input technically) W = {a 1, a 2, a 3 } X = {b 1, b 2, b 3 } Y = {c 1, c 2, c 3 } M = { (a 1, b 2, c 1 ), (a 2, b 1, c 3 ), (a 3, b 3, c 2 ), (a 1, b 1, c 3 ), (a 2, b 2, c 1 ) } Yes! The first 3 form a matching. Note that every element in each set will appear in exactly one triple in M. 1.4

5 3-Dimensional Matching Example #2: q = 3 (not part of input technically) W = {a 1, a 2, a 3 } X = {b 1, b 2, b 3 } Y = {c 1, c 2, c 3 } M = { (a 1, b 1, c 1 ), (a 1, b 1, c 2 ), (a 2, b 1, c 3 ), (a 3, b 1, c 1 ) } No! In fact b 2 and b 3 do not appear in any triple. 1.5

6 Vertex Cover, Independent Set and Clique VERTEX COVER (VC) INSTANCE: A Graph G = (V, E) and a positive integer K <= V. QUESTION: Is there a vertex cover of size K or less for G, that is, a subset V V such that V <= K and, for each edge {u,v} E, at least one of u and v belongs to V? K = 3 u v w x z 1.6

7 Vertex Cover, Independent Set and Clique CLIQUE INSTANCE: A Graph G = (V, E) and a positive integer J <= V. QUESTION: Does G contain a clique of size J or more? J = 3 u v w x z 1.7

8 Hamiltonian Circuit (HS) HAMILTONIAN CIRCUIT (HC) INSTANCE: A Graph G = (V, E). QUESTION: Does G have a Hamiltonian circuit, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that {v n, v 1 } E and {v i, v i+1 } E for all i, 1 i n. How is a Hamiltonian circuit different from a tour, as in TSP? TRAVELING SALESMAN INSTANCE: Set C of m cities, distance d(c i, c j ) Z + for each pair of cities c i, c j C positive integer B. QUESTION: Is there a tour of C having length B or less, I.e., a permutation <c (1), c (2),, c (m) > of C such that: m 1 i1 d( c ( i), c ( i 1)) d( c ( m), c (1)) B? 1.8

9 3-Satisfiability A restricted version of satisfiability in which all instances have exactly 3 literals per clause. 3-SATISFIABILITY (3-SAT) INSTANCE: Collection C = {c 1, c 2,,c m } of clauses on a finite set U of variables such that {c j } = 3, for 1 j m. QUESTION: Is there a truth assignment for U that satisfies all the clauses in C? Contrasted with the more general SAT: SATISFIABILITY (SAT) INSTANCE: Collection C of clauses on a finite set U of variables. QUESTION: Is there a truth assignment for U that satisfies all the clauses in C? 1.9

10 3-Satisfiability Theorem 3.1: 3-SAT is NP-Complete. 1) 3-SAT NP 2) SAT 3-SAT I = U,C SAT instance A I = U,C 3-SAT instance I is satisfiable iff I is 1.10

11 3-Satisfiability Each clause c j in I => a set C j of clauses with new variables U j Let c j = {z 1, z 2,,z k } where z i s are literals derived from variables in U Case 1) k=1 c j = {z 1 } U j = {y j1, y j2 } C j = { {z 1, y j1, y j2 }, {z 1, y j1, y j2 }, {z 1, y j1, y j2 }, {z 1, y j1, y j2 } } Case 2) k=2 c j = {z 1, z 2 } U j = {y j1 } C j = { {z 1, z 2, y j1 }, {z 1, z 2, y j1 } } 1.11

12 3-Satisfiability Case 3) k=3 c j = {z 1, z 2, z 3 } U j = {} C j = { {z 1, z 2, z 3 } } Case 4) k>=4 c j = {z 1, z 2,,z k } U j = {y j i 1 i k-3} C j = { {z 1, z 2, y j1 } } U {y ji, z i+2, y j i+1 } 1 i k-4} U {y j k-3, z k-1, z k } } Example: c j = {z 1, z 2, z 3, z 4, z 5, z 6 } U j = { {z 1, z 2, a}, {a, z 3, b}, {b, z 4, c}, {c, z 5, z 6 } } 1.12

13 3-Satisfiability Finally, let: U = U { U j 1 j m } C = { C j 1 j m } Claim: 1) I = U,C is satisfiable iff I = U,C is satisfiable. 2) I can be computed in polynomial time. 1.13

14 Six Basic NP-Complete Problems A review of basic logic and language A if and only if B Equates to: A if B A only if B The if part The only if part Similarly: A if B B only if A B => A A only if B B if A A => B 1.14

15 Six Basic NP-Complete Problems Lastly, to prove: X => Y We frequently show: ~Y => ~X 1.15

16 3-Satisfiability So lets go back to the basic claim: 1) I = U,C is satisfiable iff I = U,C is satisfiable. a) (if) I = U,C is satisfiable if I = U,C is b) (only if) I = U,C is satisfiable only if I = U,C is 1.16

17 3-Satisfiability 2) I can be computed in polynomial time: Let m = C, n = U case 1) creates 4 clauses case 2) creates 2 clauses case 3) creates 1 clause case 4) creates k-1 clauses, where k is the number of literals in the clause This gives a total of at most k-1 new clauses in I for each clause in I Therefore, there is a total of m*(k-1) clauses in I Since k<=2n, it follows that there are at most 2nm clauses in I, which is O(mn) 1.17

18 3-Satisfiability 3-SAT is an example of what is called a special case of SAT. Some special cases, like 3-SAT, are NP-complete Others are solvable in polynomial time (chapter 4) How about 4-SAT? 5-SAT? N-SAT, for any fixed N>=3? 1-SAT? 2-SAT? 1.18

19 Some More New Problems Not All Equal (NAE) 3-SAT INSTANCE: Collection C = {c 1, c 2,,c m } of clauses on a finite set U of variables such that {c j } = 3, for 1 j m. QUESTION: Is there a truth assignment for U such that each clause in C has at least one true literal and at least one false literal? Fact: NAE 3-SAT is NP-complete 1.19

20 Some More New Problems Examples: { (a, b, c), (a, b, c), (a, b, c) } a = T, b = T, c = F { (a, b, c), (a, b, c), (a, b, c), Not even satistfiable (a, b, c), (a, b, c), (a, b, c) (a, b, c), (a, b, c) } { (a, b, c), (a, b, c), (a, b, c), Satistfiable, but not with (a, b, c), (a, b, c), (a, b, c) at least one literal true and false (a, b, c) } per clause 1.20

21 More Problems, cont. Hypergraph 2-Colorability (H2C) INSTANCE: Hypergraph H = (V, E), where 2 e i 3, for all e i E. QUESTION: Is H 2-colorable? In other words, is there a function f : V {0, 1} such that for all e i E there exist vertices u,v e i such that f(u) f(v)? Examples: No Yes No 1.21

22 H2C is NP-Complete Theorem: H2C is NP-complete H2C NP Not All Equal 3-SAT H2C I = U,C NAE3SAT instance A H = (V, E) H2C instance 1.22

23 H2C is NP-Complete, cont. Suppose I = U,C where U = {u 0, u 1,,u n-1 } and C = {c 0, c 1,,c m-1 } Construct H = (V, E) where: V = { v i1 u i U} {v i2 u i U} v i1 corresponds to u i v i2 corresponds to the complement of u i E = E 1 E 2 where E 1 = { (v 1, v 2, v 3 ) c i C, c i = (z 1, z 2, z 3 ) and v 1, v 2, v 3 are the vertices corresponding to the literals z 1, z 2 and z 3, respectively} E 2 = { (v i1, v i2 ) 0 i n-1} 1.23

24 H2C is NP-Complete, cont. Example: U = {u 0, u 1, u 2, u 3 } C = { (u 0, u 1, u 2 ), (u 0,u 2, u 3 ), (u 1, u 2, u 3 ) } 1 0 v 0 v 0 v v v v v v 3 0 The resulting hyper-graph is 2-colorable IFF there is a NAE satisfying truth assignment for the Boolean expression. (if) Suppose there is a NAE assignment, then there is a 2-coloring. (only if) Suppose there is a 2-coloring, then there is a NAE satisfying assignment. 1.24

25 3-Dimensional Matching 3-DIMENSIONAL MATCHING (3-DM) INSTANCE: A set M W X Y, where W, X and Y are disjoint sets having the same number q of elements. QUESTION: Does M contain a matching, that is, a subset M M such at M = q and no two elements of M agree in any coordinate? Example #1: q = 3 (not part of input technically) W = {a 1, a 2, a 3 } X = {b 1, b 2, b 3 } Y = {c 1, c 2, c 3 } M = { (a 1, b 2, c 1 ), (a 2, b 1, c 3 ), (a 3, b 3, c 2 ), (a 1, b 1, c 3 ), (a 2, b 2, c 1 ) } Yes! The first 3 form a matching. Note that every element in each set will appear in exactly one triple in M. 1.25

26 3-Dimensional Matching Example #2: q = 3 (not part of input technically) W = {a 1, a 2, a 3 } X = {b 1, b 2, b 3 } Y = {c 1, c 2, c 3 } M = { (a 1, b 1, c 1 ), (a 1, b 1, c 2 ), (a 2, b 1, c 3 ), (a 3, b 1, c 1 ) } No! In fact b 2 and b 3 do not appear in any triple. 1.26

27 3-Dimensional Matching Theorem: 3DM is NP-complete. Proof: 1) 3DM NP 2) 3-SAT 3DM I = U,C 3-SAT instance A I = W,X,Y,M 3DM instance 1.27

28 3-Dimensional Matching Suppose I = U,C where: U = {u 1, u 2,,u n } C = {c 1, c 2,,c m } Construct M as follows. M will consists of three types of components: Truth Setting and fan-out Satisfaction testing Garbage collection 1.28

29 3-Dimensional Matching Suppose I = U,C where: U = {u 1, u 2,,u n } C = {c 1, c 2,,c m } Construct M as follows. M will consists of three types of components: Truth Setting and fan-out Satisfaction testing Garbage collection 1.29

30 Truth Setting and Fan Out Components For each variable u i U, create the following (TS&FO) elements: T it = { (u i [j], a i [j], b i [j]) 1 j m } U T if = { (u i [j], a i [j+1], b i [j]) 1 j m-1 } U { (u i [m], a i [1], b i [m]) } a big blob for each Boolean variable (suppose m=4): 1.30

31 Truth Setting and Fan Out Components Observation #1: Creates 2mn elements in W, mn in X and mn in Y. u i [j] represents the fact that variable u i could occur in clause c j. Similarly for u i [j] Observation #2: a i [j] and b i [j] both occur in exactly two triples and nowhere else. Observation #3: This tells us that in any matching M M we must have all white or all shaded triples, in other words, all triples from T it or all triples from T i f This corresponds to setting the variable false or true, respectively. 1.31

32 Satisfaction Testing Components For each clause c j C, create (ST) triples: C j = { (u i [j], s 1 [j], s 2 [j]) u i c j } U { (u i [j], s 1 [j], s 2 [j]) u i c j } Observation #4: This adds m elements to X, and m elements to Y. Observation #5: For each j, 1 j m, s 1 [j] and s 2 [j] both appear in exactly three triples and nowhere else. Observation #6: Any matching must choose exactly one triple from C j This corresponds to making that literal true, thereby satisfying the clause. This gives a total of m triples selected from the ST triples. Observation #7: Any matching will contain exactly one triple from C j if and only if there is a satisfying truth assignment for the 3-SAT instance. 1.32

33 Garbage Collection Components For each clause c j C, create 2mn(n-1) (GC) triples: G = { (u i [j], g 1 [k], g 2 [k]), (u i [j], g 1 [k], g 2 [k]) 1 k m(n-1), 1 i n, 1 j m} Observation #8: This adds m(n-1) elements to X, and to Y. Observation #9: For each k, 1 k m(n-1), g 1 [k] and g 2 [k] both appear in exactly 2mn triples and nowhere else. Observation #10: Consequently, exactly m(n-1) triples from G must occur in any matching for M. Observation #11: W = X = Y = 2mn = q. 1.33

34 Garbage Collection Components The resulting instance I of 3DM has a matching IFF the 3-SAT instance I is satisfiable. (if) Suppose you have a satisfying truth assignment for I. How do you construct the matching? (only if) Suppose you have a matching. What is the satisfying truth assignment? 1.34

35 Vertex Cover, Independent Set and Clique VERTEX COVER (VC) INSTANCE: A Graph G = (V, E) and a positive integer K <= V. QUESTION: Is there a vertex cover of size K or less for G, that is, a subset V V such that V <= K and, for each edge {u,v} E, at least one of u and v belongs to V? K = 3 u v w x z 1.35

36 Vertex Cover, Independent Set and Clique INDEPENDENT SET (IS) INSTANCE: Graph G = (V, E) and positive integer J <= V. QUESTION: Does G contain an independent set of size J or more? J = 2 u v w x z 1.36

37 Vertex Cover, Independent Set and Clique CLIQUE INSTANCE: A Graph G = (V, E) and a positive integer J <= V. QUESTION: Does G contain a clique of size J or more? J = 3 u v w x z 1.37

38 Vertex Cover, Independent Set and Clique Lemma 3.1: For any graph G=(V,E) and subset V V, the following statements are equivalent: (a) V is a vertex cover for G (b) V-V is an independent set for G (c) V-V is a clique in the complement G c of G, where G c =(V,E c ) with E c ={{u,v} u,v V and {u,v} E} u v w u v w u v w x z x z x z 1.38

39 Vertex Cover, Independent Set and Clique Lemma 3.1: For any graph G=(V,E) and subset V V, the following statements are equivalent: (a) V is a vertex cover for G (b) V-V is an independent set for G (c) V-V is a clique in the complement G c of G, where G c =(V,E c ) with E c ={{u,v} u,v V and {u,v} E} u v w u v w u v w x z x z x z 1.39

40 Vertex Cover Theorem: VERTEX COVER is NP-complete Proof: 1) VC NP 2) 3SAT VC Suppose I = U,C is an instance of 3SAT where: U = {u 1, u 2,,u n } C = {c 1, c 2,,c m } We will construct a graph G=(V,E) and a positive integer K<= V such that G has a vertex cover of size K or less if and only if C is satistfiable. 1.40

41 Vertex Cover For each variable u i U, there is a truth-setting component T i =(V i,e i ) where: V i = {u i, u i } and E i = {{u i,u i }} *Note that any vertex cover will have to contain at least one of u i and its complement. For each clause c j C, create a satisfaction testing component S j = (V j, E j ): V j = { a 1 [j], a 2 [j], a 3 [j] } E j = { {a 1 [j], a 2 [j]}, {a 1 [j], a 3 [j]}, {a 2 [j], a 3 [j]} } *Note that any vertex cover will have to contain at least two vertices from V j in order to cover the edges in E j. 1.41

42 Vertex Cover For each clause c j C, let the three literals in c j be x j, y j, z j. Then add communication edges: E j = { {a 1 [j], x j }, {a 2 [j], y j }, {a 3 [j], z j } } Finally, let K = n + 2m. 1.42

43 Vertex Cover Example: U = {u 1, u 2, u 3, u 4 } C = { (u 1, u 3, u 4 ), (u 1, u 2, u 4 ) } K = n + 2m =

44 Vertex Cover Observations: The transformation can be performed in polynomial-time. G = (V, E) will have a vertex cover of size K or less IFF I = U,C is satisfiable. (if) Suppose I = U,C is satisfiable (only if) Suppose G = (V, E) has a vertex cover of size K or less 1.44

45 Vertex Cover, Independent Set and Clique Recall Lemma 3.1: Lemma 3.1: For any graph G=(V,E) and subset V V, the following statements are equivalent: (a) V is a vertex cover for G (b) V-V is an independent set for G (c) V-V is a clique in the complement G c of G, where G c =(V,E c ) with E c ={{u,v} u,v V and {u,v} E} What does the previous result say about the independent set and clique problems? 1.45

46 Homework Problems INDEPENDENT SET (IS) INSTANCE: Graph G = (V, E) and positive integer J <= V. QUESTION: Does G contain an independent set of size J or more? Prove IS NP-complete by giving a transformation from 3DM. 4-DIMENSIONAL MATCHING (4-DM) INSTANCE: A set M W X Y Z, where W, X, Y and Z are disjoint sets having the same number q of elements. QUESTION: Does M contain a matching, that is, a subset M M such at M = q and no two elements of M agree in any coordinate? Prove 4-DM NP-complete by giving a transformation from 3DM. 1.46

47 Hamiltonian Circuit (HS) HAMILTONIAN CIRCUIT (HC) INSTANCE: A Graph G = (V, E). QUESTION: Does G have a Hamiltonian circuit, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that {v n, v 1 } E and {v i, v i+1 } E for all i, 1 i n. How is a Hamiltonian circuit different from a tour, as in TSP? 1.47

48 Hamiltonian Circuit (HS) HAMILTONIAN CIRCUIT (HC) INSTANCE: A Graph G = (V, E). QUESTION: Does G have a Hamiltonian circuit, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that {v n, v 1 } E and {v i, v i+1 } E for all i, 1 i n. VERTEX COVER (VC) INSTANCE: A Graph G = (V, E) and a positive integer K <= V. QUESTION: Is there a vertex cover of size K or less for G, that is, a subset V V such that V <= K and, for each edge {u,v} E, at least one of u and v belongs to V? 1.48

49 Hamiltonian Circuit (HC) Theorem: HC is NP-complete Proof: 1) HC NP 2) VC HC Let G = (V,E) and K <= V be an instance of VC. We will construct a graph G = (V,E ) such that G has a vertex cover of size K or less if and only if G has a Hamiltonian circuit. 1.49

50 Hamiltonian Circuit (HC) 1) Add selector vertices a 1, a 2,,a k to V 2) For each edge e = {u,v} in E, construct the following cover testing component: this side corresponds to u this side corresponds to v More specifically, add the following 12 vertices: V e = {(u,e,i), (v,e,i) : 1<=i<=6}} And 14 edges: E e = {{(u,e,i), (u,e,i+1)}, {(v,e,i), (v,e,i+1)} : 1<=i<=5 } {{(u,e,3), (v,e,1)}, {(v,e,3), (u,e,1)}} {{(u,e,6), (v,e,4)}, {(v,e,6), (u,e,4)}} 1.50

51 Hamiltonian Circuit (HC) 3) For each vertex v V, let the edges incident on v be: e v[1], e v[2],,e v[deg(v)] Add the following edges: E v = { {(v,e v[i],6),(v,e v[i+1],1)} : 1<=i<deg(v) } This creates a path in G that touches the cover-testing components corresponding to the edges adjacent to v in G. start This path corresponds to the vertex v from G. end 1.51

52 Hamiltonian Circuit (HC) 4) Finally, add edges to G that connect the first (s i ) and last (e i ) vertices from each of these paths to every one of the selector vertices: E = { {a i,(v,e v[1],1)}, {a i,(v,e v[deg(v)],6)} : 1<=i<=K, v V } s 1 a 1 e 1 a 2 s 2 e 2 : : : : a K s V e V 1.52

53 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 x e 5 z K =

54 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 x e 5 z a 1 K = 3 a 2 a

55 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 K = 3 e 2 a 2 e 3 a 3 e 4 e

56 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 v K = 3 e 2 a 2 e 3 a 3 e 4 e

57 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 e 2 a 2 e 3 a 3 e 4 e

58 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 e 2 a 2 e 3 a 3 x e 4 e

59 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e

60 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e 5 z 1.60

61 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e 5 z 1.61

62 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e 5 z 1.62

63 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e 5 z 1.63

64 Hamiltonian Circuit (HC) A complete example consider the following instance of vertex cover: e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 G as a vertex cover of size 3 If and only if G has a Hamiltonian circuit e 5 z 1.64

65 Hamiltonian Circuit (HC) (only if) e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e 5 z 1.65

66 Hamiltonian Circuit (HC) (if) e 1 e 2 u v w e 3 e 4 e 1 x e 5 z a 1 u v K = 3 w e 2 a 2 e 3 a 3 x e 4 e 5 z 1.66

67 Hamiltonian Path (HP) HAMILTONIAN PATH (HP) INSTANCE: A Graph G = (V, E), and vertices u,v V. QUESTION: Is there a Hamiltonian path from vertex u to vertex v, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that u = v 1, v = v n, and {v i, v i+1 } E for all i, 1 i n. FACT: HP is NP-complete (see page 60). 1.67

68 HW Problem Solution #1 INDEPENDENT SET (IS) INSTANCE: Graph G = (V, E) and positive integer J <= V. QUESTION: Does G contain an independent set of size J or more? Theorem: IS is NP-complete 1) IS NP 2) 3DM IS I = M,W,X,Y 3DM instance A G = (V, E), J IS instance 1.68

69 HW Problem Solution #1 Proof: Let M be an instance of 3DM, and construct an instance of IS as follows. V = {v i t i M} E = {v i, v j i j and t i and t j agree on some coordinate} j = q Claims: 1) The transformation can be performed in polynomial-time 2) M contains a matching if and only if G=(V,E) contains an independent set of size j. 1.69

70 HW Problem Solution #1 (only if) Let M = {t 0, t 1,,t q-1 } be a matching, where M M. It can be easily verified that V = {v 0, v 1,,v q-1 } is an independent set of size j. (if) Let V = {v 0, v 1,,v q-1 } is an independent set of size j for G. Then it can be easily verified that M = {t 0, t 1,,t q-1 } is a matching. 1.70

71 HW Problem Solution #2 4-DIMENSIONAL MATCHING (4-DM) INSTANCE: A set M W X Y Z, where W, X, Y and Z are disjoint sets having the same number q of elements. QUESTION: Does M contain a matching, that is, a subset M M such at M = q and no two elements of M agree in any coordinate? Theorem: 4DM is NP-complete 1) 4DM NP 2) 3DM 4DM I = M,W,X,Y 3DM instance A I = M,W,X,Y,Z 4DM instance 1.71

72 HW Problem Solution #2 Proof: Let M,W,X, and Y be an instance of 3DM, and construct an instance of 4DM as follows: W = W X = X Y = Y Z = {z i, where 0 i q-1, and q = W = X = Y } M = {(w i,x j,y k,z r ) (w i,x j,y k ) M and z r Z} In other words, for each triple in M and value in Z, add a quadruple in M. Claims: 1) The transformation can be performed in polynomial-time 2) M contains a matching if and only if M does. 1.72

73 HW Problem Solution #2 (only if) Let M = {t 0, t 1,,t q-1 } be a 3D matching, where M M. Create a 4D matching M by adding z i to triple t i, for all i, where 0 i q-1. It can easily be verified that M is a 4D matching for I. (if) Let M = {t 0, t 1,,t q-1 } be a 4D matching, where M M. Create a 3D matching by letting M = {(w i,x j,y k ) (w i,x j,y k,z r ) M }. It can easily be verified that M is a 3D matching for I. 1.73

74 Partition PARTITION INSTANCE: A finite set A and a size s(a) Z + for each a A. QUESTION: Is there a subset A A such that: 3-DIMENSIONAL MATCHING (3-DM) INSTANCE: A set M W X Y, where W, X and Y are disjoint sets having the same number q of elements. QUESTION: Does M contain a matching, that is, a subset M M such at M = q and no two elements of M agree in any coordinate? 1.74

75 Partition Theorem: Partition is NP-complete Proof: 1) PARTITION NP 2) 3DM PARTITION Let W, X, and Y with W = X = Y = q, and M W X Y be an instance of 3DM. Also let: and: W = {w 1, w 2,, w q } X = {x 1, x 2,, x q } Y = {y 1, y 2,, y q } M = {m 1, m 2,, m k } where k = M 1.75

76 1.76 Partition We will construct a set A, and a size s(a) Z + for each a A. This set A will be such that A contains a subset A satisfying: if and only if M contains a matching. ' ' ) ( ) ( A a A A a a s a s

77 Partition First add k elements {a i :1 i k} to A, where a i corresponds with triple m i M, and the size s(a i ) in binary is given by: p log 2 ( k 1) w 1 w 2 w q x 1 x 2 x q y 1 y 2 y q Notes: A triple from M corresponds to a 3-bit binary number, where each bit is in the rightmost position of one sub-field. If all the binary numbers were added up for all the triples, no sub-field would overflow (because of the choice of p). 1.77

78 Partition Let: B 3q 1 i0 2 pj w 1 w 2 w q x 1 x 2 x q y 1 y 2 y q Then B corresponds to the binary number containing a 1 in every sub-field rightmost position. If a set M of triples formed a matching, then the corresponding binary numbers would add up to exactly B. Now add two more elements b 1 and b 2 to A, where: s( b s( b k 1 ) 2 s( ) i1 k 2 ) s( ) i1 a i B a i B 1.78

79 1.79 Partition Note that the sum of the sizes of all the elements in A is: Thus, any partition of A into equal-sizes subsets A and A A, the sum of the sizes of the elements in those two partitions must both equal: Furthermore, b 1 and b 2 cannot be in the same set. k i a i B s b s 1 1 ) ( 2 ) ( k i a i B s b s 1 2 ) ( ) ( k i i k i i k i i k i i k i i a s B a s B a s a s b s b s a s ) ( 4 ) ) ( ( ) ) ( (2 ) ( ) ( ) ( ) ( k i a i s 1 ) ( 3 k i a i s 1 ) ( 2

80 Partition Thus, in any partition A of A into two equal-sized subsets, b1 and b2 must be in different sets: s A A A k ( b1 ) 2 s( a i ) B s( b ) i1 For the sum of the sizes of the two sets A and A A to sum to: 2 k i1 s( a i k 2 s( ) i1 a i B We therefore need to add some subset of the remaining elements of A to A that sums to B. ) As noted previously, the corresponding triples would have to be a matching for M. Consequently, the set A can be partitioned into two equal-sized subsets IFF M contains a matching. 1.80

81 Techniques for Proving NP-Completeness There are several general types of transformations: Restriction Local Replacement Component Design 1.81

82 Restriction Proving a problem NP NP-complete by restriction consists of showing that contains another known NP-complete problem as a special case. What is a special case of a problem? Let I be all instances of a problem, and let I be all instances of a problem If I I and I Y IFF I Y then is said to be a special case of Furthermore, if and are both in NP, and if is NP-complete, then so is The heart of a proof by restriction is the specification of restrictions to be placed on the instances of so that the resulting problem will be identical to Note that a proof by restriction is still a transformation, i.e., it is not a different kind of NPcompleteness proof. 1.82

83 Directed Hamiltonian Circuit (DHS) DIRECTED HAMILTONIAN CIRCUIT (DHC) INSTANCE: A directed graph G = (V, E). QUESTION: Does G have a Hamiltonian circuit, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that {v n, v 1 } E and {v i, v i+1 } E for all i, 1 i n. HAMILTONIAN CIRCUIT (HC) INSTANCE: A Graph G = (V, E). QUESTION: Does G have a Hamiltonian circuit, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that {v n, v 1 } E and {v i, v i+1 } E for all i, 1 i n. Fact: HC is NP-complete. 1.83

84 Directed Hamiltonian Circuit (DHS) Theorem: DHC is NP-complete Proof: 1) DHC NP 2) HC DHC, by restriction. Proof: Consider those instances of DHC where there is an edge from u to v if and only if there is an edge from v to u. Recall that technically a restriction is, in fact, a transformation. In what sense is the above proof a transformation? 1.84

85 Exact Cover by 3-Sets (X3C) EXACT COVER BY 3-SETS (X3C) INSTANCE: A finite set X with X = 3q and a collection C of 3-element subsets of X. QUESTION: Does C contain an exact cover for X, that is, a sub-collection C C such that every element of X occurs in exactly one member of C? How does this differ from 3DM? 3-DIMENSIONAL MATCHING (3DM) INSTANCE: A set M W X Y, where W, X and Y are disjoint sets having the same number q of elements. QUESTION: Does M contain a matching, that is, a subset M M such at M = q and no two elements of M agree in any coordinate? 1.85

86 Exact Cover by 3-Sets (X3C) Theorem: X3C is NP-complete Proof: 1) X3C NP 2) 3DM X3C Let M W Y Z, where W, Y and Z are disjoint sets having the same number q of elements, be an instance of 3DM. Construct an instance of X3C as follows: Let X = W Y Z Let C = { {a,b,c} (a,b,c) M} It can easily be verified that C contains an exact 3-cover for X IFF M contains a matching. 1.86

87 Exact Cover by 3-Sets (X3C) Theorem: X3C is NP-complete Proof: 1) X3C NP 2) 3DM X3C Another way to view this is as a restriction from X3C to 3DM consider those instances of X3C where X can be partitioned into 3 disjoint sets W, Y, and Z, and where each 3-element set C contains exactly one element from each of these sets. 1.87

88 MINIMUM COVER EXACT COVER BY 3-SETS (X3C) INSTANCE: A finite set X with X = 3q and a collection C of 3-element subsets of X. QUESTION: Does C contain an exact cover for X, that is, a sub-collection C C such that every element of X occurs in exactly one member of C? 1.88

89 Hitting Set HITTING SET INSTANCE: A collection C of subsets of a set S, positive integer K. QUESTION: Does S contain a hitting set for C of size K or less, that is, a subset S S with S K and such that S contains at least one element from each subset in C? Proof: Restrict to VC by considering those instances having c = 2 for all c C. VERTEX COVER (VC) INSTANCE: A Graph G = (V, E) and a positive integer K <= V. QUESTION: Is there a vertex cover of size K or less for G, that is, a subset V V such that V <= K and, for each edge {u,v} E, at least one of u and v belongs to V? 1.89

90 Subgraph Isomorphism SUBGRAPH ISOMORPHISM INSTANCE: Two graphs G = (V 1, E 1 ) and H = (V 2, E 2 ). QUESTION: Does G contain a subgraph isomorphic to H, that is, a subset V V 1 and a subset E E 1 such that V = V 2, E = E 2, and there exists a one-to-one function f : V 2 V satisfying {u,v} E 2 if and only if {f(u),f(v)} E. Proof: Restrict to CLIQUE by considering those instances where H is a complete graph, that is, E 2 contains all possible edges joining two members of V 2. CLIQUE INSTANCE: A Graph G = (V, E) and a positive integer J <= V. QUESTION: Does G contain a clique of size J or more? 1.90

91 Bounded Degree Spanning Tree Let G=(V,E) be a graph and let E E. Then T=(V,E ) is said to be a spanning tree if T is connected and E = V -1 (i.e., T contains no cycles). BOUNDED DEGREE SPANNING TREE INSTANCE: A graph G = (V, E) and a positive integer K V -1. QUESTION: Is there a spanning tree for G in which no vertex has degree exceeding K, that is, a subset E E such that E = V -1, the graph G = (V, E ) is connected, and no vertex in V is included in more than K edges from E? Proof: Restrict to HAMILTONIAN PATH by considering only instances where K=2. HAMILTONIAN PATH (HP) INSTANCE: A Graph G = (V, E), and vertices u,v V. QUESTION: Is there a Hamiltonian path from vertex u to vertex v, that is an ordering < v 1, v 2,,v n > of the vertices of G, where n = V, such that u = v 1, v = v n, and {v i, v i+1 } E for all i, 1 i n. FACT: HP is NP-complete (see page 60). 1.91

92 Minimum Equivalent Digraph MINIMUM EQUIVALENT DIGRAPH INSTANCE: A directed graph G = (V, A) and a positive integer K A. QUESTION: Is there a directed graph G = (V, A ) such that A A, A K, and such that, for every pair of vertices u and v in V, G contains a directed path from u to v if and only if G contains a directed path from u to v. Proof: Restrict to DIRECTED HAMILTONIAN CIRCUIT by considering those instances where G is strongly connected, that is, contains a path from every vertex u to every vertex v, and K= V. Note that this is technically a restriction to DIRECTED HAMILTONIAN CIRCUIT FOR STRONGLY CONNECTED DIGRAPHS, but the NP-completeness of that problem follows immediately from the constructions given for HC and DIRECTED HC. 1.92

93 Knapsack KNAPSACK INSTANCE: A finite set U and a size s(u) Z + and a value s(v) Z + for each u U, a size constraint B Z +, and a value goal K Z +. QUESTION: Is there a subset U U such that: and Proof: Restrict to PARTITION by considering only those instances where s(u) = v(u) for all u U and: PARTITION uu ' s( u) B uu ' uu INSTANCE: A finite set A and a size s(a) Z + for each a A. QUESTION: Is there a subset A A such that: v( u) K B K 1/ 2 s( u) aa' s( a) aa A' s( a) 1.93

94 Knapsack KNAPSACK INSTANCE: A finite set U and a size s(u) Z + and a value s(v) Z + for each u U, and a value goal K Z +. QUESTION: Is there a subset U U such that: uu ' v( u) K 1.94

95 Multiprocessor Scheduling MULTIPROCESSOR SCHEDULING INSTANCE: A finite set A of tasks, a length l(a) Z + for each a A, a number m Z + of processors, and a deadline D Z +. QUESTION: Is there a partition A = A 1 A 2 A m of A into m disjoint sets such that: max{ a A i l( a) :1 i m} D? Proof: Restrict to PARTITION by considering only those instances where m=2 and: D 1/ 2 l( a) aa PARTITION INSTANCE: A finite set A and a size s(a) Z + for each a A. QUESTION: Is there a subset A A such that: aa' s( a) aa A' s( a) 1.95

96 Invalid Restriction Subset Sum INSTANCE: Integers a 1, a 2,,a n and integer B. QUESTION: Is there a sequence of 0 s and 1 s, x 1, x 2,,x n such that: Fact: Subset Sum is NP-complete n i1 a i x i B? Real Subset Sum INSTANCE: Integers a 1, a 2,,a n and integer B. QUESTION: Is there a sequence of real numbers x 1, x 2,,x n such that: n i1 a i x i B? 1.96

97 Invalid Restriction, Cont. Claim (from a Ph.D disseration): Subset Sum is just a special case of Real Subset Sum Therefore, Real Subset Sum is NP-complete The proof is in error since it restricts the question, and not the instances. In fact, the problem is actually trivially solvable in polynomial time simply taking x 1 = B/a 1 and x i = 0, for all i, where 2 i n. Also note that the restriction does not preserve yes and no instances (in fact, all are yes instances). 1.97

98 Other Invalid Restrictions Some other invalid restrictions: 4-DM is NP-complete because it contains 3-DM as a special case. 4-SAT is NP-complete because it contains 3-SAT as a special case. In these cases, the instances of one aren t even a subset of the other! 1.98

99 Homework #2 See page 75, the first group: Longest Path Set Packing Partition into Hamiltonian Subgraphs Largest Common Subgraph Minimum Sum of Squares Give an NP-completeness proof for each of the above by restriction. Hand in any two. 1.99

100 Local Replacement Transformations are: sufficiently non-trivial to warrant spelling out details (in contrast to restriction) still relatively simple First example transforming SAT to 3-SAT: each clause in SAT was locally replaced by 1 or more clauses in 3-SAT Replacement of one clause was independent of all other clauses 1.100

101 Partition into Triangles Partition into Triangles INSTANCE: A Graph G = (V, E), with V = 3q. QUESTION: Is there a partition of V into q disjoint sets V 1, V 2,,V q of three vertices each such that, for each V i = {v i[1], v i[2], v i[3] } the three edges {v i[1], v i[2] }, {v i[1], v i[3] } and {v i[2], v i[3] } all belong to E? Theorem: Partition into Triangles is NP-complete Proof: 1) Partition into Triangles NP 2) X3C Partition into Triangles 1.101

102 Local Replacement Let set X with X = 3q and let C be a collection of 3-element subsets of X. Construct a graph G = (V,E) as follows: For each set c i = {x i,y i,z i } in C, create the following vertices and edges: That s it! 1.102

103 3-Dimensional Matching Can you draw the graph? q = 3 (not part of input technically) X = {a 1, a 2, a 3, b 1, b 2, b 3, c 1, c 2, c 3 } M = { (a 1, b 2, c 1 ), (a 2, b 1, c 3 ), (a 3, b 3, c 2 ), (a 1, b 1, c 3 ), (a 2, b 2, c 1 ) } Note the first 3 form an exact 3-cover

104 Local Replacement The resulting graph G = (V,E) can be partitioned into triangles IFF there is a sub-collection C C such that every element of X occurs in exactly one member of C. (if) Suppose there is a sub-collection C C such that every element of X occurs in exactly one member of C. Consider each triple from C. in C not in C {x 1,y 1,z 1 } {x 2,y 2,z 2 } {x 3,y 3,z 3 } {x k,y k,z k } It is easy to see that this gives a partition of G = (V,E) into triangles

105 Local Replacement (only if) Suppose the resulting graph G = (V,E) can be partitioned into triangles. Note that each component must be partitioned into one of two ways. can t happen in a valid partition {x 1,y 1,z 1 } {x 2,y 2,z 2 } In the first case, put the corresponding triple in C, and in the second case, don t. It is easy to see that the resulting sub-collection C C is an exact cover for X

106 Component Design The most complicated of the 3 types of proofs. Constructs components in the target instance from components of the given instance: not a simple one-to-one mapping, in contrast to local replacement typically between different types of problems Components serve two purposes typically: making choices selecting vertices or truth assignments testing properties making sure all edges are covered or that clauses are satisfied Additionally, the choice-components are connected to the testing components in such as way to ensure choices satisfy required properties. Examples: 3 Dimensional Matching (slide 27) Vertex Cover (slide 40) or is this local replacement? Hamiltonian Circuit (slide 49) 1.106

107 Component Design MINIMUM TARDINESS SEQUENCING INSTANCE: A finite set T of tasks, each t T having length 1 and a deadline d(t) Z +, a partial order on T, and a non-negative integer K T. QUESTION: Is there a schedule σ:t {0,1,, T -1} such that σ(t) σ(t ) whenever t t, such σ(t) < σ(t ) whenever t t, and such that {t T: σ(t)+1>d(t)} K? Theorem: Minimum Tardiness Sequencing is NP-complete Proof: 1) Minimum Tardiness Sequencing NP 2) CLIQUE Minimum Tardiness Sequencing Let the graph G=(V,E) and positive integer J V be an arbitrary instance of CLIQUE. Construct an instance of Minimum Tardiness Sequencing as follows

108 Component Design 1.108

109 Component Design Observation #1: A schedule is an ordering of the tasks, from 0 to T -1. Consequently, any schedule for the tasks will look as follows: 0 J(J+1)/2 T = V + E (edge task deadline) We need to show that the G = (V,E) contains a clique of size J IFF the resulting set of tasks has a minimum tardiness schedule

110 Component Design (only if) Suppose the graph G contains a clique of size J. Construct a schedule as follows: clique vertices clique edges J vertex tasks J(J-1)/2 edge tasks V - J vertex tasks E - J(J-1)/2 edge tasks 0 J(J+1)/2 T = V + E (edge task deadline) 1.110

111 Component Design (if) Suppose there is a schedule σ:t {0,1,, T -1} such that σ(t) σ(t ) whenever t t, such σ(t) < σ(t ) whenever t t, and such that {t T: σ(t)+1>d(t)} K? Observation #1: At least J(J-1)/2 of the edge tasks must be scheduled before the edge deadline; otherwise, too many edge tasks would be late. J vertex tasks J(J-1)/2 edge tasks 0 J(J+1)/2 T = V + E (edge task deadline) Observation #2: At least J vertex tasks must also occur prior to the edge task deadline; this is because the minimum number of vertices on J(J-1)/2 edges is J

112 Component Design Observation #3: Since there are at least J vertex tasks, and at least J(J-1)/2 edge tasks prior to the deadline J(J+1)/2, it follows there must be exactly J vertex tasks and exactly J(J-1)/2 edge tasks prior to the deadline J(J+1)/2. Observation #4: The J vertex tasks must also occur before the J(J-1)/2 edge tasks because of the partial order J vertex tasks J(J-1)/2 edge tasks 0 J(J+1)/2 T = V + E (edge task deadline) It follows that the J vertex tasks and the J(J-1)/2 edge tasks form a clique in the graph G=(V,E)

113 Homework #3 Which category would these be? 3-SAT (slide 10) Hypergraph 2-colorability (slide 22) Clique (slide 45) Independent Set (slide 45) Independent Set (slide 68) 4-Dimensional Matching (71) Partition (slide 75) 1.113

1.1 P, NP, and NP-complete

1.1 P, NP, and NP-complete CSC5160: Combinatorial Optimization and Approximation Algorithms Topic: Introduction to NP-complete Problems Date: 11/01/2008 Lecturer: Lap Chi Lau Scribe: Jerry Jilin Le This lecture gives a general introduction

More information

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems

More information

8.5 Sequencing Problems

8.5 Sequencing Problems 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,

More information

NP-Completeness. NP-Completeness 1

NP-Completeness. NP-Completeness 1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and

More information

Introduction to Complexity Theory

Introduction to Complexity Theory Introduction to Complexity Theory Read K & S Chapter 6. Most computational problems you will face your life are solvable (decidable). We have yet to address whether a problem is easy or hard. Complexity

More information

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof T-79.5103 / Autumn 2006 NP-complete problems 1 NP-COMPLETE PROBLEMS Characterizing NP Variants of satisfiability Graph-theoretic problems Coloring problems Sets and numbers Pseudopolynomial algorithms

More information

In NP: guess a satisfying assignment and verify that it indeed satisfies

In NP: guess a satisfying assignment and verify that it indeed satisfies 3SAT is NP-complete 3SAT denotes the following restriction of satisfiability. INSTANCE: A set of variables, U, and a set of clauses, C, such that each clause contains exactly 3 literals. QUESTION: Is C

More information

Theory of Computation Chapter 9

Theory of Computation Chapter 9 0-0 Theory of Computation Chapter 9 Guan-Shieng Huang May 12, 2003 NP-completeness Problems NP: the class of languages decided by nondeterministic Turing machine in polynomial time NP-completeness: Cook

More information

NP-Complete Problems. More reductions

NP-Complete Problems. More reductions NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM

More information

CS 583: Algorithms. NP Completeness Ch 34. Intractability

CS 583: Algorithms. NP Completeness Ch 34. Intractability CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working

More information

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2) Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set

More information

Polynomial-time Reductions

Polynomial-time Reductions Polynomial-time Reductions Disclaimer: Many denitions in these slides should be taken as the intuitive meaning, as the precise meaning of some of the terms are hard to pin down without introducing the

More information

CS/COE

CS/COE CS/COE 1501 www.cs.pitt.edu/~nlf4/cs1501/ P vs NP But first, something completely different... Some computational problems are unsolvable No algorithm can be written that will always produce the correct

More information

NP-Complete Reductions 2

NP-Complete Reductions 2 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete

More information

Complexity theory for fellow CS students

Complexity theory for fellow CS students This document contains some basics of the complexity theory. It is mostly based on the lecture course delivered at CS dept. by Meran G. Furugyan. Differences are subtle. Disclaimer of warranties apply:

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Chapter 34: NP-Completeness

Chapter 34: NP-Completeness Graph Algorithms - Spring 2011 Set 17. Lecturer: Huilan Chang Reference: Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms, 2nd Edition, The MIT Press. Chapter 34: NP-Completeness 2. Polynomial-time

More information

NP-Complete Reductions 1

NP-Complete Reductions 1 x x x 2 x 2 x 3 x 3 x 4 x 4 CS 4407 2 22 32 Algorithms 3 2 23 3 33 NP-Complete Reductions Prof. Gregory Provan Department of Computer Science University College Cork Lecture Outline x x x 2 x 2 x 3 x 3

More information

Limits to Approximability: When Algorithms Won't Help You. Note: Contents of today s lecture won t be on the exam

Limits to Approximability: When Algorithms Won't Help You. Note: Contents of today s lecture won t be on the exam Limits to Approximability: When Algorithms Won't Help You Note: Contents of today s lecture won t be on the exam Outline Limits to Approximability: basic results Detour: Provers, verifiers, and NP Graph

More information

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P Easy Problems vs. Hard Problems CSE 421 Introduction to Algorithms Winter 2000 NP-Completeness (Chapter 11) Easy - problems whose worst case running time is bounded by some polynomial in the size of the

More information

Computational complexity theory

Computational complexity theory Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 25 NP Completeness Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 NP-Completeness Some

More information

NP-completeness. Chapter 34. Sergey Bereg

NP-completeness. Chapter 34. Sergey Bereg NP-completeness Chapter 34 Sergey Bereg Oct 2017 Examples Some problems admit polynomial time algorithms, i.e. O(n k ) running time where n is the input size. We will study a class of NP-complete problems

More information

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65 Undecidable Problems Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, 2018 1/ 65 Algorithmically Solvable Problems Let us assume we have a problem P. If there is an algorithm solving

More information

NP-Complete Problems

NP-Complete Problems NP-Complete Problems Max Bisection Is NP-Complete max cut becomes max bisection if we require that S = V S. We shall reduce the more general max cut to max bisection. Add V isolated nodes to G to yield

More information

Computational complexity theory

Computational complexity theory Computational complexity theory Introduction to computational complexity theory Complexity (computability) theory deals with two aspects: Algorithm s complexity. Problem s complexity. References S. Cook,

More information

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 8.5 Sequencing Problems Basic genres.! Packing problems: SET-PACKING,

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 20 February 23, 2018 February 23, 2018 CS21 Lecture 20 1 Outline the complexity class NP NP-complete probelems: Subset Sum NP-complete problems: NAE-3-SAT, max

More information

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle Directed Hamiltonian Cycle Chapter 8 NP and Computational Intractability Claim. G has a Hamiltonian cycle iff G' does. Pf. Suppose G has a directed Hamiltonian cycle Γ. Then G' has an undirected Hamiltonian

More information

ECS122A Handout on NP-Completeness March 12, 2018

ECS122A Handout on NP-Completeness March 12, 2018 ECS122A Handout on NP-Completeness March 12, 2018 Contents: I. Introduction II. P and NP III. NP-complete IV. How to prove a problem is NP-complete V. How to solve a NP-complete problem: approximate algorithms

More information

Chapter 8. NP and Computational Intractability

Chapter 8. NP and Computational Intractability Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Acknowledgement: This lecture slide is revised and authorized from Prof.

More information

NP-problems continued

NP-problems continued NP-problems continued Page 1 Since SAT and INDEPENDENT SET can be reduced to each other we might think that there would be some similarities between the two problems. In fact, there is one such similarity.

More information

More on NP and Reductions

More on NP and Reductions Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data

More information

Lecture 18: More NP-Complete Problems

Lecture 18: More NP-Complete Problems 6.045 Lecture 18: More NP-Complete Problems 1 The Clique Problem a d f c b e g Given a graph G and positive k, does G contain a complete subgraph on k nodes? CLIQUE = { (G,k) G is an undirected graph with

More information

SAT, Coloring, Hamiltonian Cycle, TSP

SAT, Coloring, Hamiltonian Cycle, TSP 1 SAT, Coloring, Hamiltonian Cycle, TSP Slides by Carl Kingsford Apr. 28, 2014 Sects. 8.2, 8.7, 8.5 2 Boolean Formulas Boolean Formulas: Variables: x 1, x 2, x 3 (can be either true or false) Terms: t

More information

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch] NP-Completeness Andreas Klappenecker [based on slides by Prof. Welch] 1 Prelude: Informal Discussion (Incidentally, we will never get very formal in this course) 2 Polynomial Time Algorithms Most of the

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.

More information

8.5 Sequencing Problems. Chapter 8. NP and Computational Intractability. Hamiltonian Cycle. Hamiltonian Cycle

8.5 Sequencing Problems. Chapter 8. NP and Computational Intractability. Hamiltonian Cycle. Hamiltonian Cycle Chapter 8 NP and Computational Intractability 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems:

More information

Computational Complexity

Computational Complexity Computational Complexity Problems, instances and algorithms Running time vs. computational complexity General description of the theory of NP-completeness Problem samples 1 Computational Complexity What

More information

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM 8. INTRACTABILITY I poly-time reductions packing and covering problems constraint satisfaction problems sequencing problems partitioning problems graph coloring numerical problems Lecture slides by Kevin

More information

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness

Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness Marc Uetz University of Twente m.uetz@utwente.nl Lecture 9: sheet 1 / 31 Marc Uetz Discrete Optimization Outline 1 N P and co-n P 2 N P-completeness

More information

NP-Hardness reductions

NP-Hardness reductions NP-Hardness reductions Definition: P is the class of problems that can be solved in polynomial time, that is n c for a constant c Roughly, if a problem is in P then it's easy, and if it's not in P then

More information

Polynomial-time reductions. We have seen several reductions:

Polynomial-time reductions. We have seen several reductions: Polynomial-time reductions We have seen several reductions: Polynomial-time reductions Informal explanation of reductions: We have two problems, X and Y. Suppose we have a black-box solving problem X in

More information

NP Complete Problems. COMP 215 Lecture 20

NP Complete Problems. COMP 215 Lecture 20 NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst

More information

Hardness of Approximation

Hardness of Approximation Hardness of Approximation We have seen several methods to find approximation algorithms for NP-hard problems We have also seen a couple of examples where we could show lower bounds on the achievable approxmation

More information

CS Fall 2011 P and NP Carola Wenk

CS Fall 2011 P and NP Carola Wenk CS3343 -- Fall 2011 P and NP Carola Wenk Slides courtesy of Piotr Indyk with small changes by Carola Wenk 11/29/11 CS 3343 Analysis of Algorithms 1 We have seen so far Algorithms for various problems Running

More information

Lecture 4: NP and computational intractability

Lecture 4: NP and computational intractability Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 18 February 16, 2018 February 16, 2018 CS21 Lecture 18 1 Outline the complexity class NP 3-SAT is NP-complete NP-complete problems: independent set, vertex cover,

More information

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes: Classes of Problems We can characterize many problems into three classes: CS 461, Lecture 23 Jared Saia University of New Mexico P is the set of yes/no problems that can be solved in polynomial time. Intuitively

More information

CSCI3390-Lecture 17: A sampler of NP-complete problems

CSCI3390-Lecture 17: A sampler of NP-complete problems CSCI3390-Lecture 17: A sampler of NP-complete problems 1 List of Problems We now know that if L is any problem in NP, that L P SAT, and thus SAT is NP-hard. Since SAT is also in NP we find that SAT is

More information

NP Completeness and Approximation Algorithms

NP Completeness and Approximation Algorithms Winter School on Optimization Techniques December 15-20, 2016 Organized by ACMU, ISI and IEEE CEDA NP Completeness and Approximation Algorithms Susmita Sur-Kolay Advanced Computing and Microelectronic

More information

Today: NP-Completeness (con t.)

Today: NP-Completeness (con t.) Today: NP-Completeness (con t.) COSC 581, Algorithms April 22, 2014 Many of these slides are adapted from several online sources Reading Assignments Today s class: Chapter 34.5 (con t.) Recall: Proving

More information

Limitations of Algorithm Power

Limitations of Algorithm Power Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying

More information

Data Structures and Algorithms (CSCI 340)

Data Structures and Algorithms (CSCI 340) University of Wisconsin Parkside Fall Semester 2008 Department of Computer Science Prof. Dr. F. Seutter Data Structures and Algorithms (CSCI 340) Homework Assignments The numbering of the problems refers

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Problem set 8: solutions 1. Fix constants a R and b > 1. For n N, let f(n) = n a and g(n) = b n. Prove that f(n) = o ( g(n) ). Solution. First we observe that g(n) 0 for all

More information

Computational Intractability 2010/4/15. Lecture 2

Computational Intractability 2010/4/15. Lecture 2 Computational Intractability 2010/4/15 Professor: David Avis Lecture 2 Scribe:Naoki Hatta 1 P and NP 1.1 Definition of P and NP Decision problem it requires yes/no answer. Example: X is a set of strings.

More information

Algorithms Design & Analysis. Approximation Algorithm

Algorithms Design & Analysis. Approximation Algorithm Algorithms Design & Analysis Approximation Algorithm Recap External memory model Merge sort Distribution sort 2 Today s Topics Hard problem Approximation algorithms Metric traveling salesman problem A

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Review Basic reduction strategies. Simple equivalence: INDEPENDENT-SET P VERTEX-COVER. Special case to general case: VERTEX-COVER P SET-COVER. Encoding with gadgets:

More information

CSCI 1590 Intro to Computational Complexity

CSCI 1590 Intro to Computational Complexity CSCI 1590 Intro to Computational Complexity NP-Complete Languages John E. Savage Brown University February 2, 2009 John E. Savage (Brown University) CSCI 1590 Intro to Computational Complexity February

More information

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

More information

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA. Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA NP Completeness Susmita Sur-Kolay Advanced Computing and Microelectronics Unit

More information

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem? Admin Two more assignments No office hours on tomorrow NP-COMPLETE PROBLEMS Run-time analysis Tractable vs. intractable problems We ve spent a lot of time in this class putting algorithms into specific

More information

4/30/14. Chapter Sequencing Problems. NP and Computational Intractability. Hamiltonian Cycle

4/30/14. Chapter Sequencing Problems. NP and Computational Intractability. Hamiltonian Cycle Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 2 Hamiltonian Cycle 8.5 Sequencing Problems HAM-CYCLE: given an undirected

More information

CSE 421 NP-Completeness

CSE 421 NP-Completeness CSE 421 NP-Completeness Yin at Lee 1 Cook-Levin heorem heorem (Cook 71, Levin 73): 3-SA is NP-complete, i.e., for all problems A NP, A p 3-SA. (See CSE 431 for the proof) So, 3-SA is the hardest problem

More information

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter 2006 NP-Completeness (Chapter 8) Given positive integers a, b, c Question 1: does there exist a positive integer x such that

More information

CSI 4105 MIDTERM SOLUTION

CSI 4105 MIDTERM SOLUTION University of Ottawa CSI 4105 MIDTERM SOLUTION Instructor: Lucia Moura Feb 6, 2010 10:00 am Duration: 1:50 hs Closed book Last name: First name: Student number: There are 4 questions and 100 marks total.

More information

Graph Theory and Optimization Computational Complexity (in brief)

Graph Theory and Optimization Computational Complexity (in brief) Graph Theory and Optimization Computational Complexity (in brief) Nicolas Nisse Inria, France Univ. Nice Sophia Antipolis, CNRS, I3S, UMR 7271, Sophia Antipolis, France September 2015 N. Nisse Graph Theory

More information

NP-complete Problems

NP-complete Problems NP-complete Problems HP, TSP, 3COL, 0/1IP Dimitris Diamantis µπλ November 6, 2014 Dimitris Diamantis (µπλ ) NP-complete Problems November 6, 2014 1 / 34 HAMILTON PATH is NP-Complete Definition Given an

More information

There are two types of problems:

There are two types of problems: Np-complete Introduction: There are two types of problems: Two classes of algorithms: Problems whose time complexity is polynomial: O(logn), O(n), O(nlogn), O(n 2 ), O(n 3 ) Examples: searching, sorting,

More information

CS 5114: Theory of Algorithms

CS 5114: Theory of Algorithms CS 5114: Theory of Algorithms Clifford A. Shaffer Department of Computer Science Virginia Tech Blacksburg, Virginia Spring 2014 Copyright c 2014 by Clifford A. Shaffer CS 5114: Theory of Algorithms Spring

More information

NP-Complete problems

NP-Complete problems NP-Complete problems NP-complete problems (NPC): A subset of NP. If any NP-complete problem can be solved in polynomial time, then every problem in NP has a polynomial time solution. NP-complete languages

More information

Notes for Lecture 21

Notes for Lecture 21 U.C. Berkeley CS170: Intro to CS Theory Handout N21 Professor Luca Trevisan November 20, 2001 Notes for Lecture 21 1 Tractable and Intractable Problems So far, almost all of the problems that we have studied

More information

1. Introduction Recap

1. Introduction Recap 1. Introduction Recap 1. Tractable and intractable problems polynomial-boundness: O(n k ) 2. NP-complete problems informal definition 3. Examples of P vs. NP difference may appear only slightly 4. Optimization

More information

Out-colourings of Digraphs

Out-colourings of Digraphs Out-colourings of Digraphs N. Alon J. Bang-Jensen S. Bessy July 13, 2017 Abstract We study vertex colourings of digraphs so that no out-neighbourhood is monochromatic and call such a colouring an out-colouring.

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

Introduction to Computational Complexity

Introduction to Computational Complexity Introduction to Computational Complexity Tandy Warnow October 30, 2018 CS 173, Introduction to Computational Complexity Tandy Warnow Overview Topics: Solving problems using oracles Proving the answer to

More information

NP-problems continued

NP-problems continued NP-problems continued Page 1 Since SAT and INDEPENDENT SET can be reduced to each other we might think that there would be some similarities between the two problems. In fact, there is one such similarity.

More information

1 Non-deterministic Turing Machine

1 Non-deterministic Turing Machine 1 Non-deterministic Turing Machine A nondeterministic Turing machine is a generalization of the standard TM for which every configuration may yield none, or one or more than one next configurations. In

More information

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010 CS311 Computational Structures NP-completeness Lecture 18 Andrew P. Black Andrew Tolmach 1 Some complexity classes P = Decidable in polynomial time on deterministic TM ( tractable ) NP = Decidable in polynomial

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURES 30-31 NP-completeness Definition NP-completeness proof for CIRCUIT-SAT Adam Smith 11/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova,

More information

Lecture 15 - NP Completeness 1

Lecture 15 - NP Completeness 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 29, 2018 Lecture 15 - NP Completeness 1 In the last lecture we discussed how to provide

More information

More NP-Complete Problems

More NP-Complete Problems CS 473: Algorithms, Spring 2018 More NP-Complete Problems Lecture 23 April 17, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 57 Recap NP: languages/problems that have

More information

COP 4531 Complexity & Analysis of Data Structures & Algorithms

COP 4531 Complexity & Analysis of Data Structures & Algorithms COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According

More information

Formal definition of P

Formal definition of P Since SAT and INDEPENDENT SET can be reduced to each other we might think that there would be some similarities between the two problems. In fact, there is one such similarity. In SAT we want to know if

More information

Computers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness

Computers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory Background: Find a good method for determining whether or not any given set of specifications for a

More information

NP-Completeness Review

NP-Completeness Review CS124 NP-Completeness Review Where We Are Headed Up to this point, we have generally assumed that if we were given a problem, we could find a way to solve it. Unfortunately, as most of you know, there

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 31 P and NP Self-reducibility NP-completeness Adam Smith 12/1/2008 S. Raskhodnikova; based on slides by K. Wayne Central ideas we ll cover Poly-time as feasible most

More information

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms Computer Science 385 Analysis of Algorithms Siena College Spring 2011 Topic Notes: Limitations of Algorithms We conclude with a discussion of the limitations of the power of algorithms. That is, what kinds

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Homework 5 due on March 29 th at 11:59 PM (on Blackboard) Recap Polynomial Time Reductions (X P Y ) P Decision problems

More information

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1 NP CS 320, Fall 2017 Dr. Geri Georg, Instructor georg@colostate.edu 320 NP 1 NP Complete A class of problems where: No polynomial time algorithm has been discovered No proof that one doesn t exist 320

More information

Computers and Intractability

Computers and Intractability Computers and Intractability A Guide to the Theory of NP-Completeness The Bible of complexity theory M. R. Garey and D. S. Johnson W. H. Freeman and Company, 1979 The Bandersnatch problem Background: Find

More information

3/22/2018. CS 580: Algorithm Design and Analysis. Circuit Satisfiability. Recap. The "First" NP-Complete Problem. Example.

3/22/2018. CS 580: Algorithm Design and Analysis. Circuit Satisfiability. Recap. The First NP-Complete Problem. Example. Circuit Satisfiability CS 580: Algorithm Design and Analysis CIRCUIT-SAT. Given a combinational circuit built out of AND, OR, and NOT gates, is there a way to set the circuit inputs so that the output

More information

Automata Theory CS S-18 Complexity Theory II: Class NP

Automata Theory CS S-18 Complexity Theory II: Class NP Automata Theory CS411-2015S-18 Complexity Theory II: Class NP David Galles Department of Computer Science University of San Francisco 18-0: Language Class P A language L is polynomially decidable if there

More information

Polynomial-Time Reductions

Polynomial-Time Reductions Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel

More information

Geometric Steiner Trees

Geometric Steiner Trees Geometric Steiner Trees From the book: Optimal Interconnection Trees in the Plane By Marcus Brazil and Martin Zachariasen Part 3: Computational Complexity and the Steiner Tree Problem Marcus Brazil 2015

More information

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas CSE 417 Introduction to Algorithms Winter 2007 Some Algebra Problems (Algorithmic) Given positive integers a, b, c Question 1: does there exist a positive integer x such that ax = c? NP-Completeness (Chapter

More information

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9 1 Computational Complexity and Intractability: An Introduction to the Theory of NP Chapter 9 2 Objectives Classify problems as tractable or intractable Define decision problems Define the class P Define

More information