The contraction structure over memory #
The contraction structure Karger.spec is implemented over the memory oracle Memory.spec w by
the programs of Karger.Memory.Layout (size, total, pairAt) and Karger.Memory.Contract
(contract), on the layout of a Layout. This file assembles them into a refinement.
refinement: aRefinement Karger.spec (Memory.spec w)with invariantInvand abstractionabs.amortized: each operation on a graph ofksupervertices costs at mostopCharge, which is one memory unit forsizeandtotal,2 k + 1forpairAtand7 k + 7forcontract. Soamortized_capacitybounds every operation by7 C + 7at capacityC.framed: the same refinement as aMemory.Framed, whose footprint is the layout's region, so it joins products with other structures in one memory.
Each obligation comes from one weakest-precondition lemma per operation (wp_methods), through
StateTransitionSpec.wp_iff. Nothing here mentions a register or an instruction.
Karger's algorithm over memory (kargerProg) is the client karger linked through the
refinement with its coins passed through (hop, which is refinement.toRandomized.withCoins).
Every law proved on the specification transfers through RandomizedRefinement.run_link
(map_run_kargerProg): the success probability 2 / (n (n - 1)) and the one-sided error. The
costs transfer through Refinement.Amortized.toRandomized and
RandomizedRefinement.ExpectedAmortized.withCoins: the expected memory cost, counting a unit per
coin, is at most (n - 2) (1 + 4 (7 C + 7)) + 2 (7 C + 7) at capacity C
(expectedCost_kargerProg_le), which is O(n²) when the layout is sized to the input
(exists_expectedCost_kargerProg_isBigO).
Main definitions #
methods,opCharge: the operations as memory programs, and their charges.refinement,framed: the implementation as a refinement, and as a framed one.hop,kargerProg: the distributional hop, and Karger's algorithm over memory.
Main results #
wp_methods: each operation realizes the specified step, preserves the invariant, costs at mostopCharge, and changes no cell outside the layout.amortized,amortized_capacity: the cost certificates.map_run_kargerProg: the law of Karger's algorithm over memory, read through the abstraction, is its law on the specification.two_div_le_toOuterMeasure_kargerProg,minCut_le_of_mem_support_kargerProg: Karger's theorem and the one-sided error over memory.expectedCost_karger_le: the expected charge ofkargeron the specification.expectedCost_kargerProg_le,expectedCoins_kargerProg_le: the expected memory cost and the expected number of coins over memory.exists_expectedCost_kargerProg_isBigO: the expected memory cost isO(n²).
References #
The operations of the contraction structure as memory programs.
The memory charge of each operation on a graph of k supervertices: one unit for the size
and the total, 2 k + 1 for the sampling query, and 7 k + 7 for a contraction.
Every operation over memory. From a state satisfying the invariant, each admissible
operation answers and steps as the specification, preserves the invariant, costs at most
opCharge, keeps the frontier and changes no cell outside the layout.
The contraction structure over memory.
Cost. Each operation costs at most opCharge memory units, with no potential.
At most capacity supervertices, every operation costs at most 7 capacity + 7 memory
units.
The framed implementation. The refinement, with the layout's region as its footprint.
The framed implementation has the same costs.
Karger's algorithm over memory #
The distributional hop: the memory implementation, with coins passed through.
Karger's algorithm over memory: karger, with every call of the contraction structure
replaced by its memory program.
The law transfers. From a memory state satisfying the invariant, the law of Karger's
algorithm over memory, read through the abstraction, is the law of karger on the specification,
provided karger is admissible there.
Karger's theorem over memory. From a memory state holding a connected multigraph on
n ≥ 2 vertices, Karger's algorithm over memory answers the minimum cut weight with probability
at least 2 / (n (n - 1)).
One-sided error over memory. Every answer of Karger's algorithm over memory, from a
memory state holding a multigraph on n ≥ 2 vertices, is at least the minimum cut weight.
Cost #
Over a deterministic specification with coins, a call charges its cost, then continues with its answer from the next state.
Expected calls of karger on the specification. From a graph on n vertices, at one unit
per coin and K per call of the structure, karger costs at most (n - 2) (1 + 4 K) + 2 K in
expectation.
Expected memory cost of Karger's algorithm. From a memory state holding a multigraph on
n ≥ 2 vertices at capacity C, Karger's algorithm over memory costs at most
(n - 2) (1 + 4 (7 C + 7)) + 2 (7 C + 7) memory units in expectation, counting one unit per
coin.
Expected coins of Karger's algorithm over memory. It draws at most n - 2 coins in
expectation.
The exported cost. With the layout sized to the input, the expected memory cost of
Karger's algorithm over memory on n vertices is at most F n for some F that is O(n²).