Mathematical recurrences and quadratic potential for Karger–Stein (FastCut) #
Combinatorial, arithmetic, and probabilistic foundations for the Karger–Stein recursive global
minimum cut algorithm ([KargerStein1996], Section 4, Figure 6, Lemmas 4.1–4.3, and the
minimum-cut-value part of Theorem 4.4; paraphrase) on the randomized word RAM.
Design notes and deviations from [KargerStein1996] #
- Integer contraction threshold (
fastCutThreshold):[KargerStein1996], Section 4, Figure 6 contracts each branch to⌈k / √2 + 1⌉vertices so that(t * (t - 1)) / (k * (k - 1)) ≥ 1 / 2(Section 4, Lemma 4.3). We instead definefastCutThreshold kas the smallest integert ≥ 2satisfyingk * (k - 1) ≤ 2 * t * (t - 1). This integer deviation directly enforces Lemma 4.3's≥ 1 / 2per-branch survival inequality without square roots or divisions; it is never larger than⌈k / √2 + 1⌉and is strictly smaller at e.g.k = 8(t = 6vs7). - Base case at
k ≤ 6, as in the source: each leaf runs one random contraction down to2vertices, the base caseG' ← Contract(G, 2)of[KargerStein1996], Section 4, Figure 6. The cutoff follows equation (2) and the remark at the end of the proof of Lemma 4.3 (recurse forn ≥ 7); Figure 6 itself tests "fewer than 6 vertices". A leaf keeps a fixed minimum cut with probability≥ 2 / (k * (k - 1)) ≥ 2 / 30, equation (2)'s base-case bound1 / 15. The15in1 / (Nat.log 2 n + 15)is the source's constant: the proof of Lemma 4.3 setsz₀ = 59and showsz_k < 59 + 2 * kfork ≥ 1, sop_k = 4 / (z_k + 1) ≥ 2 / (30 + k); at depth at most2 * Nat.log 2 nthis is1 / (Nat.log 2 n + 15). - Concrete Word-RAM constants and trial schedule (
fastCutTrials):[KargerStein1996], Section 4, Lemmas 4.1–4.3 state asymptoticO(n ^ 2 log n)time,O(n ^ 2)space andΩ(1 / log n)single-tree success probability, and the proof of Theorem 4.4 repeats the algorithmO(log ^ 2 n)times; the explicit coefficients infastCutNodeTimeandfastCutScratch, the trial schedulefastCutTrials n = (Nat.log 2 n + 15) * (Nat.log 2 n + 2)and the1 / (2 * n)failure target are concrete parameter choices of this formalization. - Elementary quadratic potential
Φ(k) = (k - 4) ^ 2:two_mul_pot_threshold_leproves2 * (fastCutThreshold k - 4) ^ 2 ≤ (k - 4) ^ 2for allk ≥ 7via integer arithmetic (49 * 2 = 98 < 100 = 10 ^ 2), replacing real-valued recurrence unrolling in[KargerStein1996], Section 4, Lemmas 4.1–4.3.
Main definitions #
Cslib.Algorithms.WordRAM.Karger.fastCutThreshold: smallest integert ≥ 2satisfyingk * (k - 1) ≤ 2 * t * (t - 1).Cslib.Algorithms.WordRAM.Karger.fastCutDepth,Cslib.Algorithms.WordRAM.Karger.frameSize,Cslib.Algorithms.WordRAM.Karger.fastCutScratch: recursion depth, per-frame memory footprint, and root-to-leaf active stack scratch bound.Cslib.Algorithms.WordRAM.Karger.fastCutNodeTime,Cslib.Algorithms.WordRAM.Karger.fastCutNodeQueries,Cslib.Algorithms.WordRAM.Karger.fastCutTrials: explicit time,rand-call, and high-probability amplification budgets.
Main results #
Cslib.Algorithms.WordRAM.Karger.two_mul_pot_threshold_le: quadratic potential halving2 * (fastCutThreshold k - 4) ^ 2 ≤ (k - 4) ^ 2for everyk ≥ 7, proved via integer arithmetic without real square roots.Cslib.Algorithms.WordRAM.Karger.fastCutDepth_le_two_mul_log: recursion depth boundfastCutDepth k ≤ 2 * Nat.log 2 k.Cslib.Algorithms.WordRAM.Karger.fastCutScratch_le: total root-to-leaf stack workspace boundfastCutScratch n ≤ 26 * (n * n)forn ≥ 2([KargerStein1996], Section 4, Lemma 4.2; paraphrase).Cslib.Algorithms.WordRAM.Karger.two_branch_hit_prob_ge,Cslib.Algorithms.WordRAM.Karger.root_hit_prob_eq,Cslib.Algorithms.WordRAM.Karger.fastCutHighProb_failure_le: elementaryENNRealprobability recurrence1 - (1 - 1 / s) ^ 2 ≥ 2 / (s + 1)giving≥ 1 / (Nat.log 2 n + 15)single-tree success ([KargerStein1996], Section 4, Lemma 4.3; paraphrase) and≤ 1 / (2 * n)amplified failure (the minimum-cut-value part of[KargerStein1996], Section 4, Theorem 4.4; paraphrase) withoutReal.logorReal.exp.
References #
Pure-integer threshold fastCutThreshold and quadratic potential Φ(k) = (k - 4) ^ 2 #
Pure-integer Karger–Stein contraction threshold: for k ≥ 7, the smallest t ≥ 2 such that
k * (k - 1) ≤ 2 * t * (t - 1), ensuring ((t * (t - 1)) / (k * (k - 1)) : ℝ≥0∞) ≥ 1 / 2
([KargerStein1996], Section 4, Lemma 4.3; paraphrase). This integer deviation from Figure 6's
⌈k / √2 + 1⌉ is never larger and is strictly smaller at e.g. k = 8 (t = 6 vs 7).
Instances For
Lower bound 2 ≤ fastCutThreshold k for k ≥ 4.
Upper bound fastCutThreshold k ≤ k - 1 for k ≥ 4.
Strict decrease fastCutThreshold k < k for k ≥ 4.
Defining threshold inequality
k * (k - 1) ≤ 2 * fastCutThreshold k * (fastCutThreshold k - 1).
Minimality of fastCutThreshold k: every 2 ≤ m < fastCutThreshold k satisfies
2 * m * (m - 1) < k * (k - 1).
For k ≥ 7, the contraction threshold satisfies 6 ≤ fastCutThreshold k.
Predecessor minimality inequality
2 * (fastCutThreshold k - 1) * (fastCutThreshold k - 2) < k * (k - 1) for k ≥ 7.
Quadratic potential halving (Φ(k) = (k - 4) ^ 2): for every k ≥ 7,
2 * (fastCutThreshold k - 4) ^ 2 ≤ (k - 4) ^ 2.
Uses 49 * 2 = 98 < 100 = 10 ^ 2: if b ^ 2 < 2 * a ^ 2 (a = t - 4 ≥ 2, b = k - 4 ≥ 3),
then (7 * b) ^ 2 < 100 * a ^ 2 = (10 * a) ^ 2, so 7 * b < 10 * a and
b ^ 2 + 7 * b < 2 * a ^ 2 + 10 * a, contradicting 2 * (t - 1) * (t - 2) < k * (k - 1).
For every k ≥ 7, 2 * k + 2 ≤ 3 * fastCutThreshold k, ensuring that linear per-node costs sum
geometrically to O((k - 4) ^ 2) across the binary recursion tree.
Recursion depth, stack workspace, query count, and time recurrences #
Recursion depth of FastCut down to the base case k ≤ 6.
Instances For
Base-case unfolding of fastCutDepth for k < 7.
Recursive unfolding of fastCutDepth for k ≥ 7.
For every k ≥ 7, 2 * 2 ^ fastCutDepth k ≤ (k - 4) ^ 2.
The recursion depth of FastCut on k vertices is at most 2 * Nat.log 2 k.
Word count of one explicit stack frame at active vertex count k:
4 header words (parentFp, k, stage, savedVal1), immutable k × k frame matrix,
working k × k contraction matrix, and k-word degree buffer.
Instances For
Total stack scratch words along any root-to-leaf active path starting at k vertices.
Instances For
Base-case unfolding of fastCutScratch for k < 7.
Recursive unfolding of fastCutScratch for k ≥ 7.
Potential-based upper bound fastCutScratch k ≤ 26 * (k - 4) ^ 2 for k ≥ 7.
Total stack workspace for FastCut on n ≥ 2 vertices is at most 26 * (n * n) words.
Worst-case rand-call budget for executing one FastCut subtree of size k.
Instances For
Base-case unfolding of fastCutNodeQueries for k < 7.
Recursive unfolding of fastCutNodeQueries for k ≥ 7.
One FastCut tree on k ≥ 2 vertices makes at most 6 * (k * k) rand calls.
Worst-case instruction budget for executing a FastCut subtree of size k inside
fastCutLoop (200 * k ^ 2 internal frame overhead across the 3 stages, 2400 at a base leaf
k ≤ 6).
Instances For
Base-case unfolding of fastCutNodeTime for k < 7.
Recursive unfolding of fastCutNodeTime for k ≥ 7.
Potential-based upper bound fastCutNodeTime k ≤ (1200 * fastCutDepth k + 2700) * (k - 4) ^ 2
for k ≥ 7.
Closed-form O(n ^ 2 log n) bound on fastCutNodeTime n for every n ≥ 2.
At k ≥ 7, contracting down to t = fastCutThreshold k preserves a fixed minimum cut with
probability t * (t - 1) / (k * (k - 1)) ≥ 1 / 2.
Sequential two-branch success probability recurrence on ProbComp: if Branch 1 hits hit₁
with probability ≥ 1 / s, any outcome in hit₁ guarantees f a b ∈ hit on every supported b,
and conditioned on any outcome outside hit₁ Branch 2 achieves f a b ∈ hit with probability
≥ 1 / s, then the combined computation hits hit with probability ≥ 2 / (s + 1).
Concrete O(log ^ 2 n) trial schedule (Nat.log 2 n + 15) * (Nat.log 2 n + 2) used by
fastCutHighProbProgram to achieve failure probability ≤ 1 / (2 * n) (instantiating the
asymptotic O(log ^ 2 n) repetition count in the proof of [KargerStein1996], Section 4,
Theorem 4.4; paraphrase).
Instances For
For every n, fastCutTrials n executes at least one FastCut tree
(1 ≤ fastCutTrials n).
Elementary failure probability bound for fastCutTrials n independent FastCut trees:
(1 - 1 / (Nat.log 2 n + 15)) ^ fastCutTrials n ≤ 1 / (2 * n).
Weakened failure probability bound (1 - 1 / (Nat.log 2 n + 15)) ^ fastCutTrials n ≤ 1 / n.