1 graph colouring and the chromatic polynomial · 2019-05-06 · 1 graph colouring and the...

8
MATH20902: Discrete Maths, Coursework for 2019 The coursework has two components: an online part available on Blackboard and a written part—Problems (2) and (3) in Section 4—that you should hand in, accompanied by a standard Cover Sheet, at the Reception Desk in the Alan Turing Building by 2:00 PM, Friday 5 April. Although you may discuss the problems with me and with each other, the work you submit must be your own. 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question: How many distinct k-colourings does a graph G(V,E) have? Of course, if k<χ(G), then G doesn’t have any k-colourings at all, but when k χ(G) there may be lots. The figure below illustrates six distinct 3-colourings of the complete graph K 3 and this exhausts the possibilities. 1 2 3 V 1 V 3 V 2 1 2 3 V 1 V 3 V 2 1 2 3 V 1 V 3 V 2 1 2 3 V 1 V 3 V 2 1 2 3 V 1 V 3 V 2 1 2 3 V 1 V 3 V 2 Figure 1: All 3-colourings of K 3 , the complete graph on three vertices. The map φ : {v 1 ,v 2 ,v 3 } 7→ {1, 2, 3} is indicated both with colours and by writing the value of φ(v j ) on the vertex v j . More generally the answer depends on both the graph G and the number of colours k. It turns out to be a polynomial in k, the so-called chromatic polynomial, P (G, k). If G has n vertices then P (G, k)= k n + α n-1 k n-1 + ··· + α 1 k, (1) with α j Z. Further, this polynomial is zero for all integers k with 0 k<χ(G), but nonzero for k χ(G), so it provides a way to compute the chromatic number. 2 Computing the chromatic polynomial There are a handful of cases where the chromatic polynomial is easy to compute: Lemma 1 (Complete graphs). The complete graph on n vertices, K n , has chromatic polynomial P (K n ,k)= n-1 Y j =0 (k - j ).

Upload: others

Post on 27-Apr-2020

7 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

MATH20902: Discrete Maths, Coursework for 2019

The coursework has two components: an online part available on Blackboard and a writtenpart—Problems (2) and (3) in Section 4—that you should hand in, accompanied by astandard Cover Sheet, at the Reception Desk in the Alan Turing Building by 2:00 PM,Friday 5 April.

Although you may discuss the problems with me and with each other, the work yousubmit must be your own.

1 Graph colouring and the chromatic polynomial

The coursework concerns graph-colouring and focuses on the question: How many distinctk-colourings does a graph G(V,E) have? Of course, if k < χ(G), then G doesn’t have anyk-colourings at all, but when k ≥ χ(G) there may be lots. The figure below illustrates sixdistinct 3-colourings of the complete graph K3 and this exhausts the possibilities.

1

2 3

V1

V3V2

1

2

3

V1

V3V2

12

3V1

V3V2

1

23

V1

V3V2

1

2

3

V1

V3V2

1 2

3V1

V3V2

Figure 1: All 3-colourings of K3, the complete graph on three vertices. The map φ :{v1, v2, v3} 7→ {1, 2, 3} is indicated both with colours and by writing the value of φ(vj) onthe vertex vj.

More generally the answer depends on both the graph G and the number of coloursk. It turns out to be a polynomial in k, the so-called chromatic polynomial, P (G, k). If Ghas n vertices then

P (G, k) = kn + αn−1kn−1 + · · ·+ α1k, (1)

with αj ∈ Z. Further, this polynomial is zero for all integers k with 0 ≤ k < χ(G), butnonzero for k ≥ χ(G), so it provides a way to compute the chromatic number.

2 Computing the chromatic polynomial

There are a handful of cases where the chromatic polynomial is easy to compute:

Lemma 1 (Complete graphs). The complete graph on n vertices, Kn, has chromaticpolynomial

P (Kn, k) =n−1∏j=0

(k − j).

Page 2: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

Lemma 2 (Trees). If G(V,E) is a tree with |V | = n vertices , then

P (G, k) = k(k − 1)n−1.

Lemma 3 (Cycle graphs). Cn, the cycle graph on n ≥ 3 vertices, has chromatic polyno-mial:

P (Cn, k) = (k − 1)n + (−1)n(k − 1).

Lemma 4 (Connected components). If G(V,E) is a graph with r connected components,then

P (G, k) =r∏

j=1

P (Gj , k),

where Gj(Vj , Ej) is the j-th connected component.

I’ll prove the first of these, but the proofs of Lemmas 2 and 4 form the written com-ponent of the coursework, while the proof of Lemma 3 is similar to that of Lemma 2 andso is left to the reader.

Proof of Lemma 1. As every vertex in Kn is adjacent to every other, no two can be as-signed the same colour. This means that χ(Kn) = n and so P (Kn, k) = 0 if k < n.If k ≥ n, we can specify a k-colouring for Kn by numbering the vertices, then choosingcolours for v1, v2, . . . vn, in order. We can use any of the k colours for v1, then one of theremaining (k − 1) colours for v2 . . . and so on, with (k − j + 1) choices for the colour ofvj . This gives us a total of

k × (k − 1)× · · · × (k − n+ 1) =

n−1∏j=0

(k − j)

distinct colourings, which is the formula from the lemma.

2.1 The Deletion/Contraction formula

If our graph G isn’t one of those covered by the results in the previous section, we need towork harder to compute its chromatic polynomial. The key tool is an equation that relatesP (G, k) to the chromatic polynomials of a pair of graphs produced by the graph-surgicalprocedures described below.

Definition (Deletion). Given a graph G(V,E) and an edge e ∈ E, the operation of dele-tion forms a new graph G′(V,E′), whose vertex set is the same as G’s, but whose edge setis E′ = E\{e}. We will write G\e to indicate the graph formed by deleting e from G.

Definition (Contraction). Given a graph G(V,E) and an edge e = (u, v) ∈ E, the opera-tion of contraction forms a new graph by:

• deleting the vertices u and v and all their edges;

• introducing a new vertex, w, that is adjacent to all the vertices that are adjacent to uor v in G. The adjacency lists of u, v and w are related by Aw = (Au ∪Av) \{u, v}.

We will write G/e to indicate the graph formed by contracting an edge e.

Examples of both these operations are illustrated in Figure 2. Once we have these twoideas, we can state our main result:

Page 3: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

G

eu v

G \ e

u v

G / e

ContractionDeletion

w

Figure 2: The operations of contraction and deletion. Note that the graphs G\e and G/eare smaller and simpler than G in that they have fewer edges or vertices.

Theorem 5 (The Deletion/Contraction formula). If G(V,E) is a graph and e ∈ E is oneof its edges, then

P (G, k) = P (G\e, k)− P (G/e, k). (2)

Proof: Say that e = (u, v) and introduce the notation C for the set of all k-colourings ofG\e. Notice that G\e and G have the same vertex set, V , but that G/e has a differentone that we’ll denote V ′. It’s given by V ′ = (V \{u, v}) ∪ {w}.

We can divide C into two disjoint subsets by thinking about the way in which theendpoints of the edge e get coloured. If φ ∈ C is a k-colouring of G\e there are twopossibilities:

• φ assigns u and v the same colour, φ(u) = φ(v), or

• φ assigns them different colours, φ(u) 6= φ(v).

If we define S (for “same”) and D (for “different”) by

S = {φ ∈ C |φ(u) = φ(v)} and D = {φ ∈ C |φ(u) 6= φ(v)}

then clearly C = S ∪ D and S ∩ D = ∅, so

|C| = |S|+ |D|. (3)

It follows automatically from the definition of the chromatic polynomial that P (G\e, k) =|C|, but it’s also true that P (G, k) = |D|. There’s a natural bijection between k-colouringsof G (which must assign different colours to u and v as they are adjacent in G) and thesubset D of k-colourings of G\e that happen to assign different colours to u and v. Thecorrespondence is illustrated on the left side of Figure 3.

Finally, there’s also a bijection between colourings of G/e and the elements of S. Tosee why, suppose that we are given a k-colouring φ ∈ S. We can use it to construct ak-colouring φ′ : V ′ 7→ {1, . . . , k} of G/e as follows:

φ′(a) =

{φ(a) if a 6= w

φ(u) = φ(v) if a = w

The relation between φ ∈ S and φ′, the corresponding k-colouring of G/e, is illustratedon the right side of Figure 3 and leads to the conclusion that P (G/e, k) = |S|.

By substituting all these results about cardinality into Eqn. (3), we obtain

P (G\e, k) = P (G/e, k) + P (G, k)

which, after a little rearrangement, yields the result we sought.

Page 4: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

u

G \ (u,v) G \ (u,v)

u ub b b b

c c c cv v v

G G / (u,v)w

Figure 3: Illustrations of the bijections that allow us to conclude that |D| = P (G, k)and |S| = P (G/e, k) in the proof of Theorem 5. At left are two graphs: G and G\e,which is formed by deletion of the edge e = (u, v). A three-colouring φ1 ∈ D of G\e thatassigns different colours to the vertices u and v is, in a natural way, also a three-colouringof G. In the right half of the figure are G\e and G/e. The former is coloured with athree-colouring φ2 ∈ S that assigns the same colour to both u and v and it is bijectivelyassociated with a three-colouring φ′2 of G/e in which the new vertex w gets assigned thecolour, φ2(u) = φ2(v), that is shared by u and v in G\e.

2.2 Examples

In this section I’ll give two examples of how to use the Deletion/Contraction formula andLemmas 1–4 to compute the chromatic polynomial of a graph. I’ll also introduce someconventions about the drawing and labelling of graphs that will be used throughout therest of the assignment.

2.2.1 Removing an edge

If the graph in question is sparse—if it has many fewer edges than it could—one can oftenmake progress by deleting edges. Figure 4 shows the results of deleting and contractingthe edge (c, d) in the graph G and so the Deletion/Contraction formula says P (G, k) =P (G\(c, d), k)− P (G/(c, d), k) or, using the numbering scheme shown in the figure,

P (G, k) = P (G1, k)− P (G2, k). (4)

a a a

G G1= G \ (c,d) G

2= G / (c,d)

a a a

b b b

c c cdd d

Figure 4: Using the Deletion/Contraction formula and Lemmas 1–4 to compute thechromatic polynomial of a small graph. The edge that we’ll delete, e = (c, d), is shown inorange, while the new vertex formed when contracting (c, d) has a label, cd, that combinesthose of e’s endpoints. These conventions will be used throughout the assignment.

G1 has two connected components, one that includes the vertices {a, b, c} and anotherthat consists of the isolated vertex d. We’ll call the component with three vertices G3 andthe other component G4 and note that they are isomporphic to, respectively, K3 and K1.

Page 5: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

The lemma about connected components, Lemma 4, then says

P (G1, k) = P (G3, k)× P (G4, k) = k(k − 1)(k − 2)× k = k4 − 3k3 + 2k2, (5)

where the second equality follows from two applications of the lemma about completegraphs, Lemma 1.

Similarly we can see that G2 = G/(c, d) is isomorphic to K3 and so

P (G2, k) = k(k − 1)(k − 2) = k3 − 3k2 + 2k. (6)

Finally, we combine Eqns. (4)–(6) to obtain

P (G, k) = P (G1, k)− P (G2, k)

= (P (G3, k)× P (G4, k))− P (G2, k)

= (k(k − 1)(k − 2)× k)− k(k − 1)(k − 2)

= (k4 − 3k3 + 2k2)− (k3 − 3k2 + 2k)

= k4 − 4k3 + 5k2 − 2k.

2.2.2 Adding an edge

If the graph of interest is dense—if it has almost as many edges as a complete graph—thenit may prove more effective to think of the Deletion/Contraction formula as a statementabout adding an edge. Figure 5 shows a graph H that is not isomorphic to K4 because itlacks a single edge, (c, d). But if we apply the Deletion/Contraction formula to a graph,H1, that includes (c, d) we get

P (H1, k) = P (H1\(c, d), k)− P (H1/(c, d), k).

Then, noting that H = H1\(c, d) and defining H2 = H1/(c, d), we can rearrange the lineabove to get:

P (H, k) = P (H1\(c, d), k) = P (H1, k) + P (H1/(c, d), k) = P (H1, k) + P (H2, k).

Now, as both H1 and H2 are isomorphic to complete graphs, we can again employ Lemma 1to say

P (H, k) = P (H1, k) + P (H2, k)

= k(k − 1)(k − 2)(k − 3) + k(k − 1)(k − 2)

= k(k − 1)(k − 2)(k − 3 + 1)

= k(k − 1)(k − 2)2

= k4 − 5k3 + 8k2 − 4k.

Page 6: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

d d cdc c

b b b

a a aH = H

1\ (c,d) H

1H

2= H

1/ (c,d)

a a a

Figure 5: Applying the Deletion/Contraction formula in a setting where we’d like to addthe edge e = (c, d). Note that forming H2 = H1/(c, d) does not produce parallel edgesbetween the vertices cd and a, even though a is adjacent to both c and d in H1.

3 Computational complexity

Early in the term, when we first discussed graph-colouring, I said that there is no known,fast algorithm to find the chromatic number of a graph. The reader may now wonderwhat I meant: the examples in the previous section aren’t all that difficult, and yet theyproduce P (G, k). And once we have that, we can easily find the chromatic number byevaluating P (G, k) for k ∈ {1, 2, 3, . . . }. The resolution of this paradox becomes clearwhen one thinks more carefully about automating the use of the Deletion/Contractionformula.

Prescriptions such as “Choose an edge whose deletion produces a graph more like thosecovered by Lemmas 1–4” are notoriously hard to formalise, implement and analyse. Toget an upper bound on the amount of work needed to compute P (G, k) we could insteadimagine numbering the edges arbitrarily and then deleting-and-contracting them in order.If we start with a graph that has m edges, the first application of the Deletion/Contractionformula will give rise to two graphs, each of which could have as many as m − 1 edges.Applying the formula again to each of these will produce a maximum of four graphs, eachwith a maximum of m− 2 edges . . . and so on. Repeated application of the formula couldthus eventually lead to 2m graphs, each of which consists of a collection of isolated vertices.Reasoning such as this leads to two conclusions:

• It is always possible to compute P (G, k) using finitely-many applications of theDeletion/Contraction formula.

• For a graph with |E| = m, we may need to apply the formula O(2m) times.

That is, the algorithm sketched here provides a way to compute χ(G), but it may requirean amount of work that is exponential in the number of edges. A fast algorithm is generallyconsdiered to be one that needs only a polynomial amount of work and so our computationof χ(G) via P (G, k) can’t be regarded as fast.

Page 7: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

4 Problems

(1). Go on Blackboard and answer the following questions about a graph, G(V,E), thatyou will be given. It will be chosen randomly from a large pool of examples with |V | = 8and |E| = 9.

(a) [8 marks] Compute P (G, k).

(b) [2 marks] Find χ(G) and evaluate P (G, k) when k = χ(G).

(2). [5 marks] Prove Lemma 2, which is about the chromatic polynomials of trees.

(3). [5 marks] Prove Lemma 4, which is about the chromatic polynomials of graphs withr connected components.

PracticalitiesThis coursework is worth 20% of the total mark for the module. You should not expectto spend more than 10 hours preparing and completing the problems. The assignmentaddresses Intended Learning Outcome (ILO) 2: Explain what the chromatic number of agraph is, determine it for small graphs and apply the idea to scheduling problems.

Warning Against PlagiarismPlagiarism is the presentation of other people’s work as your own. It is both dishonest andunfair to other students. The University takes plagiarism very seriously: if your courseworksubmission contains material copied without proper attribution from textbooks, Wikipediaor other web sites or any other source except the lecture notes, problem sets and solutionsfrom this module, you may be referred to the School’s Academic Malpractice Panel. Stan-dard penalties include, at a minimum, a mark of zero for the entire coursework. If you areunsure whether or how to acknowledge a source, please consult the University’s Guidanceon Plagiarism and Academic Malpractice or check with me well before the due date.

Page 8: 1 Graph colouring and the chromatic polynomial · 2019-05-06 · 1 Graph colouring and the chromatic polynomial The coursework concerns graph-colouring and focuses on the question:

5 Further reading

This coursework is meant to be self-contained, but if you find yourself interested in thechromatic polynomial you might want to look at some of the following books and articles.G.D. Birkhoff invented the chromatic polynomial as part of an attempt to prove the Four-Colour Theorem: he tried to show that if G is a planar graph, then P (G, k) > 0 fork ≥ 4. He didn’t succeed, but did manage to establish the weaker five-colour theorem.You can read about his efforts in the original papers, (Birkhoff, 1912) and (Birkhoff &Lewis, 1946) or in a readable (and inexpensive) account of the proof of the Four-ColourTheorem by Saaty and Kainen (1986). The chromatic polynomial is not usually covered inundergraduate textbooks, though (Gibbons, 1985) is an exception. More advanced booksthat treat the subject include (Biggs, 1993) and (Bollobas, 1998). These latter two alsodiscuss the Tutte1 polynomial, a two-variable generalisation of the chromatic polynomialthat obeys an analog of the Deletion/Contraction formula which holds even in multigraphs.Finally, toward the end of his life Tutte wrote a reminiscence, (Tutte, 2004), about howhe came to construct his polynomial.

References

Biggs, N. (1993). Algebraic Graph Theory (2nd ed.). Cambridge University Press. doi:10.1017/CBO9780511608704

Birkhoff, G. D. (1912). A determinant formula for the number of ways of coloring a map.Annals of Mathematics, 14 (1/4), 42–46. doi: 10.2307/1967597

Birkhoff, G. D., & Lewis, D. C., Jr. (1946). Chromatic polynomials. Transactions of theAMS , 60 , 355–451. doi: 10.1090/S0002-9947-1946-0018401-4

Bollobas, B. (1998). Modern Graph Theory. New York: Springer Science+Media.Gibbons, A. (1985). Algorithmic Graph Theory. Cambridge University Press.Saaty, T. L., & Kainen, P. C. (1986). The Four-Color Problem: Assaults and Conquest.

Dover.Tutte, W. (2004). Graph-polynomials. Advances in Applied Mathematics, 32 (1), 5–9. doi:

10.1016/S0196-8858(03)00041-1

1 Invented by the same Bill Tutte who proved the directed Matrix-Tree Theorem.