Five groups are building one model railway for a school exhibition. They have money for track between stations, and passengers must be able to reach every station. One student spends the first three credits on two short links. Another spots a third cheap link that closes a triangle. Should the team buy it while two stations are still cut off?
Draw five dots and use strips of paper for the available links. You will build a minimum spanning tree, produce a short proof of its cost, and give the plan to another team with one price changed. The assessment turns on whether you can defend your design after the price sheet changes.
- Connect every station and account for every credit.
- Use a cut to explain why a link belongs in an optimum.
- Distinguish the cheapest network from the quickest journey or a backup route.
Choose your reading route
In this coursework set · 183. Minimum Spanning Tree Lab · 184. Archival Provenance and Original Order Studio · 185. Birthday Collision Lab · 186. Use and Mention Studio
Full chapter index
State the design problem · Chapters 1–3
Build and price the tree · Chapters 4–9
Change the constraints · Chapters 10–19
Solve a fresh network · Chapters 20–23
Defend the design · Chapters 24–26
CHAPTER 1 OF 26 · State the design problem
1. Write down what the budget buys
The exhibit pays once for each two-way track segment it installs. Any journey may use several segments. The objective is the sum of the construction prices on the installed segments. A ticket price or a passenger’s travel time would be a different measurement. Put a unit beside the objective before drawing what looks like a good railway.
CHAPTER 2 OF 26 · State the design problem
2. Specify the graph
Label the stations A, B, C, D and E. A listed pair is an available segment. An unlisted pair is unavailable, even if the two dots sit next to one another on your drawing. A weight is the price in exhibition credits. Moving a dot on the page changes the drawing but leaves these inputs intact.
CHAPTER 3 OF 26 · State the design problem
3. Recognise a spanning tree
A connected network lets you trace a route between any two stations. A cycle is a closed route with no repeated intermediate station. A tree connects all its stations without a cycle. Starting from five isolated stations, each useful join merges two groups. Reaching one group therefore takes four such joins. Four segments by themselves are insufficient evidence of connectivity.
CHAPTER 4 OF 26 · Build and price the tree
4. Lay out the price sheet
Make a card for each segment in the table. Place the cards in increasing price order. Two cards cost two credits each. Try both orders for the tied cards and keep the results. In this example the cards connect different groups at the moment they are considered, so the order of that particular tie changes nothing.
| Segment | Price in credits | Segment | Price in credits |
|---|---|---|---|
| AB | 1 | CD | 4 |
| BC | 2 | BD | 6 |
| DE | 2 | CE | 7 |
| AC | 3 | AE | 8 |
CHAPTER 5 OF 26 · Build and price the tree
5. Keep a running list of groups
Buy AB for one credit. Buy BC and DE for two credits each. You now have one group containing A, B and C, and another containing D and E. The running cost is five. Lay a loop of string around each group. The cheapest remaining card is AC at three credits. Its ends already lie inside the same loop.
CHAPTER 6 OF 26 · Build and price the tree
6. Decide when to skip a cheap link
Buying AC would add a second way between A and C while leaving D and E outside their group. Skip AC and buy CD for four credits. The two loops merge. The finished plan is AB, BC, DE and CD, costing nine. A useful final check is a journey from A to E that touches every installed segment exactly once.
CHAPTER 7 OF 26 · Build and price the tree
7. Prove the plan with four cuts
Draw a line separating A from the rest of the graph. AB is the unique cheapest crossing. Do the same for the partitions AB versus CDE, E versus ABCD, and ABC versus DE. Their unique cheapest crossings are BC, DE and CD. These four requirements identify the entire proposed tree and establish its optimality, even though two of its prices happen to coincide.
CHAPTER 8 OF 26 · Build and price the tree
8. Explain why a unique cheapest crossing is forced
Suppose a cheapest tree omitted the unique cheapest edge across a given cut. Its endpoints still have a path in the tree, and that path must cross the cut. Add the omitted edge, then remove a more expensive crossing edge from the resulting cycle. Connectivity survives and the total falls. The supposed cheapest tree could not have been cheapest.
CHAPTER 9 OF 26 · Build and price the tree
9. Use the exchange argument carefully
When two crossing edges tie for cheapest, the exchange can preserve the total. It can show that a chosen crossing is compatible with an optimum under the usual greedy step, provided the cut respects the edges already chosen. It no longer proves that every optimum contains that particular edge. Ask the examiner which strength of claim the evidence supports.
CHAPTER 10 OF 26 · Change the constraints
10. Give a tie real consequences
Change the price of CE from seven to four. Once AB, BC and DE are installed, CD and CE now tie as the cheapest joins between the two groups. Pick either for a nine-credit tree. Buying both creates a cycle and costs thirteen. A model that reports one nine-credit solution has found an optimum. A claim of uniqueness now needs correction.
CHAPTER 11 OF 26 · Change the constraints
11. Price an outage
Restore the original price sheet, then remove CD from the list of available track. AB, BC and DE still cost five together. BD at six is the cheapest surviving link between ABC and DE, producing a total of eleven. Replacing CD with CE because it looks closer on paper would bring the total to twelve.
| Price sheet | Chosen bridge between groups | Minimum total |
|---|---|---|
| Original | CD at 4 | 9 |
| CE falls to 4 | CD or CE at 4 | 9 |
| Original prices, CD unavailable | BD at 6 | 11 |
CHAPTER 12 OF 26 · Change the constraints
12. Check a tempting AI proposal
An assistant suggests AB, BC, AC and DE for eight credits and declares the budget beaten. The invoice is arithmetically correct. Trace a route from A to D using those cards. No such route exists. Return the failed pair of stations as your evidence. A checker that tests the sum and the number of edges would accept this invalid proposal.
CHAPTER 13 OF 26 · Change the constraints
13. Compare network cost with journey cost
In the original optimum, the path from A to E uses AB, BC, CD and DE, with weights summing to nine. The available direct AE edge costs eight. If weights also represented journey costs, that direct route would beat this tree path for one passenger. The exhibition’s actual brief prices installed track. A decision about journey times would need suitable travel data.
CHAPTER 14 OF 26 · Change the constraints
14. Discuss the price of a backup
Remove CD from the built nine-credit tree. The two halves disconnect. If the organisers specifically require the exhibit to survive failure of CD, adding BD for six supplies a route across that cut. This repairs the named vulnerability. AB could still fail and isolate A. Write down which failure the proposed backup actually covers.
CHAPTER 15 OF 26 · Change the constraints
15. Build a certificate for another team
Hand a classmate the four installed cards, the eight-card price sheet and the four partitions from chapter seven. Ask them to list every crossing edge on one partition of their choice. This exposes a common shortcut: certifying the cheapest crossing among edges already selected. The proof must compare against every available crossing, including rejected cards.
CHAPTER 16 OF 26 · Change the constraints
16. Switch the starting point
Try Prim’s method on the original sheet. Start at E. The cheapest edge leaving the current group is ED, then DC, then CB, then BA. Each choice expands one connected group. Kruskal’s method earlier allowed two groups to grow before joining them. Both procedures solve the same brief, and your price sheet explains why their final edges agree here.
CHAPTER 17 OF 26 · Change the constraints
17. Find the limit of the brief
Give both teams a sixth station, F, and no available segment touching it. Either procedure leaves F isolated. Report the connected components and mark a network spanning all six as infeasible. Adding an invented segment would change the exhibit plan. The organiser can now decide whether to allow another track or remove F from the brief.
CHAPTER 18 OF 26 · Change the constraints
18. Make the vocabulary portable
In eduKate’s Vocabulary Coding and Engineering exercise, finish three different sentences beginning “minimum,” “spanning” and “tree.” Minimum names the comparison across feasible designs. Spanning names the stations that must be included. Tree names the connectivity and cycle conditions. Ask a partner to break just one condition while preserving as many of the other properties as possible.
CHAPTER 19 OF 26 · Change the constraints
19. Hand over the changed-price test
Give another learner your original proof and a revised CE card. Ask which line of the proof fails before they rebuild. The final cut has lost its unique cheapest crossing. In eduKate’s proposed EnDist exercise, record whether the recipient can locate that change unaided, and whether the handover gave them enough information to repair it.
CHAPTER 20 OF 26 · Solve a fresh network
20. Solve a four-station transfer
Start fresh with P, Q, R and S. The offers are PQ 2, PR 2, QR 1, RS 5, QS 4 and PS 8. Draw a cheapest connected tree. Then try to find a different tree with the same cost. Before reading on, write one reason a three-edge proposal costing five credits cannot span these stations.
CHAPTER 21 OF 26 · Solve a fresh network
21. Compare the transfer solutions
QR joins Q and R for one credit. Either PQ or PR attaches P for two, while QS attaches S for four. Both totals are seven. The three cheapest available edges cost five but all sit inside PQR. S requires an edge costing at least four. Two further distinct edges cost at least one and two, which gives the matching lower bound of seven.
| Installed segments | Cost | Feasibility |
|---|---|---|
| QR, PQ, QS | 1 + 2 + 4 = 7 | All four stations connected |
| QR, PR, QS | 1 + 2 + 4 = 7 | All four stations connected |
| QR, PQ, PR | 1 + 2 + 2 = 5 | S isolated |
CHAPTER 22 OF 26 · Solve a fresh network
22. Write a question an AI can grade poorly
Ask an assistant to mark responses against a key listing only QR, PQ and QS. A learner hands in QR, PR and QS. The costs and endpoints can be read from the transfer price sheet. Insist that feedback check cost, connectivity and feasibility before checking exact agreement with the key. A rubric that recognises equivalent optima matters just as much as an algorithm that can find one.
CHAPTER 23 OF 26 · Solve a fresh network
23. Change the audience of the explanation
Give the exhibit treasurer a costed list, the builders a connection diagram and the examiner an optimality certificate. These can describe exactly the same tree. Exchange the three documents and check whether each edge identifier survives. An AI-generated paragraph that drops the price revision may be readable while sending the builder back to the wrong plan.
CHAPTER 24 OF 26 · Defend the design
24. Use four weeks of progressively harder briefs
In week one, build the original railway and identify a cycle by tracing it. In week two, defend one cut at the board. In week three, exchange tied-price and missing-edge cases with another team. In week four, solve a new price sheet unaided and supply a certificate that another learner can verify without reproducing your whole search.
CHAPTER 25 OF 26 · Defend the design
25. Award credit for the decision
Mark the feasibility check, total, optimality argument and response to a changed condition separately. A learner who finds a nine-credit plan by trial still owes the proof. A learner who rejects the eight-credit disconnected plan has already demonstrated a meaningful diagnostic skill. Ask both to give the first observation they would make on a larger graph.
CHAPTER 26 OF 26 · Defend the design
26. Build a puzzle with a known answer
Princeton’s Algorithms materials set out the cut and cycle arguments and the two greedy algorithms. The railways in this lab are fictional. For your own puzzle, draw a tree, give all its edges price one, then add distinctly more expensive alternatives. Explain why it is the unique cheapest tree. Now change one price to create a second optimum and exchange the puzzle.
Princeton Algorithms · Minimum Spanning Trees
Related coursework · Orthogonal Projection and Least Squares Lab · Network Path Lab · Set Cover and Greedy Selection Lab
Contents · Previous chapter · Continue to the Archival Provenance and Original Order Studio