Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
191 views5 pages

Solving the Chinese Postman Problem

The Chinese postman problem involves finding the shortest closed walk in a connected network that contains each edge at least once. Edmonds' algorithm solves this problem in three steps: (1) find shortest paths between vertices of odd degree, (2) find a minimum weight perfect matching in the corresponding complete graph, (3) construct an Eulerian extension by doubling edges along the matching. The closed walk constructed from the Eulerian extension is proved to be a shortest postman walk.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views5 pages

Solving the Chinese Postman Problem

The Chinese postman problem involves finding the shortest closed walk in a connected network that contains each edge at least once. Edmonds' algorithm solves this problem in three steps: (1) find shortest paths between vertices of odd degree, (2) find a minimum weight perfect matching in the corresponding complete graph, (3) construct an Eulerian extension by doubling edges along the matching. The closed walk constructed from the Eulerian extension is proved to be a shortest postman walk.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

8 The Chinese postman problem

8.1 Definition
Let N be a network and W be a walk in N . Then the length of W , length(W ), is
the sum of the weights of the edges of W , counting each edge the same number
of times as it appears in W .

8.2 Problem
Let N be a connected network in which each edge has a positive integer weight.
Find a closed walk in N which contains each edge of N at least once and is as
short as possible. This problem is called the Chinese Postman Problem after a
Chinese graph theorist, Guan, who gave a characterisation for a shortest closed
walk which contains all edges of N in 1960. Note that if W is a closed walk which
contains all edges of N then we must have length(W ) ≥ w(N ). Furthermore, if
equality holds, then W contains every edge of N exactly once, and hence W is
an Euler tour of N .

8.3 Example
Let N be the following network.
v1 5 v2 1 v7
t t t

1 1
2
4 t v5 3 3

1 3
t t t
v4 2 v3 1 v6
N has no Euler tour since it has four vertices of odd degree. Hence, if W is a
shortest closed walk which contains all edges of N , then length(W ) > w(N ).

8.4 Definitions
We shall call a closed walk in N , which contains all edges of N a postman walk
for N . By an extension of N we shall mean an network N ∗ obtained from N
by replacing each edge e of N by one or more parallel edges, i.e. edges with the
same end vertices as e and the same weight as e. An Eulerian extension of N
is an extension N ∗ such that each vertex of N ∗ has even degree.

8.5 Example
The following network N ∗ is an Eulerian extension of the network N in Example
8.3.

57
5 1
v1 v2 v7
t t t
5 1
1 1
2
4 t v5 3 3
1
1 3
3
t t t
v4 2 v3 1 v6

Note that an Euler tour R of N corresponds to a postman walk W in N which
uses the edges v1 v2 , v2 v7 , v4 v5 , v5 v3 twice and all other edges once. Thus

length(W ) = length(R) = w(N ∗ ) = w(N ) + 5 + 1 + 1 + 3 = w(N ) + 10.

8.6 Lemma
Let N be a network in which each edge has a positive integer weight, and let k
be an integer. Then N has a postman walk of length k if and only if N has an
Eulerian extension of weight k.

Proof (a) Suppose N has a postman walk W of length k. Construct an exten-


sion N ∗ of N by replacing each edge of N by p(e) parallel edges, where p(e) is the
number of times e is contained in W . Then N ∗ is Eulerian since W corresponds
to an Euler tour R of N ∗ . Furthermore length(W ) = length(R) = w(N ∗ ).
Hence N has an Eulerian extension of weight k.
(b) Suppose N has an Eulerian extension N ∗ of weight k. Let R be an Euler
tour of N ∗ . Then R corresponds to a postman walk W for N with length(W ) =
length(R) = w(N ∗ ). Hence N has a postman walk of length k.

8.7 Corollary
The minimum length of a postman walk of N is equal to the minimum weight
of an Eulerian extension of N .
Proof Take k as small as possible in Lemma 8.6

We will solve the Chinese Postman problem for a network N by finding a


minimum weight Eulerian extension of N . We need the following elementary
lemma.

8.8 Lemma
Let G be a graph and let S be the set of vertices of odd degree in G. Then |S|
is even.

58
P
Proof We have v∈V (G) dG (v) = 2|E(G)|. Reducing both sides modulo two
gives |S| ≡ 0 (mod 2). Thus |S| is even.

8.9 Edmond’s Algorithm


The following strongly polynomial algorithm for solving the Chinese Postman
Problem on a network was given by Edmonds in 1965. It uses his algorithm for
finding a minimum weight perfect matching in a weighted complete graph, see
Remark 6.15, and also Dijkrstra’s algorithm for finding shortest paths, in order
to find a minimum weight Eulerian extension of the network.
Let N be a network in which each edge has a positive integer weight.
Step 1 Let S = {v1 , v2 , . . . , v2m } be the set of vertices of odd degree in N . For
each vi , vj ∈ S construct a shortest path Pi,j from vi to vj in N .
Step 2 Construct a weighted complete graph K2m with V (K2m ) = S and
w(vi vj ) = length(Pi,j ) for all vi , vj ∈ S. Find a minimum weight per-
fect matching M in K2m .
Step 3 Construct an Eulerian extension N ∗ of N by replacing each edge e ∈
E(Pi,j ) by two parallel edges, for all vi vj ∈ M .
Step 4 Construct an Euler tour T of N ∗ . Then T corresponds to a shortest
postman walk W for N . Furthermore
length(W ) = length(T ) = w(N ∗ ) = w(N ) + w(M ).

8.10 Example
Let N be the network given in Example 8.3.
Step 1 The set of vertices of odd degree in N is S = {v1 , v3 , v4 , v7 }. The
shortest paths in N joining the vertices of S are: P1,3 = v1 v5 v3 , P1,4 =
v1 v5 v4 , P1,7 = v1 v5 v2 v7 , P3,4 = v3 v4 , P3,7 = v3 v7 , P4,7 = v4 v5 v2 v7 .
Step 2 Construct the weighted K4 below:
v1
u
T
 T
 T
2  3 T4
 v7 T
 Q

u
 3 Q T
T
v4   2QQ T v


u Q
QTu 3
2

59
A Minimum weight perfect matching is M = {v1 v4 , v3 v7 } and w(M ) =
2 + 2 = 4.
Step 3 Construct N ∗ by ‘doubling’ edges along P1,4 and P3,7 .
v1 5 v2 1 v7
s s s

1 1
1 2
4 s v5 3 3
1 1 3 2

s s s
v4 2 v3 1 v6
Step 4 Construct an Euler tour R of N ∗ . For example

R = v 1 v2 v3 v4 v1 v5 v2 v7 v3 v7 v6 v3 v5 v4 v5 v1 .

Put W = R. Then W is a shortest postman walk for N and length(W ) =


w(N ) + w(M ) = w(N ) + 4.
We next show that the closed walk constructed by Edmond’s algorithm is a
shortest postman walk for N . We need the following lemma.

8.11 Lemma
Let G be a graph and let S = {x1 , x2 , . . . , x2m } be the set of vertices of odd
degree in G. Then G has a set of m pairwise edge-disjoint paths P such that
each vertex in S is an end vertex of exactly one path in P.
Proof We use induction on |S|. If S = ∅ then the lemma is trivially true, we
just take P = ∅. Hence we may suppose that S 6= ∅. Let H be a component
of G which contains at least one vertex of odd degree. Applying Lemma 8.8 to
H, we must have |S ∩ V (H)| ≥ 2. Choose xi , xj ∈ S ∩ V (H), and let Pi,j be an
xi xj -path in H. Let G0 = G − E(Pi,j ) and S 0 = S − {xi , xj }. Then S 0 is the set
of vertices of odd degree in G0 . By induction G0 has a set of (m − 1) pairwise
edge-disjoint paths P 0 such that each vertex in S 0 is an end vertex of exactly
one path in P 0 . Then P = P 0 ∪ {Pi,j } is the required set of m paths in G.

8.12 Theorem
Let N be a network in which each edge has a positive integer weight. Then
Edmond’s Algorithm constructs a shortest postman walk for N .
Proof By Corollary 8.7, it suffices to show that the extension N ∗ constructed
by Edmond’s algorithm is a minimum weight Eulerian extension of N .
Let S = {x1 , x2 , . . . , x2m } be the set of vertices of odd degree in N . Let

Nmin be a minimum weight Eulerian extension of N and put G = N ∗ − E(N ).
For each vertex v of G, we have dG (v) = dNmin ∗ (v) − dN (v). Since Nmin

is

60

Eulerian, all vertices of Nmin have even degree. Thus dG (v) ≡ dN (v) (mod 2)
for all v ∈ V (G). Hence the set of vertices of odd degree in G is again S.
By Lemma 8.11, G has a set of m pairwise edge-disjoint paths P such that
each vertex in S is an end vertex of exactly one path in P. Let N 0 be obtained
from N by doubling edges along each path in P. Then N 0 has no vertices of odd
degree. Hence N 0 is an Eulerian extension of N which is contained in Nmin

. By
∗ ∗ 0
the minimality of Nmin , we must have Nmin = N .

Thus Nmin can be obtained by choosing a set of m pairwise edge-disjoint
paths such that each vertex in S is an end vertex of exactly one of the paths,
and then ‘doubling edges’ along the paths. Furthermore, the sum of the lengths
in N of the paths must be as small as possible. This corresponds to choos-
ing a minimum weight perfect matching in the weighted K2m constructed by
Edmond’s algorithm.

8.13 Note
We have not covered Edmond’s algorithm for constructing a minimum weight
perfect matching in K2m in this course. Thus when asking you to apply Al-
gorithm 8.9 to specific examples, I will ensure that the set S is quite small (
|S| = 2m ≤ 4), so that you can find a minimum weight perfect matching of
the weighted K2m by exhaustive search. Similarly, for small examples, you may
be able to find shortest paths by inspection, rather than applying Dijkstra’s
algorithm.

8.14 Remark
It is straightforward to modify Algorithm 8.9 to:
• find a shortest trail which joins two specified vertices of a network N and
contains all edges of N ;
• find a shortest directed closed walk which contains all edges of directed
network.

61

You might also like