Minimum Spanning Trees and Kruskal’s Algorithm (AQA A-Level Further Maths): Revision Notes
Minimum Spanning Trees and Kruskal's Algorithm
What is a spanning tree?
A spanning tree (also called a connector) is a special type of sub-graph that connects all vertices in a graph without creating any cycles. It forms a tree structure that "spans" across the entire graph.
Key definition: A spanning tree is a sub-graph that is a tree containing every vertex of the original graph.
Important property of spanning trees
For any graph with vertices, a spanning tree will always have exactly edges.
This makes sense when you think about it: you need one edge to connect the first two vertices, then one more edge for each additional vertex you add, giving you edges total.
Formula: For a graph with vertices, a spanning tree has edges.
The One Less Rule: A spanning tree always has one less edge than the number of vertices. This property is crucial for checking whether you've found a complete spanning tree.
Example: different spanning trees
The same graph can have multiple different spanning trees. Here's an example showing two possible spanning trees for the same graph with six vertices (A, B, C, D, E, F):

Both diagrams show valid spanning trees because:
- They include all six vertices
- They have exactly 5 edges (since )
- They contain no cycles
Minimum spanning trees
When working with weighted graphs (also called networks), where edges have numerical values representing distances, costs, or other quantities, we often want to find the spanning tree with the smallest total weight.
Key definition: For a network, the spanning tree with the lowest total weight is called the minimum spanning tree (MST) or minimum connector.
Why are minimum spanning trees useful?
MSTs have many real-world applications:
- Designing efficient road networks
- Planning telecommunications infrastructure
- Minimising cable lengths in electrical networks
- Optimising pipeline routes
- Reducing costs in any connected system
The challenge is that as networks get larger, the number of possible spanning trees increases dramatically. For a network with vertices, there can be possible spanning trees. This means we need a systematic algorithm to find the minimum one efficiently.
Kruskal's algorithm
Kruskal's algorithm provides a systematic method for finding a minimum spanning tree. It's an example of a greedy algorithm, which means at each stage you make the most advantageous choice available without thinking ahead.
The algorithm steps
Kruskal's Algorithm - Essential Steps
Follow these steps to apply Kruskal's algorithm:
Step 1: Begin by selecting the edge with the smallest weight.
Step 2: From the remaining edges, choose the one with the least weight, ensuring that adding this edge won't create a cycle with edges already selected.
Step 3: If any vertices remain unconnected, return to Step 2.
Note: If at any point there's a tie between edges with equal weights, choose one at random. Either choice will give you a valid minimum spanning tree, though the trees may look different.
Why is it called "greedy"?
Kruskal's algorithm is greedy because at each stage, you simply grab the smallest available edge that doesn't create a cycle. You don't need to plan ahead or consider future consequences—the locally optimal choice at each step leads to the globally optimal solution.
Memory Aid: "SCR Rule"
- Smallest edge first
- Check for cycles (reject if it creates one)
- Repeat until all vertices are connected
Think of it as "GROW the tree": Grab smallest edge, Reject if cycle forms, Order matters (smallest first), Work until all connected.
Worked example 1: applying Kruskal's algorithm
Let's find the minimum spanning tree for the following network using Kruskal's algorithm. The graph has 6 nodes (A, B, C, D, E, F), so the connector will have 5 arcs.
Worked Example: Finding the Minimum Spanning Tree
We'll systematically select edges in order of increasing weight, checking each time that we don't create a cycle.
- Choose CF (weight 4)
- CF has the smallest weight in the network
- No cycle is formed
- Choose CD (weight 4)
- There's a tie between CD and EF (both weight 4)
- We can choose either; we'll select CD
- No cycle is formed
- Choose EF (weight 4)
- This is the other edge with weight 4
- Adding EF doesn't create a cycle
- Choose BC (weight 6)
- This is the next smallest weight available
- We could have chosen EF before CD—either order works
- Consider CE (weight 6)
- CE is the next lowest weight
- However, adding CE would create the cycle CEFC
- We must reject CE and move to the next option
- Choose AD (weight 7)
- We skip DE (weight 7) because it would form cycle DEFCD
- AD is acceptable and completes our spanning tree
- All 6 nodes are now connected with 5 arcs
Result:
- The arcs selected in order are: CF, CD, EF, BC, AD
- The minimum spanning tree is complete
- Total weight =
Worked example 2: country park problem
This example shows how Kruskal's algorithm applies to a real-world scenario.
Problem: A country park has seven picnic sites (A, B, C, D, E, F, G) and a car park, connected by rough paths. The distances between sites are shown in metres. The council wants to upgrade paths so all picnic sites are accessible by wheelchair. The upgrade costs $55 per metre. Use Kruskal's algorithm to determine which paths should be upgraded and calculate the total cost.
Worked Example: Country Park Path Optimization
Strategy:
- If necessary, draw a clear graph
- Apply Kruskal's algorithm, clearly showing the order of arc selection
- Answer the question in context
There are 8 nodes, so we need 7 arcs for the spanning tree.
Applying Kruskal's algorithm:
1st: EF (150 m) - smallest weight
2nd: FG (190 m) - next smallest
3rd: BG (200 m) - next smallest
4th: Car park–A (200 m) - tied with BG, chosen next
5th: GC (230 m) - next smallest
6th: AF (240 m) - next smallest
Reject BC (which would form cycle BGCB)
7th: ED (280 m) - completes the spanning tree
The spanning tree is now complete with 7 arcs connecting all 8 nodes.
Total length to upgrade:
Total cost:
Answer in context: The council should upgrade paths EF, FG, BG, Car park–A, GC, AF, and ED. The total cost of the upgrade will be $81,950.
Exam tips
When solving MST problems:
-
Always start by counting vertices. If there are vertices, you need exactly edges.
-
List the edges in order of selection to show your working clearly.
-
Check for cycles carefully. A common error is accidentally creating a cycle by adding an edge that connects vertices already joined by another path.
-
If there's a tie between equal weights, state this and choose one. Your answer may differ from the mark scheme, but if your logic is correct, you'll still get full marks.
-
Always show your working systematically. Examiners want to see the order in which you selected edges.
-
For context-based questions, remember to answer in context (e.g., "Upgrade paths X and Y" not just "Choose edges X and Y").
-
Calculate the total weight at the end and double-check your arithmetic.
Common mistakes to avoid:
- Forgetting to check for cycles before adding an edge
- Counting the number of edges incorrectly
- Not showing the order of edge selection clearly
- Stopping too early (before all vertices are connected)
- Adding too many edges (more than )
Remember!
Key Points to Remember:
-
A spanning tree connects all vertices of a graph without creating any cycles.
-
A spanning tree with vertices must have exactly edges.
-
The minimum spanning tree (MST) is the spanning tree with the lowest total weight in a network.
-
Kruskal's algorithm finds the MST by repeatedly selecting the smallest available edge that doesn't create a cycle.
-
Kruskal's algorithm is a greedy algorithm—it makes the best local choice at each step without planning ahead.
-
Remember the "One Less Rule": spanning trees always have one fewer edge than the number of vertices.
-
When applying the algorithm: Smallest first, Check for cycles, Repeat until done.