Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to remember the principle variation in my program

Author: Tord Romstad

Date: 03:28:13 08/26/03

Go up one level in this thread


On August 26, 2003 at 06:00:51, Hans Bogaards wrote:

>In my old program I first used a 2 dimensional array PV[MAXDEPTH][MAXDEPTH]
>and stored the best move in PV[Depth][Depth] and copied the rest of the PV
>from PV[Depth + ][Depth + X] to PV[Depth][Depth + 1]. This worked but was
>very slow.

This is what most people do, I think.  And there is no reason it should be
slow.  The code should look something like this:

PV[Depth][Depth] = new_best_move;
for(i = Depth+1; i < PV_length[Depth+1]; i++)
  PV[Depth][i] = PV[Depth+1][i];
PV_length[Depth] = PV_length[Depth+1];

I assume this is what you did?  I cannot imagine how this could slow down
a program noticably ...

>One solution I know is to only use the transposition table for the best move,
>but when I tried that in my old program it made the search tree quite a bit
>larger...

I don't understand quite what you mean here, but this sounds similar to what
I do.  Because I use the MTD(f) algorithm instead of alpha-beta, it is
somewhat tricky to build a PV during the search.  Instead, I build a PV
from the transposition table at the end of each iteration.  This works, but
is somewhat more complicated than using a PV[][] array, and has the
disadvantage that the PV may be truncated because positions in the
transposition table are overwritten.

Good luck with your program!  I would recommend you to make it compatible
to the xboard/Winboard protocol.  There is a big community of friendly
Winboard enthusiasts who runs test tournaments between amateur engines
of all strengths.

Tord



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.