Cuts of weighted multigraphs #
An undirected weighted multigraph without self-loops on a finite vertex type V is given here by
its symmetric weight matrix W : V → V → ℕ with zero diagonal (Cslib.WeightedCut.IsMultigraph):
W u v is the total weight, or the number of parallel edges, joining distinct u and v. A set
C of vertices with C and its complement both nonempty is a non-trivial cut, its weight is the
total weight of the edges between C and its complement, and the global minimum cut weight is the
least weight of a non-trivial cut.
Contracting a multigraph along a surjective map part : V → U of the vertices onto supervertices
sums the weights between the vertices sent to distinct supervertices
(Cslib.WeightedCut.IsContractionOf). Pulling a cut of the contracted multigraph back to the
original vertices gives a cut of the same weight (Cslib.WeightedCut.cutWeight_pullbackCut), so
contraction never decreases the global minimum cut weight. Karger's contraction algorithm and the
Karger–Stein algorithm (CslibFrontier.Algorithms.Karger.Graph) are built on these facts.
The multigraphs given by their ends (Cslib.Multigraph) have weight matrices with the same cut
weights; see CslibFrontier.Foundations.Combinatorics.WeightedCut.Multigraph.
Main definitions #
Cslib.WeightedCut.IsMultigraph: a symmetric weight matrix with zero diagonal.Cslib.WeightedCut.IsNonTrivialCut: a set of vertices whose complement is also nonempty.Cslib.WeightedCut.cutWeight,Cslib.WeightedCut.minCut: cut weights and the global minimum cut weight.Cslib.WeightedCut.rowDeg,Cslib.WeightedCut.totalDoubledWeight: weighted degrees and their sum, twice the total edge weight.Cslib.WeightedCut.pullbackCut,Cslib.WeightedCut.IsContractionOf: cuts pulled back along a supervertex map, and contracted multigraphs.
Main results #
Cslib.WeightedCut.cutWeight_compl: a cut and its complement have the same weight.Cslib.WeightedCut.cutWeight_singleton: a singleton cut weighs the degree of its vertex.Cslib.WeightedCut.cutWeight_fin_two,Cslib.WeightedCut.totalDoubledWeight_fin_two: on two vertices, every non-trivial cut weighs the weight of the edge, and the degrees sum to twice it.Cslib.WeightedCut.le_minCut_iff: with at least two vertices,m ≤ minCut Wexactly when every non-trivial cut weighs at leastm.Cslib.WeightedCut.mul_minCut_le_totalDoubledWeight:|V| * minCut Wis at most the sum of the degrees.Cslib.WeightedCut.cutWeight_pullbackCut: pulling a cut back along a contraction preserves its weight.Cslib.WeightedCut.minCut_le_of_isContractionOf: contraction does not decrease the global minimum cut weight.Cslib.WeightedCut.two_vertex_contraction_output: a contraction to two supervertices gives a non-trivial cut of the original multigraph whose weight is the remaining edge weight.
Weighted multigraphs and global minimum cuts #
An undirected weighted multigraph without self-loops on the vertices V is a symmetric weight
matrix W : V → V → ℕ with zero diagonal.
Instances For
Total weight of edges crossing (C, Finset.univ \ C), for weights in any additive
commutative monoid (natural numbers for multigraphs, or a linearly ordered field such as ℝ).
Instances For
For symmetric weights, the cut (Finset.univ \ C, C) weighs as much as (C, Finset.univ \ C).
On two vertices, every non-trivial cut weighs the weight of the edge.
On two vertices, the sum of the degrees is twice the weight of the edge.
Global minimum cut weight of a multigraph W, defined as the greatest lower bound of
cutWeight W C over all non-trivial cuts C.
Instances For
Supervertex maps and contractions #
Pull back a cut B of the supervertices along a supervertex map part : V → U.
Instances For
W : U → U → ℕ is the contracted multigraph of W₀ : V → V → ℕ along the surjective
supervertex assignment part : V → U: the weight between distinct supervertices is the total
weight between the vertices sent to them.
- surj : Function.Surjective part
- multigraph : IsMultigraph W