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?

5241632A0BCEFG
the answer, and why

the answer is D

E by 2, F by 4, B by 1, G by 3 and C by 2, which is 12.

if you chose another

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

new numbers

question 2

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

61231542A0BCEFGH
the answer, and why

the answer is C

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

if you chose another

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

new 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

Joining A writes a road at all 3 others, so 1, 3, 2 and 1, which is 7.

if you chose another

  • From B, B waits alone, then A alone, then E and F, then F, so 1, 1, 2 and 1, which is 5.
  • A line of 4 weighs up one place each round, 4.
  • C, D and H are another piece, so the run ends after A and B, 2.

new numbers