Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: NegaMax with alphabeta: how to produce Principal variation?

Author: Colin Frayn

Date: 08:27:45 02/11/00

Go up one level in this thread


On February 11, 2000 at 10:42:12, Per Steneskog wrote:

>Since january, I am writing a little chessplaying program. So far it has went
>rather smooth until it introduced alphabeta cut-offs. Debbuging the move-tree
>shows it cut-offs and back-ups scores as expected. But I am not sure how to
>produce the principal variation and how to update it.

Yeah it took me an annoyingly long time to get it working too.  The actual
theory is quite simple, though I must admit I had to ask.

>Clearly the pv should only be updated when you
>have a cut-off (alpha < score < beta). But how do I know I am within the pv and
>at what ply?

Simply keep a list of the current PV from each node, and whenever you return a
move which is neither fail-high or fail-low (i.e. the move is between alpha and
beta as you say) then also return the PV from that node, but with the move you
just played to get to that node stuck on the front.  If the move is <= alpha or
>=beta then you forget the PV from that node and it doesn't get propagated
backwards.  I think.  Well... something like that.

That's not a very good explanation is it?  Prof. Hyatt explained it much better
when I asked him but I didn't keep the email I'm afraid.

I implemented it in a very daft way using linked lists, but with a little
thought you could probably do it with large arrays and no dynamic allocation at
all.

Cheers,
Colin



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.