71
Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available at: http://staff.science.uva.nl/~peter/teaching/gac09.html © Games Workshop © Games Workshop

Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Embed Size (px)

Citation preview

Page 1: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

THE PEBBLE GAME

Games and Complexity

Guangzhou 2009

Peter van Emde Boas

References available at: http://staff.science.uva.nl/~peter/teaching/gac09.html

© Games Workshop© Games Workshop

Page 2: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Stoning of st Stephen

Acts VIII 57--60

Doré bible

Page 3: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Origin Pebble Game

7 + (1+x)(5-z) - ((1+x)/(u-t) + 2z)/v

+

+

+

-

-

/

/

-

*

*7

1 x5 z u t

2 z

v

Page 4: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Origin Pebble Game

+

+

+

-

-

/

/

-

*

*7

1 x 5 z u t2 z

v

r1 = 1r2 = xr3 = r1 + r2r1 = 5r2 = zr4 = r1 - r2r1 = 7r2 = r3 * r4r5 = r1 + r2.... How to evaluate this expression on a

Von Neuman Computer using fewregisters and little time?

Page 5: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Formalization

nodeinputoutput

Storing value in register =placing a pebble on the node

Page 6: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Formalization

Directed Acyclic GraphBounded IndegreeMultiple Outputs & Sharing

Page 7: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Rules of the Pebble Game

• 1: You can always pebble an input

• 2: You can always remove a pebble

• 3: You may pebble a node provided its ancestors are pebbled

• 4: You must pebble all outputs at least once

• Use as few pebbles as possible

• Use as few moves as possible

Page 8: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Interpretation

• 1: You can always pebble an input• 2: You can always remove a pebble• 3: You may pebble a node provided its

ancestors are pebbled• 4: You must pebble all outputs at least

once• Use as few pebbles as possible• Use as few moves as possible

load

free

compute

# registers

time

results

Page 9: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Alternative Version

3: You may pebble a node provided its ancestors are pebbled

Ri = Rj § Rk

3a: You may shift a pebble from an ancestor to a node provided its ancestors are pebbled

Ri = Ri § Rk

Page 10: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Impact Alternative Rule 3a

If the DAG entirely consists of isolated nodesboth versions allow a pebbling with a singlepebble in real time.

In all other cases rule 3a saves exactly onepebble.

Proof by transformation of pebbling strategies

Page 11: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Impact Alternative Rule 3a

G DAG;

S(G): # pebbles reqired to pebble G in standard game

S’(G): # pebbles requied to pebble G using rule 3a

S(G) = S’(G) = 1 iff G is a collection of isolated nodes

S(G) = S’(G) + 1 otherwise

Page 12: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

ProofsIsolated Nodes case : trivial

S’(G) ≤ S(G) : don’t use 3a

S(G) ≤ S’(G) + 1 : substitute shift by a place/remove combination of moves,

S’(G) ≤ S(G) - 1 , for non isolated case:follow an optimal standard play andremove the peaks in pebble consumption

Page 13: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

ProofsMove j requires peak consumption ( S(G) pebbles) so the next move j+1 removes a pebble; what sort of move was it:

a: remove a pebble: not applicable : this can’t provokepeak consumption

b: pebble a node (with ancestors): put x ; remove y, x ≠ y :if y is ancestor of x play a shift; otherwiseinterchange move j and move j+1 : this saves apebble without loss of time

c: pebble an input: put x ; remove x (only useful if x isalso an output) . Shift these moves to start of play.

d: pebble an internal output: put x ; remove x : replacemove by a shift (saving a pebble) , and remove everything and start all over but forget output x.This saves a pebble but causes loss of time.

Page 14: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Consequences

In the worst case the transformed strategy requires an (almost complete) replay forevery output.

This may square the time of the play

Worst case example is easy to obtain.in the standard game this DAG requires2 pebbles and runs in real time. With rule3a a single pebble suffices in quadratic time.

Page 15: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Cook’s Pyramid

C(7) THEOREM:

C(k) requiresprecisely k pebbles

Page 16: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Cook’s Pyramid

input node blocking the last free path

When the last free pathto an input is blockedthere are k-2 disjointside paths, each havingat least one pebble on it.This blocking places thek-1-th pebble

The next move is a placement of the k-thpebble

C(k)k=7

Page 17: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Saving the last pebble?Saving the last pebble may require recomputationwhich requires possibly substantial timeHow bad can it be?

T(G,k) : time needed for pebbling DAG G in the standard game using S(G) + k pebbles

T’(G,k) : time needed for pebbling DAG G in the standard game using S’(G) + k pebbles

T’(G,0) T(G,0) T’(G,1) T(G,1) ..... T’(G,k) T(G,k) ...

less rules butextra pebble

extra rule butsame numberof pebbles

Eventually enough pebbles available for real time pebbling

Page 18: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Exponential Gap

G[ k + 1 ]

G[ k ]

u

v

T[ k+1 ]

H[ k+1,k+1 ]

Page 19: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

RequirementsG[ k ] can be pebbled in real time (shifting rules)with k+1 pebbles; doing it with k pebbles requirestime > k!

T[ k +1] : a component requiring k+1 pebbles to reach u

H[ k+1,k+1 ] : with k+2 pebbles all outputs can be pebbledin any required order in real time

with k+1 pebbles any output can be pebbled, butat this move all other outputs obtain free path to v

Example components: T[k+1] node with k+1 inputs;H[k+1,k+1] complete bipartite graph on k +1 + k +1 nodes.These components are not binary!

Page 20: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Proof by Induction

Theorem: if G[ k ] satisfies the requirements so does G[ k+1 ]

With k + 2 pebbles: pebble u ; keep a pebble on thepath from u to v while pebbling G[k] with k+1 pebbles in real time. Having reached v pebble the k+1successors. Remove the pebble from v and use iton the k+1 outputs.

Page 21: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Proof by Induction

Theorem: if G[ k ] satisfies the requirements so does G[ k+1 ]

With k + 1 pebbles: pebble u ; keep a pebble on thepath from u to v while pebbling G[k] with k pebbles.This now requires time > k!. Having reached v pebble the k+1 successors, with a shift for the last one. Nextuse a shift to pebble an output. Now v becomes visible (and so u and its inputs) and we must start to repebble u which requires all our pebbles.Consequently we have to pebble the embedded G[k]k+1 times using k pebbles. Total time > (k+1)k! = (k+1)!

Page 22: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Binary Components

For T[ k ] : Take Cook’s Pyramid C(k+1) with base k (requires kpebbles in the shifting game)

For H[k,k] : a pyramidal grid of height k*(k+1)

Properness condition: pebblesstay “close” together. Whenviolated free paths are created.

Page 23: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

A General Upper BoundGiven a DAG G with n nodes and max indegree k;How many pebbles may be required in the worst case?

Sk(G) n (trivial bound)

without bound on the indegree this can’t be improved!

THEOREM: Sk(G) Cn / log(n)where the constant C depends on k

Sk(G) = O( n/ log(n) )

n-1

Page 24: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

A General Upper BoundEquivalent Formulation:

Rk(m) := least number of edges in a DAG with max indegree k which requires m pebbles.

THEOREM: Rk(m) D m log(m)where the constant D depends on k

Rk(m) = ( m log(m) )

R’k(m) := least number of nodes in a DAG with max indegree k which requires m pebbles.R’k(m) Rk(m) k R’k(m)

Page 25: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Equivalence?

G n nodes max indegree k requiring m pebbles

m C n / log(n) <==> n 1/C m * log(n)<==> n D m * log(m)

provided log(n) log(m) for these worst case DAGs

Evidently m n , but the Cook Pyramid alreadyprovides us with examples where m nshowing that for the worst case m, log(m) log(n)/2so indeed log(n) log(m)

Page 26: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Proof by induction

inputs

output

Gcheappart

expensivepart

Page 27: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Induction

inputs

output

Gcheappart: G1

expensivepart: G2

G requires m pebblescheap part: nodes can be pebbles with m/2 pebblesexpensive part: nodes require > m/2 pebbles.

three classes of edges:

edges within G1 : E1edges within G2 : E2edges from G1 to G2 : Dno edges from G2 to G1

Page 28: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Induction

inputs

output

Gcheappart: G1

expensivepart: G2

Some node in G1 needsat least m/2 - k pebbles,otherwise an “input” ofG2 becomes “cheap”

So G1 contains at leastRk(m/2 - k) edges.

Some node in G2 (in isolation) requires m/2 - k pebbles,otherwise the entire G can be pebbled with <m pebbles.

So G2 contains at least Rk(m/2 - k) edges.

Page 29: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Counting cross edges in D

inputs

output

Gcheappart: G1

expensivepart: G2

Two cases:

A: D contains > m/4edges

B: D contains m/4edges

In case B part G2 (in isolation) must require at least 3m/4 pebbles!

A node with indegree j which requires t pebbleshas an ancestor requiring at least t - j pebbles.

j

Page 30: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Counting Cross Edges in D

expensivepart

Walking down from the mostexpensive node to its mostexpensive ancestor we starta path to a node requiring tpebbles with m/2-k < t m/2.Remove the nodes along this path: this removes at least m/4edges.

So in both cases:

Rk(m) Rk(m/2 - k) + Rk(m/2 - k) + m/4

Page 31: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Solving the Recurrence

H(m) H(m/2 - k) + H(m/2 - k) + m/4 + C

This solves to H(m) U m log(m) for some U

Let K(m) := H(m-2k) then K satisfies:

K(m) K(m/2) + K(m/2) + m/4 + (C-k/2) , so for m > 20(k/2 - C)

K(m) K(m/2) + K(m/2) + m/5

which solves to K(m) 1/5 m log(m) ( in fact K(m) ≥ 1/5 C’ m log(m) due to initial effect )

Page 32: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Just a Upper Bound ?• Matching Lowerbound (n/log(n)) for

Sk(G) is known ( Paul, Tarjan & Celoni )

• Heavy Combinatorial and Probabilistic Graph Theory involved (or Algebraic Number Theory if you aim for explicit constructions...)– Superconcentrators– Grates – Communication Networks

Page 33: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Hopcroft Paul Valiant Theorem

THEOREM: A j-tape TM in time T(n) can be simulatedin space S(n) = O( T(n)/log(T(n)) ) ( T(n) > n reasonable )

Consequence: TM’s can do more in space S(n) thanin time S(n) (requires standard diagonalization results)

Proof steps:1: Make computation block preserving2: Introduce Computation Graph of head configurations3: Establish correspondence between pebbling

strategies and simulation strategies4: Correlate Space and Pebble consumption5: Apply Upper Bound Result from Pebbling Theory6: Eliminate Nondeterminism

Page 34: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

k-tape Turing Machine

Finite Control

input tape

work tapes

Page 35: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Block Preserving

Finite Control

input tape

work tapes

Compute for k steps; only cross borders at end of block of steps

Page 36: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Block Preserving

w2 w5w4w3

w3R w6Rw5Rw4R

w1R w4Rw3Rw2R

By having three tracks on every tape information for a block of k steps is always accessible.After block of k steps the tracks must be updated.Must be done in block preserving way.Computation delayed by a constant factor.

Page 37: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Head ConfigurationsFirst configuration in a block of k steps

Full Block Determined byA: Position input head & State Finite ControlB: Positions (also within block) on WorktapesC: Contents Worktape Blocks

Space required for head configuration:A: O(log(n))B: j. log(n)C: O(j.k)

But what for the next k steps ???!!!

Page 38: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Configuration Graph

Nodes: Head Configurations: H(0), H(1), ....Edges: Logical Dependencies !

Type 0: Time dependency : H(i) ---> H(i+1)

Type a: Tape dependency : H(i) ---> H(m) (a)if the tape block on tape a visited duringblock m was last visited during block i

Claim: This Configuration Graph is a DAG withindegree bounded by j+1

Page 39: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Configuration Graph

Number of nodes: T(n) / k

Secret: take k dependent on T(n) : k = (T(n))2/3

Now the Configuration Graph can be described in space O( T(n)1/3 . log(T(n)) )

Assume for a moment that the correctConfiguration Graph is Available, togetherwith the state and head position information.

Page 40: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Computing and PebblingBlock H(m) can be simulated provided theHead Configurations of its Direct Ancestorsin the Configuration Graph are known.Missing Information: the Tape Block Contents !Solution: Write them down in Memory; [ Costs O(k) space per configuration ]and call it a pebble.

Number of Pebbles Required: O( T(n)1/3 / log(T(n) )Space needed for a pebble: O(k) = O(T(n)2/3)

Total Space Needed: O( T(n) / log(T(n)) )

Page 41: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Wrong Theorem

THEOREM: DTIME(T(n)) NSPACE( T(n) / log(T(n)) )

Proof:a: Guess states and head positions of the T(n)1/3

head configurations; based on this information build the Configuration Graph

b: Play a pebble strategy with O(T(n)1/3/ log(t(n)) )pebbles, using nondeterminism for guessingthe right next move.

c: When the last configuration is pebbled read offthe answer

d: Abort on time-overflow (repeating moves is futile)

Page 42: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Making this Simulation Deterministic

Step a: Replace “Guess and Verify” by “Try out allpossibilities”

This is possible, since we are economizing on space rather than time

Step b: Trying out all possibilities is not possible; they take too long and there are too many of them...

Page 43: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Consulting the NPSPACE Oracle

what is the rightnext move ?

I can’t answer thatquestion

is move z the rightnext move ?

YES / NO

Page 44: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Asking the Right QuestionGIVEN: the DAG G, with a given collection of pebbles

on it, and the number of the move tQUESTION: is z the correct next move in some

pebbling strategy using no more than m’ pebblesand succeeding within 2m - t moves.

This problem is solvable in NSPACE( m.log(m) )

SAVITCH: This problem is solvable in DSPACE( m2.log(m)2 )

Since in our situation m = O(T(n)1/3) this space consumption is acceptable.

Page 45: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

A Reasonable Simulation?

Re-pebbling a node amounts to re-computing ablock of steps: time overhead!

Retrieving the correct next move in the pebble gamerequires a Savitch-based simulation for every move.

Trying out all possibilities for the configuration graphamounts to performing this awesome simulation anexponential number of times.

WHHAAARGHHH !

Page 46: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Gilbert Lengauer & Tarjan

THEOREM: Deciding whether a given DAG can be pebbled with a given number of pebbles

is PSPACE-Complete.

Proof: Reduction from QBF

Requires: Intricate ConstructionGood Control over Conceivable pebblingStrategies

Page 47: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Reference Frame

• Single output DAG’s only

• Pebbling Game with Shifting Rule

• Elimination of inessential moves

• Normalization of Strategies

• Non-standard Encoding of Propositional Valuations

Page 48: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Essential Moves

The first pebbling of the output node is essential

The last pebbling of a internal node preceeding anessential pebbling of one of its successors isessential

That’s all folks.

Lemma: inessential pebblings can be eliminated.Lemma: inessential pebblings can be eliminated.

(G. L. & T. call these moves necessary)

Page 49: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Essential MovesLet the placement on node x at time t1 be inessential.This pebble is removed at time t2.Claim: During the interval [t1,t2] all placements on directsuccessors of x are inessential.So during the interval [t1,t2] all placements on allconnected successors of x are inessential.In particular, the first pebbling of the output is outsideinterval [t1,t2] (or unconnected) .A move placing a pebble on an internal node y whichis not followed by a placement on some successorcan be removed. Such a move must occur after t1 !Eliminate it and use same argument again. Eventuallyall placements on connected successors of x are eliminated. Next remove the placement on x. QED.

Page 50: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Essential Moves

A pebbling strategy without inessential movesis called Frugal.

For Frugal strategies:

After the first pebbling of some internal node somepath connecting it to the output is pebbled.

After the last pebbling of some internal node allpaths connecting it to the output are pebbled.

Page 51: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Normal Strategies

C(7)

6

=

The DAG’s used in the reduction contain severalembedded Pyramids withthe purpose to force someorder on the pebbling ofthe embedded components.

In a Normal Strategy thesePyramids are pebbled inconsecutive sequences ofmoves, leaving at most a pebble on the Apex.

(7 --> 6 due to shifts)

Apex

Apex

Page 52: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Normal Strategies

k

g

Assume Frugal Strategy.

First placement on P(k) at t0

Last Removal from P(k) at t1

Maximal pebble consumptionon P(k) at t2 (k pebbles); where t2 [to ,t1]

Reschedule all moves on P(k)to a block of steps at time t2

This is possible since P(k) hasno ancestors of its inputs....

Page 53: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Construction

Page 54: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Construction

input

output5 quantifiers

4 clauses with3 literals each

18 pebbles18 = 5*3 + 3

Pyramids arepebbled from top to bottom.Yet it mustremain possibleto pebble the path along theclauses....

Page 55: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Construction

quantifier blocks

variablesetters

clause blocks

Page 56: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Components

x x

x’ x’

x x

x’ x’

x x

x’ x’

x x

x’ x’

variable x true setting false setting double false setting

A formula can be made true by the illogical double falsesetting if its clauses are made true by other literals ....

Page 57: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Components

clause C[ j ] = ( l1 l2 l3 )

l1’ l2’ l3’

l1 l2 l3pj-1

pj

If current setting makesclause true 3 pebblessuffice.

If current setting failsto make clause true4 pebbles are neededor some other pebble must move

Page 58: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Components

k

k-1

k-2

xx

x’ x’

qi

ai

bi

ci

qi+1

di

fi

gi

i+1-th quantifiervariable: xUniversalk = 3(m-i) + 3

when pebbledk pebblesavailable

Page 59: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

The Components

k

k-1

k-2

xx

x’ x’

qi

ai

bi

ci

qi+1

di

i+1-th quantifiervariable: xExistentialk = 3(m-i) + 3

when pebbledk pebblesavailable

fi

Page 60: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Overall Idea

The embedded pyramids enforce that the quantifierblocks are pebbled in order, leaving a variableassignment. (Proper configurations in the block)For the i+1-th quantifier 3(m-i) + 3 pebbles areavailable. In a proper configuration exactly 3 areinside the block.The clauses part can be traversed (pebbled) whenthe formula evaluates to true for the assignment.For the existential quantifier a value can be chosen;for the universal quantifier the entire block must betreated twice, unless the double false assignmentalready makes the formula true.Nesting of universals causes exponential time!

Page 61: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Variable Settings

k

k-1

k-2

xx

x’ x’

qi

ai

bi

ci

qi+1

di

fi

gi

k

k-1

k-2

xx

x’ x’

qi

ai

bi

ci

qi+1

di

fi

gi

k

k-1

k-2

xx

x’ x’

qi

ai

bi

ci

qi+1

di

fi

gi

true setting false setting

doubly false setting

The proper settings in the i+1-th quantifier block.Universal quantifierCalled Ni in paper

Page 62: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Variable Settings

kk-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

kk-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

kk-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

true setting false setting

doubly false setting

The proper settings in the i+1-th quantifier block.Existential quantifierCalled Ni in paper

Page 63: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Induction Hypothesis: H(i)Given formula: Qx1 Qx2 .... Qxm[ F(x1,x2, ..., xm) ]

Partial truth assignment for x1,x2, ..., xi , say wNB! requires good understanding for what it means to assign doubly false! Think of substituting true/false and removing thedoubly false variables (and reduce to a proper logical form afterwards)

Equivalent are:Resulting QBF formula is true <==>Given the initial proper configuration for this wwith 3i pebbles on the i quantifier blocks, node qi

can be pebbled using 3(m-i) + 3 further pebblesleaving the 3i given pebbles fixed.

Page 64: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Order of ProofH(m): All variables are assigned a truth value(or doubly false). The resulting formulaevaluates either to true or false. The DAG can be traversed up to qm iff the formula evaluates to true, and we have just 3 pebbles available....

H(0): No variable assigned yet and the DAG iscompletely empty. We have 3m + 3 pebbles.This is what we need for proving the Theorem...

Proof order: H(m) => H(m-1) => .... => H(0)

Page 65: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

H(m): Base of Induction

Forward: If the fully assigned formula is trueevery clause block has at least one node inits base pebbled, so 3 more pebbles suffice.

Backward: If the fully assigned formula isfalse some clause block has an empty baseso at least 4 pebbles are required. Note thatother pebbles can’t be moved....

Page 66: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

H(i+1) => H(i) , Induction Step

In all cases there are 3(m-i) + 3 pebbles available, 3 of which can remain on the i-th quantifier block.Note that 3(m-i) + 3 is also the order of the largestpyramid connected to this block.

When proper configuration is reached invokeinduction hypothesis.

Cases of Universal and Existential quantifierare treated separately.

Page 67: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Forward Universal

k

k-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

gi

x’ ; di; x’; (k, leave 3)x’ => x ;qi+1 (IH) ; (k-3)qi+1 => ci => bi => ai ;x’ => x ; remove x ;x’; (k-2)qi+1 (IH) ; (k-3)x’ => gi => fi => qi ;

If the doubly false assignment makes the formula truepebbles can remain on x’ and x’ . The at least 2 freepebbles can be used to traverse the block pebbling qi+1

just once.

Page 68: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Forward Existential

kk-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

x’ ; di; fi; fi => x’; (k, leave 3)if x = true then x’ => x ; qi+1 (IH) ; (k-3) x ; (1) qi+1 => ci => bi => ai => qi ;else { x = false } x’ => x ; qi+1 (IH) ; (k-3) qi+1 => ci => bi ; remove x ; fi => x’; (k-2) bi => ai => qi

fi

Page 69: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Backward Universal

k

k-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

gi

Since only k pebbles areavailable we must start withx’ ; di; x’;Before qi+1 is pebbled theonly possible actions toproceed are x’ => x, x’ => x or no move at all, alwaysleaving a proper configuration. By IH the involved partial assignmentmakes the formula true.From qi+1 either ai or fi canbe reached but not both;

which one depends onthe value assigned to xUnless x is assigneddoubly false qi+1 mustbe pebbled again.

Page 70: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Backward Existential

kk-1

k-2

x x

x’ x’

qi

ai

bi

ci

qi+1

di

fi

Since only k pebbles areavailable we must start withx’ ; di; fi; fi => x’ must precedethe removal from x’.Before qi+1 is pebbled theonly possible actions toproceed are x’ => x, x’ => xor no move at all, alwaysleaving a proper configuration. Move x’ => x’ is a looser!By IH the involved partial assignment makes the formula true.

Once qi+1 is pebbled it issimple to reach qi withthe remaining two freepebbles.

Page 71: Peter van Emde Boas: Games and Complexity, Guangzhou 2009 THE PEBBLE GAME Games and Complexity Guangzhou 2009 Peter van Emde Boas References available

Peter van Emde Boas: Games and Complexity, Guangzhou 2009

Final Remarks

One extra pebble eliminates the need for repebblingthe Universal Quantifier blocks, yielding an exponential speed-up. This gives an independent prooffor the exponential slowdown by saving the last pebble(with in fact a graph of order n3 in stead of n4).

A modification shows that also the question whethera DAG can be pebbled with k pebbles within a restricted amount of time is hard for PSPACE. Note that this problem is in NP if the time allowance ispolynomial. (Sethi has proven NP-hardness in this case.)