35
1 The Travelling Salesman The Travelling Salesman Problem Problem (TSP) (TSP) H.P. Williams Professor of Operational Research London School of Economics

1 The Travelling Salesman Problem (TSP) H.P. Williams Professor of Operational Research London School of Economics

Embed Size (px)

Citation preview

11

The Travelling Salesman The Travelling Salesman ProblemProblem

(TSP)(TSP)

H.P. WilliamsProfessor of Operational Research

London School of Economics

22

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

33

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.

AB

44

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)

AB

55

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

AB

66

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

77

Applications of the TSPRouting around Cities

Computer Wiring - connecting together computer components using minimum

wire length

Archaeological Seriation - ordering sites in time

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 symmetricLast three asymmetric

88

8am-10am

2pm-3pm

3am-5am7am-8am10am-1pm

4pm-7pm

Major Practical Extension of the TSP

Vehicle Routing - Meet customers demands within given time windows using lorries of limited capacity

Depot

6am-9am

6pm-7pm

Much more difficult than TSP

99

History of TSP

1800’s Irish Mathematician, Sir William Rowan Hamilton

1930’s Studied by Mathematicians Menger, Whitney, Flood etc.

1954 Dantzig, Fulkerson, Johnson, 49 cities (capitals of USA states) problem solved

1971 64 Cities1975 100 Cities

1977 120 Cities

1980 318 Cities

1987 666 Cities

1987 2392 Cities (Electronic Wiring Example)

1994 7397 Cities

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

2001 15112 Cities (towns in Germany)

2004 24978 Cities (places in Sweden)

But many smaller instances not yet solved (to proven optimality)But there are still many smaller instances which have not been solved.

1010

Recent TSP Problems and Recent TSP Problems and Optimal Solutions Optimal Solutions

fromfrom

Web Page of William Cook, Web Page of William Cook, Georgia Tech, USAGeorgia Tech, USA

with Thankswith Thanks

1111

  

                                                                            

      

                                                                                                                                                                                                                                                                                                                                                      

                                                                                          

TTSSPP HHiissttoorryy

>> TTSSPP iinn PPiiccttuurreess

>> 22000044:: 2244997788

                                                                                                                                                                                                                                                                                                                                                        

 

Printed Circuit Board 2392 cities 1987 Padberg and Rinaldi  

1954n=49

1962n=33

1977n=1201987n=5321987n=6661987n=23921994n=73971998n=13509n=1512

2004n=24978

 

1212

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

ChvChvátal and Cookátal and Cook

1313

Towns in Germany 15112 Cities Towns in Germany 15112 Cities

2001Applegate, Bixby, Chv2001Applegate, Bixby, Chvátal and Cookátal and Cook

1414

Sweden 24978 Cities 2004 Applegate, Bixby, ChvSweden 24978 Cities 2004 Applegate, Bixby, Chvátal, Cook and átal, Cook and HelsgaunHelsgaun

1515

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

III. Heuristic Methods obtain ‘good’ solutions ‘quickly’ by intuitive methods.

No guarantee of optimality

(Place problem in newspaper with cash prize)

1616

The Nearest Neighbour Method (Heuristic) – A ‘Greedy’ Method

1. Start Anywhere

2. Go to Nearest Unvisited City

3. Continue until all Cities visited

4. Return to Beginning

1717

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

1

21

20

19

29

7

30

28

3137

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

1818

The Nearest Neighbour Method (Starting at City 1)

1

21

20

19

29

7

30

28

3137

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

1919

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

1

21

20

19

29

7

30

28

3137

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

2020

29

Remove Crossovers

1

21

20

19

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

15 23

22

213

16

317 4

18

42

40

41

5

2121

Remove Crossovers

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

15 23

22

213

16

317 4

18

42

40

41

5

2222

Remove Crossovers Length 1453

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

15 23

22

213

16

317 4

18

42

40

41

5

2323

Christofides Method (Heuristic)

1. Create Minimum Cost Spanning Tree (Greedy Algorithm)

2. ‘Match’ Odd Degree Nodes

3. Create an Eulerian Tour - Short circuitcities

revisited

2424

1

10

20

21

35

12

19

29

7 33

34

39

26

38

23

25

27

246 28

2215

42

16

417

18

8

30

11

32

9

36

3731

3

40

14

13

41

2

5

Christofides Method 42 – City Problem

Minimum Cost Spanning Tree

Length 1124

2525

Minimum Cost Spanning Tree by Greedy Algorithm

Match Odd Degree Nodes

2626

1

10

20

21

35

12

19

29

7 33

34

39

26

38

23

25

27

246 28

2215

42

16

417

18

8

30

11

32

9

36

3731

3

40

14

13

41

2

5

1

10

20

21

35

12

19

29

7 33

34

39

26

38

23

25

27

246 28

2215

42

16

417

18

8

30

11

32

9

36

3731

3

40

14

13

41

2

5

Match Odd Degree Nodes in Cheapest Way – Matching Problem

2727

1. Create Minimum Cost Spanning Tree (Greedy Algorithm)

2. ‘Match’ Odd Degree Nodes

3. Create an Eulerian Tour - Short circuitcities

revisited

2828

Create a Eulerian Tour – Short Circuiting Cities revisited

Length 1436

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

2929

27

Optimising Method

1.Make sure every city visited once and left once – in cheapest way (Easy)

-The Assignment Problem - Results in subtours Length 1098

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

266

24

25

14

1523

22

213

16

317 4

18

42

40

41

5

3030

Put in extra constraints to remove subtours (More Difficult)

Results in new subtours Length 1154

1

21

20

19

29

7

3028

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

15 23

22

213

16

317 4

18

42

40

41

5

3131

Remove new subtours

Results in further subtours Length 1179

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

3232

Further subtours Length 1189

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

3333

Further subtours Length 1192

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5

3434

Further subtours Length 1193

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

15 23

22

213

16

317 4

18

42

40

41

5

3535

Optimal Solution Length 1194

1

21

20

19

29

7

30

28

31 37

32 36

11

9

34

10

39

38

35

12

33

8

2726

624

25

14

1523

22

213

16

317 4

18

42

40

41

5