iterative deepening: keep alpha/beta?

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

flok

iterative deepening: keep alpha/beta?

Post by flok »

Hi,

I'm implementing iterative deepening in my chess engine.
e.g.:

Code: Select all

   depth=1
   while(! time_is_up())
   {
        alpha = ...
        beta = ...
        score = alphaBeta(alpha, beta, depth);
        // do something with score
        depth++
    }
What I'm wondering now is: should I indeed each time reset alpha/beta to their initial values when I'm trying a deeper depth?


Thanks.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: iterative deepening: keep alpha/beta?

Post by tpetzke »

Unless you introduce yet another technique called "aspirations windows", the answer is yes, Reset them to the full window.

With aspiration windows you set them to some margin around the last value (alpha = last score - margin, beta = last score + margin) but must be prepared that if the returned score is not inside your assumed window you have to widen the window and do a research.

Thomas...
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: iterative deepening: keep alpha/beta?

Post by ZirconiumX »

The classical iterative deepening driver has

(code from Bruce Moreland)

Code: Select all

for (depth = 1;; depth++) {
    val = AlphaBeta(depth, -INFINITY, INFINITY);
    if (TimedOut())
        break;
}
I think you are getting confused with Aspiration Windows, which is implemented like this:

(code from Bruce Moreland)

Code: Select all

#define valWINDOW  50

alpha = -INFINITY;
beta = INFINITY;
for (depth = 1;;) {
    val = AlphaBeta(depth, alpha, beta);
    if (TimedOut())
        break;
    if (&#40;val <= alpha&#41; || &#40;val >= beta&#41;) &#123;
        alpha = -INFINITY;    // We fell outside the window, so try again with a
        beta = INFINITY;      //  full-width window &#40;and the same depth&#41;.
        continue;
    &#125;
    alpha = val - valWINDOW;  // Set up the window for the next iteration.
    beta = val + valWINDOW;
    depth++;
&#125;
This allows you to get cut-offs quicker than with an open window, where beta-cutoffs are impossible.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: iterative deepening: keep alpha/beta?

Post by bob »

flok wrote:Hi,

I'm implementing iterative deepening in my chess engine.
e.g.:

Code: Select all

   depth=1
   while&#40;! time_is_up&#40;))
   &#123;
        alpha = ...
        beta = ...
        score = alphaBeta&#40;alpha, beta, depth&#41;;
        // do something with score
        depth++
    &#125;
What I'm wondering now is: should I indeed each time reset alpha/beta to their initial values when I'm trying a deeper depth?


Thanks.
Most use the last iteration's score +/- some delta value that prevents excessive re-searching. For example, +/- 1/3 of a pawn works pretty well...
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: iterative deepening: keep alpha/beta?

Post by Sven »

ZirconiumX wrote:This allows you to get cut-offs quicker than with an open window, where beta-cutoffs are impossible.
Not quite: with an open window, beta-cutoffs are impossible at the root node but not necessarily down the tree.

Sven