Mathster Maths topics Free worksheets Coverage Mathster for schools

Maths topics › A level Further Maths › D1, algorithms and graphs

Apply Prim's algorithm to a distance matrix

A level Further Maths · D1, algorithms and graphs

A question

Apply Prim's algorithm, starting at \( V \), to the distance matrix below. Show the order in which you choose the arcs, and state the weight of your minimum spanning tree.

Free worksheet

10 questions on this objective, ready to print.

Download the worksheet (PDF)

We use this address to send you the answers, and for news only if you tick the box.

Worked solution

The working

  1. Start with column V: cross out row V, and look down the columns of the vertices in the tree for the least number not crossed out. Add that arc and the new vertex.
  2. From {V} the least arc to a new vertex is VA (16); From {V, A} the least arc to a new vertex is VG (23); From {V, A, G} the least arc to a new vertex is VW (28); From {V, A, G, W} the least arc to a new vertex is AF (43); From {V, A, G, W, F} the least arc to a new vertex is FN (22).
  3. (a) VA, VG, VW, AF, FN. (b) Weight \(= (16 + 23 + 28 + 43 + 22) = 132\).
  4. Answers: (a) VA, VG, VW, AF, FN; (b) 132.

Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →

Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.