Objective: Find the edge cut of minimum cardinality of a connected multigraph , aka the Min-cut problem
The key operation is the node contraction, which for edge merges and into a single node. The operation never decreases the min-cut size.
Crucial Property
For each edge cut of , it exists an edge cut C of G such that
IDEA: if I perform contractions, I reduce to a multigraph with only two nodes. If the contractions avoid the edges of a fixed min-cut, then corresponds to
def FULL_CONTRACTION(G=(V,E)):
for i in range(|V|-2):
e = random(E) # select a random edge (accounting for multiplicities)
G <- G/e
return |E|def KARGER(G,s):
min_cont = +infty
for _ in range(s):
t = FULL_CONTRACTION(G)
min_cont = min(min_cont, t)
return min_cont