TCSLib

93 Complexity — NAESAT To Coloring

93.1 Overview

This module formalises the polynomial-time reduction from Not-All-Equal 3-SAT (NAE-SAT) to 3-Coloring. Given a NAE-SAT instance over Boolean variables \(x_1,\dots ,x_n\) and clauses \(C_1,\dots ,C_m\), it constructs an explicit simple graph whose 3-colorability is equivalent to the satisfiability of the instance, and proves both completeness and soundness of that correspondence.

93.2 Declarations

Definition 93.1 NAE clause satisfaction
#

Given a Boolean assignment \(\mathit{assign} : V \to \mathtt{Bool}\) and a Not-All-Equal clause \(c\) with three variables \(c.v_0, c.v_1, c.v_2\), \(\texttt{NAEtoColor.SatisfiesClause}\) returns \(\mathtt{true}\) if and only if the three assigned values are not all equal, i.e. at least two of \(\mathit{assign}(c.v_0)\), \(\mathit{assign}(c.v_1)\), \(\mathit{assign}(c.v_2)\) differ.

Definition 93.2 NAE-SAT instance
#

A NAE-SAT instance over variable type \(V\) is defined as a list of NAE clauses, i.e. \(\texttt{NAEtoColor.NAESat3}\; V = \mathtt{List}\; (\mathtt{NAEclause}\; V)\).

Definition 93.3 Global NAE-SAT satisfaction
#

Given an assignment \(\mathit{assign} : V \to \mathtt{Bool}\) and a NAE-SAT instance \(f\), \(\texttt{NAEtoColor.SatisfiesNAE3}\) returns \(\mathtt{true}\) if and only if every clause in \(f\) is satisfied by \(\mathit{assign}\) (i.e. \(\texttt{NAEtoColor.SatisfiesClause}\) holds for each clause).

Definition 93.4 NAE-SAT satisfiability
#

A NAE-SAT instance \(f\) over variable type \(V\) is satisfiable if there exists a Boolean assignment \(\mathit{assign} : V \to \mathtt{Bool}\) such that \(\texttt{NAEtoColor.SatisfiesNAE3}\; \mathit{assign}\; f = \mathtt{true}\).

Definition 93.5 Example NAE-SAT instance
#

A concrete NAE-SAT instance over \(\mathrm{Fin}\, 5\) consisting of three clauses: \(\langle 0,1,2\rangle \), \(\langle 0,1,3\rangle \), \(\langle 0,2,4\rangle \).

Definition 93.6 Example assignment
#

A concrete Boolean assignment for \(\mathrm{Fin}\, 5\) given by \(\! [{\mathtt{true}},{\mathtt{true}},{\mathtt{false}},{\mathtt{false}},{\mathtt{false}}]\), which witnesses satisfiability of NAEtoColor.NAE_SAT_Example.nae_sat_eg.

Definition 93.7 3-colorability
#

A simple graph \(G\) on vertex type \(V'\) is 3-colorable if there exists a proper coloring \(G.\mathtt{Coloring}\; (\mathrm{Fin}\, 3)\), i.e. a map from vertices to \(\{ 0,1,2\} \) such that no two adjacent vertices share the same color.

Definition 93.8 Reduction vertex type
#

The vertex set of the reduction graph is an inductive type with three constructors:

  • \(\mathtt{groundNode}\) — a single ground vertex (colored “neutral”);

  • \(\mathtt{varNode}\; v\) — one vertex per variable \(v \in V\);

  • \(\mathtt{clauseNode}\; c\; k\) — three internal gadget vertices (\(k \in \mathrm{Fin}\, 3\)) for each clause \(c\).

Definition 93.9 Reduction edge relation
#

Given a NAE-SAT instance \(\mathit{clauses}\), the directed edge relation on \(\texttt{NAEtoColor.OutputVertex}\; V\) is defined by: (1) \(\mathtt{groundNode}\) is adjacent to every \(\mathtt{varNode}\); (2) \(\mathtt{varNode}\; v\) is adjacent to \(\mathtt{clauseNode}\; c\; i\) when \(v\) is the \(i\)-th variable of clause \(c\); (3) two clause-gadget nodes \(\mathtt{clauseNode}\; c\; i\) and \(\mathtt{clauseNode}\; c\; j\) are adjacent when \(c \in \mathit{clauses}\) and \(i \neq j\) (forming a triangle within each clause gadget). All other pairs are non-adjacent.

Definition 93.10 Reduction graph

Given a NAE-SAT instance \(f\), \(\texttt{NAEtoColor.ReductionGraph}\; f\) is the simple graph on \(\texttt{NAEtoColor.OutputVertex}\; V\) whose adjacency is the symmetrization of \(\texttt{NAEtoColor.EdgeRelation}\; f\) restricted to distinct pairs (no self-loops).

Definition 93.11 Clause-gadget node coloring
#

Given three Boolean values \(a, b, c\) (the truth values of a clause’s three literals) and an index \(k \in \mathrm{Fin}\, 3\), returns the color in \(\mathrm{Fin}\, 3\) assigned to the \(k\)-th internal clause-gadget node. The coloring is chosen so that all three gadget nodes receive distinct colors whenever \((a, b, c)\) is a NAE-satisfying assignment; if the assignment is not NAE-satisfying, all gadget nodes are colored \(0\).

Definition 93.12 NAE-to-coloring coloring map
#

Given a Boolean assignment \(\mathit{assign} : V \to \mathtt{Bool}\), defines a coloring of all vertices of the reduction graph by: \(\mathtt{groundNode} \mapsto 0\); \(\mathtt{varNode}\; v \mapsto 1\) if \(\mathit{assign}(v) = \mathtt{true}\), else \(2\); \(\mathtt{clauseNode}\; c\; k \mapsto \texttt{NAEtoColor.clauseNodeColor}\; (\mathit{assign}(c.v_0))\; (\mathit{assign}(c.v_1))\; (\mathit{assign}(c.v_2))\; k\).

If a NAE-SAT instance \(f\) over variable type \(V\) is satisfiable, then the reduction graph \(\texttt{NAEtoColor.ReductionGraph}\; f\) is 3-colorable. Concretely, any satisfying assignment yields the proper coloring \(\texttt{NAEtoColor.naeColoring}\).

If the reduction graph \(\texttt{NAEtoColor.ReductionGraph}\; f\) is 3-colorable, then the NAE-SAT instance \(f\) is satisfiable. The assignment is recovered by comparing each variable-node color to the “true” color (ground color \(+1 \pmod{3}\)); the triangle gadgets within each clause force the three variable colors to be not all equal, yielding a NAE-satisfying assignment.

Theorem 93.15 NAE-SAT iff 3-colorable

For any NAE-SAT instance \(f\) over variable type \(V\),

\[ \texttt{NAEtoColor.IsSatisfiable}\; f \; \iff \; \texttt{NAEtoColor.Is3Colorable}\; (\texttt{NAEtoColor.ReductionGraph}\; f). \]

This is the main reduction theorem, combining completeness and soundness.