Lecture 9 Tours
description
Transcript of Lecture 9 Tours
1
Lecture 9 Tours
Sometimes a tree is just too unreliable to be a good network design.
Tours are far more reliable yet only have 1 additional link.
In graph theory, a tour refers to a possible solution of the traveling salesman problem (TSP).
2
Definition 3.24 page 75
Given a set of vertices, a tour T is a set of n edges E such that each vertex has degree 2 and the graph is connected.
Tours (cont’d)
1tv
3
Tours (cont’d)
The number of tours is [(n-1)!]/2
Represent the tour as a permutation:
There are n! such permutations, but the reverse permutation also gives the same tour.
4
Tours With 4 Cities
1 ABCD 2 ABDC 3 ACBD 4 ACDB
5 ADBC 6 ADCB 7 BACD 8 BADC
9 BCAD 10 BCDA 11 BDAC 12 BDCA
13 CABD 14 CADB 15 CBAD 16 CBDA
17 CDAB 18 CDBA 19 DABC 20 DACB
21 DBAC 22 DBCA 23 DCAB 24 DCBA
But 1 ABCD, 10 BCDA, 17 CDAB, & 19 DABC are the same tour.
5
Unique Tours 3!/2 = 3
A
C
B
D
A
C
B
A
C
B
D
D
6
Definition 3.25
Given a set of vertices and a distance function for every pair of vertices, the traveling salesman problem is to find the minimum length tour.
There are many well-known heuristics that can be used to find tours.
7
Example
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
8
Distances
A B C D E
A 5.00 6.40 3.61 3.16
B 5.10 4.24 2.24
C 2.83 4.12
D 2.24
E
9
Nearest Neighbor Heuristic
Begin at A go to E
From E go to B
From B go to D
From D go to C
From C return to A
10
Nearest Neighbor
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
Total
Length
= 18.87
Not
Too
Good
11
Sweep Heuristic
Point X Y Slope Order
A 0 0 Ifinity 5
B 0 5 0.00 1
C 4 5 0.80 3
D 2 3 0.67 2
E 3 1 3.00 4
12
Sweep Example
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
Total
Length
= 17.80
Better
13
Use Integer Programming On
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
14
See TSP1.txt
TSPdata1.txtout1.txt
on class web page
15
TSP1 Example
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
Total
Length
= 16.94
Better
16
See TSP2.txt
TSPdata2.txtout2.txt
on class web page
17
TSP2 Example
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
Subtour
Problem!
G
F
18
Subtour Elimination Constraint
x[A,B]+x[A,C]+x[A,D]+x[A,E]
+x[B,F]+x[C,F]+x[D,F]+x[E,F]+x[B,G]+x[C,G]
+x[D,G]+x[E,G]
> 1
will eliminate these subtours!
19
See TSP3.txt
TSPdata3.txtout3.txt
on class web page
20
TSP3 Example
0 1 2 3 4 5
5
4
3
2
1
0A
E
D
C
B
Subtour
Eliminated
G
F