A Retrograde Approximation Algorithm for One Player Can’t Stop James Glenn

advertisement
A Retrograde Approximation
Algorithm for One Player Can’t
Stop
James Glenn
Haw-ren Fang
Clyde Kruskal
Loyola College in Maryland
University of Maryland, College Park
University of Maryland, College Park
Can’t Stop Equipment
2
3
4
5
6
7
8
9
10
11
12
 2 to 4 players
 4 6-sided dice
 Board with
columns 2-12
 Colored markers
for each column
 3 neutral markers
 Goal: advance to
top of 3 columns
Game Play
 Roll 4 dice
 Split into 2 pairs
 Advance neutral markers in columns
for pair totals
 Roll again or stop
 Turn ends if no way to use pair totals
Example
2
3
4
5
6
7
8
9
10
11
12
Position Graph
 Similar to Backgammon or Yahtzee
 Bipartite (V1, V2, E)
 (v2, v1) in E correspond to player
choices
 (v1, v2) in E correspond to outcomes
of random event
Can’t Stop Graph
Comparison to Other Games
 Solitaire Yahtzee
 No cycles
 Backgammon
 General: long cycles
 Bearing off: only short cycles
 Can’t Stop
 Cycles long but only within one turn
 components form a DAG
Can’t Stop Graph
anchors of
other
components
anchor
Retrograde Analysis
 Topologically sort graph
 Compute position value for each
vertex
 Start with final states
 Work back towards start state
 Player choice: compute max/min over
outgoing edges
 Random event: weighted average
 Can’t Stop: retrograde analysis on
components
Symbolic Analysis
E
B
F
C
p1
p2
A
D
p3




f(B)=f(E)
f(C)=min(f(E), f(F))
f(D)=f(A)
f(A)=p1f(E)
+p2•min(f(E),f(F))
+p3f(A)
Symbolic Analysis for Can’t Stop
G
H
p3
E
p4
D
B
C
p2
p1
A
F







f(E), f(F) given
f(H)=f(F)
f(G)=f(A)
f(D)=p3f(G)+p4f(H)
f(C)=min(f(E),f(F))
f(B)=min(f(D),f(E))
f(A)=1+p1f(B)+p2f(C)=
1+p1min(p3f(A)+p4f(F),f(E))
+p2min(f(E), f(F))
Numerical Analysis
G
H
p3
E
p4
D
B
C
p2
p1
A’
A
F





Make a copy of anchor
component is now a DAG
Guess value of f(A’)
f(A) is a function of f(A’)
Want fixed point
 Function is piecewise linear
and continuous
 Fast convergence from
Newton’s method
Retrograde Analysis for Can’t Stop
 f(v) = 0 for all final states v
 For each non-final anchor in reverse
order of topological sort
 Make a copy of the anchor
 Topologically sort the anchor’s
component
 Apply Newton’s method to find value of
anchor; using retrograde analysis on
each iteration
Results
Dice
Size
Graph Size
Time to Solve Optimal Turns
2
1
225
0.166 sec
1.298
2
2
1,936
0.405 sec
1.347
2
3
9,025
0.601 sec
1.400
3
1
64,372
1.70 sec
1.480
3
2
787,600
5.05 sec
1.722
3
3
4,934,006
23.3 sec
1.890
4
1
20,802,843
5 min
2.187
4
2
289,091,584
59 min
2.454
4
3
2,104,663,011
6 hr
2.700
5
1
7,105,015,062
2.8 days
2.791
 Official game: estimated 3000 years
Future Work
 Optimizations to Algorithm
 Better initial estimate
 Shortcuts when evaluating components
 Distributed Algorithm
 Analysis of 2-player Can’t Stop
Download