Carthagène
description
Transcript of Carthagène
![Page 1: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/1.jpg)
Carthagène
A brief introduction to combinatorial optimization:
The Traveling Salesman Problem
Simon de GivrySimon de Givry
![Page 2: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/2.jpg)
Find a tour with minimum distance, visiting every city only once
![Page 3: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/3.jpg)
Distance matrix (miles)Distances Camara Caniço Funchal ...
Camara 0 15 7 ...
Caniço 15 0 8 ...
Funchal 7 8 0 ...
... ... ... ... ...
![Page 4: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/4.jpg)
Find an order of all the markers with maximum likelihood
![Page 5: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/5.jpg)
2-point distance matrix (Haldane)
Distances M1 M2 M3 ...
M1 0 14 7 ...
M2 14 0 8 ...
M3 7 8 0 ...
... ... ... ... ...
![Page 6: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/6.jpg)
Link
M1 M2 M3 M4 M5M6 M7
Mdummy
0 0…0…
i,j,k distance(i,j) ? distance(i,k) + distance(k,j)=,
Multi-point likelihood (with unknowns) the distance between two markers depends on the order
![Page 7: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/7.jpg)
Traveling Salesman Problem
Complete graph Positive weight on every edge
Symmetric case: dist(i,j) = dist(j,i) Triangular inequality: dist(i,j) dist(i,k) +
dist(k,j)
Euclidean distance Find the shortest Hamiltonian cycle
![Page 8: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/8.jpg)
78
15
![Page 9: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/9.jpg)
Total distance = xxx miles
![Page 10: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/10.jpg)
Traveling Salesman Problem Theoretical interest
NP-complete problem 1993-2001: +150 articles about TSP
in INFORMS & Decision Sciences databases
Practical interest Vehicle Routing Problem Genetic/Radiated Hybrid Mapping
Problem NCBI/Concorde, Carthagène, ...
![Page 11: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/11.jpg)
Variants Euclidean Traveling Salesman Selection Problem Asymmetric Traveling Salesman Problem Symmetric Wandering Salesman Problem Selective Traveling Salesman Problem TSP with distances 1 and 2, TSP(1,2) K-template Traveling Salesman Problem Circulant Traveling Salesman Problem On-line Traveling Salesman Problem Time-dependent TSP The Angular-Metric Traveling Salesman Problem Maximum Latency TSP Minimum Latency Problem Max TSP Traveling Preacher Problem Bipartite TSP Remote TSP Precedence-Constrained TSP Exact TSP The Tour Cover problem ...
![Page 12: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/12.jpg)
Plan Introduction to TSP Building a new tour Improving an existing tour Finding the best tour
![Page 13: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/13.jpg)
Building a new tour
![Page 14: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/14.jpg)
![Page 15: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/15.jpg)
Nearest Neighbor heuristic
![Page 16: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/16.jpg)
Greedy (or multi-fragments) heuristic
![Page 17: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/17.jpg)
Savings heuristic (Clarke-Wright 1964)
![Page 18: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/18.jpg)
Heuristics Mean distance to the optimum
Savings: 11%
Greedy: 12%
Nearest Neighbor: 26%
![Page 19: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/19.jpg)
![Page 20: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/20.jpg)
Improving an existing tour
![Page 21: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/21.jpg)
Which local modification can improve this tour?
![Page 22: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/22.jpg)
Remove two edges and rebuild another tour
Invert a given sequence of markers
![Page 23: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/23.jpg)
2-change
![Page 24: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/24.jpg)
Remove three edges and rebuild another tour (7 possibilities)
Swap the order of two sequences of markers
![Page 25: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/25.jpg)
« greedy » local search 2-opt
Note: a finite sequence of « 2-change » can reach any tour, including the optimum tour
Strategy: Select the best 2-change among N*(N-1)/2
neighbors (2-move neighborhood) Repeat this process until a fix point is
reached (i.e. no tour improvement was made)
![Page 26: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/26.jpg)
2-opt
![Page 27: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/27.jpg)
Greedy local search Mean distance to the optimum
2-opt : 9% 3-opt : 4% LK (limited k-opt) : 1%
Complexity 2-opt : ~N3
3-opt : ~N4
LK (limited k-opt) : <N4 ?
![Page 28: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/28.jpg)
Complexity n = number of vertices
Algorithm Complexity A-TSP (n-1)! S-TSP (n-1)! / 2 2-change 1 3-change 7 k-change (k-1)! . 2k-1 k-move (k-1)! . 2k-1 . n! / (k! . (n-k)!) ~ O( nk ) k << n
In practice: o( n ) 2-opt et 3-opt ~ O( nk+1 )
In practice: o( n1.2 ) time(3-opt) ~ 3 x time(2-opt)
![Page 29: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/29.jpg)
For each edge (uv), maintain the list of vertices wsuch that dist(w,v) < dist(u,v)
u
v
2-opt implementation trick:
![Page 30: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/30.jpg)
Lin & Kernighan (1973) k-change : e1->f1,e2->f2,...
=> Sumki=1( dist(ei) - dist(fi) ) > 0
There is an order of i such that all the partial sums are positives:
Sl = Sumli=1( dist(ei) - dist(fi) ) > 0
=> Build a valid increasing alternate cycle:xx ’->yx ’, yy’ -> zy’, zz’ -> wz’, etc.dist(f1)<dist(e1),dist(f1)+dist(f2)<dist(e1)+dist(e2),..+ Backtrack on y and z choices + Restart
![Page 31: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/31.jpg)
x
x’
y
y’
z
z’
w
(in maximization)
e2
e3
e4
e1
f1
f3
f2
f4
w’
{x,y,z,w,..} ^ {x’,y’,z’,w’,..} = 0y is among the 5 best neighbors of x’, the same for z’ and w
![Page 32: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/32.jpg)
Is this 2-opt tour optimum?
![Page 33: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/33.jpg)
2-opt + vertex reinsertion
![Page 34: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/34.jpg)
local versus global optimum
![Page 35: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/35.jpg)
Local search &« meta-heuristics » Tabu Search
Select the best neighbor even if it decreases the quality of the current tour
Forbid previous local moves during a certain period of time
List of tabu moves Restart with new tours
When the search goes to a tour already seen
Build new tours in a random way
![Page 36: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/36.jpg)
Tabu Search
• Stochastic size of the tabu list• False restarts
![Page 37: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/37.jpg)
Experiments with CarthaGèneN=50 K=100 Err=30% Abs=30%
Legend: partial 2-opt = early stop , guided 2-opt 25% = early stop & sort with X = 25%
![Page 38: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/38.jpg)
Experiments - next
![Page 39: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/39.jpg)
Other meta-heuristics Simulated Annealing
Local moves are randomly chosen Neighbor acceptance depends on its quality
Acceptance process is more and more greedy Genetic Algorithms
Population of solutions (tours) Mutation, crossover,…
Variable Neighborhood Search …
![Page 40: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/40.jpg)
Simulated AnnealingMove from A to A’ acceptedif cost(A’) ≤ cost(A)or with probability P(A,A’) = e –(cost(A’) – cost(A))/T
![Page 41: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/41.jpg)
Variable Neighborhood Search
• Perform a move only if it improves the previous solution• Start with V:=1. If no solution is found then V++ else V:=1
![Page 42: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/42.jpg)
Local Search
Demonstration
![Page 43: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/43.jpg)
Finding the best tour
![Page 44: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/44.jpg)
Search tree
M2M1 M3
M2 M3 M1 M3 M1 M2
M3 M2 M3 M1 M2 M1
M1,M2,M3
depth 1:
depth 2:
depth 3:
leaves
node
branch
root
= choice point
= alternative
= solutions
![Page 45: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/45.jpg)
Tree search Complexity : n!/2 different orders
Avoid symmetric orders (first half of the tree)
Can use heuristics in choice points to order possible alternatives
Branch and bound algorithm Cut all the branches which cannot lead to a
better solution
Possible to combine local search and tree search
![Page 46: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/46.jpg)
Branch and boundMinimum weight spanning tree
Prim algorithm (1957)
Held & Karp algorithm (better spanning trees) (1971) linear programming relaxation of TSP, LB(I)/OPT(I) 2/3
![Page 47: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/47.jpg)
Christofides heuristic (1976)
=> A(I) / OPT(I) 3/2 (with triangular inequalities)
![Page 48: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/48.jpg)
Complexity
Complexity
Standard computer
Computer 100 times faster
Computer 1000 times faster
N N1 100*N1 1000*N1
N2 N2 10*N2 31,6*N2
N3 N3 4,64*N3 10*N3
2N N4 N4+6,64 N4+9,97
3N N5 N5+4,19 N5+6,29
![Page 49: Carthagène](https://reader036.fdocuments.net/reader036/viewer/2022070418/56815718550346895dc4b691/html5/thumbnails/49.jpg)
Complete methods 1954 : 49 cities 1971 : 64 cities 1975 : 100 cities 1977 : 120 cities 1980 : 318 cities 1987 : 2,392 cities 1994 : 7.397 cities 1998 : 13.509 cities 2001 : 15.112 cities (585936700 sec. 19 years of CPU!)