Professional Documents
Culture Documents
Presentación Transporte Parte 3 2022-1
Presentación Transporte Parte 3 2022-1
1
TWO CLASSES OF HEURISTIC ALGORITHMS FOR TSP
1) CONSTRUCTIVE ALGORITHMS
build a Hamiltonian circuit starting from the input
data of the original problem (i.e. n, cost matrix cij).
2
CONSTRUCTIVE ALGORITHMS (iterative algorithms)
Main ingredients
4
2
5 Opt = 27
1
6 3
8 5
7 9
Initial vertex: 1 3
4 4
4 6
3
9
8
3 2
7
2 2 7
2
3 5
7
6
4 4
3
9
8
2
2
7
Solution cost: 32
4
Example 1 (Alg. Nearest Neighbour) 3
2
4
2
5 Opt = 27
1
6 3
8 5
7 9
Initial vertex: 6 3
4 4
4 6
3
9
8
3 2
7
2 2 2
7
3 5
5
7
4 6
4 4
3
8
2
2
7
Solution cost: 29
5
Example 1 (Alg. Nearest Neighbour)
2 2
Opt = 27
3 5
4
1
6 3
8 5
Initial vertex: 7 (second vertex: 6) 7 9
4 6
4 4 3
3
9
8
2 2 3 2
7
3 5 2
7
5
7
6
4 4 3
3
8
3 2
Solution cost: 29
6
Example 1 (Alg. Nearest Neighbour) 3
2
4
2
5 Opt = 27
1
6 3
8 5
7 9
3
7
6
4 4 3
3
8
3
2
7
Solution cost: 27
(optimal solution)
7
Example 1 (Alg. Nearest Neighbour) 3
2
4
2
5 Opt = 27
1
6 3
8 5
7 9
Initial vertex: 8 3
4 4
4 6
3
9
8
3 2
7
2 2 2
3 5 7
3
7
6
4 4
3 9
8
2
2
7
Solution cost: 32
(same solution as that found with
“Initial vertex”: 1)
8
Example 2
4 4
33
X 5 5
44
X 66 33
6 6
77
X
X 3 3
99 55 66 X
88
X
2 2
1212
12
1 1
n=6
Optimal solution X
Optimal solution cost: Opt = 33
9
Example 2 (Alg. Nearest Neighbour) 4
3 5
4
6 3
6
7
3
Initial vertex: 1 9 5 6
8 2
12
1
3 5 Opt = 33
4
3
6
7
3
9 5
Solution cost: 35
8 2
4
6 3
6
7
3
Initial vertex: 5 9 5 6
8 2
12
1
3 5 Opt = 33
4
4
6
7
3
8 2
1
No feasible solution found
(with alternative choices as well)
11
Example 2 (Alg. Nearest Neighbour) 4
3 5
4
6 3
6
7
3
Initial vertex: 3 9 5 6
8 2
12
1
3 5
4 Opt = 33
4
3
6
3
9 6
8 2 Solution cost: 33
1
(Optimal solution)
4 4
2 4 4 4 6
2 4 6
4
3 4
3
3 3 8
1 3 3 3 3 3 8
1 3 3 3
3
3
4
4
3 5 7
3 4 5 4 7
4 4
n=8
Optimal solution
Optimal solution cost: Opt = 30
13
Example B (Alg. Nearest Neighbour) 14
4 4
2 4 6
4
3
3 3 8
3 3 3
Initial vertex: 1 1
3
4
3 5 7
4 4
14
Opt = 30
2 4 6
3
8
1
3 3 3 3 3
3
3 5 7
Solution cost: 35
Same solution found with “Initial vertex”: 2, 3, 4, 5, 6, 7, 8
14
Example 3 3
77
2 7
3
33
3
3 33
3 4 555
55
5
2
n=6 1
9999
Optimal solution 4
33
3 4
4 44 3
33
Optimal solution cost = 21 33 44 4
4