Efficient Minimal Perfect Hashing in Nearly Minimal Space

  • Torben Hagerup
  • Torsten Tholey
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2010)


We consider the following problem: Given a subset S of size n of a universe {0, … ,u-1}, construct a minimal perfect hash function for S, i.e., a bijection h from S to {0, … ,n-1}. The parameters of interest are the space needed to store h, its evaluation time, and the time required to compute h from S. The number of bits needed for the representation of h, ignoring the other parameters, has been thoroughly studied and is known to be n log e + log log u ± O(log n), where “log” denotes the binary logarithm. A construction by Schmidt and Siegel uses O(n + log logu) bits and offers constant evaluation time, but the time to find h is not discussed. We present a simple randomized scheme that uses n log e+log log u+o(n+log log u) bits and has constant evaluation time and O(n + log log u) expected construction time.


Computational and structural complexity algorithms and data structures perfect hashing sparse tables space complexity 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    J. L. Carter and M. N. Wegman, Universal Classes of Hash Functions, J. Comput. System Sci. 18 (1979), pp. 143–154.MATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    M. Dietzfelbinger and F. Meyer auf der Heide, A new universal class of hash functions and dynamic hashing in real time, Proc. 17th International Colloquium on Automata, Languages and Programming (ICALP 1990), Lecture Notes in Computer Science, Vol. 443, Springer-Verlag, Berlin, pp. 6–19.CrossRefGoogle Scholar
  3. 3.
    M. L. Fredman and J. Komlós, On the size of separating systems and families of perfect hash functions, SIAM J. Alg. Disc. Meth. 5 (1984), pp. 61–68.MATHCrossRefGoogle Scholar
  4. 4.
    M. L. Fredman, J. Komlós and E. Szemerédi, Storing a sparse table with O(1) worst case access time, J. ACM 31 (1984), pp. 538–544.MATHCrossRefGoogle Scholar
  5. 5.
    T. Hagerup, Sorting and searching on the word RAM, Proc. 15th Annual Symposium on Theoretical Aspects of Computer Science (STACS 1998), Lecture Notes in Computer Science, Vol. 1373, Springer-Verlag, Berlin, pp. 366–398.Google Scholar
  6. 6.
    M. Hofri, Probabilistic Analysis of Algorithms, Springer-Verlag, New York, 1987.MATHGoogle Scholar
  7. 7.
    C. P. Kruskal, L. Rudolph and M. Snir, A complexity theory of efficient parallel algorithms, Theoret. Comput. Sci. 71, (1990), pp. 95–132.MATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    K. Mehlhorn, Data Structures and Algorithms, Vol. 1: Sorting and Searching, Springer-Verlag, Berlin, 1984.Google Scholar
  9. 9.
    M. O. Rabin, Probabilistic algorithm for testing primality. J. Number Theory 12, (1980), pp. 128–138.MATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    J. Radhakrishnan, Improved bounds for covering complete uniform hypergraphs, Inform. Process. Lett. 41 (1992), pp. 203–207.MATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    J. P. Schmidt and A. Siegel, The spatial complexity of oblivious k-probe hash functions, SIAM J. Comput. 19 (1990), pp. 775–786.MATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    A. Siegel, On universal classes of fast high performance hash functions, their timespace tradeoff, and their applications, Proc. 30th Annual IEEE Symposium on Foundations of Computer Science (FOCS 1989), pp. 20–25.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Torben Hagerup
    • 1
  • Torsten Tholey
    • 1
  1. 1.Institut für InformatikJohann Wolfgang Goethe-Universität FrankfurtFrankfurt am MainGermany

Personalised recommendations