Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Could someone explain how hash tables work?

Author: Steve Maughan

Date: 03:21:25 04/26/99

Go up one level in this thread


Brett

Hash tables are a programs search memory and generally the larger the hash table
the better.

Basically, when a program comes across a position it first looks into its hash
table to see if it already knows something about the position.  The type of
information it may find is the best move it found the last time it encountered
this position, the score of the position based upon a search of 'x' extra moves
or a score bound eg 'this position looses a queen'.  The program use this
information to either ignore this position (eg a line that looses a queen
probably will not need searching any deeper) or search the best move first.
When it has completed searching from a position, it stores what it already knows
in the hash table for future use.

Generally hash tables make a big difference in the endgame where transpositions
occur frequently in the search i.e. the stored knowledge in the hash tables is
extremely useful.

That's the basic idea - it can be one of the most complex aspects of chess
programming.  For a deeper understanding search Deja News for "Hash Zobrist" in
the alt.games.computer.chess newsgroup and you sould find quite a bit (Zobrist
is the algorithm used by most programs to hash a position).

Hope that helps!

Steve Maughan




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.