Post on 31-Mar-2015
Artificial IntelligenceIntelligence
Ian Gentipg@cs.st-and.ac.uk
Game Playing: Checkers
Artificial IntelligenceIntelligence
1. History2. Search in Checkers3. Endgame Databases4. Chinook
The Story of the World’s Best Draughts Player
3
A Checkered History
Arthur Samuel, 1959 Learning algorithm used to build computer checkers player Beat a ‘master’
Patrick Prosser, 1970s Undergraduate project Probably state of the art at that time Not developed further
Jonathan Schaeffer, 1990s Chinook is the World Man-Machine champion Possibly the best player there has ever been of any kind
4
Further Reading
J Schaeffer One Jump Ahead
Springer, 1997A popular account of the history of ChinookLittle technical detail
J Schaeffer, J Culberson, N Treloar, B Knight, P Lu, D Szafron A world championship caliber checkers program
Artificial Intelligence, Vol 53, pages 273-289, 1992
5
Didn’t Samuel solve Checkers?
Samuel’s program’s opponent made an appalling move…
6
Prehistory of Chinook
Joe Culberson: What is the real size of the search tree in Checkers? Not the naïve estimate of 1040
Jonathan Schaeffer took up the challengeProject began June 1989
Goals were to beat Marion Tinsley and solve the game completely
7
History of Chinook
Tournament August 1990 US National Open, 2nd to Marion Tinsley Gained right to challenge Tinsley for World Title
Political shenanigans Establishment did not want machine to be champion Tinsley resigned championship to be able to play Chinook fudge was “World Man Machine Championship”
Match vs Tinsley, August 1992 Lost to Tinsley, won 2, lost 4, drawn 33
8
History of Chinook
World Man Machine Championship, August 1994 vs Tinsley, drew 6, won 0, lost 0 won title by forfeit when Tinsley fell ill -- died 1995
World Man Machine Championship, 1995 vs Don Lafferty, won 1, lost 0, drew 31
Play it on the Web today! http://www.cs.ualberta.ca/~chinook/play.html
Artificial IntelligenceIntelligence
1. History2. Search in Checkers3. Endgame Databases4. Chinook
The Story of the World’s Best Draughts Player
10
Search in Checkers
What is the search tree like in Checkers? It is possible to get Zugzwang -- every move losesFine line between win and draw
e.g. textbook example with 40 critical moves required
Captures are forced, reducing branching rate about 8 when no captures, about 1.25 when captures
Endgame databases heavily used Chinook can use the endgame database at the root
11
Search in Checkers
Search early in the game involves all of … opening middlegame endgame endgame database
All of these factors make search different from chess
Artificial IntelligenceIntelligence
1. History2. Search in Checkers3. Endgame Databases4. Chinook
The Story of the World’s Best Draughts Player
13
Endgame Databases
Endgames can be 100 moves long in checkers branching rate of 2 gives 2100 = 1030 positions.
But there is a trick when few pieces left first used by Ken Thompson in Chess
(Ken Thompson wrote first Unix, won Turing award)
Calculate the true optimal move for every position e.g. 406 x 109 eight piece positions, 4x1011<< 1030
Best version of Chinook used 8 piece databases web version just uses 6 piece
14
How to calculate Endgame DB’s
0. Duplicate every position, for W/B to move1. Try every possible position of the pieces
Mark as Win/0 if W has won in this position Mark as Loss/0 if W has lost in this position Leave other positions unmarked
2. Iterate until no new positions are marked 2a) Try every unmarked position of the pieces
If W has move to Win/n, mark as Win/n+1If every W move is to Loss/n, mark as Loss/n+1
Ian Gent:
Of course W might have move to Loss/1, Loss/3, Loss/5. In this case n = 5
Ian Gent:
Of course W might have move to Loss/1, Loss/3, Loss/5. In this case n = 5
15
Calculating Endgame Databases
When this process has finished We know the number of moves to win for every position
where either B or W can force win Therefore every other position must be drawn
so the following is valid3. Mark all unmarked positions as DrawnWe can calculate optimal winning moves
In Win/n position, best move for W is to any Win/n-1 in Drawn, best move for W is to any Drawn position, In Loss/n position, best move is to Loss/n-1
Artificial IntelligenceIntelligence
1. History2. Search in Checkers3. Endgame Databases4. Chinook: Putting it all together
The Story of the World’s Best Draughts Player
17
Putting it all together
Standard techniques search endgame databases
variable search depthe.g. pursue positions with material deficit less deeply
An AntiBook not a standard opening book known to opponents a book of disallowed moves, encouraging novelty
18
Static Evaluation function
Game divided into 5 phases opening middlegame early endgame late endgame endgame database
Different evaluation function at each stageSearch involves all phases early in the game
deal with ‘blemish effect’ by rescaling each phase• I.e. problem that score jumps as move from one phase to next
19
Static Evaluation function
Game divided into 5 phases opening middlegame early endgame late endgame endgame database
Different evaluation function … Search involves all phases …
deal with ‘blemish effect’ by rescaling ...
Total is 88 parameters plus scaling factors!
22 parameters22 parameters22 parameters22 parametersperfect info.88 parameters
scaling factors
20
The Weigh-in
Tinsley Chinook
Team Marion Tinsley Schaeffer et al,SGI computer
CPU Massivel parallel 16x parallel
Positions/sec 2-3 100,000-500,000
Knowledge 50,000+ patterns < 100 patterns1011 database
Technique knowledge based Search based
21
The Present and the Future
Present Chinook is best player in the
world following Tinsley Never beat Tinsley in a match,
not near solving Checkers Deep Blue beat Kasparov, but
has been dismantled
Harder games Go: huge branching rate
(computers terrible) Bridge: uncertainty Civilization: worst of both the
above!