Papers
Topics
Authors
Recent
Search
2000 character limit reached

Locality in Open Addressing Hash Tables

Published 17 Jul 2026 in cs.DS | (2607.16390v1)

Abstract: 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ε1-\varepsilon, uniform probing achieves the optimal Θ(1/ε)Θ(1/\varepsilon) probe count among greedy schemes, but has essentially no locality, whereas linear probing is highly local but performs Θ(1/ε<sup>2)Θ(1/\varepsilon<sup>2) probes. We show that this quadratic locality scale is fundamental: no open-addressing algorithm without reordering can achieve locality o(1/ε<sup>2)o(1/\varepsilon<sup>2) simultaneously at every load 1ε1-\varepsilon. We also prove an amortized expected-locality lower bound of Ω(1/ε)Ω(1/\varepsilon) over any sequence of (1ε)n(1-\varepsilon)n insertions, even when the final load is known in advance. Our lower bound further implies that page size B=Ω(1/ε<sup>2)B=Ω(1/\varepsilon<sup>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 O~(1/ε)\widetilde O(1/\varepsilon), essentially deamortizing the amortized lower bound. We also give a load-oblivious greedy scheme with optimal expected probe count Θ(1/ε)Θ(1/\varepsilon) whose ii-th probe is at distance O(i<sup>2)O(i<sup>2) from the first probe. Its analysis gives a general variance bound for occupied-cell densities in symmetric probing schemes, implying an O(logn/ε<sup>2)O(\log n/\varepsilon<sup>2) expected probe bound for every fixed-shift probing sequence and every load 1ε1-\varepsilon.

Authors (1)

Summary

  • The paper proves that no-reordering open-addressing schemes incur expected locality of Ω(1/ε²) at some loads, establishing linear probing’s quadratic locality as an inherent all-load barrier and showing that page sizes of Ω(1/ε²) are necessary for near-one-transfer operations.
  • The paper develops a distribution-free optimal-transport lower bound and a variance theorem for symmetric probing schemes, then uses them to design load-oblivious and known-load constructions with near-optimal probe counts and locality up to polylogarithmic factors.
  • The results show that probe count and locality are distinct design objectives: linear probing is optimal for all-load locality, while proposed schemes approach O(1/ε) expected probes, leaving open whether matching locality guarantees and stronger tail bounds are possible.

This paper, "Locality in Open Addressing Hash Tables" (2607.16390) by Or Zamir, initiates the formal study of locality as a performance measure for open-addressed hash tables, complementing the classical probe-count metric. The central finding is that the quadratic locality scale of linear probing is not an artifact of that particular scheme but an inherent barrier: in open addressing without reordering, expected locality Ω(1/ε2)\Omega(1/\varepsilon^2) is unavoidable at all loads 1ε1-\varepsilon. This provides a theoretical explanation for the persistent practical dominance of linear probing, whose probes scan contiguous memory and interact well with caches and prefetching, despite being suboptimal in probe count.

Model and cost measure

The table is identified with the cyclic group Zn\mathbb{Z}_n. For each inserted key, the paper distinguishes the home location HiH_i (first probed cell) from the placement YiY_i (final storage cell). The locality radius RiR_i of an insertion is the maximum cyclic distance from HiH_i to any cell inspected during the insertion, including the final placement cell. The setting is deliberately permissive: the algorithm may be adaptive, randomized, table-aware, and need not be greedy or follow a fixed probe sequence. The only structural restriction is no reordering — once a key is placed, it is never moved. This immutable setting is common in practice and has been the focus of recent work on open addressing beyond greedy schemes (Farach-Colton et al., 4 Jan 2025).

The contrast motivating the paper is well known: at load 1ε1-\varepsilon, uniform probing achieves the optimal greedy probe count Θ(1/ε)\Theta(1/\varepsilon) [Yao 1985] but probes essentially random locations, while linear probing incurs Θ(1/ε2)\Theta(1/\varepsilon^2) probes due to primary clustering yet is maximally local.

Lower bounds via optimal transport

The technical core of the lower bound is a distribution-free transport statement on the cycle. Given 1ε1-\varepsilon0 i.i.d. home locations 1ε1-\varepsilon1 drawn from an arbitrary distribution 1ε1-\varepsilon2 on 1ε1-\varepsilon3, the expected optimal transport cost (Earth Mover's Distance) to a configuration of distinct cells is always 1ε1-\varepsilon4. The proof proceeds in two steps. First, for the uniform distribution, an interval-overload argument shows that intervals of length 1ε1-\varepsilon5 frequently contain more home locations than they can hold: the excess, 1ε1-\varepsilon6 for 1ε1-\varepsilon7, is 1ε1-\varepsilon8 by a Berry–Esseen normal-approximation argument, and each unit of excess forces at least unit transport distance via a combinatorial covering argument. Second, a convexity lemma — 1ε1-\varepsilon9 is convex in Zn\mathbb{Z}_n0, since Zn\mathbb{Z}_n1 — combined with Jensen's inequality shows that the uniform distribution minimizes the expected interval overload, so the bound holds for every Zn\mathbb{Z}_n2.

The reduction to hashing is direct. Inserting uniformly random elements from a universe of size Zn\mathbb{Z}_n3 makes the home locations i.i.d. samples from some induced distribution Zn\mathbb{Z}_n4, and since every insertion must inspect its final placement cell, Zn\mathbb{Z}_n5. This yields:

  • Amortized lower bound. Any no-reordering algorithm has Zn\mathbb{Z}_n6, i.e., amortized expected locality Zn\mathbb{Z}_n7, even when Zn\mathbb{Z}_n8, Zn\mathbb{Z}_n9, and HiH_i0 are known in advance. The assumptions are minimal — open addressing, stateless first probes, and a large universe — and each is shown necessary for the statement to be meaningful.
  • All-load lower bound. No such algorithm achieves expected insertion locality HiH_i1 at every load HiH_i2. This follows by integrating the amortized bound over the load profile: a hypothetical HiH_i3 guarantee at all loads contradicts the HiH_i4 total. The all-load quantifier matters because search costs depend on insertions performed at earlier, possibly different, loads.

Both bounds are matched exactly by linear probing, which has expected locality HiH_i5 at slack HiH_i6 and HiH_i7 total over the insertion sequence. The lower bounds therefore establish that linear probing is optimal with respect to all-load locality, even though its probe count is far from optimal.

External-memory consequence

The locality measure directly controls cache and disk behavior. In the external-memory model with pages of HiH_i8 consecutive cells, an operation of locality HiH_i9 spans YiY_i0 pages. Consequently, if a no-reordering scheme achieves YiY_i1 expected page span at load YiY_i2, then page size YiY_i3 is necessary. This supplies the first lower bound explaining the long-standing YiY_i4 barrier for YiY_i5 block transfers in immutable open addressing, previously achieved constructively by Jensen and Pagh but never shown necessary. The result is complementary to graveyard hashing (Bender et al., 2021) and zombie hashing, which do beat the YiY_i6 threshold by rebuilding and reordering — confirming that the barrier is specific to the no-reordering regime.

Upper bound: load-oblivious greedy scheme with optimal probes

The paper's main technical contribution on the upper-bound side is a variance bound for symmetric probing schemes: in any greedy, translation-invariant scheme (covering linear probing, double hashing, uniform probing, and the new construction), for every fixed set YiY_i7 the number of occupied cells satisfies YiY_i8. The proof uses the Efron–Stein inequality together with an elegant coupling argument: resampling one key's random data changes the final occupied set by at most a single swap of two cells, and by translation invariance each swapped cell lands in YiY_i9 with probability at most RiR_i0. This shows that the occupied-set density in any fixed test set has binomial-like variance, despite the insertion process being highly adaptive — a robust pseudorandomness property that may be of independent interest.

Two consequences follow. First, for any fixed-offset probe sequence (even with dependent, randomized shifts), expected probe count at load RiR_i1 is RiR_i2 at every load. This is weaker than the constant-load result of Kuszmaul and Xi for quadratic probing but is, to the author's knowledge, the first all-load guarantee for arbitrary fixed-shift schemes; in regimes RiR_i3 it gives RiR_i4, precluding uniformly worse polynomial behavior.

Second, the paper analyzes an expanding-window sampler: it guesses the slack RiR_i5, and for each guess samples RiR_i6 cells uniformly from an interval of length RiR_i7 around the home location. A Chebyshev argument on the variance lemma shows such an interval contains an RiR_i8 fraction of empty cells with constant probability, giving expected probe count RiR_i9 — optimal among greedy schemes — with the HiH_i0-th probe at distance HiH_i1 from the home location, so HiH_i2 deterministically. This unconditionally delivers the locality profile one would obtain from quadratic probing if its conjectured HiH_i3 high-load probe count held.

A notable caveat: the combination HiH_i4 and HiH_i5 yields locality HiH_i6 only with high constant probability, not in expectation, since a first-moment bound on HiH_i7 does not control HiH_i8. Closing this gap requires stronger tail bounds on occupied-cell densities, which the variance lemma does not provide.

Upper bound: deamortized known-load construction

When the target slack HiH_i9 is known in advance, the amortized 1ε1-\varepsilon0 lower bound can essentially be deamortized. The construction replaces temporal cost discrepancy with per-insertion probabilistic discrepancy: a hierarchical block structure in which each key carries reproducible flexibility bits at each level; with probability 1ε1-\varepsilon1 the key is proactively sent to a least-loaded child block, and otherwise it stays in its home block. Most keys pay a small cost, while a small fraction intentionally pay more, leaving local space for the rest.

The analysis rests on two lemmas: a biased minimum-allocation lemma proved via an exponential potential function, showing that interleaving uniform allocations with least-loaded choices bounds the maximum bin imbalance by 1ε1-\varepsilon2; and a top-block overload lemma using Chernoff bounds and a no-crossing monotonicity argument (valid because there are no deletions, so a currently nonfull block was never full). A two-level version achieves 1ε1-\varepsilon3, and a 1ε1-\varepsilon4-level hierarchy with 1ε1-\varepsilon5 levels yields:

1ε1-\varepsilon6

for every insertion and every successful or unsuccessful search. Thus the amortized lower bound is tight up to polylogarithmic factors, and no individual insertion pays the quadratic cost. The same guarantee covers successful searches for fixed earlier keys, via a tagged version of the overload lemma.

Limitations and open problems

The paper is explicit about the remaining gaps. The known-load upper bound carries a 1ε1-\varepsilon7 factor; removing it, to match the amortized lower bound exactly with 1ε1-\varepsilon8 per operation, is open, as is any separation between the amortized bound and the worst per-operation cost. The load-oblivious sampler lacks an expected-locality guarantee — only high-probability locality 1ε1-\varepsilon9 is known — and the missing ingredient is a tail bound beyond the variance lemma. More generally, the paper asks what moment or tail bounds hold uniformly for Θ(1/ε)\Theta(1/\varepsilon)0 across all symmetric probing mechanisms. Finally, the lower bounds apply only to no-reordering schemes; recent non-greedy constructions beat the greedy probe-count barrier, and whether such schemes can retain optimal Θ(1/ε)\Theta(1/\varepsilon)1 all-load locality while achieving Θ(1/ε)\Theta(1/\varepsilon)2 probes remains open, as does extending the locality framework to schemes that move or rebuild keys.

Conclusion

This paper establishes locality as a rigorous second axis for evaluating open-addressed hash tables and proves that, without reordering, linear probing's quadratic locality is optimal: no immutable scheme can achieve Θ(1/ε)\Theta(1/\varepsilon)3 expected locality at all loads, and page size Θ(1/ε)\Theta(1/\varepsilon)4 is necessary for Θ(1/ε)\Theta(1/\varepsilon)5 expected page span in external memory. The lower bounds follow from a distribution-free optimal-transport theorem on the cycle, and the upper bounds from a general variance bound for symmetric probing schemes together with a hierarchical deamortization construction achieving Θ(1/ε)\Theta(1/\varepsilon)6 expected probe count and locality per operation. The results cleanly delineate what recent probe-count improvements can and cannot deliver: probe count can be pushed below the greedy optimum, but the all-load locality scale cannot.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 4 likes about this paper.