Skip to main content
QUICK REVIEW

[论文解读] Incremental Edge Orientation in Forests

Michael A. Bender, Bradley C. Kuszmaul|arXiv (Cornell University)|Jan 1, 2021
Caching and Content Delivery参考文献 118被引用 2
一句话总结

本文提出墓地哈希(graveyard hashing),一种新型线性探测变体,通过战略性地使用墓碑(tombstones)实现反聚类效应,从而消除主聚类。通过谨慎管理删除操作(使用墓碑而非立即压缩),作者证明即使在接近 1−1/x 的负载因子下,插入和删除操作的摊销成本仍可保持在 Õ(x) 的期望值,当 x=o(B) 时,外部内存中可实现 1+o(1) 的最优块传输次数。

ABSTRACT

First introduced in 1954, linear probing is one of the oldest data structures in computer science, and due to its unrivaled data locality, it continues to be one of the fastest hash tables in practice. It is widely believed and taught, however, that linear probing should never be used at high load factors; this is because primary-clustering effects cause insertions at load factor $1 - 1 /x$ to take expected time $Θ(x^2)$ (rather than the ideal $Θ(x)$). The dangers of primary clustering, first discovered by Knuth in 1963, have been taught to generations of computer scientists, and have influenced the design of some of many widely used hash tables. We show that primary clustering is not a foregone conclusion. We demonstrate that small design decisions in how deletions are implemented have dramatic effects on the asymptotic performance of insertions, so that, even if a hash table operates continuously at a load factor $1 - Θ(1/x)$, the expected amortized cost per operation is $ ilde{O}(x)$. This is because tombstones created by deletions actually cause an anti-clustering effect that combats primary clustering. We also present a new variant of linear probing (which we call graveyard hashing) that completely eliminates primary clustering on \emph{any} sequence of operations: if, when an operation is performed, the current load factor is $1 - 1/x$ for some $x$, then the expected cost of the operation is $O(x)$. One corollary is that, in the external-memory model with a data blocks of size $B$, graveyard hashing offers the following remarkable guarantee: at any load factor $1 - 1/x$ satisfying $x = o(B)$, graveyard hashing achieves $1 + o(1)$ expected block transfers per operation. Past external-memory hash tables have only been able to offer a $1 + o(1)$ guarantee when the block size $B$ is at least $Ω(x^2)$.

研究动机与目标

  • 为解决线性探测在高负载因子下因主聚类导致的长期性能下降问题。
  • 探究基于墓碑的删除策略是否能从根本上改变线性探测的渐近行为。
  • 设计一种保持数据局部性同时消除主聚类的哈希表变体。
  • 在高负载因子下实现外部内存性能的最优化,即每操作的期望块传输次数为 1+o(1)。

提出的方法

  • 提出“墓地哈希”——一种使用墓碑制造反聚类效应的线性探测变体。
  • 分析墓碑与插入操作之间的相互作用,表明墓碑可通过打断长运行序列来减少聚类。
  • 使用概率分析证明,墓碑使得插入操作表现得如同表的实际聚类程度低于其真实情况。
  • 证明通过合理的墓碑管理,即使在负载因子为 1−1/x 时,每操作的期望摊销成本仍可保持在 Õ(x)。
  • 将该技术应用于外部内存模型,证明当块大小为 B 时,若 x=o(B),墓地哈希可实现每操作 1+o(1) 的期望块传输次数。
  • 利用关于 2-独立和简单表格哈希函数的已知结果,确保与实际哈希族的兼容性。

实验结果

研究问题

  • RQ1基于墓碑的删除策略是否能消除线性探测中的主聚类?
  • RQ2哈希表中墓碑的存在是否会产生反聚类效应,从而改善插入性能?
  • RQ3当通过墓碑处理删除操作时,线性探测是否能在接近 1−1/x 的负载因子下仍保持 O(x) 的期望摊销成本?
  • RQ4使用墓碑防止聚类的线性探测变体在外部内存中的性能如何?
  • RQ5即使在无删除的工作负载中,墓碑的使用是否也能改变线性探测的渐近行为?

主要发现

  • 墓地哈希即使在负载因子为 1−1/x 时,仍可实现每插入或删除操作的期望摊销成本为 Õ(x)。
  • 墓碑产生反聚类效应,可防止长运行序列的形成,从而抵消主聚类。
  • 在外部内存模型中,当 x=o(B) 时,墓地哈希可实现每操作 1+o(1) 的期望块传输次数,相比以往工作所需 B=Ω(x²) 的条件有显著改进。
  • 即使在无删除的工作负载中,性能保证依然成立,这是由于墓碑的持久反聚类效应。
  • 该技术与 2-独立和简单表格哈希函数兼容,支持实际部署。
  • 结果表明,墓碑管理不仅是工程选择,更是影响线性探测渐近行为的关键算法设计决策。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。