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?

8215974A0BCEFG
the answer, and why

the answer is B

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

if you chose another

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

93214865A0BCEFGH
the answer, and why

the answer is A

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

if you chose another

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

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

C-F 3, G-H 9, C-D 2, F-G 6, C-G 3, B-F 5; B 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 5 places, fewer than 8.
  • That map weighs up 6 places, fewer than 8.

new numbersthe test page's numbers