jmaths
IB Mathematics: Applications and Interpretation HL · AHL 1: Graph Theory · AHL 1.9
Minimum spanning trees: Prim's algorithm Problem set B One question at a time
Try each question on paper first. Open the working a line at a time, then say whether you had it.
Skills
-
Use Prim's algorithm, starting at A, on this graph. List the edges in the order they are added and find the total weight of the minimum spanning tree.
- Start at A. Edges in the order added: AB (2), BD (6), DE (3), BC (7), DF (10).
- Total weight: 2 + 6 + 3 + 7 + 10 = 28.
- Check: 6 vertices, 5 edges.
-
Use Prim's algorithm, starting at B, to find a minimum spanning tree of this graph. Write the edges in the order you add them.
- Start at B. Edges in the order added: BG (3), GE (2), GA (4), ED (6), EF (8), DC (10).
- Total weight: 3 + 2 + 4 + 6 + 8 + 10 = 33.
- Check: 7 vertices, 6 edges.
-
The table gives the weights of the edges of a graph. A dash means there is no edge. Use Prim's algorithm, starting at C, to find a minimum spanning tree. List the edges in order, draw the tree and state its total weight.
- Start at C. Edges in the order added: CE (3), EA (8), AD (4), EB (10), BF (6).
- Total weight: 3 + 8 + 4 + 10 + 6 = 31.
- Check: 6 vertices, 5 edges.
-
Use Prim's algorithm on this weighted adjacency table, starting at F. Write the edges in the order they are added and find the total weight of the tree.
- Start at F. Edges in the order added: FC (7), CG (11), GD (2), DE (4), EA (3), GB (8).
- Total weight: 7 + 11 + 2 + 4 + 3 + 8 = 35.
- Check: 7 vertices, 6 edges.
In context
-
The table shows the distances, in km, between six wind turbines A to F on an island. They must all be joined by cable to one network. Find the least total length of cable.
- Prim from A: AF (9), AE (11), EB (7), BC (17), BD (21).
- Total: 9 + 11 + 7 + 17 + 21 = 65 km.
- Any start vertex gives the same total.
-
A theme park has six zones A to F. The graph shows the possible cable routes, with lengths in units of 10 m. The network must join all zones with least total length.
(a) Use Prim's algorithm from A and state the total length of the network in metres.
- Prim from A: AB (4), BE (5), BF (6), FC (8), ED (10).
- Total: 4 + 5 + 6 + 8 + 10 = 33 units = 330 m.
(b) Cable costs £480 for each 10 m. Find the total cost.
- 33 × £480 = £15 840
-
The table gives the distances, in km, between six lighthouses A to F. A boat company wants a set of routes that joins all six with least total length.
(a) Use Prim's algorithm from B. List the edges in the order added.
- Start at B: BA (6), AE (14), EC (8), CD (12), BF (18).
(b) State the least total length.
- 6 + 14 + 8 + 12 + 18 = 58 km
Stretch
-
The table gives the weights of the edges of a graph.
(a) Use Prim's algorithm from B. List the edges in order and state the total weight.
- BE (2), BA (3), AD (4), DF (6), FC (7)
- 2 + 3 + 4 + 6 + 7 = 22
(b) Do the same from E.
- EB (2), BA (3), AD (4), DF (6), FC (7)
- 2 + 3 + 4 + 6 + 7 = 22
(c) What do you notice about the two trees? Explain.
- Both trees contain the same 5 edges.
- Different weights mean one minimum spanning tree: only the order changes.
-
The graph shows the possible pipe routes between the vertices, with lengths in km. A minimum spanning tree is built from A. Edge AB (length 9) then becomes unusable.
(a) Find the total weight of the original minimum spanning tree.
- Prim from A: AB (9), BC (2), CG (3), GE (7), EF (4), ED (6).
- Total 31.
(b) Use Prim's algorithm from A without edge AB. State the new total weight and how much longer it is.
- Delete AB and run Prim again: AG (10), GC (3), CB (2), GE (7), EF (4), ED (6).
- New total 32.
- 32 − 31 = 1.
jmaths.xyz · AI HL · AHL 1.9 Minimum spanning trees: Prim's algorithm