Edge Colouring and Chromatic Polynomials
Edge colouring assigns colours to edges so that adjacent edges receive different colours. It is the natural model for scheduling pairwise interactions: games sharing a team, jobs sharing a machine, or communication links sharing a port cannot happen in the same time slot. Unlike vertex colouring, edge colouring is controlled closely by the maximum degree, but the exact answer still contains subtle structure.
Chromatic polynomials count proper vertex colourings as a function of the number of available colours. They refine the yes/no question "is this graph -colourable?" into "how many -colourings does it have?" This gives a bridge from graph theory to algebra and combinatorics.
Definitions
A proper edge colouring of a graph assigns colours to edges so that any two edges sharing an endpoint have different colours. The chromatic index is the least number of colours needed.
The line graph has one vertex for each edge of , with two vertices adjacent in exactly when the corresponding edges of share an endpoint. Edge colouring is the same as vertex colouring , so
The chromatic polynomial counts the number of proper vertex colourings of using colours from a set of size . It is a polynomial in for every finite graph.
For an edge that is not a loop, denotes deletion of , and denotes contraction of .
Key results
Lower bound for edge colouring.
because all edges incident with a vertex of maximum degree need distinct colours.
Vizing's theorem. For every simple graph,
Graphs with are called Class 1; graphs with are Class 2.
Konig's line-colouring theorem. If is bipartite, then
Deletion-contraction for chromatic polynomials. If is not a loop, then
Reason: colourings of either give different colours to the endpoints of , in which case they are colourings of , or give the same colour to the endpoints, in which case they correspond to colourings of .
Special values of chromatic polynomials. If has at least one vertex, then because there are no colours available. If has at least one edge, then because adjacent vertices cannot share the only colour. The value detects bipartiteness for connected graphs: it is when is connected and bipartite, and when has an odd cycle.
Leading terms. For a graph with vertices and edges,
The leading term counts all colour assignments. The next term subtracts assignments that violate one specified edge, and the lower-order terms correct overlaps among violations. This gives a quick check on small polynomial computations.
Edge colouring through line graphs. Because , every theorem about vertex colouring can be applied to edge colouring after forming the line graph. The translation is powerful but can obscure the original graph. For example, a clique in may come from all edges incident with one high-degree vertex, or from the three edges of a triangle in .
Planar connection. Edge colouring also interacts with map colouring. For a plane cubic graph, face colouring of the dual and edge colouring of the original graph are closely related. Historically, several equivalent formulations of the four-colour problem passed through edge-colouring statements about cubic planar graphs. This is one reason Wilson treats vertex colouring, map colouring, edge colouring, and chromatic polynomials in the same chapter.
Chromatic roots. The values of for which are called chromatic roots. The integers are always roots in the sense that no proper colouring exists with that many colours. Noninteger chromatic roots are a deeper topic, but even at an introductory level they remind us that is both a counting function and an algebraic object.
Disjoint unions. If is the disjoint union of and , then
Colour choices on different components are independent.
Visual
The triangle needs three edge colours because every pair of edges is adjacent.
| Graph | Chromatic polynomial | ||
|---|---|---|---|
| Path with | 2 or 1 | 2 or 1 | |
| Cycle | 2 | 2 | |
| Cycle | 2 | 3 | |
| Complete graph | 2 | 3 | |
| Complete bipartite | no single short form |
Worked example 1: Edge-colour an odd cycle
Problem. Find .
Method.
- The graph has maximum degree
- Therefore .
- Suppose two edge colours were enough. Around the cycle, adjacent edges must alternate colours:
- The first and last edges of the cycle are adjacent, but both would have colour . This is impossible.
- So .
- Three colours suffice: colour the first four edges and the last edge .
Checked answer.
This agrees with the general rule that odd cycles are Class 2.
Worked example 2: Compute a chromatic polynomial by deletion-contraction
Problem. Compute for the path using deletion-contraction on edge .
Method.
Let and .
- Delete . The graph has one edge and an isolated vertex .
- The edge can be coloured in ways, and can be coloured independently in ways. Therefore
- Contract . The vertices and merge, and the result is a single edge between and the merged vertex. Hence
- Apply deletion-contraction:
- Substitute:
Check. Directly, colour in ways, then in ways, then in ways because it only needs to differ from . The answer matches.
The leading-term check also works:
The path has vertices and edges, so the first two terms should be , exactly as computed.
Code
This exact chromatic-polynomial routine uses deletion-contraction symbolically through SymPy. It is meant for small simple graphs.
from functools import lru_cache
import sympy as sp
k = sp.symbols("k")
def normalize(vertices, edges):
vertices = tuple(sorted(vertices))
edges = tuple(sorted(tuple(sorted(e)) for e in edges if e[0] != e[1]))
return vertices, tuple(sorted(set(edges)))
@lru_cache(None)
def chrom_poly(vertices, edges):
vertices, edges = normalize(vertices, edges)
if not edges:
return k ** len(vertices)
u, v = edges[0]
deleted = tuple(e for e in edges if e != (u, v))
merged_vertices = tuple(x for x in vertices if x != v)
contracted_edges = []
for a, b in deleted:
a = u if a == v else a
b = u if b == v else b
if a != b:
contracted_edges.append(tuple(sorted((a, b))))
return sp.expand(chrom_poly(vertices, deleted) - chrom_poly(merged_vertices, tuple(contracted_edges)))
print(chrom_poly(("a", "b", "c"), (("a", "b"), ("b", "c"))))
The recursive code recomputes many isomorphic subproblems unless caching catches the exact normalized edge set. Serious implementations use canonical graph forms or specialized deletion-contraction strategies. For small examples, however, the code mirrors the theorem closely enough to be useful as a checking tool.
As a quick sanity check, evaluate a computed chromatic polynomial at small integers. For a graph with an edge, should be . For a connected bipartite graph, should be ; for a graph containing an odd cycle, it should be .
For edge-colouring, do the analogous check at a maximum-degree vertex. If a vertex has degree , then its incident edges already require distinct colours. Any proposed colouring with fewer is impossible before the rest of the graph is considered.
For chromatic polynomial computations, keep the graph operation visible beside the algebra. Deleting an edge and contracting an edge produce different graphs, and the subtraction order matters. For edge-colouring, sketch the line graph only when it clarifies adjacency among edges; otherwise, checking edge conflicts directly in the original graph is often cleaner.
Common pitfalls
- Confusing vertex colouring with edge colouring. Adjacent edges share an endpoint; adjacent vertices share an edge.
- Assuming every graph satisfies . Odd cycles and many complete graphs require colours.
- Applying Konig's line-colouring theorem to non-bipartite graphs.
- Forgetting that a loop makes proper vertex colouring impossible and also disrupts ordinary edge-colouring assumptions.
- Counting colourings "up to renaming colours" when computing . The chromatic polynomial counts actual assignments from a fixed colour set.
- Using deletion-contraction with the signs reversed.