Freshblood wrote:I was trying to say that i enter AlphaBeta algorithm with alpha=-infinity and beta=+infinity. So i understand from your answer that never score>=beta in algorithm. This is what i wanted to be sure. But still can't understand what can cause this.
Code: Select all
int alphabeta_recursive(int depth, int alpha, int beta){
int i, x;
for (i = 0; i < num_moves; ++i){
makemove(move[i]);
x = -alphabeta_recursive(depth - 1, -beta, -alpha);
if (x >= beta) return x;
if (x > alpha) alpha = x;
unmakemove(move[i]);
}
return alpha;
}
The least value of alpha at any node is -infi; the max value of beta at any node is +infi;
if x >= beta when beta == +infi, it means there is a bug in your program (evaluation); but x >= beta can happen - called "beta-cut-off".
Rasjid