Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: hash table collisions

Author: Robert Hyatt

Date: 21:06:38 01/14/00

Go up one level in this thread


On January 14, 2000 at 21:55:04, Landon Rabern wrote:

>An average how many hash collisions per number of nodes should be happening?  I
>am getting around 18,000 collisions when I search 800,000 nodes.  This seems
>like a lot.  I am using random numbers from 0 to greatest power of 2 over the
>number of hash entries I have for my values.  This way if the hashIndex is over
>the number of the highest entry I can just subtract the highest entry and get
>back in to the numbers I want to be in.  I didn't see an easy way to use randoms
>from 0 to 2^32 -1, because how do you get the number back into an index you can
>use?
>
>
>Thanks,
>
>Landon


Use 64 bits.  _not_ 32.  And then use the hash&mask where mask is the size
of the hash table-1, noting that the size must be a perfect power of 2.



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.