arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2607.16390cs.DS

开放地址哈希表中的局部性

Locality in Open Addressing Hash Tables

Or Zamir

AI总结:

研究开放地址哈希表的局部性参数,证明无重排算法在各负载下无法同时实现\(o(1/\varepsilon^2)\)局部性等下限,给出预先知道目标负载时的上限及负载无关贪婪方案等上限,补充了相关性能界限。

AI中文摘要:

无重排的开放地址哈希表,如线性探测和均匀探测,是最简单且应用最广泛的数据结构之一,传统上用探测次数衡量其性能。本文研究一个补充参数:局部性,即从首次探测位置到最远检查或使用单元的几何距离。在负载因子为\(1 - \varepsilon\)时,均匀探测在贪婪方案中实现了最优的\(\Theta(1/\varepsilon)\)探测次数,但基本没有局部性,而线性探测局部性高但探测次数为\(\Theta(1/\varepsilon^2)\)。本文证明这种二次局部性规模是基本的:没有无重排的开放地址算法能在每个负载\(1 - \varepsilon\)下同时实现\(o(1/\varepsilon^2)\)的局部性。还证明了在任何\((1 - \varepsilon)n\)次插入序列上的摊销期望局部性下限为\(\Omega(1/\varepsilon)\)。通过两个上限补充了这些下限。当预先知道目标负载时,每次插入以及每次成功或不成功的搜索都可以给出期望探测次数和局部性\(\widetilde O(1/\varepsilon)\),基本上消除了摊销下限。还给出了一种负载无关的贪婪方案,其期望探测次数最优为\(\Theta(1/\varepsilon)\),其第\(i\)次探测与首次探测的距离为\(O(i^2)\)。其分析给出了对称探测方案中占用单元密度的一般方差界,意味着对于每个固定移位探测序列和每个负载\(1 - \varepsilon\),期望探测界为\(O(\log n/\varepsilon^2)\)。

英文摘要:

Open-addressed hash tables without reordering, such as linear probing and uniform probing, are among the simplest and most widely used data structures. Their performance is traditionally measured by probe count. We study a complementary parameter: locality, defined as the geometric distance from the first probed location to the farthest cell inspected or used. At load factor $1-\varepsilon$, uniform probing achieves the optimal $Θ(1/\varepsilon)$ probe count among greedy schemes, but has essentially no locality, whereas linear probing is highly local but performs $Θ(1/\varepsilon^2)$ probes. We show that this quadratic locality scale is fundamental: no open-addressing algorithm without reordering can achieve locality $o(1/\varepsilon^2)$ simultaneously at every load $1-\varepsilon$. We also prove an amortized expected-locality lower bound of $Ω(1/\varepsilon)$ over any sequence of $(1-\varepsilon)n$ insertions, even when the final load is known in advance. Our lower bound further implies that page size $B=Ω(1/\varepsilon^2)$ is necessary for $1+o(1)$ expected page span in immutable open addressing. We complement these lower bounds with two upper bounds. When the target load is known in advance, every insertion and every successful or unsuccessful search can be given expected probe count and locality $\widetilde O(1/\varepsilon)$, essentially deamortizing the amortized lower bound. We also give a load-oblivious greedy scheme with optimal expected probe count $Θ(1/\varepsilon)$ whose $i$-th probe is at distance $O(i^2)$ from the first probe. Its analysis gives a general variance bound for occupied-cell densities in symmetric probing schemes, implying an $O(\log n/\varepsilon^2)$ expected probe bound for every fixed-shift probing sequence and every load $1-\varepsilon$.

↑