Abstract
A hash function h, i.e., a function from the set U of all keys to the range range [m] = {0,...,m − 1} is called a perfect hash function (PHF) for a subset S ⊆ U of size n ≤ m if h is 1-1 on S. The important performance parameters of a PHF are representation size, evaluation time and construction time. In this paper, we present an algorithm that permits to obtain PHFs with expected representation size very close to optimal while retaining O(n) expected construction time and O(1) evaluation time in the worst case. For example in the case m = 1.23n we obtain a PHF that uses space 1.4 bits per key, and for m = 1.01n we obtain space 1.98 bits per key, which was not achievable with previously known methods. Our algorithm is inspired by several known algorithms; the main new feature is that we combine a modification of Pagh’s “hash-and-displace” approach with data compression on a sequence of hash function indices. Our algorithm can also be used for k-perfect hashing, where at most k keys may be mapped to the same value.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Belazzougui, D., Botelho, F.C., Dietzfelbinger, M.: Hash, displace, and compress. Computer Research Repository (2009)
Botelho, F.C., Pagh, R., Ziviani, N.: Simple and space-efficient minimal perfect hash functions. In: Dehne, F., Sack, J.-R., Zeh, N. (eds.) WADS 2007. LNCS, vol. 4619, pp. 139–150. Springer, Heidelberg (2007)
Chazelle, B., Kilian, J., Rubinfeld, R., Tal, A.: The bloomier filter: An efficient data structure for static support lookup tables. In: Proc. of the 15th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 30–39. SIAM, Philadelphia (2004)
Dietzel, L.: Speicherplatzeffiziente perfekte Hashfunktionen. Master’s thesis, Technische Universität Ilmenau (Novmber 2005) (in German)
Dietzfelbinger, M.: Design strategies for minimal perfect hash functions. In: Hromkovič, J., Královič, R., Nunkesser, M., Widmayer, P. (eds.) SAGA 2007. LNCS, vol. 4665, pp. 2–17. Springer, Heidelberg (2007)
Dietzfelbinger, M., Rink, M.: Applications of a splitting trick. In: Proc. of 36th International Colloquium on Automata, Languages and Programming. Springer, Heidelberg (to appear, 2009)
Dietzfelbinger, M., Weidling, C.: Balanced allocation and dictionaries with tightly packed constant size bins. Theoretical Computer Science 380(1-2), 47–68 (2007)
Erlingsson, U., Manasse, M., McSherry, F.: A cool and practical alternative to traditional hash tables. In: Proc. of the 7th Workshop on Distributed Data and Structures, pp. 1–6 (2006)
Ferragina, P., Venturini, R.: A simple storage scheme for strings achieving entropy bounds. Theoretical Computer Science 372(1), 115–121 (2007)
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)
Fredriksson, K., Nikitin, F.: Simple compression code supporting random access and fast string matching. In: Demetrescu, C. (ed.) WEA 2007. LNCS, vol. 4525, pp. 203–216. Springer, Heidelberg (2007)
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)
Litwin, W.: Linear hashing: a new tool for file and table addressing. In: Proc. of the 6th International Conference on Very Large Data Bases, pp. 212–223. VLDB Endowment (1980)
Mehlhorn, K.: Data Structures and Algorithms 1: Sorting and Searching. Springer, Heidelberg (1984)
Mitzenmacher, M., Upfal, E.: Probability and Computing. Cambridge University Press, Cambridge (2005)
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)
Radhakrishnan, J.: Improved bounds for covering complete uniform hypergraphs. Information Processing Letters 41, 203–207 (1992)
Sanders, P.: Personal communication (2004)
Schmidt, J.P., Siegel, A.: The spatial complexity of oblivious k-probe hash functions. SIAM Journal on Computing 19(5), 775–786 (1990)
Tarjan, R.E., Yao, A.C.C.: Storing a sparse table. Communications of the ACM 22(11), 606–611 (1979)
Vigna, S.: Broadword implementation of rank/select queries. In: Proc. of the 7th International Workshop on Efficient and Experimental Algorithms, pp. 154–168. ACM Press, New York (2008)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Belazzougui, D., Botelho, F.C., Dietzfelbinger, M. (2009). Hash, Displace, and Compress. In: Fiat, A., Sanders, P. (eds) Algorithms - ESA 2009. ESA 2009. Lecture Notes in Computer Science, vol 5757. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04128-0_61
Download citation
DOI: https://doi.org/10.1007/978-3-642-04128-0_61
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-04127-3
Online ISBN: 978-3-642-04128-0
eBook Packages: Computer ScienceComputer Science (R0)