Some graphs can be drawn on paper with no two edges crossing and some cannot, and the problem is to tell which is which, then to find how few colours are needed so that neighbouring regions of a map never share one.
The previous lesson proved that a tree, a connected graph with no cycles, on vertices has exactly edges, and that every connected graph contains a spanning tree, a tree using all of its vertices and some of its edges. Both facts are used below. Graphs here are simple (no loops, no repeated edges), is the complete graph on vertices, and joins each of vertices to each of others. So far a graph has been pure combinatorics, a list of what is joined to what. The question now is geometric, and the answer starts from a formula Euler sent to Christian Goldbach in 1750.
Drawings, faces and the outer face
A plane drawing of a graph puts each vertex at a point and each edge along a curve between its ends, so that curves meet only at shared ends. A graph is planar if it has a plane drawing, and a graph together with one is a plane graph. drawn as a square with both diagonals has a crossing, but moving one vertex inside the triangle of the other three removes it, so is planar although that first drawing is not a plane one.
A plane drawing cuts the rest of the plane into regions called faces. Exactly one is unbounded, the outer face, surrounding the whole drawing. The cycle has two faces, inside and outside. with one vertex in the middle has four: three small triangles and the outer face. A tree has only one, since no cycle encloses anything.
The degree of a face is the length of the walk around its boundary, and an edge with the same face on both sides, such as every edge of a tree, is walked twice and counts twice. Then every edge contributes exactly , one for each side, so the face degrees of a plane graph add up to . It is the handshake lemma again, counting edge and face incidences instead of edge and vertex ones.
Polyhedra supply plane graphs. Puncture one face of a convex polyhedron and stretch the surface flat through the hole: the vertices and edges become a plane graph, and the punctured face becomes the outer face. The cube becomes a small square inside a large one with corners joined: vertices, edges and faces.
Euler's formula
Theorem (Euler). A connected plane graph with vertices, edges and faces has .
The proof is by induction on the number of edges outside a spanning tree. Let be a spanning tree of the connected plane graph , drawn as it sits inside . It has edges and one face, so for the count is . Now put the other edges of back one at a time. Each new edge joins two vertices already connected by a path in the tree, so it closes a cycle, a closed curve separating the plane into an inside and an outside. The face the new edge runs through is cut in two and no other face changes. Each step adds one edge and one face, so stays , and when every edge is back the graph is .
That a closed curve without self-crossings splits the plane into exactly two regions is the Jordan curve theorem. It looks obvious and is hard to prove for arbitrary curves (Camille Jordan's 1887 proof was later judged incomplete), but for curves made of straight segments, which is all a drawing needs, it is elementary, and here it is taken on trust.
The cube has . The dodecahedron has pentagonal faces; each edge lies on of them, so , and each vertex on , so . Then . Connectedness matters: two separate triangles have , and in general a plane graph with components has .
Example. A connected plane graph has every vertex of degree , and every face is a pentagon or a hexagon. Show that it has exactly pentagons, however many hexagons it has.
Let there be pentagons and hexagons, so . Face degrees sum to , so , and vertex degrees sum to , so . Multiply Euler's formula by and substitute to get , that is , so . The hexagons cancel. The dodecahedron is the case , and a football, pentagons and hexagons, has and , with .
Now you. A connected plane graph has every vertex of degree , and every face is a square or a hexagon. How many squares does it have?
Answer
Exactly . With squares and hexagons, and , and the same steps give , so and . The cube is the case ; with it is the truncated octahedron, with , and .
Too many edges to be planar
Theorem. A simple planar graph with vertices has .
Take a plane drawing, and suppose first it is connected. A face of degree or would need a loop, a repeated edge, or a graph that is a single edge, all ruled out. So every face has degree at least , and counting edge and face incidences gives . Euler's formula with gives , which rearranges to . A disconnected planar graph can have edges added between components, staying planar, until it is connected, and the bound for the larger graph covers the smaller.
has and , while . So is not planar: five towns each joined directly to every other cannot have their roads laid flat without a crossing.
If a graph has no triangles, every face has degree at least , so and the same algebra gives . The graph has no triangles, since every edge crosses between the sides and so every cycle is even. It has and , so it is not planar. This is the three utilities puzzle: three houses each to be joined to gas, water and electricity with no two pipes crossing, which cannot be done. Notice that passes the first test, : the bounds are necessary conditions only.
Example. Show that for every simple graph on vertices, or its complement (same vertices, joined exactly where has no edge) is not planar.
Between them and its complement contain every pair once, so their edges number . If both were planar each would have at most edges, in all. Since , one of them has at least edges and is not planar.
Now you. The Petersen graph has as vertices the ten two element subsets of , two joined when they are disjoint. Every vertex has degree , and its shortest cycle has length . Show that it is not planar, although it satisfies both bounds above.
Answer
and , and indeed and . With no cycle shorter than , every face of a plane drawing would have degree at least , so and . But Euler's formula forces . So no plane drawing exists.
Subdividing an edge, replacing it by a path through new vertices of degree , changes no picture, so a graph containing a subdivided or is not planar. Kazimierz Kuratowski proved in 1930 that these are the only obstructions.
Theorem (Kuratowski). A graph is planar if and only if it contains no subdivision of or of .
The hard direction, that a graph avoiding both can always be drawn, is beyond this course. The Petersen graph contains a subdivided , as it must.
Colourings and the chromatic number
A proper colouring gives each vertex a colour so that adjacent vertices differ, and the chromatic number is the fewest colours that allow one. needs . An even cycle alternates two colours; an odd cycle cannot, since alternating around it brings the start back with the wrong colour, so for odd . Showing takes two halves: a colouring with colours, and a reason fail.
Maps become graphs through their dual: a vertex inside each country, two joined when they share a stretch of border, not just a point. Each dual edge crosses only the border it stands for, so the dual of a map is planar, and colouring countries so that neighbours differ is properly colouring the vertices of a planar graph.
The same idea schedules. Make each exam a vertex and join two when some student sits both. A proper colouring assigns time slots with no student in two rooms at once, and is the fewest slots possible.
Example. Six exams have clashes , , , , , and . How many slots are needed?
form a cycle of length , which is odd, so at least . Three suffice: and in slot , and in slot , in slot , and , whose clashes and are both in slot , in slot . Every clashing pair is split: is ; is ; is ; is ; is ; and are . So .
Now you. A seventh exam clashes with each of and . How many slots are needed now?
Answer
. The five exams of the odd cycle already use three slots between them, and clashes with all of them, so it needs a fourth; putting it there and keeping the rest works. The graph contains no , so a large chromatic number does not need a large complete subgraph.
No efficient method is known for the chromatic number in general. Computing it was among the problems Richard Karp showed NP-complete in 1972, the same class as the Hamilton cycle question, and even deciding whether colours suffice is that hard.
Two colours and odd cycles
Two colours, by contrast, are completely understood. A graph is bipartite if its vertices split into two sides with every edge crossing between them, which is the same thing as a proper colouring with two colours.
Theorem. A graph is two colourable if and only if it has no cycle of odd length.
If it is two colourable, colours alternate around any cycle, so returning to the start takes an even number of steps.
Conversely, suppose there is no odd cycle, and treat each connected component separately. Take a spanning tree, choose a root , and colour each vertex by the parity of its depth , its distance from along the tree. Tree edges join consecutive depths, so they are fine. Suppose another edge joined two vertices of the same colour, and let be the last vertex shared by the tree paths from to and to . The tree path from to through has length , which is even because and have the same parity. Adding closes a cycle of odd length, a contradiction.
The proof is also an algorithm: colour by depth, and either every edge checks out or a clashing edge exhibits an odd cycle. Two colours are decided quickly; three is the hard problem.
Six colours suffice
Lemma. Every simple planar graph has a vertex of degree at most .
With this is clear. Otherwise the degrees sum to , so the average degree is below , and some vertex is at or below the average.
Theorem. Every planar graph can be properly coloured with colours.
By induction on . A graph with at most vertices gets a different colour on each. For larger , delete a vertex of degree at most . What remains is planar, so by induction it has a colouring. The neighbours of use at most colours, so a sixth is free for .
Alfred Kempe published a proof in 1879 that four colours suffice, handling a of degree or by swapping colours along two coloured chains of vertices to free one up. It stood for eleven years until Percy Heawood found, in 1890, a case the swaps miss. Heawood salvaged what Kempe's chains do prove, the five colour theorem.
Four colours and a proof by computer
In 1852 Francis Guthrie, colouring a map of the counties of England, noticed that four colours were enough and asked whether that was always so. His brother Frederick passed the question to Augustus De Morgan, who wrote of it to William Rowan Hamilton that October. Four cannot be lowered, since is planar and needs four.
Theorem (four colour theorem). Every planar graph can be properly coloured with colours.
Kenneth Appel and Wolfgang Haken at the University of Illinois proved it in 1976. By hand they showed that a smallest counterexample would have to contain one of almost two thousand configurations. A computer then checked that none of them can occur in a smallest counterexample, which took about 1,200 hours of machine time, and no person has checked that part through. Neil Robertson, Daniel Sanders, Paul Seymour and Robin Thomas gave a simpler proof in 1997 with configurations, and in 2005 Georges Gonthier checked the whole argument in the Coq proof assistant, a program that verifies every logical step down to the axioms.
A proof is an argument that each step follows from the last, and nothing requires the checker to be human. The worry in 1976 was a bug nobody could see, and some mathematicians declined to call it a proof. Independent programs agreeing, then a formal proof whose trust rests on a small checking kernel rather than on the whole computation, have settled it for most. What the computer does not give is understanding: it confirms that four colours suffice without a short reason why, and none is known.
What has been built
The course began with questions of how many. The sum and product rules, bijections, binomial coefficients and inclusion and exclusion count without listing, and Probability rests on them, since a probability over equally likely outcomes is one count divided by another. Recurrences and generating functions describe a count through smaller ones, which is how Algorithms and Data Structures measures the running time of a program that calls itself. Divisibility, primes and congruences built RSA from Fermat's theorem, the starting point of Cryptography, and the same questions about primes pursued further are Number Theory. Graphs, trees and colourings proved what is true of networks, and Algorithms and Data Structures turns those proofs into methods for searching them and finding their shortest paths and spanning trees. Through all of it the method has been the same: find the right thing to count, set up an induction, and prove the answer right.