Skip to content

Chapter 69. Chromatic Polynomial

The chromatic number records the least number of colors needed to color a graph. The chromatic polynomial records more information. It counts how many proper colorings are possible when a fixed number of colors is available.

For a graph GG, the chromatic polynomial is usually written

PG(k) P_G(k)

or

χG(k). \chi_G(k).

In this chapter, we write PG(k)P_G(k) to avoid confusion with the chromatic number χ(G)\chi(G).

69.1 Definition

Let G=(V,E)G=(V,E) be a finite graph. For a positive integer kk, let PG(k)P_G(k) denote the number of proper vertex colorings of GG using colors from the set

{1,2,,k}. \{1,2,\ldots,k\}.

Thus PG(k)P_G(k) counts all functions

c:V{1,2,,k} c:V\to \{1,2,\ldots,k\}

such that

uvEc(u)c(v). uv\in E \quad \Longrightarrow \quad c(u)\ne c(v).

The surprising fact is that this counting function is always a polynomial in kk. This polynomial is called the chromatic polynomial of GG. The deletion-contraction identity is one standard way to prove polynomiality.

69.2 First Examples

Let NnN_n be the graph with nn vertices and no edges. Since there are no adjacency restrictions, each vertex may receive any of the kk colors. Therefore

PNn(k)=kn. P_{N_n}(k)=k^n.

For the complete graph KnK_n, all vertices must receive distinct colors. The first vertex has kk choices, the second has k1k-1, and so on. Hence

PKn(k)=k(k1)(k2)(kn+1). P_{K_n}(k)=k(k-1)(k-2)\cdots(k-n+1).

For the path PnP_n with n1n\ge 1, the first vertex has kk choices. Each later vertex must avoid the color of the previous vertex, so it has k1k-1 choices. Thus

PPn(k)=k(k1)n1. P_{P_n}(k)=k(k-1)^{n-1}.

For a tree TT with nn vertices, the same formula holds:

PT(k)=k(k1)n1. P_T(k)=k(k-1)^{n-1}.

A tree has no cycles, so after choosing a root, each non-root vertex only needs to avoid the color of its parent.

69.3 Relation to Chromatic Number

The chromatic polynomial determines the chromatic number.

A graph is kk-colorable exactly when

PG(k)>0. P_G(k)>0.

Therefore

χ(G)=min{k1:PG(k)>0}. \chi(G)=\min\{k\ge 1:P_G(k)>0\}.

The chromatic number gives the first positive integer at which the chromatic polynomial becomes positive.

For example, if

PG(1)=0,PG(2)=0,PG(3)>0, P_G(1)=0,\qquad P_G(2)=0,\qquad P_G(3)>0,

then

χ(G)=3. \chi(G)=3.

Thus the chromatic polynomial refines the chromatic number. It does not merely say whether a coloring exists. It counts how many colorings exist for every allowed number of colors.

69.4 Deletion and Contraction

The most important recursive method for chromatic polynomials uses deletion and contraction.

Let e=uve=uv be an edge of GG.

The deletion GeG-e is the graph obtained by removing the edge ee while keeping all vertices.

The contraction G/eG/e is the graph obtained by identifying uu and vv as a single vertex and then removing the edge ee. In simple graphs, parallel edges created by contraction may be replaced by a single edge.

Deletion removes a constraint. Contraction identifies the two endpoints of that constraint.

These two operations are related because every proper coloring of GeG-e falls into one of two classes:

CaseMeaning
uu and vv have different colorsThe coloring is a proper coloring of GG
uu and vv have the same colorThe coloring corresponds to a coloring of G/eG/e

This gives the deletion-contraction formula:

PG(k)=PGe(k)PG/e(k). P_G(k)=P_{G-e}(k)-P_{G/e}(k).

This identity is the standard recursive formula for the chromatic polynomial. It follows by subtracting the colorings of GeG-e in which the endpoints of ee receive the same color.

69.5 Base Cases

The deletion-contraction formula reduces the number of edges. Repeated use eventually reaches graphs with no edges, whose chromatic polynomials are known.

If GG has nn vertices and no edges, then

PG(k)=kn. P_G(k)=k^n.

If GG has a loop, then

PG(k)=0. P_G(k)=0.

A loop joins a vertex to itself. Proper coloring would require a vertex to have a color different from itself, which is impossible.

These two base cases allow recursive computation.

69.6 Example: A Triangle

Let G=K3G=K_3. Choose an edge ee. Then GeG-e is a path on three vertices, and G/eG/e is K2K_2.

Thus

PK3(k)=PP3(k)PK2(k). P_{K_3}(k)=P_{P_3}(k)-P_{K_2}(k).

We know

PP3(k)=k(k1)2 P_{P_3}(k)=k(k-1)^2

and

PK2(k)=k(k1). P_{K_2}(k)=k(k-1).

Therefore

PK3(k)=k(k1)2k(k1). P_{K_3}(k)=k(k-1)^2-k(k-1).

Factor:

PK3(k)=k(k1)((k1)1). P_{K_3}(k)=k(k-1)\bigl((k-1)-1\bigr).

Hence

PK3(k)=k(k1)(k2). P_{K_3}(k)=k(k-1)(k-2).

This agrees with the direct count for a complete graph on three vertices.

69.7 Example: A Cycle

Let CnC_n be a cycle with n3n\ge 3 vertices. Its chromatic polynomial is

PCn(k)=(k1)n+(1)n(k1). P_{C_n}(k)=(k-1)^n+(-1)^n(k-1).

This formula explains the parity behavior of cycles.

For an even cycle,

PCn(2)=1n+1=2. P_{C_n}(2)=1^n+1=2.

There are exactly two proper 2-colorings, corresponding to the two choices of color for the first vertex.

For an odd cycle,

PCn(2)=1n1=0. P_{C_n}(2)=1^n-1=0.

Thus an odd cycle is not 2-colorable.

69.8 Basic Properties

Let GG be a graph with nn vertices, mm edges, and cc connected components.

The chromatic polynomial has several important structural properties:

PropertyStatement
DegreePG(k)P_G(k) has degree nn
Leading coefficientThe leading coefficient is 11
Second coefficientThe coefficient of kn1k^{n-1} is m-m
Constant termIf n>0n>0, then PG(0)=0P_G(0)=0
Lowest nonzero degreeThe lowest nonzero power is kck^c

The degree and leading coefficient follow from the fact that, without edge restrictions, there would be knk^n colorings. Edges remove some assignments, but they do not change the leading term.

The coefficient of kn1k^{n-1} records the number of edges with a negative sign. These facts are standard consequences of deletion-contraction and induction on the number of edges.

69.9 Disconnected Graphs

If a graph is the disjoint union of components

G1,G2,,Gr, G_1,G_2,\ldots,G_r,

then colorings of the components may be chosen independently.

Therefore

PG(k)=PG1(k)PG2(k)PGr(k). P_G(k)=P_{G_1}(k)P_{G_2}(k)\cdots P_{G_r}(k).

For example, if GG is the disjoint union of a triangle and an isolated vertex, then

PG(k)=PK3(k)k. P_G(k)=P_{K_3}(k)\cdot k.

Thus

PG(k)=k2(k1)(k2). P_G(k)=k^2(k-1)(k-2).

Independence of components turns the chromatic polynomial into a product.

69.10 Complete Bipartite Examples

Consider the complete bipartite graph K1,nK_{1,n}, also called a star. The center has kk choices. Each leaf must avoid the color of the center, but leaves are mutually nonadjacent. Hence

PK1,n(k)=k(k1)n. P_{K_{1,n}}(k)=k(k-1)^n.

More generally, complete bipartite graphs Km,nK_{m,n} have more complicated chromatic polynomials. One can compute them by first choosing the set of colors used on one part, then assigning colors to the other part while avoiding those colors.

This illustrates a common theme: symmetry can simplify counting, but dense adjacency between parts still creates nontrivial combinatorics.

69.11 Roots of the Chromatic Polynomial

A number λ\lambda is called a chromatic root of GG if

PG(λ)=0. P_G(\lambda)=0.

All nonnegative integers smaller than χ(G)\chi(G) are chromatic roots. For example, if χ(G)=4\chi(G)=4, then

PG(0)=PG(1)=PG(2)=PG(3)=0. P_G(0)=P_G(1)=P_G(2)=P_G(3)=0.

Chromatic roots are also studied over the real and complex numbers. Their behavior is subtle and connects graph coloring with algebra, statistical physics, and the Tutte polynomial.

For elementary graph theory, the most important roots are the integer roots, since they indicate impossible numbers of colors.

69.12 Chromatic Equivalence

Two graphs GG and HH are chromatically equivalent if

PG(k)=PH(k). P_G(k)=P_H(k).

Chromatically equivalent graphs need not be isomorphic. The chromatic polynomial records important information, but it does not determine the graph completely.

A graph is chromatically unique if every graph with the same chromatic polynomial is isomorphic to it.

Thus chromatic polynomials give a graph invariant, but not a complete invariant.

69.13 Connection with the Tutte Polynomial

The chromatic polynomial is a specialization of the Tutte polynomial.

The Tutte polynomial is a two-variable graph polynomial that unifies many graph invariants, including the chromatic polynomial, flow polynomial, and number of spanning trees. Deletion-contraction is one of its central principles.

This connection places graph coloring inside a broader algebraic framework.

In advanced graph theory, the chromatic polynomial is often studied as part of this larger family of deletion-contraction invariants.

69.14 Computational Aspects

Deletion-contraction gives a conceptually simple algorithm, but it may be computationally expensive.

Each edge creates two recursive branches:

Ge G-e

and

G/e. G/e.

Thus a naive implementation may require exponentially many steps.

For special graph classes, faster methods exist. Trees, cycles, complete graphs, and certain decomposable graphs have closed formulas. More generally, algorithms exploit structure such as low treewidth, cut vertices, separations, or chordality.

Computing chromatic polynomials belongs to the broader study of graph counting problems, many of which are computationally hard.

69.15 Summary

The chromatic polynomial PG(k)P_G(k) counts proper kk-colorings of a graph.

It refines the chromatic number by recording not only whether a coloring exists, but how many such colorings exist.

The main ideas are:

ConceptMeaning
PG(k)P_G(k)Number of proper kk-colorings
Chromatic numberFirst positive integer kk with PG(k)>0P_G(k)>0
DeletionRemove an edge
ContractionIdentify the endpoints of an edge
Deletion-contractionPG(k)=PGe(k)PG/e(k)P_G(k)=P_{G-e}(k)-P_{G/e}(k)
Chromatic rootRoot of PG(k)P_G(k)
Chromatic equivalenceSame chromatic polynomial

The chromatic polynomial is one of the first examples of a graph polynomial. It connects coloring, recursion, algebraic invariants, and enumerative combinatorics.

69.16 Exercises

  1. Compute the chromatic polynomial of K2K_2.

  2. Compute the chromatic polynomial of P4P_4.

  3. Compute the chromatic polynomial of K4K_4.

  4. Prove that if GG has no edges and nn vertices, then PG(k)=knP_G(k)=k^n.

  5. Prove that if GG has a loop, then PG(k)=0P_G(k)=0.

  6. Use deletion-contraction to compute the chromatic polynomial of C4C_4.

  7. Verify that

PCn(k)=(k1)n+(1)n(k1) P_{C_n}(k)=(k-1)^n+(-1)^n(k-1)

for n=3n=3 and n=4n=4.

  1. Prove that if GG is the disjoint union of G1G_1 and G2G_2, then
PG(k)=PG1(k)PG2(k). P_G(k)=P_{G_1}(k)P_{G_2}(k).
  1. Show that the coefficient of kn1k^{n-1} in PG(k)P_G(k) is E(G)-|E(G)|.

  2. Give two non-isomorphic graphs with the same chromatic polynomial.

  3. Prove that PG(k)>0P_G(k)>0 if and only if GG is kk-colorable.

  4. Compute the chromatic polynomial of the star K1,nK_{1,n}.

  5. Explain why the chromatic polynomial is a graph invariant.

  6. Use deletion-contraction to show that PG(k)P_G(k) is a polynomial in kk.

  7. Find the chromatic roots of K3K_3.