随机化算法常采用可能失败的方法,并以独立随机性重试直至成功。因此,随机化数据结构通常存储成功尝试的索引,称为种子。如果需要 n 个这样的种子(例如用于独立子结构),标准做法是对每个 i ∈ [n] 计算最小的成功种子 S_i,并存储向量 S = (S_1, …, S_n)。本文的核心观察是这种做法并非空间最优。我们提出一种不同的算法,计算成功种子序列 S' = (S_1', …, S_n'),使得在大多数情况下 S' 的熵比 S 的熵少 Ω(n) 比特。为实现 OPT + εn 的内存消耗,检查种子的期望数量增加 O(1/ε) 倍。我们通过一种新颖的最小完美哈希函数构造展示了研究结果的实用性:对于 n 个键和任意 ε ∈ [n^{-3/7}, 1],其空间需求为 (1+ε)OPT,构造时间为 O(n/ε)。所有先前方法仅支持 ε = ω(1 / log n),或构造时间随 1/ε 呈指数增长。在 ε ≤ 3% 时,我们的实现将构造吞吐量提升至现有最优水平的两倍以上(即超过两个数量级)。
英文摘要:
Randomised algorithms often employ methods that can fail and that are retried with independent randomness until they succeed. Randomised data structures therefore often store indices of successful attempts, called seeds. If $n$ such seeds are required (e.g., for independent substructures) the standard approach is to compute for each $i \in [n]$ the smallest successful seed $S_i$ and store $\vec{S} = (S_1, \ldots, S_n)$.
The central observation of this paper is that this is not space-optimal. We present a different algorithm that computes a sequence $\vec{S}' = (S_1', \ldots, S_n')$ of successful seeds such that the entropy of $\vec{S'}$ undercuts the entropy of $\vec{S}$ by $Ω(n)$ bits in most cases. To achieve a memory consumption of $\mathrm{OPT}+\varepsilon n$, the expected number of inspected seeds increases by a factor of $O(1/\varepsilon)$.
We demonstrate the usefulness of our findings with a novel construction for minimal perfect hash functions that, for $n$ keys and any $\varepsilon \in [n^{-3/7}, 1]$, has space requirement $(1+\varepsilon)\mathrm{OPT}$ and construction time $O(n/\varepsilon)$. All previous approaches only support $\varepsilon = ω(1 / \log n)$ or have construction times that increase exponentially with $1/\varepsilon$. Our implementation beats the construction throughput of the state of the art by more than two orders of magnitude for $\varepsilon \leq 3\%$.
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^{…
A Fast Algorithm for Determining the Existence and Value of Integer Roots of N
我们证明了所有不能被3整除的完全奇数平方都可以有效地写成sqrt(N)= a +18 p,其中常数a由N的基本性质决定.该方程可以通过仅基于整数运算的高效四步算法确定性地求解。不需要乘或除多位整数,算法也不需要种子值。当N是一个完满平方时,它找到整数p,当算法没有解而终止时,它证明N是非平方的。迭代次数的比例近似为平方根的log(sqrt(N)/2)。本文还概述了如何讨论的平方的方法之一,可以扩展到找到一个任意根的N。最后,我们提出了一个规则,区分产品的孪生素数平方。
Discovering Data Structures: Nearest Neighbor Search and Beyond
Université de Montréal(蒙特利尔大学);Mila;HEC Montréal(蒙特利尔高等商学院);Microsoft Research(微软研究院);University of Southern California(南加州大学);Stanford University(斯坦福大学)