Menu
Sign up Sign in

AI HL · AHL 1

Graph Theory

AHL 1.10

The Chinese postman problem

AHL 1.10

The Chinese postman problem

Target: I can find the degree of every vertex, list the odd vertices and say when no edge needs repeating. (+4 more)

By the end of this section

Key points

The problem

  • The postman must walk along every edge at least once and return to the start. The aim is the shortest total length.
  • The total weight of all the edges is the least the route can be. Any extra length comes from edges walked a second time.
  • Route length = total weight of all the edges + weight of the repeated edges.

Odd vertices

  • The degree of a vertex is the number of edges at it. A vertex is odd if its degree is odd.
  • A graph always has an even number of odd vertices: 0, 2, 4, and so on.
  • If every vertex is even, a route that uses each edge once and returns exists. Nothing is repeated, and the route length is the total weight.
  • Repeating an edge adds 1 to the degree at both of its ends. The repeats must turn every odd vertex into an even one.

Two odd vertices

  • Repeat the shortest path between the two odd vertices.
  • The shortest path may use several edges. Check every path, not just the direct edge.
  • Write down which edges are repeated, then add their weights to the total.

Four odd vertices

  • Call the odd vertices P, Q, R and S. There are three pairings: PQ and RS, PR and QS, PS and QR.
  • For each pair, find the shortest path between them. Add the two lengths for each pairing and compare. Choose the smallest.
  • State the edges that are repeated, then add their weights to the total weight.
  • To write out a route, start at A and use every edge once, plus each repeated edge a second time. Check that you end at A and that the number of edges walked is right.

Finishing somewhere else

  • If the route may finish at a different vertex, the start and the finish can stay odd. Only the other odd vertices must be made even.
  • Exactly two odd vertices, starting at one and finishing at the other: nothing is repeated. The route length is the total weight.
  • Four odd vertices, starting and finishing at two of them: repeat the shortest path between the other two. This is usually shorter than a route that returns to the start.
  • Compare every path between the two vertices. The direct edge is not always the shortest.

Explore: the Chinese postman problem

The postman walks every edge and returns to the start. Find the odd vertices, then choose which edges to walk twice. Press Next to move on.

Odd vertices
Edges repeated

  1. Why does the route never come out shorter than the total weight of the edges?
  2. What happens to the degrees of the two ends of an edge when you walk it twice? Why must the odd vertices be paired up?
  3. On a graph with two odd vertices, is the direct edge between them always the best one to repeat? Find a graph where it is not.
  4. Try to draw a graph with exactly one odd vertex. What goes wrong?

Worked examples

Problems like the ones in class. Pick one, try it, then open the working.
Two odd vertices

A park keeper must walk along every path in the park, starting and finishing at A. The graph shows the paths and their lengths in metres. Find the length of the shortest route and state which paths are walked twice.

1223413710ABCFED
Working
  1. Degrees

    A 2, B 3, C 2, F 2, E 3, D 2

    Odd vertices: B and E. Two odd vertices: repeat the shortest path between them.

  2. Paths

    B–C–D–E = 9; B–E = 10; B–A–F–E = 32

    The shortest path from B to E is B–C–D–E, length 9.

  3. 1223413710ABCFED
    Repeated edges

    Repeat BC (2), CD (3), DE (4)

    These edges are walked twice.

  4. Length

    51 + 9 = 60

    Total weight of the edges, 12 + 2 + 3 + 4 + 13 + 7 + 10 = 51, plus the repeated path.

Video walkthrough coming
Writing out a route

A delivery rider must travel along every road shown, starting and finishing at A. The numbers are lengths in km. Find the length of the shortest route and write down a route that has this length.

57841523ABCDE
Working
  1. Degrees

    A 4, B 2, C 3, D 3, E 2

    Odd vertices: C and D. Two odd vertices: repeat the shortest path between them.

  2. Paths

    C–A–D = 5; C–D = 8; C–B–A–D = 15; C–A–E–D = 21

    The shortest path from C to D is C–A–D, length 5.

  3. 57841523ABCDE
    Edges

    7 edges + 2 repeated = 9 edges walked

    Use each edge once and the repeated edges CA (2), AD (3) a second time.

  4. Route

    A–B–C–A–C–D–A–D–E–A

    This is one possible route. Others of the same length also work.

  5. Length

    44 + 5 = 49

    Total weight 44, plus the repeated path 5.

Video walkthrough coming
Four odd vertices

A council gritter must drive along every road shown, then return to its start. The numbers are lengths in km. Find the length of the shortest route and state which roads are driven twice.

11613710298ABCDEF
Working
  1. Degrees

    A 2, B 3, C 3, D 3, E 3, F 2

    Four odd vertices: B, C, D, E. Pair them up in the three possible ways.

  2. Three pairings

    B–C (13) and D–E (2): total 15; B–D (7) and C–E (10): total 17; B–D–E (9) and C–E–D (12): total 21

    For each pair, use the shortest path between them. Compare the three totals.

  3. 11613710298ABCDEF
    Smallest

    Repeat BC (13), DE (2)

    The smallest total is 15, so these edges are walked twice.

  4. Length

    66 + 15 = 81

    Total weight of the edges, 66, plus the repeated edges.

Video walkthrough coming
Pairing odd vertices on a small graph

A surveyor must inspect every path in the garden shown and return to the start. The numbers are lengths in metres. Compare the three pairings of the odd vertices and find the length of the shortest route.

141139621013ABCDEF
Working
  1. Degrees

    A 3, B 3, C 3, D 3, E 2, F 2

    Four odd vertices: A, B, C, D. Pair them up in the three possible ways.

  2. Three pairings

    A–B (14) and C–D (3): total 17; A–D–C (12) and B–C–D (14): total 26; A–D (9) and B–C (11): total 20

    For each pair, use the shortest path between them. Compare the three totals.

  3. 141139621013ABCDEF
    Smallest

    Repeat AB (14), CD (3)

    The smallest total is 17, so these edges are walked twice.

  4. Length

    68 + 17 = 85

    Total weight of the edges, 68, plus the repeated edges.

Video walkthrough coming
Finishing at a different vertex

A runner plans a training route that covers every path of a nature reserve at least once. The graph shows the paths between six viewpoints, with lengths in km. The route must start at the car park A and finish at the cafe B. Find the length of the shortest route.

16107651243DBCEFA
Working
  1. Degrees

    A 3, B 3, C 2, D 3, E 2, F 3

    Odd vertices: A, B, D, F. The route may finish at a different vertex, so A and B can stay odd.

  2. Fix the other two

    Only D and F must be made even

    Repeat the shortest path between D and F. A path with more edges can be shorter than the direct edge.

  3. 16107651243DBCEFA
    Shortest path

    D–E–F = 11; D–F = 16; D–B–C–A–F = 24

    The shortest path from D to F is D–E–F, length 11. The direct edge is 16.

  4. Length

    Total weight 63 + 11 = 74

    Total weight of all the edges, plus the repeated path.

  5. Compare a return to A

    AB + DF = 7 + 11 = 18; AD + BF = 17 + 14 = 31; AF + BD = 7 + 10 = 17; smallest 17, route 63 + 17 = 80

    Returning to A needs all four odd vertices fixed, so the route is 6 km longer.

Video walkthrough coming