The maths behind 4square
The Four Colour Theorem, Kempe chains, and why the hole is hard to fill
Colour any map drawn on a plane or a globe so that regions sharing a border get different colours. Four colours are always enough. That is the Four Colour Theorem, one of the most famous results in mathematics, and 4square is built on the move that was supposed to prove it.
A question from 1852
Francis Guthrie noticed in 1852, while colouring the counties of England, that four colours seemed to suffice for every map. The question passed to Augustus De Morgan and became a well-known open problem. It is easy to see that three colours are not always enough: four regions that all touch each other need four colours. The hard part is showing that no map ever needs five.
Maps as graphs
Mathematicians usually redraw a map as a graph: one dot per region and a line between every pair of regions that share a border. A map drawn on a sphere becomes a planar graph, and colouring the map means colouring the dots so that no line joins two dots of the same colour. 4square draws its maps both ways: as islands of tiles in some styles, and as dots and lines in others.
One fact about planar graphs drives everything: every such map has a region with at most five neighbours. (It follows from Euler's formula: on average a region has fewer than six neighbours, so some region has five or fewer.)
Kempe's argument, 1879
Alfred Kempe tried induction. Take a map, remove a region with at most five neighbours, four-colour the smaller map, then put the region back. If its neighbours use three colours or fewer, give it the missing one. If they use all four, recolour something first.
His tool was the chain swap that 4square uses as its only move. Pick two colours and the connected patch of regions that alternate between them: swapping the two colours throughout the patch keeps the colouring valid. If a neighbour of the hole can be swapped without the chain reaching another neighbour of the other colour, the rim loses a colour and the hole can be filled. Kempe showed this always works when the hole has four or fewer neighbours. For a hole with five neighbours he proposed doing two swaps at once.
Heawood's catch, 1890
Eleven years later Percy Heawood published a map where Kempe's two swaps, done one after the other, fail: the first swap reconnects the chain that the second one needed. Kempe's proof had a gap. Heawood rescued the weaker statement that five colours always suffice, which is still proved with Kempe's chains today. Level 4 of 4square shows Kempe's double swap working; level 5 shows a map where it fails in both orders.
The proof that worked
Kenneth Appel and Wolfgang Haken proved the theorem in 1976 with a different strategy: a list of almost 2,000 unavoidable configurations, each shown reducible by computer. In 1997 Neil Robertson, Daniel Sanders, Paul Seymour and Robin Thomas simplified it to 633 configurations, and in 2005 Georges Gonthier checked the whole proof in the Coq proof assistant. The theorem is settled. What remains interesting is the dynamics Kempe was reaching for.
What 4square explores
Each level is Kempe's situation made concrete: a hole with five neighbours whose rim uses all four colours. Every swap is a Kempe swap. Can swaps alone always fill the hole, on every map? Nobody knows a proof that they can. One would give a short, Kempe-style proof of the theorem, which is why these small puzzles are worth studying. The levels come from exhaustive computer searches of every sphere map up to 34 regions, which found:
- π loops. On a doubly locked rim one chain is forced. Following it can cycle forever: on some maps 20 swaps bring you back to the start without the rim ever opening.
- Quiet exits. Sometimes every shortest solution begins with a chain that never touches the rim.
- Deep pits. The deepest starting colouring found among maps of 34 regions needs six swaps. Nobody has proved that the number of swaps stays bounded on larger maps.
- Separate seas. A map's colourings can split into groups (Kempe classes) that no swap connects, yet each group can still contain a way to fill the hole.
The game grew out of an open research project on deductive and computer-checked approaches to the theorem, GraphColourDeductiveSolver. Its hardest pieces became the Hurdle levels.
Further reading
- Robin Wilson, Four Colors Suffice: How the Map Problem Was Solved (Princeton University Press).
- N. Robertson, D. Sanders, P. Seymour and R. Thomas, "The Four-Colour Theorem", Journal of Combinatorial Theory, Series B 70 (1997).
- G. Gonthier, "Formal Proof: The Four-Color Theorem", Notices of the AMS 55 (2008).
- P. J. Heawood, "Map-Colour Theorem", Quarterly Journal of Pure and Applied Mathematics 24 (1890).