[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
computer-go: Re: Zobrist hashing
Thanks Stuart for posting the sample code. I have one comment about the
number of bits for the code:
32 bits is a bit small nowadays. If your search generates n distinct
positions, there are n*(n-1)/2 pairs, and you don't want any such pair to
have the same code. For example, if n=2^17, you have about 2^33 pairs, so
you're already likely to get collisions. But 2^17 is only about 130.000, a
small number. 48 bits is safer, and 64 bits is what I use.
Of course it depends on what exactly you're doing with the table. If a few
collisions now and then are less important than the extra memory, you can
go with the smaller code. But if a collision would be fatal, better play it
safe :)
BTW the Zobrist paper has been reprinted in the ICCA journal.
Zobrist, A.L. (1990). A New Hashing Method with Applications for Game
Playing. ICCA Journal, Vol. 13, No. 2, pp. 69-73.
Martin