Euler Hall — free maths guides

Colouring: the fewest colours that keep neighbours apart

Decide whether a described colouring is proper. The idea in plain words, a worked example, and a check with the answers shown — part of the free Quantitative Reasoning guides.

Adjacent vertices must differ

A colouring of a graph assigns a colour to every vertex so that no edge joins two vertices of the same colour. Such a colouring is proper.

|pp |qq |p∧qp \wedge q | |---|---|---| | T | T | T |

The number that matters is the chromatic numberχ(G)\chi(G): the fewest colours a proper colouring needs.

  • - An edgeless graph needs 1.
  • - A bipartite graph needs 2 (next lesson).
  • - A triangle needs 3.
  • -KnK_n needsnn.

The origin is map colouring: countries are vertices, shared borders are edges, and a proper colouring is a set of colours that never puts the same one on two countries sharing a border. The four-colour theorem says every PLANAR graph — every graph that can be drawn with no crossing edges — needs at most 4.

Computing the chromatic number in general is hard, but on the small graphs in this course it is settled by trying 2 colours, then 3, and stopping at the first that works.

Why the chromatic number is worth computing

It is the smallest number of resources that makes a conflict-free assignment possible. Colour a radio network's transmitters with frequencies, and the chromatic number is the fewest frequencies that avoid interference. Colour a timetable's exams with time slots, and it is the fewest slots that avoid clashes for students taking both.

Two facts make it tractable in practice. First, a GREEDY colouring — take the vertices in any order, give each the smallest colour not used by its already-coloured neighbours — never uses more thanΔ+1\Delta + 1 colours, whereΔ\Delta is the maximum degree. That is a bound, not the answer, but it is a guarantee and it is instant. Second, the chromatic number is at least the size of the largest complete subgraph, since the vertices ofKkK_k all need different colours. Bounds from both sides, which is often enough.

What makes it hard in general is that those bounds can be far apart, and deciding whether 3 colours suffice is NP-complete. The small graphs here are settled by trying eachkk in turn.

Worked example: chromatic number of a small graph

*V={1,2,3,4,5}V = \{1, 2, 3, 4, 5\},E={12,23,34,45,15,13}E = \{12, 23, 34, 45, 15, 13\}. Find the chromatic number.**

Step one — is 1 colour possible? No: the graph has edges, and one colour would put the same colour on both ends of every edge.

Step two — is 2 possible? Try: 1 red, 2 blue, 3 red — but1313 is an edge, so 3 cannot be red. Try 3 blue instead — but2323 is an edge, so 3 cannot be blue either. Both colours are used by 3's neighbours, so two colours fail. The triangle 1–2–3 is why: three mutually adjacent vertices need three colours.

Step three — is 3 possible? 1 red, 2 blue, 3 green, 4 red, 5 blue. Check each edge:1212 differs,2323 differs,3434 differs,4545 differs,1515 differs,1313 differs. A proper 3-colouring exists.

Answer.χ=3\chi = 3. Lower bound from the triangle, upper bound from the explicit colouring — the two meet, which is what settles it.

By the end you can
  • Decide whether a described colouring is proper
  • Find the chromatic number of a small graph by trying each k
  • Use a triangle as a lower bound and an explicit colouring as an upper bound
Check yourself
  1. 1. What is the chromatic number of a triangle?
  2. 2. What is the chromatic number of a 4-cycle?
  3. 3. Why does a graph containing a triangle need at least 3 colours?
Answers

1. 3 — every pair is adjacent, so all three differ. 2. 2 — colour alternately around the cycle. 3. The triangle's three vertices are mutually adjacent, so no two of them may share a colour, and three vertices with three different colours need three.

Work out where to start — free, no accountAnswer six real questions — free, no account