Introduction to Graph Theory Fourth edition
Introduction to Graph Theory Fourth edition Robin J. Wilson
LONGMAN
Ad...
680 downloads
4033 Views
14MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Introduction to Graph Theory Fourth edition
Introduction to Graph Theory Fourth edition Robin J. Wilson
LONGMAN
Addison Wesley Longman Limited Edinburgh Gate, Harlow, Essex CM20 2JE, England and Associated Companies throughout the world. © R o b i n Wilson 1972, 1996 A l l rights reserved; no part of this publication may be reproduced, stored in any retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise without either the prior written permission of the Publishers or a licence permitting restricted copying in the United Kingdom issued by the Copyright Licensing Agency Ltd., 90 Tottenham Court Road, London W1P 9HE. First published by Oliver & Boyd, 1972 Second edition published by Longman Group Ltd, 1979 Third edition, 1985 Fourth edition, 1996 Reprinted 1998
British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library ISBN 0-582 24993-7
Library of Congress Cataloging-in-Publication Data A catalog record for this book is available from the Library of Congress
Set by 8 in 10 on 12pt Times Produced through Longman Malaysia. PP
Contents
Preface to the fourth edition 1
2
Introduction 1 What is a graph? Definitions and examples 2 Definition 3 4
3
Paths 5 6 7 8
4
5
6
Examples Three puzzles and cycles Connectivity Eulerian graphs Hamiltonian graphs Some algorithms
vii
1
8 17 21
26 31 35 38
Trees 9 Properties o f trees 10 Counting trees 11 M o r e applications
43 47 51
Planarity 12 Planar graphs 13 Euler's formula 14 Graphs on other surfaces 15 Dual graphs 16 Infinite graphs
60 70 73 77
Colouring graphs 17 18 19 20 21
Colouring vertices Brooks' theorem Colouring maps Colouring edges Chromatic polynomials
81 86 88 92 96
vi
Contents
7
Digraphs 22 Definitions 23 Eulerian digraphs and tournaments 24 Markov chains
100 105 109
Matching, marriage and Menger's theorem 25 H a l l ' s ' m a r r i a g e ' t h e o r e m 26 Transversal theory
112 115
8
27 28 29 9
Applications o f Hall's theorem Menger's theorem Network flows
Matroids 30 Introduction to matroids 31 Examples o f matroids 32 Matroids and graphs 33
Matroids and transversals
118 122 126
132 135 139 143
Appendix
147
Bibliography
148
Solutions to selected exercises
150
Index of symbols
167
Index of definitions
168
Go forth, my little book! pursue thy way! Go forth, and please the gentle and the good. W i l l i a m Wordsworth
Preface to the fourth edition
I n recent years, graph theory has established itself as an important mathematical tool i n a wide variety o f subjects, ranging from operational research and chemistry to genetics and linguistics, and from electrical engineering and geography to sociology and archi tecture. A t the same time i t has also emerged as a worthwhile mathematical discipline in its o w n right. I n view o f this, there is a need for an inexpensive introductory text on the subject, suitable both for mathematicians taking courses i n graph theory and also for nonspecialists wishing to learn the subject as quickly as possible. I t is my hope that this book goes some way towards filling this need. The only prerequisites to reading i t are a basic knowledge o f elementary set theory and matrix theory, although a further knowledge o f abstract algebra is needed for more difficult exercises. The contents o f this book may be conveniently divided into four parts. The first o f these (Chapters 1-4) provides a basic foundation course, containing definitions and examples o f graphs, connectedness, Eulerian and Hamiltonian paths and cycles, and trees. This is followed by two chapters (Chapters 5 and 6) on planarity and colouring, w i t h special reference to the four-colour theorem. The third part (Chapters 7 and 8) deals w i t h the theory o f directed graphs and w i t h transversal theory, w i t h applications to critical path analysis, Markov chains and network flows. The book ends w i t h a chap ter on matroids (Chapter 9), which ties together material from the previous chapters and introduces some recent developments. Throughout the book I have attempted to restrict the text to basic material, using exercises as a means for i n t r o d u c i n g less important material. O f the 250 exercises, some are routine examples designed to test understanding o f the text, w h i l e others w i l l i n t r o d u c e y o u to n e w results and ideas. Y o u s h o u l d read each exercise, whether or not y o u w o r k through i t i n detail. D i f f i c u l t exercises are indicated by an asterisk. I have used the symbol // to indicate the end o f a proof, and bold-face type is used for definitions. The number o f elements i n a set S is denoted by LSI, and the empty set is denoted by 0 . A substantial number o f changes have been made i n this edition. The text has been revised throughout, and some terminology has been changed to f i t i n w i t h current usage. I n addition, solutions are given for some o f the exercises; these exercises are indicated by the s y m b o l next to the exercise number. Several changes have arisen as s
viii
Preface to the fourth edition
a result o f comments by a number o f people, and I should like to take this opportunity of thanking them for their helpful remarks. Finally, I wish to express m y thanks to m y former students, but for w h o m this book w o u l d have been completed a year earlier, to M r W i l l i a m Shakespeare and others for their apt and witty comments at the beginning o f each chapter, and most o f all to m y wife Joy for many things that have nothing to do w i t h graph theory. RJ.W. May 1995
The Open University
Chapter
1
Introduction
The last thing one discovers in writing a book is what to put first. Blaise Pascal
I n this introductory chapter we provide an intuitive background to the material that we present more formally i n later chapters. Terms that appear here i n bold-face type are to be thought o f as descriptions rather than as definitions. Having met them here i n an informal setting, you should find them more familiar when you meet them later. So read this chapter quickly, and then forget all about i t !
1
What
is a
graph?
W e begin by considering Figs. 1.1 and 1.2, which depict part o f a road map and part o f an electrical network.
P
Fig. 1.1
Fig. 1.2
Q
2
Introduction
Either o f these situations can be represented diagrammatically by means o f points and lines, as i n F i g . 1.3. The points F , Q, F , S and T are called vertices, the lines are called edges, and the whole diagram is called a graph. Note that the intersection o f the lines PS and QT is not a vertex, since i t does not correspond to a cross-roads or to the meeting o f two wires. The degree o f a vertex is the number o f edges w i t h that ver tex as an end-point; it corresponds i n Fig. 1.1 to the number of roads at an intersection. For example, the degree o f the vertex Q is 4. P
Q
R
T
S
Fig. 1.3 The graph i n Fig. 1.3 can also represent other situations. For example, i f F , 2 , F , S and T represent football teams, then the existence o f an edge might correspond to the playing o f a game between the teams at its end-points. Thus, i n Fig. 1.3, team F has played against teams Q, S and T, but not against team F . I n this representation, the degree o f a vertex is the number o f games played by the corresponding team. Another way o f depicting these situations is by the graph i n F i g . 1.4. Here we have removed the 'crossing' o f the lines PS and QT by drawing the line PS outside the rect angle PQST. The resulting graph still tells us whether there is a direct road from one intersection to another, how the electrical network is w i r e d up, and w h i c h football teams have played which. The only information we have lost concerns 'metrical' prop erties, such as the length o f a road and the straightness o f a wire. Thus, a graph is a representation o f a set o f points and o f how they are joined up, and any metrical properties are irrelevant. F r o m this point o f view, any graphs that represent the same situation, such as those o f Figs. 1.3 and 1.4, are regarded as the same graph. P
Q
Fig. 1.4 More generally, two graphs are the same i f two vertices are joined by an edge i n one graph i f and only i f the corresponding vertices are j o i n e d by an edge i n the other. Another graph that is the same as the graphs i n Figs. 1.3 and 1.4 is shown i n Fig. 1.5. Here all idea o f space and distance has gone, although we can still tell at a glance which points are joined by a road or a wire.
What is a graph?
3
Q
S
Fig. 1.5 I n the above graph there is at most one edge j o i n i n g each pair o f vertices. Suppose now, that i n F i g . 1.5 the roads j o i n i n g Q and 5, and S and T, have too much traffic to carry. Then the situation is eased by building extra roads j o i n i n g these points, and the resulting diagram looks like Fig. 1.6. The edges j o i n i n g Q and S, or S and 7, are called multiple edges. If, i n addition, we need a car park at F , then we indicate this by draw ing an edge from P to itself, called a loop (see F i g . 1.7). I n this book, a graph may contain loops and multiple edges. Graphs w i t h no loops or multiple edges, such as the graph i n F i g . 1.5, are called simple graphs. G
S
Fig. 1.6 Q
S
Fig. 1.7
The study o f directed graphs (or digraphs, as we abbreviate them) arises from making the roads into one-way streets. A n example of a digraph is given i n Fig. 1.8, the directions o f the one-way streets being indicated by arrows. ( I n this example, there w o u l d be chaos at T, but that does not stop us from studying such situations!) W e dis cuss digraphs i n Chapter 7. M u c h of graph theory involves 'walks' o f various kinds. A walk is a 'way o f getting from one vertex to another', and consists o f a sequence o f edges, one following after another. For example, i n Fig 1.5 P —» Q —» R is a walk o f length 2, and P —> S —> Q —> T —> S —> R is a walk o f length 5. A walk i n which no vertex appears more than once is
4
Introduction Q
S
Fig. 1.8 called a path; for example, p T S —> F is a path. A walk o f the form Q —» S —» T —> Q is called a cycle. M u c h o f Chapter 3 is devoted to walks w i t h some special property. I n particular, we discuss graphs containing walks that include every edge or every vertex exactly once, ending at the initial vertex; such graphs are called E u l e r i a n and Hamiltonian graphs, respectively. For example, the graph i n Figs 1.3-1.5 is Hamiltonian; a suitable walk is F — > Q - $ R - ^ S - $ T - ^ P . I t is not Eulerian, since any walk that includes each edge exactly once (such asP-^Q-^R-^S-^T-^P-^S-^Q-^T) must end at a ver tex different from the initial one. Some graphs are i n two or more parts. For example, consider the graph whose ver tices are the stations o f the L o n d o n Underground and the N e w Y o r k Subway, and whose edges are the lines joining them. I t is impossible to travel from Trafalgar Square to Grand Central Station using only edges o f this graph, but i f we confine our attention to the London Underground only, then we can travel from any station to any other. A graph that is i n one piece, so that any t w o vertices are connected by a path, is a con nected graph; a graph i n more than one piece is a disconnected graph (see Fig. 1.9). W e discuss connectedness i n Chapter 3.
Fig. 1.9
Fig. 1.10
What is a graph?
5
W e are sometimes interested i n connected graphs w i t h only one path between each pair of vertices. Such graphs are called trees, generalizing the idea o f a family tree, and are considered i n Chapter 4. As we shall see, a tree can be defined as a connected graph containing no cycles (see Fig. 1.10). Earlier we noted that F i g . 1.3 can be redrawn as i n Figs 1.4 and 1.5 so as to avoid crossings o f edges. A graph that can be redrawn without crossings i n this way is called a planar graph. I n Chapter 5 we give several criteria for planarity. Some o f these involve the properties of 'subgraphs' o f the graph i n question; others involve the funda mental notion o f duality. Planar graphs also play an important role i n colouring problems. I n our 'road-map' graph, let us suppose that Shell, Esso, BP, and G u l f wish to erect five garages between them, and that for economic reasons no company wishes to erect two garages at neigh bouring corners. Then Shell can build at P, Esso can build at g , BP can build at S, and G u l f can build at 7, leaving either Shell or G u l f to build at R (see Fig. 1.11). However, i f G u l f backs out o f the agreement, then the other three companies cannot erect the garages i n the specified manner.
Fig. 1.11
Fig. 1.12 W e discuss such problems i n Chapter 6, where we try to colour the vertices o f a simple graph w i t h a given number o f colours so that each edge of the graph joins ver tices o f different colours. I f the graph is planar, then we can always colour its vertices i n this way w i t h o n l y four colours - this is the celebrated f o u r - c o l o u r t h e o r e m . Another version o f this theorem is that we can always colour the countries of any map w i t h four colours so that no t w o neighbouring countries share the same colour (see Fig. 1.12). I n Chapter 8 we investigate the celebrated m a r r i a g e p r o b l e m , which asks under what conditions a collection of girls, each o f whom knows several boys, can be married
6
Introduction
so that each g i r l marries a boy she k n o w s . This p r o b l e m can be expressed i n the language o f 'transversal theory', and is related to problems o f finding disjoint paths connecting two given vertices i n a graph or digraph. Chapter 8 concludes w i t h a discussion o f network flows and transportation prob lems. Suppose that we have a transportation network such as i n Fig. 1.13, i n which P is a factory, R is a market, and the edges o f the graph are channels through which goods can be sent. Each channel has a capacity, indicated by a number next to the edge, rep resenting the m a x i m u m amount that can pass through that channel. The problem is to determine how much can be sent from the factory to the market. Q
S
Fig. 1.13
W e conclude with a chapter on matroids. This ties together the material o f the pre vious chapters, while satisfying the m a x i m 'be wise - generalize!' Matroid theory, the study o f sets w i t h 'independence structures' defined on them, generalizes both linear independence i n vector spaces and some results on graphs and transversals from earlier in the book. However, matroid theory is far from being 'generalization for generaliza tion's sake'. On the contrary, i t gives us deeper insight into several graph problems, as well as providing simple proofs o f results on transversals that are awkward to prove by more traditional methods. Matroids have played an important role in the development of combinatorial ideas i n recent years. W e hope that this introductory chapter has been useful i n setting the scene and describing some o f the treats that lie ahead. We now embark upon a formal treatment of the subject. Exercises 1 1.1
s
Write down the number of vertices, the number of edges, and the degree of each vertex, in: (i) the graph in Fig. 1.3; (ii) the tree in Fig. 1.14. P A
B
C
YA D
B
Fig. 1.14
F Fig. 1.15
Q
R
What is a graph? 1.2
1
Draw the graph representing the road system in Fig. 1.15, and write down the number of vertices, the number of edges and the degree of each vertex. s
1.3
Figure 1.16 represents the chemical molecules of methane (CH ) and propane ( C H ) . (i) Regarding these diagrams as graphs, what can you say about the vertices repre senting carbon atoms (C) and hydrogen atoms (H)? (ii) There are two different chemical molecules with formula C H . Draw the graphs corresponding to these molecules. 4
3
4
H
H
H H H I I I H—C—C—C—H I I I H H H
methane
propane
i— C— \
8
l()
Fig. 1.16 John
i
r~
J
Joe
Jean
Jenny
Kenny
1
1
Jane
Jill Bill
Ben
Fig. 1.17 1.4
Draw a graph corresponding to the family tree in Fig. 1.17.
1.5*
Draw a graph with vertices A,. . . , M that shows the various routes one can take when tracing the Hampton Court maze in Fig. 1.18.
/ / /
E
G
K
Fig. 1.18 s
1.6
John likes Joan, Jean and Jane; Joe likes Jane and Joan; Jean and Joan like each other. Draw a digraph illustrating these relationships between John, Joan, Jean, Jane and Joe.
1.7
Snakes eat frogs and birds eat spiders; birds and spiders both eat insects; frogs eat snails, spiders and insects. Draw a digraph representing this predatory behaviour.
Chapter
2
Definitions and examples
/ hate definitions! Benjamin Disraeli
I n this chapter, we lay the foundations for a proper study of graph theory. Section 2 for malizes some of the basic definitions o f Chapter 1 and Section 3 provides a variety o f examples. I n Section 4 we show how graphs can be used to represent and solve three problems from recreational mathematics. M o r e substantial applications are deferred until we have more machinery at our disposal (see Sections 8 and 11).
2
Definitions
A simple graph G consists o f a non-empty finite set V(G) o f elements called vertices (or nodes), and a finite set E(G) o f distinct unordered pairs o f distinct elements o f V(G) called edges. W e call V(G) the vertex set and E(G) the edge set o f G. A n edge {v, w} is said to join the vertices v and vv, and is usually abbreviated to vvv. For example, Fig. 2.1 represents the simple graph G whose vertex set V(G) is {w, v, w, z } , and whose edge set E(G) consists o f the edges uv, uw vw and wz. 9
u
Fig. 2.1
V
z
w
I n any simple graph there is at most one edge j o i n i n g a given pair o f vertices. However, many results that hold for simple graphs can be extended to more general objects i n which t w o vertices may have several edges j o i n i n g them. I n addition, we may remove the restriction that an edge joins two distinct vertices, and allow loops edges joining a vertex to itself. The resulting object, i n which loops and multiple edges are allowed, is called a general g r a p h - or, simply, a g r a p h (see Fig. 2.2). Thus every simple graph is a graph, but not every graph is a simple graph.
Definitions
9
Fig. 2.2 Thus, a graph G consists o f a non-empty finite set V(G) o f elements called ver tices, and a finite family E(G) o f unordered pairs o f (not necessarily distinct) elements of V(G) called edges; the use o f the word ' f a m i l y ' permits the existence o f multiple edges ". We call V(G) the vertex set and E(G) the edge family o f G. A n edge {v, w} is said to join the vertices v and w, and is again abbreviated to vw. Thus i n Fig. 2.2, V(G) is the set {u, v, w, z} and E(G) consists o f the edges u\\ vv (twice), vw (three times), uw (twice), and wz. Note that each loop vv joins the vertex v to itself. Although we some times have to restrict our attention to simple graphs, we shall prove our results for general graphs whenever possible. 1
The language o f graph theory is not standard - all authors have their o w n terminol ogy. Some use the term 'graph' for what we call a simple graph, or for a graph w i t h directed edges, or for a graph w i t h infinitely many vertices or edges; we discuss digraphs in Chapter 7 and infinite graphs i n Section 16. A n y such definition is per fectly valid, provided that it is used consistently. In this book, all graphs are finite and
undirected, with loops and multiple edges allowed unless specifically excluded.
Isomorphism T w o graphs G and G are isomorphic i f there is a one-one correspondence between the vertices of G , and those of G such that the number of edges j o i n i n g any t w o vertices o f G is equal to the number o f edges j o i n i n g the corresponding vertices o f G . Thus the t w o graphs shown i n F i g . 2.3 are isomorphic under the correspondence u /, v m, w n, x p, y q, z r. For many problems, the labels on the vertices are unnecessary and we drop them. W e then say that two ' unlabel led graphs' are isomorphic i f we can assign labels so that the resulting 'labelled graphs' are {
2
2
{
2
/
p
Fig. 2.3
+
We use the word 'family' to mean a collection of elements, some of which may occur several times; for example, {a, b, c} is a set, but (a, a, c, b, a, c) is a family.
10
Definitions and examples
Fig, 2.4 isomorphic. For example, the unlabel led graphs i n F i g . 2.4 are isomorphic, since we can label the vertices as i n F i g . 2.3. The difference between labelled and unlabel led graphs becomes more apparent when we try to count them. For example, i f we restrict ourselves to graphs w i t h three vertices, then there are, up to isomorphism, eight different labelled graphs but only four unlabel led ones (see Figs 2.5 and 2.6). It is usually clear from the context whether we are referring to labelled or unlabelled graphs.
A A A A A A AA A A m
3
Fig. 2.5
3
2
2
3
2
m
3
2
Fig. 2.6 Connectedness We can combine two graphs to make a larger graph. I f the two graphs are G = ( V ( G ) , £ ( G , ) ) and G = ( V ( G ) , E(G )), where V(G ) and V(G ) are disjoint, then their union G, u G is the graph with vertex set V(G ) u V(G ) and edge family E(G ) u E(G ) (see Fig. 2.7). x
2
9
2
X
2
{
b+ G-\
y •
G2
t
2
2
X
2
b< u G2
Fig. 2.7 Most all the graphs discussed so far have been ' i n one piece'. A graph is connected i f it cannot be expressed as the union o f t w o graphs, and disconnected otherwise. Clearly any disconnected graph G can be expressed as the union o f connected graphs.
Definitions
11
each o f which is a component o f G. For example, a graph w i t h three components is shown i n Fig. 2.8.
ft ft
Fig. 2.8
When proving results about graphs i n general, we can often obtain the corresponding results for connected graphs and then apply them to each component separately. A table of all the connected unlabelled graphs w i t h up to five vertices is given i n Fig. 2.9.
'A "j 'A A XA X A V A; ,A X v A A. A: K A 8
9
ft ft ft ft
1
11
14
13
16
15
O
:
18
1
9
1
?1
—
ft
22
ft
ft
23
5
26
ft ft
27
28
r
c >9
3C
7°
F/g. 2.9
31
12
Definitions and examples
Adjacency W e say that two vertices v and w o f a graph G are adjacent i f there is an edge vw j o i n ing them, and the vertices v and w are then i n c i d e n t w i t h such an edge. Similarly, two distinct edges e a n d / a r e adjacent i f they have a vertex i n common (see Fig. 2.10).
v >
w «c
adjacent vertices
f^#K > - ^ - * r adjacent edges
Fig. 2.10 The degree o f a vertex v o f G is the number o f edges incident w i t h v, and is written deg(v); in calculating the degree o f v, we usually make the convention that a loop at v contributes 2 (rather than 1) to the degree o f v. A vertex of degree 0 is an isolated ver tex and a vertex of degree 1 is an end-vertex. Thus each of the two graphs i n Fig. 2.11 has two end-vertices and three vertices o f degree 2, while the graph i n Fig. 2.12 has one end-vertex, one vertex o f degree 3, one o f degree 6 and one o f degree 8. The degree sequence o f a graph consists o f the degrees written i n increasing order, w i t h repeats where necessary. For example, the degree sequences o f the graphs i n Figs. 2.11 and 2.12 are ( 1 , 1,2, 2, 2) and ( 1 , 3, 6, 8).
Fig. 2.11 u
z
Fig. 2.12
Note that in any graph the sum of all the vertex-degrees is an even number - in fact, twice the number o f edges, since each edge contributes exactly 2 to the sum. This result, due essentially to Leonhard Filler in 1736, is called the h a n d s h a k i n g l e m m a . It implies that i f several people shake hands, then the total number o f hands shaken must be even - precisely because just two hands are involved i n each handshake. A n imme diate corollary of the handshaking lemma is that in any graph the number of vertices of
odd degree is even. Subgraphs A s u b g r a p h o f a graph G is a graph, each o f whose vertices belongs to V(G) and each of whose edges belongs to E{G). Thus the graph i n Fig. 2.13 is a subgraph of the graph in Fig. 2.14, but is not a subgraph o f the graph i n F i g . 2.15, since the latter graph contains no 'triangle'.
Definitions
13
Fig. 2.13
Fig. 2.14
Fig. 2.15
W e can obtain subgraphs of a graph by deleting edges and vertices. I f e is an edge of a graph G, we denote by G - e the graph obtained from G by deleting the edge e. M o r e generally, i f F is any set o f edges i n G, we denote by G - F the graph obtained by deleting the edges i n F. Similarly, i f v is a vertex o f G, we denote by G - v the graph obtained from G by deleting the vertex v together with the edges incident with v. M o r e generally, i f S is any set o f vertices i n G, we denote by G - S the graph obtained by deleting the vertices i n S and all edges incident w i t h any o f them. Some examples are shown i n F i g . 2.16. v
e
W
V
w
w
Fig. 2.16
W e also denote by G V the graph obtained by taking an edge e and contracting i t removing it and identifying its ends v and w so that the resulting vertex is incident with those edges (other than e) that were originally incident w i t h v or w. A n example is shown in Fig. 2.17.
14
Definitions and examples
Matrix representations Although it is convenient to represent a graph by a diagram o f points joined by lines, such a representation may be unsuitable i f we wish to store a large graph i n a com puter. One way o f storing a simple graph is by listing the vertices adjacent to each vertex o f the graph. A n example o f this is given i n Fig. 2.18.
v
w u: v: w: x: y:
Y
v,y u,w,y v,x,y w,y u,v,w,x
x
Fig. 2.18 Other useful representations involve matrices. I f G is a graph w i t h vertices labelled { 1 , 2 , . . . , w(, its adjacency matrix A is the n x n matrix whose ij-th entry is the number o f edges j o i n i n g vertex i and vertex j . I f , i n addition, the edges are labelled { 1 , 2 , . . . , m], its incidence matrix M is the n x m matrix whose //-th entry is 1 i f ver tex i is incident to edge /, and 0 otherwise. Figure 2.19 shows a labelled graph G with its adjacency and incidence matrices.
0 10 1 10
12
10 M:
0 10
110
0
0 10 1
0 110
12
0 0
10
Exercises 2 2.1 Write down the vertex set and edge set of each graph in Fig. 2.3. 2.2
Draw (i) a simple graph, (ii) a non-simple graph with no loops, (iii) a non-simple graph with no multiple edges, each with five vertices and eight edges.
11 0 0
1 1 1 1
Fig. 2.19
s
0
Definitions 2.3
s
(i) (ii)
15
By suitably labelling the vertices, show that the two graphs in Fig. 2.20 are isomorphic. Explain why the two graphs in Fig. 2.21 are not isomorphic.
Fig. 2.20
Fig. 2.21 2.4
Classify the following statements as true ox false: (i) any two isomorphic graphs have the same degree sequence; (ii) any two graphs with the same degree sequence are isomorphic.
2.5
2.6
(i) (ii) s
( w - 1 ) / 2
Show that there are exactly 2 " labelled simple graphs on n vertices, How many of these have exactly m edges?
Locate each of the graphs in Fig. 2.22 in the table of Fig. 2.9.
(i)
Fig. 2.22
2.7
s
Write down the degree sequence of each graph with four vertices in Fig. 2.9, and verify that the handshaking lemma holds for each graph.
2.8
(i) (ii)
2.9*
2.10
Draw a graph on six vertices with degree sequence (3, 3, 5, 5, 5, 5); does there exist a simple graph with these degrees? How are your answers to part (i) changed if the degree sequence is (2, 3, 3,4,5, 5)?
If G is a simple graph with at least two vertices, prove that G must contain two or more vertices of the same degree. s
Which graphs in Fig. 2.23 are subgraphs of those in Fig. 2.20?
16
Definitions and examples
n o o
a Fig. 2.23 2.11
2.12
Let G be a graph with n vertices and m edges, and let v be a vertex of G of degree k and e be an edge of G. How many vertices and edges have G -e,G-v and GV? s
Write down the adjacency and incidence matrices of the graph in Fig. 2.24. 1
Fig. 2.24 r
0
1 1 2 0^ 1 0 0 0 1
10
1 1
0
2 0 1 0
^0
1 1 0
0
0,
Fig. 2.25 r
0
0 1 1 1 1 1 0^
0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1
10 J
1 0
1 0
1 0
1 0 0 0 1 0 0^
Fig. 2.26 2.13
(i) (ii)
Draw the graph whose adjacency matrix is given in Fig. 2,25. Draw the graph whose incidence matrix is given in Fig. 2.26.
2.14
I f G is a graph without loops, what can you say about the sum of the entries in (i) any row or column of the adjacency matrix of G? (ii) any row of the incidence matrix of G? (iii) any column of the incidence matrix of G?
2.15*
I f G is a simple graph with edge-set E{G), the vector space of G is the vector space over the field Z of integers modulo 2, whose elements are subsets of E(G). The sum E + F of two subsets E and F is the set of edges in E or F but not both, and scalar multiplication is defined by IE = E and 0E = 0 . Show that this defines a vector space over Z , and find a basis for it. 2
0
Examples 3
17
Examples
I n this section we examine some important types o f graphs. Y o u should become familiar w i t h them, as they w i l l appear frequently i n examples and exercises. Null graphs A graph whose edge-set is empty is a null graph. W e denote the null graph on n ver tices by N \ N is shown i n Fig. 3.1. Note that each vertex o f a n u l l graph is isolated. N u l l graphs are not very interesting. n
4
Fig. 3.1
Complete graphs A simple graph i n w h i c h each pair o f distinct vertices are adjacent is a complete graph. W e denote the complete graph on n vertices by K ; K and K are shown i n Fig. 3.2. Y o u should check that K has n(n-\)/2 edges. n
4
5
n
Fig. 3.2
Cycle graphs, path graphs and wheels A connected graph that is regular o f degree 2 is a cycle graph. W e denote the cycle graph on n vertices by C . The graph obtained from C by removing an edge is the path graph on n vertices, denoted by P . The graph obtained from C _ by j o i n i n g each vertex to a new vertex v is the wheel on n vertices, denoted by W . The graphs C , P and W are shown i n F i g . 3.3. n
n
f}
f1
n
6
Fig. 3.3
6
{
6
18
Definitions and examples
Regular graphs A graph i n which each vertex has the same degree is a regular graph. I f each vertex has degree r, the graph is regular of degree r or r-regular. O f special importance are the cubic graphs, which are regular o f degree 3; an example o f a cubic graph is the Petersen graph, shown i n F i g . 3.4. Note that the n u l l graph N is regular o f degree 0, the cycle graph C is regular o f degree 2, and the complete graph K is regular o f degree n-l. n
n
n
Fig. 3.4 Platonic graphs O f interest among the regular graphs are the Platonic graphs, formed from the vertices and edges o f the five regular (Platonic) solids - the tetrahedron, octahedron, cube, icosahedron and dodecahedron (see Fig. 3.5).
tetrahedron
octahedron
cube
icosahedron
dodecahedron
Fig. 3.5
Bipartite graphs I f the vertex set o f a graph G can be split into two disjoint sets A and B so that each edge o f G joins a vertex o f A and a vertex o f B, then G is a bipartite graph (see F i g . 3.6). Alternatively, a bipartite graph is one whose vertices can be coloured black and white i n such a way that each edge joins a black vertex (in A ) and a white vertex (in B). A complete bipartite graph is a bipartite graph i n which each vertex i n A is joined to each vertex i n B by just one edge. W e denote the bipartite graph w i t h r black vertices and s white vertices by K . ; K , K , K and K are shown in Fig. 3.7. Y o u should check that K has r + s vertices and rs edges. f s
r
s
{
3
2
3
3
3
4
3
19
Examples A
B Fig. 3.6
Fig. 3.7
Cubes O f special interest among the regular bipartite graphs are the cubes. The A-cube Q is the graph whose vertices correspond to the sequences (a a , •. • , a ), where each a- 0 or 1, and whose edges j o i n those sequences that differ i n just one place. Note that the graph o f the cube is the graph Q (see Fig. 3.8). Y o u should check that Q has 2 ver tices and k2 edges, and is regular o f degree k. k
v
2
k
k
3
k
Fig. 3.8
Fig. 3.9
1
k
20
Definitions and examples
T h e complement of a simple graph I f G is a simple graph with vertex set V(G), its complement G is the simple graph with vertex set 1(G) in which two vertices are adjacent i f and only i f they are not adjacent in G. For example, Fig. 3.9 shows a graph and its complement. Note that the comple ment o f a complete graph is a null graph, and that the complement o f a complete bipartite graph is the union o f two complete graphs. Exercises 3 3.1 Draw (i) (ii) (in) (iv) (v) s
3.2
s
{0
3.4
6
?
{
3
4
4
4
(il)K ;
(iii) Q ;
57
4
(iv) W ; 8
(v) the Petersen graph?
How many vertices and edges has each of the Platonic graphs? s
3.5
In the table of Fig. 2.9, locate all the regular graphs and the bipartite graphs. Give an example (if it exists) of each of the following: (i) (ii) (iii) (iv) (v)
3.6
5
How many edges has each of the following graphs: (i)K ;
3.3
the following graphs: the null graph N ; the complete graph K ; the complete bipartite graph K ; the union of K and W ; the complement of the cycle graph C .
s
3.7
a bipartite graph that is regular of degree 5; a bipartite Platonic graph; a complete graph that is a wheel; a cubic graph with 11 vertices; a graph (other than K , K 4
Draw all the simple cubic graphs with at most 8 vertices. }
ANC
3.9*
4
The complete tripartite graph K . consists of three sets of vertices (of sizes r, s and i), with an edge joining two vertices i f and only i f they lie in different sets. Draw the graphs AT? 2 * ^ 3 3 2 * d the number of edges of K . A simple graph that is isomorphic to its complement is self-complementary. (i) Prove that, if G is self-complementary, then G has 4k or 4k+1 vertices, where k is an integer. (ii) Find all self-complementary graphs with 4 and 5 vertices. (iii) Find a self-complementary graph with 8 vertices. a n c
s t
1 1n
2
3.8
or Q ) that is regular of degree 4.
4 4
3 4
5
The line graph L(G) of a simple graph G is the graph whose vertices are in one-one correspondence with the edges of G, two vertices of L(G) being adjacent i f and only if the corresponding edges of G are adjacent. (i) Show that K and K have the same line graph. (ii) Show that the line graph of the tetrahedron graph is the octahedron graph. (iii) Prove that, i f G is regular of degree k, then L(G) is regular of degree 2 k—2. (iv) Find an expression for the number of edges of L(G) in terms of the degrees of the vertices of G. (v) Show that L(K ) is the complement of the Petersen graph. 3
x 3
5
3.10*
An automorphism 9 of a simple graph G is a one-one mapping of the vertex set of G onto itself with the property that (p(v) and cp( vv) are adjacent whenever v and w are. The automorphism group F(G) of G is the group of automorphisms of G under composition.
Three puzzles (i) (ii) (iii)
Three
4
21
Prove that the groups T(G) and T(G) are isomorphic. Find the groups T(K ), T(K ) and T(C ). Use the results of parts (i) and (ii) and Exercise 3.9(v) to find the automorphism group of the Petersen graph. n
rs
n
puzzles
In this section we present three recreational puzzles that can be solved using ideas relating to graphs. I n each puzzle, note how the use of a graph diagram makes the prob lem much easier to understand. The eight circles problem Place the letters A, B, C, D, E, F, G, H into the eight circles in Fig. 4.1, in such a way that no letter is adjacent to a letter that is next to it in the alphabet.
Fig. 4.1
First note that trying all the possibilities is not a practical proposition, as there are 8! = 40 320 ways o f placing eight letters into eight circles. W e therefore need a more systematic approach. Note that: (i) (ii)
the easiest letters to place are A and / / , because each has only one letter to which it cannot be adjacent (namely, B and G, respectively); the hardest circles to fill are those in the middle, as each is adjacent to six others.
This suggests that we place A and H in the middle circles. I f we place A to the left of / / . then the only possible positions for B and G are as shown in Fig. 4.2.
Fig. 4.2
22
Definitions and examples
The letter C must now be placed on the left-hand side o f the diagram, and F must be placed on the right-hand side. I t is then a simple matter to place the remaining letters, as shown i n Fig. 4.3.
Fig. 4.3 Six people at a party Show that, in any gathering of six people, there are either three people who all know each other or three people none of whom knows either of the other two. T o solve this, we draw a graph i n which we represent each person by a vertex and j o i n two vertices by a solid edge i f the corresponding people know each other, and by a dotted edge i f not. W e must show that there is always a solid triangle or a dotted triangle. Let v be any vertex. Then there must be exactly five edges incident w i t h v, either solid or dashed, and so at least three o f these edges must be o f the same type. Let us assume that there are three solid edges (see Fig. 4.4); the case o f at least three dashed edges is similar. v
y Fig. 4.4
w
Three puzzles
v
23
w
Fig. 4.6 I f the people corresponding to the vertices w and x know each other, then v, w and x form a solid triangle, as required. Similarly, i f the people corresponding to the ver tices w and y, or to the vertices x and y, k n o w each other, then we again obtain a solid triangle. These three cases are shown i n F i g . 4.5. Finally, i f no two o f the people corresponding to the vertices w, x and y know each other, then w, x and y form a dotted triangle, as required (see Fig. 4.6). T h e four cubes problem W e conclude this section with a puzzle that has been popular under the name of Instant Insanity. Given four cubes whose faces are coloured red, blue, green and yellow, as in Fig. 4.7, can we pile them up so that all four colours appear on each side of the resulting 4x1 stack?
R R
R
Y
G
B
R
R cub e 1
Y
B
G B
G
B
B
R
Y
G
Y
R
Y
G
Y
cub e 2
cub e 3
cub e 4
G
Fig. 4.7 Although these cubes can be stacked i n thousands o f different ways, there is essen tially only one way that gives a solution. W e solve this problem by representing each cube by a graph w i t h four vertices, R, B , G and Y , one for each colour. I n each o f these graphs, t w o vertices are adjacent i f and only i f the cube i n question has the corresponding colours on opposite faces. The graphs corresponding to the cubes o f Fig. 4.7 are shown i n Fig. 4.8. B
OS
G
Y cube 1
Fig. 4.8
G cube 2
G cube 3
Y cube 4
24
Definitions and examples W e next superimpose these graphs to form a new graph G (see F i g . 4.9).
Fig. 4.9
A solution o f the puzzle is obtained by finding two subgraphs H and H o f G. The subgraph H tells us which pair o f colours appears on the front and back o f each cube, and the subgraph H tells us which pair o f colours appears on the left and right. To this end, the subgraphs / / , and II have the following properties: {
2
{
2
2
(a)
(b) (c)
each subgraph contains exactly one edge from each cube; this ensures that each cube has a front and back, and a left and right, and the subgraphs tell us which pairs o f colours appear on these faces. the subgraphs have no edges in common; this ensures that the faces on the front and back are different from those on the sides. each subgraph is regular of degree 2; this tells us that each colour appears exactly twice on the sides o f the stack (once on each side) and exactly twice on the front and back (once on the front and once on the back).
The subgraphs corresponding to our particular example are shown in Fig. 4.10, and the solution can be read from these subgraphs as in Fig. 4.11.
G
"
Y
front and back
left and right
"1
Ho
Fig. 4.10
cube 4
^
G
R
Y
G
cube 3
•
Y
B
B
R
cube 2
•
B
G
R
Y
cube 1
^
R
Y
G
B
left
Fig. 4.11
front
right
back
Three puzzles
25
Exercises 4 4.1 Find another solution of the eight circles problem. s
4.2
s
Show that there is a gathering of five people in which there are no three people who all know each other and no three people none of whom knows either of the other two.
4.3
s
Find a solution of the four cubes problem for the set of cubes in Fig. 4.12.
Y R
G B R
G
R
Y
G
Y B
G
R
R
cut e 1
Y
Y R
B
R
G
cub e2
G
R
Y
B
cub e 3
cub e 4
Fig. 4.12 4.4
Show that the four cubes problem in Fig. 4.13 has no solution. B
G Y
G
R
R cube 1
B
G
R
B R
Y
R
Y
G
G
Y
cube 2
cube 3
B
Y
b
G
R
b cube 4
Fig. 4.13
4.5*
Prove that the solution of the four cubes problem in the text is the only solution for that set of cubes.
Chapter
3
Paths and cycles
. . . So many paths that wind and wind, While just the art of being kind Is all the sad world needs. Ella Wheeler Wilcox
N o w that we have a reasonable armoury o f graphs, we can look at their properties. T o do this, we need some definitions that describe ways o f ' g o i n g from one vertex to another'. W e give these definitions i n Section 5 and prove some results on connec tivity. I n Sections 6 and 7 we study t w o particular types o f graphs, those w i t h trails containing every edge, and those w i t h cycles containing every vertex. W e conclude this chapter, in Section 8, with some applications o f paths and cycles.
5
Connectivity
Given a graph G, a walk in G is a finite sequence o f edges o f the form VQV], Vji'2, . . . , v
m
\v
nn
also denoted by VQ —> v j —> V2 —> * " • —> v , in which any t w o consecutive m
edges are adjacent or identical. Such a w a l k determines a sequence o f vertices v , v 0
. . . , v . We call VQ the initial vertex and v m
m
l 5
the final vertex o f the walk, and speak o f
a walk from v to v . The number o f edges i n a walk is called its length; for example, 0
m
i n F i g . 5 . 1 , v — > w — > x — > y — > z — » z — > y — > w i s a walk o f length 7 from v to w. x
y
Fig. 5.1
The concept o f a walk is usually too general for our purposes, so we impose some restrictions. A walk in which all the edges are distinct is a trail. I f , in addition, the ver tices V(), v i , . . . , v
m
are distinct (except, possibly, VQ = v ) , then the trail is a path. A m
Connectivity
27
path or trail is closed i f VQ = v , and a closed path containing at least one edge is a cycle. Note that any loop or pair o f multiple edges is a cycle. m
To clarify these concepts, consider Fig. 5.1. W e see that v—> w —> x y —> z z —» x is a trail, v - > w — > x ^ y - ^ z is a path, v w —> x —> y —> z ^ x —> v is a closed trail, and v—>w—>x—> y v is a cycle. A cycle o f length 3, such as v —» w —> x —> v, is a triangle. Note that a graph is connected i f and only i f there is a path between each pair o f vertices (see Fig. 5.2). v
w
v
w
connected
disconnected
Fig. 5.2 Note also that G is a bipartite graph i f and only i f each cycle o f G has even length. W e prove one half of this result here, leaving the proof o f its converse to you (see Exercise 5.3). T H E O R E M 5.1. If G is a bipartite graph, then each cycle ofG has even length.
Proof. Since G is bipartite, we can split its vertex set into two disjoint sets A and B so that each edge o f G joins a vertex o f A and a vertex o f B. Let VQ —> v\ —> " " ' —» v —> VQ be a cycle i n G, and assume (without loss o f generality) that VQ is i n A. Then v i is i n B, v is i n A, and so on. Since v must be i n B, the cycle has even length. // m
2
m
We now investigate bounds for the number of edges of a simple connected graph on n vertices. Such a graph has fewest edges when i t has no cycles, and most edges when it is a complete graph. This implies that the number o f edges must lie between n - 1 and n(n - 1 )/2. I n fact, we prove a stronger theorem that includes this result as a special case. T H E O R E M 5.2. Let G be a simple graph on n vertices. IfG has k components, the number m of edges of G satisfies n-k<mn-~ k by induction on the number of edges of G, the result being trivial i f G is a null graph. I f G contains as few edges as possible (say mo), then the removal o f any edge o f G must increase the number o f components by 1, and the graph that remains has n vertices, k + 1 components, and m - 1 edges. I t follows from the induction hypothesis that m - 1 > n - (k + 1), giving m > n - k, as required. 0
0
0
28
Paths and cycles
To prove the upper bound, we can assume that each component o f G is a complete graph. Suppose, then, that there are two components Q and Cj with n and fij vertices, respectively, where /*,- > nj > 1. I f we replace Cj and Cj by complete graphs on /?,- + 1 and nj — 1 vertices, then the total number o f vertices remains unchanged, and the number o f edges is changed by t
{(m + 1 H -
- 1) }/2 - {rijirij - \ ) - ( n
r
l)(nj - 2) }/2 = n t
rij + 1,
which is positive. It follows that, in order to attain the maximum number of edges, G must consist o f a complete graph on // - k + 1 vertices and k - 1 isolated vertices. The result now follows. //
C O R O L L A R Y 5.3. Any simple (n - 1)(/? - 2)/2 edges is connected
graph
with
n
vertices
and
more
than
Another approach used in the study o f connected graphs is to ask 'how connected is a connected graph?' One interpretation o f this is to ask how many edges or vertices must be removed i n order to disconnect the graph. W e conclude this section w i t h some terms that are useful when discussing such questions. A disconnecting set i n a connected graph G is a set of edges whose removal dis connects G. For example, i n the graph o f Fig. 5.3, the sets {e\, en,