Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

Similar documents
Complexity Theory 112. Space Complexity

Time Complexity. Definition. Let t : n n be a function. NTIME(t(n)) = {L L is a language decidable by a O(t(n)) deterministic TM}

Space Complexity. The space complexity of a program is how much memory it uses.

CSCI 1590 Intro to Computational Complexity

Lecture 21: Space Complexity (The Final Exam Frontier?)

Space and Nondeterminism

Lecture 8: Complete Problems for Other Complexity Classes

CS151 Complexity Theory. Lecture 4 April 12, 2017

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.

The space complexity of a standard Turing machine. The space complexity of a nondeterministic Turing machine

Space is a computation resource. Unlike time it can be reused. Computational Complexity, by Fu Yuxi Space Complexity 1 / 44

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Outline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018

1 Computational Problems

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

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

Advanced topic: Space complexity

Lecture 22: PSPACE

Review of Basic Computational Complexity

Notes for Lecture Notes 2

Space Complexity. Master Informatique. Université Paris 5 René Descartes. Master Info. Complexity Space 1/26

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3

CSCI 1590 Intro to Computational Complexity

Notes on Space-Bounded Complexity

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

Notes on Space-Bounded Complexity

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

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

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

Polynomial Hierarchy

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

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

More Complexity. Klaus Sutner Carnegie Mellon University. Fall 2017

PSPACE, NPSPACE, L, NL, Savitch's Theorem. More new problems that are representa=ve of space bounded complexity classes

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

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

Lecture 5: The Landscape of Complexity Classes

Computability and Complexity CISC462, Fall 2018, Space complexity 1

Complete problems for classes in PH, The Polynomial-Time Hierarchy (PH) oracle is like a subroutine, or function in

Computability and Complexity

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

Lecture 9: PSPACE. PSPACE = DSPACE[n O(1) ] = NSPACE[n O(1) ] = ATIME[n O(1) ]

conp, Oracles, Space Complexity

Could we potentially place A in a smaller complexity class if we consider other computational models?

Introduction to Computational Complexity

6.045 Final Exam Solutions

CS294: Pseudorandomness and Combinatorial Constructions September 13, Notes for Lecture 5

CSE 105 THEORY OF COMPUTATION

SOLUTION: SOLUTION: SOLUTION:

Lecture 8: Alternatation. 1 Alternate Characterizations of the Polynomial Hierarchy

Lecture 3: Reductions and Completeness

Chapter 7: Time Complexity

CSE 135: Introduction to Theory of Computation NP-completeness

Lecture 8. MINDNF = {(φ, k) φ is a CNF expression and DNF expression ψ s.t. ψ k and ψ is equivalent to φ}

P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:

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

Lecture Notes Each circuit agrees with M on inputs of length equal to its index, i.e. n, x {0, 1} n, C n (x) = M(x).

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

The Polynomial Hierarchy

Complexity (Pre Lecture)

Circuits. Lecture 11 Uniform Circuit Complexity

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

NP, polynomial-time mapping reductions, and NP-completeness

CS154, Lecture 13: P vs NP

1 PSPACE-Completeness

Computability and Complexity Theory: An Introduction

Undirected ST-Connectivity in Log-Space. Omer Reingold. Presented by: Thang N. Dinh CISE, University of Florida, Fall, 2010

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

CS154, Lecture 13: P vs NP

Computational Complexity

Universal Algebra and Computational Complexity Lecture 1

Lecture 16: Time Complexity and P vs NP

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.

CSE200: Computability and complexity Space Complexity

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

Principles of Knowledge Representation and Reasoning

Computational Complexity for Algebraists

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12

Advanced Topics in Theoretical Computer Science

Lecture 7: The Polynomial-Time Hierarchy. 1 Nondeterministic Space is Closed under Complement

Computability Theory

Time Complexity. CS60001: Foundations of Computing Science

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

BBM402-Lecture 11: The Class NP

Theory of Computation

CSE 105 THEORY OF COMPUTATION

Theory of Computation

Lecture 4. 1 Circuit Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

Definition: Alternating time and space Game Semantics: State of machine determines who

Lecture 3: Nondeterminism, NP, and NP-completeness

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

Lecture 23: More PSPACE-Complete, Randomized Complexity

Computational Complexity CSCI-GA Subhash Khot Transcribed by Patrick Lin

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

Introduction to Computational Complexity

CSCI 1590 Intro to Computational Complexity

Transcription:

1 2 Topics in Logic and Complexity Handout 2 Anuj Dawar MPhil Advanced Computer Science, Lent 2010 Polynomial Time Computation P = TIME(n k ) k=1 The class of languages decidable in polynomial time. The complexity class P plays an important role in complexity theory. It is robust, as explained. It serves as our formal definition of what is feasibly computable 3 4 Nondeterministic Polynomial Time Succinct Certificates NP = NTIME(n k ) k=1 That is, NP is the class of languages accepted by a nondeterministic machine running in polynomial time. Since a deterministic machine is just a nondeterministic machine in which the transition relation is functional, P NP. The complexity class NP can be characterised as the collection of languages of the form: L = {x yr(x, y)} Where R is a relation on strings satisfying two key conditions 1. R is decidable in polynomial time. 2. R is polynomially balanced. That is, there is a polynomial p such that if R(x, y) and the length of x is n, then the length of y is no more than p(n).

5 6 Equivalence of Definitions Equivalence of Definitions If L = {x y R(x, y)} we can define a nondeterministic machine M that accepts L. The machine first uses nondeterministic branching to guess a value for y, and then checks whether R(x, y) holds. In the other direction, suppose we are given a nondeterministic machine M which runs in time p(n). Suppose that for each (q, σ) K Σ (i.e. each state, symbol pair) there are at most k elements in δ(q, σ). For y a string over the alphabet {1,...,k}, we define the relation R(x, y) by: y p( x ); and the computation of M on input x which, at step i takes the y[i]th transition is an accepting computation. Then, L(M) = {x y R(x, y)} 7 8 Space Complexity Classes L = SPACE(log n) The class of languages decidable in logarithmic space. NL = NSPACE(log n) The class of languages decidable by a nondeterministic machine in logarithmic space. PSPACE = k=1 SPACE(nk ) The class of languages decidable in polynomial space. NPSPACE = k=1 NSPACE(nk ) We have the following inclusions: Inclusions between Classes L NL P NP PSPACE NPSPACE EXP where EXP = k=1 TIME(2nk ) Of these, the following are direct from the definitions: L NL P NP PSPACE NPSPACE

9 10 NP PSPACE NL P To simulate a nondeterministic machine M running in time t(n) by a deterministic one, it suffices to carry out a depth-first search of the computation tree. We keep a counter to cut off branches that exceed t(n) steps. The space required is: a counter to count up to t(n); and a stack of configurations, each of size at most O(t(n)). The depth of the stack is at most t(n). Given a nondeterministic machine M that works with work space bounded by s(n) and an input x of length n, there is some constant c such that the total number of possible configurations of M within space bounds s(n) is bounded by n c s(n). Define the configuration graph of M, x to be the graph whose nodes are the possible configurations, and there is an edge from i to j if, and only if, i M j. Thus, if t is a polynomial, the total space required is polynomial. 11 12 Reachability in the Configuration Graph Nondeterministic Space Classes M accepts x if, and only if, some accepting configuration is reachable from the starting configuration in the configuration graph of M, x. If Reachability were solvable by a deterministic machine with logarithmic space, then L = NL. Using the O(n 2 ) algorithm for Reachability, we get that M can be simulated by a deterministic machine operating in time c (nc s(n) ) 2 c c 2(log n+s(n)) (log n+s(n)) d In fact, Reachability is solvable by a deterministic machine with space O((log n) 2 ). for some constant d. When s(n) = O(log n), this is polynomial and so NL P. This implies NSPACE(s(n)) SPACE((s(n) 2 )). When s(n) is polynomial this is exponential in n and so NPSPACE EXP. In particular PSPACE = NPSPACE.

13 14 Reachability in O((log n) 2 ) Inclusions between Classes O((log n) 2 ) space Reachability algorithm: This leaves us with the following: Path(a, b, i) if i = 1 and (a, b) is not an edge reject else if (a, b) is an edge or a = b accept else, for each node x, check: L NL P NP PSPACE EXP Hierarchy Theorems proved by diagonalization can show that: 1. is there a path a x of length i/2; and 2. is there a path x b of length i/2? L PSPACE NL NPSPACE P EXP if such an x is found, then accept, else reject. The maximum depth of recursion is log n, and the number of bits of information kept at each stage is 3 log n. For other inclusions above, it remains an open question whether they are strict. 15 16 Complement Classes Relationships If we interchange accepting and rejecting states in a deterministic machine that accepts the language L, we get one that accepts L. If a language L P, then also L P. Complexity classes defined in terms of nondeterministic machine models are not necessarily closed under complementation of languages. P NP co-np and any of the situations is consistent with our present state of knowledge: P = NP = co-np P = NP co-np NP co-np P NP co-np = NP = co-np P NP co-np NP co-np Define, co-np the languages whose complements are in NP. co-nl the languages whose complements are in NL. It follows from the fact that PSPACE = NPSPACE that NPSPACE is closed under complementation. Also, Immerman and Szelepcsényi showed that NL = co-nl.

17 18 Reductions Resource Bounded Reductions Given two languages L 1 Σ 1, and L 2 Σ 2, A reduction of L 1 to L 2 is a computable function If f is computable by a polynomial time algorithm, we say that L 1 is polynomial time reducible to L 2. L 1 P L 2 f : Σ 1 Σ 2 such that for every string x Σ 1, If f is also computable in SPACE(log n), we write f(x) L 2 if, and only if, x L 1 L 1 L L 2 19 20 Reductions 2 Completeness If L 1 L 2 we understand that L 1 is no more difficult to solve than L 2. That is to say, for any of the complexity classes C we consider, If L 1 L 2 and L 2 C, then L 1 C We can get an algorithm to decide L 1 by first computing f, and then using the C-algorithm for L 2. Provided that C is closed under such reductions. The usefulness of reductions is that they allow us to establish the relative complexity of problems, even when we cannot prove absolute lower bounds. Cook (1972) first showed that there are problems in NP that are maximally difficult. For any complexity class C, a language L is said to be C-hard if for every language A C, A L. A language L is C-complete if it is in C and it is C-hard.

21 22 Complete Problems Reading List for this Handout Examples of complete problems for various complexity classes. NL Reachability 1. Papadimitriou. Chapters 7, 8 and 16. 2. Immerman Chapter 2. P Game, Circuit Value Problem NP Satisfiability of Boolean Formulas, Graph 3-Colourability, Hamiltonian Cycle co-np Validity of Boolean Formulas, Non 3-colourability PSPACE Geography, The game of HEX