Fall 2013 CMU CS 15-855 Computational Complexity
description
Transcript of Fall 2013 CMU CS 15-855 Computational Complexity
![Page 1: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/1.jpg)
Fall 2013 CMU CS 15-855Computational Complexity
Lecture 5
Savich’s theorem, and IS theorems.
These slides are mostly a resequencing of Chris Umans’ slides From CS 151: Complexity Theory (Spring 2013) at CalTech.
![Page 2: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/2.jpg)
World Picture
EXPPSPACE
PL
NEXP
NP coNP
coNEXP
9/24/2013
![Page 3: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/3.jpg)
Ladner’s Theorem• Try to “merge”:
• on input x, either– answer SAT(x)– answer TRIV(x)
• if can decide which one in P, L NP
SAT TRIVMi
M0
L
N0
Ni
: :
: :
. . . ≠
≠
≠
≠
9/24/2013
![Page 4: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/4.jpg)
Ladner’s Theorem
• Key: n eventually large enough to notice completed previous stage
Lf 0 0 1 1 k k k
. . .
. . .
Mi
input xinput z < x
≠
suppose k = 2i
• I’m sup-posed to ensure Mi is killed
• I finally have enough time to check input z
• I notice z did the job, increase f to k+1
k k
9/24/2013
![Page 5: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/5.jpg)
April 4, 2013 5
At most 2O(f(n)) bits to describe a SPACE(fn)) configuration.
.• # configurations for a q-tape TM (work tape + read-only input) that runs in space f(n)
n x f(n)q x |Q| x |∑|f(n)q = O( cqf(n) ) = 2O(f(n))
input-tape head position work-tape head
positions
state work-tape contents
![Page 6: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/6.jpg)
At most 2O(f(n)) bits to describe a SPACE(fn)) configuration.
.• Pick any consistent way of interpreting binary strings as configurations of a TM.
n x f(n)q x |Q| x |∑|f(n)q = O( cqf(n) ) = 2O(f(n))
![Page 7: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/7.jpg)
April 4, 2013 7
Configuration graph for NTMs• configuration graph of M on input x: • nodes are all sequences of 2O(f(n)) bits • configurations, edge (C, C’) • iff the config of M(x) represented by C, and the
config of M(x) represented by C’ are consistent with the transition relation of M.
![Page 8: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/8.jpg)
• NSPACE(f(n)) = languages decidable by a multi-tape NTM that touches at most f(n) squares of its work tapes along any computation path, where n is the input length, and f :N ! N
Let C configuration graph for a space f(n) NTM on input x.
C has cf(n) = 2kf(n) nodes (Exponential in f(n))f(n) = k’log(n) means POLY-SIZED graph.
9/24/2013
![Page 9: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/9.jpg)
Do DFS or BFS on C
• most nk configurations of given NTM M running in NSPACE(log n).
qstartx1x2x3…xn
qaccept qreject
xL
qaccept qreject
xL• easy to
determine if C yields C’ in one step
• configuration graph for M on input x:
9/24/2013
![Page 10: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/10.jpg)
Reachability
• Conclude: NL P – and NPSPACE EXP
• S-T-Connectivity (STCONN): given directed graph G = (V, E) and nodes s, t, is there a path from s to t ?
Theorem: STCONN is NL-complete under logspace reductions.
9/24/2013
![Page 11: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/11.jpg)
Reachability
• Proof:– given L NL decided by NTM M construct
configuration graph for M on input x (can be done in logspace)
– s = starting configuration; t = qaccept
9/24/2013
![Page 12: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/12.jpg)
STCONN is in NL
• NUMSTEPS = 0 (number of steps taken.)• C = s (current node)• FLAG=False
• Until NUMSTES = n do– GUESS Z from 1 to n– Increment NUMSTEPS– If (c,z) is an edge in G, set c=z – If c==t set FLAG= True.
9/24/2013
![Page 13: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/13.jpg)
I started at S – I got drunk – and now I am at T
I wandered, therefore, my path from S to T exists. 9/24/2013
![Page 14: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/14.jpg)
Two startling theorems
• Strongly believe P ≠ NP• nondeterminism seems to add enormous
power• for space: Savitch ‘70:
NPSPACE = PSPACEand
NL SPACE(log2n)
9/24/2013
![Page 15: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/15.jpg)
Two startling theorems
• Strongly believe NP ≠ coNP• seems impossible to convert existential
into universal
• for space: Immerman/Szelepscényi ’87/’88:
NL = coNL
9/24/2013
![Page 16: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/16.jpg)
Savitch’s Theorem
Theorem: STCONN SPACE(log2 n)
• Corollary: NL SPACE(log2n)
• Corollary: NPSPACE = PSPACE
9/24/2013
![Page 17: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/17.jpg)
Proof of Theorem– input: G = (V, E), two nodes s and t– recursive algorithm:
/* return true iff path from x to y of length at most 2i */PATH(x, y, i) if i = 0 return ( x = y or (x, y) E ) /* base case */ for z in V if PATH(x, z, i-1) and PATH(z, y, i-1) return(true); return(false);end
9/24/2013
![Page 18: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/18.jpg)
Proof of Theorem– answer to STCONN: PATH(s, t, log n)– space used:
• (depth of recursion) x (size of “stack record”)– depth = log n– claim stack record: “(x, y, i)” sufficient
• size O(log n)– when return from PATH(a, b, i) can figure out
what to do next from record (a, b, i) and previous record
9/24/2013
![Page 19: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/19.jpg)
Nondeterministic space
• Robust nondeterministic space classes:
NL = NSPACE(log n)
NPSPACE = k NSPACE(nk)
9/24/2013
![Page 20: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/20.jpg)
Second startling theorem
• Strongly believe NP ≠ coNP• seems impossible to convert existential
into universal
• for space: Immerman/Szelepscényi ’87/’88:
NL = coNL
9/24/2013
![Page 21: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/21.jpg)
I started at S – I got drunk NL lucky, tiny brain – and now I am NOT at T
How might I know that NO PATH from S to T exists ???? !
9/24/2013
![Page 22: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/22.jpg)
I-S Theorem
Theorem: ST-NON-CONN NL• Proof: slightly tricky setup:
– input: G = (V, E), two nodes s, t
t
s“yes”
t
s“no”
9/24/2013
![Page 23: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/23.jpg)
I-S Theorem– want nondeterministic procedure using only
O(log n) space with behavior:
“yes” input
“no” input
qaccept qreject qaccept qreject
t
s
t
s
9/24/2013
![Page 24: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/24.jpg)
I-S Theorem– observation: given count of # nodes
reachable from s, can solve problem• for each v V, guess if it is reachable• if yes, guess path from s to v
– if guess doesn’t lead to v, reject. – if v = t, reject. – else counter++
• if counter = count accept
9/24/2013
![Page 25: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/25.jpg)
I-S Theorem– every computation path has sequence of
guesses…– only way computation path can lead to
accept:• correctly guessed reachable/unreachable
for each node v• correctly guessed path from s to v for each
reachable node v• saw all reachable nodes• t not among reachable nodes
9/24/2013
![Page 26: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/26.jpg)
I-S Theorem– R(i) = # nodes reachable from s in at most i
steps– R(0) = 1: node s
– we will compute R(i+1) from R(i) using O(log n) space and nondeterminism
– computation paths with “bad guesses” all lead to reject
9/24/2013
![Page 27: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/27.jpg)
I-S Theorem– Outline: in n phases, compute
R(1), R(2), R(3), … R(n) – only O(log n) bits of storage between phases– in end, lots of computation paths that lead to
reject– only computation paths that survive have
computed correct value of R(n)– apply observation.
9/24/2013
![Page 28: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/28.jpg)
I-S Theorem– computing R(i+1) from R(i):
– Initialize R(i+1) = 0– For each v V, guess if v reachable from s in
at most i+1 steps
R(i) = R(2) = 6
9/24/2013
![Page 29: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/29.jpg)
I-S Theorem– if “yes”, guess path from s to v of at most i+1
steps. Increment R(i+1)– if “no”, visit R(i) nodes reachable in at most i
steps, check that none is v or adjacent to v• for u V guess if reachable in ≤ i steps;
guess path to u; counter++• KEY: if counter ≠ R(i), reject• at this point: can be sure v not reachable
9/24/2013
![Page 30: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/30.jpg)
I-S Theorem
• correctness of procedure:• two types of errors we can make • (1) might guess v is reachable in at most
i+1 steps when it is not– won’t be able to guess path from s to v of
correct length, so we will reject.
“easy” type of error
9/24/2013
![Page 31: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/31.jpg)
I-S Theorem• (2) might guess v is not reachable in at
most i+1 steps when it is – then must not see v or neighbor of v while
visiting nodes reachable in i steps.– but forced to visit R(i) distinct nodes– therefore must try to visit node v that is not
reachable in ≤ i steps– won’t be able to guess path from s to v of
correct length, so we will reject.“easy” type of error9/24/2013
![Page 32: Fall 2013 CMU CS 15-855 Computational Complexity](https://reader036.fdocuments.in/reader036/viewer/2022062323/56816260550346895dd2bb60/html5/thumbnails/32.jpg)
Summary
• nondeterministic space classesNL and NPSPACE
• ST-CONN NL-complete
9/24/2013