AThat is how many roads it reads, not how many it keeps.
BThe sort reads every road, and every pair has more.
DBoth keep the same number.
4question 4
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
AThree roads in order compare 3.
BOne road needs no comparison.
DFour roads in order compare 4. Pieces change nothing in the sort.
pen and paper
5question 5about 8 minutes
The map has roads A-B 7, A-E 1, E-F 6, B-F 2, B-C 4, F-G 3 and C-G 5.
Write the roads in order, each kept or left out.
Which is left out first, and why?
What do the roads kept add up to?
a hint
Write each place's name as you go.
a worked answer
In order: A-E 1, B-F 2, F-G 3 and B-C 4 are kept. C-G 5 is left out, as C and G share a name. E-F 6 is kept. A-B 7 is left out. They add up to 1 + 2 + 3 + 4 + 6, so 16.
The roads kept alone, 16. A-B and C-G are left out.
A-E, B-F, F-G, B-C and E-F kept; C-G and A-B left out.
C-G: C and G share a name.
16.
6question 6about 8 minutes
The map has roads A-B 3, A-E 6, B-E 4, B-F 8 and E-F 5. Someone offers the network A-E, B-E and B-F.
What does that network cost?
Split A alone from the rest. Add the cheapest road across. Which road on the loop crosses too?
Swap them. Now split F alone from the rest, add the cheapest road across, and swap again. What does the network cost now, and what do the roads Kruskal's method keeps add up to?
a hint
Draw the map first.
a worked answer
It costs 6 + 4 + 8, so 18. A-B 3 and A-E 6 cross, so A-B is cheapest. Adding it closes the loop A, B, E, A, and A-E crosses too. The swap gives 18 - 6 + 3, so 15. For F alone, E-F 5 and B-F 8 cross, so E-F is cheapest. Adding it closes the loop B, E, F, B, and B-F crosses too. The swap gives 15 - 8 + 5, so 12. The method keeps A-B 3, B-E 4 and E-F 5, also 12.
The whole map. A, shaded, is split from the rest.
Question 6: why are the roads kept a cheapest network, one for each piece? Let be a network's cost and its cost after one swap.11 of 11 shown
1the move: what stays true
the line:
why it is allowed: Take one piece, and only its roads. Two networks can tie for cheapest. At the start no road is kept, so there is nothing to check. The plan is to show that keeping the next road keeps this true.
2the move: split the places
the line:
A and E, shaded, are split from the rest. E to F, length 2, and A to B, length 9, cross.
why it is allowed: Take the next road kept. Split the group at one of its ends from the rest of the piece. Its ends have different names, so it crosses. An earlier road was kept or left out, so its ends now share a name, and it does not cross. A later road is no shorter. So this road is cheapest across. On the small map, with A and E split off, it is E to F.
guess it, then
3the move: swap a road on the loop
the line:
The network of 15 with E to F added. The loop, heavy, crosses the split on E to F and on A to B.
why it is allowed: Take a network with the roads kept so far, B to F and A to E, without E to F: those two, plus A to B and B to C. That costs 1 + 2 + 9 + 3, so is 15. Adding E to F closes a loop, which comes back across the split on A to B, length 9. Take A to B out.
guess it, then
4the move: add them up
the line:
where does this come from?
question 2 of the page greedy choices, and when they failSplit the places in two. Why does some cheapest network hold the cheapest road across? Let be a network's cost, and its cost after one swap.
1the move: swap a road on the loop
the line:
A network of 12, A to B, B to D, C to D and D to E, with A to C added. The loop A, C, D, B, A, heavy, crosses back on B to D, of 6.
why it is allowed: The plan is to show a swap on a network that is not the cheapest, then use it on a cheapest one. Take a network without A to C, the cheapest road across. A to B, B to D, C to D and D to E cost 3 + 6 + 2 + 1, so here is 12. They already join A to C another way, so adding A to C closes a loop, roads leading round and back to A. The loop leaves the shaded group on A to C, so it comes back on another road across, B to D, of 6. Take B to D out.
2the move: add them up
the line:
why it is allowed: Taking out 6 and putting in 4 is 2 less.
3the move: no dearer
the line:
After the swap, B to D out and A to C in, at 12 less 2, which is 10.
why it is allowed: less 2 is at most , so the swap costs no more. Before, 12; after, 10.
4the move: still one piece
the line:
why it is allowed: A trip that used the road taken out goes the other way round the loop. From B to D, that is B, A, C, D.
5the move: on any map
the line:
why it is allowed: On any map, let be the cheapest road across, and a road where the loop crosses back. Each letter also stands for its road's length. Here is A to C, of 4, and is B to D, of 6. The swap takes out and puts in.
6the move: f costs at least e
the line:
why it is allowed: crosses too, and is the cheapest road across, so is at least . Taking out saves at least what putting in adds.
7the move: start from a cheapest one
the line:
why it is allowed: The network of 12 only showed the swap. Start instead from a cheapest network without . The swap costs no more, and no network costs less than a cheapest one, so it costs the same. So it is cheapest too, and holds . A cheapest network that holds already needs no swap.
why it is allowed: Taking out 9 and putting in 2 is 7 less. The proof of the swap on any map is under this line.
guess it, then
5the move: no dearer
the line:
why it is allowed: The road taken out crosses too, so it costs at least the cheapest across. Before, 15; after, 8.
guess it, then
6the move: roads kept stay
the line:
why it is allowed: The road taken out crosses the split. A road kept has both ends in one group, so it does not cross.
guess it, then
7the move: so it stays true
the line:
why it is allowed: The network of 15 only showed the swap. Start from a cheapest network holding the roads kept so far, by line 1. If it holds the next road too, nothing changes. If not, the swap leaves a network and costs no more, and no network costs less, so it is cheapest too. It holds the next road, and by line 6 it keeps the roads kept.
guess it, then
8the move: as many roads
the line:
road kept
groups left
start
5
B-F
4
A-E
3
E-F
2
B-C
1
The small map, 5 places and 4 roads kept.
why it is allowed: Each road kept makes one group fewer. After its turn a road's ends share a name, kept or left out. A piece is joined, so two or more groups left in it would have a road between two of them. So a piece of places goes from groups to 1.
guess it, then
9the move: a cheapest network has them too
the line:
why it is allowed: Take any road off a loop. A trip that used it goes the other way round, so every place stays joined. Every length here is at least 1, so the cost falls. So it has no loop. Travel out from any place. Each other place is first reached along one road, in all, and any other road would close a loop.
guess it, then
10the move: at the end
the line:
The roads kept on two parts of town, the watch page's fifth map, cost 6 and 3, which is 9, with 2 names at the end.
why it is allowed: By line 7, after every road kept they lie in a cheapest network of the piece, and by lines 8 and 9 both have roads. So they are all of it, one for each piece.
guess it, then
11the move: ties change nothing
the line:
why it is allowed: Nothing above used letter order, and all cheapest networks cost the same. On the watch page's third map, every road 5, ties broken backwards keep other roads, and still cost 35.
guess it, then
try it with a small : at , line 3 gives , which you can work out by hand