PL E
Brighter Thinking
A Level Further Mathematics for AQA Discrete Student Book (AS/A Level)
SA
M
Jan Dangerfield
Original material Š Cambridge University Press 2018
Contents Introduction How to use this resource 1 Graphs 1: The language of graphs 2: Properties of graphs 3: Planarity and isomorphism Mixed practice 1
3 Networks flows 1: Flows and cuts
PL E
2 Networks 1: Network optimisation problems using spanning trees 2: Route inspection problems 3: Travelling salesperson problem Mixed practice 2
2: Variations on flow problems Mixed practice 3
4 Linear programming 1: Formulating constrained optimisation problems 2: Graphical solutions
M
3: The simplex algorithm Mixed practice 4
Cross-topic review exercise 1
SA
5 Critical path analysis 1: Analysing precedence networks 2: Scheduling Mixed practice 5
6 Game theory for zero-sum games 1: Games with stable solutions 2: Mixed strategies Mixed practice 6 7 Binary operations 1: Properties of binary operations 2: Using Cayley tables Mixed practice 7
8 Groups 1: The group axioms 2: Generators of a group Mixed practice 8 Cross-topic review exercise 2
Original material Š Cambridge University Press 2018
SA
M
PL E
Practice paper Formulae Answers Acknowledgements Copyright
Original material Š Cambridge University Press 2018
1 Graphs
PL E
In this chapter you will learn how to: use the language of graphs
recognise and use some special types of graph use graphs to model problems.
If you are following the A Level course you will also learn how to: understand and use the term planarity
understand and use the term isomorphism.
M
Before you start‌
You should be able to use a mapping to represent
1 What relationship is shown in this mapping?
relationships.
SA
GCSE Mathematics
Original material Š Cambridge University Press 2018
Section 1: The language of graphs Key point 1.1 A graph is a set of vertices connected by edges. A vertex is shown as a point on a graph. Vertices are sometimes labelled, and sometimes not. An edge is a line or curve with a vertex at each end.
PL E
WORKED EXAMPLE 1.1
a List the vertices in this graph. b List the edges in the graph. a The vertices are A, , C , D and E.
AB, AC , AD, BC
and BE.
You can identify an edge by the vertices at its ends. Edge BA is the same as edge AB, for example.
Key point 1.2
SA
b
Not all graphs will have labelled vertices.
M
B
A walk is a set of edges joined end to end, so the end vertex of one edge is the start vertex of the next. A trail is a walk in which no edges are repeated. Vertices can be repeated in a trail, although often they are not. A cycle is a trail that starts and finishes at the same vertex. Other than the start being the same as the finish, vertices are not repeated in a cycle.
Fast forward The terms trail and cycle will be used in route inspection problems and the travelling salesperson problem in Chapter 2.
Original material Š Cambridge University Press 2018
WORKED EXAMPLE 1.2
Using the graph in Worked example 1.1:
a give an example of a walk that passes through every vertex b give two examples of trails, one with a repeated vertex and one with no repeated vertices c explain why A − B − C
− D
is not a trail
d give an example of a cycle e explain why E − B − A − C
− A − B − E
b An example of a trail with a repeated vertex is A − B − C − A − D
.
An example of a trail with no repeated vertices is D − A − B − E. c There is no edge C
is not a cycle. This is not a trail because the edge A − B is repeated.
PL E
a e.g. D − A − B − C
− B − E
− D
This trail repeats the vertex A.
This trail has no repeated vertices.
.
− A
M
d For example: A − B − C
e Vertex B is travelled through twice.
A cycle has no repeated vertices, apart from starting and finishing at the same vertex.
SA
Key point 1.3
Two vertices are directly connected, or adjacent, if there is an edge with these vertices at its ends. An indirect connection between two vertices passes through other vertices and involves more than one edge. A graph is connected if it is possible to get from any vertex to any other, directly or indirectly.
The position of the vertices and the shapes of the edges in a graph (including whether they cross each other or not) are irrelevant. All that matters is which vertices are adjacent (directly joined) to each other.
Key point 1.4 An edge that directly connects a vertex to itself is called a loop. A graph has a multiple edge if there are two or more edges that directly connect the same pair of vertices. Original material © Cambridge University Press 2018
A graph with no loops and no multiple edges is called a simple graph.
WORKED EXAMPLE 1.3
Which of these graphs have:
a a loop or loops b a multiple edge or multiple edges?
A
D
C
E
PL E
B
F
Graph 1
Graph 2
G
J
H
I
K
L
Graph 4
N
SA
M
M
Graph 3
P
O
Graph 5
a Graph 1 and graph 3
Graph 1 has a loop at B.
Graph 3 has loops at G and at H .
b Graph 1 and graph 4
Graph 1 has a multiple edge AB. Graph 4 has a multiple edge K L .
Key point 1.5 The degree of a vertex is the number of edges that end at that vertex.
Original material Š Cambridge University Press 2018
WORKED EXAMPLE 1.4
a Write down the degree of each vertex in the graphs used in Worked example 1.3. b Work out the sum of the vertex degrees for each graph. c Why is the sum of the vertex degrees equal to twice the number of edges? a A
B
C
D
E
F
G
H
Degree
3
5
2
2
2
2
4
4
Vertex
I
J
K
L
M
N
O
P
Degree
2
1
2
3
0
2
1
1
Each end of the loop contributes to the degree at B, G and H . M has degree 0.
= 3 + 5 + 2 = 10 = 2 + 2 + 2 = 6
M
b Graph 1 Graph 2 Graph 3 Graph 4 Graph 5
The degree of each vertex is the number of edges that end at that vertex.
PL E
Vertex
= 4 + 4 + 2 = 10 = 1 + 2 + 3 = 6
= 0 + 2 + 1 + 1 = 4
SA
c Each edge has two ends, each of which contributes towards a vertex degree.
Graphs 1 and 3 have 5 edges each, 5 × 2 = 10 Graphs 2 and 4 have 3 edges each, 3 × 2 = 6 Graph 5 has 2 edges, 2 × 2 =
4
The sum of the vertex degrees is the total number of edge ends, which is the same as twice the number of edges.
Key point 1.6 For any graph, the sum of the vertex degrees is twice the number of edges, which means that the sum of the vertex degrees is always even. An immediate consequence of this is that a graph cannot have an odd number of vertices with odd degrees.
Original material © Cambridge University Press 2018
WORKED EXAMPLE 1.5
A graph has 3 vertices and 6 edges.
a What is the sum of the degrees of the vertices? b Explain why the graph must have loops or multiple edges. c Draw three different graphs that fit this description. a
edges; sum is twice the number of edges.
6 Ă— 2 = 12
6
b If there are no loops or multiple edges, then the
PL E
maximum degree at each vertex is 2, giving degree sum = 6 . The degree sum is greater than 6, so there must be loops or multiple edges.
With no loops or multiple edges, the maximum degree sum is 6.
c For example:
M
The first graph shown has multiple edges; the second has multiple edges and a loop; the third is made up of two disconnected graphs and has multiple edges and loops.
Key point 1.7
A subgraph of a graph is formed by using some or all of the vertices of a graph
SA
together with some or all of the edges that connect these vertices. A subgraph is a graph contained within another graph. This could result in an unconnected vertex. However, subgraphs are usually connected.
Key point 1.8
Subdivision means inserting a vertex of degree 2 into an edge. Subdivision increases the number of vertices by 1 and the number of edges by 1.
WORKED EXAMPLE 1.6
Original material Š Cambridge University Press 2018
a Show that graph 2 is a subgraph of graph 1. b Explain how graph 3 is obtained from graph 1 by subdivision. a Remove the edge joining the two vertices of degree 3.
It is irrelevant that the edges cross. Graph 2 is the same as a square.
b Insert a vertex into one of the edges joining a vertex of degree 3 to a vertex of degree 2. This turns that edge into two edges joined by a vertex of degree 2.
PL E
Key point 1.9 A simple graph, on a given number of vertices, with the maximum possible number of edges is called a complete graph. Each vertex is connected by a single edge to each of the other vertices. Recall from Key point 1.4 that a simple graph has no loops or multiple edges. The complete graph with n vertices is denoted by K and has n
Common error
1
n (n − 1)
2
edges.
M
Be careful not to confuse complete graphs and connected graphs (see Key point 1.3).
WORKED EXAMPLE 1.7
Draw the complete graph K . 4
SA
For example:
You could also draw K without edges crossing, for example: 4
WORKED EXAMPLE 1.8
Explain why K has n
1 n (n − 1) 2
edges.
has n vertices, each of which is connected to the other n − 1 vertices.
Kn
Alternatively, there are n − 1 edges from the first vertex, another n − 2 edges from the second vertex, …
Original material © Cambridge University Press 2018
So each vertex has degree n − 1 .
This gives a total of 1 (n − 1) + (n − 2) + … + 3 + 2 + 1 =
The degree sum is n (n − 1) .
n (n − 1) 2
.
The degree sum is twice the number of edges. So the number of edges is 1 n (n − 1) 2
.
Key point 1.10
PL E
A bipartite graph is a simple graph that can be partitioned into two sets so that every edge joins a vertex from one of these sets to a vertex in the other set. No edge connects two vertices in the same set.
A simple bipartite graph, on a given number of vertices in each set, with the maximum
possible number of edges is called a complete bipartite graph. Each vertex in the first set is connected by a single edge to each vertex in the second set. The complete bipartite graph with m vertices in the first set and n vertices in the second set is denoted by K and has mn edges. m ,n
Did you know?
M
The classic ‘utilities problem’ where three houses need to each be connected to three
utilities – gas, water and electricity – without any of the connections crossing uses the complete bipartite graph K . 3, 3
SA
WORKED EXAMPLE 1.9
Draw the graph K
4, 2
.
For example:
The two sets are usually presented either as two horizontal rows or two vertical rows, so that the two sets can be identified easily. The vertices need not be labelled.
WORKED EXAMPLE 1.10
Explain why K Km , n
m , n
has mn edges.
has m vertices in the first set, each of
Alternatively, each of the m vertices in the first set has degree n, giving
Original material © Cambridge University Press 2018
which is connected to the n vertices in the second set.
degree sum mn, and each of the n vertices in the second set has degree m , giving degree sum mn .
So the first set consists of m vertices each with degree n, and the second set consists of n vertices each with degree m. There are mn arc endings in the first set and mn in the second set, so the number of edges is mn.
The total degree sum is mn + mn = 2mn . The degree sum is twice the number of edges. So the number of edges is mn.
It is useful to have a way of describing graphs, particularly large ones.
PL E
Key point 1.11 An adjacency matrix shows the number of edges that directly connect each pair of vertices. An adjacency matrix can also be used when there are no vertex labels given.
WORKED EXAMPLE 1.11
a Draw the graph represented by this adjacency matrix.
B C D E
B
0
1
1
1
⎜1 ⎜ ⎜ ⎜1 ⎜ ⎜1
0
1
0
1
0
0
0
0
0
1
0
0
⎛
⎝
C
D
E
0
⎞
1 ⎟ ⎟ ⎟ 0 ⎟ ⎟ 0 ⎟
M
A
A
0
0
⎠
b What is the significance of the row sums and the column sums of the adjacency matrix? c If a loop is drawn at vertex A, how would this be represented in the adjacency matrix? D
SA
a A
C
B
E
b The row sums are the same as the corresponding column sums. These give the vertex degrees.
A
B
C
D
E
sum
A
0
1
1
1
0
3
B
1
0
1
0
1
3
C
1
1
0
0
0
2
D
1
0
0
0
0
1
Original material © Cambridge University Press 2018
E
0
1
0
0
0
1
sum
3
3
2
1
1
10
A
B
C
D
E
sum
A
2
1
1
1
0
5
B
1
0
1
0
1
3
C
1
1
0
0
0
2
PL E
c A loop at vertex A contributes 2 to the degree of vertex A, so it is represented by an entry 2 in the adjacency matrix.
Tip
D
1
0
0
0
0
1
E
0
1
0
0
0
1
sum
5
3
2
1
1
12
M
An adjacency matrix is symmetrical about the lead diagonal (top left to bottom right).
WORKED EXAMPLE 1.12
SA
Construct the adjacency matrix for the graph with vertices A, B, C , D with edges between A and B, A and C , A and D , two edges between B and C , and a loop from D to itself.
A
B C
D
A
B
C
D
0
1
1
1
⎜1 ⎜ ⎜1
0
2
2
0
0⎟ ⎟ 0⎟
0
0
2
⎛
⎝
1
⎞
⎠
Each edge is shown by a 1 in the cell corresponding to the vertices at its ends, the repeated edge between B and C is shown by a 2 and the loop from D to itself is shown by a 2 (as in Worked example 1.11). Cells that correspond to vertices that are not directly connected are labelled with 0.
Key point 1.12
The complement of a simple graph is the set of edges that, when added to the graph, makes a complete graph. Every pair of vertices that are not directly connected in the original graph are joined by an edge in the complement; every pair of vertices that are joined by an edge in the original graph are not directly connected in the complement. The adjacency matrix for a simple graph consists of 0s and 1s. The adjacency matrix for the complement has a 1 where the matrix for the graph has a 0, and a 0 where the Original material © Cambridge University Press 2018
matrix for the graph has a 1, apart from the lead diagonal which consists of 0s in both adjacency matrices.
WORKED EXAMPLE 1.13
PL E
The graph represents six people. Edges connect people who have met one another.
Draw the complement of this graph and describe what the edges in the complement represent in this case. Original graph B
C
M
A
Complement
D
E
F
B
C
D
E
F
0
0
0
0
1
1
A
0
1
1
1
0
0
B
0
0
0
1
1
0
B
1
0
1
0
0
1
C
0
0
0
0
1
0
C
1
1
0
1
0
1
D
0
1
0
0
0
1
D
1
0
1
0
1
0
E
1
1
1
0
0
0
E
0
0
0
1
0
1
F
1
0
0
1
0
0
F
0
1
1
0
1
0
SA
A
The edges in the complement show people who have not met one another.
EXERCISE 1A 1
A
Is this graph simple? Explain your answer.
Original material Š Cambridge University Press 2018
Show that, for the graph in question 1, the sum of the degrees of the vertices is twice the number of edges.
3
A graph has 8 vertices and 6 edges. What is the sum of the degrees of the vertices?
4
How many edges does the complete graph on five vertices have?
5
A graph is drawn with vertices labelled 1, 2, 3, 4, 5 and 6. An edge is drawn between two vertices if the larger number is a multiple of the smaller. a Draw this graph.
PL E
2
b List a cycle in this graph.
M
c Write down a trail that starts at 5 and travels through every vertex in the graph once.
Explain why it is impossible to draw a graph with exactly five vertices that have degrees 1, 2, 3, 4 and 5.
7
A simple graph has six vertices. The degrees of the vertices are 2, 2, 3, 4, 4 and k.
SA
6
a Explain why k must be odd.
b What is the value of k if the graph has 8 edges? c What is the maximum possible number of edges that the graph could have?
8
Explain why there is no simple graph with exactly four vertices with degrees 1, 2, 3 and 4.
9
Write down a possible adjacency matrix for a connected graph with four vertices and three edges for which there is: a a vertex with degree 3 b no vertex with degree 3.
10
A graph has adjacency matrix:
Original material Š Cambridge University Press 2018
V W X Y Z
⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝
V
W
X
Y
Z
0
1
0
0
1
1
0
0
1
0
0
0
1
0
1
1
0
0⎟ ⎟ ⎟ 0⎟ ⎟ 0⎟
1
0
0
0
0
⎞
⎠
a How many edges does this graph have? b Show that the graph is a bipartite graph. An extra vertex, U , is created by subdivision of the edge XY .
11
PL E
c Show that the resulting graph is still bipartite. a How many edges are there in the complement of the complete bipartite graph K
2,5
?
b Describe what the edges in the complement represent. A bipartite graph is a subgraph of K
2, 5
. The subgraph is a connected graph with 7 vertices.
The subgraph has fewer edges than K
2,5
.
c How many edges does this subgraph have?
A connected graph has 6 vertices and 5 edges. Explain why the graph must be simple.
13
A medieval river crossing puzzle involves a farmer, a wolf, a goat and a sack of cabbages. Initially, the farmer, wolf, goat and sack of cabbages are together on the north bank of the
M
12
river. The farmer can use a small boat to cross the river. The boat is only big enough to carry
SA
the farmer and one of the other three items. The goat cannot be left with the cabbages or with the wolf, unless the farmer is also present. The wolf can be left alone with the cabbages. The problem is to find a way to get everything across to the other side of the river using as few crossings as possible.
The problem can be modelled using a graph in which the vertices are labelled to show what is on the north bank of the river at the beginning of each crossing. Initially, the farmer and all of the items are all on the north bank; this is the vertex FWGC. The first crossing must involve the farmer taking the goat across the river, so the second vertex is W C . The final crossing must involve the farmer taking the goat from the north bank to the south bank; this is the vertex F G.
a List the nine possible vertices, remembering that the goat cannot be left with the cabbages or with the wolf, unless the farmer is also present. b Draw a bipartite graph to represent the possible river crossings. c Find a solution to the problem.
Original material © Cambridge University Press 2018
Section 2: Properties of graphs Key point 1.13 A graph that is both simple and connected is called a simple-connected graph. A simple-connected graph with the minimum possible number of edges is called a tree. A tree on n vertices has n − 1 edges.
PL E
WORKED EXAMPLE 1.14
There are two different trees with 4 vertices.
a Draw the two different trees with 4 vertices. b List the set of vertex degrees for each tree. a
Any other tree on 4 vertices can be rearranged by moving the vertices around to make one of these graphs.
b
{1, 1, 2, 2}
and
The trees have different sets of vertex degrees so they must represent different graphs.
{1, 1, 1, 3}
M
These are the graphs from question 9 in Exercise 1A.
The vertices at the ends of the branches in a tree have degree 1. A tree on n vertices must have a minimum of 2 vertices of degree 1 and a maximum of n − 1 vertices of degree 1.
SA
Key point 1.14
A traversable graph is one that can be drawn as a trail without going over the same edge twice.
WORKED EXAMPLE 1.15
Which of these graphs are traversable? A
B
C
D
, B and D .
A
Original material © Cambridge University Press 2018
There is an easy way to check if a graph is traversable by using the degrees of the vertices.
Key point 1.15 An Eulerian graph is a connected graph that has no vertices of odd degree. Eulerian graphs are traversable, with the trail starting and finishing at the same vertex. A semi-Eulerian graph is a connected graph that has exactly 2 vertices of odd degree. Semi-Eulerian graphs are traversable, but the trail starts at one of the odd vertices and finishes at the other odd vertex.
WORKED EXAMPLE 1.16
PL E
It is easy to show that each time a trail enters and exits a vertex it uses up 2 edges, so for a graph to be traversable the degrees must all be even, apart from the start and finish which will have odd degree (or even if the trail finishes where it started). However, it is much more difficult to prove that every connected graph with 0 or exactly 2 vertices of odd degree is traversable.
A simple-connected graph has 4 vertices and 5 edges. The vertex degrees are 2, 3, x and y. a Show that the graph must be semi-Eulerian.
b Explain why the missing degrees must be 2 and 3.
a
M
Drawing an example of a graph that fits the description is not enough, because there might be more than one possibility.
2 + 3 + x + y = 10
so
x + y = 5
The sum of the degrees is even.
is odd
SA
x + y
The sum of the degrees is twice the number of edges.
One of the missing degrees is odd and the other is even.
The graph has exactly 2
odd degrees, so it must be semi-Eulerian.
Odd + even = odd Odd + odd or even + even = even Exactly 2 odd degrees ⇒ semi-Eulerian
b Simple-connected: x, y ∈ {1, 2, 3}
Connected: x, y
x + y = 5
so x
= 2, y = 3
⩾ 1
. Simple: x, y
or
.
x = 3, y = 2
Original material © Cambridge University Press 2018
.
⩽ 3
Key point 1.16 A Hamiltonian graph contains a cycle that passes through every vertex exactly once, apart from starting and finishing at the same vertex. The cycle is called a Hamiltonian cycle. There will usually be edges in the graph that are not used in the cycle.
Common error
WORKED EXAMPLE 1.17
PL E
Be careful not to confuse Hamiltonian graphs (which contain a closed trail that uses every vertex once) and Eulerian graphs (which contain a closed trail that uses every edge once).
In chess, a knight moves two squares horizontally followed by one square vertically or two squares vertically followed by one square horizontally.
M
A classic chessboard puzzle, known as the knight’s tour, asks whether a knight can visit every square of an 8 × 8 chessboard and whether this can be done with the knight finishing back where it started.
SA
The centre of each square on the chessboard is a vertex. The solution requires a Hamiltonian cycle made up of edges that are knight’s moves. There are several possible solutions.
WORKED EXAMPLE 1.18
Draw a Hamiltonian cycle on the edges of a cube. Each corner of the cube is a vertex. The solution requires a Hamiltonian cycle made up of edges of the cube. A possible solution is shown.
Original material © Cambridge University Press 2018
PL E
Did you know? Hamiltonian graphs are named after the Irish mathematician William Rowan Hamilton (1805–1865) who invented the icosian game, which is now known as Hamilton’s puzzle. This involves finding a Hamiltonian cycle, using the edge graph of a dodecahedron.
Try drawing a 2-dimensional skeleton graph of a dodecahedron and investigate this problem. Show that all Platonic solids, when considered as graphs, are Hamiltonian graphs.
EXERCISE 1B
M
Which of these graphs are trees?
SA
1
2
Which of the graphs in question 1 are semi-Eulerian?
3
Explain why a tree can never be Eulerian.
4
Is this graph Eulerian, semi-Eulerian or neither? Explain your reasoning.
5
a What is the sum of the vertex degrees for a tree on five vertices? Original material © Cambridge University Press 2018
b What is the minimum possible number of vertices of degree 1 for a tree on five vertices?
c What is the maximum possible vertex degree for a tree on 5 vertices? d List the possible sets of vertex degrees for trees on 5 vertices. 6
A simple, connected Eulerian graph has 5 vertices and 7 edges. Deduce the degrees of the vertices.
7
This question is about the seven graphs (A) K , (B) K , (C) K , (D) K and (G ) K . 3
4
5
2,3
, (E) K
2,4
, (F ) K
3,3
3,4
PL E
a How many edges does each of these graphs have? b Which of the six graphs are Eulerian? 8
a Give an example of a graph that is Hamiltonian but not Eulerian. b Give an example of a graph that is Eulerian but not Hamiltonian.
9 10
There are 6 different trees with 6 vertices. Draw an example of each and state its degrees.
a Are complete graphs Hamiltonian?
How many different trees on:
a
4
vertices
b
5
vertices
SA
11
M
b Are complete bipartite graphs Hamiltonian?
c
12
6
vertices can be made as subgraphs of K
3,3
?
A graph has 4 vertices. The vertex degrees are 1, 2, 3, 4.
a How many edges does the graph have? b Explain how the vertex degrees show that the graph is not simple-connected. c How many different graphs fit this description?
Original material © Cambridge University Press 2018
Section 3: Planarity and isomorphism Key point 1.17 A planar graph is any graph that can be drawn with no edges crossing. A planar graph can be drawn as one layer, without needing any ‘bridges’ where one edge jumps over another.
Common error
PL E
A planar graph need not actually be drawn with no edges crossing; all that matters is that it can be manipulated (topologically) into a graph with no edges crossing.
WORKED EXAMPLE 1.19
Give two reasons why it is useful to be able to draw a graph without having any edges crossing. It avoids ambiguity about whether there is a vertex where edges cross or if there is a ‘bridge’.
M
It avoids ‘contamination’ between edges, for example short-circuits in an electrical component. WORKED EXAMPLE 1.20
SA
A simple-connected planar graph is drawn on 6 vertices. The graph has the maximum possible number of edges. Draw a graph that fits this description. For example:
The maximum possible number of edges is 12. A complete graph with 6 vertices has 15 edges, but some of these cross. You should be able to convince yourself that 13 edges is impossible for a planar graph.
A convex polyhedron can be represented as a planar graph. The edges of the polyhedron are represented by the edges in the graph and the faces of the polyhedron are represented by regions (one of the faces is represented by the region that is ‘outside’ the graph). For example, this graph is a representation of a cube. Original material © Cambridge University Press 2018
WORKED EXAMPLE 1.21
A cube has 6 faces, 12 edges and 8 vertices.
ii
PL E
a Count the number of faces, edges and vertices for: i a tetrahedron (triangular-based pyramid) a square-based pyramid
iii an octahedron (eight triangular faces, like two square-based pyramids joined at their square bases) iv a hexagonal prism (a prism with hexagonal cross-section).
b Use your results from part a to conjecture a relationship between the numbers of faces, edges and vertices of a convex polyhedron. a
M
Faces Edges Vertices 6
12
8
i
4
6
4
ii
5
8
5
iii
8
12
6
iv
8
18
12
SA
Cube
b
faces − edges + vertices = 2
Or any equivalent expression.
Key point 1.18
Euler’s formula says that for any connected planar graph (or convex polyhedron) v − e + f = 2
where v is the number of vertices, e is the number of edges and f is the number of faces (or regions).
Original material © Cambridge University Press 2018
The regions of a graph are called faces and include the ‘outside’ region, which is sometimes called the infinite face.
WORKED EXAMPLE 1.22
PL E
a The graphs shown are all planar graphs. Show that Euler’s formula holds for each of these graphs.
b The graphs shown are non-planar graphs. Does Euler’s formula hold for either of these graphs?
Graph 4
Graph 5
Graph 1 has 3 ‘faces’, the two triangular regions and the infinite face.
M
a Graph 1 v = 4, e = 5, f = 3
v − e + f = 4 − 5 + 3 = 2
SA
Graph 2
v = 4, e = 4, f = 2
Graph 2 has 2 ‘faces’, the region enclosed by the edges and the ‘outside’ region (infinite face).
v − e + f = 4 − 4 + 2 = 2
Graph 3
v = 5, e = 6, f = 3
Graph 3 has 3 ‘faces’, the two enclosed by the edges and the infinite face.
v − e + f = 5 − 6 + 3 = 2
b Graph 4 No v
= 6, e = 10
If Euler’s formula holds then f = 6 , but there are more than 6 regions.
Graph 4 has 3 triangular ‘faces’, 5 faces enclosed by 4 edges and the infinite face. There are C = 20 ways of choosing 3 vertices to form a triangular face plus the infinite face. 6
3
Graph 5 No v = 6, e = 15
Original material © Cambridge University Press 2018
If Euler’s formula holds then f = 11, but there are more than 11 regions. Sometimes it is easy to see how a graph can be manipulated so that no edges cross, but at other times it can be difficult to know whether a graph is planar or non-planar.
Key point 1.19 Kuratowski’s theorem says that a necessary and sufficient condition for a finite graph to be planar is that it does not contain a subgraph that is a subdivision of K or K .
5
Rewind
PL E
3,3
Recall from Section 1 that subdivision means inserting a vertex of degree 2 into an edge. Subdivision increases the number of vertices by 1 and the number of edges by 1. The graphs K and K 5
3, 3
are minimum cases for non-planarity. If either of these is contained
M
within a graph, possibly after simplifying the graph by eliminating any vertices of degree 2, then the graph is also non-planar. WORKED EXAMPLE 1.23
SA
a Use Kuratowski’s theorem to show that this graph is planar.
b Describe how the graph in part a can be drawn with no edges crossing. An edge is added to the graph in part a connecting C to E. c Show that the resulting graph is non-planar. a Only A, B, D and F have degree ⩾ 4 , so K is not a subgraph. 5
Original material © Cambridge University Press 2018
If K is a subgraph, there must be five 5
vertices with degree 4 or more. Vertex G can be removed so that edges AG, GF become a single edge AF .
, GF is formed from AF by subdivision.
AG
This leaves a graph with six vertices:A, B, C , D, E and F . If K is a subgraph, these vertices can be split into two sets of three, where there is an edge joining each vertex in the first set to each vertex in the second set. 3, 3
PL E
There is no edge C E or C F so {C , E, F } would need to be taken together as a set, with {A, B, D} as the other set. But there is no edge AE so K is not a subgraph. 3, 3
Hence the graph is planar.
The graph does not contain a subgraph that is a subdivision of K or K . 5
3,3
b Move edge AC so that it passes outside of B (and does not cross other edges) and the edge DF so that it passes outside of E (and does not cross other edges).
M
c Edge C E is added and vertex G is removed so that edges AG , GF become a single edge AF . Vertices A, C , E and F each have degree 4. is now a subgraph, with the two sets as {A, B, E} and K {C , D, F } .
SA
3, 3
There are edges from each of A, B and E to each of C , D and F .
So the graph is non-planar.
Two graphs might look very different from one another but have the same structure, in the sense that they can be transformed into one another by relabelling and moving the vertices and edges around without cutting any of the edges.
Key point 1.20
Two graphs are isomorphic if they have the same structure.
Tip From the ancient Greek: isos = equal, morphe = form or shape.
Original material © Cambridge University Press 2018
Did you know? The study of these properties is part of the branch of Mathematics known as topology. Isomorphic graphs are topologically equivalent. You can show isomorphism by using a reasoned argument or by setting up a correspondence between the sets of vertices. WORKED EXAMPLE 1.24
PL E
Show that these graphs are isomorphic.
Straighten out edge W Z and relabel the vertices: W = A, X = B, Y = C , Z = D
Set up a correspondence between the sets of vertices.
M
WORKED EXAMPLE 1.25
SA
Show that these graphs are isomorphic.
Relabel
U = A, W = B, V = C , X = D, Y = E
and Z
Compare the vertex degrees to suggest a possible correspondence.
= F
Common error A necessary condition for two graphs to be isomorphic is that they have the same vertex degrees. However, this is not a sufficient condition, as two graphs can have the same degree but not be isomorphic.
Original material © Cambridge University Press 2018
WORKED EXAMPLE 1.26
Draw two non-isomorphic graphs that both have degrees 1, 1, 1, 1, 2, 2, 4 .
EXERCISE 1C
Which of these graphs are planar?
SA
M
1
PL E
These trees each have degrees 1, 1, 1, 1, 2, 2, 4 , but in the first the vertex of degree 4 is connected to two of degree 2 and two of degree 1, while in the second the vertex of degree 4 is connected to one of degree 2 and three of degree 1.
2
Which of these graphs are isomorphic? A
B
Original material © Cambridge University Press 2018
C
3
Use Euler’s formula for the planar graph K to find the number of regions.
4
Show that this graph is planar by drawing it after it has been manipulated so that no edges cross.
5
Show that these graphs are not isomorphic.
SA
M
PL E
4
6
Use Euler’s formula to find the number of regions in the planar graph described by this adjacency matrix. 0
1
0
1
0
1
⎜1 ⎜ ⎜0 ⎜ ⎜ ⎜1 ⎜ ⎜0
0
1
1
1
1
0
0
1
1
0
0
1
1
1
1
0
0⎟ ⎟ 1⎟ ⎟ ⎟ 1⎟ ⎟ 1⎟
0
1
1
1
0
⎛
⎝
7
1
⎞
⎠
A standard dice is modelled as a planar graph with vertices labelled 1, 2, 3, 4, 5 and 6. The faces of the dice are represented by the vertices of the graph and edges connect vertices that correspond to adjacent faces, but not vertices that correspond to opposite faces. Original material © Cambridge University Press 2018
Use Euler’s formula to find the number of regions in the graph. 8
This graph connects 6 vertices.
a Find three different subgraphs, each with 6 vertices and 5 edges. b Use the degrees of the vertices to show that the subgraphs are all different. Give a relabelling of the vertices that shows that these graphs are isomorphic.
A
B
PL E
9
a b
D
C
d
b
c
d
0
1
0
0
⎜1 ⎜ ⎜0
0
1
1
0
1⎟ ⎟ 1⎟
1
1
0
⎛
⎝
0
⎞
⎠
a Write the vertex degrees for the graph with this adjacency matrix.
M
10
c
a
A
B C
B
C
D
E
F
0
1
1
1
1
0
⎜1 ⎜ ⎜1 ⎜ ⎜ ⎜1 ⎜ ⎜1
0
1
0
0
1
0
1
1
0
1
0
0
⎛
E F
⎝
0
⎞
0
1
0
0
1⎟ ⎟ 1⎟ ⎟ ⎟ 1⎟ ⎟ 1⎟
1
1
1
1
0
SA
D
A
⎠
b Show that the graph is Hamiltonian. c Use Kuratowski’s theorem to show that the graph is non-planar.
11
The complete graph K is drawn on the vertices A, B, C , D, E but with the edge AD missing. 5
a Use Kuratowski’s theorem to show that the graph is planar. b Use Euler’s formula to find the number of regions in the graph. Regions are bounded by three edges that between them share three vertices. c How many ways are there to choose 3 vertices from 5, excluding any triples that include both A and D ? d Explain why the answers to parts b and c are different. Original material © Cambridge University Press 2018
Checklist of learning and understanding A vertex is shown as a point on a graph. Vertices are sometimes labelled, and sometimes not. An edge is a line or curve with a vertex at each end. A walk is a set of edges joined end to end, so the end vertex of one edge is the start vertex of the next.
PL E
A trail is a walk in which no edges are repeated. Vertices can be repeated in a trail, although often they are not.
A cycle is a trail that starts and finishes at the same vertex. Other than the start being the same as the finish, vertices are not repeated in a cycle.
Two vertices are directly connected, or adjacent, if there is an edge with these vertices at its ends. An indirect connection between two vertices passes through other vertices and involves more than one edge. A graph is connected if it is possible to get from any vertex to any other, directly or indirectly. An edge that directly connects a vertex to itself is called a loop.
M
A graph has a multiple edge if there is more than one edge that directly connects the same pair of vertices.
A graph with no loops and no multiple edges is called a simple graph. The degree of a vertex is the number of edges that end at that vertex.
SA
For any graph, the sum of the degrees of the vertices is twice the number of edges. An immediate consequence of this is that a graph cannot have an odd number of vertices with odd degrees.
A subgraph of a graph is formed by using some or all of the vertices of a graph together with some or all the edges that connect these vertices. A subgraph is a graph contained within another graph. This could result in an unconnected vertex. However, subgraphs are usually connected. Subdivision means inserting a vertex of degree 2 into an edge. Subdivision increases the number of vertices by 1 and the number of edges by 1. A simple graph, on a given number of vertices, with the maximum possible number of edges is called a complete graph. Each vertex is connected by a single edge to each of the other vertices. The complete graph with n vertices is denoted by K and has n
Original material Š Cambridge University Press 2018
1 n (n − 1) 2
edges.
A bipartite graph is a simple graph that can be partitioned into two sets so that every edge joins a vertex from one of these sets to a vertex in the other set. No edge connects two vertices in the same set. A simple bipartite graph, on a given number of vertices in each set, with the maximum possible number of edges is called a complete bipartite graph. Each vertex in the first set is connected by a single edge to each vertex in the second set. The complete bipartite graph with m vertices in the first set and n vertices in the second set is denoted by K and has mn edges. m ,n
An adjacency matrix shows the number of edges that directly connect each pair of vertices. An adjacency matrix can also be used when there are no vertex labels given.
PL E
The complement of a simple graph is the set of edges that, when added to the graph, make a complete graph.
Every pair of vertices that were not directly connected in the original graph are joined by an edge in the complement; every pair of vertices that were joined by an edge in the original graph are not directly connected in the complement.
The adjacency matrix for the graph consists of 0s and 1s. The complement has a 1 where the graph had a 0 and a 0 where the graph had a 1, except for the leading diagonal which is all 0s in both the graph and its complement. A graph that is both simple and connected is called a simple-connected graph.
A simple-connected graph with the minimum possible number of edges is called a tree.
M
A tree on n vertices has n − 1 edges.
A traversable graph is one that can be drawn as a trail, without going over the same edge twice.
An Eulerian graph is a connected graph that has no vertices of odd degree.
SA
Eulerian graphs are traversable, with the trail starting and finishing at the same vertex.
A semi-Eulerian graph is a connected graph that has exactly 2 vertices of odd degree. Semi-Eulerian graphs are traversable, but the trail starts at one of the odd vertices and finishes at the other odd vertex.
A Hamiltonian graph contains a cycle that passes through every vertex (exactly once, apart from starting and finishing at the same vertex). The cycle is called a Hamiltonian cycle. There will usually be edges in the graph that are not used in the cycle. A planar graph is any graph that can be drawn with no edges crossing. A planar graph can be drawn as one layer, without needing any ‘bridges’ where one edge jumps over another. Euler’s formula says that for any connected planar graph (or convex polyhedron) v − e + f = 2
Original material © Cambridge University Press 2018
where v is the number of vertices, e is the number of edges and f is the number of faces (or regions), including the infinite face. Kuratowski’s theorem says that a necessary and sufficient condition for a finite graph to be planar is that it does not contain a subgraph that is a subdivision of K or K . 5
3, 3
SA
M
PL E
Two graphs are isomorphic if they have the same structure.
Original material Š Cambridge University Press 2018
Mixed practice 1
2
A connected graph has five vertices with vertex degrees 2, 2, 3, 3, 4 . How many edges does the graph have? Choose from these options.
A
5
B
7
C
10
D
14
PL E
1
A simple-connected semi-Eulerian graph has six vertices. The degrees of five of the vertices are 1, 2, 3, 4 and 4. What could be the degree of the sixth vertex? Choose from these options. 6
B
5
C
4
D
3
A graph is drawn with vertices labelled 2, 4, 5, 7 and 8. Edges connect two vertices
M
3
A
if the sum of their labels is a multiple of 3.
a Draw this graph.
SA
b List all the cycles in this graph.
4
By considering the number of edges, show that all simple-connected graphs that connect four vertices using five edges are isomorphic.
5
Explain why a graph with four vertices, of which one vertex has degree 1 and the other three vertices have degree 3, is not simply connected.
6
A graph is described by the adjacency matrix
A B C D E F G
A
B
C
D
0
1
1
1
1
0
1
⎜1 ⎜ ⎜1 ⎜ ⎜ ⎜1 ⎜ ⎜ ⎜1 ⎜ ⎜0
0
0
0
1
0
0
0
1
1
0
0
1
0
1
1
1
1
1
0
1
0
0
1
1
0
0⎟ ⎟ 1⎟ ⎟ ⎟ 1⎟ ⎟ ⎟ 1⎟ ⎟ 0⎟
0
1
1
1
0
0
⎛
⎝
1
E
F
G ⎞
⎠
Original material © Cambridge University Press 2018
a Find a subset of the vertices that, together with the edges that directly connect them, form a subgraph that is K . 5
b What can you conclude from this about the original graph? Two of these graphs are isomorphic. 1 A B C D E
B
0
1
0
1
0
⎜1 ⎜ ⎜ ⎜0 ⎜ ⎜1
0
1
1
1
0
1
1
1
0
1 ⎟ ⎟ ⎟ 0 ⎟ ⎟ 0 ⎟
⎛
⎝
0
1
P
Q
0
1
⎜1 ⎜ ⎜ ⎜0
0
3 P Q R S T
⎛
⎜ ⎜0 ⎝
1
1 1 1
C
0
D
2
A
E
0
0
⎞
⎠
J K L M N
J
K
L
M
0
1
1
1
0
⎜1 ⎜ ⎜ ⎜1 ⎜ ⎜1
0
1
1
1
0
0
1
0
0
1 ⎟ ⎟ ⎟ 0 ⎟ ⎟ 1 ⎟
1
0
1
0
⎛
⎝
0
N ⎞
⎠
PL E
7
R
S
4
T
0
0
1
1
1
0
1
1 ⎟ ⎟ ⎟ 1 ⎟ ⎟ 0 ⎟
1 1
0 0
0
⎞
⎠
V
W X Y
Z
V
W
X
0
0
1
1
1
⎜0 ⎜ ⎜ ⎜1
0
0
1
0
0
1
1
1
0
1 ⎟ ⎟ ⎟ 0 ⎟ ⎟ 1 ⎟
1
0
1
0
⎛
⎜ ⎜1 ⎝
0
Y
Z
⎞
⎠
a Which two graphs are isomorphic?
b Show that the two graphs from your answer to part a are isomorphic.
A simple-connected Eulerian graph is drawn that has exactly nine vertices and 12 edges.
SA
8
M
c Show that each of the other two graphs are is isomorphic to any of the other graphs.
a Write down the minimum possible vertex degree. b What is the maximum number of vertices that can have this minimum degree? c What is the maximum number of vertices of degree 4 that the graph could have?
9
A three-dimensional noughts and crosses game is played using a 3 × 3 × 3 cube of cells. Label the cells (a, b, c), where a, b, c ∈ {1, 2, 3} represent the coordinates of the cell. A simple-connected graph is constructed in which the vertices represent the cells and edges join two cells if those cells are not in the same straight line of 3 cells.
a Which cells are directly connected to (1, 2, 3)? b Show that the graph is Eulerian. 10
A graph has exactly four vertices. The degrees of the vertices are 2, 2, 4 and x. Original material © Cambridge University Press 2018
a Explain why, if the graph is connected, it must be Eulerian. b Show that the graph need not be connected. c How many edges does the graph have? d What is the greatest value of x for which it is possible to draw a connected graph with the degree sequence 2, 2, 4, x with no loops. A graph has adjacency matrix:
A B C D E F G H
A
B
0
1
0
0
0
1
0
1
⎜1 ⎜ ⎜0 ⎜ ⎜ ⎜0 ⎜ ⎜0 ⎜ ⎜ ⎜1 ⎜ ⎜0
0
1
0
0
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
0 ⎟ ⎟ 1 ⎟ ⎟ ⎟ 0 ⎟ ⎟ 0 ⎟ ⎟ ⎟ 0 ⎟ ⎟ 1 ⎟
1
0
0
0
1
0
⎛
⎝
1
1 0 0 0 1 0
C
D
E
F
G
H ⎞
PL E
11
⎠
a Write a Hamiltonian cycle for this graph.
b Use Kuratowski’s theorem to show that the graph is non-planar.
M
A connected graph is semi-Eulerian if exactly two of its vertices are of odd degree.
a A graph is drawn with 4 vertices and 7 edges. What is the sum of the degrees of the vertices? b Draw a simple semi-Eulerian graph with exactly 5 vertices and 5 edges, in which exactly one of the vertices has degree 4.
SA
12
c Draw a simple semi-Eulerian graph with exactly 5 vertices that is also a tree. d A simple graph has 6 vertices. The graph has two vertices of degree 5. Explain why the graph can have no vertex of degree 1.
Original material © Cambridge University Press 2018
[© AQA 2016]
2Networks
PL E
In this chapter you will learn how to: use networks to model problems
use spanning trees to solve network optimisation problems solve route inspection problems
find and interpret upper and lower bounds for a travelling salesperson problem.
You should be able to
1
understand the terms cycle and tree.
SA
Chapter 1
M
Before you start‌
Original material Š Cambridge University Press 2018
a Find a cycle through every node in this graph. b Find a tree that connects every node in this graph.
Section 1: Network optimisation problems using spanning trees Key point 2.1 A network is a weighted graph. This means that each edge of the graph is assigned a numerical value (a weight) that is attached to it. The weights could, for example, represent distances, costs or travel times between points.
PL E
Key point 2.2 The vertices in a graph are called nodes in a network. The edges in a graph are called arcs in a network.
Rewind
You learned about vertices and edges of graphs in Chapter 1.
Key point 2.3
M
The arcs in a network can be undirected or they can be directed (like one-way streets).
SA
A simple network (with no multiple arcs or loops) can be represented as a weighted matrix, showing the weight of each arc and a blank, − or ∞ when no arc exists. The weighted matrix can be called a distance matrix, cost matrix, time matrix, according to what the weights represent.
Fast forward
You will use directed networks in Chapter 3 when you look at network flows. The weight of an arc will represent its maximum capacity.
WORKED EXAMPLE 2.1
A simple network is shown. The nodes in the network represent towns and the weights on the arcs represent travel costs in £10 units.
Original material © Cambridge University Press 2018
Represent the network as a weighted matrix (cost matrix). In this network the arcs are undirected.
A B C D E F G H
B C D E F G H
⎛
− 5
⎜5 ⎜ ⎜8 ⎜ ⎜ ⎜− ⎜ ⎜− ⎜ ⎜ ⎜− ⎜ ⎜− ⎝
8
− 6
− − − − − 3
⎞
9
− − − ⎟ ⎟ 6 − − 2 5 − − ⎟ ⎟ ⎟ 3 − − 6 − 9 − ⎟ ⎟ 9 2 6 − 2 2 1 ⎟ ⎟ ⎟ − 5 − 2 − 6 8 ⎟ ⎟ − − 9 2 6 − 3 ⎟
− − − − 1
8
Tip
3
−
With a directed network the usual convention is that the arcs are from the nodes on the rows to the nodes on the columns.
PL E
A
⎠
Often you will present a weighted matrix as a table and omit the brackets around the matrix.
The weights will usually be non-negative but need not be integers, unless this is given in the question.
M
Key point 2.4
A spanning tree is a tree that connects all the nodes in a network.
SA
A least weight tree connecting all the nodes of a network is a minimum spanning tree or minimum connector. The total weight of a tree is the sum of the arc weights used in the tree.
If, for example, the arc weights are the costs of laying cables between the points, the minimum spanning tree represents the cheapest way to join the places by cables, so that all of the places are connected, directly or indirectly.
Common error
There are various strategies for finding minimum spanning trees. You should always show your working. It is important that you draw the tree, or that you list the arcs in the tree, and also that you give the total weight. One way to find a minimum spanning tree is to use Kruskal’s algorithm.
Original material © Cambridge University Press 2018
Key point 2.5 Kruskal’s algorithm: Start to list the arcs in increasing order of weight. Step 1: Add an arc of minimum weight in such a way that no cycles are created. Step 2: If a spanning tree is obtained stop; otherwise return to Step 1.
Tip
WORKED EXAMPLE 2.2
PL E
Kruskal’s algorithm starts with the least weight arc and works through the arcs in increasing order of weight. It builds a collection of little trees that are eventually combined to make a single spanning tree.
M
Use Kruskal’s algorithm to find a minimum spanning tree for this network.
EH = 1
SA
CE = 2 EF = 2
Start by listing the arcs in order of increasing weight. Where there are arcs with the same weight they can appear in any order. It is not usually necessary to write out the whole list, but every vertex must be in the list.
EG = 2
BD = 3
GH = 3 AB = 5
…
✔
EH = 1
✔
C E = 2
Use Step 1 repeatedly to add arcs to the network (working down the list). Each time check that no cycles are created. Original material © Cambridge University Press 2018
Add EH . Add C E . Add EF .
✔
EF = 2
✔
EG = 2
✔
BD = 3
Add EG . Add BD .
GH = 3 AB = 5
PL E
…
At this point the next arc in the list is GH but this would create a cycle E– G– H – E.
✔
EH = 1
✔
C E = 2
Add AB . Although every node is now included the two parts are not connected so a spanning tree is not yet formed.
✔
EF = 2
✔
EG = 2
✔
BD = 3
GH = 3
✔
M
AB = 5
SA
Continue until a spanning tree is formed.
Total weight =
21
Delete all remaining arcs and add the weights of the arcs that have been used to find the total weight of the spanning tree. You should show all the working on one diagram. The ticks and crossing out on the list are evidence that you have used the algorithm correctly.
WORKED EXAMPLE 2.3
Find a different minimum spanning tree for the network in Worked example 2.2.
Use DE instead of BC .
Total weight =
21
Original material © Cambridge University Press 2018
A second way to find a minimum spanning tree is to use Prim’s algorithm.
Key point 2.6 Prim’s algorithm: Start with any node (this will usually be given in the question). Step 1: Add an arc of minimum weight joining a node already included to a node not already included.
Tip
PL E
Step 2: If a spanning tree is obtained stop; otherwise return to Step 1.
Prim’s algorithm builds a tree by growing out from the starting node until every node is included.
WORKED EXAMPLE 2.4
SA
M
Use Prim’s algorithm, starting at A, to find a minimum spanning tree for this network.
AB = 5
BD = 3 BC = 6
Choose AB
= 5
, the least weight arc from {A} to {B, C , D, E, F , G, H }.
Choose BD
= 3
, the least weight arc from {A, B} to {C , D, E, F , G, H }. Choose BC = 6 (or DE = 6), a least weight arc from {A, B, D} to {C , E, F , G, H }.
Note that the arc can start at any of the nodes already included. AB = 5 BD = 3 BC = 6 CE = 2
Continue in this way until a spanning tree is obtained. Add the weights of the arcs that have been used to find the total weight of the spanning tree. The working should all be shown on one diagram. The list is evidence that you have used the algorithm correctly.
Original material © Cambridge University Press 2018
EH = 1 EF = 2 EG = 2
Total weight =
21
PL E
Tip There might be more than one minimum spanning tree. The choice of the starting node and the order in which arcs of equal weight are chosen might give different trees.
If a computer is being used to solve a problem, the network is likely to have been given as a distance table, rather than drawn as a diagram. Prim’s algorithm is easily converted into a form that is suitable for use of a distance network. This is called Prim’s algorithm in tabular form.
Key point 2.7
Prim’s algorithm in tabular form:
M
Start with the table (or matrix) of weights for a connected graph.
Step 1: Cross through the entries in an arbitrary row and mark the corresponding column. Step 2: Choose a minimum entry from the uncircled entries in the marked column(s).
SA
Step 3: If no such entry exists Stop, otherwise go to Step 4. Step 4: Circle the weight w found in Step 2, mark column i and cross through row i. ij
Step 5: Return to Step 2.
Tip
Step 1: Columns that are marked correspond to nodes that are in the tree. Entries in rows that are crossed out cannot be chosen, so an arc cannot connect two nodes within the tree. Step 4: Circled entries correspond to arcs that are in the tree. w is the entry on row i ij
and column j.
Original material © Cambridge University Press 2018
WORKED EXAMPLE 2.5
Use Prim’s algorithm, starting at A, to find a minimum spanning tree for the network described by this distance matrix.
B
C
D
E
F
G
H
A
–
5
8
–
–
–
–
–
B
5
–
6
3
9
–
–
–
C
8
6
–
D
–
3
–
E
–
9
2
F
–
–
5
G
–
–
–
H
–
–
–
2
5
–
–
–
6
–
9
–
6
–
2
2
1
–
2
–
6
8
9
2
6
–
3
–
1
8
3
–
M
–
↓
↓
A
B
C
D
E
F
G
H
-
5
8
-
-
-
-
-
SA
A
PL E
A
B
5
-
6
3
9
-
-
-
C
8
6
-
-
2
5
-
-
D
-
3
-
-
6
-
9
-
Step 4: Record this by circling the entry (and recording in a list at the side). This entry is . w Mark column 2 and cross through (remainder of) row 2. arcs AB 21
E
-
9
2
6
-
2
2
1
F
-
-
5
-
2
-
6
8
G
-
-
-
9
2
6
-
3
H
-
-
-
-
1
8
3
-
↓
↓
↓
Step 1: Cross through row A and mark column A. Step 2: Choose AB = 5, the least weight arc, not crossed out, from column A.
Step 2: Choose BD = 3, the least weight arc, not crossed out or circled, from columns A, B. Step 4: Record this by circling the entry (and
Original material © Cambridge University Press 2018
A
B
C
D
E
F
G
recording in a list at the side). This entry is . w Mark column 4 and cross through (remainder of) row 4. Step 2: Choose BC = 6. arcs AB
H
42
-
5
8
-
-
-
-
-
B
5
-
6
3
9
-
-
-
C
8
6
-
-
2
5
-
-
D
-
3
-
-
6
-
9
-
E
-
9
2
6
-
2
2
1
F
-
-
5
-
2
-
6
8
G
-
-
-
9
2
H
-
-
-
-
1
↓
↓
↓
↓
A
B
C
D
E
A
-
5
8
-
-
B
5
-
6
3
9
C
8
6
D
-
3
BD
PL E
A
6
-
3
8
3
-
↓
↓
F
G
H
-
-
-
-
-
-
↓
Continue in this way until there are no entries that are not circled or crossed out in any of the marked columns. Add the circled values to find the total weight of the spanning tree.
M
↓
-
-
2
5
-
-
-
-
6
-
9
-
arcs AB BD BC
-
9
2
6
-
2
2
SA
E
F
-
-
5
-
2
-
6
1
EH 8 EF
G
-
-
-
9
2
6
-
3
H
-
-
-
-
1
8
3
-
Total weight =
CE
EG
21
Minimum spanning trees are useful in solving a variety of network optimisation problems. Later in this chapter, you will use minimum spanning trees to find bounds on the solution of the travelling salesperson problem.
Original material © Cambridge University Press 2018
WORKED EXAMPLE 2.6
The distance matrix shown represents the lengths, in km, of gas pipelines that could be used to connect villages A, B, C , D , and E. Currently, the main gas supply only reaches as far as village A and it is required to connect the other villages to the main supply. B
C
D
E
A
−
5
2
7
4
B
5
−
6
−
7
C
2
6
−
D
7
−
7
E
4
7
6
PL E
A
7
6
−
3
3
−
a What total length of pipeline is needed if each of B, C , D and E needs to be directly connected to A?
b What total length of pipeline is needed if B, C , D and E can be connected to A via other villages (indirectly connected to A)? 18 km
b
14 km
BA + C A + DA + EA = 5 + 2 + 7 + 4 = 18
M
a
Use arcs in minimum spanning tree.
SA
WORK IT OUT 2.1
Find a minimum spanning tree for the network described by the distance matrix shown.
A
B
C
D
A
−
6
5
5
B
6
−
4
1
C
5
4
−
3
D
5
1
3
−
Which is the correct solution? Identify the errors made in the incorrect solutions. Solution 1
Original material © Cambridge University Press 2018
The three shortest arcs are BD
= 1, C D = 3
and BC
.
= 4
Solution 2 BD = 1 CD = 3 BC = 4 AC = 5
1 + 3 + 5 = 9
BD = 1 CD = 3 BC = 4
M
AC = 5
PL E
Solution 3
EXERCISE 2A
How many arcs are there in a minimum spanning tree for a network with n nodes? Choose from these options.
SA
1
A
n − 1
B
n
C
2n
D
2
1
n (n − 1)
2
Find the weight of a minimum spanning tree on this network.
Original material © Cambridge University Press 2018
10 11
9
8
14 How many different spanning trees are there on the network in question 2?
4
Find the total weight of a minimum spanning tree for the network described by this weighted matrix. Q
R
P
−
6
8
Q
6
−
5
R
8
5
−
S
5
3
7
T
10
7
8
U
5
S
T
U
5
10
6
3
7
7
7
8
9
−
9
−
9
−
8
M
P
PL E
3
6
7
9
−
8
−
For the network in question 4, suppose that a direct connection is made between S and U .
SA
What is the greatest weight that this arc can have if it can be used in a minimum spanning tree?
6
A minimum spanning tree on a certain network uses the arc with the greatest weight. What can be deduced about the network?
7
Five buildings on a university campus are connected by footpaths. It has been suggested that shelters should be installed along some of the footpaths. Only footpaths with shelters can be used when it is raining. In this table, the nodes represent the buildings and the arcs represent the footpaths. The weight of each arc is the cost (in units of £1000) of installing the shelters on the footpath represented by that arc.
V
V
W
X
Y
Z
−
2
−
4
−
Original material © Cambridge University Press 2018
W
2
−
5
6
3
X
−
5
−
5
4
Y
4
6
5
−
−
Z
−
3
4
−
−
The university want to minimise the money spent on installing shelters.
a Which footpaths should have shelters installed for it to be possible to travel between any of the buildings when it is raining?
PL E
b If an additional £5000 can be spent on the shelters, which footpath should it be spent on? Explain your choice. 8
Give an example of a network on A, B and C in which AB has the minimum weight but there is a minimum spanning tree that does not use AB .
9
Following a heavy snowstorm a snowplough is used to clear the snow from some of the
roads between five houses. In a weighted network the houses are represented as nodes and the roads are represented as arcs. The weight of each arc is the time taken (in minutes) to clear the snow from that road.
A
B
C
D
E
−
15
33
28
−
15
−
12
−
40
33
12
−
45
−
SA
C
B
M
A
D
28
−
45
−
68
E
−
40
−
68
−
a Find the minimum time needed to clear a route to each house, given that the time needed to drive the snowplough along any road that has already been cleared of snow can be ignored. b Find the minimum time needed to clear a route to each house, given that instead, the time needed to drive the snowplough along a road that has already been cleared of snow is exactly half the time needed to clear the snow from that road.
10 Why is it not possible to have directed arcs in a minimum spanning tree?
Original material © Cambridge University Press 2018
Section 2: Route inspection problems Key point 2.8 A route is like a cycle or closed trail except that edges can be repeated.
Rewind You found cycles and trails in Chapter 1.
PL E
Key point 2.9 A route inspection problem involves finding a least weight route that uses every arc of a network.
The problem was originally studied by the Chinese mathematician Kwan Mei-Ko in 1960, and is also known as the Chinese postman problem.
Key point 2.10
Any network formed by weighting an Eulerian graph can be traversed without having to repeat any arcs.
M
Otherwise, arcs need to be doubled up, in the way that uses the least weight possible, so that the graph that was weighted to form the network becomes Eulerian.
WORKED EXAMPLE 2.7
SA
Solve the Chinese postman (route inspection) problem for this network.
The odddegree nodes
The solution needs all nodes of even degree.
are D and H . The least weight path connecting D to H is
In this case there is just one pair of odd nodes so this is the minimum total weight to be added to make all nodes of even degree.
D − E − H = 7
75 + 7 = 82
Total weight of original graph =
75
. This would often be given in the question.
Original material © Cambridge University Press 2018
The minimum weight is 82. The route uses each arc once and uses DE and EH a second time, giving D degree 4, H degree 4 and E degree 8.
For example: A − B − D − G − H − F − C − B − E − D − E − G − F − E − H − E − C − A − −−−−− −−− − −−−−−−−−
There is no need to write out a route unless it is asked for.
Common error Shortest routes between odd nodes are usually found by inspection. Do not assume that a direct
PL E
route is the shortest route – an indirect route could be shorter.
WORKED EXAMPLE 2.8
a Find the weight of the least weight tour that uses every arc in the network shown. The sum of the weights in the network is 93.
i
C
ii
D
iii
F
M
b Given that the tour starts and ends at A, find how many times it passes through
SA
a The odd-degree nodes are A, B, D and F . AB =
13
DF =
AD =
=
15
14 BF =
20 BD =
6
27
39
93 + 21 = 114
b
i. 2
ii
2
iii 2
19
AF
21
Four odd nodes so means that there are three pairs of least weight paths (each containing all four odd nodes). Note that the least weight path need not be the direct arc between two nodes. Least weight pairing is AF
.
+ BD = 21
has degree 4 so it is passed through twice (in twice and out twice).
C
has degree 3 but BD is repeated, effectively making the degree 4.
D
Similarly for F .
Common error In Worked example 2.8, you should show that you have considered all the ways of joining the odd nodes in pairs (for example, AB + DF , AD + BF and AF + BD) and not just write down the shortest such pairing.
Original material © Cambridge University Press 2018
Key point 2.11 The standard Chinese postman problem starts and finishes at the same node. Sometimes a question will indicate that the route need not start and end at the same node. In this case, a semiEulerian network is needed, where the route will start at one odd-degree node and finish at another.
WORKED EXAMPLE 2.9
a Solve the problem in Worked example 2.8, but allowing the route to start and end at different nodes.
ii
D
iii
F
.
PL E
b Find how many times the route passes through i C
a The odd-degree nodes are A, B, D
and F .
One pair can remain odd, so you just need to find the shortest pairing of the other pair.
AB = 13, AD = 19, AF = 15 DF = 14, BF = 20, BD = 6
93 + 6 = 99 2
ii
2
iii
1
The route either starts or ends at F and also passes through F once.
M
b i
Route starts and ends at A and F , repeating BD .
SA
EXERCISE 2B 1
2
Classify each graph as Eulerian, semi-Eulerian or neither. A
B
C
D
The distance matrix for a network is shown.
Original material Š Cambridge University Press 2018
Which are the odd-degree nodes? A
B
C
D
E
A
−
3
12
−
10
B
3
−
4
7
17
C
12
4
−
13
−
D
−
7
13
−
−
E
10
17
−
−
−
What is the least weight path connecting the odd nodes in the network in question 2?
4
Explain why the solution to the Chinese postman problem for the network in question 2 has total weight 73.
5
A groundsworker wants to use a line-painting machine to mark out a design on a pitch. The machine is faulty so once it has been switched off it cannot be switched on again. This means that some lines will be painted twice.
SA
M
The design is shown.
PL E
3
The small circle has radius 1 metre. It passes through the centre of the larger circle and touches the larger circle. The straight lines are diameters of the larger circle. Each metre uses 0.1 litres of paint.
a What is the minimum amount of paint that the groundsman needs? b Why, when the groundsman is pushing the machine, would he need to walk further than the distance travelled by the machine? c What else do you need to know to be able to calculate the minimum distance that the groundsman travels when marking out the lines?
6
The least weight route that uses every arc at least once is required for this network.
Original material © Cambridge University Press 2018
When the Chinese postman algorithm is used, one group of odd nodes is {AB, C E, F G}. a How many groups of odd nodes are there altogether? b Explain why the total weight of the shortest paths for any group of odd nodes that includes BF = 20 must be greater than 30 . c List the weights and total weight for each group of odd nodes that includes GF . d Explain why GF must be included in the group with least total weight.
PL E
A closed route is constructed that uses every edge once and repeats the shortest routes between A and B, C and E, F and G . e How many times does this route pass through D ? 7
For the network in question 6, which arcs would be repeated in a route that covers every arc but starts and ends at different nodes?
8
The total length of the arcs in a network is 220 metres. The degrees of the nodes are: A
B
C
D
E
F
G
M
Node Degree
2
4
6
3
5
3
5
H
I
J
5
2
3
The lengths, in metres, of the shortest paths between the odd nodes are: DE = 20, DF = 24, DG = 26, DH = 21, DJ = 19, EF = 16,
SA
EG = 34, EH = 14, EJ = 20, F G = 18, F H = 27, F J = 30, GH = 25, GJ = 23, H J = 29.
The shortest route that starts at D and uses every route is required. a Where does the route end?
b Use the Chinese postman algorithm to find the length of the route.
9
The Chinese postman algorithm is to be used on a network with eight odd nodes. a Show that, unless any additional information is given, 105 groups of odd nodes would need to be considered.
b Show that the lengths of 28 shortest paths would need to be calculated. If it takes 2 seconds to calculate each shortest path and 3 seconds to find the total weight of each group of odd nodes, the time taken for a network with eight odd nodes will be over 6 minutes. c Calculate the corresponding time for a network with ten odd-degree nodes.
Original material © Cambridge University Press 2018
Did you know? Find out about the Königsberg Bridges problem. This problem was solved by the Swiss mathematician Leonhard Euler (1707–1783). The town of Königsberg, which was in Prussia but is now in Russia and is called Kaliningrad, had seven bridges connecting the two sides of the River Pregel to two islands in the river. Euler proved that it was impossible to walk a route that used every bridge once without repeating any bridges. Use your knowledge of the Chinese postman
SA
M
PL E
(route inspection) problem to understand Euler’s method.
Original material © Cambridge University Press 2018
Section 3: Travelling salesperson problem Key point 2.12 The travelling salesperson problem (TSP) involves finding a least weight cycle through all the nodes of an undirected graph (the least weight Hamiltonian cycle).
Rewind
PL E
You learnt how to identify Hamiltonian graphs in Chapter 1.
Did you know?
The travelling salesperson problem is one of the most widely studied problems in computational mathematics but no efficient strategy is known for the general case. Determining whether or not an efficient strategy exists (one that is better than an exhaustive check of every possibility) is equivalent to the ‘P versus NP’ problem, for which the Clay Mathematics Institute has offered a one million dollar prize.
Although there is no general strategy to solve the travelling salesperson problem, it is easy to find upper and lower bounds for the minimum weight.
M
Any Hamiltonian cycle will provide an upper bound for the problem. A problem might suggest a suitable cycle. If not, you can try the nearest neighbour algorithm.
Key point 2.13
SA
The nearest neighbour algorithm involves starting at some node and travelling the least weight arc from this node to another node. From each node that is reached the least weight arc from this node to a node that has not yet been visited is chosen. This process is repeated until every node has been visited. If there is an arc that directly connects the final node to the start node, then this arc can be used to close the cycle.
WORKED EXAMPLE 2.10
Apply the nearest neighbour algorithm, starting at A, to the network represented by this distance matrix.
A
B
C
D
E
A
–
3
12
12
10
B
3
–
4
7
17
Original material © Cambridge University Press 2018
C
12
4
–
13
8
D
12
7
13
–
10
E
10
17
8
10
–
SA
M
PL E
Starting from A the nearest adjacent vertex is B. You do not want to revisit a vertex, until all vertices have been used.
A
B
C
D
E
A
–
3
12
12
10
B
3
–
4
7
17
C
14
4
–
13
8
D
12
7
13
–
10
E
10
17
8
10
–
A − B − C − E − D − 3
+ 4
+ 8
+ 1
0
From B move to C . From C to E and from E to D . Then return from D to A.
Each row has one circled entry and each column has one circled entry.
A
+ 12 = 37
Original material © Cambridge University Press 2018
Common error The nearest neighbour algorithm is similar to the construction of a minimum spanning tree in that both require you to find the least weight arc from a node that has been included to a node that has not yet been included. The difference is that, for a minimum spanning tree, every node that has been visited is considered whereas, for nearest neighbour, only the most recent node is considered. If the network is not based on a complete graph, the nearest neighbour algorithm might ‘stall’. This
WORKED EXAMPLE 2.11
PL E
means that a node is reached for which all the adjacent nodes have already been visited. This means that the path stops before a Hamiltonian cycle has been achieved.
Find the weight of the cycle ACFHGEDBA for this network.
8
5
This is a cycle through every node, so the least weight Hamiltonian cycle has weight at most 40.
M
A −C − F − H −G −E −D −B−A 8
3
2
6
3
5
= 40
TSP ⩽ 40
SA
WORKED EXAMPLE 2.12
Apply the nearest neighbour algorithm to the network in Worked example 2.11, starting at A, C and F in turn.
Starting from A:
A −B − D−E −H −G− F −C −A 5
3
6
1
3
6
5
8
= 37
Starting from C :
The route stalls at F because C , E, G and H have already been visited, but nodes A, B and D have not yet been visited.
C − E − H − G − F − stall 2
1
3
When using the nearest neighbour algorithm, the next arc is chosen from the current node to a node that has not been visited. At G the least weight arc is GE , but E has already been visited.
6
Starting from F : F −E − H −G −D−B− A −C −F 2
1
3
9
3
5
8
5
= 36
Original material © Cambridge University Press 2018
If you had used the nearest neighbour from B in Worked example 2.12, it would have given the same cycle as from A, but starting B − D − …. Starting from D, E, G or H would have led to a stall. Both cycles found by using the nearest neighbour algorithm in Worked example 2.12 are Hamiltonian cycles so the least weight cycle has total weight ⩽ 37 and also ⩽ 36. Since 36 is smaller than 37 this is the better upper bound.
Key point 2.14
Tip
PL E
The best upper bound is the smallest of the upper bounds that have been found (the least upper bound).
Sometimes you can use shortcuts or switches to improve an upper bound. For example, you could improve the solution from Worked example 2.11 by changing F − H = 8 to F − E − H = 3
and then travelling G − D
= 9
instead of G − E − D
= 8
.
M
The context might permit nodes to be repeated (the salesman travels through a town that he has already visited). In this case, it is better to travel G − E − D instead of G − D, even if E has already been visited.
Key point 2.15
A tour is a closed route through every node that might pass through nodes more than
SA
once.
It is useful to try to give a lower bound for the travelling salesperson problem as well as an upper bound. If the lower bound and the upper bound are equal, then this is the weight of the solution to the travelling salesperson problem and the route that gave the upper bound is an optimal tour. If the lower bound and the upper bound are close to one another, then the route that gave the upper bound is either an optimal tour or is a very good tour.
Key point 2.16
For a network based on a complete graph, a lower bound can be found by removing a node and all the arcs from that node and then constructing a minimum spanning tree for the remaining nodes. The weight of the minimum connector is then added, that is, the two least weight arcs that will reconnect the node to the minimum spanning tree. An optimal tour uses two arcs to any given node, the total weight of these is less than or equal to the sum of the weights of the two least weight arcs from the given node. The remainder of the Original material © Cambridge University Press 2018
optimal tour is a ‘string’ connecting the other vertices. This must be at least as long as the minimum spanning tree for these vertices. If the graph is not based on a complete network, then the method could fail to give a lower bound. WORKED EXAMPLE 2.13
Show what happens when the method from Key point 2.16 is applied to the network shown when the node that is removed is:
a
A
b
E
PL E
.
M
a Reduced network with A deleted.
Delete A and arcs that are directly connected to A (arcs that are incident on A).
Minimum spanning tree:
BD, BC , (or DE) , C E, EH , EF , EG 16
.
SA
Total weight =
Two least weight arcs from A: AB + AC = 5 + 8 = 13
Lower bound =
Note that two different arcs are used.
.
16 + 13 = 29
b Reduced network with E deleted.
From the original graph, delete E and arcs that are directly connected to E.
Minimum spanning tree: AB, BD, BC , C F , F G, GH
Total weight =
28
. Original material © Cambridge University Press 2018
Two least weight arcs from E: or EF or EG)
EH + EC (
Lower bound =
= 1 + 2 = 3
28 + 3 = 31
.
Key point 2.17 The largest of the lower bounds that have been found (greatest lower bound) is the best of the lower bounds. For the problem in Worked examples 2.11, 2.12 and 2.13, 31
EXERCISE 2C 1
A, B, C
− F
weight of TSP
⩽ 36
.
of weight 36 is a good solution. It might or
PL E
So the tour F − E − H − G − D − B − A − C might not be the optimal tour.
⩽
and D are connected by weighted arcs
.
AB = 5, AC = 6, AD = 12, BC = 7, BD = 8, C D = 15
Use the nearest neighbour algorithm starting from A. Give the weight of the resulting tour.
When the nearest neighbour algorithm is used on the network in question 1, the arc C D is included, whichever node is used as the start. What is the length of a tour that does not use
M
2
the arc C D?
A network has four nodes, A, B, C , D with each node connected to each of the others. Ignoring the direction of travel, how many different cycles are there?
SA
3
4
a Find the lower bound for the travelling salesperson problem for the network described by the shown distance matrix by deleting each of the nodes in turn. b Give the total weight of the best of these lower bounds. A
B
C
D
E
F
A
−
6
8
5
10
6
B
6
−
5
3
7
7
C
8
5
−
7
8
9
D
5
3
7
−
9
−
E
10
7
8
9
−
8
Original material © Cambridge University Press 2018
F
5
6
7
9
−
8
−
a Find the upper bound for the travelling salesperson problem for the network in question 4 by using the nearest neighbour algorithm, starting from each of the nodes in turn. b Give the total weight of the best of these upper bounds. a What is the total weight of the least weight Hamiltonian cycle for this network?
PL E
6
b What is the total weight of the least weight closed tour if nodes can be repeated? An additional arc of weight 2 is added, connecting A to C .
c What is the total weight of the least weight Hamiltonian cycle?
d What is the total weight of the least weight closed tour if nodes can be repeated?
Five buildings on a university campus are connected by footpaths. It has been suggested that street lights should be installed along some of the footpaths.
M
The cost (in £100) of installing the street lights on each footpath is shown in the table. The nodes represent the buildings and the arcs the footpaths. V
W
X
Y
Z
−
5
6
4
2
5
−
7
5
6
X
6
7
−
9
4
Y
4
5
9
−
8
Z
2
6
4
8
−
V
W
SA
7
A security guard wants to be able to walk a circuit using only paths with street lights, starting and ending at V and passing through each of W , X, Y and Z once. The university want to minimise the money spent on installing street lights. a Find a minimum spanning tree for the reduced network formed when all arcs directly joined to V are removed. Hence find a lower bound for the cost for the university. b Use the nearest neighbour algorithm to find an upper bound for the cost to the university.
Original material © Cambridge University Press 2018
c Give a reason why the cost might be greater than the upper bound. 8
A reduced network is formed by removing a certain node from a graph. The resulting lower bound for the travelling salesperson problem for the original graph has the same total weight as the best upper bound. What can you deduce about the minimum spanning tree for the reduced network? A graph consists of a weighted tree. a Explain why it is not possible to construct a cycle that passes through every node exactly once.
PL E
A closed route is constructed that passes through every node, sometimes more than once. b What is the weight of the closed route?
Checklist of learning and understanding
A network is a weighted graph. This means that each edge of the graph is assigned a numerical value (a weight) attached to it.
M
The weights could, for example, represent distances, costs or travel times between points. The vertices in a graph are called nodes in a network. The edges in a graph are called arcs in a network. The arcs in a network can be undirected or can be directed (like one-way streets). A simple network (with no multiple arcs or loops) can be represented using a weighted matrix, showing the weight of each arc and a blank, − or ∞ when no arc exists.
SA
9
A spanning tree is a tree that connects all the nodes in a network. A least weight tree connecting all the nodes is a minimum spanning tree or minimum connector. The total weight of a tree is the sum of the arc weights used in the tree. A minimum spanning tree can be found by using Kruskal’s algorithm or using Prim’s algorithm. A route is like a cycle or closed trail except that edges can be repeated. A Chinese postman problem is the problem of finding a least weight route that uses every arc of a network. It is also called the route inspection problem. Any network formed by weighting an Eulerian graph can be traversed without having to repeat any arcs. Otherwise, arcs need to be doubled up, in the way that uses the least weight possible, so that the graph that was weighted to form the network becomes Original material © Cambridge University Press 2018
Eulerian. Sometimes a question will indicate that the route need not start and end at the same node. In this case, a semi-Eulerian network is needed, where the route will start at one odd-degree node and finish at another. The travelling salesperson problem (TSP) involves finding a least weight cycle through all the nodes of an undirected graph (the least weight Hamiltonian cycle). For a network based on a complete graph, an upper bound can be found by using the nearest neighbour algorithm. The best upper bound for the travelling salesperson problem is the smallest of the upper bounds that have been found (the least upper bound).
PL E
For a network based on a complete graph, a lower bound can be found by removing a node and all the arcs from that node and then constructing a minimum spanning tree for the remaining nodes. The weight of the minimum connector is then added, that is, the two least weight arcs that reconnect the node to the minimum spanning tree.
The best lower bound for the travelling salesperson problem is the largest of the lower bounds that have been found (the greatest lower bound).
SA
M
A tour is a closed route through every node that can pass through nodes more than once.
Original material Š Cambridge University Press 2018
Mixed practice 2 A network is described by the distance network shown.
A
B
C
D
A
−
13
5
6
B
13
−
10
−
C
5
10
−
8
D
6
PL E
1
−
8
−
What is the total weight of the minimum spanning tree? Choose from these options. 19
B
20
C
21
D
22
A network is described by the distance network shown.
M
2
A
Y
Z
−
13
20
SA
X
X
Y
13
−
18
Z
20
18
−
What is the total weight of the network? Choose from these options.
3
A
51
B
62
C
82
D
102
In the network shown in the diagram, the weights represent distances between nodes. The total length of the arcs is 90.
Original material © Cambridge University Press 2018
a List the degrees of the nodes in the network. b What is the length of the shortest route that starts and finishes at P and uses every arc at least once? a Find a minimum spanning tree for the network described by the distance matrix shown.
PL E
4
b Give the total weight of the tree.
J
K
14
L
9
M
N
14
9
−
22
−
15
23
−
15
−
17
8
M
−
L
M
−
23
17
−
20
N
22
−
8
20
−
a Apply the nearest neighbour algorithm to the network in question 4, starting at node J .
SA
5
J
K
b Calculate a lower bound for the travelling salesperson problem by using the reduced network formed by removing N .
6
A cake decorator wants to mark out a design in icing. To avoid making a mess when starting and stopping icing, he wants to draw the design as a continuous route. He will achieve this by duplicating some arcs, but wants to minimise the number of nodes that are travelled through more than twice. The design is shown.
Original material © Cambridge University Press 2018
A
B
C
D E
F H
G J
I
K
The route needs to start at A and finish at F . Show that to achieve this every node will be visited twice. a Find a minimum connector for the network in this diagram.
A
7
B
5
3 6
PL E
7
4
C
7
8
7
D
E
b Show that this minimum connector is not unique.
M
Sarah is a mobile hairdresser based at A. Her day’s appointments are at five places: B, C , D, E and F . She can arrange the appointments in any order. She intends to travel from one place to the next until she has visited all of the places, starting and finishing at A. The table shows the times, in minutes, that it takes to travel between the six places.
SA
8
A
B
C
D
E
F
A
−
15
11
14
27
12
B
15
−
13
19
24
15
C
11
13
−
10
19
12
D
14
19
10
−
26
15
E
27
24
19
26
−
27
F
12
15
12
15
27
−
a Sarah decides to visit the places in the order ABCDEF A . Find the travelling time of this tour.
Original material © Cambridge University Press 2018
b Explain why this answer can be considered as being an upper bound for the minimum travelling time of Sarah’s tour. c Use the nearest neighbour algorithm, starting from A, to find another upper bound for the minimum travelling time of Sarah’s tour. d By deleting A, find a lower bound for the minimum travelling time of Sarah’s tour. e Sarah thinks that she can reduce her travelling time to 75 minutes. Explain why she is wrong. [© AQA 2013] The network below shows 8 towns A, B, … , H . The weight on each arc shows the length of the road, in miles, between the towns. During the winter, the council treats some of the roads with salt so that each town can be safely reached on treated
PL E
9
roads from any other town. It costs £30 to treat a mile of road.
A
D
5 7
4 7 9
6
8
11
F
5
10
9
4
E
H
M
B
8
8
C
G
7
a
i Use Prim’s algorithm starting from A, showing the order in which you select the arcs, to find a minimum spanning tree for the network.
SA
ii Draw your minimum spanning tree.
iii Calculate the minimum cost to the council of making it possible for each town to be safely reached on treated roads from any other town.
b On one occasion, the road from C to E is impassable because of flooding. Find the minimum cost of treating sufficient roads for safe travel in this case. [© AQA 2015]
10 A network connects four nodes. The arc weights are shown in the table. The arcs are all undirected apart from K L .
From
J
K
L
M
J
−
2x
2.9
−
K
2x
−
3.6
5.6
Original material © Cambridge University Press 2018
L
2.9
−
−
x
M
−
5.6
x
−
The total weight of the arcs that enable travel from any node to any other node is 11. What is the value of x?
11 A network connects six nodes. The arc weights are shown in the table. The arcs are all undirected apart from U V and XU .
U
V
From
V
W
X
Y
Z
PL E
U
W
X
Y
25
−
−
−
16
−
−
14
10
13
−
−
14
−
−
18
12
18
10
−
−
14
−
−
13
18
14
−
10
16
−
12
−
10
−
M
Z
−
The total weight of the undirected arcs is 107 and the total weight of all the arcs is 150
.
SA
Find the weight of the least weight route that uses every arc that:
a starts and finishes at U b starts at U and finishes at X .
12 The cost (in pence) of travelling by train between eight stations is given in the table. The cost for any cell marked with M is 1030 and for any cell marked with K is 1020 .
Bodmin
B
C
F
L
N
P
S
T
−
940
810
630
570
M
630
680
570
M
890
480
M
480
Camborne
940
Falmouth
810
570
−
M
680
810
M
410
Looe
630
M
M
−
680
M
570
K
Original material © Cambridge University Press 2018
Newquay
570
890
680
680
−
K
890
630
Penzance
M
480
810
M
K
−
M
680
Saltash
630
M
M
570
890
M
−
K
Truro
680
480
410
K
630
680
K
−
a Use the nearest neighbour algorithm, starting from Truro, to find an upper bound for the minimum cost of travelling between the eight stations, starting and finishing at Truro.
PL E
The upper bounds found by using other stations as the start for nearest neighbour are: £48.90, £50.40, £49.60, £51.90, £52.70, £48.50.
b Which of these is the best upper bound?
c By considering the reduced network formed by removing Truro, find a lower bound for the minimum cost of travelling between the eight stations, starting and finishing at Truro. The lower bounds found by reducing the network by removing other stations are:
M
£44.50, £43.40, £44.00.
d Which of these is the best lower bound?
SA
e What can you deduce about the minimum cost of travelling between the eight stations, starting and finishing at Truro?
Original material © Cambridge University Press 2018