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?

7426139A0BCEFG
the answer, and why

the answer is A

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

if you chose another

  • That keeps A-B 7 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?

82734195A0BCEFGH
the answer, and why

the answer is C

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

if you chose another

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

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 C

D-G 5, C-G 9, B-C 8, F-G 3, B-F 2; G weighs up 10 places, the most of the four.

if you chose another

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

new numbersthe test page's numbers