Date post: | 22-Dec-2015 |
Category: |
Documents |
View: | 220 times |
Download: | 1 times |
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Games in Computation and Complexity Theory
Peter van Emde Boas
ILLC-FNWI-Univ. of AmsterdamReferences and slides available at: http://staff.science.uva.nl/~peter/teaching/gtis07.html
Workshop Logic & GamesKazimierz DolnySep 24-30, 2006
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Topics
• Relations Games and Computations
• Algorithmic Problems on Games and Game Models
• Complexity of problems on Games
• Games and PSPACE
• Other connections
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Non Topics
• Computer programs for game playing– Chess, go, bridge, poker, robot-soccer
• Computer Games– Pong, Doom, Civilization , .....
• Games, Logic and Language– That’s for the other tutorials ……
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Games and Computer Science
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Are Games interesting at all ???
Past (1970/80) position of Games in Mathematics & CS:
Study object for a marginal part of AI(Chess playing programs)
Recreational Mathematics (cf. Conway, Guy &Berlekamp Theory)
Game Theory (Economy): von Neumann, Morgenstern, Aumann,
Games in Logic: Determinacy in set theory, Ehrenfeucht-Fraise Games, ....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A previous development
Epistemic Logic used to be a strange topic inPhilosophy up-to the early 1980-ies.
But then at IBM its use for Distributed Computingwas recognized and it became well fundable ComputerScience:
Fagin, Halpern, Moses, Vardi: Reasoning about Knowledge
Biannual TARK conference series since 1986
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Noam NisanAlgorithms for Selfish AgentsMechanism Design for Distributed ComputingProc. STACS’99, Springer LNCS 1563, pp 1--15Invited paper.
Elias Koutsoupias & Christos PapadimitriouWorst-Case Equilibria, Proc. STACS’99, Springer LNCS 1563, pp 404--413
STACS’99 IN TRIER: Games !!!
© Peter van Emde Boas
© Peter van Emde Boas
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Computer Science Theory• Computation Theory
• Complexity Theory
• Machine Models
• Algorithms
• Knowledge Theory
• Information Theory
• Semantics
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Games in Computer Science• Evasive Graph properties (1972-74)• Information & Uncertainty (Traub ea. - 1980+)• Pebble Game (Register Allocation, Theory 1970+)• Tiling Game (Reduction Theory - 1973+)• Alternating Computation Model (1977-81)• Interactive Proofs /Arthur Merlin Games (1983+)• Zero Knowledge Protocols (1984+)• Creating Cooperation on the Internet (1999+)• E-commerce (1999+)• Logic and Games (1950+)• Language Games, Argumentation (500 BC)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Games and Computation
Computation: Set of Configurations, connectedby transitions, with initial one and final ones;
entire computation graph determines outcome:Accept, Reject, obtained value.....
Game: Set of positions connected by moves, with initial one and final ones; entire Game graphdetermines outcome: Win, Loose, Utility Payoff
What is the Difference ?????
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
COMPUTATION
• Deterministic
• Nondeterministic
• Probabilistic
• Alternating
• Interactive protocols
• Concurrency
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
COMPUTATION TREES• Notion of Configurations: Nodes• Notion of Transitions: Edges• Non-uniqueness of transition:
Out-degree > 1 - Nondeterminism• Initial Configuration : Root • Terminal Configuration : Leaf• Computation : Branch Tree • Acceptance Condition:
Property of trees
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Types of Games
• Single player - no choices : Routine :
• Single player - choices : Solitaire :
• Two players – choices : Finite Combinatorial Games :
• Single player - random moves : Gambling :
• Two players - choices, randomness, information hiding:• Several players - concurrent moves :
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Types of Games (and Computations)
• Single player - no choices : Routine : Deterministic Computation
• Single player - choices : Solitaire : Nondeterministic Computation
• Two players – choices : Finite Combinatorial Games : Alternating Computation
• Single player - random moves : Gambling : Probabilistic Algorithms
• Two players - choices, randomness, information hiding: Interactive Proof Systems
• Several players - concurrent moves : Multi Prover Systems
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Questions
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A Game….
X
X
O
Questions: Termination ?
Is there a winner ?
If so, who ?
And how does he do it ?
Trivial …..
No ….
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A Game….
X
X
O
Questions: Termination ?
Is there a winner ?
If so, who ?
And how does he do it ?
Trivial …..
Yes ….
O
X ….
X
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A Game
from H.W. Lenstra: Aeternitatem Cogita
Questions: Termination ?
Is there a winner ?
If so, who ?
And how does he do it ?
Not evident: 50 moves rule…
Unknown in general…..
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The game of HEX
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Position is winning for Green
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Green wins the game
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Questions about HEX: Termination ?
Is there a Winner ?
If so, Who ?
And how does he achieve to win ….?
trivial
Topological argument => Draw is impossible !
Zermelo principle => There must be a winner !
Strategy-copy argument: It can’t be the second player who wins the game…..
Unknown
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Why is a Draw impossible?
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A Mathematical Game
Position: finite list of non negative numbers:
5, 5, 3, 4, 0, 1, 12
Move: replace a single number by a list of smaller numbers ( 0 only can be removed….. )
5, 3, 3, 2, 0, 3, 4, 0, 1, 12
Player unable to move loses the game.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Questions on the Mathematical Game: Termination ?
Is there a winner ?
If so, Who ?
And how to win ….?
Yes, based on set theory (Königs Lemma)
Yes, but not grace to the Zermelo principle ….
Parity principle:
First player wins iff some number occurs with odd parity
Establish position with even parities only…..
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
de Bono’s L-Game
Move: 1) remove your L-piece, and place it somewhere else2) may move one of the neutral stones
Board: 4 by 4 square
Pieces: Red’s L-piece Greens’s L-piece 2 Neutral stones
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
de Bono’s L-Game
Move: 1) remove your L-piece, and place it somewhere else2) may move one of the neutral stones
Board: 4 by 4 square
Pieces: Red’s L-piece Greens’s L-piece 2 Neutral stones
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
de Bono’s L-Game
Move: 1) remove your L-piece, and place it somewhere else2) may move one of the neutral stones
Board: 4 by 4 square
Pieces: Red’s L-piece Greens’s L-piece 2 Neutral stones
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
de Bono’s L-Game
Move: 1) remove your L-piece, and place it somewhere else2) may move one of the neutral stones
Board: 4 by 4 square
Pieces: Red’s L-piece Greens’s L-piece 2 Neutral stones
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
de Bono’s L-GameBoard: 4 by 4 square
Pieces: Red’s L-piece Greens’s L-piece 2 Neutral stones
Move: 1) remove your L-piece, and place it somewhere else2) may move one of the neutral stones
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Move / Lost position
Complete move for Red
Lost Position for Green Initial position
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Questions on L-Game: Termination ?
Is there a winner ?
If so, Who ?
And how to do that ….?
No – the game can run in cycles….
Some positiosn are determined, but not the intitial one
Initial position is a draw due to infinite play…..
Complicated; there exists a Database for this game…..
Source: van Gijlswijk, J.J.O.O Wiegerinck et.al.: Computer Analysis of E. de Bono’s L-GameRep. MI-UvA-76-18
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Time for Computer Science…
In order to answer such questions the games must become input for some Computer Program
How to represent a Game on the Computer ?
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Game Models
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
© Games Workshop © Games Workshop
URGATOrc Big Boss
THORGRIMDwarf High King
Introducing the Opponents
Games involve strategic interaction ......Games involve strategic interaction ......
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
CONWAY’S PERSPECTIVE
© Peter van Emde Boas 19761208 @ SMC, Amsterdam
© Peter van Emde Boas 19761208 @ SMC, Amsterdam © Peter van Emde Boas 19761208 @ SMC, Amsterdam
A Game isa Set.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A GAME IS A SET
• Pick an element, this is again a set
• Give it to the other player, it is now his turn
• Player looses if there is no element remaining: the empty set represents the (unique) lost game
• Let’s play REALS !
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Another way of playing multisets
• A position is a finite collection of sets, repetitions allowed (multiset)
• A move consists of– Select one of the sets– Replace this set by a finite collection of
its elements, repetitions allowed
• The player unable to move looses• Why does this game terminate?
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Playing Multisets
{ A, A, B, B, B, C , D , E }
( B = { p, p, q, r, r, s, t } )
{ A, A, B, B, p, q, q, s, s, t, C , D , E }
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Playing Multisets
Game tree of the multiset game becomes infinite
Tree representing an individual play of the multisetgame is both Finitely Branching (due to the rules)and anti-well founded (due to well foundedness of sets)and therefore Finite on behalf of Königs Lemma
Therefore the multiset game terminates.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Game Trees
Root
Terminal node:Thorgrim looses
Thorgrim’s turn
Urgat’s turn
Terminal node:Urgat looses
Standard Interpretation:Player unable to move looses the game
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Game Trees
Root
Terminal node:
Thorgrim’s turn
Urgat’s turn
Terminal node:
Free Interpretation:Winner explicitly designated at terminal node
T
TU
U
T
UT
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Game Trees
Root
Terminal node:
Thorgrim’s turn
Urgat’s turn
Terminal node:
Non Zero-Sum Game:Payoffs explicitly designated at terminal node
2 / 0
5 / -71 / 4
-1 / 4
3 / 1
-3 / 21 / -1
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Game Trees
Root
Terminal node:
Thorgrim’s turn
Urgat’s turn
Terminal node:
Free Interpretation:Winner explicitly designated at terminal node
T
TU
U
T
UT
SUB-GAME
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Game Graphs
start
U
T
An extension of theGame Tree model
May contain cycles
Acyclic Game Graphsas an intermediate model
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction
Terminal node:
Thorgrim’s turn
Urgat’s turn
Free Interpretation:Winner explicitly designated at terminal node
Root
Terminal node: T
TU
U
T
UT
T
T
UU
U
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction
Root
Terminal node:
Thorgrim’s turn
Urgat’s turn
Terminal node:
Non Zero-Sum Game:Pay-offs computed for allgame nodes including the Root.
2 / 0
5 / -71 / 4
-1 / 4
3 / 1
-3 / 21 / -1
2 / 0
3 / 1
1 / 4-3 / 2
1 / 4
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction
At terminal nodes: Pay-off as explicitly given
At Thorgrim’s nodes: Pay-off inherited from Thorgrim’s optimal choice
At Urgat’s nodes: Pay-off inherited from Urgat’s optimal choice
For strictly competetive games this is the Max-Min rule
Snag ! How to chose between equal utilities ….???!
2 / 0
5 / -71 / 4
-1 / 4
3 / 1
-3 / 21 / -1
2 / 0
3 / 1
1 / 4-3 / 2
1 / 4
T
TU
U
T
UTT
T
UU
U
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Zermelo Principle
Zermelo Principle presents a sufficient condition for Backward Induction to be possible and correct :
In a finite two person game tree where draws are impossible, one of the players must have a winningStrategy
Original intended application: Chess.
Extends to the case of Finite Acyclic Game Graphs
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Why Finitely Branching ?Game of Finity:
Thorgrim: calls a random integerUrgat: decrements the number until it becomes zero and claims victory
Any mathematician knows that this game is won by Urgat
Backward Induction fails to prove so at everyfinite stage (there remain undecided successorsof the initial position)
BI has to be extended over ordinal time in this example at stage + 1 the game isdeclared to be a win for Urgat
U
UU
U
.....
.....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward induction on Game Graphs
T
Initial labeling:only sinks are labeled. Player unable tomove looses
start
TU
Final labeling:iterative apply BI rulesuntil no new nodes arelabeled. Remaining nodes are Draw D
D
T
U
U
U
T
T
TT
D D
start
U
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Bi-Matrix Games
© Games Workshop © Games Workshop© Games Workshop© Games Workshop
© Games Workshop© Games Workshop
Runesmith Dragon SquiggOgre
R
D
O S
1/-1
1/-1
-1/1
-1/1
A Game specified by describing A Game specified by describing the Pay-off Matrix ....the Pay-off Matrix ....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Von Neumann’s Theorem
( )/2 :+ ( )/2+© Games Workshop © Games Workshop© Games Workshop© Games Workshop
© Games Workshop© Games Workshop
R D SO
R
D
O S
1/-1
1/-1
-1/1
-1/1
Mixed Strategy Mixed Strategy Nash EquilibriumNash Equilibrium; ; no player can improve his pay-off by deviation.no player can improve his pay-off by deviation.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
2 / 0
5 / -71 / 4
-1 / 4
3 / 1
-3 / 21 / -1
L R
RL
l
r
r
rl lm
lll llr lml lmr lrl lrr rll rlr rml rmr rrl rrrLL 1/-1 1/-1 1/-1 1/-1 1/-1 1/-1 -3/2 -3/2 -3/2 -3/2 -3/2 -3/ 2LR 1/-1 1/-1 1/-1 1/-1 1/-1 1/-1 -3/2 -3/2 -3/2 -3/2 -3/2 -3/2RL 2/ 0 3/ 1 1/ 4 1/ 4 5/-7 5/-7 2/ 0 3/ 1 1/ 4 1/ 4 5/-7 5/-7 RR -1/ 4 3/ 1 1/ 4 1/ 4 5/-7 5/-7 -1/ 4 3/ 1 1/ 4 1/ 4 5/-7 5/-7
Extensive and Strategic Form
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
2 / 0
5 / -71 / 4
-1 / 4
3 / 1
-3 / 21 / -1
L R
RL
l
r
r
rl lm
lll llr lml lmr lrl lrr rll rlr rml rmr rrl rrrLL 1/-1 1/-1 1/-1 1/-1 1/-1 1/-1 -3/2 -3/2 -3/2 -3/2 -3/2 -3/ 2LR 1/-1 1/-1 1/-1 1/-1 1/-1 1/-1 -3/2 -3/2 -3/2 -3/2 -3/2 -3/2RL 2/ 0 3/ 1 1/ 4 1/ 4 5/-7 5/-7 2/ 0 3/ 1 1/ 4 1/ 4 5/-7 5/-7 RR -1/ 4 3/ 1 1/ 4 1/ 4 5/-7 5/-7 -1/ 4 3/ 1 1/ 4 1/ 4 5/-7 5/-7
Winning Strategy and Equilibrium
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Extensive vs. Strategic Form
Game tree ===> Strategic Form• Exponential Blow-Up in size• Strategies deciding unreached positions• Strategy is non-adaptive• Representation is correct (for trees;• but what about arbitrary game graphs)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Extensive vs. Strategic Form
Strategic Form ===> Game Tree• Leads to games with incomplete information• Strategy is non-adaptive• Equilibria don’t always exist, • Translation is doomed to fail…..
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Urgat doesn’t know the position he is in !
INCOMPLETE INFORMATION
Thorgrim’s Choice of strategy
Urgat’s Choice of strategy
Pay-off phase
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
A Real Life Game
© Donald Duck 1999 # 35
Starting with 15 matchesplayers alternatively take1, 2 or 3 matches away untilnone remain. The playerending up with an oddnumber of matches winsthe game
A Game specified by describing A Game specified by describing the rules of the game ....the rules of the game ....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Complexity Theory
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
COMPLEXITY ENDGAME ANALYSIS
Input Data:Game G , Position p in G
Question: Is position p a winning position for Thorgrim ?for Urgat ?a Draw ?
Relevant Issues: Game presentation,Game structure (tree, graph, description)Determinacy (Incomplete Information!)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The ProblemThinking about simple games like Tic-Tac-Toeone considers the size of the game to be indicated by measures like:-- size configuration ( 9 cells possibly with marks)-- depth (duration) game (at most 9 moves)
The full game tree is much larger : 986410 nodes(disregarding early terminated plays)
And what about the size of the Strategic Form ???!
What size measure should we use for complexityestimates ??
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The ProblemThe gap between the experienced sizes (configuration size & depth) and the sizeof the game tree / graph is exponential !
Another exponential gap with the strategic form !
Here: use configuration size and depth assize measures for input games. Estimatecomplexity of endgame analysis in termsof these sizes: the Wood Measure of the Game
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Why Worry About Representations?
Algorithmic problem
Instances
Solutions
InstanceFormat
Question
Instance Size
Algorithm Space/TimeComplexity
The rules of the game called “Complexity Theory”
MachineModel
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Games as Acceptors
Input X is mapped to some game G(X)
The mapping X G(X) is easy to compute(computable in Polynomial Time or Logarithmic Space)
Consequence: G(X) has a Polynomial Size Description. (Leaving open what the Proper Descriptions are. Works only when using Wood Measure ....)
LG := { X | G(X) has a winning strategy forthe first player }
Which Languages L can be characterized in this way ?
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Folklore Belief
Reasonable Games Capture PSPACE
Many Conterexamples:
-- Games to easy-- Solitaire games which are to hard-- Two person perfect information games to hard
So what is the base for this belief ???
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
REASONABLE GAMESAssumptions for the sequel:
Finite Complete Information Zero Sum GamesStructure: tree given by description, where deciding properties likeis p a position ?, is p final ? is p starting position ?, who has to move in p ?, and thegeneration of successors of p are all trivialproblems ..... The tree can be generatedAnd traversed in time proportional to its size.....Moreover the duration of a play is polynomialwith respect to the Wood Measure.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction in PSPACE?
The Standard Dynamic Programming Algorithm forBackward Induction uses the entire ConfigurationGraph as a Data Structure: Exponential Space !
Instead we can Use Recursion over Sequences of Moves:
This Recursion proceeds in the game tree from theLeaves to the Root.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction in PSPACE?
Recursive Scheme in case of absense of Draws:
Let denote a sequence of movesc denote a configuration denote the empty sequence of movespos() denotes the position obtained by playing play(c) denotes the player who has tomove in position cmov(c) the finite set of legal moves in cfin(c) denotes whether c is finalwinf(c) denotes the winner in position cin case c is final.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction in PSPACE?win( ) :=if fin( pos( ) )then winf( pos( ) )else if play( pos ( ) ) = Thorgrim
then if mov( pos ( ) )[ win( .) = Thorgrim ]
then Thorgrimelse Urgatfi
else if mov( pos ( ) )[ win( .) = Urgat ]
then Urgatelse Thorgrimfi
fifi
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward Induction in PSPACE?
This Recursive scheme combines recursion(over move sequence) with iteration (over locallylegal moves). Correct only for determinated games!
Space Consumption =O( | Stackframe | . Recursion Depth )
| Stackframe | = O( | Move sequence | + | Configuration| )
Recursion Depth = | Move sequence | =O( Duration Game )
So the game duration should be polynomial!
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Backward induction on Game Graphsstart
TU
Initial labeling:only sinks are labeled. Player unable tomove looses
start
TU
Final labeling:iterative apply BI rulesuntil no new nodes arelabeled. Remaining nodes are Draw D
D
T
U
U
U
T
T
TT
D D
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Analyzing a Graph
If Thorgrim has no move the position is lost (in 0 moves) for Thorgrim
If Urgat has no move the position is lost (in 0 moves) for Urgat
If Thorgrim can move to a position which is lost (in k moves) for Urgat the position is won (in k+1 moves) for Thorgrim
If Thorgrim only can move to positions which are won (in ≤ k moves) for Urgat the position is lost (in ≤ k+1 moves) for Thorgrim
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Analyzing a GraphIf Urgat can move to a position which is lost (in k moves) for Thorgrim the position is won (in k+1 moves) for Urgat
If Urgat only can move to positions which are won (in ≤ k moves) for Thorgrim the position is lost (in ≤ k+1 moves) for Urgat
Apply the above rules until no new nodes are declared loss or won for any of the two players. The remaining nodes areDraws (for both players).
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Best Neighbour AlgorithmInitially: assign to every position a safe neighbour (if possible); otherwiseposition is lost (in 0 moves).Repeat (round k+1) as long as changes occur: Look for wins: if some position in the last round was declared lost (in k moves), declare its parents won (in k+1 moves) (unless they were declared won previously): Reset safe neighbour: if your safe neighbour in the last round was declared won, try to find a new safe neighbour; if no more neighbours are available declare position lost (in k+1 moves)End Repeat;All remaining positions are declared Draw
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Best Neighbour Algorithm
In this algorithm each edge is investigated atmost once in every direction. Generating edges on the fly in stead of precomputingthe entire game graph becomes advantageous.
Original Result obtained by this method: E. de Bono’s L-game is a draw if playedby a perfect player. The longest decisive play from a won position requires 9 moves.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Incomplete Information Games
© Games Workshop© Games Workshop
© Games Workshop© Games Workshop
Runesmith Dragon SquiggOgre
R
D
O S
1/-1
1/-1
-1/1
-1/1
O S
RD
R D
-1/1
-1/11/-1
1/-1
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Incomplete Information Games
Indications of trouble….:-- Simple games no longer are determinated-- Information sets capture uncertainty-- Uniform strategies are required-- Earlier algorithms become incorrect
WANTED: a complexity theory for IncompleteInformation Games......
WARNING: such a complexity theory is unlikelyto exist…..
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Games and PSPACE
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
THE HOLY QUADRINITY
FINITE COMBINATORIAL
GAMES
QUANTIFIEDPROPOSITIONAL
LOGIC: ALTERNATION
PSPACE
UNRESTRICTEDUNIFORM
PARALLELISM
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Walter Savitch
ICSOR; CWI, Aug 1976 San Diego, Oct 1983
© Peter van Emde Boas © Peter van Emde Boas© Peter van Emde Boas
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Invariance Thesis
Reasonable Sequential MachinesSimulate Each Other with
Polynomial overhead in Time andConstant Factor Overhead in Space
M’ simulates M : …. ; no definition given
TM’( x ) ≤ k.TM( x )k
SM’( x ) ≤ k.SM( x )
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Parallel Computation Thesis
// PTIME = // NPTIME = PSPACE
True for Computational Models which combineExponential Growth potential withUniform Behavior.
The Second Machine Class
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
UNDERSTANDING PSPACE
• The most Robust Complexity Class• Solitaire Problem: finding an Accepting
path in an Exponentially large, but highly Regular Graph
• Matrix Powering Algorithm: Parallelism• Recursive Procedure: Savitch Theorem• Logic: QBF, Alternation, Games
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Polynomial Space Configuration Graph
• Configurations & Transitions: – (finite) State, Focus of Interaction &
Memory Contents– Transitions are Local (involving State
and Memory locations in Focus only; Focus may shift). Only a Finite number of Transitions in a Configuration
– Input Space doesn´t count for Space Measure
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Polynomial Space Configuration Graph
• Exponential Size Configuration Graph:– input length: |x| = k ; Space bound: S(k)– Number of States: q (constant)– Number of Focus Locations: k.S(k)t
(where t denotes the number of “heads”)– Number of Memory Contents: CS(k)
– Together: q.k.S(k)t. CS(k) = 2O(S(k))
(assuming S(k) = (log(k)) )
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Polynomial Space Configuration Graph
• Uniqueness Initial & Final Accepting Configuration: – Before Accepting Erase Everything– Return Focus to Starting Positions– Halt in Unique Accepting State
Start Goal
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Path Finding in Configuration Graph
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Path Finding in Configuration Graph
Cycles in accepting path are irrelevant
Trash Nodes: Unreachable: or Useless
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Unreasonable Algorithm• Step 1: generate Exponentially large
structure• Step 2: Perform Exponentially long heavy
computation on this structure• Step 3: Extract a single bit of information
from the result - the rest of the efforts are wasted.
• :‘• And this is just what the Parallel Models
do.....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Unreasonable Algorithm
Transitive Closure of Adjacency Matrix byIterated squaring ==> // Models
Recursive approaches ==> // Models,Savitch' Theorem & Hardness QBFand Games
Playing Savitch: a direct connection betweenPSPACE and Games
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Adjacency Matrix
1 0 0 1 10 1 1 0 01 0 1 0 00 0 0 1 11 0 0 0 1
1
5
4
3
2
Matrix describes Presence of Edges in Graph;1 on diagonal: length zero paths
M :=
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Adjacency Matrix1 0 0 1 11 1 1 0 01 0 1 1 11 0 0 1 11 0 0 1 1
1
5
4
3
2
In Boolean Matrix AlgebraM2 : Paths up to length 2M4 : paths up to length 4
M2 =
1 0 0 1 11 1 1 1 11 0 1 1 11 0 0 1 11 0 0 1 1
1
5
4
3
2
M4 =
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Matrix Squaring
M[i,j] := ( M[i,k] M[k,j] )k
On an N node graph, a single squaring requires O(N3) operations
Log(N) squarings are required to compute N-th Power of the Matrix
Remember that N = 2O(S)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Think Parallel• O( N3 ) processors can compute these
squarings in time– O( log(N)) if unbounded fan-in is allowed– O( log(N)2 ) if fan-in is bounded
• This is the basis for recognizing PSPACE in polynomial time on PRAM models
• Don’t forget that the Matrix must be generated first …..
• See Second Machine Class paper* and/or chapter in Handbook of TCS
* Published in the proc’s of the 1985/86 Banach Center Workshop (Rasiowa)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Recursive Matrix Squaring
M[i,j,p+1] := ( M[i,k,p] M[k,j,p] )k
Log(N) recursion depth is required to compute N-th Power of the MatrixLog(N) recursion depth is required to replace N fold Iteration by RecursionOverall Recursion depth: Log(N)2
M[i,j,0] is the given Adjacency Matrix
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Recursive Path FindingReach(x,y,0) := x = y trans(x,y)
Reach(x,y,p+1) := z [ Reach(x,z,p) Reach(z,y,p) ]
Reach(x,y,p+1) :=z [u,v [ (u=x v=z) (u=z v=y) ==> Reach(u,v,p) ]]
Rabin, Meyer & Stockmeyer trick! The Exponential Growth of the formula is prevented! Size ≈ O( S ) . O(Rec-depth)
Cook/Levin Formula
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Recursive Path Finding
• Space Consumption of Recursive Procedure: O( | stackframe |.depth )
• In this case: | stackframe | and depth are both O(S)
• For path finding Nondeterminism of the original machine is irrelevant!
• Savitch Theorem: PSPACE = NPSPACE
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Quantified Boolean Formulas (QBF)
INSTANCE: Formula of the form:F = Qx[Qy[Qz[….. [ P(x,y,z, …… ) ]]] … ]Where P is propositional and Q is or
QUESTION: is F true ?
THEOREM: QBF is PSPACE-Complete
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
QBF as a LOGIC GAME
• Game is a Propositional Formula (x1,x2, .... xn, y1,y2, .... yn)
• THORGRIM and URGAT select values for the xi and yi in a specified order
• THORGRIM wins if the formula eventually evaluates to true: otherwise URGAT wins the game.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
QBF is PSPACE HardReach(x,y,0) := x = y trans(x,y)
Reach(x,y,p+1) := z [ Reach(x,z,p) Reach(z,y,p) ]
Reach(x,y,p+1) :=z [u,v [ (u=x v=z) (u=z v=y) ==> Reach(u,v,p) ]] The resulting formula is polynomial sizeand reduces an arbitrary PSPACE computation to QBF .Brute force Evaluation runs in PSPACE.
Cook/Levin Formula
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
QBF in PSPACE?
There exists an evident Recursive Algorithm for QBF
x[ P(x,….)] --> ( P(0, …. ) P(1, …. ) ) x[ P(x,….)] --> ( P(0, …. ) P(1, …. ) )
Space consumption: O( Depth . | Stackframe | ) = O(L2) where L = size input
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Some Direct Connections
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
THE HOLY QUADRINITY
FINITE COMBINATORIAL
GAMES
QUANTIFIEDPROPOSITIONAL
LOGIC: ALTERNATION
PSPACE
UNRESTRICTEDUNIFORM
PARALLELISM
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
PLAYING SAVITCH
Usually the connection between PSPACE andGames is established indirectly, using eitherAlternation or QBF (or both) as intermediate.
In the Literature occasionally the same holds for the reverse connection: (this game can beanalyzed in PSPACE because it can beanalyzed in Polynomial Time on a ATM ....)
A direct approach is possible !
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Savitch Game
Given: some input x for a PSPACE acceptor M(M can be nondeterministic)
To Construct: a 2 person Complete Informationreasonable Game G(M,x) such thatx is accepted by M iff the first playerhas a winning strategy in G(M,x)
WLOG: time accepting computation ≤ 2 (S(|x|))
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Savitch GameAethis Thorgrim
© Games Workshop© Games Workshop
Typical Position: Configurations C1 , C2 and Time Interval t1 < t2
| C1 | , | C2 | ≤ (S(|x|)) , 0 ≤ t1 < t2 ≤ 2 (S(|x|))
ROUND of the Game :Thorgrim chooses t3 such that t1 < t3 < t2
Aethis chooses C3 at t3
Thorgrim decides to continue with either C1 , C3 and t1 < t3 or C3 , C2 and t3 < t2
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Savitch Game
Initial Position: C1 is the startting position and C2 the (unique)
accepting Configuration. 0 = t1 and t2 = 2 (S(|x|))
Final Position: t2 - t1 = 1
Aethis wins if C1 ---> C2 is a legal transition; otherwiseThorgrim wins the game
Polynomial duration enforced by requiring (t2 - t1).e ≤ (t3 - t1) ≤ (t2 - t1).(1-e) for some fixede satisfying 0 < e ≤ 1/2
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Savitch GameWinning Strategies:
If x is accepted Aethis can win the game bybeing truthful (always play the true configuration insome Accepting Computation...)
If x is not accepted the assertion entailed by theinitial position is false. Regardless the configurationC3 chosen by Aethis he must make a false assertioneither on the first or on the second interval (or both). Thorgim wins by always attacking the false interval....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Savitch GameThe Punchline:
Endgame Analysis of the Savitch Game is in Deterministic PSPACE, even if the original acceptor was Nondeterministic:
NPSPACE = PSPACE !
an Alternative (direct) proof of the SavitchTheorem....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Savitch GameFinal remarks:Aethis can play his winning strategy if heknows the accepting computation.Thorgrim can play his winning strategy if hecan locate errors. Utterly unfeasible....And the new proof isn’t that much different.....
Reach(x,y,p+1) :=z [u,v [ (u=x v=z) (u=z v=y) ==> Reach(u,v,p) ]]
Move Aethis Move Thorgrim
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Power of your EditorTypical sequential models with the power ofparallelism:Vector Machines (Pratt, Rabin & Stockmeyer 74)MRAM (Hartmanis & Simon 74, Bertoni et. al 81)ASSM (Tromp & vEB 93)Vector Machines (Iwama & Iwamoto 98)
But also a simple model of a Text Editor (EDITRAM) solves QBF in polynomial time.
So have patience when your word processor makes you wait .....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
EDITRAM
Program
RAMMemoryIntegers
Text files
Cursors
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
EDITRAM InstructionsThe standard RAM instructions on the main memory (store, load, store-I, load-I, ....)
Read at cursor positionWrite at cursor positionMove cursor (one position, to address, to end,..)Copy segment of text (marked by pair of cursors)Systematic string replacement (literal stringsonly) : C / aab / aacba /
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
EDITRAM Program for QBF1. Eliminate Quantifiers and variables: Starting at innermost quantifier replace xi F(...xi ...) by ( F(... 0 ....) F(... 1 ... ) ) xi F(...xi ...) by ( F(... 0 ....) F(... 1 ... ) )2. Eliminate connectives Working inside out evaluate logical connectives: C / (0 1) / 1 / etc.3. The result is a literal 0 or 1 . Read the answer .
step 1 requires a subroutine for identifyingand marking variables (due to literal only condition)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Alternation
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Alternating Computation
+ -
+ +- - - ++
- Computation Tree
Configuration Type
Existential
Universal
Negating
Accepting
Rejecting
Assumption: no infinite branches
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Alternating Computation
+ -
+ +- - - +
+
-Evaluation Full Computation Tree
This Tree AcceptsThis is just backward induction on a game tree ;
But what is the Game ??
Configuration Type: Game meaning
Existential: Thorgrim moves
Universal: Urgat moves
Negating: Role Switch
Accepting: win (for Thorgrim)
Rejecting: Loose
+
+
+
+
+
+
-
- -
- -
-
--
++
+
+
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Negating Nodes ?• Create for every node its dual node which
yields the “same” transitions• Dual of accepting node is rejecting • Dual of rejecting node is accepting• Dual of universal node is existential• Dual of existential node is universal• Dual of Dual is identity• Replace every negating node by an
existential one, dualizing the entire subtree below it (think de Morgan!)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Eliminating Negating Nodes
+ -
+ +- - - +
+
+
+
+
+
+
-
- -
- -
-
--
++
+
+
+ +
+ +- - -
+
+
+
+
+
+
-
-
- -
-
--
+
+
+
-
-
-
-
+
-
-
Dualized nodes
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Alternating Computation as a Game
Negating states are unnecessary - by dualizingparts of the computation tree they can be removed.
What remains is a Computation Game where bothThorgrim and Urgat control nondeterministicchoices in the computation. Thorgrim wants thecomputation to accept. Urgat wants to prevent this from happening......
Infinite branches (if present) don’t contribute to the game value (non-trivial to prove)
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Alternation Theorems
THM 1: APTIME PSPACE:
Recursive evaluation of the quality of the root of theAlternating Computation Tree:Depth = O(time) , | Stackframe | = O(time)
Resulting Overhead: Square
Can be improved to linear by storing only a constantamount of information in a stack-frame
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Alternation Theorems
THM 2: PSPACE APTIME:
QBF trivially can be solved by an ATMQBF is PSPACE-hardWhat Further Evidence do we Need?
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Alternation Theorems
THM 3: ALOGSPACE PTIME:
Iterative evaluation of the quality of the all nodes in theAlternating Computation Tree:
#Nodes = Exponential in S; # Stages = O(# Nodes )
In terms of Games: This is BackwardInduction on a Game Graph.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Alternation Theorems
THM 4: PTIME ALOGSPACE:
Guess a Space-Time diagram of AcceptingComputation, (thinking in terms of a correct tiling)starting from the “accepting” tile and moving Backwards in time:
At cell X guess contents of three upper neighbors;Universally validate these three upper neighbors.
THIS IS CORRECT DUE TO DETERMINISM!
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Guess and Validate
“accepting Configuration”Coherence of validated Guesses is enforced fromTop to bottom
“Start Configuration”
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Tiling Games
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Tiling GamesTile Type: square divided in 4coloured triangles.Infinite stock availableNo rotations or reflections allowed
Tiling: Covering of region of the plane such that adjacent tiles havematching colours
Boundary condition: colours given along (part of) edge of region, or some giventile at some given position.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Turing Machine
Finite ControlProgram : P
Tape
Read/WriteHead
P (Q ) (Q {L,0,R}) :(q,s,q’,s’,m) P denotes the instruction:when reading s in state q print s’ performmove m and go to state q’ . Nondterminism!
Q: states: tape symbols
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
ComputationsConfiguration c : finite string in *(Q) *Computation Step c --> c’ obtained by performing an instruction in PComputation: sequence of stepsFinal Configuration: no instruction applicableInitial Configuration: start state & leftmost
symbol scannedComplete Computation: computation starting
in initial configuration and terminatingin final one
Accepting / Rejecting computation ....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Turing Machines and TilingsIdea: tile a region and let successive color sequences along rows correspond tosuccessive configurations.....
s
s
symbol passing
tile
s
qs
state accepting
tilesq
s
qsq
s’
qs instruction steptiles
q’s’
qsq’
q’s’
qs
(q,s,q’,s’,0) (q,s,q’,s’,R) (q,s,q’,s’,L)
SNAG: Pairs of phantom heads appearing out of nowhere...Solution: Right and Left Moving States....
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Example Turing Machine
K = {q,r,_}S = {0,1,B}P = { (q,0,q,0,R),
(q,1,q,1,R),(q,B,r,B,L),(r,0,_,1,0),(r,1,r,0,L),(r,B,_,1,0) }
q0 1 0 1 1 B 0 q1 0 1 1 B 0 1 q0 1 1 B 0 1 0 q1 1 B 0 1 0 1 q1 B 0 1 0 1 1 qB 0 1 0 1 r1 B 0 1 0 r1 0 B 0 1 r0 0 0 B 0 1 1 0 0 BSuccessor Machine;
adds 1 to a binary integer._ denotes empty halt state. 11 + 1 = 12
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Reduction to Tilings
q0 1 0 1 1 B 0 q1 0 1 1 B 0 1 q0 1 1 B 0 1 0 q1 1 B 0 1 0 1 q1 B 0 1 0 1 1 qB 0 1 0 1 r1 B 0 1 0 r1 0 B 0 1 r0 0 0 B 0 1 1 0 0 B
© Peter van Emde Boas ; 19921029
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Implementation in Hardware
© Peter van Emde Boas ; 19950310 © Peter van Emde Boas ; 19950310 © Peter van Emde Boas ; 19921031
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Tiling reductions
initial configuration
accepting configuration/by construction unique
blank border
space
blank border
time
Program : Tile TypesInput: Boundary
condition
Space: Width regionTime: Height region
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Tiling ProblemsSquare Tiling: Tiling a given square with
boundary condition: Complete for NP.Corridor Tiling: Tiling a rectangle with
boundary conditions on entrance and exit(length is undetermined): Complete for PSPACE .
Origin Constrained Tiling: Tiling the entire planewith a given Tile at the Origin.Complete for co-RE hence Undecidable
Tiling: Tiling the entire plain without constraints. Still Complete for co-RE(Wang/Berger’s Theorem). Hard to Prove!
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Two Person Tiling GameDesired property of the construction:
A winning strategy for Thorgrim for the given instance corresponds to an Accepting Alternating Computation.
Thorgrim wins by simulating a winning strategy on the Alternating Turing Machine (understood as game).Urgat, however has additional possibilities: he couldattack the legality of the encoding of a Turing Machine computation.....Urgat therefore must be forced to stay within theconstraints allowed by the encoding.
Solved by Bogdan Chlebus.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Conventions on ATM
• Tape uses even number of cells
• Universal and Existential States Alternate
• Left or Right moving States only
• All Instructions Move
• Unique Accepting Configuration
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Chlebus´ Bag of Tricks
Thorgrim and Urgat, each obtain their own set oftile types; this is enforced by introducing two flavorsof the vertical colors, indicated by a pink shade.
Base Shading for Thorgrim
Base Shading for Urgat
Both borders of Rectangle to be tiled are shaded white.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Chlebus´ Bag of Tricks
Tiles types representing the Turing Machine instructionsare replaced by pairs: Decide & Move
s’
q’
qs
q’s’
qs
q’
q’s’
s’
Decide
MoveThe blue shadingindicates a rightmoving state q’for left moving statesuse grey shading
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
THORGRIM’S TILES
s
s
s
s
q
pass symbol &prevent introfrom right
pass symbol &force intro from right for Urgat q’
qs
q’s’
q’s’
s’
q’
qs
q’s’
q’s’
s’
Decide &move right
Decide &move leftqs
s
qs
s
accept from left
accept from right
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
URGAT’S TILES
s
s
pass symbol;accept fromright is prevented q’
qs
q’s’
q’s’
s’
q’
qs
q’s’
q’s’
s’
Decide &move right
Decide &move leftqs
s
qs
s
accept from left
accept from rightis forced
q
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Other Games
© Games Workshop© Games Workshop
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GEOGRAPHY
Objects Selected: Directed Edges
Constraint: Edge is connected to the previously selected edge, and has notbeen selected before
Winning: Player unable to move looses
Morale: Both players build a maximalEulerian Path.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GEOGRAPHYThe original Childrens game:
Objects Selected: City names
Constraint: Name starts with final letterof the name of the previous city
Winning: Player unable to invent a newcity name looses
Question: Explain the graph formulation
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GEOGRAPHY is PSPACE HARD
Proof: Reduction from QBF
Special Contraints on QBF:Propositional Formula in CNF
Qx1 Qx2 .... Qxk [ C1 C2 ... Cm ]
Q = or , Cj are clauses
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GEOGRAPHY is PSPACE HARD
Component Design: Vars
selection component
for xi followed
by xi+1
xixi
ci
ci+1
di
xixi
ci
ci+1
di
selection component
for xi followed
by xi+1
if no alternation occurs thenodes di and ci+1 are identified
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GEOGRAPHY is PSPACE HARDComponent Design: Clauses
cn
yky1 ym
towards thosexi and xi which occur inC1
Here it is crucial that Urgat chooses for a clauseand Thorgrim chooses a literal in the clause
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GEOGRAPHY is PSPACE HARDc1 is the startnode
First Player depends on the Type of First Quantifier: if it is Existential, Thorgrim willstart the game as usual.
Play: each play will first traverse the varscomponents and select a truth assignment.Subsequently Urgat selects a clause, Thorgrimone of its literals. Only if this literal node isunvisited in the first stage Urgat has a move left.
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
STRATEGY MAPPINGPlayers select truth values for their variables as in the QBF logic game.
If now some clause is false Urgat can select it;and all literals chosen by Thorgrim will be unvisited, so Urgat still has a free move toa visited out-degree 1 node. Urgat wins.If all clauses are true Urgat must select atrue clause, so Thorgrim can select a visitedliteral. Urgat can’t go anywhere. Thorgrim wins.
NB! Urgat is to move, even if at this node Thorgrim had to move previously!
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Known Examples of Games used in Complexity Theory (1980+)
• Tiling Games (NP, PSPACE, NEXPTIME,....)
• Pebbling Game (Solitaire game !) (PSPACE)• Geography (PSPACE)• HEX (generalized or pure) (PSPACE)• Checkers, Go (PSPACE)• Block Moving Problems (PSPACE)• Chess (EXPTIME)
The Common View is that Games Characterize PSPACE
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
Hard Solitaire Games
Solitaire Games are in NP when a winning playcan be guessed and validated......
OOPS! The game can require to many steps:repetition of moves and/or positions
Typical Examples:
Pebble GameBlock Moving Games
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
The Combinatorial Game perspective
26th MFCS 2001Marianske Lazne
Aug 30
© Peter van Emde Boas
Erik D. Demaine, LCS MITbirthdate: Feb 28 1981
Playing Games with Algorithms:Algorithmic combinatorial game theory
URL : http://theory.lcs.mit.edu/~edemaine/games/
Peter van Emde Boas: Games in Computation and Complexity Theory 20060925-26
GAME OVER
© Morris & Goscinny