15
GC—Rush Hour Game Complexity Rush Hour Walter Kosters, Universiteit Leiden www.liacs.nl/home/kosters/ IPA, Eindhoven; Wednesday, January 29, 2014 1

GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour

Game Complexity

Rush Hour

Walter Kosters, Universiteit Leiden

www.liacs.nl/home/kosters/

IPA, Eindhoven; Wednesday, January 29, 2014

1

Page 2: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Introduction

Having seen the

general picture

and some gadgetry,

we now examine

particular games

and puzzles, like

Rush HourR©:

http://www.puzzles.com/products/rushhour.htm

2

Page 3: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour The game

The rules of Rush Hour are easy: cars may move either

horizontally or vertically (left/right and up/down), in their

natural direction, as long as they do not bump/crash into

other cars or the walls.

The target is to get the red car out of the garage through

the exit.

3

Page 4: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour The idea

Theorem Rush Hour is PSPACE-complete.

(Remember Savitch: PSPACE = NPSPACE.)

non-deterministic Turing machine with polynomial space

The proof proceeds by reduction from Nondeterministic

Constraint Logic (NCL): NCL is PSPACE-complete for

planar graphs using only ANDs and protected-ORs.

@@

@@

@@@@

@@@

@

@@@@

@@@

@

@@@@

@@@@

@@

@@

@@@@

@@

@@

@@

@@

@@@@

@@

@@

@@@@

@@@@

@@@

@

@@@@

@@@

@

@@@@

@@

@@

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

x AND @@@@

@@

@@

@@@@

@@@

@

@@@@

@@@

@

@@

@@

@@@@

@@

@@

@@@@

@@@@

@@

@@

@@@@

@@

@@

@@@

@

@@@@

@@@

@

@@@@

@@

@@

@@@@

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

x

x x

protected-OR

“latch”

The decision problem is: Given a constraint graph G (in-

cluding arrows) and a distinguished edge e in G; is there a

sequence of edge reversals that eventually reverses e?

Moves may be repeated: it is an unbounded game.

4

Page 5: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Proof

target “car” T

must go down

“car” is in

edge points out

@@@@

@@@@

@@@@

@@@

@

@@@@

@@@

@

@@

@@

@@@@

@@

@@

@@@@

@@@@

@@

@@

@@@@

@@

@@

@@@

@

@@@@

@@@

@

@@@@

@@

@@

@@@@

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

������������������@@@@@@@@@@@@@@@@@@x

C

AB

@@@@

@@@

@

@@

@@

@@@@

@@

@@

@@@@

@@

@@

@@@@

@@@

@

@@@@

@@@@

@@@

@

@@@@

@@

@@

@@@@

@@

@@

@@@

@

@@@@

@@@

@

@@@@

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

��

������������������@@@@@@@@@@@@@@@@@@x

C

AB

5

Page 6: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Proof elements

Exercise: Fill in the proof details.

This includes

• proper inner working of the gadgets,

• proper communication between gadgets,

• proper glueing together (in polynomial space),

• check that walls do not move,

• . . .

6

Page 7: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Protected-Rush-OR

The statespace for the Rush-Hour protected-OR gadget is

somewhat strange (where 1: car out; 0: car in):

110α 110β

111

001

100

101

ABC

010

011

����������

BBBBBBBBBB

�����

�����

�����

AAA

AA

HHHHH

HHHHH

7

Page 8: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Rush-OR

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

@@@

����

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

��

����

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

���

��

t t

t t

t t t

8

Page 9: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour NCL is PSPACE-complete

Clearly, NCL is in NPSPACE (= PSPACE).

To prove that NCL is PSPACE-hard, we reduce from Quan-

tified Boolean Logic (QBF):

Given a quantified Boolean formula φ (with quan-

tifiers ∃ and ∀, and of course variables, connectives

∨, ∧ and ¬, and parentheses), is this φ true?

And QBF is known to be PSPACE-complete: it is an ele-

ment of PSPACE and every problem in PSPACE reduces

to QBF — and so, by transitivity, to NCL.

9

Page 10: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Proof idea — 1

CNF = Conjunctive Normal Form

10

Page 11: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Proof idea — 2

In a ∃ gadget, you try (fix) both x and x to be true, and

then try the next quantifier.

In a (more complicated) ∀ gadget, you do both, meanwhile

“recursively” doing the rest twice.

11

Page 12: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Proof idea — 3

12

Page 13: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Plank puzzle — 1

And how about the Plank puzzle = River CrossingTM?

You must travel from Start to End; you can carry and move

one plank at a time (if you “have” it), and traverse them

in the obvious way.

13

Page 14: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Plank puzzle — 2

The Plank puzzle is also PSPACE-complete:

14

Page 15: GC—Rush Hour Game Complexity Rush Hour Walter - Liacs

GC—Rush Hour Plank puzzle — 3

15