Home / IB Mathematics AHL 3.16 Walks, trails, paths, circuits, cycles AI HL Paper 2- Exam Style Questions

IB Mathematics AHL 3.16 Walks, trails, paths, circuits, cycles AI HL Paper 2- Exam Style Questions- New Syllabus

Question

A hygiene inspector, based in Town A, needs to visit restaurants in five towns (B, C, D, E, F) and return to Town A. The inspector must visit each town exactly once. The distances between the towns, in kilometers, are provided in the table below.

 

 ABCDEF
A 3128262223
B31 25202725
C2825 192224
D262019 2122
E22272221 24
F2325242224 

 

(a) Starting from Town A, apply the nearest neighbour algorithm to determine an upper bound for the total distance of the inspector’s journey. Specify the sequence of towns visited. [4 marks]

(b) By excluding Town A, use Prim’s algorithm starting at Town B to calculate a lower bound for the inspector’s journey distance. [5 marks]

(c) Using the minimum spanning tree from part (b), assess whether the lower bound represents a feasible journey for the inspector. [3 marks]

▶️ Answer/Explanation
Solution

(a) Using the nearest neighbour algorithm starting at A:

  1. From A: Nearest is E (22 km).
  2. From E: Nearest unvisited is D (21 km).
  3. From D: Nearest unvisited is C (19 km).
  4. From C: Nearest unvisited is F (24 km).
  5. From F: Nearest unvisited is B (25 km).
  6. From B: Return to A (31 km).

Order: A → E → D → C → F → B → A

Total distance: \( 22 + 21 + 19 + 24 + 25 + 31 = 142 \, \text{km} \)

\[ \boxed{\text{AEDCFBA}, \, 142 \, \text{km}} \]

(b) Apply Prim’s algorithm starting at B, excluding A:

Vertices: B, C, D, E, F

  1. Start at B. Nearest: D (20 km).
  2. From B, D: Nearest is C (from D, 19 km).
  3. From B, D, C: Nearest is E (from D, 21 km).
  4. From B, D, C, E: Nearest is F (from D, 22 km).

MST edges: BD (20), DC (19), DE (21), DF (22). Total MST weight: \( 20 + 19 + 21 + 22 = 82 \, \text{km} \).

Reconnect A using two shortest edges: AE (22), AF (23). Lower bound: \( 82 + 22 + 23 = 127 \, \text{km} \).

\[ \boxed{127 \, \text{km}} \]

(c) The MST (B, C, D, E, F) forms a tree with edges BD, DC, DE, DF. Reattaching A with edges AE and AF creates a graph with a cycle (e.g., A–E–D–C–A). A Hamiltonian cycle requires a single cycle without repeated edges, but this graph has degree 3 at D, making it impossible to form a valid tour without repeating edges or vertices. Thus, the lower bound of 127 km is not achievable.

\[ \boxed{\text{Not achievable}} \]

Scroll to Top