Fast Insertion for Bucketized Cuckoo Hashing
2026-07-27 • Data Structures and Algorithms
Data Structures and Algorithms
AI summaryⓘ
The authors study bucketized cuckoo hashing, a method for storing items in two possible buckets with limited space each. They introduce a new way to insert items that works efficiently even when the table is almost full, improving previous methods by having guaranteed fast insertions and only a few item moves on average. Their approach also helps predict which bucket an item is in during searches, speeding up queries. They show that earlier insertion methods can't achieve these efficiency guarantees.
bucketized cuckoo hashinghash tableload factorinsertion algorithmrandom-walk algorithmexpected runtimeamortized analysisbucket capacityhash functionsevictions
Authors
Tolson Bell, William Kuszmaul
Abstract
Bucketized cuckoo hashing is a practically efficient hash table scheme in which each object $u$ is stored in one of two buckets $h_1(u), h_2(u)$ of capacity $\ell$. For any bucket size $\ell\in\mb{N}$, there is a threshold $ε^*(\ell)=(2/e)^\ell\mathrm{poly}(\ell)$ for which there exists a way to fill the hash table to any load factor less than $1-ε^*$ with low probability of an error. Queries and deletions only need to check two buckets to find whether an object exists. Our contribution is to give a new insertion procedure for bucketized cuckoo hashing. For any $δ\in[.99^\ell,1]$, our algorithm can fill the hash table to load factor $1-ε=1-(1+δ)(ε^*)$ with an expected run time of $O(δ^{-1}(ε^*)^{-1})$ per insertion. This gives the first $\mathrm{poly}(ε^{-1})$ insertion time bound, and the first $f(ε^{-1})$ time bound for load factors that are very close to the optimal threshold. Additionally, our algorithm (which can be viewed as a variation of the classic random-walk algorithm) comes with a very strong amortized guarantee: it performs $O(1)$ amortized expected evictions per insertion. Furthermore, we show that the traditional random-walk algorithm cannot match this guarantee. Finally, our insertion protocol also comes with the feature that, for any key $u$ in the hash table, the query algorithm can \emph{guess} which of the two bins $h_1(u), h_2(u)$ the key $u$ is in with probability $1 - o(1)$ of being correct. Thus positive queries can complete in $1 + o(1)$ expected bin accesses.