examensarbete - diva portal200/fulltext...ies, ms-polymers, silicone sealants and gasketing...

77
Examensarbete Computation of Mileage Limits for Traveling Salesmen by Means of Optimization Techniques Johan Torstensson LiTH - MAT - EX - - 2008 / 08 - - SE

Upload: others

Post on 18-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Examensarbete

Computation of Mileage Limits for Traveling Salesmen byMeans of Optimization Techniques

Johan TorstenssonLiTH - MAT - EX - - 2008 / 08 - - SE

Page 2: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s
Page 3: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Computation of Mileage Limits for Traveling Salesmen byMeans of Optimization Techniques

Division of Optimization, Department of MathematicsLinköpings Universitet

Johan Torstensson

LiTH - MAT - EX - - 2008 / 08 - - SE

Examensarbete: 30 hpLevel: DExaminer: Kaj Holmberg,

Division of Optimization, Department of MathematicsLinköpings Universitet

Supervisor: Kaj Holmberg,Professor, Linköpings Universitet

Co-supervisor: Maria Mehlin,Scantech Sverige

Linköping: June 2008

Page 4: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s
Page 5: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Abstract

Many companies have traveling salesmen that market and sell their products.This results in much traveling by car due to the daily customer visits. Thiscauses costs for the company, in form of travel expenses compensation, and en-vironmental effects, in form of carbon dioxide pollution. As many companies arecertified according to environmental management systems, such as ISO 14001,the environmental work becomes more and more important as the environmen-tal consciousness increases every day for companies, authorities and public.

The main task of this thesis is to compute reasonable limits on the mileage ofthe salesmen; these limits are based on specific conditions for each salesman’sdistrict. The objective is to implement a heuristic algorithm that optimizes thecustomer tours for an arbitrary chosen month, which will represent a “standard”month. The output of the algorithm, the computed distances, will constitute amileage limit for the salesman.

The algorithm consists of a constructive heuristic that builds an initial solution,which is modified if infeasible. This solution is then improved by a local searchalgorithm preceding a genetic algorithm, which task is to improve the toursseparately.

This method for computing mileage limits for traveling salesmen generates goodsolutions in form of realistic tours. The mileage limits could be improved if theinput data were more accurate and adjusted to each district, but the suggestedmethod does what it is supposed to do.

Keywords: Period Traveling Salesman Problem, Periodic, Travelling SalesmanProblem, PTSP, TSP, Heuristic Algorithm, mileage limit, business trips,travel expenses compensation.

i

Page 6: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

ii Abstract

Page 7: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Acknowledgements

I would like to thank my supervisor Professor Kaj Holmberg for his assistanceand guidance. I would also like to thank my co-supervisor at Scantech Sverige,Maria Mehlin, for her help, engagement and encouragement throughout thewhole period.

I also would like to thank the rest of the staff at Scantech Sverige for their helpwith understanding the salesmen’s work situation and for compilation of datamaterial.

I would also like to thank my opponent Emelie Raba for her comments andcriticism of the report.

Finally, I would like to thank family and friends for their support.

iii

Page 8: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

iv Acknowledgements

Page 9: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Contents

Abstract i

Acknowledgements iii

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Delimitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Outline of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Background 32.1 Scantech - The Company . . . . . . . . . . . . . . . . . . . . . . 3

2.1.1 Products and Business Idea . . . . . . . . . . . . . . . . . 32.2 The Environmental Work . . . . . . . . . . . . . . . . . . . . . . 4

2.2.1 ISO Certification . . . . . . . . . . . . . . . . . . . . . . . 42.2.2 Reasons for Certification . . . . . . . . . . . . . . . . . . . 52.2.3 Scantech’s Environmental Work . . . . . . . . . . . . . . . 5

2.3 Business Trips . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3.1 The Salesmen’s Working Situation . . . . . . . . . . . . . 7

2.4 Problem Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.4.1 Adjustment of Data . . . . . . . . . . . . . . . . . . . . . 82.4.2 Computation of Distances . . . . . . . . . . . . . . . . . . 10

3 Theoretical Background 113.1 TSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 PTSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.2.1 Formulation in Terms of Graph Theory . . . . . . . . . . 123.3 Heuristic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.3.1 Genetic Algorithms . . . . . . . . . . . . . . . . . . . . . . 133.4 Literature on the PTSP . . . . . . . . . . . . . . . . . . . . . . . 14

3.4.1 A Study in the PTSP Literature . . . . . . . . . . . . . . 143.4.2 Mathematical Formulation of the PTSP . . . . . . . . . . 15

v

Page 10: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

vi CONTENTS

4 Mathematical Formulation 174.1 Description of the Problem . . . . . . . . . . . . . . . . . . . . . 174.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.4 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.5 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . 18

4.5.1 Explanation of the Model . . . . . . . . . . . . . . . . . . 194.6 Commentary on the Mathematical Model . . . . . . . . . . . . . 19

5 Solution Method 215.1 The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.2 Description of the Algorithm . . . . . . . . . . . . . . . . . . . . 21

5.2.1 Initial Tour . . . . . . . . . . . . . . . . . . . . . . . . . . 235.2.2 Tour Construction . . . . . . . . . . . . . . . . . . . . . . 235.2.3 Extra Improvement Procedure . . . . . . . . . . . . . . . 235.2.4 Empty Tours . . . . . . . . . . . . . . . . . . . . . . . . . 245.2.5 Improvement Procedure . . . . . . . . . . . . . . . . . . . 255.2.6 Tour Improvement . . . . . . . . . . . . . . . . . . . . . . 255.2.7 Insertion Rule . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.2.7.1 Check Feasibility . . . . . . . . . . . . . . . . . . 265.2.8 Removal Rule . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.3 Example of Algorithm Progress . . . . . . . . . . . . . . . . . . . 285.4 Alternative Solution Techniques . . . . . . . . . . . . . . . . . . . 32

6 Results 336.1 Runs and Parameters . . . . . . . . . . . . . . . . . . . . . . . . 336.2 Computational Results . . . . . . . . . . . . . . . . . . . . . . . . 33

6.2.1 An Illustration of the Tours . . . . . . . . . . . . . . . . . 356.3 Customization to Budgeted Sales . . . . . . . . . . . . . . . . . . 35

7 Analysis 397.1 Computation of a Lower Boundary . . . . . . . . . . . . . . . . . 397.2 Analysis of Computational Results . . . . . . . . . . . . . . . . . 397.3 Analysis of the Algorithm . . . . . . . . . . . . . . . . . . . . . . 40

7.3.1 Algorithm Fluctuation . . . . . . . . . . . . . . . . . . . . 407.3.2 Running Times . . . . . . . . . . . . . . . . . . . . . . . . 407.3.3 Essential Procedures . . . . . . . . . . . . . . . . . . . . . 41

8 Demarcation of New District Boundaries 438.1 Reason for Proposal of New Boundaries . . . . . . . . . . . . . . 438.2 The Proposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Page 11: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

CONTENTS vii

9 Conclusions and Further Research 479.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479.2 Further Research . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

A More Illustrations of Tours 49

B Detailed Maps 53

Bibliography 59

Page 12: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

viii CONTENTS

Page 13: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

List of Figures

2.1 Map of Scandinavia, with the sales offices marked . . . . . . . . . 42.2 Pollution of carbon dioxide (CO2) due to business trips . . . . . 62.3 Average monthly mileages for the districts . . . . . . . . . . . . . 72.4 Map of the current district boundaries . . . . . . . . . . . . . . . 9

3.1 Solutions to a TSP and a PTSP (the square represents the home-town) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

5.1 An overview of the algorithm progress . . . . . . . . . . . . . . . 225.2 Insertion Rule: Inserting customer s into a non-empty tour . . . 265.3 Insertion Rule: Inserting customer s into an empty tour . . . . . 265.4 An axis that illustrates the punishment intervals . . . . . . . . . 275.5 Removal Rule: Removing customer r . . . . . . . . . . . . . . . . 285.6 Initial Tour after insertion of customer 2. . . . . . . . . . . . . . 295.7 Tour Construction after insertion of customer 6. . . . . . . . . . 295.8 Tour Construction after insertion of customer 5. . . . . . . . . . 295.9 Tour Construction after insertion of all six customers. . . . . . . 305.10 The tours after the extension of one day and two customers. . . . 305.11 Empty Tour after moving customer 8 to the empty tour on day 3. 315.12 Improvement Procedure after moving customer 7 to the tour on

day 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

6.1 Mileage limits (green striped) and mileage means (black) . . . . . 346.2 The tours of district 15, Skaraborg . . . . . . . . . . . . . . . . . 37

7.1 The result of all 30 runs for district 2 . . . . . . . . . . . . . . . . 40

8.1 Map of the proposed district boundaries . . . . . . . . . . . . . . 45

A.1 The tours of district 7, Västmanland/Närke . . . . . . . . . . . . 50A.2 The tours of district 14, Bohuslän . . . . . . . . . . . . . . . . . . 51A.3 The tours of district 24, East Skåne . . . . . . . . . . . . . . . . 52

ix

Page 14: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

x LIST OF FIGURES

B.1 Map of the districts in southern Sweden . . . . . . . . . . . . . . 54B.2 Map of the districts in southern-central Sweden . . . . . . . . . . 55B.3 Map of the districts in northern-central Sweden . . . . . . . . . . 56B.4 Map of the districts in northern Sweden . . . . . . . . . . . . . . 57

Page 15: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

List of Tables

2.1 Information concerning the districts (a star (*) implies that nomileage limit will be computed for that district) . . . . . . . . . . 8

6.1 Mileage limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.2 Results for the tours on district 15, Skaraborg . . . . . . . . . . . 356.3 Budgeted mileage limits . . . . . . . . . . . . . . . . . . . . . . . 36

xi

Page 16: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

xii LIST OF TABLES

Page 17: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 1

Introduction

This chapter gives a description of the problem background and the purpose anddelimitations of the thesis.

1.1 Background

Almost every company has salesmen that market and sell their products. Atraveling salesman visits customers every day and does spend much time in thecar. The more traveling the more increases the cost for the company, in theform of travel expenses compensation to the salesmen, and the effects on theenvironment. To keep down the traveled distance is therefore essential both inthe perspective of cost and environmental considerations.

On account of that, it is important to get an idea of whether a traveling sales-man’s mileage1 is reasonable, with respect to the customers’ geographical lo-cations in relation to the salesman’s hometown. Taking an arbitrary “normal”month for a specific salesman and optimizing on which day and in which orderthe customers should be visited, that distance will constitute a mileage limit.The problem will be a periodic variant of the well-known Traveling SalesmanProblem. This thesis concentrates on finding a minimal travel distance for everysalesman, with the help of a heuristic algorithm.

1.2 Purpose

The main purpose of this thesis is to solve the periodic Traveling SalesmanProblem with a heuristic algorithm that consists of a constructive heuristic, alocal search algorithm and a metaheuristic. A subproblem in this thesis is alsoto look at the boundaries of the districts and to demarcate these in order toreduce the environmental effetcs.

1mileage refers to the traveled distance in consequence of business trips

1

Page 18: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

2 1.4. Outline of the Thesis

1.3 DelimitationsBecause the number of customers is huge for every district, it would be verytime-consuming to compute the exact road distance between all of them. There-fore the distances are approximated with the air distances, with an addition tocompensate the error. An estimation of how often the customers are visited arealso done, where the basis is the order statistics.

1.4 Outline of the ThesisIn Chapter 2 the background of the company and their business trips is pre-sented. Chapter 3 gives a theoretical background to the periodic variant of theTraveling Salesman Problem and the heuristics that are used. A mathematicalformulation of the problem is given in Chapter 4 and in Chapter 5 a solutionmethod is presented. Chapter 6 deals with the results from the algorithm andthey are analyzed in Chapter 7. A proposal of new district boundaries is givenin Chapter 8. Conclusions and suggestions for future research are presentedin Chapter 9. In Appendix A additional illustrations of tours are given, whileAppendix B presents detailed maps of the proposed district boundaries.

Page 19: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 2

Background

The following chapter deals with the background of the company and the com-pany’s way of dealing with the business trips.

2.1 Scantech - The CompanyThe company Scantech Sverige AB markets chemical products. It was foundedin 1990 and has its head office and inventory in Göteborg. There are also salesoffices in Ski (near Oslo), Norway and in Jyväskylä, Finland, see Figure 2.1.Scantech Sverige is a part of the Norden Holding group that in turn is a part ofthe American ITW group, a global producer of engineered fasteners and compo-nents. The head office and the production unit of the Norden Holding group arelocated in Hadsund, Denmark. Some of the company’s products are producedin the factory in Denmark, while the rest of the products are bought in fromwithout. Scantech Sverige AB will be called just Scantech in the rest of thisthesis.

2.1.1 Products and Business IdeaThe company provides technical adhesives as cyanoacrylates, anaerobics, epox-ies, MS-polymers, silicone sealants and gasketing materials. They also supplyaerosol products and epoxy based engineering materials. Scantech’s businessidea is to “meet the requirements of our customers within the areas of bond-ing, retaining, thread locking, gasketing, sealing and industrial products.” Theirconcept also includes “offering the customer a tailor-made product range thatcovers a diversity of applications within the fields of maintenance, service andmanufacturing. Through ongoing customer training we ensure a high quality,reliability and a safe working environment.”

They also say “we should be cognized as a concept and as a natural first choice ofNordic industry within bonding, retaining, thread locking, gasketing and seal-ing. We are aware that key issues like “knowledge, quality and engagement”must pervade all our work. In order to constantly guarantee this we secure our

3

Page 20: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

4 2.2. The Environmental Work

Figure 2.1: Map of Scandinavia, with the sales offices marked

production and our work with quality and environmental management systems.”

2.2 The Environmental Work2.2.1 ISO CertificationISO, the International Organization for Standardization, is an internationalstandard-setting organ. It is the world’s largest developer and publisher ofinternational standards [1]. ISO consists of a network of 157 member countries,where each country is represented by a national standard institute. Sweden isrepresented by SIS, Swedish Standards Institute [2].

There is an enormous amount of ISO standards and below follows a few exam-ples:

Page 21: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

2.2. The Environmental Work 5

• Paper sizes, e.g. A4

• ISBN numbers on books

• Screw threads

• Credit cards

ISO also have standards for management systems. The ISO 9000 and ISO 14000families are among ISO’s best known standards and they cover quality manage-ment and environmental management. ISO 14001 is a member of the ISO 14000family and it is an environmental management system that is a tool in order tocontinuously improve the environmental work by companies and organizations.It implies requirements with guidance for use and the environmental issues areintegrated systematically in the daily work.

2.2.2 Reasons for CertificationThat a company is certified according to a management system is done espe-cially for businesslike reasons. It is often profitable to certificate the companyand it can be a competitive advantage in purchasing. The communication withcustomers and suppliers are eased and a management system gives a bettercontrol and knowledge of the company itself but also increased goodwill andcredibility.

It is more common these days that companies have claims to be certified accord-ing to environmental and/or quality management systems. It is not only theauthorities, but also the company’s customers, employees and financiers thatthese claims can come from. Hence, a certification can be both an advantageand a necessity.

2.2.3 Scantech’s Environmental WorkScantech is certified according to the environmental management system ISO14001. The company is certified since April 2001.

The environmental influence that the company causes, make up of three differ-ent parts. It is the products that they sell, their own waste and pollution ofclimate-influencing gases. The latter consists of pollution from transports andthe consumption of power and heat. Their transports consist of business trips,transportation of goods and travels to and from work.

The company has achieved much in its continuing environmental work, but oneitem that has been neglected is the carbon dioxide pollution in consequenceof business trips. Before 2006, Scantech had these environmental objectivesconcerning this:

• Increase the traveling by train, instead of by car or by plane, with 10%

• Develop a model for a long-term decreasing of the salesmen’s mileages

Page 22: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

6 2.3. Business Trips

Neither of these objectives has been accomplished during 2006. It is the secondpoint above that is the main task in this thesis.

2.3 Business Trips

Scantech has divided Sweden into 25 districts and each district corresponds toone salesman. Three of these salesmen are sales managers and one is productmanager, which mean that they have other assignments than just selling, e.g.training new salesmen. For detailed information, see Table 2.1. A map of thedistricts is given in Figure 2.4, where a red filled circle denotes the hometownof that district.

For Scantech, the business trips stand for the greatest part of the company’senvironmental pollution. The carbon dioxide pollution has increased in the pastyears, see Figure 2.2, and this is a consequence of that the salesmen’s mileagesalso have increased. Hence, with respect for the environment and the ISO 14001certification, the goal to keep the mileage of the salesmen down is of utmost im-portance.

Figure 2.2: Pollution of carbon dioxide (CO2) due to business trips

The fact that the salesmen plan their trips in a strategically way is importantto avoid unnecessary travels. Reduced traveling makes the pollution decrease,which results in decreasing costs and environmental effects. Scantech wantsto get an idea of whether a salesman’s mileage is reasonable. This makes thepreparation of a model, which output is a limit for the mileage, an importantstep in the company’s environmental policy. This limit is a maximal numberof kilometers that a salesman is allowed to cover for a specified time period.The limit is unique for every salesman and district and is dependent on thecustomers’ geographical locations in relation to the salesman’s hometown.

Page 23: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

2.4. Problem Data 7

2.3.1 The Salesmen’s Working SituationA salesman normally works five days a week with an 8-hour working-day. In-cluding travels yet a working day tends to be 9-10 hours long. During that time,normally 4-10 customers are visited and a customer visit lasts between 30 and60 minutes in general. Some salesmen have large districts and sometimes theystay overnight to continue traveling the next day, but no respect will be takento this in the model.

The salesmen normally works approximately 220 days per year and each sales-man has about 200 active customers, which means customers that have placedan order the last year. The time between two consecutive visits for a customeris normally at least two weeks, while some customers are visited just once a year.

2.4 Problem DataData, in form of customer and order data, is always taken from the samesalesman and as a standard approach from the year 2007. For some dis-tricts/salesmen, data are missing for 2007 and are then replaced with datafrom 2006 or from the beginning of 2008. Some districts have data for only afew months, which makes the basis becomes poor for those districts. Mileagedata for each district are given in Figure 2.3.

Figure 2.3: Average monthly mileages for the districts

For some districts no mileage limits will be computed and there are differentreasons for that. The salesmen for districts Uppland and Halmstad/Helsingborgare sales managers and the salesman for district Södermanland is product man-ager. Their business trips consist of more than customer visits, hence a mileagelimit for these districts would be of no use for the company. The district Dalarnahas been empty the most recent years, since it has not been able to recruit asalesman. Therefore there are no statistics for that district, but the salesman

Page 24: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

8 2.4. Problem Data

in the district Västmanland/Närke has covered some customers in Dalarna.

As in ordinary workplaces, employees quit and new ones begin and this makesthe data concerning sell and mileage to halt. Sometimes it also implies thatoccasional districts remain empty.

2.4.1 Adjustment of DataIt can be assumed that a salesman works eleven months a year, excluding July.Another assumption is that each month consists of 20 working days. How manytimes each customer is visited is unknown so estimation is done; an explanationis given below. The visits, for the whole period that data is available, are evenlydistributed among the months and then one month is chosen to represent anarbitrary month. That month and its customer visits are then used to solve theproblem and this is done for every district that is concerned.

Code Area Hometown Commentary1 Norrbotten/Lappland Skellefteå2 Västerbotten/Örnsköldsvik Holmsund3 Jämtland/Västernorrland Timrå4 Gävleborg Bollnäs5 Dalarna∗ - Empty6 Värmland Karlstad Sales manager7 Västmanland/Närke Västerås8 Uppland∗ Uppsala Sales manager9 Stockholm North Stockholm

10 Stockholm South∗ - Empty11 Södermanland∗ Katrineholm Product manager12 Östergötland/Södermanland Norrköping13 Östergötland Linköping14 Bohuslän Uddevalla15 Skaraborg Stenstorp16 Göteborg North Göteborg17 Göteborg South Stenungsund18 Älvsborg/Halland Borås19 Jönköping Jönköping20 Kronoberg/Kalmar Älmhult21 Kalmar/Blekinge/Öland Kalmar22 Halmstad/Helsingborg∗ Viken Sales manager23 NW Skåne Helsingborg24 East Skåne Malmö25 SW Skåne Kävlinge

Table 2.1: Information concerning the districts (a star (*) implies that nomileage limit will be computed for that district)

The order data do not tell how often a customer actually is visited. Every cus-tomer visit do not lead to a sell and this figure remains unknown because thesalesmen do not keep statistics on it. Therefore, how many times each customeris visited, is estimated by a given rule, which has been developed in discussion

Page 25: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

2.4. Problem Data 9

Figure 2.4: Map of the current district boundaries

Page 26: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

10 2.4. Problem Data

with the company. The rule works like this:

In general, approximately one-fifth of the customer visits lead to a sell. Hence,the number of visits is estimated to be five times the number of orders, butmaximally once a month, for customers that order less than five times the lastyear. The customers that order five times per year or more are presumed tovisit the customers these number of times and no more.

The rule could also be formulated like this: Let fvisits denote the number ofvisits, let forders denote the number of orders and let fmonths denote the numberof months that there are order statistics for (normally 11), then

fvisits ={forders if forders ≥ 5min(5 · forders, fmonths) if forders < 5 .

2.4.2 Computation of DistancesThe distances between the customers (and the salesman) are computed by meansof the customers’ geographical coordinates. This method gives the air distance,which always will be shorter than the road distance. To compensate this, afactor between 20–40% is added to the air distance, depending on the roadstructure of the actual district. These percentages were chosen according toBjelmrot [3]. A comparison between the road distances and the air distancewas also done, to verify that the percentages were reasonable. This approachdoes not give the correct distances, but data for the real road distances arenot available. To assemble this for around 100 customers per district and 20districts totally would take plenty of time and therefore this method seems tobe an acceptable compromise.

Page 27: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 3

Theoretical Background

This chapter explains the theory behind the problem types and the solution meth-ods used in this thesis.

3.1 TSPThe Traveling Salesman Problem (TSP) is a very well-known optimization prob-lem that can be applied in many kinds of situations, especially in the transportsector. It can be described as follows: Given n cities and costs of travelingbetween them, the purpose is for the traveling salesman, starting out from hishometown, to visit all the cities exactly once and then return home, and to dothis in the most cost-effective way. Instead of using costs of traveling betweencities, distance or time can be used. Similarly, customers can be used insteadof cities. An example of a solution to a TSP is given in Figure 3.1(a).

Let I be the set of all cities, including the hometown, and let cij be the cost fortraveling between city i and city j. Also let the binary variable xij be 1 if city jis visited immediately after city i, or 0 otherwise. Then the Traveling SalesmanProblem mathematically can be formulated like this:

min∑i∈I

∑j∈I

cijxij

∑j∈I

xij = 1 i ∈ I∑i∈I

xij = 1 j ∈ I∑i∈S

∑j∈S

xij ≤ |S| − 1 S ⊂ I, |S| ≥ 2

xij ∈ {0, 1} i ∈ I, j ∈ I

The objective function minimizes the total distance traveled. The first twoconstraints ensure that the salesman arrives and leaves each city exactly once.The third constraint assures that there are no subtours, i.e. the route must becoherent. The last constraint secures that the variables are binary.

11

Page 28: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

12 3.2. PTSP

(a) A solution to a TSP (b) A solution to a three-day PTSP (twocustomers require two visits)

Figure 3.1: Solutions to a TSP and a PTSP (the square represents the home-town)

3.2 PTSPAn extension of the TSP is the Period Traveling Salesman Problem (PTSP),where the planning horizon consists of several days. In this formulation, cus-tomers are chosen instead of cities. In this problem, the traveling salesman mustleave home, visit at least one customer and then return home, and do this forevery day in the period. The PTSP consists of designing a tour for every dayso that each customer’s visit requirement is fulfilled and at the same time min-imizing the distance traveled over the whole period. An example of a solutionto a PTSP is given in Figure 3.1(b).

Let ri denote how many times customer i must be visited over the period ofm days. Each customer must be visited at least once and at most daily, i.e.1 ≤ ri ≤ m. For each customer there is a set V (i) = {C1, C2, . . . , Cni} thatconsists of possible combinations of visit days. Each combination Ck ∈ V (i) iscomposed of ri days and ni denotes how many different visit combinations cus-tomer i has. The problem is to choose the visit combination for each customerthat minimizes the total distance traveled.

For example, if ri = 3 and V (i) = {{1, 3, 5}, {2, 4, 6}} in a 6-day period (m = 6),then customer i must be visited three times, either on days 1, 3 and 5 or on days2, 4 and 6. The sets of visit combinations are constructed in a way that spreadthe visit days evenly over the planning horizon. It means that in the exampleabove, days 1,2 and 3 would not be an allowed visit combination, because thecustomer is visited three days in a row and that is too close in time.

3.2.1 Formulation in Terms of Graph TheoryThe PTSP can be formulated as a network optimization model [4]. Let I bethe set of nodes consisting of all customers and the salesman’s hometown, andlet E be the set of edges between every node in I. Each edge (i, j) ∈ E hasa weight cij connected to it, which represents the distance between node i andnode j. The graph G = (I, E) is then a complete graph. The goal is to constructm tours so that each customer is visited the required number of times and to

Page 29: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

3.3. Heuristic Algorithms 13

simultaneously minimize the total distance traveled over the whole period.

3.3 Heuristic AlgorithmsThe word heuristic comes of the Greek word heuriskein that means “to find”.The task of a heuristic is to find a solution to an optimization problem. Themethod produces a good solution in some way, but the quality of the solutionis unknown, unless it is compared with other solutions or if the optimal valueis known. The solution often is near-optimal, but it is hard to determine howclose to optimum it is or if an optimal solution actually is reached. Some typesof optimization algorithms can ensure that optimum is found, but heuristic al-gorithms cannot do that. The facts in this section are taken from the bookOptimeringslära [5] by Lundgren et al.

There are several reasons for using a heuristic instead of other solutions methods.Here follow four possible reasons:

• An optimizing method is too time-consuming.

• An optimizing method is too memory requiring.

• Input data to the problem is uncertain and a near-optimal solution isacceptable.

• A simple heuristic is often more understandable for a non-expert. Thismakes it easier to describe what happens in the method.

There are different types of heuristics. Constructive heuristics, local search al-gorithms and metaheuristics are the types that are used in the solution methodin this thesis. A constructive heuristic successively builds a feasible solution.The local search algorithm is a method that iteratively improves a feasible solu-tion through changes and modifications of the the solution; this tends to a localoptimum. A metaheuristic is an extension of a local search algorithm and theadvantage with this method is that the algorithm can go from a local optimumto another one and that increases the possibility to find a better solution. Awell-known metaheuristic is tabu search.

3.3.1 Genetic AlgorithmsA genetic algorithm (GA) is a search technique used to find good solutions tooptimization problems and is a part of the evolutionary algorithms. They are inturn a part of the metaheuristic algorithms. The evolutionary algorithms try tosimulate the evolution in nature, hence its name. Genetic algorithms are oftenused to solve problems that other algorithms and solution methods fail to solve,due to the unreasonable long computation time. An overview of how geneticalgorithms work is done by Beasley et al. [6].

Here follows a brief description of a genetic algorithm, see Dizdarevic et al. [7]for details. The search space of the problem consists of a number of individ-uals. An individual is a possible solution to the problem. Every individual is

Page 30: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

14 3.4. Literature on the PTSP

represented by a chromosome, which consists of a character string or a matrix.The chromosome describes how a solution is stored in the algorithm. An indi-vidual’s fitness score measures how good the solution of that individual is. Apopulation consists of several individuals and is the part of the search space thatthe algorithm currently looks at.

At first, an initial population is selected. Then parents are chosen from the pop-ulation and they produce children. This procedure is called crossover. Thesechildren are added to the population, while the weakest individuals are removedfrom it. After a crossover, the individuals could be affected by mutation, butthis happen with a very low possibility. The steps just described are then ex-ecuted iteratively until the algorithms stops. One iteration of the algorithm iscalled generation.

3.4 Literature on the PTSPThe periodicity of the PTSP adds an extra dimension to the TSP and does makeit more useable in real world practice. Examples of occasions when problems ofthis type arise are in mail delivery and lawn-care services (see Cordeau et al.[8]).

3.4.1 A Study in the PTSP LiteratureThe PTSP is an NP-hard optimization problem and is a generalization of theTraveling Salesman Problem (TSP). The TSP is a classic and very well-studiedproblem and a great work is the book by Lawler et al. [9]. Bodin et al. [10] dealwith the TSP and many other similar problem types. It also includes severalalgorithms. However, the literature on periodic variants of the TSP is not thatextensive.

The first approach of solving a periodic routing problem is done by Christofidesand Beasley in 1984 [11]. The problem in their article is the Period VehicleRouting Problem (PVRP). The PTSP is a special case of the PVRP, in casethere is only one vehicle available. They formulate the problem mathematicallybut the problem is solved heuristically since the PVRP is NP-hard. The ideaof their heuristic algorithm is that minimizing the distance for every day inde-pendently, also results in a minimization of the total distance of the PVRP.

In addition, different methods in order to solve the PTSP have been developedby Paletta [12, 13], Cordeau et al. [8], Bertazzi et al. [14] and Paletta and Triki[15]. The heuristic algorithms in these articles but [8] are similar to each otherbecause they are constructed in the same way.

In the article by Paletta in 1992 [12], two almost identical heuristic algorithmsare presented. In the first step, that is common for the both algorithms, anon-visited customer is assigned to one of its visit combinations. This proce-dure continues until all days have been given a tour. Secondly, the remainingcustomers (they that are not inserted in the solution yet) are inserted in the

Page 31: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

3.4. Literature on the PTSP 15

solution in the most cost-effective way.

In 1995, Chao et al. [4] present a new technique for solving the PTSP. An initialsolution is produced by balancing the number of customers that are serviced oneach day of the planning period. After that, different improvement proceduresare used in order to get the best possible solution.

A tabu search heuristic for periodic and multi-depot vehicle routing problemsis presented by Cordeau et al. [8] in 1997. The problems in question are thePVRP, the PTSP and the MDVRP (Multi-Depot Vehicle Routing Problem).The first step is to find an initial solution, but this solution may be infeasible.Therefore, the GENI heuristic [16] is used to for insertions and removals in orderto reach feasibility. Then a tabu heuristic is used to improve the solution asmuch as possible and that in turn uses 4-opt and cheapest-insertion techniques.

Again, in 2002 Paletta [13] introduces a new heuristic algorithm for the PTSP.Starting with all tours empty, the customers are inserted one by one into thetours. If a tour remains empty, a procedure that fixes this is performed untilall days of the planning period have non-empty tours. Now having a feasiblesolution, an improvement procedure is performed in order to possibly find abetter solution than the current one.

In 2004 Bertazzi, Paletta and Speranza [14] present an improved heuristic al-gorithm with respect to the one proposed by Paletta [13]. The difference is inthe improvement phase and computational results indicate this algorithm to bebetter than the previous one.

In the same year, Paletta and Triki [15] propose a heuristic algorithm thattries to solve the PTSP, but now with the assumption that the distances maybe asymmetric. This algorithm is similar to the ones described in [13] and[14]. What differs this from the other two is that possible occurrences of dayswith empty tours is not taken into account, a slightly modified improvementprocedure and that the procedures that handles insertions and removals areupdated with more possible options.

3.4.2 Mathematical Formulation of the PTSPMost of the articles that deal with the PTSP do not include a mathematicalformulation. Caglar and Matta [17] use a formulation with minimum frequencyconstraints and prevention of too frequent visits, which handles the periodicityin the problem. Constraints that limit the length of a working day are alsoincluded in their formulation.

Another type of formulation is presented by Cordeau et al. [8]. They first for-mulate the PVRP but then show how a slight modification can transform thisproblem into a PTSP. To solve the periodicity in the problem they introducevisit combinations. A visit combination consists of a set of days and the cus-tomer will be visited these days, if this combination is chosen. A customer canhave several such combinations and they are all given beforehand.

Page 32: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

16 3.4. Literature on the PTSP

A mathematical formulation is presented in 2007 by Basetto and Mason [18], forthe special case when the length of the planning period is just two days. Thiscircumstance makes the formulation a little bit different in comparison to theother formulations described above. Their formulation aslo includes constraintsregarding the maximum number of customers visited per day.

All these three types of mathematical formulations have great similarities witheach other, because they all are built on the formulation of the TSP. The dif-ferences are in how to handle the periodicity in the PTSP and this of courseaffects how many types of variables and constraints there are and how the con-straints are formulated. The model and the algorithm described in [8] involvevisit combinations and so do the algorithms described in [13, 14, 15].

Page 33: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 4

Mathematical Formulation

The problem of this thesis is mathematically formulated in this chapter.

4.1 Description of the Problem

The problem that is used to compute the mileage limits is a modified version ofthe Period Traveling Salesman Problem (PTSP), formerly described in section3.2. The salesman’s task is to start out from his home, visit customers and thenreturn home again in the end of the day. This must be done for each day of theplanning period and the objective is to do this in a way that minimizes the totaldistance traveled. No tour is allowed to be empty, even if it would reduce thetraveled distance. This is because the salesman must have the option to avoidworking overtime, if this is not ordered by the company.

What differs between the formulation that follows in this chapter, from theoriginal PTSP, is additional constraints regarding the length of a working day,the daily distance traveled and the daily number of customer visits. Theseconstraints are added because otherwise the generated tours may be unrealistic,with a few tours that has almost all customer visits and the remaining toursjust a few visits each.

4.2 Parameters

The following parameters are used and they are of either scalar, vector or matrixform. Customer 0 represents the salesman’s home.

17

Page 34: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

18 4.5. Mathematical Model

n = number of customersm = length of the planning horizon [days]cij = symmetric distance between customer i and customer j [km]τi = approximate duration of a customer visit (τ0 = 0; τi = constant, i ∈ N) [h]v = approximate average speed [km/h]tij = traveling time from customer i to customer j (tij = cij/v) [h]L = threshold value for the length of a working day [h]D = threshold value for the distance traveled per day [km]K = threshold value for the number of visited customers per day

akd ={

1 if day d belongs to visit combination k0 otherwise

ni = number of visit combinations for customer i

4.3 SetsThe sets below are used in the formulation.

N = {1, 2, . . . , n}, the set of all customersA = {(i, j) : i, j ∈ {0} ∪N, i 6= j}, the set of all arcsP = {1, 2, . . . ,m}, the set of all days in the planning periodCk = a visit combination of days

V (i) = {C1, C2, . . . , Cni}, the set of visit combinations for customer i

4.4 VariablesTwo variables are used in the formulation, the binary variables xijd and yik.Note that the distances are symmetric, so it is equivalent if xijd or xjid is equalto 1 on an arbitrary day d.

xijd ={

1 if customer j follows directly on customer i on day d0 otherwise

yik ={

1 if visit combination k ∈ V (i) is assigned to customer i0 otherwise

4.5 Mathematical ModelThe mathematical model in this thesis is a variant of the PTSP and is mainlybased on the formulation by Cordeau et al. in [8]. What make this formulationunique is the additional constraints regarding the daily limitations of the lengthof a working day, the distance traveled and the number of visited customers.

min∑d∈P

∑(i,j)∈A

cijxijd (4.1)

Page 35: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

4.6. Commentary on the Mathematical Model 19

∑k∈V (i)

yik = 1 i ∈ N (4.2)

∑j:(i,j)∈A

xijd −∑

k∈V (i)

akdyik = 0 i ∈ N d ∈ P (4.3)

∑(i,j)∈A

(tij + τi)xijd ≤ L d ∈ P (4.4)

∑(i,j)∈A

cijxijd ≤ D d ∈ P (4.5)

∑(i,j)∈A

xijd − 1 ≤ K d ∈ P (4.6)

∑j:(h,j)∈A

xhjd −∑

i:(i,h)∈A

xihd = 0 h ∈ N ∪ {0} d ∈ P (4.7)

∑j∈N

x0jd = 1 d ∈ P (4.8)

∑j:(i,j)∈A

xijd ≤ 1 i ∈ N d ∈ P (4.9)

∑i:(i,j)∈A

xijd ≤ 1 j ∈ N d ∈ P (4.10)

∑i∈S

∑j∈S

xijd ≤ |S| − 1 S ⊆ N |S| ≥ 3 d ∈ P (4.11)

xijd ∈ {0, 1} (i, j) ∈ A d ∈ P (4.12)yik ∈ {0, 1} i ∈ N k ∈ V (i) (4.13)

4.5.1 Explanation of the ModelThe objective function (4.1) minimizes the total distance traveled during thewhole time period. Constraint (4.2) assures that one visit combination is as-signed to each customer. That each customer is visited only on the days corre-sponding to the assigned combination is ensured in constraint (4.3). The lengthof a working day is limited by (4.4), the total distance traveled per day is lim-ited by (4.5) and the number of visited customers per day is limited by (4.6).Constraint (4.7) guarantees that if the salesman enters a customer, then he alsomust leave the customer, while (4.8) ensures that the salesman leaves home everyday. Constraints (4.9) and (4.10) secure that the salesman leaves respectivelyarrives at a particular customer maximally once daily. Constraint (4.11) assuresthat subtours is eliminated, i.e. that the daily routes are coherent. The last twoconstraints (4.12) and (4.13) are binary constraints for the two variables x and y.

4.6 Commentary on the Mathematical ModelAt first, an attempt to use the model by Caglar and Matta [17], presented insubsection 3.4.2, was made, as it seemed easier to implement in AMPL [19] and

Page 36: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

20 4.6. Commentary on the Mathematical Model

solve with CPLEX [20]. But when the execution time for solving this type andsize of problems this way tended to be very long, this approach was abandoned.Also the approach to solve the problem in AMPL at all was forsaken, with re-spect to expected long execution times.

Though the mathematical model is not used to solve the problem in thesis, amodel can be useful to have. For example, the model describes the problemin straight way and the model could be used for a future implementation ine.g. AMPL. Another possible use of it could be to solve the LP1 relaxationand in that way get a lower bound of the optimal value. Unfortunately thelack of memory, due to too many subtour elimination constraints, made thisimpossible.

1Linear Programming

Page 37: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 5

Solution Method

This chapter describes the solution method used to solve the problem describedin the previous chapter. It also includes a small example that gives an overviewof how the method works. A discussion about advantages and disadvantagesconcerning other solution methods is also included.

5.1 The AlgorithmThe heuristic algorithm that is used in this thesis is principally based upon thealgorithms proposed by Paletta [13] and Paletta and Triki [15]. The first arti-cle describes a solution method for the symmetric PTSP with no allowance ofempty tours, while the latter article has a method for the asymmetric PTSP,but empty tours are permitted. This thesis’ algorithm is a mixture of themboth with modifications to fit this problem and the extra constraints regardingtime, distance and the number of customers.

The algorithm that is described in this chapter, including the genetic algorithmthat is used at the end of the algorithm, has been implemented in Matlab.Matlab is a numerical computing environment and programming language thatis widely used in the industry and academia. The program has been run on anIntel R© CoreTM2 Duo T7250 with CPU 2.00 GHz and 2.00 GB RAM.

5.2 Description of the AlgorithmThe program progress is visualized in Figure 5.1 and below follows a shortoverview of the algorithm and the most important procedures are explained.

1. Initial Tour: Picks one customer and forms an initial solution

2. Tour Construction∗: Inserts all customers into the solution

2.1 Extra Improvement Procedure∗∗: Improves current solution

3. Empty Tours∗∗: Eliminates empty tours, if any.

4. Improvement Procedure∗∗: Improves the current feasible solution

21

Page 38: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

22 5.2. Description of the Algorithm

Figure 5.1: An overview of the algorithm progress

5. Tour Improvement: Improves the tour of each day, if possible.

The algorithm begins with Initial Tour, where a random customer is insertedinto the solution on the days of a randomly chosen visit combination. ThenTour Construction continues to insert customers, one by one, on the combi-nation that has the lowest insertion cost. Tour Construction is interruptedoccasionally by Extra Improvement Procedure, to check if the current solutioncan be improved. When all customers are inserted, the program checks if thereare days with empty tours. If any, Empty Tours is applied and customers areassigned to the empty tours in the most cost-effective way. Then Improve-ment Procedure tries to better the current solution even more. After that TourImprovement improves the tours separately, using a genetic algorithm. Theprocedures that are marked with star (*) in the list above use Insertion Ruleand the ones marked with two stars (**) also use Removal Rule.

Before a detailed description of the procedures in the algorithm, some notationsare explained. Let Ht represent the tour currently designed for day t ∈ P .Initially, let Ht = ∅,∀t ∈ P , which means that all days consist of empty tours.The notation (i, j) ∈ Ht (arc (i, j) belongs to tour Ht), means that customeri ∈ N ∪ {0} immediately follows customer j ∈ N ∪ {0} in tour Ht. As denotedearlier, customer 0 represents the salesman’s hometown. At last, the ceilingfunction dpe returns the smallest integer not less than p.

The main part of the algorithm is described in subsection 5.2.1–5.2.6, while theinsertion and removal procedures are described in subsection 5.2.7–5.2.8.

Page 39: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

5.2. Description of the Algorithm 23

5.2.1 Initial TourThe Initial Tour procedure randomly selects a customer and one of that cus-tomer’s visit combinations. Arcs from the salesman’s home to the selectedcustomer are then established for the days in the chosen combination.

• Select a random customer i ∈ N .

• Select a random visit combination k ∈ V (i).

• Let Ht := {(0, i), (i, 0)} for all days t in visit combination k.

5.2.2 Tour ConstructionThe Tour Construction procedure selects a yet unvisited customer and assignsit to the visit combination that minimizes the total insertion cost. Then theselected customer is inserted in the tour that consists of the days of the actualcombination. When all customers are inserted the procedure is terminated.

Define the set Z as the customers that have not been inserted in the solutionyet and the set W as the customers that already is inserted. Consequently,N = Z ∪W .

Repeat

• Select a customer s such that s = arg maxi∈Z{ri ·minj∈W {cij}}.• Compute the total insertion cost ick(s) for each combinationk ∈ V (s), using Insertion Rule.

• Assign to s the combination with the lowest total insertion costic(s) = mink∈V (s){ick(s)}.

• Insert s in the tour Ht for each day t in the assigned combination.• Consider s as a processed customer and update Z and W .Set Z := Z\{s} and W := W ∪ {s}.

• If |W | = α, perform the Extra Improvement Procedure, let l := l + 1and update α.

Until Z is empty

5.2.3 Extra Improvement ProcedureThe Tour Construction procedure is interrupted when |W | = α. The parameterα changes its value each time the Extra Improvement Procedure has been run.The first α is computed like this:

α = d(3/5)× (n+ 1)/me.

Henceforth α is updated with the following formula, where l stands for howmany times the Tour Construction procedure has been interrupted:

α := α+ d(3/4)× (l + 1)× (n+ 1− α)/me.

The procedure works like this:

Page 40: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

24 5.2. Description of the Algorithm

For each j ∈W

• Calculate the total removal cost rc(j) for removing customer j fromits tours, using Removal Rule.

• For each visit combination k ∈ V (j), compute the total insertion costick(j), using Insertion Rule.

• Compute the lowest total insertion cost ic(j) = mink∈V (j){ick(j)}.

• If rc(j) + ic(j) < 0 then

– Remove customer j from its tours and assign it to the combina-tion that corresponds to the lowest total insertion cost ic(j).

– Insert customer j in the tours of the selected combination.

End for j

5.2.4 Empty Tours

If the solution contains days with empty tours after the Tour Construction pro-cedure, this procedure is used to fix this. A customer, which belongs to toursthat contains at least two customers, is selected. The customers are then re-moved from its current tours and then the visit combination that contains themost number of empty tours is chosen. The selected customer is then insertedin the tours that correspond to the newly selected combination. This procedureis repeated until no days contain empty tours.

Define the set N2 as follows: N2 = {i : i ∈ N and i belongs to days which tourscontain at least 2 customers of N}. The definition of N2 secures that no newempty tours can be generated by the algorithm.

Repeat

• For each j ∈ N2

– Evaluate the total removal cost rc(j), using Removal Rule.– Evaluate the lowest insertion cost ic(j) among the combinations

of customer j involving the greatest number of tours, using In-sertion Rule.

• Select the customer v = arg minj∈N2{rc(j) + ic(j)}

– Remove v from its current tours.– Assign to v the combination that corresponds to the lowest total

insertion cost among the combinations of customer v involvingthe greatest number of empty tours.

– Insert v into the tours designed for the days of the new assignedcombination.

Until no tour is empty

Page 41: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

5.2. Description of the Algorithm 25

5.2.5 Improvement ProcedureThen, the Improvement Procedure is performed and its purpose is to improvethe current solution. By successively removing a customer belonging to N2from the tours it belongs to and computing the cost for inserting it into anothercombination of days/tours, the solution will be changed if this change is cheaper.The current customer is then inserted into the tours of the new combination.

For each j ∈ N2

• Calculate the total removal cost rc(j) for removing customer j fromits tours, using Removal Rule.

• For each visit combination k ∈ V (j), compute the total insertion costick(j), using Insertion Rule.

• Compute the lowest total insertion cost ic(j) = mink∈V (j){ick(j)}.• If rc(j) + ic(j) < 0 then

– Remove customer j from its tours and assign it to the combina-tion that corresponds to the lowest total insertion cost ic(j).

– Insert customer j in the tours of the selected combination.

End for j

5.2.6 Tour ImprovementTour Improvement finds a near-optimal solution for every day separately. Be-cause the number of nodes in a tour in this problem rarely is more than ten totwelve, the probability of that an optimal solution to the TSP is generated isrelatively great. This procedure uses a genetic algorithm that is developed byJoseph Kirk [21] and it is slightly modified to fit this problem.

5.2.7 Insertion RuleThe function of this procedure is to compute the cost for inserting a specificcustomer into the solution. It finds the cheapest way to do this, i.e. in betweenwhich customers the actual customer should be inserted. The procedure doesnot perform any changes to the solution, but computes costs that direct whichchanges that are to take place. Let s be the customer that will be inserted inthe tour Ht.

There are two cases:

• If tour t is non-empty (Ht 6= ∅), remove the arc (i, j) ∈ Ht and replace itwith the arcs (i, s) and (s, j), see Figure 5.2. Nodes i and j are found incomputing the lowest insertion cost:

ic(s, t) = min(i,j)∈Ht

{cis + csj − cij}.

• If tour t is empty (Ht = ∅), the arcs (0, s) and (s, 0) are added to theactual tour, see Figure 5.3. The cost for this is:

ic(s, t) = c0s + cs0.

Page 42: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

26 5.2. Description of the Algorithm

Figure 5.2: Insertion Rule: Inserting customer s into a non-empty tour

Figure 5.3: Insertion Rule: Inserting customer s into an empty tour

The total insertion cost ick(s), is the sum of all costs for inserting customer sinto the tours corresponding to the days of the combination k ∈ V (s). Mathe-matically this can be formulated as:

ick(s) =∑t∈k

ic(s, t).

5.2.7.1 Check Feasibility

When computing the insertion cost for an arbitrary customer, it may be thatthe insertion could make the solution infeasible, i.e. the tour does not satisfythe daily restrictions regarding time, distance and number of customers. Suchunallowed insertion is prevented by means of punishing the insertion cost. Thisresults in very high costs for combinations that contain such an unallowabletour, which makes the tendency for choosing that combination very low.

The restrictions for time and distance are the same for all districts, but thisis not the case with the number of customers. Since the number of customersdiffers between the districts, having the same limit would cause some troubles.A too high limit would result in an uneven spread of the visits for districts withfew customer visits. For example, if several tours only have one visit per day,while the rest have ten visits. Therefore, the districts have individual limitsregarding the allowed number of visits.

There are no beforehand given threshold values that constraint the length of aworking day, the distance traveled for a day and the number of visited customersfor a day. Consequently, it is difficult to draw the line at a particular number.

Page 43: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

5.2. Description of the Algorithm 27

Therefore, there is an interval that only punishes the solution moderately andan other interval that results in a huge punishment, see Figure 5.4.

Let M be a huge number, used for great punishment, and let β > 1 regulatehow great a moderate punishment is. For an insertion of customer s into thetour on day t, also let time be the length of day t, dist be the traveled distanceon day t and cust be the number of visited customers on day t. There is oneaxis for time, dist and cust respectively. Let the upper threshold values L, Dand K be defined as in section 4.2. Let the parameters λ, δ and κ define thecorresponding lower threshold values. This is exemplified in Figure 5.4.

Figure 5.4: An axis that illustrates the punishment intervals

Here follows an overview of how the procedure works:

If either time, dist or cust belong to the Infeasible interval, then

ic(s, t) := M · ic(s, t) +M.

Else if either time, dist or cust belong to the Half-feasible interval then

ic(s, t) := β · ic(s, t).

Else the insertion is feasible and there is no punishment.

5.2.8 Removal RuleThe function of this procedure is to compute the cost for removing a customerfrom the current solution. This procedure does not perform any changes to thesolution, but does compute the costs that direct which changes that are to takeplace.

Let rc(r, t) be the cost for removing customer r from tour Ht. The customersi and j are immediately before and after customer r. Therefore, the arcs (i, r)and (r, j), both belonging to Ht, are removed and replaced with the arc (i, j),see Figure 5.5. The cost for this removal is

rc(r, t) = cij − cir − crj .

Page 44: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

28 5.3. Example of Algorithm Progress

Figure 5.5: Removal Rule: Removing customer r

The total removal cost rc(r), is the sum of all costs for removing customer rfrom the tours corresponding to the days of the combination currently assignedto customer r. If k is the combination assigned to customer r, the mathematicalformulation of the total removal cost is:

rc(r) =∑t∈k

rc(r, t).

5.3 Example of Algorithm ProgressIn this section a small example will show how the algorithm works. In thisintial example, the planning period consist of only two days, the number ofcustomers is six and every customer only needs one visit, i.e. m = 2, n =6, ri = 1, V (i) = {{1}, {2}},∀i = 1, . . . , n. In the illustrations that follow, thehometown is represented by a square and the customers by circles.

Initial Tour

A random customer is chosen, in this case customer 2. Then a random visitcombination is chosen, either day 1 or day 2, in this case it was day 1. Thecurrent tours now look like in Figure 5.6.

Tour Construction

Now moving on to Tour Construction and customer 6 is chosen according to theselection rule. It is inserted into the solution on day 2, because this insertion isthe cheapest possible, see Figure 5.7.

In the same way, customer 5 is inserted into the solution, in between the home-town and customer 6, see Figure 5.8.

After all customers have been inserted into the solution, the tours look like inFigure 5.9.

Page 45: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

5.3. Example of Algorithm Progress 29

Figure 5.6: Initial Tour after insertion of customer 2.

Figure 5.7: Tour Construction after insertion of customer 6.

Figure 5.8: Tour Construction after insertion of customer 5.

Page 46: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

30 5.3. Example of Algorithm Progress

Figure 5.9: Tour Construction after insertion of all six customers.

Empty Tours

Let now imagine that the recently described example is extended to a third dayand two more customers, in mathematic notation m = 3, n = 8, ri = 1, V (i) ={{1}, {2}, {3}},∀i = 1, . . . , n. After the first two procedures, the solution lookslike in Figure 5.10. As can be seen, the tour of day 3 is empty and therefore theEmpty Tour procedure is applied.

Figure 5.10: The tours after the extension of one day and two customers.

According to the selection rule, customer 8 is chosen to be moved to day 3.This insertion is the simplest possible, because customer 8 is the only visitedcustomer on day 3. See Figure 5.11.

As can be seen in Figure 5.11, no day contains an empty tour, which meansthat Empty Tour is finished and Tour Improvement begins.

Page 47: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

5.3. Example of Algorithm Progress 31

Figure 5.11: Empty Tour after moving customer 8 to the empty tour on day 3.

Improvement Procedure

The updated example described in Empty Tour now continues with this proce-dure. The tour on day 3 cannot remain empty again, because only customersthat belong to tours that contain two or more customers can be moved. Allcustomers, except for customer 8, are examined for a possible move to anotherday. The only move that shorten the total distance is when customer 7 movesto day 3, see Figure 5.12.

Figure 5.12: Improvement Procedure after moving customer 7 to the tour onday 3.

Tour Improvement

In this small example, Tour Improvement does not improve the tours at all,because the tour of each day is already optimal. It can be seen with the nakedeye that no improvement can be done.

Page 48: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

32 5.4. Alternative Solution Techniques

5.4 Alternative Solution TechniquesThere are several possible methods that can be used for solving this problem.One is to solve the problem exactly with AMPL/CPLEX using the mathemati-cal model directly. The advantage with this is that an optimal solution could begenerated. But a great disadvantage with this approach is that the executiontime may be unreasonable long, especially when the same problem type must besolved several times, one for each district. One other aspect could be that thereare so many variables and constraints that lack of memory could be a problemthat makes this approach impossible.

Another possibility is column generation. Columns/variables could be repre-sented by routes and these routes must satisfy the constraints regarding time,distance and the number of customers. Before the column generation couldbegin, starting columns must be initiated. Because the number of customers islarge and hence the number of combinations of routes could be large, this tendsto be a huge problem as well. Both an LP problem and a subproblem for gen-erating new routes must be solved. In addition to this, an ILP1 problem mustbe solved when the column generation is finished and these problems are oftenNP-hard. This problem could be solved heuristically though, but the complex-ity of using column generation could make the solving time for this approachextremely unpredictable.

1Integer Linear Programming

Page 49: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 6

Results

This chapter deals with the computational results generated by the algorithm,previously described in Chapter 5.

6.1 Runs and ParametersThe algorithm has been run on 20 districts that vary in size. For each districtthe algorithm has been run 30 times, where the first procedure includes a ran-dom factor, making the runs different.

The number of work days in one month is 20 (m = 20) and the length of acustomer visit was presumed to be 45 minutes (τi = 45/60,∀i ∈ N). The aver-age speed was estimated to 70 km/h (v = 70). The upper limits for time anddistance were set to 10 h and 350 km (L = 10 and D = 350), while the lowerlimits were set to 9 h and 300 km (λ = 9 and δ = 300). The limits for thenumber of customers per day, K and κ, depend on the situation of each districtand are not presented here.

6.2 Computational ResultsHere follows some notations for the computational results, used in the Table6.1.

• Code - the code of the district

• Area - the geographical area of the district

• Heur - heuristic solution, i.e. the mileage limit [km]

• Mean - the mean mileage actually traveled [km]

• Visits - total number of visits

• Time - total computational time for all 30 runs [seconds]

33

Page 50: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

34 6.2. Computational Results

Code Area Heur Mean Visits Time1 Norrbotten/Lappland 4065 4089 82 40082 Västerbotten/Örnsköldsvik 3381 3840 77 33233 Jämtland/Västernorrland 3008 3808 86 39274 Gävleborg 2507 1906 61 32836 Värmland 2994 2865 137 121357 Västmanland/Närke 3525 3366 83 11999 Stockholm North 1035 1673 92 5329

12 Östergötland/Södermanland 3460 4173 122 212513 Östergötland 2116 1995 112 831714 Bohuslän 2014 2716 110 728315 Skaraborg 2308 3057 90 484216 Göteborg North 902 1948 96 432017 Göteborg South 757 3283 103 685018 Älvsborg/Halland 2266 1886 97 156019 Jönköping 2999 3430 117 220620 Kronoberg/Kalmar 4155 4868 151 1545721 Kalmar/Blekinge/Öland 2275 2020 70 266123 NW Skåne 1744 2599 136 287624 East Skåne 2700 3714 109 752125 SW Skåne 1508 2532 110 7298

Table 6.1: Mileage limits

Figure 6.1: Mileage limits (green striped) and mileage means (black)

The computational results are presented in Table 6.1 and the mileage limit andthe mean mileage are compared in Figure 6.1.

As expected, the most computed mileages are lower than the real mileages. Itis reasonable that the algorithm generates better routes, because it has morefreedom than the salesmen have. For example, it may not be possible to visit allcustomers within an area in the same day, due to different customer conditions.

Page 51: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

6.3. Customization to Budgeted Sales 35

But for six of the districts, the heuristic gave a higher value than the real ones.A much likely cause could be that the number of customer visits is overesti-mated, and thus the mileage becomes too high. Another possibility could bethat just these salesmen plan their trips better than these that the algorithmgenerates.

6.2.1 An Illustration of the ToursThis subsection presents the results that the algorithm generated for district 15,which represents the area of Skaraborg. Table 6.2 shows the number of customervisit, the distance and the time for the tours for each day. Figure 6.2 visualizesthe different tours graphically; the tours are separated by different colors andthe number next to each tour represents which day the tour belongs to. Moreexamples of how the routes, that the algorithm generated, look graphically, aregiven in Appendix A.

Day Customers Distance [km] Time [hh:mm]1 5 134 5:392 3 158 4:303 5 171 6:114 5 73 4:475 6 237 7:526 5 36 4:157 5 113 5:218 3 41 2:499 4 98 4:24

10 3 79 3:2211 6 207 7:2712 5 102 5:1213 3 153 4:2614 5 132 5:3815 6 109 6:0316 6 120 6:1217 4 41 3:3418 4 145 5:0419 3 38 2:4720 4 122 4:44

Table 6.2: Results for the tours on district 15, Skaraborg

6.3 Customization to Budgeted SalesThe mileage limits presented above are computed with respect to the sales thatactually have taken place, i.e. to the orders that lead to visits. These limits arenow justified to how they could have been, if the budgeted sales were reachedexactly. The mileage is related to the ratio between the budgeted sales andthe real sales and the result is presented in Table 6.3. The budgeted mileage iscomputed like this:

Page 52: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

36 6.3. Customization to Budgeted Sales

budgeted mileage = budget salesreal sales︸ ︷︷ ︸

ρ

×mileage limit.

Code Ratio, ρ Mileage [km] Budgetedcomputed real mileage [km]

1 0.97 4065 4089 39452 1.07 3381 3840 36013 0.44 3008 3808 13334 0.89 2507 1906 22246 0.93 2994 2865 27827 1.02 3525 3366 35789 1.03 1035 1673 1067

12 0.96 3460 4173 331013 0.99 2116 1995 208814 1.09 2014 2716 218715 0.98 2308 3057 225616 0.96 902 1948 86317 1.26 757 3283 95418 1.15 2266 1886 261419 0.92 2999 3430 274920 1.00 4155 4868 416621 1.12 2275 2020 255123 0.96 1744 2599 166924 1.04 2700 3714 281025 0.90 1508 2532 1359

Table 6.3: Budgeted mileage limits

Page 53: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

6.3. Customization to Budgeted Sales 37

(a) The tours on day 1–10

(b) The tours on day 11–20

Figure 6.2: The tours of district 15, Skaraborg

Page 54: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

38 6.3. Customization to Budgeted Sales

Page 55: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 7

Analysis

In this chapter the results of the algorithm are analyzed as well as the algorithmitself.

7.1 Computation of a Lower BoundaryTo find out the quality of a generated solution, efforts have been made to geta lower boundary. Unfortunately, the lack of time and memory has made itimpossible to get a valid lower boundary. An LP relaxation of the problem,using the formerly described mathematical formulation, is too hard to solvewith CPLEX within a reasonable time. When attempts were done to also relaxthe subtour elimination constraints, the objective value became too poor to useas a lower boundary.

7.2 Analysis of Computational ResultsAs seen in Table 6.1, the computed mileages for the districts 9, 16, 17, 25 aremuch lower than the real ones. A possible cause for this may be that the trafficsituation is different comparing to the other districts because these districts arelocated in Sweden’s three biggest cities, i.e. Stockholm, Göteborg and Malmö.There may be more traffic congestions and the availability therefore becomesmore difficult; the average speed may therefore be lower than the estimatedone is. Another possible cause could be the salesmen’s lack of selling skills, i.e.much time driving car but low sales.

Looking at Table 6.2, the number of customer visits per day is between 3 and6, which is reasonable considering the average on 4.5 visits per day for thatdistrict. Both the distance and the time for every tour are within the allowedlimits and they also seem reasonable.

As seen in Figure 6.2 and in the figures in Appendix A, the algorithm producesgood solutions, with tours that are realistic. Tours that visit customers that arefar away from the hometown, also includes customers that are along the way orin the same area. There are no occurrences of tours that seem strange or bad.That the solution may not be optimal does not matter so much because if the

39

Page 56: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

40 7.3. Analysis of the Algorithm

difference not is huge, a heuristic solution is acceptable. Of course an optimalvalue is always preferred, but in this case a good near-optimal solution that canact as a mileage limit is good enough.

7.3 Analysis of the Algorithm7.3.1 Algorithm FluctuationA weakness with the algorithm is that once it reaches a local optimum, it staysthere. A local optimum can be a good one but also a very bad one. This isthe reason for running the algorithm several times. The randomness in the al-gorithm is in the first procedure, Initial Tour, where a customer and one of itsvisit combinations are randomly chosen. The rest of the algorithm contains norandomness. In the test phase, it was obvious that the algorithm could giveresults that fluctuated much, and this is illustrated in Figure 7.1 that presentsthe results of all runs for district 2. Therefore it was not enough with just afew runs but 30 runs where chosen, where the best result among them was taken.

Figure 7.1: The result of all 30 runs for district 2

7.3.2 Running TimesThe running time for just one run is between a half and nine minutes, dependingon which district it is. The algorithm was implemented in Matlab and contains

Page 57: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

7.3. Analysis of the Algorithm 41

several nested loops, which may slow down the running time. An implementa-tion of the most demanding computations in some other program language, e.g.C++, could speed-up the running time.

7.3.3 Essential ProceduresThe procedures that are the most essential are Tour Construction and Improve-ment Procedure. Tour Construction builds up the solution successive and TourImprovement better the solution, in moving customers to other days. In betweenthese procedures, Empty Tours are used to eliminate possible empty tours. Itis important because it is first after Empty Tours that it is for sure that thesolution is feasible.

Page 58: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

42 7.3. Analysis of the Algorithm

Page 59: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 8

Demarcation of NewDistrict Boundaries

In this chapter a proposal about how to change the district boundaries is pre-sented, in order to reduce the costs and the environmental effects.

8.1 Reason for Proposal of New BoundariesWith the passing of years, salesmen begin and quit, new customers are gainedwhile others are lost. When a salesman quits and not immediately replaced,some neighboring salesmen may take over some of the former salesman’s cus-tomers. A salesman can gain customers that is closer another salesman, butdoes not want lose them because then he also loses commission. Over the years,districts may reduce and increase in size, which can lead to unwanted effects inthe extension. That a district increases very much in size can lead to increasingcosts as a result of fuel consumption and with that increasing carbon dioxidepollution.

8.2 The ProposalThere was no district boundaries given, but they had to be found out whenlooking at the location of the customers. In that way the boundaries could beclarified. This proposal is based only on changes that can be seen intuitively.The proposal is presented in Figure 8.1; red filled circles denote the hometownof that district, green lines denote the newly proposed boundaries and dottedlines the removed boundaries. More detailed maps are available in AppendixB. The district boundaries have changed at seven places, as can be seen in thefigure; these changes are commented from north to south below:

• District 3 is expanded slightly to the south, at the expense of district 4.

• District 7 loses its eastern part, including Karlskoga, to district 6.

• District 7 is extended to the southeast, taking Eskilstuna and Strängnäsfrom districts 11 and 12.

43

Page 60: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

44 8.2. The Proposal

• District 13 expands in an area to the southeast, including Västervik. Dis-trict 19 and 20 are hence reduced in size.

• District 20 loses its northern part to district 19.

• District 21 is expanded, taking the eastern part of district 20.

• District 20 expands to the south, at the expense of districts 21 and 24.

Page 61: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

8.2. The Proposal 45

Figure 8.1: Map of the proposed district boundaries

Page 62: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

46 8.2. The Proposal

Page 63: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Chapter 9

Conclusions and FurtherResearch

This chapter concludes the thesis and suggestions for future research are pre-sented.

9.1 ConclusionsThis thesis focuses on computing reasonable mileage limits for traveling sales-men, in computing realistic routes for a period of 20 days. It includes a mathe-matical formulation and a heuristic solution method, which has been modifiedand implemented. The algorithm includes a constructive heuristic, a local searchalgorithm and at the end a genetic algorithm.

The algorithm produced good solutions that work as approximate limits for thesalesmen’s mileages. The generated tours are plausible in sense of length andcustomer visits. There are also some demarcations of the district boundariesthat could be made to decrease the costs and the environmental effects.

One thing that has taken plenty of time is the data handling for the problem.To get the order data in a manageable form, data have first been copied fromPDF documents to spreadsheets in Microsoft Office Excel. The data have thenbeen compiled with help of several procedures coded in Visual Basic for Appli-cations (VBA). VBA is an event driven programming language and associatedintegrated development environment that is built into Excel. Totally, nearlytwo thousand geographical coordinates have been assembled, and these coordi-nates are taken from Eniro’s web page [22]. Every salesman and every customercorresponds to one coordinate.

The data handling had been eased very much if the data were stored in a moreaccessible file format, such as an Excel spreadsheet. Another thing that couldhave helped is if the data material had been more extensive, e.g. statistics onactual customer visit had been kept. The same data handling was done with alltwenty districts, which contributed much to the amount of work.

47

Page 64: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

48 9.2. Further Research

9.2 Further ResearchSeveral improvements could be done to get a better output from this solutionmethod. One essential thing is to get better and more reliable input data, e.g.in form of more accurate visit information.

To reduce the size of the problem, customers that are similar, in ways of visitingfrequency and location, could be aggregated. This could speed up the compu-tation time as well as it is increases the possibility to get a lower boundary ifsolving the LP relaxation. But an aggregation could also worsen the accuracy,which makes this approach questionable.

Another thing is to improve the algorithm itself. There is one method byBertazzi et al. [14], which is an extension and an improvement of the onedescribed by Paletta [13], which is used in this thesis. Neither of the heuristicmethods, but [8], studied in this thesis have any additional constraints, e.g.regarding time or distance; the punishing method chosen may not be the bestone.

Page 65: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Appendix A

More Illustrations of Tours

This appendix contains more examples of tours that the algorithm has generated,than the tours presented in subsection 6.2.1.

The tours that the algorithm generated for district 7, 14 and 24 are presentedgraphically in Figures A.1, A.2 and A.3, where the tours are separated by dif-ferent colors.

49

Page 66: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

50 APPENDIX A. MORE ILLUSTRATIONS OF TOURS

(a) The tours on day 1–10

(b) The tours on day 11–20

Figure A.1: The tours of district 7, Västmanland/Närke

Page 67: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

APPENDIX A. MORE ILLUSTRATIONS OF TOURS 51

(a) The tours on day 1–10

(b) The tours on day 11–20

Figure A.2: The tours of district 14, Bohuslän

Page 68: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

52 APPENDIX A. MORE ILLUSTRATIONS OF TOURS

(a) The tours on day 1–10

(b) The tours on day 11–20

Figure A.3: The tours of district 24, East Skåne

Page 69: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Appendix B

Detailed Maps

This appendix contains more detailed maps of the proposal of new district bound-aries, than the map in Figure 8.1.

The maps in Figures B.1, B.2, B.3 and B.4 contain the locations of the customersand customers from different salesmen are distinguished by different colors. Asquare represents the hometown of that district’s salesman and a town with onlycustomers is represented by a circle. There are four sizes of the circles/squares;the bigger size the more customers are in that town.

Sometimes different salesmen have customers in the same town or area, whichmakes the districts overlap each other in many areas. In those areas there maynot exist an explicit boundary in reality. This is the case with district 16 and17, which both is in the area surrounding Göteborg and to the west. The sameholds for district 9 and 10, but right now the latter is empty. The districts 11and 12 do overlap each other as well, but district 12 belongs to the productmanager and his role is freer compared to a common salesman.

53

Page 70: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

54 APPENDIX B. DETAILED MAPS

Figure B.1: Map of the districts in southern Sweden

Page 71: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

APPENDIX B. DETAILED MAPS 55

Figure B.2: Map of the districts in southern-central Sweden

Page 72: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

56 APPENDIX B. DETAILED MAPS

Figure B.3: Map of the districts in northern-central Sweden

Page 73: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

APPENDIX B. DETAILED MAPS 57

Figure B.4: Map of the districts in northern Sweden

Page 74: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

58 APPENDIX B. DETAILED MAPS

Page 75: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

Bibliography

[1] ISO, International Organization for Standardization. http://www.iso.org, April 2008.

[2] SIS, Swedish Standards Institute. http://www.sis.se, April 2008.

[3] Erik Bjelmrot. Lokaliseringsfaktorer för resecentra - en gis-analys av solnastation. Master’s thesis, Luleå tekniska universitet, 2006.

[4] I-Ming Chao, Bruce L. Golden, and Edward A. Wasil. A new heuristic forthe period traveling salesman problem. Computers & Operations Research,22(5):553–565, 1995.

[5] Jan Lundgren, Mikael Rönnqvist, and Peter Värbrand. Optimeringslära.Studentlitteratur, 2nd edition, 2003.

[6] David Beasley, David R. Bull, and Ralph R. Martin. An overview of geneticalgorithms: Part 1, Fundamentals. University Computing, 15(2):58–69,1993.

[7] S. Dizdarevic, I. Inza, C.M.H. Kuijpers, P. Larrañaga, and R.H. Murga.Genetic Algorithms for the Travelling Salesman Problem: A Review ofRepresentations and Operators. Artificial Intelligence Review, 13:129–170,1999.

[8] Jean-François Cordeau, Michel Gendreau, and Gilbert Laporte. A tabusearch heuristic for periodic and multi-depot vehicle routing problems. Net-works, 30:105–119, 1997.

[9] E.L. Lawler, J.K. Lenstra, H.G. Rinnooy Kan, and D.B. Shmoys. Thetraveling salesman problem: a guided tour of combinatorial optimization.Wiley, New York, 1985.

[10] Lawrence Bodin, Bruce Golden, Arjang Assad, and Michael Ball. Routingand scheduling of vehicles and crews. The state of the art. Computers &Operations Research, 10(2):63–211, 1983.

[11] N. Christofides and J.E. Beasley. The period routing problem. Networks,14:237–256, 1984.

[12] Giuseppe Paletta. A multiperiod traveling salesman problem: heuristicalgorithm. Computers & Operations Research, 19(8):789–795, 1992.

59

Page 76: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

60 BIBLIOGRAPHY

[13] Giuseppe Paletta. The period traveling salesman problem: a new heuristicalgorithm. Computers & Operations Research, 29(10):1343–1352, 2002.

[14] Luca Bertazzi, Giuseppe Paletta, and M. Grazia Speranza. An improvedheuristic for the traveling salesman problem. Computers & OperationsResearch, 31:1215–1222, 2004.

[15] Giuseppe Paletta and Chefi Triki. Solving the asymmetric traveling sales-man problem with periodic constraints. Networks, 44(1):31–37, 2004.

[16] François-Xavier Le Louarn, Michel Gendreau, and Jean-Yves Potvin. GENIants for the traveling salesman problem. Annals of Operations Research,131:187–201, 2004.

[17] Toros Caglar and Marie Matta. Modeling the period traveling salesmanproblem with visit frequency constraints and a geriatric homecare applica-tion. Working paper at the George Washington University, 2006.

[18] Tatiana Bassetto and Francesco Mason. The 2-period balanced travelingsalesman problem. Working Papers 154, Department of Applied Mathe-matics, University of Venice, 2007.

[19] Robert Fourer, David M. Gay, and Brian W. Kernighan. A ModelingLanguage for Mathematical Programming. Management Science, 36:519–554, 1990.

[20] ILOG CPLEX: High-performance sofware for mathematical programmingand optimization. http://www.ilog.com/products/cplex/index.cfm,April 2008.

[21] Joseph Kirk. Traveling Salesman Problem - Genetic Algorithm. http://www.mathworks.com/matlabcentral/files/13680/tsp_ga.m, May 2007.Matlab program, Release 1.2; [email protected].

[22] Eniro. http://www.eniro.se, April 2008.

Page 77: Examensarbete - DiVA portal200/FULLTEXT...ies, MS-polymers, silicone sealants and gasketing materials. They also supply aerosol products and epoxy based engineering materials. Scantech’s

LINKÖPING UNIVERSITYELECTRONIC PRESS

Copyright

The publishers will keep this document online on the Internet - or its possiblereplacement - for a period of 25 years from the date of publication barring ex-ceptional circumstances. The online availability of the document implies a per-manent permission for anyone to read, to download, to print out single copiesfor your own use and to use it unchanged for any non-commercial research andeducational purpose. Subsequent transfers of copyright cannot revoke this per-mission. All other uses of the document are conditional on the consent of thecopyright owner. The publisher has taken technical and administrative mea-sures to assure authenticity, security and accessibility. According to intellectualproperty law the author has the right to be mentioned when his/her work isaccessed as described above and to be protected against infringement. For ad-ditional information about the Linköping University Electronic Press and itsprocedures for publication and for assurance of document integrity, please referto its WWW home page: http://www.ep.liu.se/

Upphovsrätt

Detta dokument hålls tillgängligt på Internet - eller dess framtida ersättare -under 25 år från publiceringsdatum under förutsättning att inga extraordinäraomständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var ochen att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att användadet oförändrat för ickekommersiell forskning och för undervisning. Överföringav upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. Allannan användning av dokumentet kräver upphovsmannens medgivande. Föratt garantera äktheten, säkerheten och tillgängligheten finns det lösningar avteknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt attbli nämnd som upphovsman i den omfattning som god sed kräver vid användningav dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändraseller presenteras i sådan form eller i sådant sammanhang som är kränkandeför upphovsmannens litterära eller konstnärliga anseende eller egenart. Förytterligare information om Linköping University Electronic Press se förlagetshemsida http://www.ep.liu.se/

c© 2008, Johan Torstensson

61