Source: NAESatisfiability
Target: MaxCut
Motivation: Classic NP-completeness reduction connecting Boolean satisfiability to graph partitioning. The Not-All-Equal structure is the key: every satisfied NAE clause contributes exactly 2 triangle edges to the cut, while every unsatisfied clause (all literals equal) contributes 0. This clean characterization establishes MaxCut as NP-hard via NAE-3SAT.
Reference: Garey, Johnson & Stockmeyer, "Some simplified NP-complete graph problems," Theoretical Computer Science 1(3), 237–267 (1976). Also: Garey & Johnson, Computers and Intractability (1979), Section 3.2.5.
Reduction Algorithm
Given a NAE-3SAT instance with $n$ variables $x_1, \ldots, x_n$ and $m$ clauses $C_1, \ldots, C_m$ (each clause has exactly 3 literals; for each clause, not all literals may be simultaneously true and not all simultaneously false):
Notation:
-
$n$ =
num_vars, $m$ = num_clauses
- For variable $x_i$, create two vertices: $v_i$ (positive literal) and $v_i'$ (negative literal)
- Forcing weight $M = 2m + 1$
Variable gadgets:
- For each variable $x_i$, create vertices $v_i$ and $v_i'$.
- Add edge $(v_i, v_i')$ with weight $M$.
Since $M = 2m+1 > 2m$ equals the maximum possible total clause contribution (at most 2 per clause), the optimal cut always cuts every variable-gadget edge. This forces $v_i$ and $v_i'$ to opposite sides. The side containing $v_i$ encodes $x_i = \text{true}$.
Clause gadgets:
3. For each clause $C_j = (\ell_a, \ell_b, \ell_c)$:
- Add a triangle of weight-1 edges: $(\ell_a, \ell_b)$, $(\ell_b, \ell_c)$, $(\ell_a, \ell_c)$.
Why NAE is essential:
For a NAE clause, the induced partition has 1 literal on one side and 2 on the other (or vice versa). A triangle with exactly $1+2$ split has exactly 2 edges crossing the cut. A triangle with all 3 on the same side contributes 0 — but the NAE constraint forbids this. Without NAE (standard 3-SAT), a clause with all literals true places all 3 literal-vertices on the same side, contributing 0 — identical to the unsatisfied case. The triangle gadget cannot distinguish the two, breaking the reduction. NAE exactly avoids this degenerate case.
Cut threshold:
4. The instance is NAE-satisfiable if and only if the maximum weighted cut $\geq n \cdot M + 2m$.
- Satisfiable: every clause contributes exactly 2 → total = $nM + 2m$.
- Unsatisfiable: every truth assignment has at least one clause with all literals equal (contributing 0) → total clause contribution $\leq 2(m-1)$ → cut $\leq nM + 2m - 2 < nM + 2m$.
Solution extraction: For variable $x_i$, if $v_i \in S$, set $x_i = \text{true}$; otherwise $\text{false}$.
Size Overhead
| Target metric (code name) |
Formula |
num_vertices |
$2n$ = 2 * num_vars
|
num_edges |
$n + 3m$ = num_vars + 3 * num_clauses
|
(Clause triangle edges connect literal-vertices of distinct variables within a clause; they are distinct from variable-gadget edges, which connect $v_i$ to $v_i'$. If a triangle edge happens to connect a complementary pair from the same variable — only possible when a clause contains both $x_i$ and $\neg x_i$ — that edge coincides with a variable-gadget edge and its weight accumulates. The formula num_vars + 3 * num_clauses is therefore a worst-case upper bound on distinct edges.)
Validation Method
- Construct small NAE-3SAT instances where no clause contains both $x_i$ and $\neg x_i$ (so no edge merging occurs), reduce to MaxCut, solve both with BruteForce.
- Verify: satisfying assignment maps to cut $= nM + 2m$.
- Verify: unsatisfiable instance has maximum cut $< nM + 2m$.
- Test both satisfiable (e.g., a colorable graph encoded as NAE-3SAT) and unsatisfiable instances.
Example
Source: NAE-3SAT with $n=3$, $m=2$, $M = 2(2)+1 = 5$
- Variables: $x_1, x_2, x_3$
-
$C_1 = (x_1, x_2, x_3)$ (NAE: not all equal)
-
$C_2 = (\neg x_1, \neg x_2, \neg x_3)$ (NAE: not all equal)
Reduction:
- Vertices: $v_1, v_1', v_2, v_2', v_3, v_3'$ (6 = $2n$ ✓)
- Variable-gadget edges: $(v_1,v_1')$ w=5, $(v_2,v_2')$ w=5, $(v_3,v_3')$ w=5
-
$C_1$ triangle: $(v_1,v_2)$ w=1, $(v_2,v_3)$ w=1, $(v_1,v_3)$ w=1
-
$C_2$ triangle: $(v_1',v_2')$ w=1, $(v_2',v_3')$ w=1, $(v_1',v_3')$ w=1
- Total edges: 9 = $n + 3m = 3 + 6$ ✓ (no merges — clause edges connect distinct-variable literal pairs)
Satisfying assignment: $x_1=T, x_2=F, x_3=F$
- Partition: $S={v_1, v_2', v_3'}$, $\bar S={v_1', v_2, v_3}$
- Variable-gadget cut: all 3 edges cross → $3 \times 5 = 15$
-
$C_1$ triangle: $(v_1, v_2)$ crosses ($v_1\in S, v_2\in\bar S$), $(v_1,v_3)$ crosses ($v_1\in S, v_3\in\bar S$), $(v_2,v_3)$ does not ($v_2,v_3\in\bar S$) → 2 edges cut ✓
-
$C_2$ triangle: $(v_1',v_2')$ crosses ($v_1'\in\bar S, v_2'\in S$), $(v_1',v_3')$ crosses ($v_1'\in\bar S, v_3'\in S$), $(v_2',v_3')$ does not ($v_2',v_3'\in S$) → 2 edges cut ✓
- Total cut = 15 + 2 + 2 = 19
-
Threshold = $nM + 2m = 3(5) + 2(2) = 19$ ✓
Unsatisfying assignment: $x_1=T, x_2=T, x_3=T$ (fails $C_1$: all true)
- Partition: $S={v_1,v_2,v_3}$, $\bar S={v_1',v_2',v_3'}$
- Variable-gadget cut: $15$
-
$C_1$ triangle: all of $v_1,v_2,v_3\in S$ → 0 edges cut
-
$C_2$ triangle: all of $v_1',v_2',v_3'\in\bar S$ → 0 edges cut
-
Total cut = 15 < 19 = threshold ✓
Source: NAESatisfiability
Target: MaxCut
Motivation: Classic NP-completeness reduction connecting Boolean satisfiability to graph partitioning. The Not-All-Equal structure is the key: every satisfied NAE clause contributes exactly 2 triangle edges to the cut, while every unsatisfied clause (all literals equal) contributes 0. This clean characterization establishes MaxCut as NP-hard via NAE-3SAT.
Reference: Garey, Johnson & Stockmeyer, "Some simplified NP-complete graph problems," Theoretical Computer Science 1(3), 237–267 (1976). Also: Garey & Johnson, Computers and Intractability (1979), Section 3.2.5.
Reduction Algorithm
Given a NAE-3SAT instance with$n$ variables $x_1, \ldots, x_n$ and $m$ clauses $C_1, \ldots, C_m$ (each clause has exactly 3 literals; for each clause, not all literals may be simultaneously true and not all simultaneously false):
Notation:
num_vars,num_clausesVariable gadgets:
Since$M = 2m+1 > 2m$ equals the maximum possible total clause contribution (at most 2 per clause), the optimal cut always cuts every variable-gadget edge. This forces $v_i$ and $v_i'$ to opposite sides. The side containing $v_i$ encodes $x_i = \text{true}$ .
Clause gadgets:$C_j = (\ell_a, \ell_b, \ell_c)$ :
3. For each clause
Why NAE is essential:$1+2$ split has exactly 2 edges crossing the cut. A triangle with all 3 on the same side contributes 0 — but the NAE constraint forbids this. Without NAE (standard 3-SAT), a clause with all literals true places all 3 literal-vertices on the same side, contributing 0 — identical to the unsatisfied case. The triangle gadget cannot distinguish the two, breaking the reduction. NAE exactly avoids this degenerate case.
For a NAE clause, the induced partition has 1 literal on one side and 2 on the other (or vice versa). A triangle with exactly
Cut threshold:$\geq n \cdot M + 2m$ .
4. The instance is NAE-satisfiable if and only if the maximum weighted cut
Solution extraction: For variable$x_i$ , if $v_i \in S$ , set $x_i = \text{true}$ ; otherwise $\text{false}$ .
Size Overhead
num_vertices2 * num_varsnum_edgesnum_vars + 3 * num_clauses(Clause triangle edges connect literal-vertices of distinct variables within a clause; they are distinct from variable-gadget edges, which connect$v_i$ to $v_i'$ . If a triangle edge happens to connect a complementary pair from the same variable — only possible when a clause contains both $x_i$ and $\neg x_i$ — that edge coincides with a variable-gadget edge and its weight accumulates. The formula
num_vars + 3 * num_clausesis therefore a worst-case upper bound on distinct edges.)Validation Method
Example
Source: NAE-3SAT with$n=3$ , $m=2$ , $M = 2(2)+1 = 5$
Reduction:
Satisfying assignment:$x_1=T, x_2=F, x_3=F$
Unsatisfying assignment:$x_1=T, x_2=T, x_3=T$ (fails $C_1$ : all true)