Reputation: 6294
I've implement a 3 * 3 Tic Tac Toe game in java applying Minimax algorithm only. However, when I change the board size to 4 * 4, the program seems to hang. I wanna ask whether I should apply Minimax with alpha-beta pruning to solve this problem or it is ok with Minimax itself?
Upvotes: 0
Views: 559
Reputation: 5532
IF you're trying to do a full depth search, you need to use alpha-beta. A naive 4 x 4 search tree has 16! or about 21 trillion nodes. A lot of those nodes need not be searched because the other side refutes an ancestor position by winning on the next move or creating a position that forces a win 2 ply later. Alpha-beta will let you carve away some of these search spaces without traversing them.
Upvotes: 1