Author: Tom Kerrigan
Date: 19:02:59 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 A hash table is called a hash table because you "hash" (cut up) the things that you are storing. So you take the unique ID of the position (between 0 and 2^64 - 1) and make your index from a few of the bits in that number. Your random numbers really need to be from 0 to 2^64, otherwise you will get way too many collisions. -Tom
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.