(xy)(yz)(xz)(zy)

Slides:



Advertisements
Similar presentations
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Advertisements

Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Lecture 22: April 18 Probabilistic Method. Why Randomness? Probabilistic method: Proving the existence of an object satisfying certain properties without.
NP-Completeness: Reductions
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CS21 Decidability and Tractability
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP and NP-completeness
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
Complexity 19-1 Complexity Andrei Bulatov More Probabilistic Algorithms.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
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.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
Clique Cover Cook’s Theorem 3SAT and Independent Set
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
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
28.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
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.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
 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
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
NP and NP-completeness
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
Richard Anderson Lecture 26 NP-Completeness
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
CS154, Lecture 16: More NP-Complete Problems; PCPs
Where Can We Draw The Line?
Intro to NP Completeness
Connected Components Minimum Spanning Tree
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Chapter 34: NP-Completeness
Richard Anderson Lecture 28 NP Completeness
NP-completeness The Chinese University of Hong Kong Fall 2008
CS 3343: Analysis of Algorithms
CS21 Decidability and Tractability
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CSE 6408 Advanced Algorithms.
NP-Completeness Yin Tat Lee
More on NP-completeness
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Instructor: Aaron Roth
Instructor: Aaron Roth
Lecture 23 NP-Hard Problems
Presentation transcript:

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

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…

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). 

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

Graph Construction: Example (xy)(yz)(xz)(zy) x y x y z z

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 (,).

Correctness Claim: a 2-CNF formula  is unsatisfiable iff there exists a variable x, such that: there is a path from x to x in the graph there is a path from x to x in the graph

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): () is false! x x . . .   T T F F

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

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.

Correctness A formula is unsatisfiable iff there are no paths of the form x..x and x..x. 

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. 