Cook Theorem and NP-complete problems

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

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.
The Theory of NP-Completeness
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
NP-Complete Problems Problems in Computer Science are classified into
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Clique Cover Cook’s Theorem 3SAT and Independent Set
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Lecture 22 More NPC problems
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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.
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.
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.
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.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
Chapter 10 NP-Complete Problems.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
Polynomial-Time Reduction
Computability and Complexity
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
NP-Completeness Proofs
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
CS21 Decidability and Tractability
Intro to Theory of Computation
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
ICS 353: Design and Analysis of Algorithms
Complexity 6-1 The Class P Complexity Andrei Bulatov.
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
The Satisfiability Problem
Richard Anderson Lecture 28 NP-Completeness
Chapter 34: NP-Completeness
Chapter 8 NP and Computational Intractability
Richard Anderson Lecture 28 NP Completeness
NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CSE 6408 Advanced Algorithms.
NP-Completeness Yin Tat Lee
CS154, Lecture 16: More NP-Complete Problems; PCPs
Trevor Brown DC 2338, Office hour M3-4pm
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Instructor: Aaron Roth
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 23 NP-Hard Problems
Presentation transcript:

Cook Theorem and NP-complete problems NP-completeness Cook Theorem and NP-complete problems

NP-complete problems Definition 10.1. A decision problem Π  NP is called NP-complete if all other problems in NP polynomially transforms to Π.

Boolean variables Definition 10.2. Assume X = {x1,…,xk} is a set of Boolean variables. A truth assignment for X is a function T: X → {true, false}. We extend T to the set by setting if T(x) := false and vice versa (x can be regarded as the negation of x). The elements of L are called the literals over X.

Literals A clause over X is a set of literals over X. A clause represents the disjunction of those literals and is satisfied by a truth assignment iff at least one of its members is true. A family Z of clauses over X is satisfiable iff there is some truth assignment simultaneously satisfying all of its clauses.

Satisfiability Instance: A set X of variables and a family Z of clauses over X. Question: Is Z satisfiable?

Cook Theorem (Cook 1971) Theorem 10.1 Satisfiability is NP-complete.

Proof Satisfiability belongs to NP because a satisfying truth assignment serves as a certificate for any yes-instance, which of course can be checked in polynomial time.

Proof Let now Π = (X,Y) be any other problem in NP. We have to show that P polynomially transforms to Satisfiability. By definition there is a polynomial p and a decision problem Π'=(X',Y') in P, where X' = {x#c: x  X, c {0,1}└ p(size(x))┘} and Y = {y  X :  c  {0,1}└ p(size(x))┘ : y#c  Y'}. Let Φ:{0,…,N}× A{⊔}→{-1,…,N}×A{⊔}×{-1,0,1} be a polynomial-time Turing machine for Π’ with alphabet A. Let q be a polynomial such that time (Φ,x#c) ≤ q(size(x#c)) for all instances x#c  X'. size(x#c) = size(x) + 1 + └p(size(x))┘

Main idea We will now construct a collection Z(x) of clauses over some set V(x) of Boolean variables for each x ∈ X, such that Z(x) is satisfiable if and only if x∈Y.

Variables Q:=q(size(x) + 1 + └p(size(x))┘) Q is an upper bound on the length of any computation of on input x#c, for any c ∈ {0,1}p(size(x)). V(x) contains the following Boolean variables: vijσ , 0 ≤ i ≤ Q, -Q ≤ j ≤ Q и σ A{⊔} wijn , 0 ≤ i ≤ Q, -Q ≤ j ≤ Q и −1≤ n ≤ N; We set Q …. Q is an upper bound on the length of any computation of Fi

Meaning of Variables vijσ , 0 ≤ i ≤ Q, -Q ≤ j ≤ Q и σ  A{⊔} (vijσ indicates whether after i steps of the computation the j-th position of the string contains the symbol σ); wijn , 0 ≤ i ≤ Q, -Q ≤ j ≤ Q и −1≤ n ≤ N; (wijn indicates whether at time i the j-th position of the string is scanned and the n-th instruction is executed). We set Q …. Q is an upper bound on the length of any computation of Fi

Our goal So if (n(i),s(i),π(i)) i = 0,1,2,…is a computation of Φ, then we intend to set vijσ = true  sj(i) =σ; wijn = true  π(i) = j и n(i) = n; The collection Z(x) of clauses to be constructed will be satisfiable  there is a string c with output(Φ,x#c)=1.

Требуемые условия для выполнимого набора дизъюнкций At any time each position of the string contains a unique symbol . At any time a unique position of the string is scanned and a single instruction is executed . The algorithm starts correctly with input x#c for some c{0,1}└ p(size(x))┘. The algorithm works correctly ((n,σ)=(m,τ,δ)). When the algorithm reaches statement −1, it stops. Positions not being scanned remain unchanged. The output of the algorithm is 1.

At any time each position of the string contains a unique symbol:

At any time a unique position of the string is scanned and a single instruction is executed:

The algorithm starts correctly with input x#c for some c{0,1}└ p(size(x))┘.:

The algorithm works correctly ((n,σ)=(m,τ,δ)).

When the algorithm reaches statement −1, it stops:

Positions not being scanned remain unchanged:

The output of the algorithm is 1: {vQ,1,1}, {vQ,2,⊔}

Reduction is polynomial The encoding length of Z(x) is O(Q3log Q): There are O(Q3) occurrences of literals, whose indices require O(log Q) space. Since Q depends polynomially on size(x), we conclude that there is a polynomial-time algorithm which, given x, constructs Z(x). Note that p,  and q are fixed and not part of the input of this algorithm. It remains to show that Z(x) is satisfiable if and only if x  Y.

If Z(x) is satisfiable then x  Y. If Z(x) is satisfiable, consider a truth assignment T satisfying all clauses. Let c {0,1}└ p(size(x))┘, with cj = 1 for all j with T(v0,size(x)+1+j,1) = true and cj = 0 for all j with T(v0,size(x)+1+j,1) = false. By the construction the variables reflect computation of  on input x#c.  we may conclude that output(, x#c)=1. Since  is a certificate-checking algorithm, this implies that x is a yes-instance (x  Y).

If x  Y then Z(x) is satisfiable. If x  Y, let c be any certificate for x. Let (n(i),s(i),π(i)) i = 0, 1, …, m be the computation of Φ on input x#c. Then we define T(vi,j,σ ) = true  sj(i) = σ T(wi,j,n ) = true  π(i) = j and n(i) = n. T(vi,j,σ ) = T(vi-1,j,σ ) i = m + 1,…, Q. T(wi,j,n ) = T(wi-1,j,n ) i = m + 1,…, Q.  Then T is a truth assignment satisfying Z(x), completing the proof.

3Sat Instance: A set X of variables and a collection Z of clauses over X, each containing exactly three literals. Question: Is Z satisfiable?

3Sat Theorem 10.2 (Cook 1971) 3Sat is NP-complete. We should replace each clause Z with a family Z’ of clauses such that each element of Z’ has exactly 3 literals and clause is satisfiable if and only if all clauses of Z’ are satisfiable.

Proof

Stable Set Instance: A graph G and an integer k. Question: Is there a stable set of k vertices? A stable set in G is a set of pairwise non-adjacent vertices.

Stable Set Theorem 10.3 (Karp 1972) Stable Set is NP-complete.

Sketch of proof «Satisfiability» → «Stable Set» «Satisfiability»: Let Z ={Z1,…,Zm} be a collection of clauses with Zi={λi1,…, λiki} (i = 1,…,m), where the λij are literals over some set X of variables. We shall construct a graph G such that G has a stable set of size m if and only if there is a truth assignment satisfying all m clauses. We show that Satisfiability polynomially transforms to Stable Set.

Reduction For each clause Zi we introduce a clique of ki vertices according to the literals in this clause. Vertices corresponding to different clauses are connected by an edge if and only if the literals contradict each other.

Instance

Proof Suppose G has a stable set of size m. Then its vertices specify pairwise compatible literals belonging to different clauses. Setting each of these literals to be true (and setting variables not occurring there arbitrarily) we obtain a truth assignment satisfying all m clauses.

Proof Conversely, if some truth assignment satisfies all m clauses, then we choose a literal which is true out of each clause. The set of corresponding vertices then defines a stable set of size m in G.

Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k? Clique Question. Has G a clique of cardinality k? Prove NP-completeness of Vertex cover and Clique.