Papers
Topics
Authors
Recent
Search
2000 character limit reached

Linear Hashing

Updated 26 August 2026
  • Linear hashing are dynamic file-expansion schemes based on incremental bucket splitting in databases, linear probing methods in data structures, and affine algebraic hash families in theoretical computer science.
  • Key methods of linear hashing include affine modular hashing, needed for prime modulus p, binary linear hashing which chooses a random linear map and linear probing, scanning the table linearly to resolve collisions.
  • A method known as dynamic linear hashing, is a database scheme which utilizes incremental bucket splitting and refers to another usage of hash families.

Linear hashing denotes several distinct families and mechanisms in hashing theory. In database systems, linear hashing is a dynamic file-expansion scheme based on incremental bucket splitting; in classical data structures, the term is also used for linear probing, an open-addressing collision-resolution method. In theoretical computer science, it commonly refers to compact algebraic hash families such as affine modular hashing, h(x)=((ax+b)modp)modmh(x)=((ax+b)\bmod p)\bmod m, or random linear maps over finite fields. Related uses include linear sketching, supervised linear hashing of feature vectors, and linear-code hashing for randomness extraction. These notions share linear or affine algebraic structure but have different models, guarantees, and unresolved problems.

1. Terminology and mathematical models

Affine modular hashing

The canonical affine modular family chooses a prime pp, random parameters a,bFpa,b\in\mathbb F_p, and maps keys to mm buckets by

ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.

The first operation is affine over Fp\mathbb F_p; the final reduction modulo mm generally is not a field operation. For a key set XX of size nn, the maximum load is

ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.

The standard worst-case question maximizes pp0 over fixed, adversarially chosen sets pp1. The family is compact—its seed requires pp2 bits—and evaluation takes constant time. Before final range reduction, the affine maps form a pairwise-independent, pp3-universal family; after reduction, bin marginals are only nearly uniform, although distinct-key collision probabilities remain pp4 (Bakshi et al., 25 Aug 2026).

Two representations are frequently distinguished. Strided hashing uses reduction modulo pp5, whereas blocked hashing partitions pp6 into consecutive intervals of length approximately pp7. In the standard prime-modulus setting, their expected maximum loads differ by at most a factor of pp8. Removing the additive shift produces Simple Linear Hashing, which is likewise equivalent up to constant factors in the relevant prime-modulus analysis (Westover, 2023).

Binary linear hashing

A different family chooses a uniformly random linear map

pp9

represented by an a,bFpa,b\in\mathbb F_p0 random binary matrix. The a,bFpa,b\in\mathbb F_p1 bins are the elements of a,bFpa,b\in\mathbb F_p2. For a fixed set a,bFpa,b\in\mathbb F_p3 with a,bFpa,b\in\mathbb F_p4,

a,bFpa,b\in\mathbb F_p5

The fibers of a surjective map are affine cosets of a random a,bFpa,b\in\mathbb F_p6-dimensional kernel. Although this family is universal and has strong algebraic dependencies—it is not even a,bFpa,b\in\mathbb F_p7-wise independent—the maximum-load behavior is optimal up to the leading and dominant second-order terms (Jaber et al., 20 May 2025, Bshouty, 18 May 2026).

This result should not be conflated with the affine modular family. The former is linear as a map between vector spaces over a,bFpa,b\in\mathbb F_p8; the latter applies an affine finite-field transformation followed by an incompatible reduction modulo an arbitrary bucket count. Their maximum-load behavior is now known to be substantially different.

Linear probing

Linear probing is an open-addressing method rather than a hash-family specification. A key whose home location is a,bFpa,b\in\mathbb F_p9 scans

mm0

until it finds the key, an empty location, or the first available location for insertion. The cost of an operation is controlled by the occupied run containing the home location. Under fully random hashing, or under suitable limited-independence assumptions, this produces a cluster-based performance problem distinct from maximum bin load.

The term linear hashing in linear-probing papers therefore denotes a collision-resolution process, not necessarily an affine hash family. Dynamic Linear Hashing, in turn, is a database scheme based on incremental bucket splitting and is a third, unrelated usage (Janson et al., 2014, Sanders, 2018).

2. Linear probing, clusters, and operational cost

For bucket capacity mm1, a table consists of mm2 cyclically ordered buckets, each holding at most mm3 keys. If mm4 is the number of keys whose home address is bucket mm5, mm6 the number trying bucket mm7, mm8 the overflow passed to bucket mm9, and ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.0 the final occupancy, then

ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.1

The load factor is ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.2). In the Poisson model, the home occupancies are independent with

ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.3

The overflow profile is a reflected random walk with increments ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.4. Its drift is ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.5, negative whenever ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.6. This representation connects local occupancy, cluster formation, overflow, and search cost.

A cluster, or block, is a maximal sequence of full buckets followed by a non-full bucket. If ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.7 is the block length in the one-sided infinite model, then

ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.8

The probability-generating function is

ha,b(x)=((ax+b)modp)modm.h_{a,b}(x)=((ax+b)\bmod p)\bmod m.9

where Fp\mathbb F_p0 on the specified branch of the tree function Fp\mathbb F_p1. The mean block length satisfies

Fp\mathbb F_p2

where Fp\mathbb F_p3 is the limiting probability that a bucket is non-full. A uniformly selected bucket sees a size-biased block distribution, so the block containing a random bucket is not distributed like a randomly selected block.

For unsuccessful search, Fp\mathbb F_p4 denotes the number of full buckets inspected. Its tail is the residual-block relation

Fp\mathbb F_p5

The total number of inspected buckets is Fp\mathbb F_p6. For first-come-first-served insertion, the displacement of a newly inserted key equals Fp\mathbb F_p7. The expected displacement of a random stored key is policy-independent because the total displacement equals the total bucket overflow:

Fp\mathbb F_p8

This conservation identity applies to FCFS, LCFS, Robin Hood, and other insertion policies, although their displacement distributions and variances differ.

The classical bucket-size-one case, Fp\mathbb F_p9, gives ordinary linear probing. For fixed mm0, expected search costs remain bounded as the table grows, but the constants diverge as mm1. At full occupancy, the behavior changes qualitatively: total displacement has order mm2 and converges after normalization to the area under a standard Brownian excursion. Near full occupancy, long clusters and finite-size effects dominate fixed-load asymptotics (Janson et al., 2014, Klein et al., 2016).

3. Independence requirements and deletion without relocation

The quality of linear probing depends not only on the collision-resolution rule but also on the hash family. A hash function is mm3-independent if the hash values of every mm4 distinct keys are mutually independent and individually uniform. A random degree-mm5 polynomial over a prime field supplies a standard construction.

Five-wise independence is sufficient for expected constant-time search, insertion, and deletion when the load is bounded away from one. The proof conditions on the query hash value; the remaining stored-key indicators are then mm6-wise independent. A fourth-moment bound shows that a dyadic interval of length mm7 is near-full with probability mm8. Summing over dyadic scales yields expected occupied-run length mm9, and hence expected XX0 operation cost. The simplified theorem assumes XX1, or XX2, while the sharper statement gives expected cost XX3 at load XX4 (Thorup, 2015).

Four-wise independence does not suffice in general. Simple tabulation hashing, although formally only XX5-independent, can satisfy the relevant fourth-moment estimate after conditioning. By contrast, ordinary affine transformations can generate pathological clustering. These guarantees are expectations over the randomly selected hash function and do not imply a simultaneous high-probability bound for every key and every operation.

A separate variant addresses deletion under referential integrity. Ordinary backward shifting preserves probe reachability by moving subsequent elements, but invalidates pointers to their table locations. The tombstone-minimizing variant never moves live elements. Each slot is logically one of EMPTY, TOMBSTONE, or LIVE. A tombstone is retained only if a surviving element’s probe path requires it; otherwise it is changed to empty during deletion. This maintains search correctness while preserving references.

The structural guarantees are local: every retained tombstone has a live witness, and every removed tombstone is unnecessary for the current set of live elements. Deletion may scan a substantial cluster and can take XX6 time in the worst case. The reported bounded long-run search overhead is experimental rather than a formal amortized theorem; no worst-case bound on tombstone counts or deletion cost is established. Ordinary resizing remains problematic because rehashing changes element addresses (Sanders, 2018).

4. Hashing with chaining and affine arithmetic structure

Affine modular hashing is often used with separate chaining rather than linear probing. In that setting, the load of a bucket is exactly its chain length, and the maximum load is the longest chain. The family

XX7

uses only two random parameters, so outputs are highly dependent. For XX8, fully random hashing has expected maximum load XX9, whereas the previously known upper bound for affine modular hashing was nn0. A 2017 analysis established

nn1

for fixed key sets, improving generic nn2 bounds for broad nn3-independent families (Knudsen, 2017).

The proof converts a heavy bucket into a short interval containing many transformed keys. Carefully selected multipliers, often indexed by primes, force many pairs of original keys to have unusually small modular differences. A technical interval-overlap lemma supplies a lower bound on such pairs, while random multiplication gives an upper bound for each fixed pair. The resulting tail estimate has cubic decay,

nn4

which integrates to the cube-root expected maximum-load bound.

Composite moduli require additional care because nonzero elements need not be invertible. Smart Linear Hashing chooses multipliers from nn5. For ordinary composite hashing, conditioning on nn6 partitions the input into components corresponding to Smart Linear Hashing modulo nn7. The resulting loss is bounded by the divisor function

nn8

Blocked and strided variants, real multipliers, random moduli, and the two-bin case are closely related, but the equivalences preserve only specified approximation factors or asymptotic orders (Westover, 2023).

5. Optimality and failure of different linear families

Binary linear hashing has a markedly stronger theorem. For every fixed nn9 with ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.0, a uniformly random linear map satisfies

ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.1

In particular, its leading term matches fully independent hashing, whose expected maximum load is

ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.2

The proof exposes the random kernel one dimension at a time. If ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.3 is the partial kernel and ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.4, define the exponential potential

ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.5

The central inequalities are

ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.6

and

ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.7

The first controls conditional growth under pairwise coset mergers; the second gives deterministic excess-potential doubling. Optimizing the base ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.8 according to the target load yields a refined tail bound. For ML(h,X)=maxr[m]{xX:h(x)=r}.\operatorname{ML}(h,X)=\max_{r\in[m]}|\{x\in X:h(x)=r\}|.9 satisfying the stated threshold condition,

pp00

A 2026 refinement integrates this optimized tail to recover the dominant second-order correction, showing that binary linear hashing nearly matches fully independent hashing beyond the leading scale (Jaber et al., 20 May 2025, Bshouty, 18 May 2026).

Affine modular hashing has a different status. Recent arithmetic-combinatorial constructions produce, for pp01 and sufficiently large prime modulus, an pp02-element key set with expected maximum load

pp03

In one formulation, the same key set causes this load for every affine multiplier, not merely in expectation. The construction uses small sets containing long arithmetic progressions in many differences. Under a real multiplier, two of the points pp04 must be close on the unit circle; a progression with that difference is consequently compressed into an interval meeting at most two bins. A reduction transfers this phenomenon to modular hashing (Bakshi et al., 25 Aug 2026, Zamir, 24 Aug 2026).

The lower bound is super-polylogarithmic but subpolynomial. Thus, for affine modular hashing with pp05, the current gap is between

pp06

and approximately

pp07

This contrasts directly with binary random linear hashing: “linear hashing is optimal” applies to the binary vector-space family, not to the canonical affine modular family.

6. Arithmetic Kakeya connections and open problems

The affine modular maximum-load problem admits a density arithmetic Kakeya formulation. For pp08, define the richness in direction pp09 at progression length pp10 by

pp11

With pp12 and pp13, the maximum load and directional richness satisfy

pp14

Therefore, constructing key sets with large rich progressions in many directions constructs bad hashing inputs. Green–Ruzsa constructions supply relatively small sets containing long arithmetic progressions for every difference in an initial interval. Difference amplification converts these progressions into rich subsets for a constant fraction of modular directions, yielding the super-polylogarithmic lower bound (Zamir, 24 Aug 2026).

The same viewpoint applies to real linear hashing,

pp15

If a set contains a pp16-term progression for every difference pp17 with pp18, then for every real seed pp19 two of pp20 lie within circular distance pp21. The corresponding progression is mapped into an interval of length less than pp22, so at least pp23 keys occupy one bin. This gives a pointwise, every-seed lower bound.

The arithmetic Kakeya connection also yields conditional barriers. A uniform pp24 upper bound for real or modular linear hashing over polynomial-size universes would imply the polynomial-length arithmetic Kakeya conjecture, which in turn implies the Kakeya conjecture for upper Minkowski dimension. Conversely, any substantial improvement over the cube-root upper bound would imply new results for arithmetic Kakeya-type sets. The current lower-bound construction does not establish a polynomial lower bound; whether the true worst-case expected load is pp25 for some absolute pp26 remains open (Zamir, 24 Aug 2026, Bakshi et al., 25 Aug 2026).

Other linear-hashing applications pose different questions. In supervised discrete hashing, S2DHMLR learns a linear feature-to-code map

pp27

while using a single shared projection pp28 for code-to-label and label-to-code regression. Its optimization combines discrete binary codes, mutual regression, feature regression, alternating minimization, Sylvester-equation solution, and discrete cyclic coordinate descent. Experiments on CIFAR-10, MS-COCO, and NUS-WIDE report improved mean average precision relative to several supervised linear baselines, with a boosting procedure selecting balanced bits (Liu et al., 2019).

In randomized numerical linear algebra, hashing matrices provide sparse subspace embeddings. An pp29-hashing matrix has pp30 signed nonzeros per column, each of magnitude pp31. For sufficiently low coherence, sketch dimension pp32 is possible, where pp33 is the input rank. Increasing pp34 permits coherence larger by approximately pp35; randomized Hadamard preprocessing further reduces coherence. These embeddings yield well-conditioned preconditioners for linear least squares, implemented in Ski-LLS for dense and sparse problems (Cartis et al., 2021).

Finally, linear-code hashing uses a parity-check matrix pp36 to map pp37 to its syndrome pp38. For integer pp39, a random linear code extracts nearly uniform pp40-ary symbols when

pp41

with an ensemble-average Rényi-divergence and normalized pp42 guarantee. Reed–Muller parity-check matrices achieve the full pp43-Rényi intrinsic-randomness rate for memoryless Bernoulli sources, while the corresponding full Shannon-order claim remains unresolved (Pathegama et al., 2024). These extraction, sketching, supervised-retrieval, chaining, probing, and algebraic-load problems all use “linear hashing,” but their objectives—uniformity, embedding, semantic similarity, operation cost, or maximum occupancy—are mathematically distinct.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

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

Follow Topic

Get notified by email when new papers are published related to Linear Hashing.