Efficient Algorithms and Problem Complexity More Complexity Classes - - PowerPoint PPT Presentation

efficient algorithms and problem complexity more
SMART_READER_LITE
LIVE PREVIEW

Efficient Algorithms and Problem Complexity More Complexity Classes - - PowerPoint PPT Presentation

Efficient Algorithms and Problem Complexity More Complexity Classes Frank Drewes Department of Computing Science Ume University Frank Drewes (Ume University) Efficient Algorithms and Problem Complexity Lecture 14 1 / 11 Outline


slide-1
SLIDE 1

Efficient Algorithms and Problem Complexity – More Complexity Classes –

Frank Drewes Department of Computing Science Umeå University

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 1 / 11

slide-2
SLIDE 2

Outline

Today’s Menu

1

Space Complexity

2

Complement Classes

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 2 / 11

slide-3
SLIDE 3

Space Complexity

Space

Instead of asking how quickly a problem can be solved, we may ask how much memory is required. How to define the memory requirements of an algorithm? In contrast to time, memory can be re-used. The input is in memory, but should not be counted towards used memory. However, if we change input registers, this is usage that should count. Consequently, we count how many bits are stored in the registers actually in use.

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 3 / 11

slide-4
SLIDE 4

Space Complexity

Space

Formalizing the space consumption of a RAM M with input x: Let usedM(x) denote the set of all i ∈ N such that some step during

M’s run assigns a value to register Ri.

A configuration of the run of M is said to use

i∈usedM(X) Ri memory

space. The space used by M with input x is the maximum of the memory space used by the configurations in the run of M with input x.

M is said to run in space f (n) if it uses at most f (x) space for every

input x. The corresponding definitions for nondeterministic RAMs are similar.

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 4 / 11

slide-5
SLIDE 5

Space Complexity

Space Complexity Classes

General notation: DSPACE(f (n)) = all decision problems solvable by RAMs in space f (n). NSPACE(f (n)) = all decision problems solvable by nRAMs in space f (n). The most important space complexity classes are L = DSPACE(O(logn)) and NL = NSPACE(O(logn)). LIN = DSPACE(O(n)) and NLIN = NSPACE(O(n)). PSPACE =

k∈NDSPACE(O(nk)).

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 5 / 11

slide-6
SLIDE 6

Space Complexity

Some Inclusions

L ⊆

(1)

NL ⊆

(2)

P ⊆

(3)

NP ⊆

(4)

PSPACE =

(5)

NPSPACE ⊆

(6)

EXP ⊆

(7)

NEXP The inclusions (1), (3), (7) (and one direction of (5)) are trivial. The proof of (4) uses depth-first search and the observation that a polynomial-time nRAM can only use a polynomial amount of space.

(5) is Savitch’s Theorem which shows how to turn an nRAM running in

space O(f (n)) into a RAM running in space O(f (n)2).

(2) and (6) can be shown by an instance of the REACHABILITY

  • method. (Savitch’s Theorem also uses this method.)

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 6 / 11

slide-7
SLIDE 7

Space Complexity

REACHABILITY

REACHABILITY Input: A directed graph G = (V,E) and nodes s,t ∈ V. Question: Is there a path in G from s to t ?

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 7 / 11

slide-8
SLIDE 8

Space Complexity

The REACHABILITY Method

The REACHABILITY method is based on the following observations: An nRAM M processing x in space f (n) has 2O(f (n)) configurations

⇒ the set of configurations yields a digraph GM,x of size 2O(f (n)), where

an edge (c,c′) means that a computation step leads from c to c′. Therefore, M(x) = 1 if and only if an accepting configuration is reachable from the initial configuration in GM,x. For graphs of size m, REACHABILITY ∈ DSPACE(O((logm)2)).

⇒ NSPACE(O(f (n))) ⊆ DSPACE((log2O(f (n)))2) = DSPACE(O(f (n)2)).

REACHABILITY can also be solved in time O(m2)

⇒ NSPACE(O(f (n))) ⊆ DTIME((2O(f (n)))2) = DTIME(2O(f (n))).

In particular, NL ⊆ P and PSPACE = NPSPACE ⊆ EXP.

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 8 / 11

slide-9
SLIDE 9

Complement Classes

Complement Classes

Definition (complements) The complement of a decision problem A is A = {x | x ∉ A}. For a class C of problems, coC = {A | A ∈ C }. Notes: Strictly speaking, A also contains all ill-formed instances, but we usually consider only valid instances of a problem. Example: SAT is the set of all unsatisfiable Boolean formulas. For every deterministic complexity class C , we have coC = C . [WHY?] We say that deterministic classes are closed under complement. For nondeterministic complexity classes, this is not apriori clear.

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 9 / 11

slide-10
SLIDE 10

Complement Classes

The Immerman-Szelepcsényi Theorem

Nondeterministic space is closed under complement: Theorem (Immerman and Szelepcsényi) Let f (n) ≥ logn, and let C be the set of all problems that can be decided nondeterministically in space O(f (n)). Then coC = C . Notes: The function f has to fulfill a few basic requirements (to exclude weird functions). The proof is a wonderful application of the REACHABILITY method, based on an algorithm that shows that REACHABILITY ∈ NL. Immerman and Szelepcsényi were awarded the Gödel prize for their result in 1995.

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 10 / 11

slide-11
SLIDE 11

Complement Classes

The Situation for Polynomial Time

NP NPC coNP coNPC P

NP = coNP if and only if NPC∩coNPC = . But perhaps NP = coNP but P = NP? If P = NP then NP = P∪NPC (and, of course, similarly for coNP).

Frank Drewes (Umeå University) Efficient Algorithms and Problem Complexity Lecture 14 11 / 11