Vertex and Map Colouring
Vertex colouring asks how few labels, or colours, are needed so that adjacent vertices receive different colours. This turns adjacency into a scheduling or separation rule: conflicting exams need different time slots, adjacent regions on a map need different colours, and incompatible tasks need different resources.
Map colouring is graph colouring in disguise. A plane map can be converted to a dual graph whose vertices are regions and whose edges record shared borders. Colouring the map is then equivalent to vertex-colouring that dual graph. This connection explains why planar graph theory and colouring theory are historically intertwined.
Definitions
A proper vertex colouring of a graph is a function
such that whenever . If such a colouring exists, is -colourable. The chromatic number is the least for which is -colourable.
A graph is bipartite if its vertex set can be split into two independent sets. Equivalently, it is -colourable, except for the edgeless case where .
A clique is a set of pairwise adjacent vertices. The clique number gives a lower bound:
A plane map can be coloured by building its region-adjacency graph. Two regions are adjacent only when they share a boundary segment, not merely a point.
Key results
Bipartite characterization. A graph is bipartite if and only if it has no odd cycle.
Proof sketch: if a graph is bipartite, every cycle alternates between the two parts, so every cycle has even length. Conversely, if a connected graph has no odd cycle, choose a root and colour vertices by parity of distance from the root. An edge joining vertices of the same parity would create an odd cycle.
Greedy colouring bound. Every graph satisfies
where is the maximum degree. Colour vertices one at a time; at most colours are forbidden by already coloured neighbors.
Brooks' theorem. If is connected and is neither a complete graph nor an odd cycle, then
Four-colour theorem. Every planar graph is -colourable. Equivalently, every plane map can be coloured with at most four colours.
The four-colour theorem is deep; introductory work usually uses it as a landmark result rather than proving it.
Critical graphs. A graph is -critical if but deleting any vertex lowers the chromatic number. Critical graphs are useful for minimal-counterexample arguments. For instance, every odd cycle is -critical. Complete graphs are -critical. If a theorem about colourability fails, one often chooses a smallest counterexample and then studies the constraints forced by criticality.
Greedy order matters. The greedy bound is universal, but the number of colours used by a greedy algorithm may be far from optimal under a bad ordering. Bipartite graphs can be forced to use many colours greedily if their vertices are ordered poorly, even though their chromatic number is . Good heuristics order high-degree vertices first or repeatedly choose a vertex with many already-coloured neighbors.
Lower bounds. Clique number is not the only lower bound. If a graph has vertices and independence number , then each colour class is an independent set of size at most , so
This bound is useful when large cliques are absent but colour classes are still forced to be small.
Colour classes. A proper -colouring partitions the vertex set into independent sets, one for each colour. Conversely, any partition of into independent sets is a proper -colouring. This reformulation is often the simplest way to prove both lower and upper bounds: lower bounds show that too few independent sets cannot cover all vertices, while upper bounds explicitly build such a partition.
Planar special cases. The four-colour theorem is the famous general result, but many planar graphs need fewer colours. Every outerplanar graph is -colourable. Every bipartite planar graph is -colourable. Every planar graph is -colourable by a classical short argument using Euler's formula and induction. These weaker results are often more useful in exercises because their proofs are accessible.
Dual map graph. In map colouring, the graph being coloured is usually the dual adjacency graph of regions. A bridge or dangling feature in the boundary may create loops or repeated adjacencies if modeled carelessly, so map-colouring problems usually assume well-behaved regions and count adjacency only along nontrivial boundary arcs.
Visual
| Graph family | Chromatic number | Reason |
|---|---|---|
| Null graph | no adjacencies | |
| Path with | bipartite and has an edge | |
| Even cycle | bipartite | |
| Odd cycle | not bipartite but greedily 3-colourable | |
| Complete graph | all vertices pairwise adjacent | |
| Wheel | or | depends on parity of rim cycle |
Worked example 1: Colour an odd cycle
Problem. Find .
Method.
- has vertices and edges around the cycle.
- It is an odd cycle, so it cannot be -coloured. To see this directly, start with red.
- Then must be blue.
- Then must be red.
- Then must be blue.
- Then must be red because it is adjacent to .
- But is also adjacent to , which is red. This is a conflict.
So .
Now give a -colouring:
Check all edges:
Checked answer. .
Worked example 2: Colour a wheel graph
Problem. Let be the wheel made from a -cycle rim plus one central hub adjacent to every rim vertex. Find .
Method.
- The rim is , so it already needs colours.
- The hub is adjacent to every rim vertex.
- In any proper colouring of the rim , all three colours must appear, because .
- Therefore the hub cannot use any of those three colours.
- Hence
Now construct a -colouring. Colour the rim as in the previous example:
Colour the hub with colour . The hub differs from every rim vertex, and the rim was already properly coloured.
Checked answer. .
If the rim had even length instead, the answer would change. A wheel whose rim is an even cycle needs only two colours on the rim and a third colour for the hub. Thus wheels show a common colouring pattern: adding one universal vertex increases the chromatic number by one because it is adjacent to every existing colour class.
Code
This backtracking routine computes the chromatic number of a small graph exactly.
def can_colour(adj, k):
vertices = sorted(adj, key=lambda v: -len(adj[v]))
colour = {}
def search(i):
if i == len(vertices):
return True
v = vertices[i]
forbidden = {colour[u] for u in adj[v] if u in colour}
for c in range(k):
if c not in forbidden:
colour[v] = c
if search(i + 1):
return True
del colour[v]
return False
return search(0)
def chromatic_number(adj):
for k in range(1, len(adj) + 1):
if can_colour(adj, k):
return k
C5 = {i: {((i - 2) % 5) + 1, (i % 5) + 1} for i in range(1, 6)}
print(chromatic_number(C5))
The exact backtracking routine is deliberately exponential. It is appropriate for checking small examples and for illustrating the definition of . Large colouring instances are computationally hard in general, so practical solvers combine branching, propagation, greedy bounds, and problem-specific structure.
For hand colouring, alternate between lower and upper bounds. A clique, odd cycle, or independence-number argument proves that at least some number of colours is necessary. An explicit colouring proves that that many colours are sufficient. Equality requires both sides.
Colouring proofs are strongest when they give matching lower and upper bounds. A lower bound says why fewer colours cannot work. An upper bound gives an actual colouring or a theorem that guarantees one. If the two bounds meet, the chromatic number is known exactly. If they do not, the result is only an interval, even if the drawing looks persuasive.
Common pitfalls
- Thinking colours have numerical meaning. Colour labels are interchangeable.
- Confusing a greedy colouring with an optimal colouring. Greedy performance depends heavily on vertex order.
- Forgetting that a graph with one edge needs at least two colours.
- Counting map regions that meet only at a point as adjacent. Map colouring uses shared boundary segments.
- Assuming every planar graph needs four colours. The theorem says four suffice, not that four are always necessary.
- Ignoring loops. A graph with a loop has no proper vertex colouring under the usual definition.