A Monotone Minimal Perfect Hash Function (MMPHF) constructed on a set S of keys is a function that maps each key in S to its rank. On keys not in S, the function returns an arbitrary value. Applications range from databases, search engines, data encryption, to pattern-matching algorithms.
In this paper, we describe LeMonHash, a new technique for constructing MMPHFs for integers. The core idea of LeMonHash is surprisingly simple and effective: we learn a monotone mapping from keys to their rank via an error-bounded piecewise linear model (the PGM-index), and then we solve the collisions that might arise among keys mapping to the same rank estimate by associating small integers with them in a retrieval data structure (BuRR). On synthetic random datasets, LeMonHash needs 34% less space than the next larger competitor, while achieving about 16 times faster queries. On real-world datasets, the space usage is very close to or much better than the best competitors, while achieving up to 19 times faster queries than the next larger competitor. As far as the construction of LeMonHash is concerned, we get an improvement by a factor of up to 2, compared to the competitor with the next best space usage.
We also investigate the case of keys being variable-length strings, introducing the so-called LeMonHash-VL: it needs space within 13% of the best competitors while achieving up to 3 times faster queries than the next larger competitor.
单调最小完美散列函数(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^{…
Karlsruhe Institute of Technology(卡尔斯鲁厄理工学院);BARC, University of Copenhagen(哥本哈根大学 BARC);Ca’ Foscari University of Venice(威尼斯大学);Università degli Studi di Milano(米兰大学)