Skip to main content

Hash, Displace, and Compress

  • Conference paper
Book cover Algorithms - ESA 2009 (ESA 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5757))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Belazzougui, D., Botelho, F.C., Dietzfelbinger, M.: Hash, displace, and compress. Computer Research Repository (2009)

    Google Scholar 

  2. 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)

    Chapter  Google Scholar 

  3. 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)

    Google Scholar 

  4. Dietzel, L.: Speicherplatzeffiziente perfekte Hashfunktionen. Master’s thesis, Technische Universität Ilmenau (Novmber 2005) (in German)

    Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. 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)

    Google Scholar 

  7. Dietzfelbinger, M., Weidling, C.: Balanced allocation and dictionaries with tightly packed constant size bins. Theoretical Computer Science 380(1-2), 47–68 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  8. 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)

    Google Scholar 

  9. Ferragina, P., Venturini, R.: A simple storage scheme for strings achieving entropy bounds. Theoretical Computer Science 372(1), 115–121 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  10. 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)

    Article  MathSciNet  MATH  Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  12. 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)

    Chapter  Google Scholar 

  13. 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)

    Google Scholar 

  14. Mehlhorn, K.: Data Structures and Algorithms 1: Sorting and Searching. Springer, Heidelberg (1984)

    Book  MATH  Google Scholar 

  15. Mitzenmacher, M., Upfal, E.: Probability and Computing. Cambridge University Press, Cambridge (2005)

    Book  MATH  Google Scholar 

  16. 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)

    Chapter  Google Scholar 

  17. Radhakrishnan, J.: Improved bounds for covering complete uniform hypergraphs. Information Processing Letters 41, 203–207 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  18. Sanders, P.: Personal communication (2004)

    Google Scholar 

  19. Schmidt, J.P., Siegel, A.: The spatial complexity of oblivious k-probe hash functions. SIAM Journal on Computing 19(5), 775–786 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  20. Tarjan, R.E., Yao, A.C.C.: Storing a sparse table. Communications of the ACM 22(11), 606–611 (1979)

    Article  MathSciNet  MATH  Google Scholar 

  21. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics