Contents · 0% complete
Minimum Spanning Trees
A minimum spanning tree (MST) connects every vertex with the least total weight and no cycles; it has edges. Kruskal adds the cheapest remaining edge unless it makes a cycle. Prim grows one tree, always adding the cheapest edge from the tree to a new vertex, and works directly on a distance matrix.
Learning objectives
- Use Kruskal's algorithm, listing accepted and rejected edges.
- Use Prim's algorithm on a network and on a distance matrix.
- Find the weight of an MST.
A council must link five villages by cable. Why will the cheapest network never contain a loop?
Core idea
A broadband company must connect five villages. Every link costs money, and the network just needs to connect everyone. Loops are wasted cable. The cheapest answer is a minimum spanning tree.
An MST connects all vertices with edges and least total weight. Kruskal takes edges cheapest-first, skipping any that close a cycle; Prim grows a single tree from one vertex.
1. Kruskal
Network used below: , , , , , , .
Find an MST.
- Goal
- Edges and weight.
- Strategy
- Sort; add unless a cycle forms.
- Cheapest.
- No cycles.
- Would make cycle .
- Joins to ; now 4 edges.
- Any division of the vertices.
- Swapping it for any heavier crossing edge can't increase the total.
- Each accepted edge is cheapest across some split.
2. Prim
Use Prim starting at .
- Goal
- Order of edges.
- Strategy
- Cheapest edge from tree to a new vertex.
- From : or .
- From .
- Options: , , .
- Last vertex.
Two greedy routes to the same tree.
Could an MST contain the heaviest edge of the network?
Summary
- edges, no cycles.
- Kruskal: sort, avoid cycles.
- Prim: grow from a vertex.
- Spanning tree
- Tree including every vertex.
- Greedy algorithm
- Takes the best immediate choice each step.
Key formulae
Worked examples
Explore the graph
- Vertices: , , , , . Weights: , , , , , , .
- The MST uses , , , : four edges for five vertices.
MST weight .
Common mistakes
Adding the cheapest edge
Cycle detected. Rejected. Next.
Exam tip
Guided practice
Practice questions
More questions on every skill in this subtopic are in the question bank under Practise.
Challenge
Summary
- MST: edges, no cycles.
- Kruskal: cheapest overall, avoid cycles.
- Prim: grow from one vertex.
Quick quiz
Same topic, different board
- Specification
- A level Further Mathematics 9FM0
- Where
- Decision 1 · Algorithms on graphs
- Expected
- Minimum spanning trees using Kruskal's and Prim's algorithms, including Prim on a distance matrix; Dijkstra's algorithm.
- Calculator
- Permitted; show enough working to earn the method marks.
- Typical style
- Edexcel often opens with a routine part and builds to a "show that" or "prove" part.
- Open in
- YMA01 · WDM119FM0 · Option
Past paper questions
No past paper questions are tagged to this subtopic yet. We add papers every week.
Browse past papersSalam Academy original content · Content status: reviewed and published. Syllabus mapping: Pearson Edexcel 9FM0, First teaching 2017 (official specification).