7.04e, 7.04f - Route inspection and choosing algorithms
Plan a shortest inspection journey that covers every road, including necessary repetitions. You will pair odd vertices, compare all pairings of up to six odd vertices, count those pairings, adapt the endpoints, and choose an algorithm from the practical objective.
Closing an inspection route
An inspector must cover every road and return to the depot. Is it enough to repeat the road joining the two nearest odd junctions? With four or six odd junctions, that locally cheap choice can leave an expensive problem behind. The whole pairing matters.
You already know
A connected undirected graph has an Eulerian circuit exactly when every vertex has even degree. With exactly two odd vertices, it has an Eulerian trail starting at one and finishing at the other. Traversing an edge again can be modelled by adding a parallel copy.
The road-inspection model here is a connected undirected network with non-negative weights. Every edge must be traversed at least once; vertices and edges may be revisited. If every degree is even, an Eulerian circuit uses every edge exactly once, so the original total weight is already the minimum closed inspection weight.
Repeating a path changes the parity of its endpoints. Every internal vertex gains two incidences and keeps its parity. Consequently, pairing the odd vertices and duplicating the paths between each pair makes every degree even.
Closed route inspection
Let be the sum of all original edge weights. Find shortest-path distances between the odd vertices, and choose a complete pairing of those vertices with minimum total distance . Then
If there are no odd vertices, . Each original edge contributes to once, however many times the final route uses it.
In the formula booklet.
Shortest connecting paths are essential: a direct edge may cost more than an indirect journey, and a pair need not be directly connected. Dijkstra supplies the distances if they are not obvious.
Why does the least pairing give an optimum, rather than just one possible route? In any closed inspection, the extra traversals must correct the original odd degrees. Those extra edges can be separated into paths pairing the odd vertices, together with possible closed circuits. Non-negative circuits cannot reduce the cost, and each connecting path costs at least its shortest-path distance. Thus no closed inspection can beat the least pairing total; duplicating the selected shortest paths attains it.
Worked example 1: two odd vertices
Question. Roads form triangle , with , , , and a tail , with , . Find the minimum inspection weight, starting and finishing at .
Plan. Find odd vertices, duplicate a shortest path between them, then add its weight to the original total.
Why this step? Starting at does not make an odd vertex; a closed route must have even degree everywhere.
Answer. Minimum weight , duplicating and .
Check. The route uses every road and has weight .
Change only the length of . It appears once in the original total and once in the duplicated path.
Worked example 2: a longer bridge
Question. In example 1, has weight instead of . Find the new minimum closed inspection weight.
Plan. Recalculate both the original total and the shortest path between the unchanged odd vertices.
Why this step? The tail is a dead end, so each of its roads must be used in both directions on a closed inspection journey.
Answer. .
Check. Increasing the tail edge by increases the closed journey by , because that edge is traversed twice.
With two odd vertices there is only one pairing, but you must still use a shortest path between them.
Four odd vertices
Four odd vertices have three complete pairings. Compare all three sums before choosing what to repeat.
[DIAGRAM: asset_name: Four odd junctions; asset_slug: h245_7_04_four_odd; caption: Every vertex has odd degree; repeating AB and CD gives the least additional weight 6; description: Complete undirected network A B C D with AB 3 AC 4 AD 8 BC 2 BD 5 CD 3. Highlight the repeated pairing AB and CD as parallel dashed arcs. Show pairing totals AB plus CD equals 6, AC plus BD equals 9, AD plus BC equals 9, where shortest AD distance is 7 through C.]

For odd vertices , once 's partner is chosen, the other pair is forced. The possibilities are , , . Pair costs refer to shortest paths, not necessarily individual edges.
Worked example 3: comparing all pairings
Question. Find the minimum closed inspection weight for the pictured network.
Plan. Calculate its original weight, find the six pair distances, then compare the three pairing totals.
Every vertex has degree . The shortest distances are
Here through , shorter than the direct edge of weight .
| Pairing | Additional weight |
|---|---|
Why this step? The individually cheapest pair leaves the expensive pair ; its combined cost loses to .
Answer. Duplicate and . Minimum weight .
Check. Each vertex receives one extra incidence, changing its degree from to ; the connected augmented network is Eulerian.
Change only from to . Recalculate shortest paths before comparing the same three pairings.
Worked example 4: an indirect distance changes
Question. Find the minimum closed inspection weight after this change.
Plan. Update the original total and all affected pair distances.
The other pair distances stay for .
Why this step? Changing one road can improve another pair's shortest distance, such as , even though that pair's direct road did not change.
Answer. Duplicate and , giving minimum weight .
Check. All four odd degrees become even and is the least complete pairing sum.
The opening question now has a counterexample: in example 3, greedily taking is worse than pairing and .
Watch out
Wrong: pair the closest two odd vertices, then accept whatever remains. Right: minimise the sum over a complete pairing of all odd vertices.
Find shortest pair distances before using the three-case comparison.
Six odd vertices
With six odd vertices, organise the fifteen pairings so that none is missed or counted twice.
[DIAGRAM: asset_name: Six odd junctions; asset_slug: h245_7_04_six_odd; caption: The nine original roads have total weight 36; all six junctions have degree 3; description: Hexagonal undirected network A B C D E F with cycle edges AB 2 BC 3 CD 4 DE 3 EF 2 FA 4 and chords AD 7 BE 6 CF 5. Highlight optimal duplicated edges AB CD EF, total 8. Place chord labels apart from crossings, and label crossings as having no junction.]

Fix 's partner in turn as . For each choice, the remaining four vertices have exactly the three pairings from part 2. That makes five groups of three, rather than an unstructured search.
Worked example 5: all fifteen cases
Question. Find the minimum closed inspection weight for the six-junction network in the diagram.
Plan. Use shortest-path distances, then compare the fifteen complete pairings grouped by 's partner.
The original total is
Every vertex has degree . The shortest distances are:
| – | ||||||
| – | ||||||
| – | ||||||
| – | ||||||
| – | ||||||
| – |
For example, through , and through .
| Pairing | Cost | Pairing | Cost | Pairing | Cost |
|---|---|---|---|---|---|
Why this step? Each row fixes 's partner and exhausts the three possibilities left, so every complete pairing is considered exactly once.
Answer. Duplicate , giving minimum closed weight .
Check. Each of the six vertices gains one incidence. The augmented connected network has all even degrees.
Change only from to . Its effect is not limited to pairings explicitly containing : shortest distances such as and also change.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account