Pente: David Kron, Matt Renzelmann, Eric Richmond, and Todd Ritland
Pente: David Kron, Matt Renzelmann, Eric Richmond, and Todd Ritland
Pente: David Kron, Matt Renzelmann, Eric Richmond, and Todd Ritland
Introduction
Game tree search algorithms in Pente
NegaScout SSS-2 MTD(f) Alpha Beta with Transposition Table
Pente
Tic-Tac-Toe, with 5 in a row, a 13x13 board, and a couple other small twists
NegaScout
Developed by Alexander Reinefeld around 1983 Good: NegaScout dominates AlphaBeta
Nodes searched by NegaScout are searched by AlphaBeta, but the reverse is not necessarily true
SSS-2
Variant of SSS* Attempts to visit nodes in a best-first fashion Maintains a global solution tree which is generated by the expand function and is refined by the diminish function Nodes visited are a subset of nodes visited by Alpha-Beta In theory, slightly better than Alpha-Beta In practice, comparable with Alpha-Beta
SSS-2
G = {root}; //The global solution tree g = expand(root, +inf); //The "best-so-far" value do { temp = g; g = diminish(root, temp); } until (g >= temp);
MTD(f)
Improvement to Alpha-Beta Always searches minimal windows
nextCall(Alpha = beta -1 , Beta = beta)
Can only return a bound on minimax value so it needs to converge towards it. Theoretically better than NegaScout Name From MTD(n,f)
Memory-enhanced Test Driver f = guess
//pos = boardState // d = depth // f = guess Int MTDF(node pos, int d, int f){ int score = f; upperBound = +Infinity; lowerBound = -Infinity; while(upperBound>lowerBound) do{ if(score == lowerBound) then beta = score +1; else = AlphaBeta(pos, beta-1, beta,d); if(score < beta) then upperBound = score; else lowerBound = score; return score;
MTD(f)
A transposition table is simply a hash table that stores previously calculated board configurations.
10
So, I made a 3dimensional hash table. 1st dimension is a hash on the middle row, 2nd dimension is a hash on the middle column, 3rd is on the forward diagonal.
12
Results
Algorithm Minimax AlphaBeta NegaScout SSS-2 MTD(f) AlphaBeta with TT Number of Wins 5 10 10 6 3 2
Conclusion
Fast tree search is not enough!
A branching factor of 169 on a 13x13 board is problematic Pente actually uses a 19x19 board