Geometry & trigonometry · AI HL
Route inspection and travelling-salesperson problems
Learn route inspection (the Chinese postman problem): cover every edge, compare odd-vertex pairings and find the shortest closed route. Then distinguish it from travelling-salesperson tours.
Course focus: AI HL · First-assessment-2021 course. The sections distinguish the mathematical idea, the calculation and its interpretation.
Before you start: Weighted connected graphs, vertex degree and shortest paths.
Build it from the beginning
HL contentRoute inspection asks you to cover edges; a travelling-salesperson tour visits vertices and returns to the start. For a closed edge-covering walk, odd-degree vertices must be paired through repeated paths. Distances along paths may matter more than single edge weights.
A first walkthrough
A connected graph has exactly two odd vertices joined by a shortest path of weight 4. Its edge weights total 20. Find the shortest closed edge-covering walk weight.
- A closed Euler walk requires all degrees even.
- Repeat a shortest path between the two odd vertices, adding weight 4.
- The required total is 24. An open walk could have a different requirement.
The foundations behind the method
Understand what the symbols mean
A route problem must specify whether the objects to cover are edges or vertices. In servicing a network, every edge carries a task; in visiting destinations, vertices carry the task. Returning to the start is common to both but does not make them the same optimisation problem.
How the ideas connect
Parity explains when edge repetition is unavoidable, while bounds explain what can be claimed about a difficult vertex-tour problem. A route-inspection pairing has an exact guarantee under the stated undirected assumptions. A nearest-neighbour tour is instead a heuristic; a separate lower bound is needed to certify optimality.
Start with the idea
Build your understanding
Parity
Every arrival in a closed edge-covering trail must be paired with a departure. This drives the odd-vertex correction.
Certification
Finding a tour proves an upper bound; proving no cheaper tour exists requires a lower bound or another exact argument.
Compare the approaches
Choose by the information in the question, rather than the formula you recognise first.
Odd-vertex pairing
When it helpsUse for closed undirected route inspection.
Check before using itPairing costs are shortest-path distances, which may use several original edges.
Tour bounds
When it helpsUse for a visit-every-vertex tour.
Check before using itA lower-bound structure need not be a feasible tour, and a heuristic upper bound need not be optimal.
Your method plan
- State edge or vertex coverage and start/end requirements.
- Compute parities or construct feasible and lower-bound structures.
- Report the exact optimum only when its justification supports that claim.
Learn the methods
Learn step by step
1. Decide what must be visited
Route inspection, also called the Chinese postman problem, asks for a shortest closed walk that covers every edge at least once. Think of a vehicle checking every road: reaching each junction is not enough if a road between junctions is missed. A travelling-salesperson problem instead asks for a tour visiting each required vertex and returning to the start. A Hamiltonian cycle visits each vertex once apart from the return; an Euler circuit uses every edge once. Read the coverage and start/end requirements before choosing a method. The odd-vertex pairing method below applies to a connected, undirected weighted network with nonnegative edge weights and a required return to the starting vertex.
2. Euler parity controls edge coverage
In a connected undirected graph, a closed Euler trail exists when every vertex has even degree. Entering and leaving pairs incident edges at each visit. An open trail can have exactly two odd-degree vertices as its endpoints. These parity statements concern connected graphs after ignoring isolated vertices with no edges. They are not tests for Hamiltonian cycles. Directed versions need balanced in- and out-degrees plus appropriate reachability conditions.
Worked example: An already Eulerian network
A four-edge cycle has weights 2,3,4,5. Find its minimum closed route-inspection cost.
- Every vertex has degree 2 and the cycle is connected.
- It therefore has a closed Euler trail using each edge exactly once.
- The edge total is 2+3+4+5=14, so no duplication is required.
- Any edge-covering route must pay at least that original total; traversing the cycle attains it and proves optimality.
3. Make an undirected network Eulerian
If some degrees are odd, duplicate routes to pair odd vertices and make all degrees even. The duplicate cost should use shortest-path distances between paired odd vertices, not just direct edge weights. Compare all pairings when the set is small and choose the least total addition. Add this cost to the sum of all original edge weights. This solves the closed undirected route-inspection problem under its standard assumptions.
Odd vertices force repeated travel
Closed undirected route inspection
Why this formula works
A closed walk must give each vertex even degree in the traversed multigraph. Duplicating paths between paired odd vertices makes their degrees even while leaving intermediate parities unchanged. Every original edge still has to be covered, so its total is the unavoidable base cost; shortest duplicated pairings add the least necessary extra.
\(\text{minimum cost}=\sum_{e\in E}w(e)+\text{minimum odd-vertex pairing cost}\).
Quick example
If the original total is 16 and the only two odd vertices are connected by a shortest route costing 2, the minimum closed inspection cost is 18.
Worked example: Inspect the five-edge network
AB=1, BC=2, AC=3, CD=4 and BD=6. Find the minimum closed edge-covering cost.
- The original edge total is 16. Degrees are A=2, B=3, C=3 and D=2.
- The odd vertices are B and C. Their shortest connecting route is the edge BC of weight 2.
- Duplicate BC; every degree is now even.
- The total is 18. One closed route is A–B–D–C–B–C–A, with every original edge covered.
Worked example: Compare all three pairings of four odd vertices
A complete undirected network has AB=2, AC=4, AD=5, BC=5, BD=4 and CD=3. Find the minimum closed route-inspection cost.
- All four vertices have degree 3, so all four are odd. The original edge total is 23.
- Check shortest paths before pairing. Here each direct edge is a shortest route between its endpoints.
- The three pairing costs are AB+CD=5, AC+BD=8 and AD+BC=10. Choose AB and CD.
- Duplicate AB and CD, making every degree even. The minimum cost is 23+5=28.
- A route attaining 28 is A–B–A–C–D–C–B–D–A. It covers all six original edges, repeats only AB and CD, and returns to A.
4. Construct an upper bound for a tour
Any feasible complete tour gives an upper bound on the least possible travelling-salesperson cost. Nearest neighbour repeatedly visits the nearest unvisited vertex, then returns to the start. It can produce a poor tour and depends on the starting vertex. Try permitted alternative starts or improve a tour by swapping edges, while keeping every vertex and the final return. A heuristic’s feasible answer is evidence of an upper bound, not proof of optimality.
5. Construct and use a lower bound
One common lower bound deletes a chosen vertex, finds a minimum spanning tree on the remaining vertices, then adds the two cheapest incident edges from the deleted vertex. Every tour must use two incident edges there, and removing that vertex from a tour leaves a spanning path whose cost is at least the minimum spanning-tree cost. Use the required method and test other deletions if appropriate. The lower-bound structure need not itself be a valid tour.
Tour bounds
Why this formula works
A lower bound is a cost every feasible tour must meet or exceed. An upper bound is the cost of a tour you can actually take. Equality proves optimality by trapping the optimum at one value. Different bounds leave uncertainty and should not be presented as an exact solution.
\(L\le C_{\mathrm{optimal}}\le U\).
Quick example
If a feasible tour costs 25 and a valid lower bound is 23, the optimum is between 23 and 25; 25 is not yet proved minimal.
Worked example: A matching tour bound
A complete four-vertex cost network has AB=2, AC=4, AD=3, BC=1, BD=5, CD=2. Bound a tour through every vertex.
- The feasible tour A–B–C–D–A costs 2+1+2+3=8, an upper bound.
- Delete A. A minimum tree on B,C,D uses BC=1 and CD=2, total 3.
- Add the two cheapest edges incident to A, AB=2 and AD=3, giving lower bound 8.
- Since the bounds agree, the tour of cost 8 is optimal. The lower-bound calculation alone would not have supplied the feasible tour.
6. State what a bound proves
If a valid lower bound equals a feasible tour cost, the tour is optimal. If they differ, the optimum lies between them; reporting the upper bound as the exact optimum is unjustified. Include units and the network assumptions: symmetric or asymmetric costs, whether roads must all be serviced, and whether repeat visits are allowed. Route-inspection and travelling-salesperson results cannot be swapped merely because both return to a starting vertex.
Quick formula reference
For revision once you understand the methods above. Check the conditions before using a formula.
Closed undirected route inspection
\(\text{minimum cost}=\sum_{e\in E}w(e)+\text{minimum odd-vertex pairing cost}\).
Return to the explanation →Learn to diagnose an error
Spot the mistake
The statement below is incorrect. Identify the missing condition or reasoning before opening the explanation.
A nearest-neighbour tour must be optimal because every step chooses the shortest available edge.
Explain and repair the mistake
Local choices can leave an expensive return or force a costly final connection. The tour supplies a valid upper bound only. Compare it with a justified lower bound or an exhaustive solution for a small instance before claiming optimality.
Connect and apply
Put the ideas together
A more demanding application of this guide’s methods. This is a learning stage; any additional HL content is labelled separately.
Why the final return matters
A nearest-neighbour procedure has visited every vertex. Can its accumulated cost already be used as a tour upper bound?
- A tour requires a return to its starting vertex.
- The last-to-first edge must be allowed and included in the total.
- Without it, the computed route is an open path rather than the requested tour.
- Only the completed feasible tour provides an upper bound on the closed-tour optimum.
What if the last-to-first connection is not a direct edge?
Check your reasoning
Use the task’s cost-network definition. If shortest-path costs complete the network, include that route cost; if a Hamiltonian cycle in the original graph is required, a missing edge may make the proposed tour infeasible.
Common mistakes and how to avoid them
- Local choices can leave an expensive return or force a costly final connection. The tour supplies a valid upper bound only. Compare it with a justified lower bound or an exhaustive solution for a small instance before claiming optimality.
- Pairing costs are shortest-path distances, which may use several original edges.
- A lower-bound structure need not be a feasible tour, and a heuristic upper bound need not be optimal.
Practise independently
Build confidence, then apply it
Try each question before opening its hint or solution. If a method is new, return to the walkthrough, then try again. These learning stages describe the practice sequence; additional HL content is labelled separately.
- 1
Build confidence
HL extensionWhy repeat a shortest path rather than any path between those vertices?
Need a starting point?
The parity repair is required, but its added cost should be minimal.
Show the worked solution
- Every suitable connecting path repairs the two odd degrees.
- The shortest adds the least weight, giving the optimum for this two-odd-vertex case.
- 2
Apply and explain
HL extensionA tour has an established lower bound 18 and a constructed route of length 21. What follows?
Need a starting point?
A bound limits the optimum; a route proves feasibility.
Show the worked solution
- The optimum is at least 18 and at most 21.
- The route of length 21 is not proved optimal unless the bounds meet or another argument establishes it.
- 3
Check your understanding
There are four odd vertices. How many complete pairings must be compared in a small route-inspection calculation?
Show the worked solution
There are three pairings: choose a partner for one fixed odd vertex, with three choices; the remaining pair is then determined. Compare their shortest-path pairing costs.
- 4
Use the method
A connected undirected graph has exactly two odd vertices. Can it have a closed Euler trail without duplicating edges?
Show the worked solution
No. Its Euler trail can start at one odd vertex and end at the other, but a closed trail requires every vertex even. Duplicating a connecting route changes those two parities and allows closed coverage.
Finished? Use the linked question bank below to practise selecting the method without a guide telling you which rule to use.
Using these methods in exam questions
AI Paper 1
GDC requiredShort-response questions still need mathematical setup and interpretation. Choose the correct tool, enter the model or data carefully, and check units and rounding.
AI Paper 2
GDC requiredExtended-response questions connect several steps. Keep intermediate values at full precision and explain how each result answers the context.
For this topic: Sketch and label the relevant triangle or curve. Show which angle and radius a formula uses, check degree or radian mode, and give length, area and volume in the correct units.
Paper 3: build a connected argument
Both AA HL and AI HL Paper 3 contain two extended problem-solving questions. A question develops a theme, so keep useful earlier results, test small cases and explain any proposed general rule. A calculator pattern can suggest a result; your mathematical reasoning must support it.
- Identify what the first part establishes and record the conditions under which it holds.
- When a later part introduces a new definition or model, connect it to methods you already know rather than assuming a new formula must have been memorised.
- Check the conclusion against an earlier numerical case and explain its meaning or limitation.
For the first-assessment-2021 courses. IB assessment reference ↗
Find a specific method or formula
Now practise the method
If you opened this guide from a question, return to that tab and try the method without looking at the example. Your answer stays in the question tab.
Practise this subtopic →Want a broader practice session? Explore IB Maths AI HL practice questions →Try free IB Maths exam-style questions and worked solutions →
Original Arc Practice teaching notes for Maths AI. Core and HL sections are distinguished above. These notes follow the first-assessment-2021 course and are not an official IB publication or a complete syllabus checklist. IB course reference. Report a correction.