English

PTHash: Revisiting FCH Minimal Perfect Hashing

Data Structures and Algorithms 2022-02-08 v2

Abstract

Given a set SS of nn distinct keys, a function ff that bijectively maps the keys of SS into the range {0,,n1}\{0,\ldots,n-1\} is called a minimal perfect hash function for SS. Algorithms that find such functions when nn is large and retain constant evaluation time are of practical interest; for instance, search engines and databases typically use minimal perfect hash functions to quickly assign identifiers to static sets of variable-length keys such as strings. The challenge is to design an algorithm which is efficient in three different aspects: time to find ff (construction time), time to evaluate ff on a key of SS (lookup time), and space of representation for ff. Several algorithms have been proposed to trade-off between these aspects. In 1992, Fox, Chen, and Heath (FCH) presented an algorithm at SIGIR providing very fast lookup evaluation. However, the approach received little attention because of its large construction time and higher space consumption compared to other subsequent techniques. Almost thirty years later we revisit their framework and present an improved algorithm that scales well to large sets and reduces space consumption altogether, without compromising the lookup time. We conduct an extensive experimental assessment and show that the algorithm finds functions that are competitive in space with state-of-the art techniques and provide 24×2-4\times better lookup time.

Keywords

Cite

@article{arxiv.2104.10402,
  title  = {PTHash: Revisiting FCH Minimal Perfect Hashing},
  author = {Giulio Ermanno Pibiri and Roberto Trani},
  journal= {arXiv preprint arXiv:2104.10402},
  year   = {2022}
}

Comments

Accepted to SIGIR 2021