Chromatic Polynomials 11 – Boolean Satisfiability
- 2 hours ago
- 4 min read
I keep touting CPs as a language of logic. Let’s see how well that claim holds up by comparing it to a well-established language of logic, Boolean Satisfiability (or “SAT”).
SAT Introduction
A SAT expression is an expression containing multiple Boolean variables, e.g. x1, x2, x3, etc., where each variable can be true or false (often “0” and “1” are used in place of false and true). An expression is satisfiable if there are values for its variables which result in the expression evaluating to true. The simplest possible expression consists of a single variable, e.g. x, and is satisfiable if and only if x is true. The expression can also contain the following operators:
NOT, ¬: The expression ¬x1 is satisfiable if x1 is false.
AND, ˄: The expression x1 ˄ x2 is satisfiable if and only if x1 and x2 are both true.
OR,˅: The expression x1 ˅ x2 is satisfiable if either x1 or x2 are true.
These operations are combined to form more complex logical expressions:
(x1 ˅ ¬x3) ˄ ¬(x1 ˅ x2)
This expression is only satisfiable if x1, x2, and x3 are all false.
As with all good languages of logic, DeMorgan’s laws apply:
¬(x1 ˅ x3) = ¬x1 ˄ ¬x2
¬(x1 ˄ x2) = ¬x1 ˅ ¬x2
This is only the briefest possible introduction to SAT problems. There are many variants to SAT problems and an entire field of mathematics dedicated to their study. SAT is a true language of logic.
Translating SAT expressions to CPs
Every SAT expression can be converted to a Chromatic Polynomial, with a few simple transformations:
A single variable must be converted to a Kronecker Delta comparing a vertex to true. For brevity, I’ll use 0 and 1 for false and true:
x1 => δσ1{1}
The B-SAT NOT operation is converted to the CP NOT expression, (1 - …):
¬x1 => (1 - δσ1{1})
Note that if the expression being negated is a single variable, then it can be converted to comparing the vertex to 0 instead of 1:
¬x1 => δσ1{0}
The SAT AND operation is converted to the product of the AND operands:
x1 ˄ x2 => δσ1{1} δσ2{1}
Note that the rules for multiplying EKDs allow us to reduce this example to:
x1 ˄ x2 => δσ1σ2{1}
The B-SAT OR operation is converted to the CP OR expression:
x1 ˅ x2 => 1 - δσ1{0}δσ2{0}
which can be reduced to:
x1 ˅ x2 => 1 - δσ1σ2{0}
Note that this makes use of DeMorgan’s laws, since a direct translation to addition, δσ1{1} + δσ2{1}, is only correct if the two terms are mutually exclusive.
Here is a sample SAT expression:
(x1 ∨ ¬x2) ∧ (¬x1 ∨ x2 ∨ x3) ∧ ¬x1
The solution requires us to find values for x1, x2, and x3 such that the expression is true. By visual inspection, we can see that the final term, ¬x1, requires that x1 is false. If x1 is false, then x2 must be false for (x1 ∨ ¬x2) to be true. The middle term, (¬x1 ∨ x2 ∨ x3), is true because ¬x1 is true, leaving no constraints on x3. Thus, we have two solutions:
x1 = false, x2 = false, x3 = false
and
x1 = false, x2 = false, x3 = true
We can translate this expression directly to CPs with the following operators:
x1 becomes δσ1{1}
¬x1 becomes δσ1{0}. Note that we could also use (1 - δσ1{1}), but this creates extra terms and slows down processing.
(A ∧ B) becomes AB
(A ∨ B) becomes either (1 – (1 – A)(1 – B)) or (A + B - AB). The first form is more preferred, since it is easier to expand to more terms.
Translating the sample SAT expression to CPs gives us:
(1 - (1 - δσ1{1}) (1 - δσ2{0})) (1 - (1 - δσ1{0}) (1 - δσ2{1}) (1 - δσ3{1})) * δσ1{0}
Summing the CP’s vertices from 0 to 1 will show us that there are 2 solutions.
Solving Satisfiability CPs
To find solutions, we use the same Solution method we used to solve logic puzzles – try a value for a vertex. If the sum is 0, then no solutions have that vertex set to that value. If the sum is 1 or more, we can save that value for that vertex and continue to find solution values for the other vertices.
Simplifying before Summing
Since the previous article showed how we can save work by simplifying before summing, let’s try that with this SAT-to-CP example. We can reduce the CP by replacing (1 - δσn{0}) with δσn{1} and (1 - δσn{1}) with δσ2{0}.
(1 - δσ1{0}*δσ2{1}) (1 - δσ1{1} δσ2{0} δσ3{0}) δσ1{0}
We can combine EKDs that share a single constant, replacing δσ2{0} * δσ3{0} with δσ2σ3{0}:
(1 - δσ1{0}*δσ2{1}) (1 - δσ1{1} δσ2σ3{0}) * δσ1{0}
We can combine EKDs that share a single constant, replacing δσ2{0} * δσ3{0} with δσ2σ3{0}:
(1 - δσ1{0}*δσ2{1}) (1 - δσ1{1} δσ2σ3{0}) * δσ1{0}
We can find even more simplifications by expanding the terms. Let us expand the last two expressions, (1 - δσ1{1} δσ2σ3{0}) δσ1{0}, to:
δσ1{0} - δσ1{0} δσ1{1} δσ2σ3{0}
We know that δσ1{0} * δσ1{1} yields 0, leaving us with:
δσ1{0} - 0 * δσ2σ3{0}
δσ1{0}
Plugging this back into the original CP gives us:
(1 - δσ1{0}*δσ2{1}) * δσ1{0}
Expanding that produces:
δσ1{0} - δσ1{0}*δσ2{1}
δσ1{0} * (1 - δσ2{1})
δσ1{0} * δσ2{0}
δσ1σ2{0}
This expression is so simple that we do not need to sum it. We can see that σ1 and σ2 must be 0. Since there is no restriction placed on σ3, it can be either 0 or 1. This gives us two solutions.
There is a lot more to SAT problems than I have shown here – it’s a field of study that someone could dedicate their entire career to. My goal isn’t to provide an exhaustive tour of SAT, but to show that SAT problems can be translated to CPs and solved through CP evaluation.
Previous Post:
Next Post:
Chromatic Polynomials 12 - coming soon.




Comments