Contents / Combinatorics / Graph Coloring and Ramsey Theory
Chapter 6
Graph Coloring and Ramsey Theory
Colouring vertices and edges, the chromatic number and its bounds, and the Ramsey results that make disorder impossible.
Introduction
Colouring vertices and edges, the chromatic number and its bounds, and the Ramsey results that make disorder impossible.
A colouring is a partition in disguise. Colouring the vertices of a graph so that no edge is monochromatic splits the vertex set into independent pieces, and the least number of pieces needed — the chromatic number — is one of the hardest invariants in graph theory to pin down. Colouring the edges asks the same question of a different graph, and there the answer is almost complete: Vizing's theorem traps the edge chromatic number inside a window of width one. Then comes the reversal that gives the chapter its second half. Instead of asking for a colouring with no monochromatic structure, fix the number of colours and ask how large the host graph must be before a monochromatic structure becomes unavoidable. That is Ramsey theory, and it is edge colouring read backwards.
Throughout, is a finite simple graph — no loops, no repeated edges — with vertices and edges. We write for the maximum degree, for the minimum degree, for the clique number (the largest with ) and for the independence number (the size of the largest set of pairwise non-adjacent vertices).
6.1Proper Colourings and the Chromatic Number
Definition 6.1 (Proper colouring and chromatic number). Let be an integer. A proper -colouring of is a map
The condition constrains only edges, so non-adjacent vertices are free to share a colour and are in fact encouraged to: reusing colours is exactly what drives down. Nothing requires a proper colouring to use all colours, which is why -colourable implies -colourable and the minimum defining is taken over an upward-closed set. A finite graph is always -colourable — give every vertex its own colour — so that set is non-empty and .
The names of the colours carry no information. What a proper colouring really produces is a partition of the vertices, and that reformulation is the one to keep in mind.
Proposition 6.2 (Colourings are partitions into independent sets). is -colourable if and only if can be written as a union of pairwise disjoint (possibly empty) independent sets — sets spanning no edge of . Consequently is the least number of independent sets into which can be partitioned.
Proof. Given a proper -colouring , let be the colour class of colour . These sets are disjoint and cover . If were adjacent then would violate properness, so each is independent.
Conversely, given a partition into independent sets, define for the unique with . If is an edge then and cannot lie in a common , since spans no edge, so .∎
Intuition. Think of the colours as rooms and of each edge as an instruction "these two must not share a room". A proper colouring is a room assignment; the chromatic number is the smallest number of rooms that can hold everybody. Because only the grouping matters, swapping the labels on two rooms gives the same assignment — which is why counts classes, not labellings.
Two consequences drop out immediately and will be used constantly.
Proposition 6.3 (Monotonicity, the clique bound and the independence bound). If is a subgraph of then . In particular
Proof. Restricting a proper colouring of to leaves every edge of bichromatic, because every edge of is an edge of ; hence . In a complete graph no two vertices may share a colour, so ; taking gives .
For the last claim, a proper -colouring splits into independent sets, each of size at most , and together they cover all vertices; hence .∎
Proposition 6.4 (The standard families). For we have and ; for every tree with at least one edge; and for cycles with ,
Proof. The first two were just argued. For a tree, root it anywhere and colour each vertex by the parity of its distance to the root; every edge of a tree joins consecutive levels, so its ends receive opposite parities. One colour will not do, since the tree has an edge.
For an even cycle , colour by the parity of ; the only edge that could fail is , and even makes and opposite in parity. For odd, suppose were a proper -colouring. The colour must change at each of the steps along , so depends only on the parity of ; then because and are both odd, contradicting that is an edge. So , and the colouring shows three colours suffice.∎
The odd cycle is not merely an example; it is the only obstruction to two colours. That is the first real theorem of the subject.
Theorem 6.6 (Two colours iff no odd cycle). For a graph with at least one edge, the following are equivalent.
- .
- is bipartite: with and every edge having one end in and one in .
- contains no cycle of odd length.
Proof. (1) (2). A proper -colouring is exactly a partition into two independent sets by Proposition Colourings are partitions into independent sets, and a partition into two independent sets is exactly a bipartition.
(2) (3). Let be a cycle in a bipartite graph with parts . Consecutive vertices lie in opposite parts, so part membership alternates and lies in the same part as precisely when is odd. Closing the cycle requires and to lie in opposite parts, which forces to be even.
(3) (2). We may assume connected; otherwise bipartition each component and take unions. Fix a vertex and let be the length of a shortest path from to , finite by connectedness. Put
Pitfall. Two colours are decided by a clean local condition, and it is tempting to expect the same for three. It is not so: deciding -colourability is NP-complete, and no finite list of forbidden subgraphs characterises it. Two colours are special because a -colouring of a connected graph is forced once a single vertex is coloured, and a forced process either completes or exhibits a visible contradiction. From three colours upward there is genuine choice, and the choices interact globally.
Example 6.7 (The Petersen graph). The Petersen graph has an outer -cycle , five inner vertices joined in the pentagram , and the five spokes . Determine .
Solution. Lower bound. The outer -cycle is odd, so by Theorem Two colours iff no odd cycle.
Upper bound. Take
Note that here: the Petersen graph is triangle-free. The clique bound is therefore off by one, which is the theme of the next section.□
Remark. is determined neither by the number of edges nor by the degree sequence. The -cycle and the disjoint union of two triangles both have six vertices, six edges and every degree equal to — and chromatic numbers and . Any useful bound must look at more than counts.
6.2Bounds on the Chromatic Number
Computing exactly is hard, so the working mathematician brackets it: an upper bound comes from exhibiting a colouring, a lower bound from exhibiting a structure that forces colours apart. This section collects the standard brackets and then shows how far apart they can be.
The cheapest colouring algorithm is also the source of the cheapest bound.
Method 6.8 (Greedy colouring). Fix an ordering of the vertices. For in turn, assign to the smallest positive integer not already used on a neighbour of among .
The output is proper by construction: when is coloured, every earlier neighbour's colour is forbidden, and every later neighbour will in its turn avoid the colour of .
Theorem 6.9 (Greedy bound). For every graph ,
Proof. Run greedy in any order. When is reached, its already-coloured neighbours number at most , so at most colours are blocked. Among the colours at least one is therefore free, and the rule picks the least such. So greedy never introduces a colour above , and the colouring it produces is proper.∎
Pitfall. The number of colours greedy actually uses depends heavily on the order. Let be the crown : vertices and , with an edge exactly when . This graph is bipartite, so . But the order makes greedy use colours: are non-adjacent and both get colour ; then are adjacent to respectively, so both get colour ; inductively and are adjacent to all of and and so receive colour . Greedy can be off by an arbitrarily large factor. Some ordering always achieves — order the vertices by colour class of an optimal colouring — but finding it is as hard as the original problem.
A better ordering gives a better bound, and the right notion is degeneracy.
Definition 6.10 (Degeneracy). is -degenerate if every subgraph of has a vertex of degree at most . The degeneracy of is the least such , namely
Theorem 6.11 (Degeneracy bound). For every graph , .
Proof. Build an ordering backwards. Let be a vertex of degree at most in — one exists by definition. Delete it; in , again pick a vertex of degree at most , which exists because is a subgraph of . Continuing, we obtain an order in which each has at most neighbours among , since those are exactly its neighbours at the moment it was removed.
Run greedy in this order. At each step at most colours are blocked, so colour is never exceeded.∎
Since always, this refines the greedy bound, sometimes dramatically: a tree has but may have huge , and the bound returns the correct value . It is also how planarity will be converted into a colouring bound later in the chapter.
The remaining slack in is precisely two families.
Theorem 6.12 (Brooks' theorem). Let be connected. If is neither a complete graph nor an odd cycle, then
Proof. This is a sketch, not a complete argument; it rests on the greedy bound, on the existence of a depth-first (or breadth-first) search tree, and on Menger-type connectivity facts that are not proved in this chapter.
Write . If then a connected graph is a path or a cycle, and the excluded cases ( and odd cycles) leave only paths and even cycles, which are -colourable. So assume .
If has a vertex with , order the vertices by decreasing distance from , so that comes last and every other vertex has at least one neighbour closer to , hence at least one neighbour later in the order. Greedy then blocks at most colours at each vertex other than , and at itself at most colours; so colours suffice. Hence we may assume is -regular.
If is not -connected, it has a cut vertex ; each block together with has a vertex of degree below , so each is -colourable by the previous paragraph, and the colourings can be permuted to agree at and glued.
So is -regular and -connected. The heart of the proof is to produce a vertex with two neighbours that are non-adjacent to each other and such that is connected. Ordering the vertices by decreasing distance from with placed first and last, greedy gives and the same colour — legal, as they are non-adjacent — so when is finally reached, its neighbours carry at most distinct colours and a colour remains free. Exactly when no such triple exists, turns out to be complete or an odd cycle, which are the excluded cases.∎
Remark. Brooks' theorem is sharp in a strong sense: has , and an odd cycle has . Those are the only connected graphs attaining .
Now the lower bounds. The clique bound is the obvious one, and the natural hope — that is governed by , so that a graph needing many colours must contain a large clique — is false in the most emphatic way possible. There are triangle-free graphs of arbitrarily large chromatic number. Mycielski's construction builds them explicitly.
Definition 6.13 (Mycielskian). Let have vertices . The Mycielskian has vertex set
Theorem 6.14 (Mycielski: triangle-free with arbitrarily large ). If is triangle-free with at least one edge, then is triangle-free and
Proof. Triangle-free. The shadows form an independent set, since has no edge ; and is adjacent only to shadows. So a triangle contains at most one shadow and cannot contain unless it contains two shadows. Hence a triangle either lies inside — impossible, as is triangle-free — or consists of one shadow and two vertices of . In that case , and means , so is a triangle in . Contradiction.
. Take a proper -colouring of with . Colour by , colour the shadow by as well, and give the new colour . Shadows are pairwise non-adjacent, so they never clash with each other; an edge exists only when , in which case ; and has a colour used nowhere else. The colouring is proper and uses colours.
. Suppose had a proper colouring with colours. Since is adjacent to every shadow, no shadow carries the colour ; say , so for all . Define a colouring of by
Let . If neither nor was recoloured, because is proper. They cannot both have been recoloured, since that would mean on an edge. So exactly one was, say , giving and . But makes an edge of , so , i.e. .
Finally, is triangle-free with , and each Mycielskian raises by one while preserving triangle-freeness, so the claimed sequence exists.∎
Example 6.15 (The Grötzsch graph). Identify and its chromatic number.
Solution. has vertices, so has vertices. Its edges are the of the cycle, shadow-to-original edges (each joins the two neighbours of ), and edges from : twenty in all. This is the Grötzsch graph, the smallest triangle-free graph with .
By Theorem Mycielski: triangle-free with arbitrarily large , and is triangle-free, so while : the clique bound is off by two.□
Intuition. Why can a triangle-free graph need many colours? Because is a global quantity and is a local one. A large clique is a local certificate that many colours are needed; the Mycielskian manufactures the need without the certificate, by making every small piece of the graph look easy while the pieces cannot be reconciled with each other. The shadow is a vertex that "must be able to take 's colour", and then demands one colour that no shadow may use — an entirely non-local squeeze.
A useful complementary lower bound relates to its complement .
Proposition 6.16 (Nordhaus–Gaddum, product form). For every graph on vertices, .
Proof. Let and take an optimal colouring, whose colour classes cover vertices; so some class has . The set is independent in , hence a clique in , so and by Proposition Monotonicity, the clique bound and the independence bound, . Multiplying by gives the claim.∎
Remark. Three named results tell the rest of the story and are quoted here without proof, each far beyond the tools of this chapter. Grötzsch's theorem (1959): every triangle-free planar graph is -colourable — so planarity does restore a link between local and global that Mycielski destroys. The strong perfect graph theorem (Chudnovsky, Robertson, Seymour, Thomas, 2006): for every induced subgraph of if and only if neither nor contains an induced odd cycle of length at least five. Erdős (1959): for every and there is a graph of girth greater than and chromatic number greater than , proved by the probabilistic method — so not even forbidding all short cycles keeps small.
6.3The Chromatic Polynomial
So far has been a single number. There is more information available for the same price: instead of asking whether colours suffice, count how many proper colourings with colours there are. The count turns out to be a polynomial in , and is recoverable from it.
Definition 6.17 (Chromatic polynomial). For a positive integer , let denote the number of proper colourings . Colourings are counted as labelled maps, so permuting the colours gives a different colouring.
Proposition 6.18 (Three basic evaluations).
Proof. With no edges every vertex is free, giving choices each. In , colour the vertices in any order: the -th vertex is adjacent to all already coloured, and their colours are distinct, so it has choices; multiply.
For a tree, root it and colour outwards from the root. The root has choices. Every other vertex has exactly one already-coloured neighbour, its parent, so it has choices, and these choices are independent because no two non-parent vertices of the tree are adjacent to one another before being reached. Multiplying gives .∎
Everything else follows from one identity, which is the fundamental recursion of the theory.
Notation. For an edge of , write for the graph with deleted, and for the graph obtained by contracting : delete , identify and into a single vertex, and discard any repeated edges so the result stays simple. Contraction reduces the vertex count by one.
Theorem 6.19 (Deletion–contraction). For every graph and every edge ,
Proof. Let and split the proper -colourings of into two classes according to whether and receive the same colour.
If is a proper colouring of with , then is also a proper colouring of , because the only edge of not in is itself and its ends differ. Conversely every proper colouring of restricts to such a colouring of . So this class is in bijection with the proper colourings of , and has size .
If instead , then assigns a single colour to the pair and a colour to each other vertex, with all edges of bichromatic. That is precisely the data of a proper colouring of : a vertex is adjacent to the merged vertex in exactly when is adjacent in to or to , and the condition " differs from the common colour" is the same in both graphs. Discarding repeated edges changes no constraint, only how many times it is written. So this class has size .
The two classes are disjoint and exhaust the colourings of , so .∎
Intuition. Deleting an edge relaxes a constraint, so has at least as many colourings as . The excess consists exactly of the colourings that were only admissible because the constraint was dropped — the ones giving and the same colour — and gluing to is how you count those. Deletion–contraction says: colourings of = colourings without the rule, minus the ones that cheat.
The recursion strictly reduces at each step and bottoms out at edgeless graphs, so it computes for any graph in finitely many steps. It also proves that deserves the name "polynomial".
Theorem 6.20 ( is a polynomial). For every graph on vertices and edges there is a polynomial with integer coefficients agreeing with at every positive integer . It has degree , is monic, has constant term when , its coefficient of is , and its coefficients alternate in sign: writing
Proof. Induction on . If then by Proposition Three basic evaluations: monic of degree , coefficient of equal to , non-negative coefficients with the sign pattern (all but the leading one are zero).
Suppose and the statement holds for all graphs with fewer edges. Pick . Then has vertices and edges, and has vertices and at most edges. By induction,
For the signs: write and with all . Then
Finally for because there is no map into an empty colour set, so the constant term vanishes.∎
Proposition 6.21 (Recovering ). , and for every .
Proof. says precisely that a proper -colouring exists, which is the definition of -colourable; and -colourable implies -colourable, since a colouring into is one into . So the set of with is exactly and its minimum is .∎
Example 6.22 (The chromatic polynomial of a cycle). Show that for , and read off .
Solution. Induct on . For , and Proposition Three basic evaluations gives ; meanwhile ✓.
For pick an edge of . Deleting it leaves the path , a tree on vertices, so . Contracting it leaves . By Theorem Deletion–contraction and the inductive hypothesis,
Now read off . At the value is . At it is , which is for even and for odd. So by Proposition Recovering , for even — and indeed there are exactly two proper -colourings, one for each way of labelling the two classes — while for odd we must go to , where . This recovers Proposition The standard families, now with counts attached.□
Example 6.23 (A small graph by deletion–contraction). Compute for the "paw": a triangle on plus a pendant vertex adjacent only to .
Solution. Colour last. It has one neighbour, , so once are coloured there are choices for , independently of everything else. Hence .
Check against the theorem. Expanding gives . Degree ✓, monic ✓, coefficient of equal to ✓ (the paw has four edges), signs alternating ✓, constant term ✓.
Smallest with : , , . So , matching the triangle's demand.□
Pitfall. The chromatic polynomial does not determine the graph. All trees on vertices share the polynomial , so the path and the star are indistinguishable by it even though they are not isomorphic. Nor does every alternating-sign polynomial of the right shape arise from a graph. Take . Degree forces , the coefficient of forces , and the lowest surviving power forces two components (the multiplicity of the factor is the number of components). Four vertices, three edges and two components leave only a triangle plus an isolated vertex, whose polynomial is . Deciding which polynomials are chromatic is open in general.
Remark. The chromatic polynomial evaluated outside the positive integers still means something. Stanley's theorem (1973) says equals the number of acyclic orientations of — assignments of a direction to every edge leaving no directed cycle. For the triangle this predicts , and indeed the orientations of are acyclic except for the two cyclic ones. The chromatic polynomial is a specialisation of the Tutte polynomial, which is why so many counting problems on graphs reduce to it.
6.4Applications: Scheduling, Registers and Maps
Colouring is the canonical model for conflict avoidance. Whenever a set of objects must be partitioned into groups so that certain pairs stay apart, the objects are vertices, the conflicts are edges, the groups are colours, and the fewest groups is . Three standard instances:
- Timetabling. Vertices are exams; join two exams if some student sits both; colours are time slots. A proper colouring is a clash-free timetable and is the shortest possible exam period.
- Register allocation. Vertices are program variables; join two if their live ranges overlap, so they cannot share a machine register; colours are registers. A -colouring assigns variables to the available registers; if the compiler must "spill" a variable to memory. Chaitin's 1982 allocator is exactly greedy colouring with spilling.
- Frequency assignment. Vertices are transmitters; join two if they are close enough to interfere; colours are frequency bands.
Intuition. The modelling step is always the same and always worth doing slowly: decide what a conflict is, and put an edge exactly there. Getting this wrong is the usual source of nonsense. In timetabling the edge is "shares a student", not "same department"; in register allocation it is "live at the same instant", not "appears in the same line of code".
Example 6.24 (An exam timetable). Six exams must be scheduled. Pairs sharing a student: , , , , , , , , . What is the shortest clash-free timetable?
Solution. Lower bound. are pairwise conflicting, a in the conflict graph, so and by the clique bound.
Upper bound. Take slots , , , , (its only conflict is , in slot ), (its conflicts are in slot and in slot ). Every listed pair receives different slots, so four slots suffice.
Hence and four slots is optimal. Note that the lower bound came from a clique and the upper from an explicit colouring — the standard two-sided argument, and the only honest way to claim optimality.□
Remark. Sudoku is the same problem in disguise. Build a graph on the cells, joining two cells when they share a row, a column or a box. Each vertex has neighbours, the graph contains (any row), and a completed Sudoku grid is precisely a proper -colouring; so . Solving a puzzle is extending a partial colouring, which is harder in general than colouring from scratch.
How hard is it to compute ? As hard as anything in combinatorics.
Theorem 6.25 (Complexity of colouring). Deciding whether is NP-complete, and remains so for planar graphs of maximum degree . Computing exactly is NP-hard, and — unless — no polynomial algorithm approximates within a factor for any fixed .
Proof. Not proved here. The first statement is a classical reduction from -SAT; the inapproximability is Zuckerman's 2007 derandomisation of Håstad's result on clique approximation. Both belong to computational complexity rather than graph theory, and are quoted because they explain why the rest of the chapter is about bounds and special classes rather than algorithms.∎
Some classes escape.
Theorem 6.26 (Chordal graphs colour greedily). Call chordal if every cycle of length at least four has a chord (an edge joining two non-consecutive vertices of the cycle). Every chordal graph has a perfect elimination ordering — an ordering in which the later neighbours of each form a clique — and greedy colouring in the reverse of that ordering uses exactly colours. Hence for chordal , and both are computable in linear time.
Proof. Sketch, resting on Dirac's lemma, which is not proved here: every chordal graph has a simplicial vertex, one whose neighbourhood is a clique. Repeatedly removing a simplicial vertex (chordality is inherited by induced subgraphs) produces a perfect elimination ordering.
Given the ordering, colour greedily. When is reached, its already-coloured neighbours are exactly its later neighbours, which form a clique, so they carry distinct colours; if there are of them, receives a colour in , and together with those neighbours is a clique of size . So no colour above is used, and ; the reverse inequality is the clique bound.∎
Bipartite graphs are -colourable by the BFS construction inside Theorem Two colours iff no odd cycle, also in linear time. Chordal and bipartite graphs are both perfect — every induced subgraph has — and the strong perfect graph theorem quoted earlier characterises the perfect graphs exactly.
Planar graphs and maps
The historical root of the subject is map colouring. A map's countries become vertices and two countries sharing a border become adjacent, which produces a planar graph: one drawable in the plane with no two edges crossing. How many colours does a planar graph need?
Theorem 6.27 (Euler's formula). For a connected plane graph with vertices, edges and faces (regions of the plane, including the unbounded one),
Proof. Sketch, by induction on . A connected graph with vertices and no cycle is a tree, with and , so . If the graph has a cycle, delete an edge of that cycle: the graph stays connected, drops by one, and the two faces on either side of merge into one, so drops by one. The alternating sum is unchanged, and induction applies. The only step needing genuine topology — that an edge on a cycle really does separate two distinct faces — is the Jordan curve theorem, which is assumed.∎
Corollary 6.28 (Planar graphs are sparse). A simple planar graph with vertices has at most edges, and therefore a vertex of degree at most .
Proof. We may add edges until the graph is maximal planar, which only helps the bound, and assume it is connected. Every face of a simple plane graph with is bounded by at least three edges, and every edge borders exactly two faces; counting incidences of edges with faces in two ways gives , i.e. . Substituting into Euler's formula,
If every vertex had degree at least , then , so , a contradiction. Hence .∎
Since every subgraph of a planar graph is planar, the corollary says planar graphs are -degenerate, and Theorem Degeneracy bound immediately gives six colours.
Theorem 6.29 (Six colour theorem). Every planar graph satisfies .
Proof. Every subgraph of a planar graph is planar, so by Corollary Planar graphs are sparse every subgraph has a vertex of degree at most ; that is, . Theorem Degeneracy bound gives .∎
One more colour can be removed by an argument of Kempe that, unlike his attempted proof of four colours, is correct.
Theorem 6.30 (Five colour theorem). Every planar graph satisfies .
Proof. Induction on . For give every vertex its own colour. Let and fix a plane drawing of . By Corollary Planar graphs are sparse there is a vertex with . By induction has a proper -colouring .
If , or if the neighbours of use at most four colours between them, a colour is free for and we are done. So assume has exactly five neighbours , listed in the cyclic order in which their edges leave in the drawing, with for each .
Let be the subgraph of induced by the vertices coloured or , and let be the connected component of containing — a Kempe chain.
Case A: . Swap colours and throughout . The result is still a proper colouring of : inside the swap preserves properness, and any edge leaving goes to a vertex coloured neither nor (otherwise it would lie in ). Now is coloured and is still coloured , so colour is used by none of 's neighbours; give it to .
Case B: . Then there is a path from to using only colours and . Together with , this path forms a closed curve in the plane which separates from : the cyclic order of the neighbours around puts strictly inside the region bounded by the curve and strictly outside. Any path from to in must cross that curve, and since the drawing is planar it can only cross at a vertex of the curve — but every such vertex is coloured or . So no path from to uses only colours and : the component of the -subgraph containing does not contain . Swap colours and on that component, exactly as in Case A, and colour is freed for .
Either way has a proper -colouring.∎
Theorem 6.31 (Four colour theorem). Every planar graph satisfies .
Proof. Not proved here, and no short proof is known. The statement was conjectured by Guthrie in 1852. Kempe published a proof in 1879 using the chain argument above on a vertex of degree ; Heawood found the error in 1890 — the two simultaneous Kempe swaps the argument needs can interfere with one another — and salvaged the five colour theorem from the wreckage, which is the proof given above.
The theorem was finally proved by Appel and Haken in 1976. Their argument is a discharging proof: an unavoidable set of configurations is exhibited, such that every planar triangulation must contain one of them, and each is shown to be reducible, meaning a four-colouring of a smaller graph extends across it. The reducibility checks were performed by computer and took over a thousand hours; they cannot be carried out by hand. Robertson, Sanders, Seymour and Thomas gave a cleaner version in 1997 with configurations, still machine-checked. In 2005 Gonthier produced a fully formal proof verified by the Coq proof assistant, which removes doubt about the case analysis but does not make the proof humanly surveyable.
The bound is sharp: is planar and needs four colours.∎
Pitfall. The four colour theorem is about planar graphs and says nothing about graphs in general. needs colours and is non-planar for . The everyday version — "any map needs four colours" — also quietly assumes each country is a single connected region; a map with a country in two disconnected pieces that must share a colour is not modelled by a planar graph and can need arbitrarily many colours.
6.5Edge Colourings and Vizing's Theorem
Colour the edges instead of the vertices, and the conflict rule becomes: edges sharing an endpoint must differ.
Definition 6.32 (Proper edge colouring and chromatic index). A proper -edge-colouring of is a map such that whenever and share an endpoint. The chromatic index is the least such .
Proposition 6.33 (Colour classes are matchings). A proper -edge-colouring of is the same thing as a partition of into matchings — sets of pairwise disjoint edges. Consequently is the least number of matchings covering , and
Proof. A colour class is a set of edges no two of which share an endpoint, which is exactly a matching; conversely a partition into matchings defines a proper colouring by class index. For the bound, let be a vertex of degree . The edges at pairwise share the endpoint , so they receive distinct colours.∎
Remark. Edge colouring is vertex colouring the line graph , whose vertices are the edges of and whose edges join pairs meeting at a vertex: . So edge colouring is a special case of vertex colouring — which makes it all the more striking that it admits a near-complete answer while the general problem does not. Restricting to line graphs is a severe restriction, and it buys a great deal.
The near-complete answer is Vizing's, and it is the reason edge colouring feels tame.
Theorem 6.34 (Vizing's theorem). For every simple graph ,
Proof. Sketch. The lower bound is Proposition Colour classes are matchings. The upper bound is proved by induction on , and rests on two tools used in this chapter already: Kempe chains, and a counting device called a fan.
Suppose all but one edge of has been properly coloured with the palette . Every vertex has degree at most , so every vertex misses at least one colour of the palette. Build a fan at : a maximal sequence of distinct neighbours of in which the colour missing at is the colour of the edge . If some colour missing at is also missing at some , the fan can be "rotated" — recolour with the colour of for — and ends up coloured, finishing the step.
Otherwise, pick a colour missing at and a colour missing at the last fan vertex . Take the -Kempe chain from . Swapping colours along it frees a colour and, after at most one rotation of the fan, lets be coloured. Making "at most one rotation" precise — showing the chain cannot end at both places that would block the argument — is the technical core and is omitted.∎
Vizing's theorem splits every graph into two classes: class 1 if , class 2 if . Deciding which is NP-complete, so the gap of one colour is not merely a blemish in the statement. Some families are settled.
Theorem 6.35 (König's edge colouring theorem). Every bipartite graph is class 1: for bipartite .
Proof. Sketch, by induction on the number of edges, resting on the theory of alternating paths. Remove an edge and properly -edge-colour the rest. Both and miss a colour; if they miss a common colour, use it on . Otherwise misses and misses ; follow the -chain from . In a bipartite graph such a chain cannot return to , because it would have to be an odd closed walk; swapping colours along it frees at and can be coloured .∎
Proposition 6.36 (Cycles and odd order). for even and for odd. More generally, if is odd and
Proof. For the cycle, , so . A proper -edge-colouring of alternates colours around the cycle and closes up only when is even, by the same parity argument as in Proposition The standard families; for odd , colour .
For the general claim, a matching in a graph on vertices has at most edges, which for odd equals . If were class 1, its colour classes would be matchings covering all edges, giving , contrary to hypothesis.∎
Example 6.37 (Round-robin tournaments). teams each play every other team once, and a team plays at most one match per round. How many rounds are needed?
Solution. Matches are the edges of ; a round is a set of matches with no team appearing twice, i.e. a matching; so the minimum number of rounds is . Here .
For odd, , so Proposition Cycles and odd order makes class 2 and . Concretely: with odd each round leaves at least one team idle, since is odd, so at most matches per round and at least rounds are needed.
For even, , realised by the classical circle schedule: fix one team at the centre and arrange the other around a circle; in round , the centre plays the team at position and the remaining teams are paired by reflection about the diameter through position . Rotating gives rounds covering every pair exactly once.
So the answer is rounds for even and rounds for odd — and for odd a bye is unavoidable, which is exactly what class 2 means here.□
Remark. The Petersen graph is the standard small class-2 graph that is not covered by the parity argument: it is -regular on ten (even) vertices, yet . For a cubic graph, being class 1 is the same as splitting the edge set into three perfect matchings, and the Petersen graph admits no such split — although it does have perfect matchings. It is the smallest snark: a bridgeless cubic class-2 graph of girth at least five.
Intuition. Here is the turn that organises the rest of the chapter. An edge colouring of with two colours is just a way of splitting the pairs from an -set into two groups: friends and strangers, say. Everything so far has asked for a colouring that avoids something — no two edges of a colour class meeting at a vertex. Ramsey theory asks the opposite question about the same object: given that we are free to colour the edges of however we like with two colours, what monochromatic structure are we forced to create once is large enough? No properness is demanded and none is possible; the colour classes are arbitrary graphs. The question is how big must be before arbitrariness runs out.
6.6Ramsey Numbers
Definition 6.38 (Ramsey number). Let . The Ramsey number is the least such that every colouring of the edges of with the two colours red and blue contains a red (a set of vertices with all pairs red) or a blue .
Three things about this definition need saying at once. The colouring is completely arbitrary — no properness, no balance. The two colours play different roles, so holds only because swapping the colours is a bijection between colourings. And the definition presupposes that some works; that is finite at all is a theorem, proved in the next section.
Intuition. Read it as a party. Invite people; colour the pair red if and know each other and blue if they do not. A red is three mutual acquaintances, a blue three mutual strangers. is the smallest party size at which one of the two is guaranteed, whatever the acquaintance pattern. The point is not that such a party can be arranged — it is that it cannot be avoided.
Proposition 6.39 (Trivial values). and for every .
Proof. is a red vacuously — a single vertex spans no edges — so already suffices and .
For : in a colouring of either some edge is red, giving a red , or every edge is blue, giving a blue ; so suffices. And does not: colour every edge of blue. There is no red (no red edge at all) and no blue (not enough vertices). So .∎
The first genuinely non-trivial value is the one everybody meets first.
Theorem 6.40 (). Every red/blue colouring of the edges of contains a monochromatic triangle, and some colouring of does not.
Proof. Upper bound: . Take any colouring of and fix a vertex . The five edges at receive two colours, so by the pigeonhole principle at least of them share a colour; say , , are all red.
Consider the three edges , , . If any one of them is red — say — then is a red triangle, since are all red. If none of them is red, then are all blue and is a blue triangle. Either way a monochromatic triangle exists. (If the majority colour at is blue instead, exchange the words red and blue throughout.)
Lower bound: . Colour by making the five edges of the cycle red and the five remaining edges — the pentagram — blue. Each colour class is itself a -cycle, and contains no triangle: a triangle needs three mutually adjacent vertices, whereas in any two adjacent vertices have no common neighbour. So neither class contains and fails.
Together these show is the least sufficient .∎
Pitfall. "Six people always contain three mutual friends or three mutual strangers" does not say the six people contain three mutual friends. The conclusion is a disjunction, and which half holds depends on the colouring. Nor does the theorem locate the triangle: the proof picks an arbitrary vertex and follows the majority colour, so the triangle found depends on the choice of . Ramsey statements assert existence and almost never identify a witness.
Example 6.42 (Every -colouring of has at least two monochromatic triangles). Strengthen Theorem by counting.
Solution. Call a triple bichromatic if its three edges are not all the same colour. Count bad pairs: pairs where are edges at of different colours. At a vertex of red-degree and blue-degree , the number of such pairs is , the maximum of over integers . Summing over the six vertices, there are at most bad pairs.
Every bichromatic triangle contains exactly two vertices at which its two incident edges differ in colour — if the triangle has two edges of one colour and one of the other, the two vertices meeting the odd edge each see a colour change — so it contributes exactly bad pairs, and a monochromatic triangle contributes . Hence the number of bichromatic triangles is at most .
has triangles, so at least are monochromatic. The bound is attained, so "two" cannot be improved.□
The exact values are known only for very small parameters, and the reason is brute force: checking by exhaustion would require sifting the colourings of .
Proposition 6.43 (Small Ramsey numbers). The known diagonal and near-diagonal values are
Proof. Not proved here; each value is a separate piece of work combining an explicit colouring for the lower bound with a computer search or a clever counting argument for the upper. is due to Greenwood and Gleason (1955), to McKay and Radziszowski (1995) after years of computation.∎
Remark. Erdős's much-quoted remark makes the difficulty concrete. If aliens demanded the value of on pain of destroying the Earth, we should marshal every computer and mathematician and try to find it. If they asked for , we should attempt to destroy the aliens.
Two generalisations extend the definition without changing its character.
Definition 6.44 (Multicolour and hypergraph Ramsey numbers). For colours, is the least such that every -colouring of the edges of has, for some , a entirely in colour .
For -uniform hypergraphs, is the least such that every red/blue colouring of the -element subsets of an -set contains a set of elements all of whose -subsets are red, or a set of elements all of whose -subsets are blue. The graph case is .
Both are finite, by the same arguments as in the next section. The only multicolour value known exactly beyond the trivial ones is .
6.7Bounding the Ramsey Numbers
Nothing so far shows that exists. The existence proof and the best general upper bound are the same argument, and it is an induction on modelled on Pascal's rule.
Theorem 6.45 (Erdős–Szekeres recursion). For , if and are finite then so is , and
Proof. Put and take any red/blue colouring of . Fix a vertex and split the other vertices by the colour of their edge to :
Suppose . The colouring restricted to contains a red or a blue , by the definition of . In the second case we are finished. In the first, that red together with is a red : every vertex of is joined to in red by construction, and the internal pairs are red by assumption.
The case is identical with the colours exchanged: a blue inside plus makes a blue .∎
Corollary 6.46 (Binomial bound). For all ,
Proof. Induction on . If then , and symmetrically for . For , Theorem Erdős–Szekeres recursion and the inductive hypothesis give
For the diagonal case, .∎
So , against the true value , and against the true . A parity refinement closes the second gap exactly.
Proposition 6.47 (Parity refinement). If and are both even, then .
Proof. Write , , both even, and set , which is odd. Take a colouring of with no red and no blue ; we derive a contradiction.
For each vertex , let be its red degree. If then, as in the proof of the recursion, the red neighbourhood of contains a red (giving a red with ) or a blue — either way a contradiction. So for every . Similarly the blue degree is at most , so . Hence for every vertex.
Now count red edges: must be even. But with odd and odd, so the sum is odd. Contradiction, so no such colouring exists and vertices already force the conclusion.∎
Example 6.48 (Pinning down ). Show .
Solution. Upper bound. and are both even, so Proposition Parity refinement gives .
Lower bound. An -vertex colouring with no red triangle and no blue is needed. Take vertices and colour red when or , blue otherwise. The red graph is the -cycle plus its four long diagonals; it is triangle-free, since a red triangle would need three differences from summing to , and , and the like never vanish mod — the only sums of three such differences that vanish would require or , neither of which holds. The blue graph joins and when , and one checks it contains no : a blue would be four residues with all six pairwise differences in , and any four residues in include a pair differing by or .
Hence vertices do not force the conclusion and .□
The upper bounds come from a deterministic argument. The best lower bounds come from a probabilistic one, and Erdős's 1947 proof of it is the founding example of the probabilistic method: the colouring it produces is never exhibited, only shown to exist.
Theorem 6.49 (Erdős probabilistic lower bound). If and satisfy
Proof. Colour each edge of red or blue independently, each with probability . For a fixed set of vertices, let be the event that is monochromatic. The edges inside are coloured independently, so
For the consequence, take and . Using ,
Intuition. The probabilistic method replaces "construct an object with property " by "put a probability distribution on candidates and show ". Nothing is built, yet the conclusion is a genuine existence statement. Here the random colouring is the fairest possible, and the calculation says that monochromatic 's are so unlikely individually that even of them do not add up to certainty. What the argument emphatically does not do is tell you which colouring to write down.
Pitfall. The gap between the bounds is enormous and has barely moved in eighty years: , so is known only to lie between and . Even worse, no explicit construction comes close to — the best known constructive lower bounds are quasi-polynomial in comparison. This is the classic embarrassment of the probabilistic method: it proves that almost every colouring is good, while nobody can name one.
Remark. The upper bound has finally started to move. Campos, Griffiths, Morris and Sahasrabudhe proved in 2023 that for an explicit , the first exponential improvement on the Erdős–Szekeres bound. Off the diagonal, is known exactly up to constants, the lower bound again probabilistic (Kim, 1995) and the upper bound by Ajtai, Komlós and Szemerédi.
6.8Infinite Ramsey Theory
The infinite version of Ramsey's theorem is both stronger in conclusion and easier to prove than the finite one, because at every step it can afford to throw away infinitely much. Nothing has to be counted.
Notation. For a set write for the collection of its -element subsets. A colouring of with colours is a map , with no constraint whatever. A set is homogeneous (or monochromatic) for the colouring if all of receives a single colour.
Theorem 6.50 (Infinite Ramsey theorem). Let be infinite, , , and let be coloured with colours. Then there is an infinite homogeneous .
Proof. Induction on . For the colouring splits into classes; if all were finite their union would be finite, so some class is infinite and is homogeneous.
Let and suppose the theorem holds for . We build a sequence of vertices and a decreasing chain of infinite sets. Put . Given an infinite , choose any and define a colouring of by
This produces distinct and colours with the key property: whenever , the set has colour . Indeed all lie in , which is homogeneous of colour for .
Finally, the infinitely many indices carry only colours , so some colour occurs for infinitely many indices . Then is infinite, and every -subset of has colour by the key property. So is homogeneous.∎
Corollary 6.51 (Infinite monochromatic clique). In every red/blue colouring of the edges of the complete graph on there is an infinite set of vertices all of whose internal edges have the same colour.
Proof. This is the case , , of Theorem Infinite Ramsey theorem.∎
Intuition. The engine of the proof is the infinite pigeonhole principle: a set split into finitely many pieces has an infinite piece. That is what lets each step commit to one colour for a vertex without ever running out of room. The finite theorem has no such luxury — there each step consumes a definite fraction of what is left, which is why the finite proof yields a bound and the infinite one does not.
A pleasant corollary shows the theorem doing work outside graph theory.
Corollary 6.52 (Monotone subsequences). Every infinite sequence of real numbers has an infinite subsequence that is non-decreasing or non-increasing.
Proof. Colour a pair with red if and blue if . By Corollary Infinite monochromatic clique there is an infinite all of whose pairs receive one colour. Listing in increasing order as , the red case gives and the blue case gives .∎
The infinite theorem also implies the finite one, by a compactness argument. This gives a second proof that is finite — a proof that, unlike the recursion, yields no bound at all.
Theorem 6.53 (Compactness: infinite implies finite). Let be given. There exists such that every -colouring of has a homogeneous set of size .
Proof. Suppose not. Then for every there is an -colouring of with no homogeneous -set. Build a tree whose nodes at level are the "bad" colourings of , with a colouring at level joined to its restriction at level . Each level is non-empty by assumption and finite, since there are only colourings in all. A restriction of a bad colouring is bad, so every node has a parent and the tree is connected.
By König's lemma — an infinite, finitely branching tree has an infinite branch, which we quote without proof — there is a sequence of colourings, each extending the previous. Their common refinement is a single -colouring of with no homogeneous -set, since any such set would be contained in for some and would already be homogeneous for . But Theorem Infinite Ramsey theorem gives an infinite homogeneous set for , and any of its elements form a homogeneous -set. Contradiction.∎
Pitfall. The compactness proof is ineffective: it shows exists without producing it, because König's lemma selects a branch without describing it. That is why the recursion of Theorem Erdős–Szekeres recursion, weak as its bound is, remains the source of every explicit upper estimate on Ramsey numbers. "Infinite Ramsey implies finite Ramsey" is a statement about existence, not about size.
Remark. Both hypotheses in the infinite theorem are needed. With infinitely many colours it fails: colour by the pair itself, and no two pairs share a colour, so no homogeneous set of size exists. And it does not lift freely to larger cardinalities: Sierpiński constructed a colouring of with two colours having no uncountable homogeneous set, so . The cardinals for which the analogue does hold are the weakly compact cardinals, whose existence is not provable in ZFC — the infinite Ramsey theorem for sits right at the edge of what set theory gives for free.
6.9Van der Waerden, Schur and the Ramsey Family
Ramsey's theorem for graphs is one member of a family whose common shape is: partition a large enough structure into finitely many classes, and one class must contain a copy of the structure you care about. The slogan, due to Motzkin, is that complete disorder is impossible. The structures vary; the phenomenon does not.
Theorem 6.54 (Schur's theorem). For every there is an integer such that whenever with is coloured with colours, some colour class contains (not necessarily distinct) with
Proof. Let , the -colour Ramsey number for triangles, which is finite by the multicolour form of Theorem Erdős–Szekeres recursion. Given an -colouring of , colour the edges of the complete graph on vertex set by
By choice of there is a monochromatic triangle with , say in colour . Set
Remark. Schur proved this in 1916 for a reason that had nothing to do with combinatorics: it shows that for every , the congruence has a solution with for all sufficiently large primes . Colour the non-zero residues mod by their coset in the quotient of by the -th powers — there are at most classes — and apply the theorem. So Fermat's equation cannot be ruled out by congruences alone.
Example 6.55 (The Schur numbers). The largest for which can be -coloured with no monochromatic solution of is for . Verify the case .
Solution. Colour by red and blue . Red sums: (blue), (out of range), (out of range). Blue sums: (red), (out of range), (out of range). No monochromatic solution, so in the "largest good " convention.
Now take and suppose a -colouring avoids monochromatic . Say is red. Then is blue. Then is red. Then : if were red, would be a red solution; so is blue. But then forces to be red, and is then a red solution. Contradiction. So always contains one, and is the largest good value.
The value for was established in 2017 by an exhaustive SAT-solver computation producing a two-petabyte proof — an indication of how quickly these numbers become inaccessible.□
Theorem 6.56 (Van der Waerden's theorem). For all there is an integer such that every -colouring of contains a monochromatic arithmetic progression of length : elements with , all of one colour.
Proof. Not proved here. The original 1927 argument is a double induction on and using "colour focusing", and it is elementary but long; it is the source of the enormous bounds discussed below.∎
Example 6.57 (). Every -colouring of contains a monochromatic -term arithmetic progression, and is not enough.
Solution. is not enough. Colour red and blue . Since , only is possible. Red: needs three consecutive reds, but the red runs are and ; gives and , both broken at the middle term; gives and , both broken. Blue: gives (and is out of range), broken; gives and , both broken; gives and , whose first terms are red. So neither class contains a -AP and .
is enough. Suppose some -colouring of has no monochromatic -AP. Swapping colour names, assume is red.
First, and are not both red, since would be a red progression. They are not both blue either: if they were, then would be red (else is blue) and would be red (else is blue), making red. So exactly one of is blue, and reflecting through — which preserves progressions and fixes — we may assume is blue and is red. Now the colours cascade:
- red forces blue, from .
- blue forces red, from .
- red forces blue (from ) and blue (from ).
- blue forces red, from .
- red forces blue, from .
But now are all blue — a monochromatic progression with , . Every branch closes, so forces one and .□
Pitfall. Van der Waerden numbers are astronomically larger than they look. and are tame, but , , and no further diagonal value is known. Van der Waerden's own proof gives a bound growing like the Ackermann function; Shelah reduced it to primitive recursive in 1988, and Gowers to a tower of height five in 2001 — still far beyond anything that can be searched.
Remark. Three further members of the family, stated without proof.
Szemerédi's theorem (1975) strengthens van der Waerden from colourings to density: any set with positive upper density contains arithmetic progressions of every finite length. Van der Waerden follows, since in an -colouring of some class has upper density at least .
Green–Tao (2004): the primes contain arbitrarily long arithmetic progressions — remarkable because the primes have density zero, so Szemerédi does not apply directly.
Erdős–Szekeres, "happy ending": for every there is such that any points in general position in the plane contain forming a convex polygon. One proof colours each triple of points by its orientation and applies the hypergraph Ramsey theorem of Definition Multicolour and hypergraph Ramsey numbers.
Intuition. Why should any of this be true? Because a colouring has to make a decision about every object, and the objects overlap. Once is red and is blue in Schur's setting, the value of is constrained by both; the constraints propagate and eventually contradict each other. Ramsey theory is the study of how far constraint propagation can be postponed, and the answer is always: not indefinitely, but usually much longer than you would guess.
- Confusing vertex colouring with edge colouring. The chromatic index is pinned to within one colour by Vizing's theorem; the chromatic number has no such bracket. They are different invariants, related only by .
- **Assuming . ** Always , but the gap is unbounded: the Mycielski graphs are triangle-free with arbitrarily large . Equality for every induced subgraph is the definition of a *perfect* graph, not a general fact.
- **Thinking every graph is -colourable, or that odd cycles are only "usually" the obstruction.** holds exactly when there is no odd cycle — this is an equivalence, not a heuristic.
- **Reading as "greedy finds the optimum".** Greedy respects the bound in every order but can use arbitrarily many more colours than on a bipartite graph if the order is bad.
- Applying the four colour theorem to non-planar graphs. is already a counterexample to the unrestricted statement, and needs colours.
- Believing the four colour theorem has a short proof. Kempe's 1879 argument is *wrong*; it survives only as the five colour theorem. Every known proof of four colours checks hundreds of configurations by machine.
- **Treating as a graph invariant that determines the graph.** All trees on vertices share one chromatic polynomial.
- Expecting small Ramsey numbers to be known. is not known, and no with beyond the short list in Proposition *Small Ramsey numbers* has an exact value.
- Confusing Ramsey with Turán-type extremal problems. An extremal problem maximises edges in an *uncoloured* graph before a subgraph is forced; Ramsey forces a *monochromatic* subgraph in any colouring, however the edges are distributed.
- Expecting a Ramsey proof to produce a witness. The recursion locates nothing, and the probabilistic lower bound names no colouring at all. These are existence statements.
- Thinking the infinite theorem gives finite bounds. It implies finiteness of by compactness, but the argument is ineffective and yields no numerical bound whatsoever.