Given this 3-SAT problem: (x1 or x2 or x3) AND (¬x1 or ¬x2 or ¬x2) AND (¬x3 or ¬x1 or x2) 1. Draw the graph that you would use if you want to solve this.

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

Cook’s Theorem The Foundation of NP-Completeness.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
Reduction Techniques Restriction Local Replacement Component Design Examples.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Clique Cover Cook’s Theorem 3SAT and Independent Set
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
1 1. Draw the machine schema for a TM which when started with input 001 halts with abbb on the tape in our standard input format. 2. Suppose you have an.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
NP-complete Languages
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
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
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
Intro to Theory of Computation
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Prove this problem is in NP
Our First NP-Complete Problem
Instructor: Aaron Roth
Lecture 23 NP-Hard Problems
Presentation transcript:

Given this 3-SAT problem: (x1 or x2 or x3) AND (¬x1 or ¬x2 or ¬x2) AND (¬x3 or ¬x1 or x2) 1. Draw the graph that you would use if you want to solve this problem using an algorithm for vertex cover. 2. What size of vertex cover would you look for in order to decide if this 3-SAT system is satisfiable?

2 Announcements: Final exam tutorial: Sunday Dec. 4 at 12:00pm in ECS 116.

SAT is NP-complete The fact that vertex cover is NP-complete is used to show that INDEPENDENT SET is NP- complete. Then we prove that CLIQUE is NP- complete. An outline is given for the proof of Cook’s theorem (SAT is NP-complete). It is a direct proof. The tactic for showing other problems are NP-complete is to use a reduction preserving polynomial running time.

INDEPENDENT SET: Given G,k, does G have an independent set of order k? Theorem: IND. SET is NP-complete. Proof: Certificate: vertex numbers of vertices in ind. set. To check: Time O(k 2 ) to make sure edges are missing between each pair of vertices in the independent set.

To determine if G has a vertex cover of order k: ask if G has an independent set of order n-k. The complement of every vertex cover is an independent set.

CLIQUE: Given G,k, does G have a clique of order k? Theorem: CLIQUE is NP-complete. Clique of order 5. Graph which has a clique of order 5.

The complement of G: has an edge (u, v) for each pair of vertices in G which are not connected by an edge in G. To solve IND. SET using CLIQUE: create the complement of G in O(n 2 ) time and then ask if it has a clique of order k.

A problem Q in NP is NP-complete if the existence of a polynomial time algorithm for Q implies the existence of a polynomial time algorithm for all problems in NP. How do we prove SAT is NP-complete?

Theorem: SAT (Satisfiability) is in NP. Proof. Variables: u 1, u 2, u 3,... u n. Certificate: sequence b 1, b 2, b 3,... b n of true/false values. Check for each clause if at least one literal is true. Time: O(n+k) where k is the number of occurrences of a literal in a clause.

Every problem Q which is in NP has a non-deterministic TM M which: 1. Guesses a certificate of length n. 2. Checks the certificate in p(n) time. Start state- q 0 Final state- the computation will terminate in a special state q N when the certificate is not correct and in a state q Y if the certificate is correct.

Cook’s Theorem: SAT is NP-complete. Idea of proof: Construct a collection of clauses whose length is polynomial in p(n) and hence is also polynomial in n. A satisfying truth assignment corresponds to a computation of M which non- deterministically guesses a correct certificate and checks it.

The number of tape squares used is bounded: p(n)= maximum number of steps that M takes on an input of size n. Tape squares used in this computation:

VariableRangeMeaning Q[i, k] 0 ≤ i ≤ p(n), 1 ≤ k ≤ # states At time i, M is in state q k H[i,j] 0 ≤ i ≤ p(n), -p(n) ≤ j ≤ p(n) Scanning square j at time i S[i, j, k] 0 ≤ i ≤ p(n), -p(n) ≤ j ≤ p(n), 1 ≤ k ≤ # symbols Time i, square j contains symbol s k

Clauses to make sure that satisfying assignments correspond to valid computations: Recall: Q[i, k]- At time i, M is in state q k Group G1: At time i, M is in exactly one state: (a) M is in at least one state at time i: for each i, 0 ≤ i ≤ p(n), add a clause (s= # states): (Q[i, 1] or Q[i, 2] or … or Q[i, s]) (b) M is in at most one state at time i: For each time i and pair j, k of states, 0 ≤ i ≤ p(n), 1 ≤ j < k ≤ s, add a clause (not Q[i, j] or not Q[i, k])

Clause Group Restriction G1At time i, M is in exactly one state. G2At time i, the tape head scans exactly one square. G3At time i, each square contains exactly one symbol. G4At time 0, M is in initial checking stage. G5By time p(n), M enters state q Y. G6 Configuration at time i+1 follows the one at time i by one application of the transition relation.

Original problem: Input of size n. The size of this SAT system has length which is at most some polynomial q(n). If there is an O(n c ) algorithm for SAT then there is an O(q(n) c ) algorithm for this other problem which is in NP. Therefore, if there is a polynomial time algorithm for SAT, there is a polynomial time algorithm for every problem in NP. Conclusion: SAT is NP-complete.

Summary of class contents: