Professional Documents
Culture Documents
August 6, 2007
Daniel Espinoza
Introduction
Outline
1
Introduction
Daniel Espinoza
Introduction
Introduction
Problem Description
Definition:
Given a finite set of cities,
and travel costs between
each pair of cities, find a tour
that visits each city exactly
once and goes back to the
starting point.
More Precisely:
We will deal with problems where the costs are
symmetric, i.e. the cost of travel from city x to city y is the
same as to travel from city y to city x. Note also that the
condition to visit all cities implies that the problem can be
reduced to decide the order in which every city will be
visited.
Daniel Espinoza
Introduction
Some History
Introduction
Year
1954
1971
1975
1977
1980
1987
1987
1987
1994
1998
2001
2004
2005
2006
Authors
Cities
Dantzig, Fulkerson, and Johnson
49
Held and Karp
64
Camerini, Fratta, and Maffioli
67
Grtschel
120
Crowder and Padberg
318
Padberg and Rinaldi
532
Grtschel and Holland
666
Padberg and Rinaldi
2,392
Applegate, Bixby, Chvtal, and Cook
7,397
Applegate, Bixby, Chvtal, and Cook
13,509
Applegate, Bixby, Chvtal, and Cook
15,112
Applegate, Bixby, Chvtal, Cook, and Helsgaun24,978
Cook et. al.
33,810
Cook et. al.
85,900
Daniel Espinoza
Introduction
100
1000
10000
Introduction
Vehicle Routing.
Scholar bus.
Emergency calls.
Express mail.
Gene sequencing.
Watching the skies
(NASA).
Chip production.
World Tour.
Santas problem.
Daniel Espinoza
Introduction
Could we enumerate?
10 cities: 105.5 posibilities.
100 cities: 10156 posibilities.
1,000 cities: 102,565 posibilities.
33,810 cities: 10138,441 posibilities.
Universe age: 1018 seconds.
Atoms in the universe: < 10100 .
Limited capability.
Introduction
Daniel Espinoza
Introduction
Daniel Espinoza
Introduction
Daniel Espinoza
Introduction
Introduction
Christofides (CHR)
Step 1 Build a minimum weight spanning tree T in
G = (V , E), where V = {1, . . . , n} and E = V V ;
note that c(T ) c .
Step 2 Build a matching M ammong the odd degree
nodes in T ; note that c(M) 12 c .
Step 3 Note that M T is connected and eulerian,
thus exist an ordering of the nodes that induces a
tour with cost less than c(M T ).
Notes:
Ejecucin es O(n3 ).
Garanta NN(I)/OPT (I) 32 .
Existen instancias tal que NN(I)/OPT (I) ( 32 ).
Daniel Espinoza
Introduction
Comparing Heuristics
Random euclidean instances (SEP GAP)
N
102 103 104 105
106
NN
25.6 26.0 24.3 23.6
23.3
GR
19.5 17.0 16.6 14.9
14.2
CHR
9.5
9.7
9.9
9.9
Random instances (SEP GAP)
N
102 103 104 105
106
NN
130 240 360
GR
100 170 250
-
Daniel Espinoza
Introduction
K-Opt heuristics
Local improvement idea.
Exchange 2 edges
Exchange 3 edges
how to reconnect?
Exchange k edges.
Lin-Kernighan uses
2-edge exchanges.
Lin-Kernigham-Helsgun
uses 5-edge exchanges.
Dont provide good
bounds.
Daniel Espinoza
K
3 Cases
2
2 4
1
3
4
45
20
3
K =4
2
5
148
6 6
1368
7
15104
7
8
8
198144
9
2998656
10 51290496
1
10
9
Introduction
K-opt limits:
If P = N P, no heuristic that at every
local-improvement iteration runs in polynomial time,
satisfies A(I)/OPT (i) C for any constant C, even if
we allow exponential-sized neighbourhood.
Even if P = N P, no heuristic with polynomial size
neighborhoods that do not depend on I can find the
optimal solution of I.
Daniel Espinoza
Introduction
K-opt limits:
Daniel Espinoza
Introduction
Comparing Heuristics
Random euclidean instances (SEP GAP)
N
102 103 104 105
106
GR
19.5 17.0 16.6 14.9
14.2
CHR
9.5
9.7
9.9
9.9
2-Opt
4.5
4.9
5.0
4.9
4.9
3-Opt
2.5
3.1
3.0
3.0
3.0
Random instances (SEP GAP)
N
102 103 104 105
106
GR
100 170 250
2-Opt
34
70 125
3-Opt
10
33
63
Daniel Espinoza
Introduction
2
K d 3c Cases
e
b
24
1
4
a
f3
20
54 g
hK = 2
5
148
6
1368
6
flip(b,g)
flip(g,f)
flip(e,d)
flip(c,b)
7
15104
7
8
c
d
8
198144
e
b
9
2998656
10 51290496
a
f
g
10
Introduction
Lin-Kernighan
Lin-Kernighan Heuristic
Basic Idea: improve one edge at a
time.
Ask for c(a, n(a)) c(n(a), n(b)) > 0
Such nodes called promising
Basic Algorithm:
1
2
3
4
5
0
while promising nodes.
Choose b promising,
+ c(a, n(a)) + c(b, n(b))
c(a, b) c(n(a), n(b)).
do flip(n(a), b).
If > 0 return current tour.
Daniel Espinoza
n(a)
n(b)
Introduction
Lin-Kernighan
Lin-Kernighan Refinements
How do we choose b?
Maximize c(b, n(b))
c(n(a), n(b)).
Only consider k closest
neighbors of n(b).
Basic Algorithm:
1
2
What if we do not
succeed?
Allow backtracking.
More at lower levels.
Try also to replace
(p(a), a).
Sort promising nodes by
c(n(a), n(b)).
Daniel Espinoza
4
5
0
while promising
nodes.
Choose b
promising,
+ c(a, n(a)) +
c(b, n(b))
c(a, b)
c(n(a), n(b)).
do flip(n(a), b).
If > 0 return
current tour.
Introduction
Lin-Kernighan
Lin-Kernighan Refinements
How do we choose a?
Set all nodes as marked.
While there are marked nodes.
Call lk_search(v,T) for some marked node v .
if unsuccessful, unmark v .
if successful, mark all endpoints in the flip sequence.
Can we do better?
While there is available time, generate a new initial
tour T , call lin_kernighan(T), keep best tour.
Called repeated Lin-Kernighan.
Best approach up to 1991.
Introduction
Implementation Issues
Basic Routines
flip(a,b) - inverts the segment from a to b.
next(a) - returns node after a in the tour.
prev(a) - returns node before a in the tour.
sequence(a,b,c) - returns 1 if b lies in the
segment a c of the tour.
Instances
Name
Size Target tour
pcb3038
3038
139070
usa13509 13509
20172983
pla85900 85900 143564780
Daniel Espinoza
Introduction
Implementation Issues
Number of operations
Function
lin_kernighan
lin_kernighan winers
average number of flip
lk_search
lk_search winers
flip
undo flip
size of flip
flip size 5
next
prev
sequence
pcb3038
141
91
61
19,855
1,657
180,073
172,396
75
67,645
662,436
715,192
89,755
Daniel Espinoza
usa13509
468
261
99
95,315
9,206
1,380,545
1,336,428
195
647,293
6,019,892
4,817,483
773,750
pla85900
1842
1169
108
376,897
29,126
5,110,340
4,925,574
607
1,463,090
14,177,723
13,758,748
2,637,757
Introduction
Implementation Issues
Implementations:
Implementation
pcb
arrays
7.2
A + RB
1.6
list
50.8
L + 2-search 15.7
L + index + n/p 1.8
L + 3 levels
2.3
L + 2 layers
1.2
Binary Tree
1.4
Instance
usa
pla
246.6 10422.5
21.6
265.9
5929.4 >50000
426.7 24047.9
65.6
697.3
18.5
81.4
10.1
43.9
12.6
52.9
Daniel Espinoza
% total time
flip% n/p% seq%
97
1
1
85
1
1
0
93
6
0
55
44
92
1
1
38
19
4
26
6
1
17
24
6
Introduction
Getting Bounds
How do we obtain
bounds or warranties?
Assign disjoint circles to
every city.
Assign disjoint moats to
set of cities.
Add two times each
ratio and band-width to
get a valid bound.
How do we find each
circle and moat width?
Daniel Espinoza
Introduction
Previous Definitions:
V Set of cities.
E Set of allowed connections between cities, i.e.
E = {(a, b) : a, b V , a = b}.
c Cost of each edge.
(S) Edges crossing the boundary of set S, i.e.
(S) = {(a, b) E : a S, b V \ S}.
IP Formulation:
min
(ce xe : e E)
(xe : e ({v })) = 2
s.t.
(xe : e (S)) 2
v V
xe {0, 1} e E
Daniel Espinoza
Introduction
(ce xe : e E)
(xe : e ({v })) = 2
v V
(xe : e (S)) 2
S
xe [0, 1] e E
Daniel Espinoza
(rv )
(WS )
Introduction
Daniel Espinoza
Introduction
IP through LP
First proposed by Dantzig,
Fulkerson and Johnson (1954)
for the TSP.
1
Consider continuous
relaxation.
2
Let x be the continuous
optimal solution.
3
Is x integer?, then finish.
4
Find valid inequality for
integer points.
5
Add it to our LP formulation.
6
Go back to 2.
Daniel Espinoza
Introduction
Introduction
Double Deckers
Domino Parity
Blossom
Binested
Sub-Tour
Combs
Clique Tree
Stars Path
Bipartition
Daniel Espinoza
Introduction
General IP Cuts
Local Cuts for the TSP
4
3
2
1
0
0 1 2 3 4
x2 Z, x1 R+
P = {(x1 , x2 ) : x1 + x2 4.5}.
x1 + x2 4.5, x1 0 x2 4.5
x2 4.
Daniel Espinoza
Introduction
Non-structured cuts
Local Cuts for the TSP:
Shrink to a small
GTSP (16-48 cities).
Separate on small
problem.
If successful, add
expanded cut to
original problem.
Numerical issues.
Extension to MIP.
What if everything
fails, what do we do?
Daniel Espinoza
2 1
xe = 0.5
1
xe = 1.0
3
7
4
xe = 1.5
4
6
5 3
Introduction
Daniel Espinoza
P2
P
P1
Introduction
Numerical examples
Daniel Espinoza
Introduction
Numerical examples
(%)
35.773
93.689
96.171
96.673
96.953
97.343
98.978
107.960
Daniel Espinoza
%
100
90
80
70
60
50
40
30
20
10
0
LKH
BR
DP+LC40
DP+LC32
DP+LC24
DP
LC24
CH
Introduction
Conclusions
TSP offers a reference for IP in general.
Strategy depends on the real objective:
Find feasible solution.
Find good solution.
Optimality.
Daniel Espinoza
Introduction
Daniel Espinoza
Introduction
References
References I
David Applegate, Robert E. Bixby, Vaek Chvtal, and
William Cook, Finding cuts in the TSP (a preliminary
report), Tech. Report 95-05, DIMACS, Rutgers
University, New Brunswick, NJ, 1995.
, Implementing the Dantzig-Fulkerson-Johnson
algorithm for large traveling salesman problems,
Math. Prog. 97 (2003), 91153.
Daniel Espinoza
Introduction
References
References II
S. Arora, C. Lund, R. Motwani, M. Sudan, and
M. Szegedy, Proof verification and hardness of
approximation problems, Proceedings 33rd Annual
Symposium on Foundations of Computer Science
(Los Alamitos, CA), IEEE Computer Society Press,
1992, pp. 1223.
S. Arora, Polynomial time approximation schemes for
euclidean TSP and other geometric problems,
Proceedings 37th Annual Symposium on Foundations
of Computer Science (Los Alamitos, CA), IEEE
Computer Society Press, 1996, pp. 211.
Daniel Espinoza
Introduction
References
References III
S. Shani and T. Gonzalez, P-complete approximation
problems, Journal of the Association for Computing
Machinery 23 (1976), 555565.
Daniel Espinoza