AS and A Level Graphs
AS and A Level Graphs
com
Chapter 1 Graphs
1 GRAPHS
Objectives
After studying this chapter you should
• be able to use the language of graph theory;
• understand the concept of isomorphism;
• be able to search and count systematically;
• be able to apply graph methods to simple problems.
1.0 Introduction
This chapter introduces the language and basic theory of graphs.
These are not graphs drawn on squared paper, such as you met
during your GCSE course, but merely sets of points joined by lines.
You do not need any previous mathematical knowledge to study
this chapter, other than an ability to count and to do very simple
arithmetic.
Although graph theory was first explored more than two hundred
years ago, it was thought of as little more than a game for
mathematicians and was not really taken seriously until the late
twentieth century. The growth in computer power, however, led
to the realisation that graph theory can be applied to a wide
range of industrial and commercial management problems of
considerable economic importance.
1
www.vagupu.com
Chapter 1 Graphs
There is an oddity in the second graph too. Jack and Jill are
friends with one another but with no one else, so that the graph
'falls apart' into two quite separate pieces. Such a graph is said
to be disconnected. A connected graph is one in which every
vertex is linked (by a single edge or a sequence of edges) to
every other. If every vertex is linked to every other by a single
edge, a simple graph is said to be complete.
Jane
A subgraph of a graph is another graph that can be seen within
it; i.e. another graph consisting of some of the original vertices
Peter
and edges. For example, the graph consisting of vertices 'Jane',
'Mary' and 'Peter' and edges from 'Jane' to 'Mary' and from
Mary
'Mary' to 'Peter' is a subgraph of the friendship graph above.
2
www.vagupu.com
Chapter 1 Graphs
Exercise 1A
Note The answers to these questions will be used 2. Say which (if any) of the graphs in Question 1
in later sections, and should be kept safely are
until then. (i) simple (ii) connected and/or (iii) complete.
1. For each of the graphs shown below, write down 3. Draw graphs to fit the following descriptions:
(i) its number of vertices, (a) The vertices are A, B, C and D; the edges join
(ii) its number of edges, AB, BC, CD, AD and BD.
(iii) the degree of each vertex.
(b) The vertices are P, Q, R, S and T, and there
(a) (b) (c) are edges joining PQ, PR, PS and PT.
(c) The graph has vertices W, X, Y and Z and
edges XY, YZ , YZ, ZX and XX.
(d) (e) (f) (d) The graph has five vertices, each joined by a
single edge to every other vertex.
(e) The graph is a simple connected graph with
four vertices and three edges.
1.2 Isomorphism
Look at your answers to Question 3 from Exercise 1A, and
compare them with those of other students. You will probably
find that some of the drawings look different from others and
yet fit the descriptions equally well.
3
www.vagupu.com
Chapter 1 Graphs
The clue is in the argument that has already been given. If one
graph has a vertex of degree three, and the other does not, then
no matching can ever be found and the graphs are not
isomorphic. This idea can be extended to provide a partial test: a
necessary condition for two graphs to be isomorphic is that the
two graphs have the same number of vertices of degree 0, the
same number of vertices of degree 1, and so on. If this condition
is not satisfied the graphs are certainly not isomorphic. But it is
not a sufficient condition; in other words, if the condition is
satisfied you still do not know whether or not the graphs are
isomorphic and you must go on looking for a match.
Exercise 1B
Look at the graphs below, and say which of them are
isomorphic to which others.
Counting graphs
You may be wondering by now how many different simple 1 vertex
graphs can be drawn with just a few vertices. With only one 1 graph
vertex (and no loops allowed) there is clearly only one such ...........................
graph - the one with no edges.
2 vertices
With two vertices there are two possibilities: there is one graph 2 graphs
with no edges and one with one edge, making two possible ...........................
graphs altogether. You are counting simple graphs, remember,
so multiple edges are excluded.
3 vertices
With three vertices there are four possibilities: one each with no 4 graphs
edges, one edge, two edges and three edges respectively. Any other
simple graph on three vertices must be isomorphic to one of these.
4
www.vagupu.com
Chapter 1 Graphs
Vertices 1 2 3 4 5 6 ...
When you have got a firm result for four vertices (and corrected
your prediction if necessary), try to extend your prediction to
five and/or six vertices.
Activity 2 Handshakes
At the beginning of the lesson, greet some of the other members
of your group by shaking hands with them. You don’t have to
shake hands with everyone, and you can shake hands with the
same person more than once if you like, but you must keep
count of how many handshakes you take part in.
At the end, some members of the group will have been involved
in an odd number of handshakes, and others in an even number,
so consider this bet: if the number of people involved in an odd
number of handshakes is odd, your teacher lets you off
homework for a week, but if it is even you get a double dose -
does that seem fair?
You may guess that this is not a good bet at all from your point
of view - not unless you like doing maths homework, that is! In
fact you can never win, because the number of people who
shake hands an odd number of times is always even.
5
www.vagupu.com
Chapter 1 Graphs
This lemma leads quite easily to the unwinnable bet. If the total
of individual handshakes is twice the number of handshakes, as
the lemma requires, it is certainly an even number. Some
members of the class shook hands an even number of times, and
the total of any number of even numbers is even. So the total for
the rest must be even as well, and since they each shook hands
an odd number of times, this can happen only if there are an
even number of people. So the number of people involved an an
odd number of handshakes must always be even.
The handshake lemma may seem trivial, but it has some quite
important consequences and comes up again in Chapter 6.
Activity 3
Try the handshaking exercise again, and this time keep count not of
the number of handshakes, but of the number of people with whom
you shake hands (once or more times makes no difference). What
are the chances that at the end there will be two people who have
shaken hands with the same number of others?
For example, suppose there are nine people in the room: each must
have shaken hands with 0, 1, 2, 3, 4, 5, 6, 7 or 8 others. Of course,
if anyone has shaken hands with 8 others - that is, with everyone
else - then there cannot be anyone who has shaken hands with 0
others, and vice versa. So among the nine people there are at most
eight different scores and the pigeonhole principle says that at least
two people must therefore have the same score. You can apply the
same argument to any number of people more than one.
6
www.vagupu.com
Chapter 1 Graphs
Exercise 1C
1. Referring to the graph in the diagram below, list 2. Which (if any) of the shapes below can you draw
A completely without lifting your pencil from the
paper or going over any line twice?
B
P Q (If you invent appropriate vertices and imagine
them as graphs, then you are looking for a trail
C which includes all the edges)
7
www.vagupu.com
Chapter 1 Graphs
Activity
.. 4 Königsberg bridges
Try to find a route crossing each bridge just once and returning
to the starting point.
Eulerian trails
The four vertices of the graph have degrees 3, 3, 3 and 5
respectively - all odd numbers. Any closed trail, on the other hand,
goes into a vertex and out of it again, thus adding 2 to its degree on
each visit. A closed trail using all the edges cannot exist, therefore,
unless every vertex has even degree. (If there are just two vertices
with odd degree, they could be the start and finish of a non-closed
trail using all the edges.) In fact the opposite is also known: if a
connected graph has every vertex of even degree then there does
exist a closed trail using all the edges (and if there are just two
vertices of odd degree then there is a non-closed trail using all the
edges).
8
www.vagupu.com
Chapter 1 Graphs
Exercise 1D
By considering the degree of each vertex, determine (a) (b) (c)
whether each of the graphs shown opposite is Eulerian,
semi-Eulerian, or neither. In the case of Eulerian and
semi-Eulerian graphs, find an Eulerian trail.
G
Activity 5 Icosian game
E F L M H B
The diagram shows a graph representing a dodecahedron. Try R
S
to find such a route - a closed path, to use the modern phrase - Q
beginning with ABCIN in that order. K T N
P
O
J I
D C
A closed path that passes through every vertex of a graph is
called a Hamiltonian cycle, and a graph in which a Hamiltonian
cycle exists is said to be Hamiltonian. The dodecahedron is a
Hamiltonian graph, and there are actually two Hamiltonian
cycles beginning with the five vertices given:
ABCINHMSTPOJDEFKQRLGA
and ABCINHMGLFKQRSTPOJDEA.
9
www.vagupu.com
Chapter 1 Graphs
* Exercise 1E
Decide by trial and error whether or not each of the
graphs shown below is Hamiltonian.
(a) (b) (c) (d) (e) (f)
1.6 Trees
A connected graph in which there are no cycles is called a tree.
Look at the graphs below and decide which of them are trees.
Activity 6
Look again at the graphs you have identified as trees, and count
their vertices and their edges. Can you state a general theorem
connecting the numbers of vertices and edges for trees? If so,
can you prove it?
Trees of this kind occur quite often in real life - a biology book
may include a 'tree' showing how all living creatures are
ultimately descended from the same primitive life forms; a
geography text may include a diagram of the entire Amazon
river system; and you may find in a history book a diagram of
the Kings and Queens of England, although a certain amount of
from being truly a tree as defined above.
10
www.vagupu.com
Chapter 1 Graphs
Hierarchies
Trees are also commonly used to represent hierarchical
organisations. The first diagram below shows part of the
management structure of a college, for example, while the
second is an extract from a computer’s hard disk directory.
11
www.vagupu.com
Chapter 1 Graphs
Game strategies
Another application of trees is in setting out strategies for
playing certain games. For example, the diagram shows the
first few stages of a strategy tree for the first player in the game
“Noughts and Crosses”. You may like to try to complete it.
O
x O x
O x
x x O x
O any x any
x x O other O x other
O
Counting trees
There is clearly only one tree with one vertex, one with two, and 1 vertex
one with three, as shown in the diagram - any other is isomorphic 1 tree
to one of these. There are two non-isomorphic trees with four ..............................
..
vertices, however, and these figures can be set out in a table: 2 vertices
1 tree
Vertices 1 2 3 4 5 6 7 ... ...............................
.
3 vertices
Trees 1 1 1 2 ... ... ... ...
1 tree
..............................
*Organic chemistry
In fact there is no simple formula for unlabelled trees - it turns
out to be much easier to count trees if their vertices are labelled
12
www.vagupu.com
Chapter 1 Graphs
Cube 3 Cube 4
13
www.vagupu.com
Chapter 1 Graphs
From this graph, extract two disjoint subgraphs - that is, two 4
subgraphs with no edges in common. Each subgraph must consist 3 3 2
1
of four edges of the original graph, chosen in such a way that
4
(i) the edges include one of each number, in any order, 2
1 G B
3
(ii) each of the vertices R, Y, G, B has degree 2 in each
subgraph.
A graphical representation
Two subgraphs satisfying these conditions are shown in the lower
of the four cubes
diagram opposite.
Activity 8
Find the third subgraph and interpret it in the same way as in the
example.
Activity 9
Try to get hold of a commercially-made puzzle of this kind, or
make your own, and then amaze your family and friends (and
perhaps yourself!) by using mathematics to solve it in just a few
minutes.
14
www.vagupu.com
Chapter 1 Graphs
E F
A four-dimensional cube in graph form
B C
*8. Prove that among any group of six people, there
are either three who all know one another or
three who are mutual strangers.
(a) Is G Eulerian? If so, write down an
*9. Given that there are 23 different unlabelled trees Eulerian trail.
with eight vertices, draw as many of them as you
can. (b) Is G Hamiltonian? If so, write down a
Hamiltonian cycle.
*10. A set of four coloured cubes has opposite faces
coloured as follows:
Cube 1 R-B, R-Y, B-G;
Cube 2 R-B, Y-Y, Y-G;
Cube 3 R-Y, R-B, B-G;
Cube 4 R-G, G-G, B-Y;
Either find a solution to the four-cube problem
or explain why such a solution is impossible.
15
www.vagupu.com
Chapter 1 Graphs
16