Introduction to Complexity Classes. Marcin Sydow

Similar documents
Computability and Complexity CISC462, Fall 2018, Space complexity 1

Complexity Theory 112. Space Complexity

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

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

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

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

Hierarchy theorems. Evgenij Thorstensen V18. Evgenij Thorstensen Hierarchy theorems V18 1 / 18

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

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems

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

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

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}

Deterministic Time and Space Complexity Measures

Review of Basic Computational Complexity

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. Ch.8 Space Complexity. wherein all branches of its computation halt on all

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

Space Complexity. Huan Long. Shanghai Jiao Tong University

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

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

Introduction to Computational Complexity

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

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

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

Introduction to Computational Complexity

COMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems

Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky SOLUTION

Universal Algebra and Computational Complexity Lecture 1

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

Complexity of domain-independent planning. José Luis Ambite

LTCC Course: Graph Theory 2017/18 3: Complexity and Algorithms

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

Introduction to Computational Complexity

Computational Complexity for Algebraists

Computational Complexity

Advanced topic: Space complexity

Algorithms & Complexity II Avarikioti Zeta

Harvard CS 121 and CSCI E-121 Lecture 20: Polynomial Time

Computational Complexity Theory

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

Complexity Theory Final Exam

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

Notes on Complexity Theory Last updated: December, Lecture 2

CSCI 1590 Intro to Computational Complexity

Resource-Bounded Computation

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

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

Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary

Principles of Knowledge Representation and Reasoning

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

Lecture 5: The Landscape of Complexity Classes

1 Computational Problems

6.045 Final Exam Solutions

On Straight Forward Approaches to P vs NP

CS151 Complexity Theory. Lecture 1 April 3, 2017

Notes for Lecture Notes 2

Time-bounded computations

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

About the relationship between formal logic and complexity classes

Non-Deterministic Time

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

Turing-Computable Functions

B6.1 (Bounded-Cost) Plan Existence

Planning and Optimization

SOLUTION: SOLUTION: SOLUTION:

Computability and Complexity

Computational Complexity IV: PSPACE

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

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

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

Circuits. Lecture 11 Uniform Circuit Complexity

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

More Complexity. Klaus Sutner Carnegie Mellon University. Fall 2017

Computability and Complexity Theory

Theory of Computation Lecture Notes. Problems and Algorithms. Class Information

Advanced Topics in Theoretical Computer Science

NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.

CS151 Complexity Theory. Lecture 4 April 12, 2017

Intro to Theory of Computation

Time Complexity. CS60001: Foundations of Computing Science

Mm7 Intro to distributed computing (jmp) Mm8 Backtracking, 2-player games, genetic algorithms (hps) Mm9 Complex Problems in Network Planning (JMP)

Lecture 16: Time Complexity and P vs NP

Complexity: Some examples

DRAFT. Diagonalization. Chapter 4

Computer Sciences Department

Ταουσάκος Θανάσης Αλγόριθμοι και Πολυπλοκότητα II 7 Φεβρουαρίου 2013

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

Computational Complexity III: Limits of Computation

Computational Complexity: A Modern Approach. Draft of a book: Dated January 2007 Comments welcome!

Lecture 3: Reductions and Completeness

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

The Polynomial Hierarchy

Implicit Computational Complexity and Probabilistic Classes

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

Two-Way Automata Characterizations of L/poly versus NL

execution. Both are special cases of partially observable MDPs, in which the agent may receive incomplete (or noisy) information about the systems sta

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

Chapter 7: Time Complexity

Algorithms. Grad Refresher Course 2011 University of British Columbia. Ron Maharik

Transcription:

Denition TIME(f(n)) TIME(f(n)) denotes the set of languages decided by deterministic TM of TIME complexity f(n) Denition SPACE(f(n)) denotes the set of languages decided by deterministic TM of SPACE complexity f(n) Denition NTIME(f(n)) denotes the set of languages decided by non-deterministic TM of TIME complexity f(n) Denition NSPACE(f(n)) denotes the set of languages decided by non-deterministic TM of SPACE complexity f(n)

Linear Speedup Theorem Theorem If L is recognised by machine M in time complexity f(n) then it can be recognised by a machine M' in time complexity f (n) = ɛf (n) + (1 + ɛ)n, where ɛ > 0.

Blum's theorem There exists a language for which there is no fastest algorithm! (Blum - a Turing Award laureate, 1995) Theorem There exists a language L such that if it is accepted by TM of time complexity f(n) then it is also accepted by some TM in time complexity log(f (n)).

Basic complexity classes (the functions are asymptic) P = j>0 TIME(nj ), the class of languages decided in deterministic polynomial time NP = j>0 NTIME(nj ), the class of languages decided in non-deterministic polynomial time EXP = j>0 TIME(2nj ), the class of languages decided in deterministic exponential time NEXP = j>0 NTIME(2nj ), the class of languages decided in non-deterministic exponential time

Space complexity classes L = SPACE(logn), the class of languages decided in deterministic logarithic space NL = NSPACE(logn), the class of languages decided in non-deterministic logarithic space PSPACE = j>0 SPACE(nj ), the class of languages decided in deterministic polynomial space NPSPACE = j>0 NSPACE(nj ), the class of languages decided in non-deterministic polynomial space EXPSPACE = j>0 SPACE(2nj ), the class of languages decided in deterministic exponential space NEXPSPACE = j>0 NSPACE(2nj ), the class of languages decided in non-deterministic exponential space

Basic relations among complexity classes (Connections between time, space and non-determinism) TIME(f (n)) NTIME(f (n))

Basic relations among complexity classes (Connections between time, space and non-determinism) TIME(f (n)) NTIME(f (n)), since each deterministic machine is also a non-deterministic one (by denition) SPACE(f (n)) NSPACE(f (n))

Basic relations among complexity classes (Connections between time, space and non-determinism) TIME(f (n)) NTIME(f (n)), since each deterministic machine is also a non-deterministic one (by denition) SPACE(f (n)) NSPACE(f (n))(as above) TIME(f (n)) SPACE(f (n))

Basic relations among complexity classes (Connections between time, space and non-determinism) TIME(f (n)) NTIME(f (n)), since each deterministic machine is also a non-deterministic one (by denition) SPACE(f (n)) NSPACE(f (n))(as above) TIME(f (n)) SPACE(f (n)) (no machine can write more memory cells than its working time) NTIME(f (n)) NSPACE(f (n))

Basic relations among complexity classes (Connections between time, space and non-determinism) TIME(f (n)) NTIME(f (n)), since each deterministic machine is also a non-deterministic one (by denition) SPACE(f (n)) NSPACE(f (n))(as above) TIME(f (n)) SPACE(f (n)) (no machine can write more memory cells than its working time) NTIME(f (n)) NSPACE(f (n)) (as above) NTIME(f (n)) TIME(c f (n) ) (by a theorem on simulating a non-deterministic machine by a deterministic one)

Gap Theorem and space-constructibility Let assume the following constraint on f(n) (f(n) is space-constructible): f (n) logn and there exists TM that, when receives n (in unary encoding) in input, uses exactly f(n) cells of space and sps Example: logn, n k, 2 n are space-constructible (and all reasonable functions are).

Gap Theorem and space-constructibility Let assume the following constraint on f(n) (f(n) is space-constructible): f (n) logn and there exists TM that, when receives n (in unary encoding) in input, uses exactly f(n) cells of space and sps Example: logn, n k, 2 n are space-constructible (and all reasonable functions are). (binary counter, multiplication/addition, n times doubling the input) Theorem (Gap theorem) There exists a recursive function f(n) so that TIME(f(n))=TIME(2 f (n) ). Comment: constraints like space-constructibility are introduced avoid situations like this.

Congurations of TM The number of dierent congurations of a TM with space complexity f(n) (that is space-constructible) on a input word of length n can be bounded by c f (n), for some constant c that depends only on the machine and assuming that f (n) logn (what is implied by space-constructibility) SPACE(f (n)) TIME(c f (n) ), due the bound on the number of congurations (c f (n) ), since the machine that does not loop can be simulated on a machine that works that long (else it loops)

More relations between classes... NTIME(f (n)) SPACE(f (n)), since deterministic machine can simulate non-deterministic one It suces generate each of f(n) sequences of non-deterministic choices (here we use the space-constructibility assumption) that are made during the computations. Next, we deterministically simulate the computations in f(n) steps. All these operations can be done in f(n) space since each sequence of non-deterministic choices can be simulated in the same space. NSPACE(f (n)) TIME(c f (n) ), again, due simulation As before, the number of all congurations is c f (n), but now transitions between the congurations form a graph. It suces check whether there exists a path from the starting conguration the terminating one, that can be computed in polynomial time (with regard the graph size), that is in asymptic time c f (n).

L NL P NP PSPACE PSPACE NPSPACE EXP NEXP EXPSPACE NEXPSPACE Explanations: NL P, due NSPACE(f (n)) TIME(c f (n) ), because c logn = n k NPSPACE EXP, also due NSPACE(f (n)) TIME(c f (n) ), because c nk = 2 nk. The space-hierarchy theorem (later) implies L PSPACE so that the rst and last elements above are dierent. Thus, at least one of the inclusions is sharp, however it is not known which one! (the most famous is the P vs NP case)

Theorem (Savitch) If f(n) is space-constructible, then NSPACE(f (n)) SPACE(f 2 (n)). Thus, we can infer that some classes are equal: PSPACE = NPSPACE, EXPSPACE = NEXPSPACE. This means that non-determinism does not extend computational power for some high space complexity classes. Nothing comparable concerning the time complexity classes is known.

Space hierarchy theorem Theorem If f(n) is space-constructible and g(n) o(f (n)) (grows asymptically slower) then SPACE(g(n)) SPACE(f (n)).

Time hierarchy theorem f(n) is time-constructible i f (n) nlogn and there exists a TM that having n (unary encoding) on input can work in exactly f(n) steps and halt. (most of known functions have this property) Theorem If f(n) is time-constructible and g(n) o(f (n)/logf (n)) then TIME(g(n)) TIME(f (n)).

Conclusions SPACE(n ɛ 1 ) SPACE(n ɛ 2 ), for 0 ɛ 1 < ɛ 2, from the properties of polynomials TIME(n ɛ 1 ) TIME(n ɛ 2 ), for 1 ɛ 1 < ɛ 2, as above L PSPACE, since logarithm grows slower than polynomial P EXP, since each polynomial grows slower than sub-exponential function n logn that grows slower than any exponential function PSPACE EXPSPACE, as above Thus, the complexity class P that is usually regarded as the class of eciently solvable problems has some inner hierarchy.

Literature Theory: Papadimitriou Computational, Addison Wesley Longman, 1994 Garey, Johnson Computers and Intractability (issued in 1979, dicult get nowadays) Introducry Textbooks: Cormen et al. Algorithms 3rd edition, MIT Press chapters 34,35 Kleinberg, Tardos Algorithm Design, Addison Wesley, 2006 chapters 8,10,11

Thank you for attention