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

Size: px
Start display at page:

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

Transcription

1 NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT 3SAT The 3SAT problem is the following. INSTANCE : Given a boolean expression E in conjunctive normal form (CNF) that is the conjunction of clauses, each of which is the disjunction of three distinct literals. QUESTION : Is E satisfiable? The CSAT problem is the following. INSTANCE : Given a boolean expression E in CNF. QUESTION : Is E satisfiable; that is, is there a truth assignment to the variables of E so that each clause in E becomes true? The Cook-Levin theorem asserts that SATISFIABILITY is NP-complete. Although 3-CNF expressions are a subset of the CNF expressions, they are complex enough in the sense that testing for satisfiability turns out to be NP-complete. Theorem : 3SAT is NP-complete. Proof : Evidently 3SAT is in NP, since SAT is in NP. To determine whether a boolean expression E in CNF is satisfiable, nondeterministically guess values for all the variables and then evaluate the expression. If E turns out to be true, then accept. This can be carried out in nondeterministic polynomial time. Thus 3SAT is in NP. To prove NP-completeness, we shall reduce CSAT to 3SAT. Let a given CNF expression be E = e 1 e 2... e k where each e i is a disjunction of literals. We replace each clause e i (as shown below) to create a new expression F such that i) F is a clause in 3SAT form. ii) time taken to construct F is linear in the length of E. iii) a truth assignment satisfies E if and only if it can be extended to a satisfying truth assignment for F. The construction of F is as follows. 1. If an e i is a single literal, say (x) or (x) we introduce two new variables u and v. We replace (x) by the conjunction of four clauses as (x+u+v)(x+u+v)(x+u+v)(x+u+v). Since u and v appear in all combinations, the only way to satisfy all four clauses is to make x true. Scribe : R. Karthik

2 2. Suppose an e i is the disjunction of two literals, (x + y). We introduce a new variable z and replace e i by the conjunction of two clauses (x + y + z)(x + y + z). As in case 1, the only way to satisfy both clauses is to satisfy (x + y). 3. If an e i is the disjunction of three literals it is already in the form required for 3-CNF, so we take e i as such to construct F. 4. Suppose e i = (x 1 +x x m ) for some m 4. We introduce new variables y 1, y 2,..., y m 3 and replace e i by the conjunction of clauses (x 1 + x 2 + y 1 )(x 3 + y 1 + y 2 )(x 4 + y 2 + y 3 )... (x m 2 + y m 4 + y m 3 )(x m 1 + x m + y m 3 ). (1) If there is a truth assignment τ that satisfies e i then at least one literal (one of the x s) in x 1 + x x m should be true; say τ makes x j true; that is in... (x j 1 + y j 3 + y j 2 )(x j + y j 2 + y j 1 )(x j+1 + y j 1 + y j )... Then in (1) above, if we make y 1, y 2,..., y j 2 true and make y j 1, y j,..., y m 3 false, we satisfy all the clauses of (1). Thus τ can be extended to satisfy these clauses. On the other hand, if τ makes all the x s false we can reason (as follows) that it is not possible to extend τ to make (1) true. The reason is that, since x 1 and x 2 are false, y 1 must be true (otherwise this clause will become false and will collapse e i to false) in the first clause; since x 3 is false and y 1 is false, y 2 must be true to keep the situation alive. By continuing the argument, we will reason that y m 3 is true. But, alas, x m 1 is false, x m is false and y m 3 is false and we see that e i cannot be satisfied. The above argument shows how to reduce an instance E of CSAT to an instance F of 3SAT, such that F is satisfiable if and only if E is satisfiable. The construction evidently requires time that is linear in the length of E, because none of the four cases above expand a clause by more than a factor 32/3 (that is the ratio of symbol counts in case 1) and it is possible to built F in polynomial time. Since CSAT is NP-complete, it follows that 3SAT is also NP-complete. 1-IN-3SAT The 1-IN-3SAT problem is the following. INSTANCE : A collection of clauses C 1,..., C m, m > 1; each C i is a disjunction of exactly three literals. QUESTION : Is there a truth assignment to the variables occurring so that exactly one literal is true in each C i? Let X = {x 1,..., x 5 } be the set of variables. Let the clause set C = {C 1, C 2, C 3 } be the following : C 1 = {x 1, x 2, x 3 }, C 2 = {x 1, x 4, x 5 }, C 3 = {x 2, x 4, x 5 }. With this (X, C) we consider the 1-IN-3SAT problem. We say a clause is correctly satisfied if and only if the clause is satisfied due to exactly one literal in it. To correctly satisfy C 1 we try setting only x 1 = in C 1. This when applied to C 2 requires x 4 = and x 5 = for correct satisfaction of C 2. But x 4 = and x 5 = in C 3 requires x 2 = for correct satisfaction of C 3 this violates the correct satisfaction of C 1. Similarly we get a contradiction if we try setting only x 2 = in C 1. The only solution is x 1 =, x 2 = and x 3 = and exactly one of x 4 or x 5 is. Note that as a 3SAT instance (X, C) admits other solutions as well.

3 Theorem : 1-IN-3SAT is NP-complete. Proof : It can be argued that 1-IN-3SAT is in NP. To prove that the problem is NP-hard, the following reduction shows 3SAT is polynomially reducible to 1-IN-3SAT, where 3SAT is NP-hard. That is, we need to show that any instance of 3SAT can be efficiently transformed to an instance of 1-IN-3SAT so that 3SAT is satsifiable if and only if 1-IN-3SAT is satisfiable. We consider any C i = {x i1, x i2, x i3 } in 3SAT. In the corresponding 1-IN-3SAT instance, we will produce the following three clauses with the addition of four new variables a i, b i, c i, d i : C i1 = {x i1, a i, b i }, C i2 = {x i2, b i, c i }, C i3 = {x i3, c i, d i } Hence if the 3SAT instance has n variables and m clauses, in the 1-IN-3SAT instance, there will be n + 4m variables and 3m clauses. This transformation can be done efficiently. Assume that the 3SAT instance is not satisfiable. Then in any C i, x i1 =, x i2 = and x i3 =. We try to extend this truth assignment to a satisfying truth assignment of 1-IN- 3SAT. In the 1-IN-3SAT instance, in C i2 since x i2 = exactly one of b i or c i should be so that C i2 gets correctly satisfied; if b i =, C i1 will not get satisfied; if c i =, C i3 will not get satisfied. In other words, if the 3SAT instance is not satisfied then no truth assignment of variables can make the 1-IN-3SAT instance satisfied correctly. Now assume that the 3SAT instance is satisfiable. Every C i is in any solution. We consider the following cases that make C i = in the 3SAT instance: 1. x i2 = (we have 4 cases) : In the 1-IN-3SAT instance we can set b i =, c i = in C i2 ; we also set a i = x i1 and d i = x i3 so that C i1 and C i3 are correctly satisfied. 2. x i2 =, x i1 =, x i3 = : In the 1-IN-3SAT instance we can set a i =, b i =, c i =, d i = so that C i1, C i2 and C i3 are correctly satisfied. 3. Only x i1 = : In the 1-IN-3SAT instance we set a i =, b i =, c i =, d i =. This correctly satisfies C i1, C i2 and C i3. 4. Only x i3 = : In the 1-IN-3SAT instance we set a i =, b i =, c i =, d i =. This correctly satisfies C i1, C i2 and C i3. In summary, a satisfying truth assignment to the variables in 3SAT can be extended to a correctly satisfying truth assignment of the variables in 1-IN-3SAT. We conclude that 1-IN-3SAT is also NP-complete. MAX 2SAT The following is the maximum satisfiability with at most two literals per clause (MAX 2SAT) problem. INSTANCE : Given a set C 1,..., C p of clauses, each being a disjunction of at most two literals; and an integer k where 1 k < p. QUESTION : Is there a truth assignment to the variables so that k or more clauses are satisfied? Note that if k = p, the above problem reduces to the 2SAT problem which can be solved

4 efficiently in polynomial time. The following theorem relies on reducing 3SAT to MAX 2SAT. The proof rewritten slightly essentially follows [2]. Theorem : MAX 2SAT is NP-complete. Proof : First we note that if a truth setting of variable makes at least k clauses true, then by substituting these truth values we can efficiently check the truth or falsity clause by clause, keeping a counter to hold the number of clauses found to be true so far. Hence MAX 2SAT is in NP. The following is a reduction from 3SAT to MAX 2SAT. That is, given an instance of 3SAT we construct an instance of MAX 2SAT so that a satisfying truth assignment of 3SAT can be extended to a satisfying truth assignment of MAX 2SAT. Note that a satisfying truth assignment is one that makes at least k clauses true in the MAX 2SAT instance. Let S be the instance of 3SAT where the clauses are C 1,..., C m where C i = {x i, y i, z i }, where each x i, y i, and z i represents either a variable or its negation and 1 i m. From S we build an instance S of MAX 2SAT as follows. Each C i in S corresponds to a clause group C i in S where C i = {(w i ), (x i ), (y i ), (z i ), (x i + y i ), (y i + z i ), (x i + z i ), (w i + x i ), (w i + y i ), (w i + z i )} where w i is a new variable and 1 i m. We set k = 7m. Each clause in S as constructed above has at most two literals. It can be seen that the clauses in S can be efficiently generated from the clauses in S in polynomial time. We now argue that a satisfying truth assignment of S exists if and only if it can be extended to a satisfying truth assignment for S appropriately. Assume that S is satisfiable. Then in a typical clause C i = {x i, y i, z i } either one or two or all the three variables are true. a) Let x i = T, y i = F, z i = F. With this truth assignment in S, if w i = T, six clauses of C i become true; if w i = F, seven clauses of C i become true. b) Let x i = T, y i = T, z i = F. This truth assignment in S together with w i = T or w i = F, makes seven clauses of C i true. c) Let x i = T, y i = T, z i = T. With this truth assignment in S, if w i = T, seven clauses of C i become true; if w i = F, six clauses of C i become true. In summary, a satisfying truth assignment of S can be extended to a satisfying truth assignment of S where exactly seven clauses in each clause group get satisfied. Moreover no setting of w i causes more than seven of the ten clauses to be true in each clause group in S. Now assume that S is not satisfiable. Then in at least one clause C i = {x i, y i, z i } in S, we have x i = F, y i = F, z i = F. With this truth assignment in S, if w i = T, four clauses of C i become true; if w i = F, six clauses of C i become true. That is, if S is not satisfiable, no truth setting can make at least seven clauses true in each clause group C i. Since 3SAT is NP-complete, we conclude that MAX 2SAT is also NP-complete.

5 References [1] J. E. Hopcroft, R. Motwani, and J. D. Ullman. Introduction to Automata Theory, Languages, and Computation, third edition. Pearson Addison-Wesley, [2] M. R. Garey, D. S. Johnson, and L. Stockmeyer. Some simplified NP-complete graph problems. Theo. Comp. Sci., 1(3): , [3] T. J. Schaefer. The complexity of satisfiability problems, in Proceedings of the 10th Annual ACM Symposium on Theory of Computing, pages , 1978.

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

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT 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

More information

8 NP-complete problem Hard problems: demo

8 NP-complete problem Hard problems: demo Ch8 NPC Millennium Prize Problems http://en.wikipedia.org/wiki/millennium_prize_problems 8 NP-complete problem Hard problems: demo NP-hard (Non-deterministic Polynomial-time hard), in computational complexity

More information

arxiv: v2 [cs.cc] 29 Mar 2010

arxiv: v2 [cs.cc] 29 Mar 2010 On a variant of Monotone NAE-3SAT and the Triangle-Free Cut problem. arxiv:1003.3704v2 [cs.cc] 29 Mar 2010 Peiyush Jain, Microsoft Corporation. June 28, 2018 Abstract In this paper we define a restricted

More information

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

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

More information

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

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch] NP Completeness Andreas Klappenecker [partially based on slides by Jennifer Welch] Overview We already know the following examples of NPC problems: SAT 3SAT We are going to show that the following are

More information

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal https://hal.archives-ouvertes.fr/hal

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal https://hal.archives-ouvertes.fr/hal NP versus PSPACE Frank Vega To cite this version: Frank Vega. NP versus PSPACE. Preprint submitted to Theoretical Computer Science 2015. 2015. HAL Id: hal-01196489 https://hal.archives-ouvertes.fr/hal-01196489

More information

Complexity Classes and Polynomial-time Reductions

Complexity Classes and Polynomial-time Reductions COMPSCI 330: Design and Analysis of Algorithms April 19, 2016 Complexity Classes and Polynomial-time Reductions Lecturer: Debmalya Panigrahi Scribe: Tianqi Song 1 Overview In this lecture, we introduce

More information

W4231: Analysis of Algorithms

W4231: Analysis of Algorithms W4231: Analysis of Algorithms 11/23/99 NP-completeness of 3SAT, Minimum Vertex Cover, Maximum Independent Set, Boolean Formulae A Boolean formula is an expression that we can build starting from Boolean

More information

SAT-CNF Is N P-complete

SAT-CNF Is N P-complete SAT-CNF Is N P-complete Rod Howell Kansas State University November 9, 2000 The purpose of this paper is to give a detailed presentation of an N P- completeness proof using the definition of N P given

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

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

1 Introduction. 1. Prove the problem lies in the class NP. 2. Find an NP-complete problem that reduces to it. 1 Introduction There are hundreds of NP-complete problems. For a recent selection see http://www. csc.liv.ac.uk/ ped/teachadmin/comp202/annotated_np.html Also, see the book M. R. Garey and D. S. Johnson.

More information

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

A New Reduction from 3-SAT to Graph K- Colorability for Frequency Assignment Problem A New Reduction from 3-SAT to Graph K- Colorability for Frequency Assignment Problem Prakash C. Sharma Indian Institute of Technology Survey No. 113/2-B, Opposite to Veterinary College, A.B.Road, Village

More information

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

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance. Algorithm Design Patterns and Anti-Patterns Chapter 8 NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic

More information

Reductions and Satisfiability

Reductions and Satisfiability Reductions and Satisfiability 1 Polynomial-Time Reductions reformulating problems reformulating a problem in polynomial time independent set and vertex cover reducing vertex cover to set cover 2 The Satisfiability

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Other NP-Complete Problems Haniel Barbosa Readings for this lecture Chapter 7 of [Sipser 1996], 3rd edition. Sections 7.4 and 7.5. The 3SAT

More information

VISUALIZING NP-COMPLETENESS THROUGH CIRCUIT-BASED WIDGETS

VISUALIZING NP-COMPLETENESS THROUGH CIRCUIT-BASED WIDGETS University of Portland Pilot Scholars Engineering Faculty Publications and Presentations Shiley School of Engineering 2016 VISUALIZING NP-COMPLETENESS THROUGH CIRCUIT-BASED WIDGETS Steven R. Vegdahl University

More information

CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems

CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems This document contains slides from the lecture, formatted to be suitable for printing or individual reading, and with some supplemental explanations

More information

9.1 Cook-Levin Theorem

9.1 Cook-Levin Theorem CS787: Advanced Algorithms Scribe: Shijin Kong and David Malec Lecturer: Shuchi Chawla Topic: NP-Completeness, Approximation Algorithms Date: 10/1/2007 As we ve already seen in the preceding lecture, two

More information

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

A Simplied NP-complete MAXSAT Problem. Abstract. It is shown that the MAX2SAT problem is NP-complete even if every variable A Simplied NP-complete MAXSAT Problem Venkatesh Raman 1, B. Ravikumar 2 and S. Srinivasa Rao 1 1 The Institute of Mathematical Sciences, C. I. T. Campus, Chennai 600 113. India 2 Department of Computer

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 Algorithm Design Patterns and Anti-Patterns Algorithm design patterns.

More information

2SAT Andreas Klappenecker

2SAT Andreas Klappenecker 2SAT Andreas Klappenecker The Problem Can we make the following boolean formula true? ( x y) ( y z) (z y)! Terminology A boolean variable is a variable that can be assigned the values true (T) or false

More information

NP-complete Reductions

NP-complete Reductions NP-complete Reductions 1. Prove that 3SAT P DOUBLE-SAT, i.e., show DOUBLE-SAT is NP-complete by reduction from 3SAT. The 3-SAT problem consists of a conjunction of clauses over n Boolean variables, where

More information

The NP-Completeness of Some Edge-Partition Problems

The NP-Completeness of Some Edge-Partition Problems The NP-Completeness of Some Edge-Partition Problems Ian Holyer y SIAM J. COMPUT, Vol. 10, No. 4, November 1981 (pp. 713-717) c1981 Society for Industrial and Applied Mathematics 0097-5397/81/1004-0006

More information

Chapter 8. NP-complete problems

Chapter 8. NP-complete problems Chapter 8. NP-complete problems Search problems E cient algorithms We have developed algorithms for I I I I I finding shortest paths in graphs, minimum spanning trees in graphs, matchings in bipartite

More information

Some Hardness Proofs

Some Hardness Proofs Some Hardness Proofs Magnus Lie Hetland January 2011 This is a very brief overview of some well-known hard (NP Hard and NP complete) problems, and the main ideas behind their hardness proofs. The document

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions 8.1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. Those with polynomial-time algorithms.

More information

NP and computational intractability. Kleinberg and Tardos, chapter 8

NP and computational intractability. Kleinberg and Tardos, chapter 8 NP and computational intractability Kleinberg and Tardos, chapter 8 1 Major Transition So far we have studied certain algorithmic patterns Greedy, Divide and conquer, Dynamic programming to develop efficient

More information

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

P -vs- NP. NP Problems. P = polynomial time. NP = non-deterministic polynomial time P -vs- NP NP Problems P = polynomial time There are many problems that can be solved correctly using algorithms that run in O(n c ) time for some constant c. NOTE: We can say that an nlogn algorithm is

More information

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

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance. Algorithm Design Patterns and Anti-Patterns 8. NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic programming.

More information

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

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W. : Coping with NP-Completeness Course contents: Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems Reading: Chapter 34 Chapter 35.1, 35.2 Y.-W. Chang 1 Complexity

More information

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

P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989 University of Pennsylvania ScholarlyCommons Technical Reports (CIS) Department of Computer & Information Science October 1989 P Is Not Equal to NP Jon Freeman University of Pennsylvania Follow this and

More information

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

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices Hard Problems Euler-Tour Problem Undirected graph G=(V,E) An Euler Tour is a path where every edge appears exactly once. The Euler-Tour Problem: does graph G have an Euler Path? Answerable in O(E) time.

More information

NP-Completeness. Algorithms

NP-Completeness. Algorithms NP-Completeness Algorithms The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient

More information

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

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements. Desiderata Reductions Desiderata. Classify problems according to their computational requirements. Frustrating news. Huge number of fundamental problems have defied classification for decades. Desiderata'.

More information

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer (QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer is yourself, then show how to get the answer using both

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

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

More NP-Complete Problems [HMU06,Chp.10b] Node Cover Independent Set Knapsack Real Games More NP-Complete Problems [HMU06,Chp.10b] Node Cover Independent Set Knapsack Real Games 1 Next Steps We can now reduce 3SAT to a large number of problems, either directly or indirectly. Each reduction

More information

PCP and Hardness of Approximation

PCP and Hardness of Approximation PCP and Hardness of Approximation January 30, 2009 Our goal herein is to define and prove basic concepts regarding hardness of approximation. We will state but obviously not prove a PCP theorem as a starting

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 4: Due tomorrow (March 9) at 11:59 PM Recap Linear Programming Very Powerful Technique (Subject of Entire Courses)

More information

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

3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability Algorithm Design Patterns and Anti-Patterns CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Algorithm design patterns. Ex. Greedy. O(n log n) interval scheduling. Divide-and-conquer.

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions Algorithm Design Patterns and Anti-Patterns Analysis of Algorithms Algorithm design patterns. Ex. Greed. O(n 2 ) Dijkstra s SSSP (dense) Divide-and-conquer. O(n log n) FFT. Dynamic programming. O(n 2 )

More information

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

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time: 1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time: Input: A CNF formula ϕ with n variables x 1, x 2,..., x n. Output: True if there is an

More information

SAT Solver. CS 680 Formal Methods Jeremy Johnson

SAT Solver. CS 680 Formal Methods Jeremy Johnson SAT Solver CS 680 Formal Methods Jeremy Johnson Disjunctive Normal Form A Boolean expression is a Boolean function Any Boolean function can be written as a Boolean expression s x 0 x 1 f Disjunctive normal

More information

(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

(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 CS 70 Discrete Mathematics for CS Fall 2000 Wagner MT1 Sol Solutions to Midterm 1 1. (16 pts.) Theorems and proofs (a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information

Mixed Integer Linear Programming

Mixed Integer Linear Programming Mixed Integer Linear Programming Part I Prof. Davide M. Raimondo A linear program.. A linear program.. A linear program.. Does not take into account possible fixed costs related to the acquisition of new

More information

New Upper Bounds for MAX-2-SAT and MAX-2-CSP w.r.t. the Average Variable Degree

New Upper Bounds for MAX-2-SAT and MAX-2-CSP w.r.t. the Average Variable Degree New Upper Bounds for MAX-2-SAT and MAX-2-CSP w.r.t. the Average Variable Degree Alexander Golovnev St. Petersburg University of the Russian Academy of Sciences, St. Petersburg, Russia alex.golovnev@gmail.com

More information

Localization in Graphs. Richardson, TX Azriel Rosenfeld. Center for Automation Research. College Park, MD

Localization in Graphs. Richardson, TX Azriel Rosenfeld. Center for Automation Research. College Park, MD CAR-TR-728 CS-TR-3326 UMIACS-TR-94-92 Samir Khuller Department of Computer Science Institute for Advanced Computer Studies University of Maryland College Park, MD 20742-3255 Localization in Graphs Azriel

More information

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

P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang Efficient Algorithms So far, we have developed algorithms for finding shortest paths in graphs, minimum spanning trees in

More information

Implementation of a Sudoku Solver Using Reduction to SAT

Implementation of a Sudoku Solver Using Reduction to SAT Implementation of a Sudoku Solver Using Reduction to SAT For this project you will develop a Sudoku solver that receives an input puzzle and computes a solution, if one exists. Your solver will: read an

More information

The Resolution Algorithm

The Resolution Algorithm The Resolution Algorithm Introduction In this lecture we introduce the Resolution algorithm for solving instances of the NP-complete CNF- SAT decision problem. Although the algorithm does not run in polynomial

More information

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

(p 300) Theorem 7.27 SAT is in P iff P=NP pp. 292-311. The Class NP-Complete (Sec. 7.4) P = {L L decidable in poly time} NP = {L L verifiable in poly time} Certainly all P is in NP Unknown if NP is bigger than P (p. 299) NP-Complete = subset of

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture Homework 1 Due Date: Wednesday 11/26/07 - at the beginning of the lecture Problems marked with a [*] are a littlebit harder and count as extra credit. Note 1. For any of the given problems make sure that

More information

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

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang Efficient Algorithms So far, we have developed algorithms for finding shortest paths in graphs, minimum spanning trees

More information

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

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions. CS 787: Advanced Algorithms NP-Hardness Instructor: Dieter van Melkebeek We review the concept of polynomial-time reductions, define various classes of problems including NP-complete, and show that 3-SAT

More information

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics 400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {

More information

Lecture 10 October 7, 2014

Lecture 10 October 7, 2014 6.890: Algorithmic Lower Bounds: Fun With Hardness Proofs Fall 2014 Lecture 10 October 7, 2014 Prof. Erik Demaine Scribes: Fermi Ma, Asa Oines, Mikhail Rudoy, Erik Waingarten Overview This lecture begins

More information

arxiv: v1 [cs.cc] 2 Sep 2017

arxiv: v1 [cs.cc] 2 Sep 2017 Complexity of Domination in Triangulated Plane Graphs Dömötör Pálvölgyi September 5, 2017 arxiv:1709.00596v1 [cs.cc] 2 Sep 2017 Abstract We prove that for a triangulated plane graph it is NP-complete to

More information

Satisfiability Coding Lemma

Satisfiability Coding Lemma ! Satisfiability Coding Lemma Ramamohan Paturi, Pavel Pudlák, and Francis Zane Abstract We present and analyze two simple algorithms for finding satisfying assignments of -CNFs (Boolean formulae in conjunctive

More information

Where Can We Draw The Line?

Where Can We Draw The Line? Where Can We Draw The Line? On the Hardness of Satisfiability Problems Complexity 1 Introduction Objectives: To show variants of SAT and check if they are NP-hard Overview: Known results 2SAT Max2SAT Complexity

More information

Steven Skiena. skiena

Steven Skiena.   skiena Lecture 22: Introduction to NP-completeness (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Among n people,

More information

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

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can

More information

Chapter 10 Part 1: Reduction

Chapter 10 Part 1: Reduction //06 Polynomial-Time Reduction Suppose we could solve Y in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Chapter 0 Part : Reduction Reduction. Problem X

More information

Exam in Algorithms & Data Structures 3 (1DL481)

Exam in Algorithms & Data Structures 3 (1DL481) Exam in Algorithms & Data Structures 3 (1DL481) Prepared by Pierre Flener Tuesday 15 March 2016 from 08:00 to 13:00, in Polacksbacken Materials: This is a closed-book exam, drawing from the book Introduction

More information

Lecture 7: Counting classes

Lecture 7: Counting classes princeton university cos 522: computational complexity Lecture 7: Counting classes Lecturer: Sanjeev Arora Scribe:Manoj First we define a few interesting problems: Given a boolean function φ, #SAT is the

More information

Eulerian disjoint paths problem in grid graphs is NP-complete

Eulerian disjoint paths problem in grid graphs is NP-complete Discrete Applied Mathematics 143 (2004) 336 341 Notes Eulerian disjoint paths problem in grid graphs is NP-complete Daniel Marx www.elsevier.com/locate/dam Department of Computer Science and Information

More information

Binary Decision Diagrams

Binary Decision Diagrams Logic and roof Hilary 2016 James Worrell Binary Decision Diagrams A propositional formula is determined up to logical equivalence by its truth table. If the formula has n variables then its truth table

More information

PROPOSITIONAL LOGIC (2)

PROPOSITIONAL LOGIC (2) PROPOSITIONAL LOGIC (2) based on Huth & Ruan Logic in Computer Science: Modelling and Reasoning about Systems Cambridge University Press, 2004 Russell & Norvig Artificial Intelligence: A Modern Approach

More information

Lecture 21: Other Reductions Steven Skiena

Lecture 21: Other Reductions Steven Skiena Lecture 21: Other Reductions Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.stonybrook.edu/ skiena Problem of the Day Show that the dense

More information

On Approximating Minimum Vertex Cover for Graphs with Perfect Matching

On Approximating Minimum Vertex Cover for Graphs with Perfect Matching On Approximating Minimum Vertex Cover for Graphs with Perfect Matching Jianer Chen and Iyad A. Kanj Abstract It has been a challenging open problem whether there is a polynomial time approximation algorithm

More information

Geometric Unique Set Cover on Unit Disks and Unit Squares

Geometric Unique Set Cover on Unit Disks and Unit Squares CCCG 2016, Vancouver, British Columbia, August 3 5, 2016 Geometric Unique Set Cover on Unit Disks and Unit Squares Saeed Mehrabi Abstract We study the Unique Set Cover problem on unit disks and unit squares.

More information

Answer Key #1 Phil 414 JL Shaheen Fall 2010

Answer Key #1 Phil 414 JL Shaheen Fall 2010 Answer Key #1 Phil 414 JL Shaheen Fall 2010 1. 1.42(a) B is equivalent to B, and so also to C, where C is a DNF formula equivalent to B. (By Prop 1.5, there is such a C.) Negated DNF meets de Morgan s

More information

Inapproximability of the Perimeter Defense Problem

Inapproximability of the Perimeter Defense Problem Inapproximability of the Perimeter Defense Problem Evangelos Kranakis Danny Krizanc Lata Narayanan Kun Xu Abstract We model the problem of detecting intruders using a set of infrared beams by the perimeter

More information

COMP4418 Knowledge Representation and Reasoning

COMP4418 Knowledge Representation and Reasoning COMP4418 Knowledge Representation and Reasoning Week 3 Practical Reasoning David Rajaratnam Click to edit Present s Name Practical Reasoning - My Interests Cognitive Robotics. Connect high level cognition

More information

P and NP (Millenium problem)

P and NP (Millenium problem) CMPS 2200 Fall 2017 P and NP (Millenium problem) Carola Wenk Slides courtesy of Piotr Indyk with additions by Carola Wenk CMPS 2200 Introduction to Algorithms 1 We have seen so far Algorithms for various

More information

On Detecting Global Predicates in Distributed Computations

On Detecting Global Predicates in Distributed Computations On Detecting Global Predicates in Distributed Computations Neeraj Mittal Department of Computer Sciences The University of Texas at Austin Austin TX 787-88 USA neerajm@cs.utexas.edu Vijay K. Garg Department

More information

Graph Vertex Colorability & the Hardness. Mengfei Cao COMP-150 Graph Theory Tufts University

Graph Vertex Colorability & the Hardness. Mengfei Cao COMP-150 Graph Theory Tufts University Dec. 15 th, Presentation for Final Project Graph Vertex Colorability & the Hardness Mengfei Cao COMP-150 Graph Theory Tufts University Framework In General: Graph-2-colorability is in N Graph-3-colorability

More information

Parallelizing SAT Solver With specific application on solving Sudoku Puzzles

Parallelizing SAT Solver With specific application on solving Sudoku Puzzles 6.338 Applied Parallel Computing Final Report Parallelizing SAT Solver With specific application on solving Sudoku Puzzles Hank Huang May 13, 2009 This project was focused on parallelizing a SAT solver

More information

Lecture 2: NP-Completeness

Lecture 2: NP-Completeness NP and Latin Squares Instructor: Padraic Bartlett Lecture 2: NP-Completeness Week 4 Mathcamp 2014 In our last class, we introduced the complexity classes P and NP. To motivate why we grouped all of NP

More information

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.6 Indirect Argument: Contradiction and Contraposition Copyright Cengage Learning. All

More information

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman. Decision Procedures An Algorithmic Point of View Decision Procedures for Propositional Logic D. Kroening O. Strichman ETH/Technion Version 1.0, 2007 Part I Decision Procedures for Propositional Logic Outline

More information

The Complexity of Camping

The Complexity of Camping The Complexity of Camping Marzio De Biasi marziodebiasi [at] gmail [dot] com July 2012 Version 0.04: a re-revised sketch of the proof Abstract We prove that the tents puzzle game is NP -complete using

More information

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

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY Lecture 20: Satisfiability Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Problem of the Day Suppose we are given

More information

The complement of PATH is in NL

The complement of PATH is in NL 340 The complement of PATH is in NL Let c be the number of nodes in graph G that are reachable from s We assume that c is provided as an input to M Given G, s, t, and c the machine M operates as follows:

More information

Complexity of unique list colorability

Complexity of unique list colorability Complexity of unique list colorability Dániel Marx 1 Department of Computer Science and Information Theory, Budapest University of Technology and Economics, Budapest H-151, Hungary. Abstract Given a list

More information

Lecture 21: Other Reductions Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Lecture 21: Other Reductions Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY Lecture 21: Other Reductions Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Problem of the Day Show that the Dense

More information

CPSC 320 Notes: What's in a Reduction?

CPSC 320 Notes: What's in a Reduction? CPSC 320 Notes: What's in a Reduction? November 7, 2016 To reduce a problem A to another problem B, we typically proceed as follows: give one algorithm that takes a (legal) instance a of A and converts

More information

Finding a winning strategy in variations of Kayles

Finding a winning strategy in variations of Kayles Finding a winning strategy in variations of Kayles Simon Prins ICA-3582809 Utrecht University, The Netherlands July 15, 2015 Abstract Kayles is a two player game played on a graph. The game can be dened

More information

Maximization Versions of Lights Out Games in Grids and Graphs

Maximization Versions of Lights Out Games in Grids and Graphs Maximization Versions of Lights Out Games in Grids and Graphs John Goldwasser and William Klostermeyer Dept of Mathematics Dept of Computer Science West Virginia University Morgantown, WV 26506 E-mail:

More information

Deductive Methods, Bounded Model Checking

Deductive Methods, Bounded Model Checking Deductive Methods, Bounded Model Checking http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Deductive methods Pavel Parízek Deductive Methods, Bounded

More information

The Complexity of Minimizing Certain Cost Metrics for k-source Spanning Trees

The Complexity of Minimizing Certain Cost Metrics for k-source Spanning Trees The Complexity of Minimizing Certain Cost Metrics for ksource Spanning Trees Harold S Connamacher University of Oregon Andrzej Proskurowski University of Oregon May 9 2001 Abstract We investigate multisource

More information

Packing Trominoes is NP-Complete, #P-Complete and ASP-Complete

Packing Trominoes is NP-Complete, #P-Complete and ASP-Complete CCCG 2012, Charlottetown, P.E.I., August 8 10, 2012 Packing Trominoes is NP-Complete, #P-Complete and ASP-Complete Takashi Horiyama Takehiro Ito Keita Nakatsuka Abstract We study the computational complexity

More information

Learning with the Aid of an Oracle

Learning with the Aid of an Oracle ' Learning with the Aid of an Oracle (1996; Bshouty, Cleve, Gavaldà, Kannan, Tamon) CHRISTINO TAMON, Computer Science, Clarkson University, http://www.clarkson.edu/ tino Exact Learning, Boolean Circuits,

More information

Efficient Enumeration Algorithms for Constraint Satisfaction Problems

Efficient Enumeration Algorithms for Constraint Satisfaction Problems Efficient Enumeration Algorithms for Constraint Satisfaction Problems Henning and Ilka Schnoor Institut für Theoretische Informatik Leibniz Universität Hannover 2.10.2006 Efficient Enumeration Algorithms

More information

Nondeterministic Query Algorithms

Nondeterministic Query Algorithms Journal of Universal Computer Science, vol. 17, no. 6 (2011), 859-873 submitted: 30/7/10, accepted: 17/2/11, appeared: 28/3/11 J.UCS Nondeterministic Query Algorithms Alina Vasilieva (Faculty of Computing,

More information

Chapter 8. NP-complete problems. Search problems. cient algorithms. Exponential search space

Chapter 8. NP-complete problems. Search problems. cient algorithms. Exponential search space Chapter 8. NP-complete problems Search problems 1 / 64 2 / 64 E cient algorithms Exponential search space We have developed algorithms for finding shortest paths in graphs, minimum spanning trees in graphs,

More information

HW1. Due: September 13, 2018

HW1. Due: September 13, 2018 CSCI 1010 Theory of Computation HW1 Due: September 13, 2018 Attach a fully filled-in cover sheet to the front of your printed homework. Your name should not appear anywhere; the cover sheet and each individual

More information

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation CSE560 Class 10: 1 c P. Heeman, 2010 Integrity Constraints Overview Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down CSE560 Class 10: 2 c P. Heeman, 2010 Integrity

More information

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 CS 3512, Spring 2011 Instructor: Doug Dunham Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 Prerequisites: Calc I, CS2511 Rough course outline:

More information