Cuckoo Hashing

We present a simple dictionary with worst case constant lookup time, equaling the theoretical performance of the classic dynamic perfect hashing scheme of Dietzfelbinger et al. [SIAM J. Comput. 23 (4) (1994) 738-761]. The space usage is similar to that of binary search trees. Besides being conceptually much simpler than previous dynamic dictionaries with worst case constant lookup time, our data structure is interesting in that it does not use perfect hashing, but rather a variant of open addressing where keys can be moved back in their probe sequences. An implementation inspired by our algorithm, but using weaker hash functions, is found to be quite practical. It is competitive with the best known dictionaries having an average case (but no nontrivial worst case) guarantee on lookup time.

[1]  Jesper Nyholm Jensen,et al.  A Complete Axiomatization of Simulation for Regular CCS Expressions , 2001 .

[2]  Gaston H. Gonnet,et al.  Efficient Ordering of Hash Tables , 1979, SIAM J. Comput..

[3]  Donald E. Knuth,et al.  The art of computer programming, volume 3: (2nd ed.) sorting and searching , 1998 .

[4]  J. Ian Munro,et al.  Membership in Constant Time and Almost-Minimum Space , 1999, SIAM J. Comput..

[5]  Gaston H. Gonnet,et al.  Handbook Of Algorithms And Data Structures , 1984 .

[6]  P BrentRichard Reducing the retrieval time of scatter storage techniques , 1973 .

[7]  Craig Silverstein A practical perfect hashing algorithm , 1999, Data Structures, Near Neighbor Searches, and Methodology.

[8]  Eli Upfal,et al.  Balanced Allocations , 1999, SIAM J. Comput..

[9]  Glynn Winskel,et al.  A Higher-Order Calculus for Categories , 2001, TPHOLs.

[10]  Efrem G. Mallach Scatter Storage Techniques: A Unifying Viewpoint and a Method for Reducing Retrieval Times , 1977, Comput. J..

[11]  Martin Dietzfelbinger,et al.  Universal Hashing and k-Wise Independent Random Variables via Integer Arithmetic without Primes , 1996, STACS.

[12]  Donald E. Knuth,et al.  Sorting and Searching , 1973 .

[13]  J. Ian Munro,et al.  Last-Come-First-Served Hashing , 1989, J. Algorithms.

[14]  Friedhelm Meyer auf der Heide,et al.  Dynamic perfect hashing: upper and lower bounds , 1988, [Proceedings 1988] 29th Annual Symposium on Foundations of Computer Science.

[15]  A. Siegel,et al.  On Aspects of Universality and Performance for Closed Hashing (Extended Abstract) , 1989, STOC 1989.

[16]  Kurt Mehlhorn,et al.  LEDA: a platform for combinatorial and geometric computing , 1997, CACM.

[17]  Rasmus Pagh,et al.  On the cell probe complexity of membership and perfect hashing , 2001, STOC '01.

[18]  Yossi Matias,et al.  Polynomial Hash Functions Are Reliable (Extended Abstract) , 1992, ICALP.

[19]  Richard P. Brent,et al.  Reducing the retrieval time of scatter storage techniques , 1973, Commun. ACM.

[20]  Alan Siegel,et al.  On universal classes of fast high performance hash functions, their time-space tradeoff, and their applications , 1989, 30th Annual Symposium on Foundations of Computer Science.

[21]  J. A. T. Maddison Fast Lookup in Hash Tables with Direct Rehashing , 1980, Comput. J..

[22]  Andrei Z. Broder,et al.  Multilevel adaptive hashing , 1990, SODA '90.

[23]  Kurt Mehlhorn,et al.  A platform for combinatorial and geometric computing , 1995 .

[24]  Mikkel Thorup Even strongly universal hashing is pretty fast , 2000, SODA '00.

[25]  Paul G. Spirakis,et al.  Space Efficient Hash Tables with Worst Case Constant Access Time , 2003, STACS.

[26]  Berthold Vöcking,et al.  Balanced allocations: the heavily loaded case , 2000, STOC '00.

[27]  János Komlós,et al.  Storing a sparse table with O(1) worst case access time , 1982, 23rd Annual Symposium on Foundations of Computer Science (sfcs 1982).

[28]  Rajeev Raman,et al.  Succinct Dynamic Dictionaries and Trees , 2003, ICALP.

[29]  Friedhelm Meyer auf der Heide,et al.  Efficient PRAM simulation on a distributed memory machine , 1992, STOC '92.

[30]  Martin Dietzfelbinger,et al.  Almost random graphs with simple hash functions , 2003, STOC '03.

[31]  Luca Aceto,et al.  A Fully Equational Proof of Parikh's Theorem , 2001 .

[32]  Friedhelm Meyer auf der Heide,et al.  A New Universal Class of Hash Functions and Dynamic Hashing in Real Time , 1990, ICALP.

[33]  Martti Penttonen,et al.  A Reliable Randomized Algorithm for the Closest-Pair Problem , 1997, J. Algorithms.

[34]  Jeanette P. Schmidt,et al.  The analysis of closed hashing under limited randomness , 1990, STOC '90.

[35]  R.M. Karp, M. Luby, F. Meyer auf der Hei Efficient PRAM simulation on a distributed memory machine , 1996 .

[36]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[37]  Alfred V. Aho,et al.  Storing a dynamic sparse table , 1986, 27th Annual Symposium on Foundations of Computer Science (sfcs 1986).

[38]  Andrei Z. Broder,et al.  Using multiple hash functions to improve IP lookups , 2001, Proceedings IEEE INFOCOM 2001. Conference on Computer Communications. Twentieth Annual Joint Conference of the IEEE Computer and Communications Society (Cat. No.01CH37213).

[39]  Larry Carter,et al.  Universal Classes of Hash Functions , 1979, J. Comput. Syst. Sci..

[40]  Ronald L. Rivest Optimal Arrangement of Keys in a Hash Table , 1978, JACM.

[41]  Rasmus Pagh,et al.  Lossy Dictionaries , 2001, ESA.

[42]  János Komlós,et al.  Storing a sparse table with O(1) worst case access time , 1982, 23rd Annual Symposium on Foundations of Computer Science (sfcs 1982).

[43]  Jeanette P. Schmidt,et al.  On aspects of university and performance for closed hashing , 1989, STOC '89.

[44]  Gaston H. Gonnet,et al.  Handbook of Algorithms , 1984 .