Perfect hash functions can potentially be used to compress data in connection with a variety of data management tasks. Though there has been considerable work on how to construct good perfect hash functions, there is a gap between theory and practice among all previous methods on minimal perfect hashing. On one side, there are good theoretical results without experimentally proven practicality for large key sets. On the other side, there are the theoretically analyzed time and space usage algorithms that assume that truly random hash functions are available for free, which is an unrealistic assumption. In this paper we attempt to bridge this gap between theory and practice, using a number of techniques from the literature to obtain a novel scheme that is theoretically well-understood and at the same time achieves an order-of-magnitude increase in performance compared to previous ``practical'' methods. This improvement comes from a combination of a novel, theoretically optimal perfect hashing scheme that greatly simplifies previous methods, and the fact that our algorithm is designed to make good use of the memory hierarchy. We demonstrate the scalability of our algorithm by considering a set of over one billion URLs from the World Wide Web of average length 64, for which we construct a minimal perfect hash function on a commodity PC in a little more than 1 hour. Our scheme produces minimal perfect hash functions using slightly more than 3 bits per key. For perfect hash functions in the range $\{0,...,2n-1\}$ the space usage drops to just over 2 bits per key (i.e., one bit more than optimal for representing the key). This is significantly below of what has been achieved previously for very large values of $n$.
Karlsruhe Institute of Technology(卡尔斯鲁厄理工学院);BARC, University of Copenhagen(哥本哈根大学 BARC);Ca’ Foscari University of Venice(威尼斯大学);Università degli Studi di Milano(米兰大学)
单调最小完美散列函数(MMPHF)问题是下面的索引问题。给定一组$S= \{s_1,\ldots,s_n\}$,其中$n$是来自大小为$u$的全域$U$的不同键,创建一个回答以下查询的数据结构$DS$:\[ RankOp(q) = \text{rank of } q \text{ in } S \text{ for all } q\in S ~\text{ and arbitrary answer otherwise.} \] MMPHF问题的解决方案在理论和实践中都有广泛的应用。该问题已知的最佳上限是以$O(n\log\log\log u)$位对$DS$进行编码,并在$O(\log u)$时间内执行查询。这一直是一个开放的问题,无论是提高空间上界或显示,这个有点奇怪的外观界是紧的。在本文中,我们表明后者:具体地说,任何数据结构(确定性或随机)的单调最小完美哈希的任何集合的$n$元素从宇宙的大小$u$需要$Ω(n \cdot \log\log\log{u})$预期位正确地回答每个查询。我们通过定义一个图$\mathbf{G}$来实现我们的下界,其中节点是可能的${u \choose n}$输入,并且如果两个节点不能共享相同的$DS$,则它们是相邻的。$DS$的大小则由$\mathbf{G}$的色数的对数下界。最后,我们证明了$\mathbf{G}$的分数色数(从而色数)是由$2^{…