Connector problems and best paths
Solving minimal connector problems with minimum spanning trees, and why the shortest path is not always in the tree or the best choice.
You now have two tools: the shortest path and the minimum spanning tree. The hard part in an exam is usually not running the method. It's reading a worded problem and deciding which tool it needs.
Minimal connector problems
A minimal connector problem asks you to link every location using the least total length, time or cost. Laying NBN fibre to every house in a new estate, running irrigation pipe to every paddock, or building walking tracks between campsites are all minimal connector problems. The answer is a minimum spanning tree.
| The question says… | Use |
|---|---|
| "connect all", "link every", "least cable/pipe to reach each" | minimum spanning tree |
| "from X to Y", "quickest route", "shortest trip" | shortest path |
A farm near Dubbo needs water piped from a tank to a house (H), a shed (S), a dam (D) and a paddock trough (P). The tank is T. Possible pipe routes and their lengths in metres are shown. Pipe costs $\$18$ per metre laid. Find the minimum cost.
Shortest paths and spanning trees are different
It's natural to assume the minimum spanning tree also gives the shortest trips. It doesn't. The tree minimises the total of all its edges. A shortest path minimises one particular journey. These are different goals, so they often give different edges.
For the network above: (a) find the shortest path from A to E (b) find the length of the route from A to E using only the minimum spanning tree (c) explain the difference.
Is the shortest path the best path?
The shortest path is only "best" for the one thing the weights measure. Real decisions weigh up more than one thing:
- Tolls: the shortest drive into the city might use a toll road. Is $5$ minutes worth the toll?
- Traffic and time of day: a short road through Parramatta at 8 am may be slower than a longer motorway.
- Road type and safety: a short dirt road, school zones, or roads unsuitable for a truck.
- Accessibility: the shortest walk between platforms may have stairs and no lift.
- Reliability: a route with one fragile link can be worse than a slightly longer route with options.
For Penrith to the Sydney CBD, find the shortest route by distance, then by time. Are they the same?
Turn on Avoid toll roads. How much longer does the trip get?
Turn on Show minimum spanning tree and try each trip. For which trips does the shortest route leave the tree?
Your turn
In Example 1, the farmer decides the dam (D) doesn't need water after all. What is the new minimum length of pipe?
Show the working
Remove D and its edges. Remaining edges: ST $70$, HT $90$, HS $120$, TP $130$, SP $150$. Kruskal's: keep ST $70$, HT $90$, skip HS $120$ (cycle H–S–T), keep TP $130$. Total $= 70 + 90 + 130 = 290$ m. Losing DP and TD means the paddock now needs its own longer pipe.
A council wants to build bike paths so that every one of $8$ parks is connected, using the least total length of path. This is:
"Every park connected, least total length" is exactly a minimum spanning tree.
How many bike paths will the council's solution have?
A spanning tree on $8$ vertices has $8 - 1 = 7$ edges.
In Example 1, what is the minimum cost in dollars of the pipe?
Minimum spanning tree $= 350$ m, and $350 \times 18 = 6300$.
In Example 2's network, what is the length of the shortest path from A to C?
The direct edge AC has weight $7$. The tree route A–B–C is $8$.
Which statement is true?
Example 2 shows it: the shortest A to E path uses AC, which isn't in the MST.
What is the total weight of the minimum spanning tree in Example 2?
DE $2$ + CD $3$ + AB $4$ + BC $4$ $= 13$. After four edges the tree spans all $5$ vertices, and every remaining edge (CE, AC, BD) would close a cycle.
A delivery driver wants the quickest route from a warehouse to one customer. They should find:
One start, one finish, smallest time: shortest path.
Exam style: In Example 1 the dam no longer needs water. Find the minimum length of pipe, in metres, to connect T, H, S and P.
Edges left: ST $70$, HT $90$, HS $120$, TP $130$, SP $150$. Keep ST and HT, skip HS (cycle), keep TP. Total $70 + 90 + 130 = 290$ m.
Exam style: A maps app's shortest route from Westmead into the city saves $3$ km, but it uses a toll road and runs through two school zones. Which is the best reason to take a longer route?
"Best" depends on what you value. The weights only measured distance, but cost and time also matter to the driver.
Coaching Centre