complexity of games & puzzles - mit opencourseware · reproduced by permission of taylor and...
TRANSCRIPT
bun
Complexity of Games & PuzzlesComplexity of Games & Puzzles[Demaine, Hearn & many others][Demaine, Hearn & many others]
ound
ed
boun
ded
NP
PSPACE EXPTIME
P
Undecidable
NEXPTIMEPSPACE
PSPACE
Rengo Kriegspiel?
bridge?
Image courtesy of Jason Whittaker.
Courtesy of BigJ_Smack
Image courtesy of Nguyen Dai.
Image courtesy of Herman Hiddema
Image courtesy of Marie-Lan Nguyen.
Image courtesy of PartsnPieces.
Image is in the public domain.
Courtesy of Sam Cancilla. Used with permission.
Courtesy of Glenn Peters. Used with permission.
0 players 1 player 2 players team, (simulation) (puzzle) (game) imperfect info
Images by MIT OpenCourseWare.
1
Constraint LogicConstraint Logic[Hearn & Demaine 2009][Hearn & Demaine 2009]
boun
ded
unbo
unde
d
PSPACE EXPTIME
P
Undecidable
NEXPTIME
PSPACE
NP PSPACE
0 players 1 player 2 players team, (simulation) (puzzle) (game) 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.
2
Constraint GraphsConstraint 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 GraphsConstraint Graphs
Machine state= orientation
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.
constraint graph
4
Constraint LogicConstraint Logic
= 11 1
= 2 2
Rule: at least 2 unitsincoming at a vertex
Move: reverse an edge, preserving RuleCopyright (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 vertexAND vertex
FT F TT T inputs1 1
1 1
2 output
F T
not your usual Rule: at least 2 units AND gate! 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 vertexSPLIT vertex
T T FF F outputs1
1 1
2 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 vertexOR vertex
FT F TT T inputs2 2
2 2
2 output
TF T
not your usual Rule: at least 2 unitsOR gate! 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 ProblemDecision Problem
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.
can you reverse this edge?
9
Constraint LogicConstraint Logic[Hearn & Demaine 2009][Hearn & Demaine 2009]
boun
ded
unbo
unde
d
PSPACE EXPTIME
P
Undecidable
NEXPTIME
PSPACE
NP PSPACE
0 players 1 player 2 players team, (simulation) (puzzle) (game) 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 ProblemDecision Problem
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.
can you reverse this edge?
Theorem: PSPACE-complete
11
SlidingSliding--BlockBlockPuzzlesPuzzles
Courtesy of Dr. Jim Storer. Used with permission.
12
SlidingSliding--Block PuzzlesBlock PuzzlesCorollary:[Hearn & Demaine 2002][Hearn & Demaine 2002] 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
SlidingSliding--Block PuzzlesBlock PuzzlesCorollary:[Hearn & Demaine 2002][Hearn & Demaine 2002] 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 TogetherWiring Vertices Together
AND wants red OR wants blue
2 OR
AND 1
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
RedRed--Blue ConversionBlue Conversion
assume an even number of conversionsCopyright (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
RedRed--Blue ConversionBlue Conversion
assume an even number of conversionsCopyright (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
BooleanBooleanFormulasFormulas
Copyright (2009) From Games, Puzzles, and Computation by Robert A. Hearn and Erik D. DeReproduced by permission of Taylor and Francis Group, LLC, a division of Informa plc.
maine.18
Quantified Boolean FormulasQuantified Boolean Formulas (QBF)(QBF)
x x y y w w 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 QuantifierExistential 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
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.
Universal QuantifierUniversal Quantifier
21
LatchLatch
A
Blockedun
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 QuantifierUniversal 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 GadgetCrossover 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 fromOR fromProtector ORProtector 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 HourRush Hour[Hearn & Demaine 2002][Hearn & Demaine 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
TriangularTriangularRush HourRush 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: 1Open: 1××1 Rush Hour1 Rush Hour[Tromp & Cilibrasi 2008][Tromp & Cilibrasi 2008]
• P or PSPACE-complete or …?
Image courtesy of John Tromp. Used with permission.
28
Plank PuzzlesPlank Puzzles [Hearn 2004][Hearn 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
SokobanSokoban[Hearn & Demaine 2002][Hearn & Demaine 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
PushPush--2F2F[Demaine, Hearn, Hoffmann 2002][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 LogicConstraint Logic[Hearn & Demaine 2009][Hearn & Demaine 2009]
boun
ded
unbo
unde
d
PSPACE EXPTIME
P
Undecidable
NEXPTIME
PSPACE
NP PSPACE
0 players 1 player 2 players team, (simulation) (puzzle) (game) 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 LogicConstraint Logic[Hearn & Demaine 2009][Hearn & Demaine 2009]
boun
ded
unbo
unde
d
PSPACE EXPTIME
P
Undecidable
NEXPTIME
PSPACE
NP PSPACE
0 players 1 player 2 players team, (simulation) (puzzle) (game) 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
AmazonsAmazons[Hearn 2005][Hearn 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 OpenCourseWarehttp://ocw.mit.edu
ES.268 The Mathematics in Toys and GamesSpring 2010
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.