To improve performance of Minimax algorithm with Alpha-Beta pruning, I've implemented Iterative deepening:
public Integer iterativeDeepening(int maxDepth, boolean isFirstPlayer) {
Integer bestCell = -1;
for (Integer depth = 1; depth <= maxDepth; depth++) {
bestCell = alphabeta.minimax(depth, false, Integer.MIN_VALUE, Integer.MAX_VALUE)[1];
}
return bestCell;
}
where method iterativeDeepening
simply returns id of best move.
Firstly, I am not sure if this is correct way to implement Iterative Deepening.
Secondly, I noticed that AI started making wrong moves. Is it possible for Iterative Deepening to affect decision making?
While working with Transposition tables and Iterative Deepening, I measure significant improvements to algorithm speed, but I don't really want to sacrifice AI quality for speed.