Skip to content

[Model] MinimumMultiwayCut #184

@hmyuuu

Description

@hmyuuu

Motivation

Fundamental graph partitioning problem that generalizes the minimum s-t cut (k=2, polynomial) to $k \geq 3$ terminals (NP-hard); important in VLSI design, image segmentation, and network design, with a direct ILP formulation.

Definition

Name: MinimumMultiwayCut
Reference: Dahlhaus, Johnson, Papadimitriou, Seymour & Yannakakis (1994), SIAM J. Comput.

Given an undirected weighted graph $G = (V, E, w)$ where $V$ is the vertex set, $E$ is the edge set, and $w : E \to \mathbb{R}_{>0}$ assigns a positive weight to each edge, and a set of $k$ terminal vertices $T = {t_1, t_2, \ldots, t_k} \subseteq V$, find a minimum-weight set of edges $C \subseteq E$ such that no two terminals remain in the same connected component of $G' = (V, E \setminus C)$.

Equivalently, $C$ must induce a partition of $V$ into $k$ disjoint subsets $V_1, \ldots, V_k$ with $t_i \in V_i$, minimizing

$$\sum_{e \in C} w(e) = \sum_{\substack{(u,v) \in E \ \exists, i \neq j: u \in V_i,, v \in V_j}} w(u, v)$$

Variables

  • Count: $m = |E|$ (one binary variable per edge)
  • Per-variable domain: binary ${0, 1}$
  • Meaning: $x_e = 1$ if edge $e \in E$ is in the cut (removed); $x_e = 0$ otherwise. A configuration is feasible if removing the cut edges ${e \mid x_e = 1}$ disconnects every pair of terminals.

Schema (data type)

Type name: MinimumMultiwayCut
Variants: MinimumMultiwayCut<G, W> where G is graph topology (SimpleGraph) and W: WeightElement is the weight type (i32, f64, One)

Field Type Description
graph G the graph $G = (V, E)$ with edge weights stored via W: WeightElement inherent methods (weights(), set_weights())
terminals Vec<usize> terminal vertex indices $T = {t_1, \ldots, t_k} \subseteq V$

Edge weights are managed through the graph's inherent weight methods, following the same pattern as MaxCut, MaximumIndependentSet, and other graph problems in the codebase.

Complexity

  • Best known exact algorithm: $O(1.84^k \cdot n^3)$ by Cao, Chen & Fan (2013), where $k = |T|$ is the number of terminals and $n = |V|$
  • Complexity string for declare_variants!: "1.84 ^ num_terminals * num_vertices ^ 3" (requires a num_terminals() getter returning self.terminals.len())
  • References: Cao, Chen & Fan (2013), FCT 2013; arXiv:1711.06397; IPL journal version

Extra Remark

The case $k = 2$ is the classical minimum $s$-$t$ cut problem, solvable in polynomial time via max-flow. For $k \geq 3$ on general graphs, the problem is NP-hard (Dahlhaus et al. 1994); it remains NP-hard even for unit weights and planar graphs. The algorithm of Cao et al. (2013) improved upon earlier $O^(2^k)$ and $O^(4^k)$ results using submodular functions on isolating cuts. A $(2 - 2/k)$-approximation is achievable in polynomial time by taking the union of the $k-1$ cheapest isolating cuts (Dahlhaus et al. 1994). See also the PAAL library implementation: https://paal.mimuw.edu.pl/docs/multiway_cut.html

How to solve

Example Instance

$n = 5$ vertices $V = {0,1,2,3,4}$, terminals $T = {0, 2, 4}$, and 6 edges with weights:

Edge Weight
(0, 1) 2
(1, 2) 3
(2, 3) 1
(3, 4) 2
(0, 4) 4
(1, 3) 5

Optimal multiway cut: remove edges ${(0,1), (0,4), (3,4)}$ with total weight $2 + 4 + 2 = \mathbf{8}$.

After removal, the connected components are ${0}$, ${1, 2, 3}$, ${4}$ — each terminal is in a distinct component. Verified by exhaustive search over all $2^6 = 64$ edge subsets: no lighter feasible cut exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions