Skip to content

Kruskal's cheapest links

networks

Level 2 of 3

Also called Kruskal's algorithm and Minimum spanning forest.

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 kruskal's cheapest links's own run on the numbers shown.

choose one

question 1

Kruskal's method runs on this map. What do the roads kept add up to?

4362715AABBCCEEFFGG
the answer, and why

the answer is B

C-G 1, B-F 2, A-E 3, A-B 4 and F-G 5 are kept, which is 15. E-F and B-C would close loops.

if you chose another

  • That adds every road on the map.
  • That stops after 4 roads, leaving C and G cut off from the rest.
  • That takes E-F 6 for F-G 5, but E-F closes a loop, and C and G stay cut off from the rest.

new numbers

question 2

On this map, what do the roads kept add up to once 3 are kept?

5143267AABBCCEEFFGG
the answer, and why

the answer is A

A-E 1, B-C 2 and B-F 3 come first, and each joins two groups. That is 6.

if you chose another

  • That is 4 roads, with E-F's 4 added.
  • That is A-B's 5 alone, which comes later and is left out.
  • That takes A-B's 5 in place of B-C's 2.

new numbers

question 3

The roads come in the order written. On which map does the sort make the most comparisons?

the answer, and why

the answer is C

Five roads in order: left runs 1 and 1, so 2; then 2, so 2; then 4, so 4. That is 8.

if you chose another

  • Three roads in order compare 3.
  • One road needs no comparison.
  • Four roads in order compare 4. Pieces change nothing in the sort.

new numbers