Library Further Decision Mathematics 1 WDM11 The Travelling Salesman Problem
AS Level · Further Decision Mathematics 1 WDM11

The Travelling Salesman Problem

Revise The Travelling Salesman Problem for Further Decision Mathematics 1 WDM11 (AS Level) — revision notes and instant AI marking. Free to start.

📖 Revision notes · preview
Edexcel A Level Further Maths · Decision 1

The Travelling Salesman Problem

Big idea: since there's no shortcut algorithm that guarantees the perfect route, we trap the true "shortest tour" between a lower bound (it can't be shorter than this) and an upper bound (we know a route that achieves this) — and squeeze that gap as tight as we can.

Summary — What This Chapter Covers

  • The problem itself: find the tour of least weight that visits every vertex and returns to the start — classical (visit each exactly once) vs practical (visit each at least once).
  • Table of least distances: turns a messy, incomplete "practical" network into a complete "classical" one, using the triangle inequality.
  • Upper bound: built from a minimum spanning tree, doubled, then improved with a "shortcut."
  • Lower bound: built with the "deleted vertex method" — remove a vertex, find the residual minimum spanning tree, add back the two cheapest connections.
  • Nearest neighbour algorithm: a quick greedy method that also gives an upper bound (a real route you can walk).
  • Solving completely: for small graphs, list every possible Hamiltonian cycle and find the cheapest — or show a found route matches the lower bound, proving it's optimal.

1. What Is the Travelling Salesman Problem?

Picture a delivery driver who has to visit six villages and get back to their depot, doing the least total driving possible. That's the whole problem in one sentence: find the tour of least weight in a network.

A tour is a walk that starts at one vertex, visits every other vertex, and returns to where it started. There are two flavours of this problem, and the difference is subtle but important:

Classical TSP Practical TSP
Classical TSPPractical TSP
RuleEach vertex visited exactly onceEach vertex visited at least once
NeedsA complete network alreadyCan work on an incomplete network
AnalogyA tour where you're not allowed to pass through the same town twiceA real road trip — sometimes you have to drive back through a town to reach the next one

Here's the key trick that ties them together: if you build a table of least distances for a practical network, you effectively turn it into a classical problem — because now every vertex has a direct "shortest path" connection to every other vertex, even if that path passes through other villages.

Why is there no perfect algorithm?
For a graph with n vertices, the number of possible tours grows explosively (a 6-vertex graph already has 120 possible Hamiltonian cycles). There's no known method that's guaranteed to find the shortest one without — in the worst case — checking huge numbers of routes. So instead, mathematicians settle for bounding the answer: proving it must lie between a lower and upper limit.
The golden rule
lower bound ≤ optimal tour weight ≤ upper bound
If the lower bound and upper bound are ever equal, you've found the exact optimal solution — no guessing needed.
Practice Question
Explain, in your own words, the difference between the classical and the practical travelling salesman problem, and explain why a table of least distances converts one into the other.

2. Building a Table of Least Distances

Think of this table as a "shortest possible commute" chart between every pair of villages — even ones with no direct road. Mathematically, every entry must satisfy the triangle inequality:

Triangle inequality
The longest side of a triangle ≤ the sum of the other two sides.
In network terms: going directly between two vertices should never be longer than going via a detour. If it is longer, the "direct" route in your table isn't actually shortest — replace it.

The 5-step method

  1. Rule out the diagonal. Put a dash/line through every cell where a vertex meets itself — there are no loops.
  2. Fill in direct connections for one vertex — its distance to every vertex it's directly joined to. Check by inspection that each is actually the shortest route (sometimes going the "long way round" beats the direct edge).
  3. Fill the gaps — for vertices that aren't directly connected, find the shortest route between them by tracing through the network.
  4. Copy the row into the matching column — the table is symmetric (undirected network), so whatever you found for row A also belongs in column A.
  5. Repeat for the next vertex until the whole table is full.
Examiner tip
The table has a line of symmetry down the leading diagonal. Complete one triangle-half carefully, then just copy it across — don't recalculate everything twice!

Worked example

Six villages A–F are connected by roads of varying "walking time" weight. After applying the 5-step method (finding shortcuts like A→C→E = 13 instead of a longer direct route), the completed table looks like this:

ABCDEF
A147111321
B141318139
C7135614
D111851018
E13136108
F21914188

Highlighted cells = calculated shortest paths (not direct edges), e.g. A→E = A→C→E = 7+6 = 13.

Practice Question
In the table above, the direct road from D to F is 20 minutes. Explain why the table shows 18 instead, and show the calculation.

3. Finding an Upper Bound (Minimum Connector Method)

An upper bound is a "worst case that's still good" — it's a real, honest route you could actually walk, so we know for certain the true optimal answer is no worse than this number. The smaller you can make your upper bound, the more useful it is.

The logic
Take the minimum spanning tree (the cheapest way to connect every vertex with no cycles) → double every edge (so you can walk there and back along each branch, guaranteeing every vertex is visited and you return home) → then remove one duplicated "there and back" trip by replacing it with a smarter shortcut.

The 3-step method

  1. Find the minimum spanning tree. Use Prim's algorithm if you have a table of least distances, or Kruskal's algorithm if you only have the graph.
  2. Double the weight of the minimum spanning tree. This guarantees every vertex is visited and you get back to the start (walking each branch there-and-back).
  3. Reduce the weight by finding a shortcut — replace a repeated "there and back" pathway with a single direct edge that isn't in the spanning tree, if one exists and is cheaper.

Worked example (same 6-village network)

Step 1 — Kruskal's algorithm (sort edges by weight, add smallest first, skip any edge that would create a cycle):

CD(5), CE(6), AC(7), EF(8), BF(9)  →  all 6 vertices connected, spanning tree complete

Step 2 — Double it:

Tree weight = 5+6+7+8+9 = 35  →  Initial upper bound = 35 × 2 = 70 minutes

Step 3 — Find a shortcut: The spanning tree forces you to repeat the path A→C→E→F→B (weight 30) there-and-back. But there's a single direct edge AB = 14 that isn't in the tree!

Saving = 30 − 14 = 16  →  Improved upper bound = 70 − 16 = 54 minutes

Quick mental shortcut
You can also write this as one calculation: 70 − 30 + 14 = 54 (subtract the repeated pathway, then add back the single shortcut edge).
Practice Question
Why must you always double the minimum spanning tree weight rather than just using it directly as the upper bound?

4. Finding a Lower Bound (Deleted Vertex Method)

If the upper bound is "here's a route that definitely works," the lower bound is the opposite: "here's proof the answer can't possibly be cheaper than this." We want this number as high as possible, to squeeze the gap.

The 5-step method

  1. Delete a vertex and all its edges from the network entirely.
  2. Find the minimum spanning tree for what's left — this is called the residual minimum spanning tree (RMST). Note its total weight.
  3. Reconnect the deleted vertex using its two cheapest individual edges back to the tree. Add their weights to the RMST total.
  4. Repeat steps 1–3 by deleting a different vertex each time (if the question asks for the best possible lower bound).
  5. Take the maximum of all the values you calculated — that's the best (tightest) lower bound.
Why does deleting a vertex work?
Every valid tour visits each vertex exactly twice-worth of "connection" (once arriving, once leaving). If you remove a vertex, the rest of the tour minus that vertex must still form a connected structure — and the cheapest such structure is the minimum spanning tree. Adding back the two cheapest links to reconnect the deleted vertex gives a legitimate lower limit on what any tour through that vertex must cost.

Worked example — deleting vertex A

Step 1: Delete A and all its edges.

Step 2: Apply Prim's algorithm to the remaining B, C, D, E, F:

Edges added: BF(9), EF(8), CE(6), CD(5)  →  RMST weight = 9+8+6+5 = 28

Step 3: Reconnect A using its two shortest edges: AC(7) and AD(11).

Lower bound = 28 + 7 + 11 = 46 minutes

Now compare — deleting vertex E instead:

RMST (without E): AC(7), CD(5), BC(13), BF(9) = 34
Reconnect E with its two shortest edges: CE(6), EF(8)
Lower bound = 34 + 6 + 8 = 48 minutes

Which one do we keep?
48 > 46, so deleting vertex E gives the better (higher) lower bound. If a question asks for the best possible lower bound, you'd try deleting every vertex and keep the highest result.
Practice Question
A student deletes vertex F from the table and finds a residual minimum spanning tree weight of 31, with F's two shortest connecting edges being EF(8) and BF(9). What lower bound does this give? Is it better or worse than deleting E (48 minutes)?

5. The Nearest Neighbour Algorithm

This is a much faster (but greedier) way to get an upper bound. Instead of building a spanning tree, you just walk to the closest unvisited village every single time, like a slightly lazy tourist who always picks the nearest attraction next. It won't always give the best route, but it's quick and always gives a valid, walkable tour.

Important restriction
This algorithm can only be used on a network that is complete and satisfies the triangle inequality. If it isn't already complete, find the table of least distances first!

The 5-step method

  1. Choose a starting vertex.
  2. Move to the nearest unvisited vertex from the current one (smallest weight edge). If tied, pick either. Cross out edges leading back to already-visited vertices so you never revisit them early.
  3. Once every vertex has been visited, add one final edge back to the starting vertex to close the loop.
  4. Add up all the edge weights in your Hamiltonian cycle — this total is your upper bound.
  5. (Optional) Repeat from a different starting vertex each time, and keep the smallest total — that's the best possible upper bound from this method.

Worked example — starting at A

Tracing through the table, always picking the cheapest unvisited option:

A → C (7) → D (5) → E (10) → F (8) → B (9) → back to A (14)

Hamiltonian cycle: ACDEFBA

Total weight = 7 + 5 + 10 + 8 + 9 + 14 = 53 minutes

Nearest Neighbour vs Prim's — don't mix them up!
Nearest neighbour only looks at edges from the current vertex you're standing at.
Prim's algorithm looks at edges from any vertex already added to the tree so far. This is the single most common mix-up examiners test for — learn this distinction cold.
Practice Question
Using the table of least distances from Topic 2, apply the nearest neighbour algorithm starting at vertex B. List the order of vertices visited and calculate the total weight.

6. Solving the Problem Completely

For small networks, you can brute-force it: list every possible Hamiltonian cycle and pick the cheapest. This isn't practical for big networks (a 6-vertex complete graph already has 120 possible cycles!), but it's the gold-standard method to prove a solution is optimal when combined with the bounds you've already found.

How many possible cycles?
A complete graph with n vertices has (n−1)!/2 distinct Hamiltonian cycles.
3 vertices → 2 cycles  ·  4 vertices → 6 cycles  ·  5 vertices → 24 cycles  ·  6 vertices → 120 cycles

The "prove it's optimal" trick

You almost never actually check all 120 cycles by hand in an exam. Instead, the typical pattern is:

  1. Find a lower bound (deleted vertex method) — say it's 53.
  2. Find a specific route (often given, or found via nearest neighbour / by inspection) starting at the vertex specified.
  3. Calculate that route's total weight.
  4. If the route's weight equals the lower bound, you've proven it's optimal — nothing could possibly be cheaper, and you've found a real route matching that exact cost!

Worked example

Given a lower bound of 53 minutes, and starting at vertex A, we find the route:

AB(14) + BF(9) + EF(8) + CF... wait — route ABFECDA:
AB(14) + BF(9) + FE(8) + EC(6) + CD(5) + DA(11) = 53

Conclusion
Route ABFECDA has weight 53 minutes — exactly matching the lower bound of 53. Since no tour can possibly cost less than the lower bound, and we've found an actual walkable route at that exact cost, this route is proven optimal. No need to check the other 119 possible cycles!
Practice Question
A network has a lower bound of 61 and the best route found by nearest neighbour is 65. Can you conclude the nearest neighbour route is optimal? Explain.

What to Memorise

Key Terms

TermMeaning
TourA walk starting and ending at the same vertex, visiting every other vertex along the way.
Hamiltonian cycleA cycle that visits every vertex in a graph exactly once before returning to the start.
Classical TSPEach vertex visited exactly once — requires a complete network.
Practical TSPEach vertex visited at least once — works on incomplete networks.
Table of least distancesA matrix of shortest possible distances between every pair of vertices; converts practical → classical.
Triangle inequalityThe longest side of a triangle ≤ sum of the other two sides — the rule that validates a table of least distances.
Upper boundA real, walkable tour weight — proves the optimal solution is no worse than this.
Lower boundA theoretical minimum — proves the optimal solution can't be cheaper than this.
Residual minimum spanning tree (RMST)The minimum spanning tree formed after deleting one vertex from the network.
Deleted vertex methodThe algorithm for finding a lower bound: delete a vertex, find the RMST, reconnect with the two cheapest edges.
Nearest neighbour algorithmGreedy method: always move to the closest unvisited vertex; gives an upper bound.

Key Formulas / Rules

lower bound ≤ optimal tour ≤ upper bound
Upper bound = 2 × (minimum spanning tree weight) − (shortcut saving)
Lower bound = (residual minimum spanning tree weight) + (two cheapest edges reconnecting the deleted vertex)
Number of Hamiltonian cycles in a complete graph with n vertices = (n−1)!/2

Concepts Checklist

Exam Tips & Common Mistakes

Mixing up nearest neighbour and Prim's algorithm
This is the #1 examiner-reported error. Nearest neighbour only considers edges from your current position. Prim's algorithm considers edges from every vertex already in the tree. Say this distinction out loud until it's automatic.
Forgetting to double the spanning tree for the upper bound
A spanning tree alone isn't a tour — it has dead ends. You must double every edge (there-and-back) before applying any shortcut, or your upper bound will be invalid.
Using the direct edge instead of checking for a shorter route
When building a table of least distances, always check by inspection whether a direct edge is genuinely the shortest path — sometimes going via another vertex is cheaper (like D→F = 20 direct vs D→E→F = 18).
Only reconnecting with one edge in the lower bound method
You must add back exactly two edges to reconnect the deleted vertex — because in any valid tour, every vertex needs exactly two connections (one arriving, one leaving).
Assuming a route is optimal just because it "looks short"
A route is only proven optimal when its weight exactly equals a valid lower bound. Never claim optimality just because you couldn't quickly think of anything cheaper.
Not checking the network is complete before nearest neighbour
The nearest neighbour algorithm requires a complete network satisfying the triangle inequality. If the original graph isn't complete, build the table of least distances first.
What examiners actually look for

• Clearly labelled steps (STEP 1, STEP 2...) showing method, not just final answers.

• Correct units carried through (e.g. "minutes") in your final bound.

• Explicit statement of which edges were chosen and why, especially for Prim's/Kruskal's/nearest neighbour.

• A clear concluding sentence, e.g. "Since the route weight (53) equals the lower bound (53), this is the optimal solution."

Also in the full note
  • Exam Tips & Common Mistakes
What's inside
📖 Revision notes ✦ AI flashcards ✓ Instant AI marking

Read the full The Travelling Salesman Problem notes free

That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.

Unlock the full notes free →

More Further Decision Mathematics 1 topics