Multi-Round Unit-Circle Dynamic Matching #
This file formalizes the multi-round consistent-hashing dynamic matching scheme of Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, Dynamic Dictionary with Subconstant Wasted Bits per Key ([LiLiangYuZhou2024, Section 3.1, Problem 3.1, Algorithm 1, Lemma 3.2, and Claims 3.3–3.4]; arXiv:2310.20536v1, PDF pp. 6–9 / printed pp. 5–8), building on consistent hashing on the unit circle ([KLL+97]) and memoryless worker-task assignment ([BKP+22]).
Given a key-ID (ball) universe Fin U' and a slot (bin) universe Fin n' (n' ≤ U'), a matching
scheme h : Scheme U' n' consists of U' permutations on Fin (U' + n') (matching the
independent Fisher–Yates permutations sampled at initialization on the Word RAM). In round i, all
remaining balls A_i ⊆ Fin U' and bins B_i ⊆ Fin n' are placed on the discrete circle
Fin (U' + n') via h i; each ball a ∈ A_i whose clockwise-next occupied circle position belongs
to a bin b ∈ B_i is matched to b, and both a and b are removed before round i + 1.
Because h is fixed in advance, the resulting assignment matching h A (for B = Finset.univ of
all n' slots, or more generally matchOptOn h A B for any B with A.card ≤ B.card) depends
solely on h and the current active set A. For any fixed h with T := rounds h A, when active
cardinality stays ≤ n', a single insertion or deletion changes at most 2 * (T + 1) ball
assignments ([LiLiangYuZhou2024, Claim 3.4]), and an atomic replacement insert y (A.erase x)
changes at most 4 * T + 6 assignments ([LiLiangYuZhou2024, Section 5.2 via Claim 3.4]). Under
uniform independent permutations (schemePMF), the expected round count is at most
⌈log₂ |A|⌉ + 2 = O(log (max |A| 2)) ([LiLiangYuZhou2024, Claim 3.3]), giving expected
O(log (max |A| 2)) single-update relocation cost ([LiLiangYuZhou2024, Lemma 3.2]).
Scope note #
This module supplies the pure mathematical dynamic-matching primitive for the
large-parameter-regime dynamic dictionary of [LiLiangYuZhou2024, Section 5]. Word-RAM Fisher–Yates
permutation sampling, precomputed lookup-table evaluation, variable-length B-way word/bit
adapters (Section 3.3), adapter trees (Section 4), strong history independence, dynamic resizing,
and super-polynomial key universes are not formalized here.
Main definitions #
Cslib.DataStructure.Dictionary.DynamicMatching.RoundPerm,Scheme,schemePMF: single-round permutation onFin (U' + n'),U'-round matching scheme, and uniform distribution on schemes.Cslib.DataStructure.Dictionary.DynamicMatching.roundMatchOpt,roundStep,stateAt,roundsOn,rounds,matchOptOn,matchOpt,matching,relocDist: Algorithm 1 round transition, round countT, partial assignmentFin U' → Option (Fin n'), canonical injectionA ↪ Fin n', and ball-relocation distanceΔ.
Main results #
card_balls_roundStep_lt,stateAt_balls_eq_empty,roundsOn_le_card,rounds_le_card,matchOptOn_isSome_iff,matchOptOn_injective,matchOpt_isSome_iff,matchOpt_injective,matching_apply: termination withinA.cardrounds and canonical injection properties.expect_roundsOn_le,expect_rounds_le: expected round bound𝔼[T] ≤ ⌈log₂ |A|⌉ + 2 ≤ 3 * ⌈log₂ (max |A| 2)⌉([LiLiangYuZhou2024, Claim 3.3]).expect_le_of_le_add_mul_rounds: a cost bounded bya + b * Thas expectation at most(a + 3 b) * ⌈log₂ (max |A| 2)⌉.relocDist_insert_le,relocDist_delete_le,relocDist_replace_le,expect_relocDist_insert_le,expect_relocDist_delete_le,expect_relocDist_replace_le: deterministicO(T)and expectedO(log (max |A| 2))relocation bounds ([LiLiangYuZhou2024, Claim 3.4 and Lemma 3.2]).
References #
- T. Li, J. Liang, H. Yu, and R. Zhou, Dynamic Dictionary with Subconstant Wasted Bits per Key
- D. R. Karger, E. Lehman, F. T. Leighton, R. Panigrahy, M. S. Levine, and D. Lewin, Consistent Hashing and Random Trees: Distributed Caching Protocols for Relieving Hot Spots on the World Wide Web
- A. Berger, W. Kuszmaul, A. Polak, J. Tidor, and N. Wein, Memoryless Worker-Task Assignment with Polylogarithmic Switching Cost
Single-round permutation on the combined universe Fin (U' + n') of U' balls and n'
bins.
Predetermined U'-round dynamic matching scheme (Algorithm 1, line 1).
Clockwise successor on a finite circle subset #
Permuted item circle and single-round matching #
Single-round match attempt (Algorithm 1, lines 7–9): ball a matches to bin b iff a ∈ A
and the clockwise-next active item in activeItems A B under π is binItem U' b.
Every round with A.Nonempty and B.Nonempty matches at least one ball (Algorithm 1
termination property, [LiLiangYuZhou2024, Section 3.1]).
Multi-round execution, canonical injection, and round count #
Expected round bound (Claim 3.3) #
Claim 3.3 ([LiLiangYuZhou2024, Section 3.1]): for any A ⊆ Fin U'
and B ⊆ Fin n' with A.card ≤ B.card, the expected number of rounds T = roundsOn h A B under
uniform independent permutations is at most ⌈log₂ |A|⌉ + 2.
Specialization of Claim 3.3 to all n' slots (B = Finset.univ): for A.card ≤ n',
𝔼[rounds h A] ≤ ⌈log₂ |A|⌉ + 2 ≤ 3 * ⌈log₂ (max |A| 2)⌉.
Single-operation relocation bounds (Claim 3.4 and Lemma 3.2) #
Single-key insertion relocation bound (Claim 3.4, B = Finset.univ).
Single-key deletion relocation bound (Claim 3.4, B = Finset.univ).
Atomic key-replacement relocation bound (Section 5.2 leaf minimap replacement
(A \ {x}) ∪ {y} at fixed capacity A.card ≤ n'): decomposes through A.erase x without ever
exceeding n' active balls.
A scheme-indexed cost bounded by a + b * rounds h A for every scheme h has expectation at
most (a + 3 b) * ⌈log₂ (max |A| 2)⌉: average the pointwise bound and apply expect_rounds_le.