Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: And a few additional questions.

Author: Bruce Moreland

Date: 16:03:14 11/26/00

Go up one level in this thread


On November 26, 2000 at 16:59:34, Severi Salminen wrote:

>>int qsearch(int alpha, int beta)
>>{
>>    int cur;
>>
>>    cur = eval();
>>    if (cur >= beta)
>>        return beta;
>>    if (cur > alpha)
>>        alpha = cur;
>>    while (captures()) {
>>        make_next_capture();
>>        cur = -qsearch(-beta, -alpha);
>>        unmake_move();
>>        if (cur >= beta)
>>            return beta;
>>        if (cur > alpha)
>>            alpha = cur;
>>    }
>>    return alpha;
>>}
>
>Do we allways return alpha even if the best score is lower than alpha (eval())?
>Shouldn't we return eval() instead?

In a classic alpha-beta search it doesn't matter.  If you return the original
value of alpha, it is going to get negatized upon return and be equal to the
caller's beta, so the caller will fail high.

If you return something less than alpha, it will be negatized and end up being
more than the caller's beta, which will still cause the caller to fail high.

bruce




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.