CNo run weighs up more, by section 4's question 3.
4question 4
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
AFrom B, B waits alone, then A alone, then E and F, then F, so 1, 1, 2 and 1, which is 5.
BA line of 4 weighs up one place each round, 4.
DC, D and H are another piece, so the run ends after A and B, 2.
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. The method runs from A.
Write each place in the order joined, with its road.
Which number is later beaten?
What do the links add up to?
a hint
Draw the map first.
a worked answer
In the order joined: A, E by A-E 1, F by E-F 6, B by F-B 2, G by F-G 3, C by B-C 4. B's 7 becomes 2. C-G's 5 does not beat C's 4, so it changes nothing. They add up to 1 + 6 + 2 + 3 + 4, so 16.
The cheapest links alone, 16. A-B and C-G are left out.
The map has roads A-B 6, A-E 1, B-E 2, B-C 4 and C-E 5. Someone offers the network A-B, A-E and B-C.
What does that network cost?
Split A and E from the rest. Add the cheapest road across. Which road on the loop crosses too?
Swap them. What does it cost now, and what does the method give from A?
a hint
Draw the map first.
a worked answer
It costs 6 + 1 + 4, so 11. A-B 6, B-E 2 and C-E 5 cross, so B-E is cheapest. Adding it closes the loop A, B, E, A, and A-B crosses too. The swap gives 11 - 6 + 2, so 7. From A the method joins E by 1, B by 2 and C by 4, also 7.
The whole map. A and E, shaded, are split from the rest.
Question 7: on a map in one piece, why are the roads joined a cheapest network? Let be a network's cost, not question 3's , and its cost after one swap.9 of 9 shown
1the move: what stays true
the line:
why it is allowed: Before round 2, no road is joined, so none can lie outside a cheapest network. The plan: show that joining the next road keeps this true.
2the move: split the places
the line:
why it is allowed: Split the places into those in the tree and the rest. A road across has one end in each. Each place waiting holds its cheapest road from the tree, as a cheaper one always replaces what is written. So the next road joined, the cheapest written, is the cheapest across. On the small map, with A and E in the tree, B holds 9 and F holds 2.
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 A to E but without E to F: A to E, A to B, B to F and B to C. That costs 2 + 9 + 1 + 3, so is 15. Adding E to F closes a loop, which comes back across the split on A to B, of 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 joined stay
the line:
why it is allowed: The road taken out crosses the split. A road joined has both ends in the tree, so it does not cross.
guess it, then
7the move: so it stays true
the line:
All lengths 1, from A. A cheapest network, heavy, costs 2, and lacks A to B, the next road joined. Put A to B in and take A to E out: still 2.
why it is allowed: The network of 15 only showed the swap. Start instead from a cheapest network holding the roads joined 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 joined.
guess it, then
8the move: at the end
the line:
why it is allowed: On a map in one piece, all places have joined, with roads, by question 6. They lie in a cheapest network, which also has roads. So they are all of it.
guess it, then
9the move: any start
the line:
why it is allowed: Nothing above used which place came first, and all cheapest networks cost the same. On the town of eight, every start gives 18.
guess it, then
try it with a small : at , line 3 gives , which you can work out by hand