variable edges, clause triangles, threshold n+2m

3NAE ≤p MAXCUT

3NAE≤pMAXCUT\mathrm{3NAE}\le_p\mathrm{MAXCUT} (over multigraphs), so MAXCUT\mathrm{MAXCUT} is NP-hard.

The construction

On a 3CNF formula φ\varphi over x1,…,xnx_1,\dots,x_n with mm clauses:

  1. Vertices. For each 1≤i≤n1\le i\le n, a vertex for xix_i and one for xi‾\overline{x_i} — 2n2n vertices, one per literal.
  2. Blue edges (variable edges). For each ii, an edge between xix_i and xi‾\overline{x_i} — nn edges.
  3. Red edges (clause edges). For each clause, an edge between each pair of its literals — a triangle, 33 edges per clause, 3m3m in all.
  4. Return ⟨G, n+2m⟩\langle G,\ n+2m\rangle.

Why a multigraph. Two clauses sharing a literal pair produce parallel edges, and a clause containing both xix_i and xi‾\overline{x_i} produces a red edge parallel to a blue one. These are distinct edges of the multigraph, and that is exactly what lets each clause be counted separately.

Visualization

Guided construction

NAE-3SAT → Max-Cut

Step 1 of 7
Source NAE-3CNF(x ∨ y ∨ z) ∧ (¬x ∨ y ∨ ¬z)
NAE-3SAT to multigraph Max-CutLiteral vertices with variable edges and clause triangles; a cut of size n+2m encodes an NAE assignment.Source NAE-3CNF
Variable edgeClause edge

Correctness — both directions

3NAE ∈ ⟹ MAXCUT ∈

Suppose φ∈3NAE\varphi\in\mathrm{3NAE}, with NAE-satisfying assignment VV. Define U={ ℓ ∣ ℓ a literal vertex, V(ℓ)=1 }.U=\{\,\ell\ \mid\ \ell \text{ a literal vertex},\ V(\ell)=1\,\}.

Blue edges. For each ii, exactly one of xi,xi‾x_i,\overline{x_i} gets 11 (since V(xi‾)=1−V(xi)V(\overline{x_i})=1-V(x_i)), so exactly one lies in UU; the blue edge has ∣e∩U∣=1|e\cap U|=1 and crosses. So all nn blue edges cross.

Red edges. Let CC be a clause with literals ℓ1,ℓ2,ℓ3\ell_1,\ell_2,\ell_3. Since VV NAE-satisfies CC, some jj has ℓj∈U\ell_j\in U and some j′j' has ℓj′∉U\ell_{j'}\notin U. The edge between ℓj\ell_j and ℓj′\ell_{j'} crosses. That leaves the third vertex: whichever side it takes, exactly one of the two remaining edges crosses. So of the triangle's three edges exactly two cross.

Since red edges of distinct clauses are distinct multigraph edges, the counts add: ∣cutG(U)∣=n⏟blue+2m⏟red=n+2m ≥ n+2m.|\mathrm{cut}_G(U)|=\underbrace{n}_{\text{blue}}+\underbrace{2m}_{\text{red}}=n+2m\ \ge\ n+2m . Hence ⟨G,n+2m⟩∈MAXCUT\langle G,n+2m\rangle\in\mathrm{MAXCUT}.

MAXCUT ∈ ⟹ 3NAE ∈

Suppose ⟨G,n+2m⟩∈MAXCUT\langle G,n+2m\rangle\in\mathrm{MAXCUT}; then some U⊆VU\subseteq V induces a cut with at least n+2mn+2m edges.

Step 1 — an upper bound on the red edges. This needs the opposite kind of argument from everything so far: "at least" until now, "at most" here. Let CC be a clause with its triangle. Whatever UU is: either all three vertices sit on one side (00 crossing) or they split 22–11 (exactly 22 crossing). So each clause contributes at most 22 red crossing edges, at most 2m2m overall.

Step 2 — forcing the blue edges. The cut has at least n+2mn+2m edges, at most 2m2m of them red, so at least nn blue. But the graph has exactly nn blue edges in total. So the cut has exactly nn blue edges — all of them. Hence for every ii the edge xixi‾x_i\overline{x_i} crosses, i.e. exactly one of xi,xi‾x_i,\overline{x_i} lies in UU.

Step 3 — the assignment. Define V(ℓ)=1  ⟺  ℓ∈UV(\ell)=1\iff\ell\in U for every literal vertex. By Step 2 this is consistent and well defined: from each pair {xi,xi‾}\{x_i,\overline{x_i}\} exactly one is in UU, so exactly one gets 11 and the other 00.

Step 4 — every clause is NAE-satisfied. The cut holds exactly nn blue edges, so of the at least n+2mn+2m edges, at least 2m2m are red. On the other hand each clause contributes at most 22; if one contributed less than 22 the total would fall below 2m2m — contradiction. So every clause contributes exactly two.

Let CC be a clause. Were all three of its vertices on one side it would contribute 00. So it splits: some ℓ∈C\ell\in C has ℓ∈U\ell\in U, i.e. V(ℓ)=1V(\ell)=1, and some ℓ′∈C\ell'\in C has ℓ′∉U\ell'\notin U, i.e. V(ℓ′)=0V(\ell')=0. That is precisely NAE-satisfaction. As CC was arbitrary, φ∈3NAE\varphi\in\mathrm{3NAE}.

Cost of the reduction

TimeO(|φ|)
SpaceO(|φ|)
Output sizeO(|φ|)

Linear, and that is the point: clause edges number exactly three per clause, because the formula is 3CNF. Red edges total 3m≤3∣φ∣3m\le3|\varphi|. Had clauses been of arbitrary length, the edges per clique would be quadratic in clause length — and this would not be linear.

What it buys

MAXCUT\mathrm{MAXCUT} is NP-hard, and lies in NP\mathrm{NP} (witness UU; the verifier counts edges with ∣e∩U∣=1|e\cap U|=1), hence NP-complete. The simple-graph version stays hard — see MAXCUT-MULTI≤pMAXCUT-SIMPLE\mathrm{MAXCUT\text{-}MULTI}\le_p\mathrm{MAXCUT\text{-}SIMPLE}.

Pitfalls

  • Why exactly 33. The trick is that a triangle contributes exactly 22 or exactly 00 — nothing else is possible. For a clause of size 44 or 55 the free vertices can split several ways and the crossing count is no longer forced; the upper bound in Step 1 goes slack and the forcing in Step 2 breaks.

  • There is no "running the reduction backwards". In the ⇐\Leftarrow direction students tend to think a formula must be built from a graph. It must not: we began with a given φ\varphi, from which the algorithm built GG, so we hold both and know exactly what GG looks like. At no point do we say "let GG be a graph".

The chain

Where this was read from

  • Lesson 10משפט 4: 3NAE≤pMAXCUT\mathrm{3NAE} \le_p \mathrm{MAXCUT}, ולכן MAXCUT\mathrm{MAXCUT} היא NP-קשה
  • Guided exercisemax-cut-multi-nae-reduction
  • 2026"Prove the described algorithm is a polynomial-time reduction from 3-NAE to Max-Cut-Multi" — the paper spells the construction out in full.