Abstract
A perfect hash function (PHF) h: U →[0,m − 1] for a key set S is a function that maps the keys of S to unique values. The minimum amount of space to represent a PHF for a given set S is known to be approximately 1.44n 2/m bits, where n = |S|. In this paper we present new algorithms for construction and evaluation of PHFs of a given set (for m = n and m = 1.23n), with the following properties:
-
1
Evaluation of a PHF requires constant time.
-
1
The algorithms are simple to describe and implement, and run in linear time.
-
1
The amount of space needed to represent the PHFs is around a factor 2 from the information theoretical minimum.
No previously known algorithm has these properties. To our knowledge, any algorithm in the literature with the third property either:
-
Requires exponential time for construction and evaluation, or
-
Uses near-optimal space only asymptotically, for extremely large n.
Thus, our main contribution is a scheme that gives low space usage for realistic values of n. The main technical ingredient is a new way of basing PHFs on random hypergraphs. Previously, this approach has been used to design simple PHFs with superlinear space usage.
This work was supported in part by GERINDO Project–grant MCT/CNPq/CT-INFO 552.087/02-5, and CNPq Grants 30.5237/02-0 (Nivio Ziviani) and 142786/ 2006-3 (Fabiano C. Botelho).
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
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.
References
Alon, N., Dietzfelbinger, M., Miltersen, P.B., Petrank, E., Tardos, G.: Linear hash functions. Journal of the ACM 46(5), 667–683 (1999)
Alon, N., Naor, M.: Derandomization, witnesses for Boolean matrix multiplication and construction of perfect hash functions. Algorithmica 16(4-5), 434–449 (1996)
Botelho, F.C., Kohayakawa, Y., Ziviani, N.: A practical minimal perfect hashing method. In: Nikoletseas, S.E. (ed.) WEA 2005. LNCS, vol. 3503, pp. 488–500. Springer, Heidelberg (2005)
Czech, Z.J., Havas, G., Majewski, B.S.: Fundamental study perfect hashing. Theoretical Computer Science 182, 1–143 (1997)
Dietzfelbinger, M., Hagerup, T.: Simple minimal perfect hashing in less space. In: Meyer auf der Heide, F. (ed.) ESA 2001. LNCS, vol. 2161, pp. 109–120. Springer, Heidelberg (2001)
Dietzfelbinger, M., Weidling, C.: Balanced allocation and dictionaries with tightly packed constant size bins. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 166–178. Springer, Heidelberg (2005)
Fox, E.A., Chen, Q.F., Heath, L.S.: A faster algorithm for constructing minimal perfect hash functions. In: Proc. of the 15th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 266–273 (1992)
Fox, E.A., Heath, L.S., Chen, Q., Daoud, A.M.: Practical minimal perfect hash functions for large databases. Communications of the ACM 35(1), 105–121 (1992)
Fredman, M.L., Komlós, J.: On the size of separating systems and families of perfect hashing functions. SIAM Journal on Algebraic and Discrete Methods 5, 61–68 (1984)
Fredman, M.L., Komlós, J., Szemerédi, E.: Storing a sparse table with O(1) worst case access time. Journal of the ACM 31(3), 538–544 (1984)
Hagerup, T., Tholey, T.: Efficient minimal perfect hashing in nearly minimal space. In: Ferreira, A., Reichel, H. (eds.) STACS 2001. LNCS, vol. 2010, pp. 317–326. Springer, Heidelberg (2001)
Janson, S.: Poisson convergence and poisson processes with applications to random graphs. Stochastic Processes and their Applications 26, 1–30 (1987)
Lefebvre, S., Hoppe, H.: Perfect spatial hashing. ACM Transactions on Graphics 25(3), 579–588 (2006)
Majewski, B.S., Wormald, N.C., Havas, G., Czech, Z.J.: A family of perfect hashing methods. The Computer Journal 39(6), 547–554 (1996)
Mehlhorn, K.: Data Structures and Algorithms 1: Sorting and Searching. Springer, Heidelberg (1984)
Pagh, R.: Hash and displace: Efficient evaluation of minimal perfect hash functions. In: Dehne, F., Gupta, A., Sack, J.-R., Tamassia, R. (eds.) WADS 1999. LNCS, vol. 1663, pp. 49–54. Springer, Heidelberg (1999)
Pagh, R.: Low redundancy in static dictionaries with constant query time. SIAM Journal on Computing 31(2), 353–363 (2001)
Radhakrishnan, J.: Improved bounds for covering complete uniform hypergraphs. Information Processing Letters 41, 203–207 (1992)
Schmidt, J.P., Siegel, A.: The spatial complexity of oblivious k-probe hash functions. SIAM Journal on Computing 19(5), 775–786 (1990)
Woelfel, P.: Maintaining external memory efficient hash tables. In: Díaz, J., Jansen, K., Rolim, J.D.P., Zwick, U. (eds.) APPROX 2006 and RANDOM 2006. LNCS, vol. 4110, pp. 508–519. Springer, Heidelberg (2006)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Botelho, F.C., Pagh, R., Ziviani, N. (2007). Simple and Space-Efficient Minimal Perfect Hash Functions . In: Dehne, F., Sack, JR., Zeh, N. (eds) Algorithms and Data Structures. WADS 2007. Lecture Notes in Computer Science, vol 4619. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-73951-7_13
Download citation
DOI: https://doi.org/10.1007/978-3-540-73951-7_13
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-73948-7
Online ISBN: 978-3-540-73951-7
eBook Packages: Computer ScienceComputer Science (R0)