Questions tagged [hopscotch-hashing]

Hopscotch hashing is a scheme in computer programming for resolving hash collisions of values of hash functions in a table using open addressing. It is also well suited for implementing a concurrent hash table.

Hopscotch hashing is a scheme in computer programming for resolving hash collisions of values of hash functions in a table using open addressing. It is also well suited for implementing a concurrent hash table. Hopscotch hashing was introduced by Maurice Herlihy, Nir Shavit and Moran Tzafrir in 2008. The name is derived from the sequence of hops that characterize the table's insertion algorithm.

The algorithm uses a single array of n buckets. For each bucket, its neighborhood is a small collection of nearby consecutive buckets (i.e. one with close indexes to the original hashed bucket). The desired property of the neighborhood is that the cost of finding an item in the buckets of the neighborhood is close to the cost of finding it in the bucket itself (for example, by having buckets in the neighborhood fall within the same cache line). The size of the neighborhood must be sufficient to accommodate a logarithmic number of items in the worst case (i.e. it must accommodate log(n) items), but only a constant number on average. If some bucket's neighborhood is filled, the table is resized.

References:

http://en.wikipedia.org/wiki/Hopscotch_hashing

2 questions
5
votes
2 answers

What happens in Hopscotch Hash Tables when there are more than sizeof(Neighborhood) actual hash collisions?

Relevant link: http://en.wikipedia.org/wiki/Hopscotch_hashing Hopscotch hash tables seem great, but I haven't found an answer to this question in the literature: what happens if my neighborhood size is N and (due to malfeasance or extremely bad…
0
votes
1 answer

How does hopscotch hashing actually work?

I am reading about hopscotch hashing The algorithm says when we run into colision during insert: Otherwise, j is too far from i. To create an empty entry closer to i, find an item y whose hash value lies between i and j, but within H − 1 of j,…
Jim
  • 18,826
  • 34
  • 135
  • 254