Complexity of Games & Puzzles [Demaine, Hearn & many others] ed und

advertisement
Complexity of Games & Puzzles
Puzzles
[Demaine, Hearn & many others]
Rengo Kriegspiel?
Image courtesy of
Herman Hiddema
un
bo
un
d
ed
Courtesy of
BigJ_Smack
Courtesy of Sam
Cancilla. Used
with permission.
PSPACE
PSPACE
Image courtesy of
Nguyen Dai.
EXPTIME
Undecidable
bridge?
bo
un
de
d
Image courtesy
of PartsnPieces.
Courtesy of Glenn Peters.
Used with permission.
Image courtesy of
Jason Whittaker.
P
0 players
(simulation)
Images by MIT OpenCourseWare.
NP
1 player
(puzzle)
Image is in the
public domain.
PSPACE
2 players
(game)
Image courtesy of
Marie-Lan Nguyen.
NEXPTIME
team,
imperfect info
1
Constraint Logic
PSPACE
PSPACE
EXPTIME
Undecidable
bo
un
de
d
un
bo
un
d
ed
[Hearn & Demaine 2009]
P
0 players
(simulation)
PSPACE
NP
1 player
(puzzle)
2 players
(game)
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
NEXPTIME
team,
imperfect info
2
Constraint Graphs
Graphs
Machine = graph,
red & blue edges
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
3
Constraint Graphs
Graphs
Machine state
= orientation
constraint graph
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
4
Constraint Logic
Logic
= 1
=2
1
1
2
Rule: at least 2 units
incoming at a vertex
Move: reverse an edge, preserving Rule
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
5
AND vertex
vertex
T
F
F
T
1
1
T
T
1
1
2
inputs
output
F
not your usual
AND gate!
T
Rule: at least 2 units
incoming at a vertex
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
6
SPLIT vertex
vertex
T
T
F
1
F
F
1
1
2
outputs
input
T
F
Rule: at least 2 units
incoming at a vertex
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
7
OR vertex
vertex
T
F
F
T
2
2
T
T
2
2
2
inputs
output
T
F
not your usual
OR gate!
T
Rule: at least 2 units
incoming at a vertex
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
8
Decision Problem
Problem
can you reverse this edge?
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
9
Constraint Logic
PSPACE
PSPACE
EXPTIME
Undecidable
bo
un
de
d
un
bo
un
d
ed
[Hearn & Demaine 2009]
P
0 players
(simulation)
PSPACE
NP
1 player
(puzzle)
2 players
(game)
NEXPTIME
team,
imperfect info
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
10
Decision Problem
can you reverse this edge?
Theorem:
PSPACE-complete
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
11
Sliding-Block
Puzzles
Courtesy of Dr. Jim Storer. Used with permission.
12
Sliding-Block Puzzles
[Hearn & Demaine 2002]
Corollary:
PSPACE-complete
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
13
Sliding-Block Puzzles
[Hearn & Demaine 2002]
Corollary:
PSPACE-complete
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
14
Wiring Vertices Together
Together
AND
1
AND wants red
OR wants blue
2
OR
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
15
Red-Blue Conversion
Conversion
assume an even number of conversions
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
16
Red-Blue Conversion
Conversion
assume an even number of conversions
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
17
Boolean
Boolean
Formulas
Formulas
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
18
Quantified Boolean Formulas (QBF)
(QBF)
x x
y y
ww
z z
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
19
Existential Quantifier
Quantifier
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
20
Universal Quantifier
Quantifier
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
21
Latch
Latch
A
unlocked
B
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
22
Universal Quantifier
Quantifier
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
23
Crossover Gadget
Gadget
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
24
OR from
Protector OR
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
25
Rush Hour
[Hearn & Demaine 2002]
2002]
PSPACE-completeness known [Flake & Baum 2002]
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
26
Triangular
Triangular
Rush Hour
Hour
[Hearn & Demaine 2009]
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
27
Open: 1×1 Rush Hour
Hour
[Tromp & Cilibrasi 2008]
• P or PSPACE-complete or …?
Image courtesy of John Tromp. Used with permission.
28
Plank Puzzles
[Hearn 2004]
2004]
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
29
Sokoban
[Hearn & Demaine 2002]
2002]
PSPACE-completeness known [Culberson 1998]
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
30
Push-2F
[Demaine, Hearn, Hoffmann 2002]
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
31
Constraint Logic
PSPACE
PSPACE
EXPTIME
Undecidable
bo
un
de
d
un
bo
un
d
ed
[Hearn & Demaine 2009]
PSPACE
P
0 players
(simulation)
NP
1 player
(puzzle)
2 players
(game)
NEXPTIME
team,
imperfect info
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
32
Constraint Logic
PSPACE
PSPACE
EXPTIME
Undecidable
bo
un
de
d
un
bo
un
d
ed
[Hearn & Demaine 2009]
PSPACE
P
0 players
(simulation)
NP
1 player
(puzzle)
2 players
(game)
NEXPTIME
team,
imperfect info
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
33
Amazons
[Hearn 2005]
2005]
fanout
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. Demaine.
Reproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
34
MIT OpenCourseWare
http://ocw.mit.edu
ES.268 The Mathematics in Toys and Games
Spring 2010
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Download