[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HELP] Zobrist Hashing
First thank Dave Dyer and David Fotland for answering the questions.
>For a complete go board, you would need a string in the range 0-3^361:
>an inconventiently large number. Using Xor, you can reduce the range
>to 0-2^31, an easy to deal with 32 bit number.
>From the posts my understanding is that for a complete go board, if your table
is going to store all possible positions, then scheme stated by Mousheng Xu is
the better approach. However, in reality the number of patterns contained in
most practical pattern database is far less than the total number of all
possible positions. In this case, the scheme stated by Mousheng Xu would not
be as efficient as possible, because a vast number of entries would not be
used. The purpose of Zobrist or any other hash table method is to reduce the
total number of entries that has to be considered as much as possible for a
given size of pattern database. For these hash methods the bit length of the
index is mainly determined by the actual database size rather than the total
number of all possible positions. Or at least that's what those hash methods
trying to accomplish. An ideal hash function would give an index length
exactly the same as the number of patterns in the database. Since such an
ideal hash method does not exist, usually the hash index length is larger than
the number of patterns in the database. 2^31 =2.15*10^9, about two billion.
It's still a very large number considering most pattern databases only contain
several thousands of patterns.
Dan Liu