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?

9531462A0BCEFG
the answer, and why

the answer is C

It joins E, F, B, C, G in turn, by 5 + 3 + 1 + 4 + 2, which is 15.

if you chose another

  • That keeps A-B 9 in place of E-F 3.
  • 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?

76321485A0BCEFGH
the answer, and why

the answer is A

E by 6, F by 3, then B by 2, as F-B beats A-B's 7. That is 11.

if you chose another

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

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 A

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

if you chose another

  • That map weighs up 4 places, fewer than 8.
  • That map weighs up 6 places, fewer than 8.
  • That map weighs up 6 places, fewer than 8.

new numbersthe test page's numbers