2.5 Trees and spanning trees — Practise with help
Warm-up: remember
- A connected network has 6 vertices and 8 edges. How many edges must be removed to leave a spanning tree?
- What is the sum of the degrees of a tree on 6 vertices?
Answers and feedback
- A spanning tree has 5 edges, so must go.
- The tree has 5 edges, so the degree sum is .
Practise with help
1. A tree has 15 vertices. How many edges has it?
Hint
.
Next step
.
Full working
Here is the number of edges and is the number of vertices.
The number of edges is fixed by the number of vertices. Any tree on 15 vertices has 14 edges.
2. A connected network has 9 vertices and 12 edges. How many edges must be removed to leave a spanning tree?
Hint
Find the size of a spanning tree first.
Next step
A spanning tree on 9 vertices has edges, so must go.
Full working
Four edges must be removed. Each one must lie on a cycle, or the network would become disconnected and stop being a spanning tree. There is always a way to choose them: keep removing an edge on any remaining cycle until none is left.
3. A network is connected and has 8 vertices and 8 edges. Is it a tree? Explain.
Hint
How many edges has a tree on 8 vertices?
Next step
A tree on 8 vertices has 7 edges. This network has 8.
Full working
No. A tree on 8 vertices has edges, and this network has 8 — one more. A connected network with more than edges must contain a cycle, so this network has at least one cycle and is not a tree.
It does have spanning trees: remove any edge on a cycle and you are left with 7 edges, still connected, which is a spanning tree.
4. A complete network has 5 vertices. How many edges has it, and how many edges has each of its spanning trees?
Hint
Use for the complete network, and for a spanning tree.
Next step
Complete: . Spanning tree: .
Full working
The complete network has edges. Every spanning tree of it has edges.
So a spanning tree uses 4 of the 10 available edges. Choosing the cheapest 4 is not enough on its own — they might form a cycle and leave a vertex unconnected. That is why Kruskal's algorithm checks each edge before adding it.
5. Explain why a tree with more than one vertex must have at least two vertices of degree 1.
Hint
Take the longest path in the tree and look at its two ends.
Next step
Could an end of the longest path have degree 2 or more?
Full working
Take the longest path in the tree, and look at one of its ends, . If had degree 2 or more, it would have a neighbour not on the path — and if that neighbour were not on the path, the path could be extended, contradicting that it was longest. If the extra neighbour were on the path, that would close a cycle, which a tree does not have. So has degree 1.
The same argument applies to the other end, so there are at least two vertices of degree
- (This is also forced by the handshake lemma: the degree sum is , which is even, so the number of odd-degree vertices is even — and a tree must have some of them, since it cannot be all even and connected without a cycle.)
6. A student removes edges from a network until 6 edges remain, and finds two vertices can no longer reach each other. What has gone wrong, and what should they do?
Hint
Was the edge they removed on a cycle?
Next step
Removing an edge that is not on a cycle disconnects the network.
Full working
They removed an edge that was not on a cycle — a bridge. Removing a bridge disconnects the network, because that edge was the only route between the two parts.
The rule is: only remove an edge that lies on a cycle. If the edge is on a cycle, the rest of the cycle still connects its two ends, so the network stays connected. The student should put that edge back and choose one that lies on a cycle instead.
A question from Section 2.4
7. A network's adjacency matrix is . Is the network a tree?
Hint
Count the edges from the matrix, then count the vertices.
Next step
Each row sum is a degree. Row 1 is .
Full working
The row sums are , adding to , so . There are 4 vertices, and a tree on 4 vertices would have edges. This network has 4, so it is not a tree.
It is connected — vertex 1 reaches everything directly — and it has one cycle, which is why it has one edge too many. Removing any edge on that cycle leaves a spanning tree.
8. A network has two components, each of which is a tree, with 4 and 5 vertices. How many edges has the network altogether, and what is it called?
Hint
A tree on vertices has edges, and the components are separate.
Next step
First tree: . Second tree: .
Full working
The first component has edges, the second edges. Altogether the network has edges.
It is a forest: a network whose components are all trees. Note that , which is more than 7 — a forest has fewer than edges per component, and the rule applies to a connected network, not to a disconnected one.