Complexity Theory 112. Space Complexity

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

Computability and Complexity CISC462, Fall 2018, Space complexity 1

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

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

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

CS151 Complexity Theory. Lecture 4 April 12, 2017

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

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

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

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

CSCI 1590 Intro to Computational Complexity

Advanced topic: Space complexity

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

6.045 Final Exam Solutions

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

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

Introduction to Complexity Classes. Marcin Sydow

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

Review of Basic Computational Complexity

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

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

Introduction to Computational Complexity

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

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

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

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.

SOLUTION: SOLUTION: SOLUTION:

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

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

Notes on Space-Bounded Complexity

Lecture 5: The Landscape of Complexity Classes

Notes on Space-Bounded Complexity

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

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

Lecture 8: Complete Problems for Other Complexity Classes

CSCI 1590 Intro to 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

More Complexity. Klaus Sutner Carnegie Mellon University. Fall 2017

Space Complexity. then the space required by M on input x is. w i u i. F ) on. September 27, i=1

CSE200: Computability and complexity Space Complexity

Notes on Complexity Theory Last updated: December, Lecture 2

CS256 Applied Theory of Computation

Umans Complexity Theory Lectures

Lecture 22: PSPACE

Space Complexity. Huan Long. Shanghai Jiao Tong University

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

Universal Algebra and Computational Complexity Lecture 1

Computational Complexity for Algebraists

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

Quantum Computing Lecture 8. Quantum Automata and Complexity

Chapter 7: Time Complexity

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

Computational Complexity

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

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

Infinite and Finite Model Theory Part II

Space and Nondeterminism

1 Computational Problems

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

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

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

Notes for Lecture Notes 2

UNIT-IV SPACE COMPLEXITY

Time to learn about NP-completeness!

Ma/CS 117c Handout # 5 P vs. NP

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}

DRAFT. Diagonalization. Chapter 4

Time and space classes

Lecture 16: Time Complexity and P vs NP

Circuits. Lecture 11 Uniform Circuit Complexity

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Time and Space Complexity Measures

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

Lecture 24: Randomized Complexity, Course Summary

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

Advanced Topics in Theoretical Computer Science

Lecture Notes 4. Issued 8 March 2018

Further discussion of Turing machines

Complexity Theory Final Exam

1 PSPACE-Completeness

Lecture 3: Reductions and Completeness

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

CSCI 1590 Intro to Computational Complexity

Complexity: Some examples

Computational Models Lecture 11, Spring 2009

CS151 Complexity Theory. Lecture 1 April 3, 2017

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

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

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

1 Deterministic Turing Machines

CSCI3390-Lecture 14: The class NP

Turing machines. Chapter Definition

Lecture 19: Finish NP-Completeness, conp and Friends

Resource-Bounded Computation

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).

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

Lecture 7: Polynomial time hierarchy

Transcription:

Complexity Theory 112 Space Complexity We ve already seen the definition SPACE(f(n)): the languages accepted by a machine which uses O(f(n)) tape cells on inputs of length n. Counting only work space NSPACE(f(n)) is the class of languages accepted by a nondeterministic Turing machine using at most f(n) work space. As we are only counting work space, it makes sense to consider bounding functions f that are less than linear.

Complexity Theory 113 Classes L = SPACE(log n) NL = NSPACE(log n) PSPACE = k=1 SPACE(nk ) The class of languages decidable in polynomial space. NPSPACE = k=1 NSPACE(nk ) Also, define co-nl the languages whose complements are in NL. co-npspace the languages whose complements are in NPSPACE.

Complexity Theory 114 Inclusions We have the following inclusions: L NL P NP PSPACE NPSPACE EXP where EXP = k=1 TIME(2nk ) Moreover, L NL co-nl P NP co-np PSPACE NPSPACE co-npspace

Complexity Theory 115 Establishing Inclusions To establish the known inclusions between the main complexity classes, we prove the following. SPACE(f(n)) NSPACE(f(n)); TIME(f(n)) NTIME(f(n)); NTIME(f(n)) SPACE(f(n)); NSPACE(f(n)) TIME(k log n+f(n) ); The first two are straightforward from definitions. The third is an easy simulation. The last requires some more work.

Complexity Theory 116 Reachability Recall the Reachability problem: given a directed graph G = (V, E) and two nodes a, b V, determine whether there is a path from a to b in G. A simple search algorithm solves it: 1. mark node a, leaving other nodes unmarked, and initialise set S to {a}; 2. while S is not empty, choose node i in S: remove i from S and for all j such that there is an edge (i, j) and j is unmarked, mark j and add j to S; 3. if b is marked, accept else reject.

Complexity Theory 117 NL Reachability We can construct an algorithm to show that the Reachability problem is in NL: 1. write the index of node a in the work space; 2. if i is the index currently written on the work space: (a) if i = b then accept, else guess an index j (log n bits) and write it on the work space. (b) if (i, j) is not an edge, reject, else replace i by j and return to (2).

Complexity Theory 118 We can use the O(n 2 ) algorithm for Reachability to show that: NSPACE(f(n)) TIME(k log n+f(n) ) for some constant k. Let M be a nondeterministic machine working in space bounds f(n). For any input x of length n, there is a constant c (depending on the number of states and alphabet of M) such that the total number of possible configurations of M within space bounds f(n) is bounded by n c f(n). Here, c f(n) represents the number of different possible contents of the work space, and n different head positions on the input.

Complexity Theory 119 Configuration Graph 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. Then, M accepts x if, and only if, some accepting configuration is reachable from the starting configuration (s,, x,, ε) in the configuration graph of M, x.

Complexity Theory 120 Using the O(n 2 ) algorithm for Reachability, we get that M can be simulated by a deterministic machine operating in time c (nc f(n) ) 2 c c 2(log n+f(n)) (log n+f(n)) k In particular, this establishes that NL P and NPSPACE EXP.

Complexity Theory 121 Savitch s Theorem Further simulation results for nondeterministic space are obtained by other algorithms for Reachability. We can show that Reachability can be solved by a deterministic algorithm in O((log n) 2 ) space. Consider the following recursive algorithm for determining whether there is a path from a to b of length at most n (for n a power of 2):

Complexity Theory 122 O((log n) 2 ) space Reachability algorithm: 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: 1. is there a path a x of length i/2; and 2. is there a path x b of length i/2? 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.