Advertisement

Mathematics in Computer Science

, Volume 3, Issue 1, pp 47–60 | Cite as

An Improved Version of Cuckoo Hashing: Average Case Analysis of Construction Cost and Search Operations

  • Reinhard KutzelniggEmail author
Article

Abstract

Cuckoo hashing is a hash table data structure introduced by Pagh and Rodler, that offers constant worst case search time. As a major contribution of this paper, we analyze modified versions of this algorithm with improved performance. Further, we provide an asymptotic analysis of the search costs of all these variants of cuckoo hashing and compare these results with the well known properties of double hashing and linear probing. The analysis is supported by numerical results. Finally, our analysis shows, that the expected number of steps of search operations can be reduced by using a modified version of cuckoo hashing instead of standard algorithms based on open addressing.

Keywords

Hashing Cuckoo hashing Open addressing Algorithms 

Mathematics Subject Classification (2000)

Primary 68W40 Secondary 05A16 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Azar Y., Broder A.Z., Karlin A.R., Upfal E.: Balanced allocations. SIAM J. Comput. 29(1), 180–200 (1999)MathSciNetzbMATHCrossRefGoogle Scholar
  2. 2.
    Black, J.R., Martel, C.U., Qi, H.: Graph and hashing algorithms for modern architectures: design and performance. In: WAE ’92, Saarbrücken, Germany, August 20–22, 1998, Proceedings, Max-Planck-Institut für Informatik, pp. 37–48 (1998)Google Scholar
  3. 3.
    Brent R.P.: Reducing the retrieval time of scatter storage techniques. Commun. ACM 16(2), 105–109 (1973)MathSciNetzbMATHCrossRefGoogle Scholar
  4. 4.
    Broder, A.Z., Mitzenmacher, M.: Using multiple hash functions to improve ip lookups. In: INFOCOM, pp. 1454–1463 (2001)Google Scholar
  5. 5.
    Carter L., Wegman M.N.: Universal classes of hash functions. J. Comput. Syst. Sci. 18(2), 143–154 (1979)MathSciNetzbMATHCrossRefGoogle Scholar
  6. 6.
    Cormen T.H., Leiserson C.E., Rivest R.L., Stein C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge (2001)zbMATHGoogle Scholar
  7. 7.
    Czech Z.J., Havas G., Majewski B.S.: Perfect hashing. Theor. Comput. Sci. 182(1/2), 1–143 (1997)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Dalal K., Devroye L., Malalla E., McLeis E.: Two-way chaining with reassignment. SIAM J. Comput. 35(2), 327–340 (2005)MathSciNetzbMATHCrossRefGoogle Scholar
  9. 9.
    Devroye L., Morin P.: Cuckoo hashing: further analysis. Inf. Process. Lett. 86(4), 215–219 (2003)MathSciNetzbMATHCrossRefGoogle Scholar
  10. 10.
    Dietzfelbinger, M., Gil, J., Matias, Y., Pippenger, N.: Polynomial hash functions are reliable (extended abstract). In: ICALP ’92, vol. 623 of LNCS, pp. 235–246. Springer (1992)Google Scholar
  11. 11.
    Dietzfelbinger, M., Schellbach, U.: On risks of using cuckoo hashing with simple universal hash classes. In: Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 795–804. SIAM (2009)Google Scholar
  12. 12.
    Dietzfelbinger M., Weidling C.: Balanced allocation and dictionaries with tightly packed constant size bins. Theor. Comput. Sci. 380(1/2), 47–68 (2007)MathSciNetzbMATHCrossRefGoogle Scholar
  13. 13.
    Dietzfelbinger, M., Woelfel, P.: Almost random graphs with simple hash functions. In: STOC ’03: Proceedings of the Thirty-fifth Annual ACM Symposium on Theory of computing, pp. 629–638. ACM (2003)Google Scholar
  14. 14.
    Drmota M.: A bivariate asymptotic expansion of coefficients of powers of generating functions. Eur. J. Comb. 15(2), 139–152 (1994)MathSciNetzbMATHCrossRefGoogle Scholar
  15. 15.
    Drmota, M., Kutzelnigg, R.: A precise analysis of cuckoo hashing. ACM Trans. Algorithms, page submitted (2009)Google Scholar
  16. 16.
    Flajolet P., Sedgewick R.: Analytic Combinatorics. Cambridge University Press, Cambridge (2009)zbMATHCrossRefGoogle Scholar
  17. 17.
    Fotakis D., Pagh R., Sanders P., Spirakis P.G.: Space efficient hash tables with worst case constant access time. Theory Comput. Syst. 38(2), 229–248 (2005)MathSciNetzbMATHCrossRefGoogle Scholar
  18. 18.
    Fredman M.L., Komlós J., Szemerédi E.: Storing a sparse table with O(1) worst case access time. J. ACM 31(3), 538–544 (1984)zbMATHCrossRefGoogle Scholar
  19. 19.
    Gardy D.: Some results on the asymptotic behaviour of coefficients of large powers of functions. Discret. Math. 139(1–3), 189–217 (1995)MathSciNetzbMATHCrossRefGoogle Scholar
  20. 20.
    Gimenez O., de Mier A., Noy M.: On the number of bases of bicircular matroids. Ann. Combinatorics 9(1), 35–45 (2005)zbMATHCrossRefGoogle Scholar
  21. 21.
    Gonnet G.H., Baeza-Yates R.: Handbook of Algorithms and Data Structures 2nd edn. Pascal, Addison-Wesley, Boston (1991)Google Scholar
  22. 22.
    Gonnet, G.H., Ian Munro, J.: The analysis of an improved hashing technique. In: Conference Record of the Ninth Annual ACM Symposium on Theory of Computing, 2–4 May 1977, Boulder, Colorado, USA, pp. 113–121. ACM (1977)Google Scholar
  23. 23.
    Good I.J.: Saddle-point methods for the multinomial distribution. Ann. Math. Stat. 28(4), 861–881 (1957)MathSciNetCrossRefGoogle Scholar
  24. 24.
    Heileman, G.L., Luo, W.: How caching affects hashing. In: ALENEX/ANALCO 2005, Vancouver, BC, Canada, 22 January 2005, pp. 141–154. SIAM (2005)Google Scholar
  25. 25.
    Janson S., Knuth D.E., Łuczak T., Pittel B.: The birth of the giant component. Random Struct. Algorithm. 4(3), 233–359 (1993)zbMATHCrossRefGoogle Scholar
  26. 26.
    Kirsch, A., Mitzenmacher, M., Wieder, U.: More robust hashing: Cuckoo hashing with a stash. In: Proceedings of the 16th Annual European Symposium on Algorithms (2008)Google Scholar
  27. 27.
    Knuth D.E.: The Art of Computer Programming, vol. 3: Sorting and Searching. 2nd edn. Addison-Wesley, Boston (1998)Google Scholar
  28. 28.
    Kutzelnigg, R.: Bipartite random graphs and cuckoo hashing. In: Proceedings of the 4th Colloquium on Mathematics and Computer Science, Discrete Mathematics and Theoretical Computer Science, pp. 403–406 (2006)Google Scholar
  29. 29.
    Kutzelnigg, R.: An improved version of cuckoo hashing: average case analysis of construction cost and search operations. In: Proceedings of the 19th Internatinal Workshop on Combinatorial Algoritms, pp. 253–266 (2008)Google Scholar
  30. 30.
    Kutzelnigg, R.: Random bipartite graphs and their application to Cuckoo Hashing. PhD thesis, Vienna University of Technology (2008)Google Scholar
  31. 31.
    Kutzelnigg, R.: Random Graphs and Cuckoo Hashing. Südwestdeutscher Verlag für Hochschulschriften, Saarbrücken (2009)Google Scholar
  32. 32.
    Pagh R., Rodler F.F.: Cuckoo hashing. J. Algorithm. 51(2), 122–144 (2004)MathSciNetzbMATHCrossRefGoogle Scholar
  33. 33.
    Tran, T.N., Kittitornkun, S.: Fpga-based cuckoo hashing for pattern matching in nids/nips. In: APNOMS, pp. 334–343 (2007)Google Scholar
  34. 34.
    Vöcking B.: How asymmetry helps load balancing. J. ACM 50(4), 568–589 (2003)MathSciNetCrossRefGoogle Scholar

Copyright information

© Birkhäuser Verlag Basel/Switzerland 2009

Authors and Affiliations

  1. 1.Institute of Discrete Mathematics and GeometryVienna University of TechnologyViennaAustria

Personalised recommendations