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.
Similar content being viewed by others
References
Azar Y., Broder A.Z., Karlin A.R., Upfal E.: Balanced allocations. SIAM J. Comput. 29(1), 180–200 (1999)
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)
Brent R.P.: Reducing the retrieval time of scatter storage techniques. Commun. ACM 16(2), 105–109 (1973)
Broder, A.Z., Mitzenmacher, M.: Using multiple hash functions to improve ip lookups. In: INFOCOM, pp. 1454–1463 (2001)
Carter L., Wegman M.N.: Universal classes of hash functions. J. Comput. Syst. Sci. 18(2), 143–154 (1979)
Cormen T.H., Leiserson C.E., Rivest R.L., Stein C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge (2001)
Czech Z.J., Havas G., Majewski B.S.: Perfect hashing. Theor. Comput. Sci. 182(1/2), 1–143 (1997)
Dalal K., Devroye L., Malalla E., McLeis E.: Two-way chaining with reassignment. SIAM J. Comput. 35(2), 327–340 (2005)
Devroye L., Morin P.: Cuckoo hashing: further analysis. Inf. Process. Lett. 86(4), 215–219 (2003)
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)
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)
Dietzfelbinger M., Weidling C.: Balanced allocation and dictionaries with tightly packed constant size bins. Theor. Comput. Sci. 380(1/2), 47–68 (2007)
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)
Drmota M.: A bivariate asymptotic expansion of coefficients of powers of generating functions. Eur. J. Comb. 15(2), 139–152 (1994)
Drmota, M., Kutzelnigg, R.: A precise analysis of cuckoo hashing. ACM Trans. Algorithms, page submitted (2009)
Flajolet P., Sedgewick R.: Analytic Combinatorics. Cambridge University Press, Cambridge (2009)
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)
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)
Gardy D.: Some results on the asymptotic behaviour of coefficients of large powers of functions. Discret. Math. 139(1–3), 189–217 (1995)
Gimenez O., de Mier A., Noy M.: On the number of bases of bicircular matroids. Ann. Combinatorics 9(1), 35–45 (2005)
Gonnet G.H., Baeza-Yates R.: Handbook of Algorithms and Data Structures 2nd edn. Pascal, Addison-Wesley, Boston (1991)
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)
Good I.J.: Saddle-point methods for the multinomial distribution. Ann. Math. Stat. 28(4), 861–881 (1957)
Heileman, G.L., Luo, W.: How caching affects hashing. In: ALENEX/ANALCO 2005, Vancouver, BC, Canada, 22 January 2005, pp. 141–154. SIAM (2005)
Janson S., Knuth D.E., Łuczak T., Pittel B.: The birth of the giant component. Random Struct. Algorithm. 4(3), 233–359 (1993)
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)
Knuth D.E.: The Art of Computer Programming, vol. 3: Sorting and Searching. 2nd edn. Addison-Wesley, Boston (1998)
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)
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)
Kutzelnigg, R.: Random bipartite graphs and their application to Cuckoo Hashing. PhD thesis, Vienna University of Technology (2008)
Kutzelnigg, R.: Random Graphs and Cuckoo Hashing. Südwestdeutscher Verlag für Hochschulschriften, Saarbrücken (2009)
Pagh R., Rodler F.F.: Cuckoo hashing. J. Algorithm. 51(2), 122–144 (2004)
Tran, T.N., Kittitornkun, S.: Fpga-based cuckoo hashing for pattern matching in nids/nips. In: APNOMS, pp. 334–343 (2007)
Vöcking B.: How asymmetry helps load balancing. J. ACM 50(4), 568–589 (2003)
Author information
Authors and Affiliations
Corresponding author
Additional information
The author was supported by EU FP6-NEST-Adventure Programme, Contract number 028875 (NEMO) and by the Austrian Science Foundation FWF, project S9604, that is part of the Austrian National Research Network “Analytic Combinatorics and Probabilistic Number Theory”.
Rights and permissions
About this article
Cite this article
Kutzelnigg, R. An Improved Version of Cuckoo Hashing: Average Case Analysis of Construction Cost and Search Operations. Math.Comput.Sci. 3, 47–60 (2010). https://doi.org/10.1007/s11786-009-0005-x
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11786-009-0005-x