Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

Similar documents
W4231: Analysis of Algorithms

NP-Complete Reductions 2

2SAT Andreas Klappenecker

8 NP-complete problem Hard problems: demo

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

8.1 Polynomial-Time Reductions

Where Can We Draw The Line?

P -vs- NP. NP Problems. P = polynomial time. NP = non-deterministic polynomial time

Computability Theory

1 Definition of Reduction

NP-complete Reductions

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

1 Introduction. 1. Prove the problem lies in the class NP. 2. Find an NP-complete problem that reduces to it.

NP-Completeness. Algorithms

Some Hardness Proofs

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

Chapter 10 Part 1: Reduction

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

NP and computational intractability. Kleinberg and Tardos, chapter 8

Lecture 2: NP-Completeness

PCP and Hardness of Approximation

SAT-CNF Is N P-complete

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

9.1 Cook-Levin Theorem

P and NP (Millenium problem)

arxiv: v2 [cs.cc] 29 Mar 2010

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Reductions and Satisfiability

Recitation 4: Elimination algorithm, reconstituted graph, triangulation

8.1 Polynomial-Time Reductions

Complexity Classes and Polynomial-time Reductions

(p 300) Theorem 7.27 SAT is in P iff P=NP

Lecture 7: Counting classes

Homework 4 Solutions

In this lecture we discuss the complexity of approximation problems, and show how to prove they are NP-hard.

The NP-Completeness of Some Edge-Partition Problems

CMPSCI611: The SUBSET-SUM Problem Lecture 18

Lecture 10 October 7, 2014

Boolean Functions (Formulas) and Propositional Logic

P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989

More NP-Complete Problems [HMU06,Chp.10b] Node Cover Independent Set Knapsack Real Games

Inapproximability of the Perimeter Defense Problem

The Resolution Algorithm

A Simplied NP-complete MAXSAT Problem. Abstract. It is shown that the MAX2SAT problem is NP-complete even if every variable

Answer Key #1 Phil 414 JL Shaheen Fall 2010

P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang

Mixed Integer Linear Programming

Steven Skiena. skiena

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

Research Question Presentation on the Edge Clique Covers of a Complete Multipartite Graph. Nechama Florans. Mentor: Dr. Boram Park

CS 580: Algorithm Design and Analysis

3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability

PROPOSITIONAL LOGIC (2)

Engineering 9867 Advanced Computing Concepts

Linear Time Unit Propagation, Horn-SAT and 2-SAT

Polynomial SAT-Solver Algorithm Explanation

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

Copyright 2000, Kevin Wayne 1

Exact Algorithms Lecture 7: FPT Hardness and the ETH

Normal Forms for Boolean Expressions

Chapter 8. NP-complete problems

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal

CPSC 320 Notes: What's in a Reduction?

CS154, Lecture 18: PCPs, Hardness of Approximation, Approximation-Preserving Reductions, Interactive Proofs, Zero-Knowledge, Cold Fusion, Peace in

COMP260 Spring 2014 Notes: February 4th

Reductions. designing algorithms establishing lower bounds establishing intractability classifying problems. Bird s-eye view

Introduction to Algorithms. Lecture 24. Prof. Patrick Jaillet

Lecture 21: Other Reductions Steven Skiena

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

1 Algorithm and Proof for Minimum Vertex Coloring

A New Reduction from 3-SAT to Graph K- Colorability for Frequency Assignment Problem

Vertex Cover is Fixed-Parameter Tractable

Feedback Arc Set in Bipartite Tournaments is NP-Complete

CS103 Spring 2018 Mathematical Vocabulary

NP-Complete Problems

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

FINAL EXAM SOLUTIONS

Computational problems. Lecture 2: Combinatorial search and optimisation problems. Computational problems. Examples. Example

Treewidth and graph minors

Recursively Enumerable Languages, Turing Machines, and Decidability

Introduction to Parameterized Complexity

4.1 Review - the DPLL procedure

arxiv: v1 [cs.cc] 2 Sep 2017

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017

Prove, where is known to be NP-complete. The following problems are NP-Complete:

Complexity of clique coloring and related problems

Implementation of a Sudoku Solver Using Reduction to SAT

Online Appendix: A Stackelberg Game Model for Botnet Data Exfiltration

Complexity of Disjoint Π-Vertex Deletion for Disconnected Forbidden Subgraphs

New Worst-Case Upper Bound for #2-SAT and #3-SAT with the Number of Clauses as the Parameter

Transcription:

20170926 CNF-SAT: CNF-SAT is a problem in NP, defined as follows: Let E be a Boolean expression with m clauses and n literals (literals = variables, possibly negated), in which - each clause contains only "OR" connectives - the only connectives between clauses are "AND"s CNF-SAT asks "Is there a way to assign True and False to the literals so that E is True?" Clearly CNF-SAT is in NP - if the answer is YES and we are told which literals should be True and which should be False, verifying the answer is easy: we just make sure there is at least one True literal in each clause of E. Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT The problem we will address is the k-clique Problem: Given a graph G and an integer k, does G contain a set of k vertices that are all mutually adjacent (connected by edges)? (Notice that our proof does not involve showing that k-clique reduces to CNF- SAT - we already know this, thanks to Cook and Levin. We need to show that CNF-SAT reduces to k-clique.)

First we observe that k-clique is in NP: if the answer to an instance of k-clique is YES and we know the details of the answer, we can easily verify that the required edges are present in the graph. To show that CNF-SAT reduces to k-clique, we start with an arbitrary instance of CNF-SAT: a boolean expression E in CNF. Each clause of E contains some Boolean variables, some of which may be negated. We will refer to these Boolean variables, with or without negation, as literals. We need to construct an instance of k-clique (i.e. a graph G and an integer k) in such a way that G has a k-clique iff E is satisfiable. Note that even though we cannot put any restrictions on E, we do know that E is some specific Boolean expression in Conjunctive Normal Form. We can use all details of E when we create G and k. To motivate the construction of G, we can reflect on the two problems we are trying to connect. If E has a satisfying truth assignment, then we must be able to set (at least) one literal to True in each clause, and of course the things we set to True must be non-contradictory we can t have being true in one clause and being true in another clause. A graph G has a k-clique if we can find a group of k vertices in G, such that they are all adjacent to each other. Is there a way that we can transform the literals in E to vertices in G? Can we relate setting one literal to True in each clause, in a non-contradictory way to finding k vertices, all of which are adjacent?

We can! We ll start by creating a vertex for each literal in E, and group them together according to the clause of E they come from. We ll label each vertex with the literal it represents. So a clause would be represented by a set of vertices To satisfy E, we need to make sure there is a true literal in each clause. To relate this to a k-clique in the graph we are building, we need to make sure the k- clique contains a vertex from each clause-group of vertices. We can ensure this by not having any edges within each clause-group. This means that any k- clique in the graph can only contain vertices from different clause-groups. But we do need edges! Remember that in a satisfying truth assignment for E, the only restriction is that we can t use a literal as True in one clause and False in another. So the corresponding restriction on a k-clique in G is that it cannot contain two vertices with contradictory labels (such as and ). To make sure this doesn t happen, we simply omit edges between contradictory vertices. In summary, we add an edge between every pair of vertices except for - vertices in the same clause-group - vertices whose labels are direct contractions of each other

Clearly G can be constructed in O( ) time where n is the length of E. To complete the constructed instance of k-clique we need the integer k. Note that any clique in G can contain at most one vertex from each of the clausegroups, so the number of clauses in E is an upper bound on the size of the largest clique in G. And if we can find a clique that does contain one vertex from each clause-group, that would correspond to choosing one literal from each clause of E. This is exactly what we want to do in a satisfying truth assignment. We let k = the number of clauses in E. The graph G and the integer k form an instance of k-clique. Here is an example (mercifully smaller than the one we did in class): Let

So far we have shown that we can transform any instance of CNF-SAT into an instance of k-clique in polynomial time. Now we have to show that the reduction is answer-preserving. We will show that the answer to the instance of CNF-SAT is YES iff the answer to the instance of k-clique is YES. First direction: Suppose the CNF-SAT answer is YES - i.e. suppose E is satisfiable. Consider any assignment of True and False to the literals in E that makes E true. There must be at least one literal in each clause that is true. For each clause, choose a literal in that clause that is true, and select the corresponding vertex in G. Claim: these vertices must form a k-clique. First, there are certainly k of them (one from each clause). Suppose that some pair of these vertices are not adjacent. That could only happen if they were in the same clause-group (they aren't) or their labels contradicted each other. But if their labels contradicted each other, that would mean some literal was both true and false in the truth assignment that satisfies E - which can't happen. Thus all of the selected vertices are adjacent to each other, and they form a k-clique. Second direction: Suppose G contains a k-clique. Due to the way we constructed G, the k-clique must contain one vertex from each clause-group. For each of the vertices in the k-clique, select the corresponding literal in the corresponding clause of E. Set all these literals to be True. There is no danger of attempting to assign True to a variable and to its negation, because the k-clique in G cannot contain any edges between things that negate each other. Now we have one True literal in each clause. Assign True and False to any unassigned literals in any consistent way (i.e. don't attempt to assign both True and False to the same variable). These assignments are effectively irrelevant because we already have one True literal in each clause of E, which means that E is satisfiable.

Thus our polynomial time reduction from CNF-SAT to k-clique is answer preserving. Therefore k-clique is NP-Complete. Note that when we said "suppose E is satisfiable", we never said anything about how we obtain the truth assignment that we then use to select vertices in G. Similarly when we said "Suppose G contains a k-clique" we never said anything about how we find the k-clique that lets us choose literals in E. There is no suggestion in this proof that either of these problems can be solved in polynomial time (in fact, the implication is that they cannot). What the proof shows is that IF the answer to either instance is YES, then the answer to the other instance is also YES. We are still no closer to solving either of these problems but now that we know they are both NP-Complete, we know that finding a polynomial-time algorithm for either one would also solve the other one... and in practice, we conclude that k-clique is almost certainly not solvable in polynomial time. You may ask the perfectly reasonable question "How did anyone come up with that reduction?" The answer, as for so many other difficult problems, is that it probably took a long time, with many false starts. The relationship between these two problems is certainly not an obvious one.