Salam Academy
Contents · 0% complete
  1. Learning objectives
  2. Core idea
  3. Key formulae
  4. Worked examples
  5. Explore the graph
  6. Common mistakes
  7. Exam tip
  8. Guided practice
  9. Practice questions
  10. Challenge
  11. Summary
  12. Quick quiz
  13. Same topic, different board
  14. Past paper questions
Learn7367Paper 3 · Discrete optionNetworksKruskal's and Prim's algorithms
Networks · Subtopic 1 of 3

Minimum Spanning Trees

A minimum spanning tree (MST) connects every vertex with the least total weight and no cycles; it has V−1V-1 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.

Edexcel YMA01 WDM11Edexcel 9FM0 OptionAQA 7367 Paper 3≈ 40 minRevision 1 · updated 2026-10-27
Practise this topicTimed testAsk Salam Tutor
Section 1 of 14

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.
Pause and think

A council must link five villages by cable. Why will the cheapest network never contain a loop?

Section 2 of 14

Core idea

Start hereCabling villages

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.

The big idea

An MST connects all VV vertices with V−1V-1 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: AB=4AB=4, AC=3AC=3, BC=2BC=2, BD=5BD=5, CD=6CD=6, CE=7CE=7, DE=3DE=3.

Worked exampleKruskal's algorithm

Find an MST.

Goal
Edges and weight.
Strategy
Sort; add unless a cycle forms.
  1. BC(2) ✓BC(2)\ \checkmark
    Cheapest.
  2. AC(3) ✓, DE(3) ✓AC(3)\ \checkmark,\ DE(3)\ \checkmark
    No cycles.
  3. AB(4) ×AB(4)\ \times
    Would make cycle ABCABC.
  4. BD(5) ✓BD(5)\ \checkmark
    Joins {A,B,C}\{A,B,C\} to {D,E}\{D,E\}; now 4 edges.
AnswerBC,AC,DE,BDBC,AC,DE,BD; weight 1313.
✓ CheckV−1=4V-1=4 edges ✓; connected ✓.
Why greedy works (cut property)
  1. split vertices into two groups\text{split vertices into two groups}
    Any division of the vertices.
  2. cheapest edge across is in some MST\text{cheapest edge across is in some MST}
    Swapping it for any heavier crossing edge can't increase the total.
  3. Kruskal and Prim always pick such an edge\text{Kruskal and Prim always pick such an edge}
    Each accepted edge is cheapest across some split.

2. Prim

Worked examplePrim's from A

Use Prim starting at AA.

Goal
Order of edges.
Strategy
Cheapest edge from tree to a new vertex.
  1. AC(3)AC(3)
    From AA: 44 or 33.
  2. CB(2)CB(2)
    From {A,C}\{A,C\}.
  3. BD(5)BD(5)
    Options: BD5BD5, CD6CD6, CE7CE7.
  4. DE(3)DE(3)
    Last vertex.
AnswerSame tree, weight 1313.
✓ CheckBoth algorithms agree ✓.
Kruskal vs Prim

Two greedy routes to the same tree.

TrickMatrix Prim Cross out the new vertex's row, label its column, choose the smallest uncrossed value in labelled columns.
Common misconceptionState rejections In Kruskal write which edges are rejected, e.g. "ABAB rejected: forms cycle ABCABC".
Pause and think

Could an MST contain the heaviest edge of the network?

Summary

  • V−1V-1 edges, no cycles.
  • Kruskal: sort, avoid cycles.
  • Prim: grow from a vertex.
Key words
Spanning tree
Tree including every vertex.
Greedy algorithm
Takes the best immediate choice each step.
HistoryBorůvka. Otakar Borůvka found the first MST algorithm in 1926 to design an efficient electricity network for Moravia. Kruskal (1956) and Prim (1957) followed.
Fun factGreedy works. Kruskal and Prim are greedy: always take the best-looking step. For MSTs, greed is provably optimal, which is rare.
Section 3 of 14

Key formulae

Edges in a spanning treeE=V−1E=V-1
Kruskalsort edges; add cheapest unless it forms a cycle\text{sort edges; add cheapest unless it forms a cycle}
Primadd cheapest edge joining tree to a new vertex\text{add cheapest edge joining tree to a new vertex}
TrickPrim on a matrix. Cross out the row of each vertex you add, label its column, and pick the smallest uncrossed entry in all labelled columns.
Section 4 of 14

Worked examples

Example 1 · Kruskal0 / 3 steps
Find the MST of the network (weights AB4AB4, AC3AC3, BC2BC2, BD5BD5, CD6CD6, CE7CE7, DE3DE3).
    Example 2 · Prim from A0 / 3 steps
    Use Prim from AA on the same network.
      Section 5 of 14

      Explore the graph

      The example network
      Loading the interactive graph…
      Try this
      1. Vertices: A(0,2)A(0,2), B(2,4)B(2,4), C(2,0)C(2,0), D(4,4)D(4,4), E(5,1)E(5,1). Weights: AB=4AB=4, AC=3AC=3, BC=2BC=2, BD=5BD=5, CD=6CD=6, CE=7CE=7, DE=3DE=3.
      2. The MST uses BCBC, ACAC, DEDE, BDBD: four edges for five vertices.

      MST weight 1313.

      In the real worldCluster analysis. Delete the heaviest edges of an MST and the remaining pieces form natural clusters: used in biology to group similar genes.
      Section 6 of 14

      Common mistakes

      IncorrectNot listing rejected edges
      CorrectSay which edges are rejected and why
      Kruskal marks need the order of consideration.
      IncorrectPrim picking the cheapest edge anywhere
      CorrectOnly edges touching the tree
      Otherwise it's Kruskal.
      IncorrectVV edges
      CorrectV−1V-1
      A tree on VV vertices.

      Adding the cheapest edge

      Cycle detected. Rejected. Next.

      Section 7 of 14

      Exam tip

      Exam tipTies. If two edges tie, either may be chosen; MSTs may not be unique, but the total weight is.
      Section 8 of 14

      Guided practice

      SA-DM-MS-G011 markL1 FoundationNon-calculatorKruskal
      How many edges are in a spanning tree of a network with 88 vertices?

      Sign in or create a free account to check answers, get hints and track your progress.

      Salam Academy Original Practice · Proposed mark scheme
      Section 9 of 14

      Practice questions

      SA-DM-MS-0013 marksL2 StandardNon-calculatorKruskal
      Network edges: AB4AB4, AC3AC3, BC2BC2, BD5BD5, CD6CD6, CE7CE7, DE3DE3. Find the weight of the minimum spanning tree.

      Sign in or create a free account to check answers, get hints and track your progress.

      Salam Academy Original Practice · Proposed mark scheme
      SA-DM-MS-0021 markL2 StandardNon-calculatorPrim
      Using Prim's algorithm from AA on the same network, what is the weight of the first edge chosen?

      Sign in or create a free account to check answers, get hints and track your progress.

      Salam Academy Original Practice · Proposed mark scheme
      SA-DM-MS-0031 markL2 StandardNon-calculatorPrim
      Using Prim from AA, what is the weight of the third edge added?

      Sign in or create a free account to check answers, get hints and track your progress.

      Salam Academy Original Practice · Proposed mark scheme

      More questions on every skill in this subtopic are in the question bank under Practise.

      Section 10 of 14

      Challenge

      SA-DM-MS-0042 marksL3 ExamNon-calculatorKruskal
      In the same network, the weight of CDCD is reduced. Find the largest weight CDCD could have and still be part of some minimum spanning tree.

      Sign in or create a free account to check answers, get hints and track your progress.

      Salam Academy Original Practice · Proposed mark scheme
      Section 11 of 14

      Summary

      • MST: V−1V-1 edges, no cycles.
      • Kruskal: cheapest overall, avoid cycles.
      • Prim: grow from one vertex.
      Section 12 of 14

      Quick quiz

      Q1 · SA-DM-MS-Q011 markL1 FoundationNon-calculatorKruskal
      Kruskal's algorithm rejects an edge when it
      Choose one option

      Sign in or create a free account to check answers, get hints and track your progress.

      Salam Academy Original Practice · Proposed mark scheme
      Section 13 of 14

      Same topic, different board

      Specification
      7367 A-level Further Mathematics
      Where
      Discrete · Networks
      Expected
      Minimum spanning trees with Kruskal's and Prim's algorithms; shortest paths; route inspection; travelling salesperson bounds.
      Calculator
      Permitted on all papers.
      Typical style
      AQA mixes short multiple-choice questions with longer structured ones.
      Open in
      7367 · Paper 3
      Section 14 of 14

      Past paper questions

      No past paper questions are tagged to this subtopic yet. We add papers every week.

      Browse past papers

      Salam Academy original content · Content status: reviewed and published. Syllabus mapping: AQA 7367, First teaching 2017 (official specification).