Skip to content

Prim's cheapest links

networks

Level 2 of 3

Also called Prim's algorithm and Minimum spanning tree.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from prim's cheapest links's own run on the numbers shown.

choose one

question 1

Prim's method runs from A on this map. What do its links add up to?

5123678A0BCEFG
the answer, and why

the answer is B

It joins E, F, B, C, G in turn, by 1 + 2 + 3 + 6 + 7, which is 19.

if you chose another

  • That keeps A-B 5 in place of E-F 2.
  • That leaves out E-F, cutting off A and E.
  • That adds every road on the map.

new numbersthe test page's numbers

question 2

On this map, from A, what does the tree add up to once it has 3 roads?

83754691A0BCEFGH
the answer, and why

the answer is D

E by 3, F by 7, then B by 5, as F-B beats A-B's 8. That is 15.

if you chose another

  • That is 4 roads, with B-C's 4 added.
  • That takes B-C's 4 for F-B's 5, but C has no road written until B joins.
  • That keeps A-B's 8 in place of F-B's 5.

new numbersthe test page's numbers

question 3

From the place after the semicolon, on which map does Prim's weigh up the most places?

the answer, and why

the answer is D

B-C 6, B-F 1, B-E 1, A-B 1, E-F 5; B weighs up 11 places, the most of the four.

if you chose another

  • That map weighs up 7 places, fewer than 11.
  • That map weighs up 7 places, fewer than 11.
  • That map weighs up 4 places, fewer than 11.

new numbersthe test page's numbers