Computing Bichromatic Triangle Polynomials via Edge Contraction ()
1. Introduction
The chromatic polynomial
of a graph
counts proper vertex colorings using at most
colors. Introduced by Birkhoff [1] in connection with the four-color problem, it has become a central object in algebraic combinatorics with connections to statistical mechanics, knot theory, and algebraic geometry [2]-[4]. Recent work has explored the distribution and density of chromatic roots [5] [6], computational methods for special graph classes [7], and systematic frameworks for deletion-contraction algorithms [8].
The classical method for computing
is the deletion-contraction algorithm. For any edge
, one has
(1)
where
denotes deletion of
and
denotes contraction, that is, identification of the endpoints
and
into a single vertex. This identity reduces computation to smaller graphs until one reaches edgeless graphs, for which
.
In this paper, we study the bichromatic triangle polynomial
, which counts vertex colorings of a triangulated graph in which every designated triangular face uses exactly two colors. This constraint arises naturally in several contexts. In face-coloring problems and map enumeration, one often seeks colorings with specific local properties on faces [9] [10]. More significantly, the bichromatic constraint connects to the theory of mixed hypergraphs introduced by Voloshin [11], where hyperedges may carry either “at least two colors” (D-edges) or “at most one color” (C-edges) constraints. Recent work has demonstrated applications of mixed hypergraph coloring to practical scheduling and frequency assignment problems [12]. The bichromatic condition—exactly two colors on a triangle—can be viewed as the intersection of a D-constraint and a cardinality bound, representing a refinement of mixed hypergraph coloring. Allagan [13] studied chromatic polynomials of mixed hypergraphs built from triangulated structures, and the present work extends that line of investigation by providing a systematic recursive algorithm.
Unlike proper colorings, bichromatic colorings do not require adjacent vertices to differ; the constraint is on triangular faces rather than edges. Our main contribution is a triangle-contraction identity that generalizes deletion-contraction to this setting. Rather than decomposing along a single edge, we decompose along a triangle
by considering all three edge contractions
,
, and
, together with the triple contraction
. The resulting four-term identity (Theorem 1) enables recursive computation of
for any triangulated graph.
The class of graphs to which our algorithm applies is broad. It includes 2-trees, which are built recursively by attaching triangles along edges and arise in the study of chordal graphs and tree-decompositions [14]. It includes maximal outerplanar graphs (MOPs), whose interior faces are all triangles and which model various network structures. Recent advances in understanding chromatic polynomials of planar triangulations [15] and counting colorings in triangle-constrained graphs [16] have highlighted the importance of studying face-based coloring constraints. More generally, any simple graph equipped with a designated collection of triangle constraints falls within scope, including partially constrained structures where only some triangles carry the bichromatic requirement.
The paper is organized as follows. Section 2 establishes notation and defines the bichromatic triangle polynomial. Section 3 proves the triangle-contraction identity via inclusion-exclusion and establishes a formal quotient-coloring correspondence. Section 4 describes the recursive algorithm and proves its correctness. Section 5 illustrates the method on several families of graphs and Section 6 concludes with directions for future work.
2. Preliminaries
We work with graphs endowed with a distinguished system of local constraints. For the main results, these constraints are induced by selected triangles, but contractions naturally generate edge constraints as well.
[Triangle-constrained graph] A triangle-constrained graph is a triple
, where
is a finite simple graph,
is a set of triangles (3-cliques) called triangle constraints, and
is a set of unordered vertex pairs called edge constraints. When
, we write
and refer to it informally as a triangulated graph in the sense of “graph equipped with constrained triangular faces,” not in the sense of chordal graphs or planar triangulations.
[Bichromatic colorings] Let
be triangle-constrained and
a positive integer. A
-coloring is a map
. A triangle
is bichromatic under
if
, meaning exactly two distinct colors appear among its vertices. An edge constraint
is satisfied if
. A coloring is valid if every triangle in
is bichromatic and every edge constraint in
is satisfied.
[Bichromatic triangle polynomial] The bichromatic triangle polynomial of
is
When the constraint system is clear from context, we abbreviate this as
.
In contrast with the chromatic polynomial, adjacency in
does not by itself impose any restriction: edges in
are unconstrained and may be monochromatic. All combinatorial structure is carried by
.
We next formalize the effect of contracting vertices on the constraint system.
[Quotient graph and induced constraints] Let
be triangle-constrained and
a nonempty subset. The quotient graph
is obtained by identifying all vertices of
to a single vertex
, redirecting incident edges to
, and deleting loops and parallel edges to keep the graph simple. Let
be the natural surjection. We write
for
and
for
.
The induced constraint system on
is defined as follows. For each triangle
, let
. If
, then
is added to the new triangle set
. If
, the bichromatic condition reduces to an edge constraint requiring the two vertices to differ, so
is added to
. If
, the constraint becomes vacuous and is discarded. Similarly, each edge constraint
with
is added to
. The resulting triangle-constrained graph is denoted
.
By construction, every valid coloring of
that is constant on
corresponds bijectively to a valid coloring of the quotient
, and conversely.
3. The Triangle-Contraction Identity
The following theorem provides the foundation for our recursive algorithm.
Theorem 1 (Triangle-contraction identity). Let
be a triangulated graph with
, and let
be a constrained triangle. Define
by releasing the constraint on
, that is,
. Then
(2)
The proof relies on a formal correspondence between colorings satisfying vertex equalities and colorings of quotient graphs.
Lemma 2 (Quotient-coloring correspondence). Let
be a triangulated graph and
. Let
be obtained by releasing
, and let
denote the set of all colorings bichromatic for
. Define
,
, and
. Then
,
,
, and
.
Proof. We establish a bijection between colorings in
and valid colorings of
. Let
be the quotient map sending
and
to a new vertex
. Given
, define
for all
; this is well-defined since
. For any constrained triangle
with image
: if
, bichromaticity is inherited; if
, the bichromatic condition on
forces the two vertices in
to have different colors; if
, no constraint applies. Thus
is valid for the quotient.
Conversely, given a valid coloring
of
, define
for
and
otherwise. Then
and is bichromatic for
. These constructions are inverses, proving
. The arguments for
and
are identical.
For intersections, any two of
,
,
imply the third, so
. The same bijection argument with triple identification yields
. □
Proof of Theorem 1. A coloring
is bichromatic on
precisely when
, which occurs if and only if
belongs to exactly one or two of
,
,
. By inclusion-exclusion,
. The bichromatic colorings form
, so
By Lemma 2, each pairwise intersection equals
. Substituting yields the identity. □
The connection to classical deletion-contraction is clear. In (1), we decompose along a single edge using deletion and contraction. In (2), we decompose along a triangle using three edge contractions plus a correction for the triple contraction. The underlying operation is identical; what differs is the structure being decomposed.
4. The Recursive Algorithm
The triangle-contraction identity yields a recursive algorithm for computing
. Given a triangulated graph
with at least one constraint, we choose a triangle
, release its constraint to form
, construct the four quotient graphs with induced constraints, and recurse. The base case occurs when
, in which case the only constraints are edges in
, and we count colorings satisfying these edge inequalities directly.
Theorem 3 (Correctness). Let
be a triangle-constrained graph. Then for all integers
, Algorithm 1 returns
.
Proof. We proceed by strong induction on
. If
, there are no triangle constraints, and the algorithm directly counts colorings satisfying the edge constraints in
.
Assume the claim holds for all graphs with fewer than
triangle constraints, where
, and let
have
. Choose
and write
. The proof of Theorem 1 shows, via inclusion-exclusion, that
where each quotient
has at most
triangle constraints. The inductive hypothesis applies to all four subinstances, completing the induction. □
A vertex in a quotient is free if every constrained triangle originally containing it has either been released or collapsed to exclude it; such vertices contribute a factor of
without further recursion. Each application of the identity reduces
by one and produces four subproblems, giving a recursion tree with at most
leaves. The total complexity is
, comparable to deletion-contraction’s
for sparse triangulations where
.
Several optimizations improve practical performance. Choosing leaf triangles—those sharing only one edge with other constrained triangles—tends to isolate free vertices. Memoization can cache results for isomorphic subproblems. For structured families such as fans, ladders, and books, the recursion reveals linear recurrences solvable via transfer matrices, bypassing exponential recursion entirely.
5. Examples
We illustrate the algorithm step-by-step on several families, using green shading for constrained triangles, red for released triangles, blue for merged vertices, and dashed lines for edges incident to free vertices.
Example 4 (The Triangle K3). For
with
, releasing the only constraint gives
. The three pairwise contractions yield two-vertex graphs with count
each (one edge constraint), while the triple contraction yields a single vertex with count
. The identity gives
This can be verified directly: a bichromatic coloring uses exactly two colors among three vertices, so one pair shares a color. There are
choices for the pair,
choices for their common color, and
for the third, giving
. The decomposition is illustrated in Figure 1.
Figure 1. Decomposition of
. Red indicates the released triangle; blue vertices are merged. Each of
has one edge constraint;
is a single free vertex.
Example 5 (The fan F4). Consider the fan
with apex
and rim vertices
. The graph contains two triangles:
(constrained) and
(released).
Step 1: Initial configuration. We have
. Choose
to release, so
.
Step 2: First quotient
. Merge
and
into vertex
. Triangle
becomes
(edge constraint), and vertex
is free. The constraint system is
with
and
. We have
, and
contributes
choices, so
.
Step 3: Second quotient
. Merge
and
into vertex
. Triangle
becomes
(still a triangle constraint). The constraint system is
. By the base computation for
,
, so
.
Step 4: Third quotient
. Merge
and
into vertex
. Triangle
becomes
(still a triangle constraint). By symmetry with
,
.
Step 5: Fourth quotient
. Merge all three vertices
into vertex
. Triangle
becomes
(edge constraint). The constraint system is
, so
.
Step 6: Combine via identity.
For
, this yields
. The decomposition is shown in Figure 2.
Figure 2. Decomposition of
. Green marks
(constrained); red marks
(released). In
, vertex
is free (dashed). In
, a constrained triangle remains. In
, only edge constraint
.
Example 6 (The bowtie). The bowtie consists of triangles
and
sharing only vertex
. Since
, no contraction within
affects two vertices of
, so
remains intact in every quotient. In
, one vertex from
becomes free; in
, only
remains. The decomposition is illustrated in Figure 3.
Thus
.
Example 7 (The wheel W4). The wheel
has hub
and rim
, with triangles
for
(indices mod 4). We release
, keeping
constrained.
Quotient
: Merge
and
into vertex
. The constraints transform as
(triangle),
(triangle), and
(edge). Write
,
,
,
. We
Figure 3. Bowtie decomposition. Releasing
preserves
in all quotients. Dashed edge to
indicates it is free.
need
,
, and
.
If
, then bichromaticity forces
and
, and the edge constraint is automatically satisfied, giving
colorings. If
, then
(2 choices) and the edge constraint forces
(1 choice), giving
colorings. Thus
. By symmetry,
.
Quotient
: Merge
and
into vertex
. The graph is
on
, but only three triangles (those containing
) are constrained:
,
,
. The triangle
is unconstrained. All valid colorings use exactly two colors: if three distinct colors appeared, some constrained triangle would contain all three (impossible for bichromatic). For each ordered pair of colors
, there are exactly 4 valid patterns for
that make all three constrained triangles bichromatic. Thus
.
Quotient
: Merge
into vertex
. Constraints become edge
, triangle
, and edge
. Edge constraints force
and
, and bichromaticity then requires
. Thus
.
Combining:
For
, this gives
, matching direct enumeration. The decomposition is shown in Figure 4.
Figure 4. Decomposition of
. In
: two triangles plus edge constraint. In
: three triangles containing
, but
is unconstrained (dashed).
Graph |
Formula |
|
|
|
6 |
(fan) |
|
10 |
Bowtie |
|
18 |
(wheel) |
|
14 |
6. Conclusions and Future Directions
We have presented a recursive algorithm for computing the bichromatic triangle polynomial of any triangulated graph, based on a triangle-contraction identity that extends classical deletion-contraction to face constraints. The algorithm correctly handles all configurations of triangles, including edge-sharing, vertex-sharing, and complex nested structures such as wheels.
The class of admissible graphs is broad. It includes 2-trees, which are constructed by repeatedly attaching triangles along edges and arise in the study of chordal graphs and tree-decompositions [14]. It includes maximal outerplanar graphs (MOPs), whose faces are all triangles and which model various network structures. It includes general outerplanar graphs, where we may constrain only some faces. More generally, any simple graph equipped with a partial collection of triangle constraints falls within scope, allowing application to mixed or incomplete triangulations where the bichromatic requirement applies to a designated subset of triangular faces.
The chromatic polynomial is famously an evaluation of the Tutte polynomial,
, where
is the number of connected components of
. Recent work on Tutte polynomials and their generalizations [17] [18] suggests rich connections between edge-based and face-based polynomial invariants. It is natural to ask whether
admits a similar two-variable generalization. Such a polynomial would provide finer invariants for triangulated graphs and potentially connect to the rich theory of the Tutte polynomial and its extensions to hypergraphs.
Future directions include developing polynomial-time algorithms for broader graph classes. Recent progress on efficient algorithms for chromatic polynomials of chordal and outerplanar graphs [7] suggests that specialized techniques may apply to bichromatic triangle polynomials for restricted graph families. Dynamic programming on tree decompositions could yield efficient computation for graphs of bounded treewidth. Investigating algebraic properties of
such as the location of roots may reveal important structural properties; recent advances in understanding chromatic roots [5] [6] provide methodological frameworks for such investigations. Extending the framework to more general face-constrained coloring problems, as explored in recent work [10], could broaden the scope of applications. Finally, exploring connections to the chromatic polynomials of mixed hypergraphs [12] in greater depth may yield both theoretical insights and practical applications in network design, scheduling, and resource allocation.
Acknowledgements
This work was supported by the U.S. Department of Education under grant number P382G240006. The authors thank the anonymous reviewers for their helpful suggestions and careful reading of the manuscript.