
Theory of Computer Science May 30, 2016 | E4. Some NP-Complete Problems, Part I Theory of Computer Science E4.1 Overview E4. Some NP-Complete Problems, Part I E4.2 3SAT Malte Helmert University of Basel E4.3 Graph Problems May 30, 2016 E4.4 Summary M. Helmert (Univ. Basel) Theorie May 30, 2016 1 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 2 / 38 Overview: Course Overview: Complexity Theory contents of this course: logic I X Complexity Theory . How can knowledge be represented? . How can reasoning be automated? E1. Motivation and Introduction E2. P, NP and Polynomial Reductions I automata theory and formal languages X . What is a computation? E3. Cook-Levin Theorem I computability theory X E4. Some NP-Complete Problems, Part I . What can be computed at all? E5. Some NP-Complete Problems, Part II I complexity theory . What can be computed efficiently? M. Helmert (Univ. Basel) Theorie May 30, 2016 3 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 4 / 38 Further Reading (German) Further Reading (English) Literature for this Chapter (German) Literature for this Chapter (English) Introduction to the Theory of Computation by Michael Sipser (3rd edition) Theoretische Informatik { kurz gefasst by Uwe Sch¨oning(5th edition) I Chapter 7.4 and 7.5 Note: I Chapter 3.3 I Sipser does not cover all problems that we do. M. Helmert (Univ. Basel) Theorie May 30, 2016 5 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 6 / 38 E4. Some NP-Complete Problems, Part I Overview E4. Some NP-Complete Problems, Part I Overview Further NP-Complete Problems I The proof of NP-completeness for SAT was complicated. I But with its help, we can now prove much more easily that further problems are NP-complete. E4.1 Overview Theorem (Proving NP-Completeness by Reduction) Let A and B be problems such that: I A is NP-hard, and I A ≤p B. Then B is also NP-hard. If furthermore B 2 NP, then B is NP-complete. Proof. First part shown in the exercises. Second part follows directly by definition of NP-completeness. M. Helmert (Univ. Basel) Theorie May 30, 2016 7 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 8 / 38 E4. Some NP-Complete Problems, Part I Overview E4. Some NP-Complete Problems, Part I Overview NP-Complete Problems Overview of the Reductions SAT I There are thousands of known NP-complete problems. I An extensive catalog of NP-complete problems from many areas of computer science is contained in: 3SAT Michael R. Garey and David S. Johnson: Computers and Intractability | Clique DirHamiltonCycle SubsetSum A Guide to the Theory of NP-Completeness W. H. Freeman, 1979. IndSet HamiltonCycle Partition I In the remaining two chapters, we get to know some of these problems. VertexCover TSP BinPacking M. Helmert (Univ. Basel) Theorie May 30, 2016 9 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 10 / 38 E4. Some NP-Complete Problems, Part I Overview E4. Some NP-Complete Problems, Part I Overview What Do We Have to Do? SAT ≤p 3SAT SAT I We want to show the NP-completeness of these 11 problems. I We already know that SAT is NP-complete. 3SAT I Hence it is sufficient to show I that polynomial reductions exist for all edges in the figure (and thus all problems are NP-hard) Clique DirHamiltonCycle SubsetSum I and that the problems are all in NP. (It would be sufficient to show membership in NP only for the leaves in the figure. But membership is so easy to show IndSet HamiltonCycle Partition that this would not save any work.) VertexCover TSP BinPacking M. Helmert (Univ. Basel) Theorie May 30, 2016 11 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 12 / 38 E4. Some NP-Complete Problems, Part I 3SAT E4. Some NP-Complete Problems, Part I 3SAT SAT and 3SAT Definition (Reminder: SAT) The problem SAT (satisfiability) is defined as follows: E4.2 3SAT Given: a propositional logic formula ' Question: Is ' satisfiable? Definition (3SAT) The problem 3SAT is defined as follows: Given: a propositional logic formula ' in conjunctive normal form with at most three literals per clause Question: Is ' satisfiable? M. Helmert (Univ. Basel) Theorie May 30, 2016 13 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 14 / 38 E4. Some NP-Complete Problems, Part I 3SAT E4. Some NP-Complete Problems, Part I 3SAT 3SAT is NP-Complete (1) 3SAT is NP-Complete (2) Proof. 3SAT 2 NP: guess and check. 3SAT is NP-hard: We show SAT ≤p 3SAT. I Let ' be the given input for SAT. Let Sub(') denote Theorem (3SAT is NP-Complete) the set of subformulas of ', including ' itself. 3SAT is NP-complete. I For all 2 Sub('), we introduce a new proposition X . I For each new proposition X , define the following auxiliary formula χ : I If = A for an atom A: χ =( X $ A) 0 I If = : : χ =( X $ :X 0 ) 0 00 I If = ( ^ ): χ =( X $ (X 0 ^ X 00 )) 0 00 I If = ( _ ): χ =( X $ (X 0 _ X 00 )) ... M. Helmert (Univ. Basel) Theorie May 30, 2016 15 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 16 / 38 E4. Some NP-Complete Problems, Part I 3SAT E4. Some NP-Complete Problems, Part I 3SAT 3SAT is NP-Complete (3) Restricted 3SAT Proof (continued). Note: 3SAT remains NP-complete if we also require that I Consider the conjunction of all these auxiliary formulas, V I every clause contains exactly three literals and χall := 2Sub(') χ . I a clause may not contain the same literal twice I Every interpretation I of the original variables can be 0 Idea: extended to a model I of χall in exactly one way: 0 for each 2 Sub('), set I (X ) = 1 iff I j= . I remove duplicated literals from each clause. I It follows that ' is satisfiable iff (χall ^ X') is satisfiable. I add new variables: X , Y , Z I This formula can be computed in linear time. I add new clauses: (X _ Y _ Z), (X _ Y _:Z), (X _:Y _ Z), I It can also be converted to 3-CNF in linear time (:X _ Y _ Z), (X _:Y _:Z), (:X _ Y _:Z), because it is the conjunction of constant-size parts (:X _:Y _ Z) involving at most three variables each. satisfied if and only if X , Y , Z are all true (Each part can be converted to 3-CNF independently.) I fill up clauses with fewer than three literals I Hence, this describes a polynomial-time reduction. with :X and if necessary additionally with :Y M. Helmert (Univ. Basel) Theorie May 30, 2016 17 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 18 / 38 E4. Some NP-Complete Problems, Part I Graph Problems E4. Some NP-Complete Problems, Part I Graph Problems 3SAT ≤p Clique SAT E4.3 Graph Problems 3SAT Clique DirHamiltonCycle SubsetSum IndSet HamiltonCycle Partition VertexCover TSP BinPacking M. Helmert (Univ. Basel) Theorie May 30, 2016 19 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 20 / 38 E4. Some NP-Complete Problems, Part I Graph Problems E4. Some NP-Complete Problems, Part I Graph Problems Clique Clique is NP-Complete (1) Definition (Clique) The problem Clique is defined as follows: Theorem (Clique is NP-Complete) Given: undirected graph G = hV ; Ei, number K 2 N0 Question: Does G have a clique of size at least K, Clique is NP-complete. i. e., a set of vertices C ⊆ V with jCj ≥ K and fu; vg 2 E for all u; v 2 C with u 6= v? German: Clique M. Helmert (Univ. Basel) Theorie May 30, 2016 21 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 22 / 38 E4. Some NP-Complete Problems, Part I Graph Problems E4. Some NP-Complete Problems, Part I Graph Problems Clique is NP-Complete (2) Clique is NP-Complete (3) Proof (continued). Proof. Let m be the number of clauses in '. Clique 2 NP: guess and check. Let lij the j-th literal in clause i. Clique is NP-hard: We show 3SAT ≤p Clique. Define V , E, K as follows: I We are given a 3-CNF formula ', and we may assume I V = fhi; ji j 1 ≤ i ≤ m; 1 ≤ j ≤ 3g that each clause has exactly three literals. a vertex for every literal of every clause 0 0 I In polynomial time, we must construct I E contains edge between hi; ji and hi ; j i if and only if a graph G = hV ; Ei and a number K such that: 0 I i 6= i belong to different clauses, and G has a clique of size at least K iff ' is satisfiable. I lij and li 0j0 are not complementary literals construction of V ; E; K on the following slides. I K = m ... obviously polynomially computable to show: reduction property . M. Helmert (Univ. Basel) Theorie May 30, 2016 23 / 38 M. Helmert (Univ. Basel) Theorie May 30, 2016 24 / 38 E4. Some NP-Complete Problems, Part I Graph Problems E4. Some NP-Complete Problems, Part I Graph Problems Clique is NP-Complete (4) Clique is NP-Complete (5) Proof (continued). ((): If hV ; Ei has a clique of size at least K, then ' is satisfiable: Consider a given clique C of size at least K. Proof (continued). I The vertices in C must all correspond to different clauses ()): If ' is satisfiable, then hV ; Ei has clique of size at least K: I (vertices in the same clause are not connected by edges).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages10 Page
-
File Size-