Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: And a few additional questions.

Author: Pham Minh Tri

Date: 17:22:50 11/26/00

Go up one level in this thread


...
>>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;
>>}
>
>I cannot see any null move here. What am I missing? The usual definition of
>null move is, that you pass the right to move to the opponent. For qsearch, this
>would mean, instead of me, let the opponent capture. If I am still better than
>beta, this is a fail high node. Otherwise, I try my captures in the ususual way.
>While I have not tried this idea, I would think, that it won't save anything in
>qsearch, to the contrary, probably more nodes will be searched on average.
>
>The qsearch routine above looks to me like a "standard" qsearch, that returns
>the stand-pat when >= beta without generating any moves.
...

It could be easier to understand the null-move in qsearch if you see the
original qsearch function as following (from Advances in Computer Chess 5):

QUIESCE (lower, upper) integer lower, upper;
{
    integer bestv;
    makenull; bestv <- -eval(-upper,-lower); unmakenull;
    foreach move m do {
        if (bestv >= upper) return bestv;
        make(m); v <- -QUIESCE(-upper, -bestv); unmake(m);
        if (v>bestv) bestv <- v;
    }
}

I think the modern qsearch functions are little modified from the original one
when the makenull and unmakenull functions do nothing than change side to move
so they could be reduced with changing the sign of eval function. It means the
line:
    makenull; bestv <- -eval(-upper,-lower); unmakenull;

turn into:
    bestv <- eval (lower, upper);

Pham



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.