Leaving Certificate Applied Mathematics2.5 Trees and spanning trees

All books

2.5 Trees and spanning trees — Practise with help

Warm-up: remember

  1. A connected network has 6 vertices and 8 edges. How many edges must be removed to leave a spanning tree?
  2. What is the sum of the degrees of a tree on 6 vertices?
Answers and feedback
  1. A spanning tree has 5 edges, so 8−5=38 - 5 = 3 must go.
  2. The tree has 5 edges, so the degree sum is 2×5=102 \times 5 = 10.

Practise with help

1. A tree has 15 vertices. How many edges has it?

Hint

E=n−1E = n - 1.

Next step

15−115 - 1.

Full working E=15−1=14E = 15 - 1 = 14

Here EE is the number of edges and nn 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 9−1=89 - 1 = 8 edges, so 12−812 - 8 must go.

Full working 12−8=412 - 8 = 4

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 8−1=78 - 1 = 7 edges, and this network has 8 — one more. A connected network with more than n−1n - 1 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 n(n−1)/2n(n-1)/2 for the complete network, and n−1n - 1 for a spanning tree.

Next step

Complete: 5×4/25 \times 4 / 2. Spanning tree: 5−15 - 1.

Full working

The complete network has 5×4/2=105 \times 4 / 2 = 10 edges. Every spanning tree of it has 5−1=45 - 1 = 4 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, vv. If vv 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 vv has degree 1.

The same argument applies to the other end, so there are at least two vertices of degree

  1. (This is also forced by the handshake lemma: the degree sum is 2(n−1)2(n-1), 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 (0111100010011010)\begin{pmatrix} 0&1&1&1\\ 1&0&0&0\\ 1&0&0&1\\ 1&0&1&0 \end{pmatrix}. 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 0+1+1+1=30+1+1+1 = 3.

Full working

The row sums are 3,1,2,23, 1, 2, 2, adding to 88, so E=4E = 4. There are 4 vertices, and a tree on 4 vertices would have 4−1=34 - 1 = 3 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 nn vertices has n−1n - 1 edges, and the components are separate.

Next step

First tree: 4−14 - 1. Second tree: 5−15 - 1.

Full working

The first component has 4−1=34 - 1 = 3 edges, the second 5−1=45 - 1 = 4 edges. Altogether the network has 3+4=73 + 4 = 7 edges.

It is a forest: a network whose components are all trees. Note that n−1=9−1=8n - 1 = 9 - 1 = 8, which is more than 7 — a forest has fewer than n−1n - 1 edges per component, and the n−1n - 1 rule applies to a connected network, not to a disconnected one.

Settings

Colour scheme

Light or dark pages. Your colour and layout stay the same.

Colour

The paper, ink and lettering. Your layout stays the same.

Quiet colours
Bold colours
Layout

How pages are arranged. Your colours stay the same.

Reading offline

Keep this book on this device and read it offline.