Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
Analysis of Algorithms
and 6.855J Cycle Canceling Algorithm. 2 A minimum cost flow problem , $4 20, $1 20, $2 25, $2 25, $5 20, $6 30, $
Introduction to Algorithms 6.046J/18.401J/SMA5503
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Reductions Complexity ©D.Moshkovitz.
Randomized Algorithms Randomized Algorithms CS648 1.
ABC Technology Project
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS.
Theory of NP-Completeness
Cook-Levin Theorem Proof and Illustration
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Squares and Square Root WALK. Solve each problem REVIEW:
1 P, NP, and NP-Complete Dr. Ying Lu RAIK 283 Data Structures & Algorithms.
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Week 1.
We will resume in: 25 Minutes.
1/22 Worst and Best-Case Coverage in Sensor Networks Seapahn Meguerdichian, Farinaz Koushanfar, Miodrag Potkonjak, and Mani Srivastava IEEE TRANSACTIONS.
Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
Complexity ©D.Moshkovitz 1 NPC More NP-Complete Problems.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Lecture 23. Subset Sum is NPC
NP-Completeness: Reductions
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
Complexity 19-1 Complexity Andrei Bulatov More Probabilistic Algorithms.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Lecture 22 More NPC problems
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
NPC.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
The NP class. NP-completeness
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
Richard Anderson Lecture 26 NP-Completeness
(xy)(yz)(xz)(zy)
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
Computability and Complexity
Where Can We Draw The Line?
More NP-complete Problems
CS21 Decidability and Tractability
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Instructor: Aaron Roth
Instructor: Aaron Roth
Presentation transcript:

Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems

Complexity ©D.Moshkovits 2 Introduction Objectives: –To show variants of SAT and check if they are NP-hard Overview: –Known results –2SAT –Max2SAT

Complexity ©D.Moshkovits 3 What Do We Know? Checking if a propositional calculus formula is satisfiable (SAT) is NP- hard.  (x  z  (  w  x))  (x  y)  y Example: propositional calculus formula

Complexity ©D.Moshkovits 4 What Do We Know? We concentrated on a special case: CNF formulas. (.. .. ..... ..)  …  (.. .. ..... ..) structure of CNF formulas

Complexity ©D.Moshkovits 5 What Do We Know? maximal number of literals per clause P NP-hard We’ll explore this!

Complexity ©D.Moshkovits 6 2SAT Instance: A 2-CNF formula  Problem: To decide if  is satisfiable (  x  y)  (  y  z)  (x  z)  (z  y) Example: a 2CNF formula

Complexity ©D.Moshkovits 7 2SAT is in P Theorem: 2SAT is polynomial-time decidable. Proof: We’ll show how to solve this problem efficiently using path searches in graphs… PAP

Complexity ©D.Moshkovits 8 Searching in Graphs Theorem: Given a graph G=(V,E) and two vertices s,t  V, finding if there is a path from s to t in G is polynomial- time decidable. Proof: Use some search algorithm (DFS/BFS).

Complexity ©D.Moshkovits 9 Graph Construction Vertex for each variable and a negation of a variable Edge ( ,  ) iff there exists a clause equivalent to (  )

Complexity ©D.Moshkovits 10 Graph Construction: Example xx y x zz z (  x  y)  (  y  z)  (x  z)  (z  y) yy

Complexity ©D.Moshkovits 11 Observation Claim: If the graph contains a path from  to , it also contains a path from  to . Proof: If there’s an edge ( ,  ), then there’s also an edge ( ,  ).

Complexity ©D.Moshkovits 12 Correctness Claim: a 2-CNF formula  is unsatisfiable iff there exists a variable x, such that: 1.there is a path from x to  x in the graph 2.there is a path from  x to x in the graph

Complexity ©D.Moshkovits 13 Correctness (1) Suppose there are paths x..  x and  x..x for some variable x, but there’s also a satisfying assignment . If  (x)=T (similarly for  (x)=F): TF xx x...   TF (  ) is false!

Complexity ©D.Moshkovits 14 Correctness (2) Suppose there are no such paths. Construct an assignment as follows: xx y x zz z yy x 1. pick an unassigned literal , with no path from  to , and assign it T y z 2. assign T to all reachable vertices 3. assign F to their negations xx yy zz 4. Repeat until all vertices are assigned

Complexity ©D.Moshkovits 15 Correctness (2) Claim: The algorithm is well defined. Proof: If there were a path from x to both y and  y, then there would have been a path from x to  y and from  y to  x.

Complexity ©D.Moshkovits 16 Correctness A formula is unsatisfiable iff there are no paths of the form x..  x and  x..x.

Complexity ©D.Moshkovits 17 2SAT is in P We get the following efficient algorithm for 2SAT: –For each variable x find if there is a path from x to  x and vice-versa. –Reject if any of these tests succeeded. –Accept otherwise  2SAT  P.

Complexity ©D.Moshkovits 18 Max2SAT Instance: A 2-CNF formula  and a goal K. Problem: To decide if there is an assignment satisfying at least K of  ’s clauses. (  x  y)  (  y  z)  (x  z)  (z  y) (  x  y)  (  y  z)  (x  z)  (z  y) Example: a 2CNF formula

Complexity ©D.Moshkovits 19 Max2SAT is in NPC Theorem: Max2SAT is NP-Complete. Proof: Max2SAT is clearly in NP. We’ll show 3SAT  p Max2SAT. (.. .. ..)  …  (.. .. ..) (.. ..)  …  (.. ..) pp K PAP

Complexity ©D.Moshkovits 20 Gadgets Claim: Let  (x,y,z,w) = (x)  (y)  (z)  (w)  (  x  y)  (  y  z)  (  z  x)  (x  w)  (y  w)  (z  w). Every satisfying assignment for (x  y  z) can be extended into an assignment that satisfies exactly 7 of the clauses. Other assignments can satisfy at most 6 of the clauses.          Proof: By checking.

Complexity ©D.Moshkovits 21 The Construction For each 1  i  m, replace the i-th clause of the 3-CNF formula (  ) with a corresponding  ( , , ,w i ) to get a 2-CNF formula. Fix K=7m. Make sure this construction is poly-time

Complexity ©D.Moshkovits 22 Correctness Every satisfying assignment for the 3-CNF formula can be extended into an assignment that satisfies 7m clauses. If 7m clauses of the 2-CNF formula are satisfied, each  has 7 satisfied clauses, so the original formula is satisfied.

Complexity ©D.Moshkovits 23 Corollary  3SAT  p Max2SAT and Max2SAT  NP  Max2SAT is NP-Complete.

Complexity ©D.Moshkovits 24 Summary We’ve seen that checking if a given CNF formula is satisfiable is: –Polynomial-time decidable, if every clause contains up to 2 literals. –NP-hard, if each clause may contain more than 2 literals. We’ve also seen Max2SAT is NP-hard. 

Complexity ©D.Moshkovits 25 Conclusions A special case of a NP-hard problem may be polynomial time decidable. The optimization version of a polynomial- time decidable problem may be NP-hard. 