An Approximation Algorithm for
the Asymmetric Maximum TSP
From: January 2004 Journal of Algorithms
Author: Markus Bläser*
Speaker: H. Z. Hsu
Advisor: R. C. T. Lee
1
In the following, we will first introduce some
terms in graph theorem in order to define the
Asymmetric Maximum Traveling Salesperson
Problem (TSP).
We need to know the following definitions first:
1.self-looping
2.asymmetric
3.triangle inequality
4.Hamiltonian tour
5.cycle cover and maximum weight cycle cover
2
Self-looping
A
15
5
11
B
D
8
The node D is
self-looping.
C
A node v of a graph G is self-looping if there is
an edge (v,v).
3
Asymmetric
A
15
17
B
11
2
2
D
B and D is asymmetric.
B and C is asymmetric.
C
In a directed and weighted graph G, there are
two nodes u and v of G. u and v is asymmetric if
the weight of the edge from u to v (w(u,v)) may
differ from w(v,u).
4
Triangle inequality
A
15
14
B
17
11
D
6
12
8
C
Take a look for (B,D), (D,C)
and (B,C):
B, D and C satisfies
triangle inequality.
9
In a weighted graph G, three nodes t, u and
v of G satisfies triangle inequality iff w(t,u)+w(u,v)
w(t,v).
5
Hamiltonian tour
A
B
D
The graph has a
Hamiltonian tour “ABDCA”.
C
In a directed graph G, G has a Hamiltonian tour
iff there is a cycle which starts from a node and
visits each node of G once time then ends to the
starting node.
6
Asymmetric Maximum TSP Problem
Given a complete, directed and asymmetric
graph G which is also without self-looping and
does not need to satisfy the triangle inequality,
find a Hamiltonian tour with maximum weight.
A
15
Input G:
23
13
14
12
B
24
17
11
D
22
21
8
C
9
7
Input G:
Output:
A
A
15
23
13
14
12
B
23
B
17
11
D
22
24
24
D
22
21
21
8
C
9
The maximum Hamiltonian
tour is “ADCBA” with cost 90.
C
8
Before introducing the algorithm, we should first
define cycle cover.
A cycle cover of a graph is a set of cycles such
that each node is part of exactly one cycle.
A cycle cover of G:
G:
A
15
23
A
12
B
15
13
14
23
24
B
17
11
D
22
D
21
8
C
21
9
C
9
9
If a cycle cover of a given graph with the
maximum total weight, it is called maximum weight
cycle cover.
The maximum weight cycle
cover of G with the weight 68:
G:
A
15
23
A
12
B
15
13
14
23
24
B
17
11
D
22
D
21
8
C
21
9
C
9
10
A counterexample of maximum weight cycle cover.
The following cycle cover of G
with the weight 54 is not the
maximum weight cycle cover.
G:
A
15
23
A
13
14
12
B
14
12
24
B
17
11
17
11
D
22
D
21
8
C
9
C
11
In the following, we present the
algorithms for the asymmetric maximum
TSP.
12
Given a directed complete graph G.
A
G:
15
23
13
14
12
B
24
17
11
D
22
21
8
C
9
13
Step1. Compute a maximum weight cycle
cover C of G [FNW79].
A
A
G:
15
23
C:
13
14
12
15
23
24
B
B
17
11
D
D
22
21
21
8
C
9
C
9
14
Step2. Discard the lightest edge of each cycle in
C to obtain a collection of node disjoint paths P.
A
C:
A
P:
15
23
23
B
B
D
D
21
21
C
9
C
15
Step3. Construct a tour by patching the paths in
P arbitrarily together.
A
P:
D
23
21
A
G:
B
C
15
23
13
14
12
B
24
Output:
17
11
D
22
23
21
8
C
9
A
24
B
D
22
21
C
16
Algorithm1:
Input: a directed complete graph G=(V, K(V), w),
where K (V ) V V \ {(v, v) | v V }
Output: a Hamiltonian tour on G.
Step1. Compute a maximum weight cycle cover C
of G. [FNW79]
Step2. Discard the lightest edge of each cycle in C
to obtain a collection of node disjoint paths
P.
Step3. Construct a tour by patching the paths in P
arbitrarily together.
17
Time Complexity:
The running time of the algorithm is proportional
to the time needed to compute a maximum weight
cycle cover with O(n3). [FNW79]
Approximation analysis:
We fixed some names for the remainder of this
section: C1,…,Cl will denote the cycles of the
computed cycle cover C. Let I 2 {1,...,l} be the set
of all indices i such that Ci is a 2-cycle, that is, a
cycle consisting of two edges. In the same way,
let I3 be the set of all indices that correspond to 3cycles. Finally, let I 4 {1,...,l} \ {I 2 I 3.} Set W=w(C).
18
For i I , choose bi and ci from [0,1] such that
biW is the weight of the heavier edge in Ci and ciW
is the weight of the lighter one.
2
C1
A
15
23
B
C2
21
C
9
D
C={C1, C2}
W=w(C)=68
b1=23/68
c1=15/68
b2=21/68
c2=9/68
19
Let b iI bi and c iI ci .
For j I , let xjW, yjW, and zjW denote the
weight of the heaviest edge, the edge in the
middle, and the lightest edge, respectively. Define
x, y, and z in the same manner as b and c.
2
2
3
C1
b=b1+b2=44/68
c=c1+c2=24/68
x=y=z=0
A
15
23
B
C2
D
21
C
9
20
Finally, for every k I 4 , let p [0,1] such that
pkW is the weight of the lightest edge in Ck, mW is
the weight of summation of all other edges except
p and let p p .
k
kI 4
C1
k
A
x=y=z=m=p=0
15
23
B
C2
D
21
C
9
21
C1
A
15
23
B
C2
21
C
9
D
C={C1, C2}
W=w(C)=68
b1=23/68
c1=15/68
b2=21/68
c2=9/68
b=b1+b2=44/68
c=c1+c2=24/68
x=y=z=m=p=0
22
C1
C2
A
C
4
E
F
C3
1
2
J
C5
L
12
14
D
3
10
11
C={C1,C2,C3,C4,C5,C6},W=w(C)=190
b1=2/190,b4=11/190
b=b1+b4=13/190
c1=1/190,c4=10/190
c=c1+c4=11/190
x2=5/190,x5=14/190
x=x2+x5=19/190
y2=4/190,y5=13/190
y=y2+y5=17/190
z2=3/190,z5=13/190
z=z2+z5=16/190
m=(7+8+9+16+17+18+19)/190=94/190
p3=6/190,p6=15/190
p=p3+p6=21/190
K
B
M
13
N
5
C6
6
G
7
9
H
C4
8
O
15
S
19
16
P
R
18
Q
17
I
23
Approximation Performance:
After the step2. of the algorithm1, we obtained a
collection of node disjoint paths P. The total
weight w(P) contained in P is (1-c-z-p)W.
Let L denote the weight of a Hamiltonian tour of
maximum weight on G, note that
1=b+c+x+y+z+m+p, m 3 p , because p is the lightest
edge in certain cycle. We concluded
that 1 b c x y z 4 p , and after a simple
(1 b c x y z ) , and W≥L
execution: p 1
4
we finally put the above result in w(P) and get the
performance ratio:
w( P) (
3 1
3
1
1
3
b c x y z) L
4 4
4
4
4
4
24
1
(1 c z p)W (1 c z (1 b c x y z ))W
4
3 1
3 1
1
3
3 1
3 1
1
3
( b c x y z )W ( b c x y z ) L
4 4 4 4
4
4
4 4 4 4
4
4
Algorithm1 returns a bound of the weight of
the output Hamiltonian tour.
25
Before we introduce the algorithm2, we should
define two terms: “perfect matching of maximum
weight” and “matching of maximum weight”.
Also, we will introduce a necessary Lemma
which will be used in algorithm2.
26
Before we define the perfect matching, we should define some terms in graph theorem
first.
Let G be a graph and v V . The number of edges incident at v in G is called the
degree of the vertex v in G and is denoted by dG(v). A graph G is called k-regular for
some nonnegative integer k iff every vertex of G has degree k.
A spanning 1-regular sub-graph of G is called a perfect matching M of G.
3-regular graph
2-regular graph
A
A
B
B
D
C
D
C
27
The following spanning
sub-graph of G is a
perfect matching M.
A graph G:
A
A
B
B
D
C
D
C
M={AB,CD}.
28
The following spanning
sub-graph of G is another
perfect matching M’.
A graph G:
A
A
B
B
D
C
D
C
M’={AC,BD}.
29
A perfect matching of maximum weight is a
perfect matching with maximum weight of total
edges in the matching.
The following is the perfect
matching M of maximum weight
on G.
A weighted
graph G:
A
A
23
10
14
B
23
B
17
Total weight is 44.
D
D
21
21
C
M={AB,CD}.
C
30
The following perfect matching M’ is not the
perfect matching of maximum weight.
M’={AC,BD}.
A weighted graph G:
A
A
23
14
10
14
B
B
17
17
D
D
21
C
C
Total weight is 31.
31
If we say that we compute a matching of
maximum weight on a directed weighted graph (V,
K(V), w), we mean that we replace the two edges
between each pair of nodes by an undirected one
with weight equal to the maximum of the weight of
the two replaced edges, then compute a perfect
matching of maximum weight on that graph, and
then translate everything back into the directed
world by replacing each undirected edge by the
directed one for which the maximum was
attained (breaking ties arbitrarily.)
32
Replace the two edges between
each pair of nodes by an
undirected one with weight equal
to the maximum of the weight of
the two replaced edges.
A directed
weighted graph
G:
A
15
23
10
14
A
12
10
B
17
11
23
14
D
21
C
B
17
9
D
21
C
33
Compute a perfect
matching M of maximum
weight on that graph.
A
A
23
10
23
14
B
D
B
17
21
D
21
C
C
M={AB,CD}.
34
Translate everything back
into the directed world.
A
A
23
23
B
B
D
D
21
21
C
C
M={AB,CD}.
35
Before we introduce the LEMMA, we
should first know an action called
contracting.
36
Z={C1,C2}
={AB,BA,CJ,JC}
A
B
J
C
I
G=(V,E)
E={AB,BA,BC,JA,CJ,JC,FD,FD,DE,HE,HI,IG,IG}
V={A,B,C,D,E,F,G,H,I,J}
H
D
G
E
F
37
Z={C1,C2}
={AB,BA,CJ,JC}
A
B
J
C
I
G=(V,E)
E={AB,BA,BC,JA,CJ,JC,FD,FD,DE,HE,HI,IG,IG}
V={A,B,C,D,E,F,G,H,I,J}
V’={D,E,F,G,H,I}
H
D
G
E
F
38
Z={C1,C2}
={AB,BA,CJ,JC}
A
B
J
C
I
G=(V,E)
E={AB,BA,BC,JA,CJ,JC,FD,FD,DE,HE,HI,IG,IG}
V={A,B,C,D,E,F,G,H,I,J}
V’={A,D,E,F,G,H,I,J}
z1=A, z2=J
H
D
G
E
F
39
A
Z={C1,C2}
={AB,BA,CJ,JC}
B
C
J
For each edge e (u, v) E ,
we do the following: if both u and v belong to the same cycle, we discard e.
Otherwise, we add the edge (u’,v’) to E’ where u’=u if u dose not belong to a
cycle, and u’=zi if u belongs to cycle Zi. The node v’ is defined in the
same manner.
I
G=(V,E)
E={AB,BA,BC,JA,CJ,JC,FD,FD,DE,HE,HI,IG,IG}
V={A,B,C,D,E,F,G,H,I,J}
V’={A,D,E,F,G,H,I,J}
z1=A, z2=J
D
E’={FD,FD,DE,HE,HI,IG,IG,JA}
H
G
E
F
40
A
B
J
C
I
After the contracting the cycles in T:
H={JA,FD,FD,DE,HE,HI,IG,IG}
H
D
G
E
F
41
If Z is a collection of node disjoint cycles on a
directed graph G=(V, E) (not necessarily covering
G) then the process of contracting the cycles in Z
produces a multi-graph H=(V’, E’) as follows: the
node set V’ consists of all nodes of V that do not
belong to any cycle of Z and of one new vertex zi
for each cycle Zi in Z. For each edge e (u, v) E ,
we do the following: if both u and v belong to the
same cycle, we discard e.
42
Otherwise, we add the edge (u’,v’) to E’ where
u’=u if u dose not belong to a cycle, and u’=zi if u
belongs to cycle Zi. The node v’ is defined in the
same manner. Note that E may be a multi-set (the
same edge may appear twice times) and hence H
may be a multi-graph (There may be more than
one edge in the same direction).
Next page is another simple example of
contracting.
43
Z={C1}
={CJ,JC}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
H
D
G
E
F
44
Z={C1}
={CJ,JC}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={D,E,F,G,H,I}
H
D
G
E
F
45
Z={C1}
={CJ,JC}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={D,E,F,G,H,I,J}
z1=J
H
D
G
E
F
46
A
Z={C1}
={CJ,JC}
B
C
J
For each edge e (u, v) E ,
we do the following: if both u and v belong to the same cycle,
we discard e. Otherwise, we add the edge (u’,v’) to E’ where u’=u
if u dose not belong to a cycle, and u’=zi if u belongs to cycle Zi.
The node v’ is defined in the same manner.
I
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
V={C,D,E,F,G,H,I,J}
V’={D,E,F,G,H,I,J}
z1=J
D
H
E’={FD,FD,DE,HI,IG,IG,JH}
G
E
F
47
A
B
J
C
I
After the contracting the cycles in T:
H={FD,FD,DE,HI,IG,IG,JH}
H
D
G
E
F
48
Z={C1}
={CJ,JC}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={D,E,F,G,H,I}
H
D
G
E
F
49
Z={C1}
={CJ,JC}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={D,E,F,G,H,I}
H
D
G
E
F
50
Z={C1}
={CJ,JC}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={C,D,E,F,G,H,I}
z1=C
H
D
G
E
F
51
A
Z={C1}
={CJ,JC}
B
C
J
For each edge e (u, v) E ,
we do the following: if both u and v belong to the same cycle,
we discard e. Otherwise, we add the edge (u’,v’) to E’ where u’=u
if u dose not belong to a cycle, and u’=zi if u belongs to cycle Zi.
The node v’ is defined in the same manner.
I
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
V={C,D,E,F,G,H,I,J}
V’={C,D,E,F,G,H,I}
z1=C
D
H
E’={FD,FD,DE,HI,IG,IG,EC}
G
E
F
52
A
B
J
C
I
After the contracting the cycles in T:
H={FD,FD,DE,HI,IG,IG,EC}
H
D
G
E
F
53
Z={C1,C2}={{CJ,JC},{FD,DE,EF}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,DE,EF,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
H
D
G
E
F
54
Z={C1,C2}={{CJ,JC},{FD,DE,EF}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,DE,EF,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={G,H,I}
H
D
G
E
F
55
Z={C1,C2}={{CJ,JC},{FD,DE,EF}
A
B
C
J
G=(V,E)
E={CJ,JC,DE,DE,EF,EC,FD,FD,HI,IG,IG,JH}
I
V={C,D,E,F,G,H,I,J}
V’={C,E,G,H,I}
z1=C,z2=E
H
D
G
E
F
56
A
Z={C1}
={CJ,JC}
B
C
J
For each edge e (u, v) E ,
we do the following: if both u and v belong to the same cycle,
we discard e. Otherwise, we add the edge (u’,v’) to E’ where u’=u
if u dose not belong to a cycle, and u’=zi if u belongs to cycle Zi.
The node v’ is defined in the same manner.
I
G=(V,E)
E={CJ,JC,DE,EC,FD,FD,HI,IG,IG,JH}
V={C,D,E,F,G,H,I,J}
V’={C,E,G,H,I}
z1=C,z2=E
D
H
E’={HI,IG,IG,EC}
G
E
F
57
A
B
J
C
I
After the contracting the cycles in T:
H={HI,IG,IG,EC}
H
D
G
E
F
58
LEMMA: Let T be a collection of node disjoint 2cycles on a node set V, P be a collection of node
disjoint paths of length at least two, and M be a
matching on V. Moreover, assume that T and P
are node disjoint and T M . Let H be the
multi-graph obtained from the graph
G (V ,T P M ) by contracting the cycles in T.
Then the edges of the multi-graph H can be
colored with two colors such that the edges in
each color class form a collection of node disjoint
paths. Such a coloring can be found in polynomial
time.
59
A
B
J
C
I
H={JA,FD,FD,DE,HE,HI,IG,IG},
H can be colored with two colors such that the
Edges in each color class form a collection of
Node disjoint paths.
H
D
G
E
F
60
A
B
J
C
I
P1={FD,HE,IG,JA}
H
D
G
E
F
61
A
B
J
C
I
P2={FDE,HIG}
H
D
G
E
F
62
A
B
J
C
I
H={JA,FD,FD,DE,HE,HI,IG,IG},
H can be colored with two colors such that the
Edges in each color class form a collection of
Node disjoint paths.
H
D
G
E
F
63
A
B
J
C
I
P1={FD,HE,IG}
P2={FDE,HIG,JA}
H
D
G
E
F
64
A
B
J
C
I
H={FD,FD,DE,HI,IG,IG,JH}
H
D
G
E
F
65
A
B
J
C
I
P1={FDE,JHIG}
P2={FD,IG}
H
D
G
E
F
66
A
B
J
C
I
H={FD,FD,DE,HI,IG,IG,JH}
H
D
G
E
F
67
A
B
J
C
I
P1={FD,JHIG}
P2={FDE,IG}
H
D
G
E
F
68
We should introduce two properties, if e=(u,v)
and f=(x,y) are two edges in a graph, e and f are
called compatible with each other, if v=x and u is
not equal to y or y=u and v is not equal to x.
y
v
f
e
u
or
x
e
f
y
v
69
An edge e is called incident with a node v, if
either e=(v,u) or e=(u,v) for some node u.
u
v
e
e
u
or
v
70
Algorithm2:
Input: a graph G=(V, K(V), w)
Output: A Hamiltonian tour on G
Step1. Compute a maximum weight cycle cover C of G.
Step2. Define a new weight function w’ on K(V) as follows. For all i I 2 , set
w’((si, ti))=w’((ti, si))=2(bi-ci)W. For all i, j I 2 , i j, set w’((si, tj))=
w((ti, sj))+(bi-ci)W+(bj-cj)W. For all i I 2, set w’((u, si))=w((u, si))+(bi-ci)W and
w’((ti, v))=w((ti, v))+(bi-ci)W, if u {tk | k I 2 } and v {s | k I }. For all other
edges e, set w’(e)=w(e).
Step3. Compute a matching M of maximum weight on (V, K(V), w’).
Step4. Discard the lightest edge of each cycle in C that has length at least three. This
yields a collection of node disjoint paths P.
Step5. Let T be the collection of all 2-cycles from C that do not share an edge with M. (In
other words, M did not pick one of the two edges of those 2-cycles.) Let M’ be
the set of all edges from M that do not share an edge with a 2-cycle from C.
Step6. Let H be the multi-graph obtained from (V ,T P M ' ) , by contracting the cycles in
T. Color the multi-graph H according to LEMMA and transfer the coloring back to
k
2
(V , P M ' )
71
Step7. For each 2-cycle not in T, add the heavier edge to both color classes. For each
2-cycle Ci from T, let ei and fi be the two edges from M’ incident with si and ti.
If both ei and fi have the same color, then add the compatible edge of Ci to
both color classes. Otherwise, add the edge of Ci compatible to ei to the color
class of ei and the edge compatible to fi to the color class of fi.
Step8. Patch together the paths of the color class with larger weight with respect to the
original weight function w to obtain the Hamiltonian tour.
We show the complete example in the next several pages.
72
A
Input:
B
J
C
I
D
H
G
E
F
73
A
Step1.
C1
B
J
C2
C
I
Assume the graph is the
cycle cover of the input.
C4
C3
D
H
G
E
F
74
C1
Step2(before).
A
c
j
a
B
J
f
h
d
e
g
i
C2
b
C
I
Assume the black edges are the lightest edge in each cycle,
And the red edges are compatible edges which are compatible
with the heavier edge of each 2-cycle Ci in C.
Also, we give the needed cost functions to illustrate the Step2.
C4
C3
D
H
G
E
F
75
2(c-a)
C1
Step2(after).
j+(d-b)
i+(c-a)
2(c-a)
B
g+(c-a)
A
J
f +(c-a)+(d-b)
2(d-b)
h+(d-b)
C2
e+(c-a)+(d-b)
2(d-b)
C
I
Step2. Define a new weight function w’ on K(V) as follows. For
all i I , set w’((si, ti))=w’((ti, si))=2(bi-ci)W. For
all i, j I , i j , set w’((si, tj))=w((ti, sj))+(bi-ci)W+(bj-cj)W.
For all i I , set w’((u, si))=w((u, si))+(bi-ci)W and
w’((ti,v))=w((ti, v))+(bi-ci)W, if u {t | k I }
and v {s | k I } . For all other edges e, set w’(e)=w(e).
2
2
2
k
k
2
2
H
D
C4
C3
G
E
F
76
We assume that the following graphs of
step3. and step5. are right.
77
A
Step3.
B
J
M={BC,FD,HE,IG,JA}
C
I
Step3. Compute a matching M of maximum weight on (V, K(V), w’).
H
D
G
E
F
78
A
Step4.
B
J
Step4. Discard the lightest edge of each
cycle in C that has length at least three.
This yields a collection of node disjoint
paths P.
C
I
H
D
P={FDE,HIG}
G
E
F
79
A
Step5.
B
J
T={C1,C2}={{AB,BA},{CJ,JC}}
C
Step5. Let T be the collection of all 2cycles from C that do not share an edge
with M. (In other words, M did not pick one
of the two edges of those 2-cycles.) Let M’
be the set of all edges from M that do not
share an edge with a 2-cycle from C.
I
P={FDE,HIG}
H
D
G
E
F
M’=M={BC,FD,HE,IG,JA}
80
A
Step6(before).
B
J
T={C1,C2}={{AB,BA},{CJ,JC}}
C
The graph=
I
(V ,T P M ' )
P={FDE,HIG}
H
D
G
E
F
M’=M={BC,FD,HE,IG,JA}
81
A
Step6.
B
C
J
Step6. Let H be the multi-graph obtained
from (V ,T P M ' ) , by contracting the
cycles in T. Color the multi-graph H
according to LEMMA and transfer the
coloring back to (V , P M ' ) .
I
H={JA,FD,FD,DE,HE,HI,IG,IG},
H can be colored with two colors such that the
Edges in each color class form a collection of
Node disjoint paths.
H
D
G
E
F
82
A
Step6(after).
B
J
P1={FD,HE,IG,JA}
P2={FDE,HIG}
C
I
H={JA,FD,FD,DE,HE,HI,IG,IG},
H can be colored with two colors such that the
Edges in each color class form a collection of
Node disjoint paths.
H
D
G
E
F
83
A
Step7(for P1).
B
J
T={C1,C2}={{AB,BA},{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’=M={BC,FD,HE,IG,JA}
84
A
Step7(for P1).
B
J
T={C1,C2}={{AB,BA},{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’=M={BC,FD,HE,IG,JA}
85
A
Step7(for P2).
B
J
T={C1,C2}={{AB,BA},{CJ,JC}}
C
I
D
H
G
E
F
M’=M={BC,FD,HE,IG,JA}
86
The total weights of the graph of Step7(for P2).
may larger than the total weights of the graph of
Step7(for P1). We assume that the total weights
of the graph of Step7(for P1). is the larger one.
87
A
Step8.
B
C
J
Step8. Patch together the paths of the
color class with larger weight with respect
to the original weight function w to obtain
the Hamiltonian tour.
I
H
D
G
E
F
88
A
Output:
B
J
The approximate maximum Hamiltonian tour
is ABFDHEIGCJA.
C
I
H
D
G
E
F
89
A
Input:
B
J
C
I
D
H
G
E
F
90
A
Step1.
C1
B
J
C2
C
I
Assume the graph is the
cycle cover of the input.
C4
C3
D
H
G
E
F
91
C1
Step2(before).
A
c
j
a
B
J
f
h
d
e
g
i
C2
b
C
I
Assume the black edges are the lightest edge in each cycle,
And the red edges are compatible edges which are compatible
with the heavier edge of each 2-cycle Ci in C.
Also, we give the needed cost functions to illustrate the Step2.
C4
C3
D
H
G
E
F
92
2(c-a)
C1
Step2(after).
j+(d-b)
i+(c-a)
2(c-a)
B
g+(c-a)
A
J
f +(c-a)+(d-b)
2(d-b)
h+(d-b)
C2
e+(c-a)+(d-b)
2(d-b)
C
I
Step2. Define a new weight function w’ on K(V) as follows. For
all i I , set w’((si, ti))=w’((ti, si))=2(bi-ci)W. For
all i, j I , i j , set w’((si, tj))=w((ti, sj))+(bi-ci)W+(bj-cj)W.
For all i I , set w’((u, si))=w((u, si))+(bi-ci)W and
w’((ti,v))=w((ti, v))+(bi-ci)W, if u {t | k I }
and v {s | k I } . For all other edges e, set w’(e)=w(e).
2
2
2
k
k
2
2
H
D
C4
C3
G
E
F
93
We assume that the following graphs of
step3. and step5. are right.
94
A
Step3.
B
J
M={BA,CE,FD,JH,IG}
C
I
Step3. Compute a matching M of maximum weight on (V, K(V), w’).
H
D
G
E
F
95
A
Step4.
B
J
Step4. Discard the lightest edge of each
cycle in C that has length at least three.
This yields a collection of node disjoint
paths P.
C
I
H
D
P={FDE,HIG}
G
E
F
96
A
Step5.
B
J
T={C1}={{CJ,JC}}
C
I
Step5. Let T be the collection of all 2cycles from C that do not share an edge
with M. (In other words, M did not pick one
of the two edges of those 2-cycles.) Let M’
be the set of all edges from M that do not
share an edge with a 2-cycle from C.
H
P={FDE,HIG}
D
G
E
F
M’={CE,FD,JH,IG}
97
A
Step5.
B
J
C
I
After the contracting the cycles in T:
H={FD,FD,DE,HI,IG,IG,JH}
H
D
G
E
F
98
A
Step6.
B
J
P1={JHIG,FDE}
C
I
Step6. Let H be the multi-graph obtained
from (V ,T P M ' ) , by contracting the
cycles in T. Color the multi-graph H
according to LEMMA and transfer the
coloring back to (V , P M ' ) .
H
D
G
E
F
99
A
Step6.
B
J
Step6. Let H be the multi-graph obtained
from (V ,T P M ' ) , by contracting the
cycles in T. Color the multi-graph according
to LEMMA and transfer the coloring back
to (V , P M ' ) .
C
I
P2={FD,IG}
H
D
G
E
F
100
A
Step7(for P1).
B
J
T={C1}={{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’={CE,FD,JH,IG}
101
A
Step7(for P1).
B
J
T={C1}={{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’={CE,FD,JH,IG}
102
A
Step7(for P1).
B
J
T={C1}={{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’={CE,FD,JH,IG}
103
A
Step7(for P2).
B
J
T={C1}={{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’={CE,FD,JH,IG}
104
A
Step7(for P2).
B
J
T={C1}={{CJ,JC}}
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
C
D
I
H
G
E
F
M’={CE,FD,JH,IG}
105
The total weights of the graph of Step7(for P2).
may larger than the total weights of the graph of
Step7(for P1). We assume that the total weights
of the graph of Step7(for P1). is the larger one.
106
A
Step8.
B
J
C
I
Step8. Patch together the paths of the
color class with larger weight with respect
to the original weight function w to obtain
the Hamiltonian tour.
H
D
G
E
F
107
A
Output:
B
J
C
I
The approximate maximum Hamiltonian tour
is ABCDJHIGFDE.
H
D
G
E
F
108
Time Complexity:
The running time of the algorithm is proportional
to the time needed to compute a maximum weight
cycle cover with O(n3). [FNW79]
Approximation analysis:
Let L denote the weight of a Hamiltonian tour of
maximum weight on G, L’ is the weight of the
maximum weight tour in (V,K(V),w’).
109
The following figure shows how a Hamiltonian tour in G can run through a 2-cycle Ci form
C. In the first case, we loose weight biW and get an additional weight 4(bi-ci)W under w’. In
the second case, we loose weight ciW and get an additional amount of 2(bi-ci)W. In the
third case, we loose nothing but get an additional 2(bi-ci)W.
Case3:
Case2:
Case1:
(e1+(bi-ci))W
e1W
e1W
A
A
A
biW
(2(bi-ci))W
c iW
(2(bi-ci))W
gain=(2bi-3ci)W
gain=(3bi-4ci)W
(e2+(bi-ci))W
gain=(2bi-2ci)W
B
B
B
(e1+(bi-ci))W
e2W
(e2+(bi-ci))W
e2W
110
ei is the original weight of the edge.
The gain of the first case is 3bi-4ci, the gain of the second case
Is 2bi-3ci, and the gain of the third case is 2bi-2ci.
Consider the smallest gain we have the equation:
L’≥L+(2b-3c)W. Hence, a matching M of maximum weight on
1
(V,K(V),w’) has weight at least ( L (2b 3c)W ) . On the other hand,
2
the collection of paths P constructed in the algorithm has weight
at least (1-b-c-z-p)W.
It is important to analysis the gain of the step 7.
Step7: For each 2-cycle not in T, add the heavier edge to
both color classes. For each 2-cycle Ci from T, let ei and fi be
the two edges from M’ incident with si and ti.
If both ei and fi have the same color, then add the
compatible edge of Ci to both color classes. Otherwise, add
the edge of Ci compatible to ei to the color
class of ei and the edge compatible to fi to the color class of
111
f i.
Step7: For each 2-cycle not in T, add the heavier edge to
both color classes. (The gain will be 2biW-2(bi-ci)W=2ciW)
But this edge must has been in the matching M, it means that
no other edges from M can enter or leave this edge, thus we
do not have to take care of this kind of edges.
For each 2-cycle Ci from T, let ei and fi be the two edges from
M’ incident with si and ti.
If both ei and fi have the same color, then add the
compatible edge of Ci to both color classes (The gain will be
(biW-(bi-ci)W)+ciW=2ciW). Otherwise, add the edge of Ci
compatible to ei to the color class of ei (The gain will be (biW(bi-ci)W)+ciW=2ciW) and the edge compatible to fi to the color
class of fi.
The total gain are 2ciW.
112
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e2W
e2W+(bi-ci)W
si
ti
biW
e1W
e1W+(bi-ci)W
ti
si
biW
e1W+(bi-ci)W
e2W+(bi-ci)W
Gain is 2biW-2(bi-ci)W=2ciW
113
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e2W+(bi-ci)W
si
e1W+(bi-ci)W
ti
biW
ti
si
biW
e1W+(bi-ci)W
e2W+(bi-ci)W
e1W
e2W
Gain is 2biW-2(bi-ci)W=2ciW
114
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
si
biW
e3W
si
e3W
ti
c iW
e1W+(bi-ci)W
e1W
ti
e1W+(bi-ci)W
Gain is biW-(bi-ci)W+ciW=2ciW
115
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
si
biW
e3W
si
e3W
ti
c iW
e1W+(bi-ci)W
ti
e1W+(bi-ci)W
Gain is biW+ciW≥2ciW
116
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e3W
si
ti
ciW
e4W
ti
si
c iW
e4W
e 3W
Gain is 2ciW
117
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e3W
si
ti
ciW
e4W
ti
si
c iW
e4W
e 3W
Gain is 2ciW
118
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e2W+(bi-ci)W
si
ti
ciW
e4W
ti
si
biW
e2W+(bi-ci)W
e4W
Gain is biW-(bi-ci)W+ciW=2ciW
119
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e2W+(bi-ci)W
e2W
si
ti
biW
e4W
ti
si
c iW
e2W+(bi-ci)W
e4W
Gain is biW-(bi-ci)W)+ciW=2ciW
120
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e2W
e2W+(bi-ci)W
si
ti
biW
e1W+(bi-ci)W
ti
si
biW
e1W+(bi-ci)W
e1W
e2W+(bi-ci)W
Gain is 2biW-2(bi-ci)W=2ciW
121
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e3W
si
ti
ciW
e1W+(bi-ci)W
ti
si
biW
e1W+(bi-ci)W
e1W
e 3W
Gain is biW- (bi-ci)W+ciW=2ciW
122
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
e3W
si
ti
ciW
e4W
ti
si
c iW
e4W
e 3W
Gain is 2ciW
123
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
si
e2W+(bi-ci)W
ti
ciW
e4W
ti
si
biW
e2W+(bi-ci)W
e4W
e2W
Gain is biW- (bi-ci)W+ciW=2ciW
124
ei is the original weight of the edge.
Step7. For each 2-cycle not in T, add the
heavier edge to both color classes. For
each 2-cycle Ci from T, let ei and fi be the
two edges from M’ incident with si and ti.
If both ei and fi have the same color,
then add the compatible edge of Ci to both
color classes. Otherwise, add the edge of
Ci compatible to ei to the color
class of ei and the edge compatible to fi to
the color class of fi.
si
e2W+(bi-ci)W
ti
ciW
e4W
ti
si
biW
e4W
e2W+(bi-ci)W
Gain is biW+ciW≥2ciW
125
ei is the original weight of the edge.
Overall, the total weight in both classes is at least
1
( L (2b 3c)W ) (1 b c z p)W 2cW . Therefore, the heavier color
2
class has weight at least: 1 L ( 1 1 c 1 z 1 p)W
4
2
4
2
2
The claim of the theorem follows by plugging in
1
p (1 b c x y z ) and exploiting W≥L.
4
1
1 1
1
1
1
1 1
1
1 1
L ( c z p )W L ( c z (1 b c x y z ))W
4
2 4
2
2
4
2 4
2
2 4
1
3 1
1
1 1
3
1
3 1
1
1 1
3
L ( b c x y z )W L ( b c x y z ) L
4
8 8
8
8 8
8
4
8 8
8
8 8
8
5 1
1
1
1
3
( b c x y z)L
8 8
8
8
8
8
126
The main idea of algorithm3 is breaking all 3-cycles
into 2-cycles; for each 3-cycle, we choose the
lightest edge and its reversing direction edge to form
a new 2-cycle. Then form new cycles arbitrarily with
the remaining nodes.
A
A
D
D
C1
C1
B
B
E
E
C2
C2
C
F
C3
C
F
127
In the case of a 3-cycle Cj, we have rj≤xj+yj since otherwise
we could replace Cj by a 2-cycle of weight at least
(rj+zj)W>w(Cj) and a single node and thus construct a cycle
cover of larger weight, a contradiction.
xj
C
A
zj
yj
rj
B
xj+yj+zj must larger than rj+zj , otherwise,
the maximum cycle cover C will not
contain the cycle “ABC”, it will contain the
2-cycle “AB”.
If rj is large, then we replace a 3-cycle by a very unbalanced
2-cycle which is sometimes favorable. This is the key point of
the gain high than the algorithm2. In the following, let r r .
jI 3
128
j
Algorithm3:
Input: a graph G=(V, K(V), w)
Output: A Hamiltonian tour on G
Step1. Compute a maximum weight cycle cover C of G.
Step2. Replace each 3-cycle in C by a 2-cycle of weight at
least rj+zj as described above. Extend this collection
of cycles to a new cycle cover C’ by forming new
cycles arbitrarily with the remaining nodes.
Step3. Run Algorithm2 with respect to the new cycle cover C’.
129
After we produced a new cycle cover, we run
the algorithm2 and than get a new gain.
The fully example of the algorithm3 will be
ignored, because it is similar with algorithm2
except the step2.
We will see the time complexity and the
performance ratio directly.
130
Time Complexity:
The running time of the algorithm is proportional
to the time needed to compute a maximum weight
cycle cover with O(n3). [FNW79]
Approximation analysis:
Let L denote the weight of a Hamiltonian tour of
maximum weight on G. W=w(C), the new cycle
cover has weight at least W’=(1-x-y+r)W. The total
Weight of all heavier edges in the 2-cycles of C’ is
b’W, where b’=b+r. In the same way, the total
weight of all lighter edges is c’W, where c’=c+z.
131
1
( L 2(b'c' )W ) .
2
The weight of the matching M’ is
Since we have removed the 3-cycles, the weight of
the collection of paths P’ is (1 b c x y z p)W =
(1 b'c' x y r p)W. When inserting the
2-cycles, we get an additional amount of 2c’W.
We come up with two color classes of node disjoint
paths with total weight:
1
( L (2b'3c' )W ) (1 b'c' x y r p )W 2c'W
2
1
1
L (1 c' x y r p )W
2
2
132
Thus, the color class with the larger weight
contains at least weight:
1 1
1
1 1
1
1
( L (1 c' x y r p )W ) ( L (1 c x y z r p )W )
2 2
2
2 2
2
2
1
1 1
1
1
1
1
1
L ( c x y z r p )W
4
2 4
2
2
4
2
2
As the algorithm2, we plug in
1
p
(1 b c x y z ) and W≥L.
4
Hence, Algorithm3 returns a tour of weight at least
(
5
1
1
3
3
1 1
b c x
y z r)L
8
8
8
8
8
8 2
133
After the improving of the algorithm 3, algorithm 4
will return a bound: ( 5 1 b 1 c 1 x 1 y 5 z 1 r ) L
8
8
8
8 8
8
2
The guaranteed approximation performance
of this algorithm can be determined as
follows: minimize max(f1,f2,f3,f4) where
3 1
3
1
1
3
b c x y z,
4 4
4
4
4
4
5 1
1
1
1
3
f 2 b c x y z,
8 8
8
8
8
8
5 1
1
3
3
1
1
f3 b c x y z r ,
8 8
8
8
8
8
2
5 1
1
1
1
5
1
f4 b c x y z r
8 8
8
8
8
8
2
f1
It turns out that
the minimum
8
equals 13 .
134
How can the approximation ratio be evaluated?
x y0
y
{
2
(1,1)
0
x
2
x-y≥0
x+y≥2
The method was called
linear programming,
and we will find that
the minimum value of
the equations f x
and { x-y≥0
x+y≥2
Is 1.
x y2
f x
135
The method can be used to solve the following equations:
b, c, x, y, z, r 0,
b c,
r x y,
b c x y z 1,
x y z.
minimize max(f1,f2,f3,f4) where:
3 1
3
1
1
3
b c x y z,
4 4
4
4
4
4
5 1
1
1
1
3
f 2 b c x y z,
8 8
8
8
8
8
5 1
1
3
3
1
1
f3 b c x y z r ,
8 8
8
8
8
8
2
5 1
1
1
1
5
1
f4 b c x y z r
8 8
8
8
8
8
2
f1
It turns out that the minimum
8
equals 13 .
136
Thank you
137
A
Output:
B
J
C
I
D
H
G
E
F
138
A
Step1.
B
J
C
I
D
H
G
E
F
139
© Copyright 2026 Paperzz