Sie sind auf Seite 1von 35

The Travelling Salesman Problem (TSP)

H.P. Williams Professor of Operational Research London School of Economics


1

A Salesman wishes to travel around a given set of cities, and return to the beginning, covering the smallest total distance

Easy to State Difficult to Solve

If there is no condition to return to the beginning. It can still be regarded as a TSP. Suppose we wish to go from A to B visiting all cities.

If there is no condition to return to the beginning. It can still be regarded as a TSP.


Connect A and B to a dummy city at zero distance (If no stipulation of start and finish cities connect all to dummy at zero distance)

If there is no condition to return to the beginning. It can still be regarded as a TSP. Create a TSP Tour around all cities

A route returning to the beginning is known as a Hamiltonian Circuit

A route not returning to the beginning is known as a Hamiltonian Path

Essentially the same class of problem

Applications of the TSP


Routing around Cities
Computer Wiring - connecting together computer components using minimum wire length - ordering sites in time

Archaeological Seriation

Genome Sequencing

- arranging DNA fragments in sequence

Job Sequencing

- sequencing jobs in order to minimise total set-up time between jobs

Wallpapering to Minimise Waste

NB: First three applications generally symmetric Last three asymmetric

Major Practical Extension of the TSP Vehicle Routing - Meet customers demands within given time windows using lorries of limited capacity
10am-1pm 7am-8am 3am-5am

4pm-7pm

6pm-7pm

Depot

8am-10am

6am-9am 2pm-3pm 8

Much more difficult than TSP

History of TSP
1800s 1930s 1954 1971 1975 Irish Mathematician, Sir William Rowan Hamilton Studied by Mathematicians Menger, Whitney, Flood etc. Dantzig, Fulkerson, Johnson, 49 cities (capitals of USA states) problem solved 64 Cities 100 Cities

1977
1980 1987 1987

120 Cities
318 Cities 666 Cities 2392 Cities (Electronic Wiring Example)

1994
1998

7397 Cities
13509 Cities (all towns in the USA with population > 500)

2001
2004

15112 Cities (towns in Germany)


24978 Cities (places in Sweden) But many smaller instances not yet solved (to proven optimality)
9

Recent TSP Problems and Optimal Solutions


from

Web Page of William Cook, Georgia Tech, USA with Thanks


10

n=1512 n=13509 n=7397 n=2392 n=666 n=532 n=120 n=33 n=49

1998 1994 1987 1977 1962 1954

Printed Circuit Board 2392 cities

1987 Padberg and Rinaldi

11

USA Towns of 500 or more population 13509 cities 1998 Applegate, Bixby, Chvtal and Cook

12

Towns in Germany 15112 Cities 2001Applegate, Bixby, Chvtal and Cook

13

Sweden 24978 Cities 2004 Applegate, Bixby, Chvtal, Cook and Helsgaun

14

Solution Methods
I. Try every possibility (n-1)! possibilities grows faster than exponentially

If it took 1 microsecond to calculate each possibility takes 10140 centuries to calculate all possibilities when n = 100 II. Optimising Methods obtain guaranteed optimal solution, but can take a very, very, long time obtain good solutions quickly by intuitive methods. No guarantee of optimality

III. Heuristic Methods

(Place problem in newspaper with cash prize)

15

The Nearest Neighbour Method (Heuristic) A Greedy Method

1. 2. 3. 4.

Start Anywhere Go to Nearest Unvisited City Continue until all Cities visited Return to Beginning

16

A 42-City Problem The Nearest Neighbour Method (Starting at City 1)


5

25

8 31 24 37 32 30 11 7 23 22 29 12 19 20 36

41 14 15 40

6 26 27

28

33

13 42 16

34

35

38 17 3 1 18 4 21 10 39 17

The Nearest Neighbour Method (Starting at City 1)


5

25

8 31 24 37 32 30 11 7 23 22 29 12 19 20 36

41 14 15 40

6 26 27

28

33

13 42 16

34

35

38 17 3 1 18 4 21 10 39 18

The Nearest Neighbour Method (Starting at City 1) Length 1498


5

25

8 31 24 37 32 30 11 7 23 22 29 12 19 20 36

41 14 15 40

6 26 27

28

33

13 42 16

34

35

38 17 3 1 18 4 21 10 39 19

Remove Crossovers
5

25

8 31 24 6 26 27 7 28 30 11 37 32 36

41
14 15 40

23

33
22 13 2 29

9
12

19
20

34

42 16 17 3 1 18 4

35

38 21 10 39 20

Remove Crossovers
5

25

8 31 24 6 26 27 7 28 30 11 37 32 36

41
14 15 40

23

33
22 13 2 29

9
12

19
20

34

42 16 17 3 1 18 4

35

38 21 10 39 21

Remove Crossovers
5

Length 1453

25

8 31 24 6 26 27 7 28 30 11 37 32 36

41
14 15 40

23

33
22 13 2 29

9
12

19
20

34

42 16 17 3 1 18 4

35

38 21 10 39 22

Christofides Method (Heuristic)


1. Create Minimum Cost Spanning Tree (Greedy Algorithm) Match Odd Degree Nodes Create an Eulerian Tour Short circuit cities revisited

2. 3.

23

Christofides Method
25 24 26 27 41 14 15 40 13 42

42 City Problem
5 8 31

Minimum Cost Spanning Tree Length 1124 37

28 30 32 36 11

23 22

33 9

29 2 19 20 16 17 3 4 21 10 39 1 24 34 35 38

12

18

Minimum Cost Spanning Tree by Greedy Algorithm


Match Odd Degree Nodes

25

Match Odd Degree Nodes in Cheapest Way Matching Problem


5 25 24 26 27 41 14 15 40 13 42 20 16 17 3 4 21 10 39 1 26 2 19 34 11 23 22 29 35 38 7 33 9 12 6 28 30 32 36 8 31 37

18

1.

Create Minimum Cost Spanning Tree (Greedy Algorithm) Match Odd Degree Nodes Create an Eulerian Tour Short circuit cities revisited

2. 3.

27

Create a Eulerian Tour Short Circuiting Cities revisited

Length 1436
5 8 31 24 41 14 15 40 26 27 7 23 22 13 42 16 17 3 1 18 4 20 38 21 10 39 28 2 19 29 12 34 6 28 30 11 37 32 36

25

33

35

Optimising Method 1.Make sure every city visited once and left once in cheapest way (Easy) -The Assignment Problem
25 5

- Results in subtours
8 31 37 32 30

Length 1098

24

6 26 27

28

36 11

41
14 15 40 13 42 16

7 23 22 2 29 12 19 20 38 17 4 1 18 10 39 29 34 35

33

21

Put in extra constraints to remove subtours (More Difficult) Results in new subtours
5 25 8 31 24 6 26 27 28 30 37 32 36 11

Length 1154

41
14 15 40 13 42 16

7
23

33
22 2 19 20 29

9
12 34

35

38 17 3 1 18 4 21 10 39 30

Remove new subtours Results in further subtours


5 8 31 24 6 26 27 7 23 22 13 42 16 17 3 1 18 4 20 38 21 10 39 31 2 19 29 12 34 28 30 11 15 40 37 32 36

Length 1179

25

41
14

33

35

Further subtours
5 25 8 31 24 6 26 14 15 40 27 7 23 22 13 42 16 17 3 1 18 4 20 2 19 29 28 30

Length 1189

37 32 36 11

41

33

9
12 34

35

38 21 10 39 32

Further subtours
5 8 31 24 41 14 15 40 26 27 7 23 22 13 42 16 17 3 1 18 4 20 2 19 29 6 28 30 37 32

Length 1192

25

36 11

33

9 12 34

35

38 21 10 39 33

Further subtours
5 8 31 24 41 14 15 40 26 27 7 23 22 13 42 16 17 3 1 18 4 20 2 19 29 33 6 28 30 37 32

Length 1193

25

36 11

9
12 34

35

38 21 10 39 34

Optimal Solution
5 8 25 31 24 6 26 27

Length 1194

37 32 36 11

28
30

41
14 15 40

7
23 22 13 42 16 17 4 1 18 20 10 39 35 38 2 19 29 33 9

12
34

35

21

Das könnte Ihnen auch gefallen