Skip to content

[Rule] GraphPartitioning to MaxCut #120

@zazabap

Description

@zazabap

Source: GraphPartitioning
Target: MaxCut
Motivation: Reveals the duality between minimizing and maximizing cut edges; enables using MaxCut solvers for bisection via a complementary objective.
Reference: Garey, Johnson & Stockmeyer, 1976 — establishes NP-completeness of Max Cut and Graph Bisection. The penalty-weighted complete graph construction below is folklore in combinatorial optimization.

Reduction Algorithm

Notation:

  • Source: undirected graph $G = (V, E)$, $n = |V|$ (even), $m = |E|$
  • Target: MaxCut on a weighted complete graph $G' = (V, E')$ with $E' = \binom{V}{2}$
  • Penalty weight: $P = m + 1$

Key idea: Build a weighted complete graph where original edges are penalized (lower weight) and all pairs receive a balance-rewarding weight. For $P > m$, the penalty term dominates, forcing balanced partitions; among balanced partitions, the maximum weighted cut corresponds to the minimum original bisection.

Construction:

  1. $V' = V$ (same vertex set).
  2. For each pair $(i, j)$ with $i < j$, set weight:

$$w'_{ij} = \begin{cases} P - 1 & \text{if } (i,j) \in E \ P & \text{if } (i,j) \notin E \end{cases}$$

The combined objective over a partition $(A, B)$ is:

$$\text{cut}_{G'}(A, B) = P \cdot |A| \cdot |B| - \text{cut}_G(A, B)$$

Proof that $P = m + 1$ suffices:

Let $(A_1, B_1)$ be any balanced partition and $(A_2, B_2)$ any unbalanced partition. We need $\text{cut}{G'}(A_1, B_1) > \text{cut}{G'}(A_2, B_2)$, i.e.:

$$P \cdot |A_1||B_1| - \text{cut}_G(A_1, B_1) > P \cdot |A_2||B_2| - \text{cut}_G(A_2, B_2)$$

Rearranging: $P(|A_1||B_1| - |A_2||B_2|) > \text{cut}_G(A_1, B_1) - \text{cut}_G(A_2, B_2)$.

  • LHS: For $n$ even, $|A||B|$ is uniquely maximized at $|A| = |B| = n/2$, giving $|A_1||B_1| - |A_2||B_2| \geq 1$. So $\text{LHS} \geq P = m + 1$.
  • RHS: $\text{cut}_G(A_1, B_1) \leq m$ and $\text{cut}_G(A_2, B_2) \geq 0$, so $\text{RHS} \leq m$.

Therefore $\text{LHS} \geq m + 1 > m \geq \text{RHS}$. ∎

Among balanced partitions, $P \cdot (n/2)^2$ is constant, so maximizing $\text{cut}_{G'}$ is equivalent to minimizing $\text{cut}_G(A, B)$.

Solution extraction: Vertex indices map directly — the partition assignment vector from the MaxCut solution is identical to the GraphPartitioning solution.

Size Overhead

Target metric (code name) Formula (in terms of source getters)
num_vertices num_vertices
num_edges num_vertices * (num_vertices - 1) / 2

Validation Method

Closed-loop testing: solve GraphPartitioning by brute-force, solve the reduced MaxCut, and verify the extracted partition matches the optimal bisection.

Example

Source: 6 vertices, 9 edges: $(0,1), (0,2), (1,2), (1,3), (2,3), (2,4), (3,4), (3,5), (4,5)$.

MaxCut graph $G'$: 6 vertices, $\binom{6}{2} = 15$ weighted edges. With $P = m + 1 = 10$:

Original edges (weight $P - 1 = 9$):
$(0,1), (0,2), (1,2), (1,3), (2,3), (2,4), (3,4), (3,5), (4,5)$ — 9 edges

Non-edges (weight $P = 10$):
$(0,3), (0,4), (0,5), (1,4), (1,5), (2,5)$ — 6 edges

Optimal partition $A = {0,1,2}$, $B = {3,4,5}$:

  • Crossing original edges: $(1,3), (2,3), (2,4)$ — 3 edges at weight 9 → $27$
  • Crossing non-edges: $(0,3), (0,4), (0,5), (1,4), (1,5), (2,5)$ — 6 edges at weight 10 → $60$
  • Total cut value: $27 + 60 = 87$

This is the unique maximum among all 10 balanced partitions (next best: 85). The corresponding GraphPartitioning solution has minimum bisection cut = 3.

An unbalanced partition $|A| = 2, |B| = 4$ cuts at most $2 \times 4 = 8$ cross-pairs (vs $3 \times 3 = 9$ for balanced), so the penalty term is strictly smaller, confirming $P = 10$ enforces balance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.ruleA new reduction rule to be added.

    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