We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byJaeden Upright
Modified over 2 years ago
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 xx y x zz z ( x y) ( y z) (x z) (z y) yy
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 xx x... TF ( ) is false!
Complexity ©D.Moshkovits 14 Correctness (2) Suppose there are no such paths. Construct an assignment as follows: xx y x zz z yy 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 xx yy zz 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. (.. .. ..) … (.. .. ..) (.. ..) … (.. ..) pp 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.
Analysis of Algorithms NP & NP-Complete Prof. Muhammad Saeed.
Complexity ©D.Moshkovitz 1 Reductions. Complexity ©D.Moshkovitz 2 Motivation Reductions are our main tool for comparison between problems.
1 NP-Completeness Zeph Grunschlag. 2 Announcement HW9 Due Now HW Amnesty I’ll drop your lowest hw score.
1 Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 18 Prof. Erik Demaine.
Computational Complexity Dr. Colin Campbell Course: EMAT20531.
1 P, NP, and NP-Complete Dr. Ying Lu RAIK 283 Data Structures & Algorithms.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Cook-Levin Theorem Proof and Illustration Kwak, Nam-ju Applied Algorithm Laboratory KAIST 1 Applied Algorithm Lab. KAIST WSAC2010 Talk 11st, January, 2010.
Copyright © Cengage Learning. All rights reserved. 2.5 The Fundamental Theorem of Algebra.
Copyright © Cengage Learning. All rights reserved. 1.6 Inverse Functions.
NP CS 4102: Algorithms Spring 2011 Aaron Bloomfield 1.
A threshold of ln(n) for approximating set cover By Uriel Feige Lecturer: Ariel Procaccia.
Completeness and Expressiveness. Consistency: a syntactic definition, related to the proof system. A set of formulas is consistent if there is no formula.
NP-Complete Proof of correctness; More reductions.
CS 336 March 19, 2012 Tandy Warnow. Basic Graph Terminology Nodes, vertices, edges, degrees, paths, cycles, connected components, adjacency, isolated.
Computational Complexity. Problem complexity vs. algorithmic complexity Upper bounds vs. lower bounds Exact solutions vs. approximate solutions Deterministic.
Roots & Zeros of Polynomials How the roots, solutions, zeros, x-intercepts and factors of a polynomial function are related. 2.5 Zeros of Polynomial Functions.
Complexity Classes: P and NP CS 130 Theory of Computation HMU Textbook: Chap 10.
Copyright © Cengage Learning. All rights reserved. 1.2 Functions.
P, NP, NP-Complete Problems. Polynomial Problems (P Family) The set of problems that can be solved in polynomial time These problems form the P family.
The Rational Zero Theorem. The Rational Zero Theorem gives a list of possible rational zeros of a polynomial function. Equivalently, the theorem gives.
Strong Stability in the Hospitals/Residents Problem Rob Irving, David Manlove and Sandy Scott University of Glasgow Department of Computing Science Supported.
NP-Completeness. Decision Problems Given Some Universal Set X, Let R be a subset of X. The decision problem for R is: Given an arbitrary element a of.
1 Constraint Satisfaction Problems Chapter 5 Sections 1 – 3.
1 Outline relationship among topics secrets LP with upper bounds by Simplex method basic feasible solution (BFS) by Simplex method for bounded variables.
Great Theoretical Ideas in Computer Science for Some.
Lehrstuhl für Informatik 2 Gabriella Kókai: Maschine Learning 1 Computational Learning Theory.
CS4026 Formal Models of Computation Part III Computability & Complexity Part III-A – Computability Theory.
NP-Complete Introduction to Algorithms NP-Complete CSE 680 Prof. Roger Crawfis.
© 2016 SlidePlayer.com Inc. All rights reserved.