Motivation
Not-All-Equal SAT (G&J LO3) is a fundamental SAT variant with a beautiful symmetry property (if α is a solution, so is ¬α) and deep connections to graph coloring and MaxCut. It bridges the formula and graph problem categories. NAE-3SAT is the standard intermediate problem in the classic 3SAT → MaxCut reduction chain (relevant to #166).
Associated rule issues:
Definition
Name: NAESatisfiability
Reference: Schaefer, T. J. (1978). "The complexity of satisfiability problems." Proc. 10th STOC, 216–226. Also Garey & Johnson (1979), Problem LO3.
Given a Boolean formula in CNF with n variables x_1, ..., x_n and m clauses C_1, ..., C_m, find a truth assignment such that in every clause, not all literals have the same truth value — i.e., each clause contains at least one true literal and at least one false literal.
Key symmetry: if α is a NAE-satisfying assignment, so is ¬α (the complement).
Variables
- Count: n (one per Boolean variable)
- Per-variable domain: binary {0, 1}
- Dims:
[2; n] — n binary variables
- Meaning: x_i = 1 iff variable i is assigned true. A configuration is satisfying if every clause contains at least one true literal and at least one false literal.
Schema (data type)
Type name: NAESatisfiability
Variants: none (reuses CNFClause from existing SAT infrastructure)
| Field |
Type |
Description |
num_vars |
usize |
Number of Boolean variables n |
clauses |
Vec<CNFClause> |
Clauses; each clause has ≥ 2 literals |
Size fields: num_vars = n, num_clauses = m, num_literals = total literal count.
Complexity
- Best known exact algorithm:
2^num_vars — brute-force over all assignments (halved to 2^(n-1) by NAE symmetry — fix x_1 = true). No dedicated sub-2^n algorithm substantially better than 3-SAT.
- References: Schaefer (1978), dichotomy theorem.
Extra Remark
NAE-SAT has complement symmetry: any NAE-satisfying assignment and its bitwise complement are both solutions. This makes NAE-SAT naturally connected to MaxCut (partition problems). NAE-3-SAT remains NP-complete even for monotone instances (no negated literals), proven by Schaefer (1978). It is a key problem in Schaefer's dichotomy theorem classifying tractable vs NP-complete Boolean CSPs.
Reduction Rule Crossref
How to solve
Example Instance
Variables: x_1, x_2, x_3, x_4, x_5 (n = 5)
Clauses (NAE-3-SAT):
- C_1: (x_1, x_2, ¬x_3)
- C_2: (¬x_1, x_3, x_4)
- C_3: (x_2, ¬x_4, x_5)
- C_4: (¬x_2, x_3, ¬x_5)
- C_5: (x_1, ¬x_3, x_5)
m = 5 clauses, search space = 2^5 = 32 configurations.
Expected Outcome
Satisfying solution: config = [0, 0, 0, 1, 1] (x_1=F, x_2=F, x_3=F, x_4=T, x_5=T)
- C_1: (F, F, T) — not all equal ✓
- C_2: (T, F, T) — not all equal ✓
- C_3: (F, F, T) — not all equal ✓
- C_4: (T, F, F) — not all equal ✓
- C_5: (F, T, T) — not all equal ✓
Complement config = [1, 1, 1, 0, 0] is also a solution (NAE symmetry).
Total NAE-satisfying assignments: 10 (5 complement pairs).
BibTeX
@article{Schaefer1978,
author = {Thomas J. Schaefer},
title = {The Complexity of Satisfiability Problems},
journal = {Conference Record of the 10th Annual ACM Symposium on Theory of Computing (STOC)},
pages = {216--226},
year = {1978},
doi = {10.1145/800133.804350}
}
Motivation
Not-All-Equal SAT (G&J LO3) is a fundamental SAT variant with a beautiful symmetry property (if α is a solution, so is ¬α) and deep connections to graph coloring and MaxCut. It bridges the formula and graph problem categories. NAE-3SAT is the standard intermediate problem in the classic 3SAT → MaxCut reduction chain (relevant to #166).
Associated rule issues:
Definition
Name:
NAESatisfiabilityReference: Schaefer, T. J. (1978). "The complexity of satisfiability problems." Proc. 10th STOC, 216–226. Also Garey & Johnson (1979), Problem LO3.
Given a Boolean formula in CNF with n variables x_1, ..., x_n and m clauses C_1, ..., C_m, find a truth assignment such that in every clause, not all literals have the same truth value — i.e., each clause contains at least one true literal and at least one false literal.
Key symmetry: if α is a NAE-satisfying assignment, so is ¬α (the complement).
Variables
[2; n]— n binary variablesSchema (data type)
Type name:
NAESatisfiabilityVariants: none (reuses CNFClause from existing SAT infrastructure)
num_varsusizeclausesVec<CNFClause>Size fields:
num_vars= n,num_clauses= m,num_literals= total literal count.Complexity
2^num_vars— brute-force over all assignments (halved to 2^(n-1) by NAE symmetry — fix x_1 = true). No dedicated sub-2^n algorithm substantially better than 3-SAT.Extra Remark
NAE-SAT has complement symmetry: any NAE-satisfying assignment and its bitwise complement are both solutions. This makes NAE-SAT naturally connected to MaxCut (partition problems). NAE-3-SAT remains NP-complete even for monotone instances (no negated literals), proven by Schaefer (1978). It is a key problem in Schaefer's dichotomy theorem classifying tractable vs NP-complete Boolean CSPs.
Reduction Rule Crossref
How to solve
Example Instance
Variables: x_1, x_2, x_3, x_4, x_5 (n = 5)
Clauses (NAE-3-SAT):
m = 5 clauses, search space = 2^5 = 32 configurations.
Expected Outcome
Satisfying solution: config = [0, 0, 0, 1, 1] (x_1=F, x_2=F, x_3=F, x_4=T, x_5=T)
Complement config = [1, 1, 1, 0, 0] is also a solution (NAE symmetry).
Total NAE-satisfying assignments: 10 (5 complement pairs).
BibTeX