Question : is there a best move in alpha-beta ?

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Paul JF
Posts: 9
Joined: Tue Aug 02, 2022 9:33 pm
Full name: Paul Jérôme--Filio

Re: Question : is there a best move in alpha-beta ?

Post by Paul JF »

My bad, I forgot '''return beta''' in beta cutoff. Thanks you all, this problem seems to no longer exist.
syzygy
Posts: 5695
Joined: Tue Feb 28, 2012 11:56 pm

Re: Question : is there a best move in alpha-beta ?

Post by syzygy »

Paul JF wrote: Tue Aug 16, 2022 5:47 pmThe move is the best move found so far if

Code: Select all

score > alpha
. But if this condition is always false on a given position, does this means there is no best move ? And how to know the best move if this is the case (because obviously every position has a best move) ?
If all moves are <= alpha, there is no best move. You should not store (or overwrite) any move in the TT entry of the position. (Any previous best move stored in the TT entry for the position is still likely to be a good move, so should be tried first the next time the position is visited.)

The first move you find that is >= beta is the "best move". You don't look any further. (There might be "better" best moves but the point of alpha beta is that you don't look for it.)

Otherwise, the move that achieved the highest score v (which will satisfy alpha < v < beta) will be the best move.