On this page
Colouring a graph means giving each vertex a colour so that no edge joins two vertices of the same colour. The smallest number of colours that works is the chromatic number. It shows up in timetabling (exams sharing a student cannot share a slot) and in olympiad combinatorics. Two quick upper bounds depend only on Δ, the largest degree in the graph.
How does greedy colouring work?
Number the colours 1, 2, 3 and so on. Put the vertices in some order. Take them one at a time and give each the smallest colour that none of its already-coloured neighbours has.
For a graph of maximum degree Δ, any greedy colouring uses at most Δ + 1 colours (Wikipedia: Greedy coloring). Each vertex has at most Δ neighbours, so at most Δ colours are blocked and one of 1 to Δ + 1 is always free.
Why does the vertex order matter?
The bound holds for every order, but the colours actually used depend on the order. The same source gives a bad case, the crown graph: two rows a1, a2, ... and b1, b2, ..., with ai joined to bj whenever i ≠ j (Wikipedia: Greedy coloring). It is bipartite, so 2 colours are enough. Yet if you colour in the order a1, b1, a2, b2, ..., greedy uses one new colour for each pair.
Take four pairs, 8 vertices, each of degree 3:
a1 gets 1. b1 is not joined to a1, so b1 also gets 1.
a2 sees b1 (colour 1), so it gets 2. b2 sees a1 (1), so it gets 2.
a3 sees b1 and b2 (1, 2), so it gets 3. b3 sees a1 and a2, so it gets 3.
a4 sees b1, b2, b3 (1, 2, 3), so it gets 4. b4 gets 4 the same way.
That is 4 colours, which is Δ + 1, for a graph that needs 2. Colour all the a's first and greedy uses just 2. Some order always gives an optimal colouring: list the vertices by colour from any best colouring (Wikipedia: Greedy coloring). The catch: you need that best colouring first.
What does Brooks' theorem say?
Brooks' theorem: a connected graph with maximum degree Δ can be coloured with at most Δ colours, unless it is a complete graph or an odd cycle, which need Δ + 1 (Wikipedia: Brooks' theorem). R. L. Brooks published it in 1941 as "On colouring the nodes of a network" in what is now the Mathematical Proceedings of the Cambridge Philosophical Society (doi:10.1017/S030500410002168X).
The exceptions are tight: the complete graph on Δ + 1 vertices needs one colour per vertex, and an odd cycle (Δ = 2) cannot alternate two colours all the way round. For a disconnected graph, apply the theorem to each piece.
One step of László Lovász's simplified proof reuses greedy. If some vertex v has degree less than Δ, colour the vertices farthest from v first and v last (Wikipedia: Brooks' theorem). Each earlier vertex still has an uncoloured neighbour nearer v, and v has fewer than Δ neighbours, so Δ colours suffice.
Worked example: how many colours does the Petersen graph need?
The Petersen graph has 10 vertices and 15 edges, and it is cubic, so every vertex has degree 3 (Wikipedia: Petersen graph). Label the outer pentagon 0 to 4 and the inner star 5 to 9, with spokes from i to i + 5 and star edges 5–7, 7–9, 9–6, 6–8, 8–5.
Check Brooks first. Δ = 3. It is connected, not a cycle, and not the complete graph K4 (which has 4 vertices). So Brooks promises 3 colours. It cannot be done with 2, because the outer pentagon is an odd cycle. So the chromatic number is 3, which matches the published value (Wikipedia: Petersen graph).
Greedy in the order 0, 1, ..., 9 happens to find it:
Outer ring: 0 gets 1, 1 gets 2, 2 gets 1, 3 gets 2, and 4 sees 0 and 3 (colours 1 and 2), so it gets 3.
Inner star: 5 sees 0 and gets 2; 6 sees 1 and gets 1; 7 sees 2 and 5 and gets 3; 8 sees 3, 5, 6 (colours 2, 2, 1) and gets 3; 9 sees 4, 6, 7 (colours 3, 1, 3) and gets 2.
Every star edge joins two different colours, so this is a proper 3-colouring.
How to use this in a problem
Find Δ first; greedy gives Δ + 1 at once.
Run the three-question check to drop to Δ.
Look for an odd cycle or a clique to prove a lower bound.
If greedy wastes colours, reorder: colour a hard part first, or work inwards towards a low-degree vertex.
To count every proper colouring, see the chromatic polynomial of a graph; bipartite graphs return in König's theorem on matchings and vertex covers. The Fermi Concept Library gives every concept in mathematics its own lesson, and the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning.



