A vertex coloring of a graph is a map
that assigns a color to each vertex of
. The coloring is proper if adjacent vertices are assigned distinct colors. The graph is 2-colorable if there exists a proper coloring whose color set
has two elements.
For instance, consider a graph whose vertex set is
and whose edge set is
. A pictorial representation of this graph is depicted below
Note that this graph is complete. We can assign two distinct colors to any two vertices, but we cannot assign a color to the third vertex that will yield a proper coloring. Therefore, the graph is not 2-colorable. To illustrate, we use the color set and generate all
possible vertex 2-colorings, as depicted below
Notice that none of these 2-colorings is proper, as expected.
As discussed by De Loera et alia [1], the graph vertex-coloring problem can be modeled using polynomial equations. We introduce variables , where
if vertex
is assigned the color
, and
if vertex
is assigned the color
. Given an edge
, we have that:
- if both vertices are pink, we get
.
- if both vertices are blue, we get
.
- if the vertices have distinct colors, we get
.
Thus, stating that adjacent vertices must be assigned distinct colors is equivalent to imposing the constraints for all
. We thus obtain a system of three equations
where . This is still a combinatorial problem, though. We can transform it into an algebraic-geometric problem. Here is a truly beautiful trick [1]: the constraint
can be encoded as
with
. How quaint!! We then obtain a system of six equations with polynomials in
whose solution set, which we denote by , is algebraic [2]. The given graph is 2-colorable if and only if the system of polynomial equations above is feasible, i.e., if set
is nonempty [1]. The following REDUCE + REDLOG script uses quantifier elimination to decide if
is nonempty:
% feasibility via quantifier elimination
load_package redlog;
rlset ofsf;
% define polynomial functions
f1 := x1+x2;
f2 := x1+x3;
f3 := x2+x3;
f4 := x1^2-1;
f5 := x2^2-1;
f6 := x3^2-1;
% define existential formula
phi := ex({x1,x2,x3}, f1=0 and f2=0 and f3=0 and
f4=0 and f5=0 and f6=0);
% perform quantifier elimination
rlqe phi;
end;
This script produces the truth value false. Thus, the solution set is empty, which means that the system of polynomial equations is infeasible. We conclude that the given graph is not 2-colorable.
__________
References
[1] Jesús De Loera, Jon Lee, Susan Margulies, Shmuel Onn, Expressing Combinatorial Optimization Problems by Systems of Polynomial Equations and the Nullstellensatz, 2007.
[2] Jacek Bochnak, Michel Coste, Marie-Françoise Roy, Real Algebraic Geometry, Springer, 1998.




