A Practical Minimal Perfect Hashing Method

  • Fabiano C. Botelho
  • Yoshiharu Kohayakawa
  • Nivio Ziviani
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3503)


We propose a novel algorithm based on random graphs to construct minimal perfect hash functions h. For a set of n keys, our algorithm outputs h in expected time O(n). The evaluation of h(x) requires two memory accesses for any key x and the description of h takes up 1.15n words. This improves the space requirement to 55% of a previous minimal perfect hashing scheme due to Czech, Havas and Majewski. A simple heuristic further reduces the space requirement to 0.93n words, at the expense of a slightly worse constant in the time complexity. Large scale experimental results are presented.


Hash Function Random Graph Space Requirement Giant Component Random Integer 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bollobás, B.: Random graphs, 2nd edn. Cambridge Studies in Advanced Mathematics, vol. 73. Cambridge University Press, Cambridge (2001)zbMATHGoogle Scholar
  2. 2.
    Bollobás, B., Pikhurko, O.: Integer sets with prescribed pairwise differences being distinct. European Journal of Combinatorics (to appear)Google Scholar
  3. 3.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge (2001)zbMATHGoogle Scholar
  4. 4.
    Czech, Z.J., Havas, G., Majewski, B.S.: An optimal algorithm for generating minimal perfect hash functions. Information Processing Letters 43(5), 257–264 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Czech, Z.J., Havas, G., Majewski, B.S.: Fundamental study perfect hashing. Theoretical Computer Science 182, 1–143 (1997)zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Dietzfelbinger, M., Hagerup, T.: Simple minimal perfect hashing in less space. In: Meyer auf der Heide, F. (ed.) ESA 2001, vol. 2161, pp. 109–120. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  7. 7.
    Erdős, P., Rényi, A.: On random graphs I. Pub. Math. Debrecen 6, 290–297 (1959)Google Scholar
  8. 8.
    Erdős, P., Rényi, A.: On the evolution of random graphs. Magyar Tud. Akad. Mat. Kutató Int. Közl. 5, 17–61 (1960)Google Scholar
  9. 9.
    Fox, E.A., Chen, Q.F., Heath, L.S.: A faster algorithm for constructing minimal perfect hash functions. In: Proceedings of the 15th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 266–273 (1992)Google Scholar
  10. 10.
    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
  11. 11.
    Havas, G., Majewski, B.S., Wormald, N.C., Czech, Z.J.: Graphs, hypergraphs and hashing. In: van Leeuwen, J. (ed.) WG 1993, vol. 790, pp. 153–165. Springer, Heidelberg (1994)Google Scholar
  12. 12.
    Janson, S., Łuczak, T., Ruciński, A.: Random graphs. Wiley-Inter., Chichester (2000)zbMATHGoogle Scholar
  13. 13.
    Erdős, P., Rényi, A.: On the strength of connectedness of a random graph. Acta Mathematica Scientia Hungary 12, 261–267 (1961)CrossRefGoogle Scholar
  14. 14.
    Pagh, R.: Hash and displace: Efficient evaluation of minimal perfect hash functions. In: Workshop on Algorithms and Data Structures, pp. 49–54 (1999)Google Scholar
  15. 15.
    Pittel, B., Wormald, N.C.: Counting connected graphs inside-out. Journal of Combinatorial Theory (to appear)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Fabiano C. Botelho
    • 1
  • Yoshiharu Kohayakawa
    • 2
  • Nivio Ziviani
    • 1
  1. 1.Dept. of Computer ScienceFederal Univ. of Minas GeraisBelo HorizonteBrazil
  2. 2.Dept. of Computer ScienceUniv. of São PauloSão PauloBrazil

Personalised recommendations