Weighted maximum cut #
MaxCut is the set of MaxCutInstance values (edges, bound) such that some set S of
vertices cuts edges of total weight at least bound [Kar72]
Garey and Johnson, Problem ND16: an edge crosses the cut when exactly one of
its endpoints lies in S. Vertices, weights and the bound are natural numbers in binary
(encNat). The edge list is a weighted multigraph of MaxCut.WeightedEdge: parallel edges add
their weights and self-loops never cross a cut. Weights may be zero. MaxCut.cutWeight reads the
weight of a cut from an encodable edge list, without a vertex type; Cslib.WeightedCut.cutWeight
is the corresponding weight for a weight matrix on a Fintype.
Karp's reduction from Partition takes the complete graph on the positions 0, …, n - 1 of the
numbers a, with weight a[i] * a[j] on the edge between positions i < j
(Partition.toMaxCut). A cut putting numbers of sum x on one side has weight x * (σ - x),
where σ = a.sum (Partition.cutWeight_productEdges), and x * (σ - x) ≥ ⌈σ² / 4⌉ holds
exactly when 2 * x = σ. The bound is ⌈σ² / 4⌉ = (σ * σ + 3) / 4. All weights are products
of two input numbers, so the reduction is polynomial in the binary encoding.
Main definitions #
Cslib.Complexity.MaxCut.WeightedEdge,Cslib.Complexity.MaxCut.encWeightedEdge: weighted edges and their binary encoding.Cslib.Complexity.MaxCut.crosses,Cslib.Complexity.MaxCut.cutWeight: edges crossing a cut and the weight of a cut.Cslib.Complexity.MaxCutInstance,Cslib.Complexity.encMaxCut,Cslib.Complexity.MaxCut: problem instances, binary encoding and decision set.Cslib.Complexity.MaxCut.verifier: a subset verifier selecting the sideSof the cut among the endpoints.Cslib.Complexity.Partition.productEdges,Cslib.Complexity.Partition.toMaxCut: Karp's reduction.
Main results #
Cslib.Complexity.MaxCut.isVerifier,Cslib.Complexity.MaxCut.mem_NP:MaxCut ∈ NP encMaxCut.Cslib.Complexity.mem_Partition_iff_exists_side: a partition is a set of positions holding half of the total sum.Cslib.Complexity.Partition.cutWeight_productEdges: a cut of the complete graph has the weight of the product of the two sides.Cslib.Complexity.Partition.toMaxCut_mem_iff: correctness of the reduction.Cslib.Complexity.polyTimeReducible_Partition_MaxCut,Cslib.Complexity.MaxCut_npHard,Cslib.Complexity.MaxCut_npComplete:MaxCutisNP-complete.
References #
Instances For
Instances For
Weighted edges are encoded as (u, v, weight) in binary.
Instances For
Whether the edge e crosses the cut whose sides are given by side.
Instances For
The weight of the cut side in the weighted edges E: the total weight of the crossing
edges. Parallel edges add their weights; self-loops never cross.
Instances For
The endpoints of the weighted edges E, in order and with repetitions.
Instances For
An instance of weighted maximum cut: a list of weighted edges and a target cut weight bound.
- edges : List MaxCut.WeightedEdge
The weighted edges of the multigraph.
- bound : ℕ
The target cut weight bound.
Instances For
Instances For
Instances For
Instances of MaxCut are encoded as the framed list of weighted edges followed by the bound,
all in binary.
Instances For
The check of a side S of a cut, given as a list: the cut has weight at least the bound.
Instances For
The verifier for MaxCut, a subset verifier (Cslib.Complexity.subsetVerifier): select the
side of the cut among the endpoints and check the weight of the cut.
Instances For
The check of a side of a cut is polynomial-time.
The MaxCut verifier is polynomial-time.
MaxCut.verifier verifies MaxCut with certificates of twice the length of the encoded
instance.
The weighted edges of the complete graph on the positions 0, …, n - 1 of the numbers a:
the edge between positions i < j has weight a[i] * a[j].
Instances For
A cut of the complete graph weighted by products has the weight of the product of the sums of its two sides.
The reduction toMaxCut is computable in polynomial time.
Partition reduces to MaxCut in polynomial time.
Weighted maximum cut is NP-complete, with the weights in binary [Kar72].