P = k=0 TIMETM(nk ), NP-completeness and Cook-Levin theorem

Similar documents
6.5.3 An NP-complete domino game

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

The Cook-Levin Theorem

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Non-Approximability Results (2 nd part) 1/19

Computability and Complexity CISC462, Fall 2018, Space complexity 1

The tape of M. Figure 3: Simulation of a Turing machine with doubly infinite tape

Reducibility in polynomialtime computable analysis. Akitoshi Kawamura (U Tokyo) Wadern, Germany, September 24, 2015

Notes on Complexity Theory Last updated: October, Lecture 6

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Lecture 7: Polynomial time hierarchy

Computability Theory. CS215, Lecture 6,

CS154, Lecture 17: conp, Oracles again, Space Complexity

Welcome to... Problem Analysis and Complexity Theory , 3 VU

CSC 373: Algorithm Design and Analysis Lecture 18

Lecture 1: Course Overview and Turing machine complexity

CS 6505, Complexity and Algorithms Week 7: NP Completeness

Turing Machines and Time Complexity

Week 3: Reductions and Completeness

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

SAT, Coloring, Hamiltonian Cycle, TSP

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

NP Completeness. Richard Karp, 1972.

Space Complexity. Huan Long. Shanghai Jiao Tong University

Automata Theory CS S-18 Complexity Theory II: Class NP

CSCI3390-Lecture 16: NP-completeness

Algebraic Dynamic Programming. Solving Satisfiability with ADP

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

Answers to the CSCE 551 Final Exam, April 30, 2008

SAT, NP, NP-Completeness

CSE 105 THEORY OF COMPUTATION

COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness

Computer Sciences Department

where Q is a finite set of states

Part I: Definitions and Properties

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

UNIT-VIII COMPUTABILITY THEORY

Variations of the Turing Machine

On the Computational Hardness of Graph Coloring

Comparison of several polynomial and exponential time complexity functions. Size n

Definition: conp = { L L NP } What does a conp computation look like?

Polynomial-time Reductions

Lecture 2. 1 More N P-Compete Languages. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

CSE 105 THEORY OF COMPUTATION

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

Complexity and NP-completeness

CS4026 Formal Models of Computation

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010

Exam Computability and Complexity

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1

Principles of Knowledge Representation and Reasoning

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

Homework Assignment 6 Answers

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

Introduction to Complexity Theory

CSCC63 Worksheet Turing Machines

Finite Automata. Mahesh Viswanathan

CS154, Lecture 13: P vs NP

conp, Oracles, Space Complexity

ECS 120 Lesson 15 Turing Machines, Pt. 1

The Complexity of Optimization Problems

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Intro to Theory of Computation

A An Overview of Complexity Theory for the Algorithm Designer

Formal Definition of Computation. August 28, 2013

Most General computer?

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

1 PSPACE-Completeness

Algorithm Design and Analysis

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

Lecture 3: Nondeterminism, NP, and NP-completeness

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Theory of Computation Time Complexity

Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all

Nondeterministic Turing Machines

NP and NP-Completeness

Planning and Optimization

CSC373: Algorithm Design, Analysis and Complexity Fall 2017

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

Advanced Topics in Theoretical Computer Science

Geometric Steiner Trees

Umans Complexity Theory Lectures

Lecture 16: Time Complexity and P vs NP

Review of unsolvability

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Computability and Complexity Theory: An Introduction

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

MTAT Complexity Theory October 13th-14th, Lecture 6

NP-Completeness and Boolean Satisfiability

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

About the impossibility to prove P NP or P = NP and the pseudo-randomness in NP

Transcription:

in time and space O( f (n)), respectively. Moreover, the complexity class NTIMETM( f (n)) is the set of decision problems P whose corresponding language L P can be solved in time O( f (n)) by a nondeterministic Turing machine. According to the above definition and because the Pascal program and Turing machine models are polynomially related, we have that P = k=0 TIMETM(nk ), PSPACE = k=0 SPACETM(nk ), and NP = k=0 NTIMETM(nk ). Observe that, according to the above definitions, classes P, PSPACE, and NP contain decision problems. In the following, however, we will, in some cases, identify a decision problem with its corresponding language and we will view these classes as sets of languages. Before concluding this section, we observe that Turing machines are in practice not used to design algorithms. However, defining the complexity classes using Turing machines is useful when proving hardness results. The Turing machine is such a simple computation model that it is relatively easy to express any computation on it using a simple structure like a Boolean formula. We will soon use this to show a hardness result for SATISFIABILITY. 6.1.5 NP-completeness and Cook-Levin theorem 184 Now that we have defined P and NP using the Turing machine computation model we will proceed to define NP-completeness in this model. Recall from Chap. 1 that a decision problem P is NP-complete if it is included in NP and if every problem in NP is polynomial-time Karp-reducible to P. The Karp-reducibility defined in Sect. 1.3 is stated using a Pascal program that transforms an instance of one problem into an instance of another problem. Instead of a polynomial-time Pascal program we can use a polynomial-time Turing machine that simulates the Pascal program in polynomial time. Observe that such a Turing machine does not behave as an acceptor machine as defined in Def. 6.2, but it must return an output value and is usually called a transducer: the formal definition of a transducer is left to the reader (see also the end of Sect. 6.1.1). As stated in Chap. 1, the standard way to show the NP-completeness of a decision problem is to find a polynomial-time Karp-reduction from some

other problem that is already known to be NP-complete. Clearly, such a process needs some initial NP-complete problem, whose NP-completeness must be proved by using some other technique. We now see an important result, known as Cook-Levin theorem, which shows that SATISFIABILITY is such an initial NP-complete problem. Section 6.1 FORMAL COMPLEXITY THEORY i time t Γ +1 cell C-variables 1 head H-variable Q state S-variables p( x ) p( x ) space Figure 6.6 The Boolean variables of Cook-Levin theorem SATISFIABILITY is NP-complete. Theorem 6.1 SATISFIABILITY has already been shown to belong to NP by providing a nondeterministic polynomial-time algorithm that solves it (see Algorithm 1.3). We have then only to show that, given any decision problem P NP, we can (Karp-) reduce P to SATISFIABILITY in polynomial time. Let M be a nondeterministic Turing machine that recognizes L P in time p(n), for a suitable polynomial p. Givenx Σ, we will construct a formula w in conjunctive normal form such that w is satisfiable if and only if M accepts x in time p( x ), that is, if and only if x L. Intuitively, w will be constructed in such a way that any satisfying truth assignment to its variables will encode an accepting computation path of M on input x. In order to simplify the proof, and without loss of generality, we make the assumption on M that its tape is semi-infinite and that, for any input, there is no transition trying to overpass the leftmost tape cell: it can be shown (see Exercise 6.8) that this assumption is justified. Since M on input x runs in time p( x ), only the first p( x ) tape cells may be accessed PROOF 185

during the computation. Finally, we will denote with a b (respectively, a b) the Boolean formula a b (respectively, (a b) (a b)). The formula w we are going to derive is the conjunction of several formulas, that is, w = w M w I w A w T,where: 1. w M specifies the general properties of Turing machines. 2. w I specifies that M has been given string x as input on the tape. 3. w A specifies that M has eventually entered an accepting configuration. 4. w T specifies the particular transition function of M. The formula w contains the following variables with the corresponding interpretations (see Fig. 6.6): 1. S(t,k) (0 t < p( x ), 1 k Q ) whereq is the set of states of M : S(t,k) takes value TRUE if and only if M is in state q k at time t (we let q 1 be the initial state q S and q Q be the accepting state q A ). 2. H(t,i) (0 t < p( x ), 0 i < p( x )): H(t,i) takes value TRUE if and only if M s head scans cell i at time t. 3. C(t,i,h) (0 t < p( x ), 0 i < p( x ), 0 h Γ ) whereγ is the tape alphabet of M : C(t,i,h) takes value TRUE if and only if cell i at time t contains the symbol σ h (we let σ 0 = ). Let us now see how the various subformulas of w are built: 1. w M is the conjunction of four formulas w MS, w MH, w MC,andw MT that specify the following properties, respectively: 5 At any time t, M must be in exactly one state, that is, w MS is the formula S(t,k) (S(t,k 1 ) S(t,k 2 )). t k k 1 k 2 At any time t, the head must be on exactly one tape cell, that is, w MH is the formula H(t,i) (H(t,i 1 ) H(t,i 2 )). t i i 1 i 2 186 5 Note that here the quantifiers and are used just as abbreviations: for example, t F(...t...) stands for F(...0...) F(...1...)...F(...p( x ) 1...).

At any time t, each cell must contain exactly one character, that is, w MC is the formula C(t,i,h) (C(t,i,h) C(t,i,h )). t,i h h h Section 6.1 FORMAL COMPLEXITY THEORY At any two successive times t and t + 1, the tape contents are the same, except possibly for the cell scanned at time t. That is, w MT is the formula (H(t,i) (C(t,i,h) C(t + 1,i,h))). t,i,h Notice that w MT is not in conjunctive normal form: however, it can be easily put in conjunctive normal form with a linear increase of its length (see Exercise 6.9). Taking into account the ranges of the values assumed by t, i, h, and k, the overall length of w M is O(p 3 ( x )). 2. If x = σ h0 σ h1...σ h x 1,thenw I is the formula S(0,1) H(0,0) C(0,0,h 0 ) C(0,1,h 1 ) C(0, x 1,h x 1 ) C(0, x,0) C(0, p( x ) 1,0). 3. w A = S(0, Q ) S(1, Q ) S(p( x ) 1, Q ). 4. w T encodes the set of transition rules for M. It is structured as the conjunction of p 2 ( x ) Q ( Γ + 1) formulas w t,i,k,h : For any t,i,k,h, if p( x ) 1 t=0 p( x ) 1 i=0 Q Γ k=1 h=0 w t,i,k,h. δ(q k,σ h )={(q k1,σ h1,r k1 ),...,(q kd,σ hd,r kd )}, then (assuming µ(r)=1, µ(l)= 1, and µ(n)=0) w t,i,k,h =(S(t,k) H(t,i) C(t,i,h)) d j=1 w j t,i,k,h 187

QED where w j t,i,k,h = H(t + 1,i + µ(r k j )) C(t + 1,i,h j ) S(t + 1,k j ). If δ(q k,σ h )=/0, thenw t,i,k,h is equal to TRUE, foranyt and i. The length of formula w T can be seen to be O(p 2 ( x )). As in the case of w MT, w T is not in conjunctive normal form but it can be put in conjunctive normal form with a linear increase of its length. Taking into consideration the whole formula w, it can easily be checked that its length is O(p 3 ( x )) and that it can be derived from x (and from M and p) in time proportional to its length. Moreover, it is not difficult to verify that the formula w is satisfiable if and only if M accepts the string x in time p( x ). We have thus shown that SATISFIABILITY is NP-complete. Proving the NP-completeness of other problems is, usually, an easier task since we can use a decision problem that is already known to be NP-complete. Example 6.5 Let us consider E3-SATISFIABILITY which is the restriction of SATISFIABILITY to instances with exactly three literals per clause. It is clear that such a problem belongs to NP. To prove that it is NP-complete, we will define a polynomialtime reduction from SATISFIABILITY to E3-SATISFIABILITY. The reduction will transform the clauses of the instance of SATISFIABILITY into a set of equivalent clauses containing exactly three (different) literals. More precisely, let C i be any clause of the instance of SATISFIABILITY. ThenC i is tranformed into the following subformula C i,wherethey variables are new ones: 1. If C i = l i1,thenc i =(l i 1 y i,1 y i,2 ) (l i1 y i,1 y i,2 ) (l i1 y i,1 y i,2 ) (l i1 y i,1 y i,2 ). 2. If C i = l i1 l i2,thenc i =(l i 1 l i2 y i ) (l i1 l i2 y i ). 3. If C i = l i1 l i2 l i3,thenc i = l i 1 l i2 l i3. 4. If C i = l i1 l i2... l ik with k > 3, then C i =(l i 1 l i2 y i,1 ) (y i,1 l i3 y i,2 )...(y i,k 4 l ik 2 y i,k 3 ) (y i,k 3 l ik 1 l ik ). Clearly, such a reduction can be done in polynomial time. Moreover, it is easy to prove that the original formula is satisfiable if and only if the transformed formula is satisfiable (see Exercise 6.12). That is, E3-SATISFIABILITY is NP-complete. 188 6.2 Oracles ORACLES WERE mentioned already in Chap. 1: we will here define them more formally. Oracles will later be used for defining probabilistically checkable proofs, a basic tool for proving non-approximability results (see Sect. 6.3).