AlphaBeta should not exceed beta in full window ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Chan Rasjid
Posts: 588
Joined: Thu Mar 09, 2006 4:47 pm
Location: Singapore

Re: AlphaBeta should not exceed beta in full window ?

Post by Chan Rasjid »

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 &#40;i = 0; i < num_moves; ++i&#41;&#123;
makemove&#40;move&#91;i&#93;);
x = -alphabeta_recursive&#40;depth - 1, -beta, -alpha&#41;;
if &#40;x >= beta&#41; return x;
if &#40;x > alpha&#41; alpha = x;
unmakemove&#40;move&#91;i&#93;);
&#125;

return alpha;
&#125;
You have to first understand basic alphabeta; the above is how it is done - the window (alpha, beta) can get narrower, but not wider than (-infi, +inf) as the search progresses.

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
Freshblood

Re: AlphaBeta should not exceed beta in full window ?

Post by Freshblood »

As a result i see that i didn't understand algorithm very well. Consider that my native language is not english so i can not express myself well enough. I assumed if any beta cut-offs occur, whole algorithm will return beta. So i thought why it shouldn't be occur any beta-cut-offs. I know that confused it with aspiration windows. As result if i call AlphaBeta algorithm with with infinity values at out of AlphaBeta algorithm, i can get beta-cut-offs in child nodes. So my engine has no bug about it.