Weighted multigraph cuts, supervertex contractions, and Karger's survival bounds #
Combinatorial and probabilistic core for Karger's randomized contraction algorithm [Karger1993]
and the Karger–Stein recursive algorithm [KargerStein1996] on n-vertex weighted undirected
multigraphs represented as symmetric zero-diagonal adjacency matrices W : Fin n → Fin n → ℕ.
Source statements and notation mapping #
- Cut-survival bounds (paraphrase):
[Karger1993], Section 2, Theorem 2.1 and Corollary 2.1 (paraphrase): contracting randomly chosen edges in ann-vertex multigraph down to2meta-vertices preserves any fixed global minimum cut with probability at leastC(n, 2)⁻¹ = 2 / (n * (n - 1)), and repeatingO(n ^ 2 log n)independent trials finds a minimum cut with high probability.[KargerStein1996], Section 2, Lemma 2.1, Theorem 2.2, and Corollary 2.3, and Section 2.1, Corollary 2.4 (paraphrase): a fixed cut survives contraction if and only if no contracted edge crosses it; atkactive supervertices every singleton cut has weight at leastminCut W, so total doubled weightSis at leastk * minCut W, a single edge-weight-proportional step crosses a fixed minimum cut with probability at most2 / k, and contracting fromndown totsupervertices preserves the cut with probability at leastC(t, 2) / C(n, 2) = t * (t - 1) / (n * (n - 1)).[MitzenmacherUpfal2017], Section 1.5, Theorem 1.8 (paraphrase): multiplying the conditional single-step survival bounds1 - 2 / i = (i - 2) / ifori = n, …, 3telescopes to2 / (n * (n - 1)).
- Notation mapping and implementation variants:
C(t, 2) / C(n, 2)andC(n, 2)⁻¹↔((t * (t - 1) : ℕ) : ℝ≥0∞) / (n * (n - 1))and2 / (n * (n - 1))(step_survival_prob_ge,telescope_survival_step);[KargerStein1996], Section 3.1, Lemma 3.1 selects(u, v)with probability2 * W u v / Svia twoRandom-Selectdraws (uproportional toD(u)thenvproportional toW(u, v)); ouredgeOffset/IsSampledPairformalizes an equivalent single-draw variant using one uniform drawr ∈ Fin S(S = totalDoubledWeight W = ∑ u, rowDeg W u) resolved by prefix sums overrowDegthen row weightsW u v, achieving the same2 * W u v / Sdistribution;[KargerStein1996], Section 3.2 (Figure 5) updates then × nmatrix inO(n)time per contraction (hence Corollary 3.2'sO(n ^ 2)total); ourembedCompact/contractMatrixswap-compacts active slotk - 1into the removed slotvso each contraction onkactive supervertices scans only0..k - 1(O(k)time);highProbTrials n = (n * (n - 1) / 2) * (Nat.log 2 n + 2)and the elementaryReal.exp-free Bernoulli boundhighProb_failure_le(≤ 1 / (2 * n)) are our own concrete parameter choices instantiating theO(n ^ 2 log n)repeated-trial amplification of[Karger1993], Section 2, Corollary 2.1.
Main definitions #
Cslib.Algorithms.WordRAM.Karger.IsMultigraph: symmetric zero-diagonal weight matrix.Cslib.Algorithms.WordRAM.Karger.IsNonTrivialCut,Cslib.Algorithms.WordRAM.Karger.cutWeight,Cslib.Algorithms.WordRAM.Karger.minCut: non-trivial vertex cuts, cut weights, and global minimum cut weight.Cslib.Algorithms.WordRAM.Karger.rowDeg,Cslib.Algorithms.WordRAM.Karger.totalDoubledWeight,Cslib.Algorithms.WordRAM.Karger.flattenMatrix: supervertex degrees, doubled total edge weight, and row-majorn ^ 2-element flattening.Cslib.Algorithms.WordRAM.Karger.IsContractionOf,Cslib.Algorithms.WordRAM.Karger.mergePair,Cslib.Algorithms.WordRAM.Karger.embedCompact,Cslib.Algorithms.WordRAM.Karger.contractMatrix,Cslib.Algorithms.WordRAM.Karger.contractPart: supervertex partition contractions and swap-compacted adjacency updates fromm + 1down tomactive supervertices.Cslib.Algorithms.WordRAM.Karger.edgeOffset,Cslib.Algorithms.WordRAM.Karger.IsSampledPair: prefix-sum interval characterization of edge-weight-proportional sampling fromFin S.
Main results #
Cslib.Algorithms.WordRAM.Karger.cutWeight_pullbackCut: pulling back any active cut along a supervertex contraction preserves its cut weight exactly.Cslib.Algorithms.WordRAM.Karger.isContractionOf_contract: contracting a distinct pair(u, v)and swap-compacting the last active slot preservesIsContractionOf.Cslib.Algorithms.WordRAM.Karger.surviving_card_eq,Cslib.Algorithms.WordRAM.Karger.step_survival_prob_ge: a fixed minimum cut survives one edge-proportional contraction onksupervertices with probability at least(k - 2) / k.Cslib.Algorithms.WordRAM.Karger.telescope_survival_step: telescoping multiplication identity((m - 1) / (m + 1)) * (t * (t - 1) / (m * (m - 1))) = t * (t - 1) / ((m + 1) * m)inℝ≥0∞.Cslib.Algorithms.WordRAM.Karger.highProb_failure_le: elementary Bernoulli amplification bound(1 - 2 / (n * (n - 1))) ^ ((n * (n - 1) / 2) * (Nat.log 2 n + 2)) ≤ 1 / (2 * n).
References #
Weighted multigraphs and global minimum cuts #
Total weight of edges crossing (C, Finset.univ \ C).
Instances For
Row-major matrix flattening #
Supervertex partitions and contraction algebra #
W : Fin k → Fin k → ℕ is the contracted multigraph of W₀ : Fin n → Fin n → ℕ along
surjective supervertex assignment part : Fin n → Fin k.
- surj : Function.Surjective part
- multigraph : IsMultigraph W
Instances For
Phase A (mergePair) and Phase B (embedCompact / contractMatrix) #
Inverse of embedCompact v on {a : Fin (m + 1) // a ≠ v}.
Instances For
IsSampledPair W r u v holds when sample r falls inside the half-open interval
[edgeOffset W u v, edgeOffset W u v + W u v).
Instances For
One-step survival probability lower bound: if k ≥ 2, 0 < totalDoubledWeight W, and
k * cutWeight W B ≤ totalDoubledWeight W, then a uniform sample r : Fin (totalDoubledWeight W)
satisfies SampleSurvives W B r with probability at least (k - 2) / k.
ENNReal multiplication rule for sequential success lower bounds across PMF.bind.
ENNReal multiplication rule for independent-trial failure upper bounds: if p stays in
stillFailing with probability at most q₁, every supported a ∈ stillFailing fails under
kernel a with probability at most q₂, and every supported a ∉ stillFailing has zero failure
probability under kernel a, then p.bind kernel fails with probability at most q₁ * q₂.
Exact complementation law p.toOuterMeasure s + p.toOuterMeasure sᶜ = 1 for discrete PMFs,
valid on arbitrary types without measurability hypotheses.
Telescoping cancellation step for contractDownTo survival probability from m + 1 down to
t (2 ≤ t ≤ m):
((m - 1) / (m + 1)) * (t * (t - 1) / (m * (m - 1))) = t * (t - 1) / ((m + 1) * m).
Elementary high-probability trial count (n * (n - 1) / 2) * (Nat.log 2 n + 2) for Basic
Karger amplification.
Instances For
Elementary failure probability bound for highProbTrials n independent contractions:
(1 - 2 / (n * (n - 1))) ^ ((n * (n - 1) / 2) * (Nat.log 2 n + 2)) ≤ 1 / (2 * n).