50 likes | 178 Views
COMS W4701 Project 3 Spring 2011. Isolation – Champion Program. Albert Jimenez (alj2110). Board Representation. Graph Representation Each node is a free block Gets smaller as the game progresses Boolean 2D Array Simpler 3 – 5 times faster when generating new boards. Alpha Beta.
E N D
COMS W4701 Project 3 Spring 2011 Isolation – Champion Program Albert Jimenez (alj2110)
Board Representation • Graph Representation • Each node is a free block • Gets smaller as the game progresses • Boolean 2D Array • Simpler • 3 – 5 times faster when generating new boards
Alpha Beta • Generating and Ordering New Boards • Statistical analysis • Correlation between distance of players of chosen board and whether the players are directly reachable. • Exploited correlation to achieve more pruning • Evaluation Function • Early in the game it is not clear who is losing/winning • Eval(board) = currentPlayer.numMoves – opponent.numMoves • Ensures more freedom to apply other strategies • Reduces the chances of the opponent trapping you
Main Strategy: Achieving Isolation • Detecting Isolation • Determine if players are separated after generating new boards • If so, this is a terminal node and the second evaluation function can be applied • Can immediately determine if board is likely to be a win/loss without going any deeper • Evaluation Function 2 • Compute number of blocks reachable from both players • Compute difference in reachable blocks = ‘diffReachable’ • Positive value means a likely win • Negative value means a likely loss • Eval2(board) = (diffReachable > 0) ? INFINITY + diffReachable : -INFINITY + diffReachable • Distinguishes between ‘good’ or ’bad’ win/loss
Main Strategy: During Isolation • Alpha Beta becomes Obsolete • It is unnecessary to care about what move the other player might take • By focusing on only one’s own moves, can reach twice the depth • Computing Optimal Isolation Path • Recursive approach to choose the longest path • Heuristics were used to prune bad moves (moves that decrease number of reachable blocks)