210 likes | 359 Views
Artificial Intelligence. Game Playing: Checkers. Ian Gent ipg@cs.st-and.ac.uk. Ian Gent: Why not chess? Unfortunately there has not been a good article or book written about Deep Blue. There is a good journal article and a book about Chinook, the checkers program.
E N D
Artificial Intelligence Game Playing: Checkers Ian Gent ipg@cs.st-and.ac.uk
Ian Gent: Why not chess? Unfortunately there has not been a good article or book written about Deep Blue. There is a good journal article and a book about Chinook, the checkers program Artificial Intelligence The Story of the World’s Best Draughts Player 1. History 2. Search in Checkers 3. Endgame Databases 4. Chinook
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
Further Reading • J Schaeffer • One Jump Ahead • Springer, 1997 • A popular account of the history of Chinook • Little 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
Didn’t Samuel solve Checkers? • Samuel’s program’s opponent made an appalling move…
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 challenge • Project began June 1989 • Goals were to beat Marion Tinsley • and solve the game completely
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
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 Intelligence The Story of the World’s Best Draughts Player 1. History 2. Search in Checkers 3. Endgame Databases 4. Chinook
Search in Checkers • What is the search tree like in Checkers? • It is possible to get Zugzwang -- every move loses • Fine 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
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
Ian Gent: Why not chess? Unfortunately there has not been a good article or book written about Deep Blue. There is a good journal article and a book about Chinook, the checkers program Artificial Intelligence The Story of the World’s Best Draughts Player 1. History 2. Search in Checkers 3. Endgame Databases 4. Chinook
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
How to calculate Endgame DB’s • 0. Duplicate every position, for W/B to move • 1. 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+1 • If 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
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 valid • 3. Mark all unmarked positions as Drawn • We 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
Ian Gent: Why not chess? Unfortunately there has not been a good article or book written about Deep Blue. There is a good journal article and a book about Chinook, the checkers program Artificial Intelligence The Story of the World’s Best Draughts Player 1. History 2. Search in Checkers 3. Endgame Databases 4. Chinook: Putting it all together
Putting it all together • Standard techniques • a-b search • endgame databases • variable search depth • e.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
Static Evaluation function • Game divided into 5 phases • opening • middlegame • early endgame • late endgame • endgame database • Different evaluation function at each stage • Search 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
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 parameters 22 parameters 22 parameters 22 parameters perfect info. 88 parameters scaling factors
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!