Lecture 9 Tours

21
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).

description

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). Tours (cont’d). Definition 3.24 page 75 - PowerPoint PPT Presentation

Transcript of Lecture 9 Tours

Page 1: 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).

Page 2: Lecture 9 Tours

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

Page 3: Lecture 9 Tours

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.

Page 4: Lecture 9 Tours

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.

Page 5: Lecture 9 Tours

5

Unique Tours 3!/2 = 3

A

C

B

D

A

C

B

A

C

B

D

D

Page 6: Lecture 9 Tours

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.

Page 7: Lecture 9 Tours

7

Example

0 1 2 3 4 5

5

4

3

2

1

0A

E

D

C

B

Page 8: Lecture 9 Tours

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

Page 9: Lecture 9 Tours

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

Page 10: Lecture 9 Tours

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

Page 11: Lecture 9 Tours

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

Page 12: Lecture 9 Tours

12

Sweep Example

0 1 2 3 4 5

5

4

3

2

1

0A

E

D

C

B

Total

Length

= 17.80

Better

Page 13: Lecture 9 Tours

13

Use Integer Programming On

0 1 2 3 4 5

5

4

3

2

1

0A

E

D

C

B

Page 14: Lecture 9 Tours

14

See TSP1.txt

TSPdata1.txtout1.txt

on class web page

Page 15: Lecture 9 Tours

15

TSP1 Example

0 1 2 3 4 5

5

4

3

2

1

0A

E

D

C

B

Total

Length

= 16.94

Better

Page 16: Lecture 9 Tours

16

See TSP2.txt

TSPdata2.txtout2.txt

on class web page

Page 17: Lecture 9 Tours

17

TSP2 Example

0 1 2 3 4 5

5

4

3

2

1

0A

E

D

C

B

Subtour

Problem!

G

F

Page 18: Lecture 9 Tours

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!

Page 19: Lecture 9 Tours

19

See TSP3.txt

TSPdata3.txtout3.txt

on class web page

Page 20: Lecture 9 Tours

20

TSP3 Example

0 1 2 3 4 5

5

4

3

2

1

0A

E

D

C

B

Subtour

Eliminated

G

F

Page 21: Lecture 9 Tours