• No results found

A Cycle-Trade Heuristic for the Weighted k-Chinese Postman Problem

N/A
N/A
Protected

Academic year: 2021

Share "A Cycle-Trade Heuristic for the Weighted k-Chinese Postman Problem"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

Linköpings universitet SE–581 83 Linköping

Linköping University | Department of Computer Science

Bachelor thesis, 16 ECTS | Computer Science

2018 | LIU-IDA/LITH-EX-G--18/073--SE

A Cycle-Trade Heuristic for

the Weighted k-Chinese

Postman Problem

Anton Hölscher

Supervisor : Kaj Holmberg Examiner : Fredrik Heintz

(2)

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ära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns lösningar av teknisk och admin-istrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sam-manhang som är kränkande för upphovsmannenslitterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/.

Copyright

The publishers will keep this document online on the Internet – or its possible replacement – for a period of 25 years starting from the date of publication barring exceptional circum-stances. The online availability of the document implies permanent permission for anyone to read, to download, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional upon the con-sent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping Uni-versity Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its www home page: http://www.ep.liu.se/.

c

(3)

Abstract

This study aims to answer whether a heuristic that trades cycles between the tours in a solution would show good results when trying to solve the Weighted k-Chinese Postman Problem for undirected graphs, of varying size, representing neighbourhoods in Sweden. A tabu search heuristic was implemented with each iteration consisting of giving a cycle from the most expensive tour to the cheapest. The heuristic performed increasingly well for graphs of increasing size, although the solution quality decreased when increasing the number of tours to be used in the solution. It is suspected that the cause for this behavior is due to the heuristic only giving cycles from the most expensive tour, not considering trading cycles from other tours in the solution. It is believed that a heuristic considering more than only the most expensive tour when trading cycles would produce even better solutions.

(4)

Contents

Abstract iii Contents iv List of Figures 1 1 Introduction 2 1.1 Motivation . . . 2 1.2 Aim . . . 2 1.3 Research Questions . . . 3 1.4 Delimitations . . . 3 2 Theory 4 2.1 The Chinese Postman Problem . . . 4

2.2 The Rural Postman Problem . . . 5

2.3 The k-Chinese Postman Problem . . . 5

2.4 The Min Max k-Chinese Postman Problem . . . 6

2.5 The Weighted k-Chinese Postman Problem . . . 6

2.6 Dynamic Programming . . . 7

2.7 Lower Bounds . . . 7

2.7.1 Lower Bounds for W k-CPP . . . 7

2.7.2 Lower Bounds for MM k-CPP . . . 7

2.7.3 Lower Bounds for k-CPP . . . 8

2.8 Metaheuristics . . . 8 2.8.1 Tabu Search . . . 8 3 Method 10 3.1 Pre-Study . . . 10 3.2 Implementation . . . 10 3.3 Evaluation . . . 11 4 Results 12 4.1 Implementation . . . 12

4.1.1 The Data Structures . . . 12

4.1.2 The Cycle Trade Heuristic . . . 12

4.2 Evaluation . . . 13 4.2.1 Åtvidaberg . . . 14 4.2.2 Colonia . . . 15 4.2.3 Skänninge . . . 16 4.2.4 Studentryd . . . 17 4.2.5 Vadstena . . . 18

(5)

5.1 Results . . . 19 5.2 Method . . . 20 5.3 The Work in a Wider Context . . . 20

6 Conclusion 21

6.1 Answer to Research Questions . . . 21 6.2 Further Research . . . 21

(6)

List of Figures

4.1 Åtvidaberg – 68 nodes, 95 edges . . . 14

4.2 Colonia – 24 nodes, 36 edges . . . 15

4.3 Skänninge – 62 nodes, 80 edges . . . 16

4.4 Studentryd – 387 nodes, 519 edges . . . 17

(7)

1

Introduction

This chapter introduces the problem and gives a motivation as to why research in this area is important. The motivation is followed by the aim of this thesis and the specification of the research questions to be examined in this study. The problem is then narrowed down into a specific type in order to keep the study of a feasible size.

1.1

Motivation

To find the most efficient way of traversing an entire graph is a widely spread problem in today’s society. For a snow truck to plow all snow on every street in a town in the minimal consumed time is only one of a vast amount of applications of this problem. This particular problem, to find the least expensive path in a graph such that all edges in a given graph has been traversed, is called the Chinese Postman Problem (CPP), which can often be solved in polynomial time. However, rarely is it the case that a single mailman delivers all of the mail in an entire city. And if we want to find the optimal tour for each mailman such that all mail is delivered, we have found a much more complicated problem than the CPP.

When multiple vehicles can be utilized and the goal is to minimize both the combined cost for all vehicle’s routes and minimize the cost of the most expensive route, e.g. minimizing both the total environmental inpact and the total time taken, we have encountered a problem defined by Holmberg as the Weighted k-Chinese Postman Problem (W k-CPP)[8]. Along with the definition of the problem, Holmberg constructed an algorithm for generating solutions to this type of problems, albeit not optimal solutions. Finding a method that could further improve these solutions would lead to both a financial and an environmental improvement to companies and cities all over the world.

1.2

Aim

According to Holmberg, solutions generated by using his heuristic could be improved sig-nificantly by manually altering the solution [8]. So a heuristic for the W k-CPP that mimics some of the methods used to manually improve a solution might perform well. This study aims to answer if a heuristic consisting of trading cycles between the tours would show good results on graphs resembling real life cities.

(8)

1.3. Research Questions

1.3

Research Questions

It is imporant that the heuristic that is to be implemented, can generate solutions that are good enough in a reasonable amount of time. Therefore, this study aims to answer the following research questions:

Can a heuristic, consisting of trading cycles between all tours in the graph, be imple-mented, such that:

Q.1 The solution found by the heuristic is close to the optimum? Q.2 The solution can be computed in a reasonable amount of time?

1.4

Delimitations

This thesis will only concern undirected connected graphs containing edges with postitive costs. The number of vehicles will alter between the range of 2–10.

This study will only consider graphs resembling the streets of a city. This means that the graphs will be sparse, i.e. each node is connected to relatively few edges.

The starting solution will always be the CPP-solution to the problem for one of the vehi-cles along with nothing for the rest of the K 1 vehicles.

(9)

2

Theory

In this chapter, all terms and concepts relevant to this study are explained. The first sections describe the problem which the heuristic will try to solve, starting at the founding problem (the CPP), then building upon it until the W k-CPP is obtained. This is followed by explan-ing the concepts used to implement the heuristic. Since all CPP problems only applies to connected graphs, for the rest of this report, any mention of a graph refers to a connected graph.

2.1

The Chinese Postman Problem

The Chinese Postman Problem (CPP) is defined by Edmond and Johnson as finding the shortest tour in a graph such that each edge in the graph has been traversed at least once [6]. The problem was first discovered by Kwan Mei-Ko who described it, according to Grötschel and Yuan, as walking the shortest possible distance when delivering mail through all the streets in the neighborhood, starting and ending in the post office [7].

In a graph G, consisting of a set of vertices V = tv1, v2, . . . , vnu, a set of edges E „ V2

and a function c : E Ñ R determining the cost of an edge, we want to find a mapping function f : E :Ñ N0that indicates the flow in each edge, such that the total cost of that flow

is minimized and the flow form an Euler tour. Given these definitions the problem can be modelled as in formula 2.1. minimize z=¸ ePE (f(e) c(e)) subject to f(e)¥ 1 @e P E, ( ¸ w:(w,v)PE f((w, v)) ) + ( ¸ w:(v,w)PE f((v, w)) )  0(mod 2) @v P V (2.1)

This problem is N P-Complete meaning that it takes non-polynomial time to generate a CPP solution, but verifying the correctness of the solution can be performed in polyno-mial time. However, with proper constraints the CPP can be both solvable and verifiable in polynomial time. If it is required that the graph is undirected, a chinese postman tour can be retrieved by adding the cheapest set of edges required to make the graph Eulerian, i.e. adding

(10)

2.2. The Rural Postman Problem

edges until all vertices in the graph has an even degree, followed by finding a Euler cycle in that graph [7].

Since we have restricted this study to only consider undirected graphs, the CPP will be considered as a polynomial problem for the rest of this report.

2.2

The Rural Postman Problem

The Rural Postman Problem (RPP) is closely related to the CPP. According to the definition by Orloff, the only alteration to the problem is that only some of the edges in the graph are required to be traversed [11].

This problem can be viewed upon as a mailman delivering mail in some villages, where each road in each village has to be served, but the mailman has no required route to travel between the villages.

In order to formalize this problem another set ER€ E is included, containing all edges in

E that requires traversal. A requirement is added that the tour starts and ends in the starting vertex vs P V, since it might be the case that no edges connected to vs exists in ER. The

problem can then be defined as in formula 2.2. minimize z= ¸ ePE (f(e) c(e)) subject to f(e)¥ 1 @e P ER, ( ¸ w:(w,v)PE f((w, v)) ) + ( ¸ w:(v,w)PE f((v, w)) )  0(mod 2) @v P V,

te P E : f(e)¥ 1u composes a connected graph,

f((vs, w))¥ 1 Dw P V

(2.2)

The RPP has been proved by Orloff to beN P-Hard, meaning that finding a solution to the RPP requires non-polynomial time, and verifying that solution also requires non-polynomial time, givenPN P[11].

2.3

The k-Chinese Postman Problem

The k-Chinese Postman Problem (k-CPP) is related to both the RPP and the CPP. The problem is described by Osterhues and Mariak as finding k tours such that each edge of the graph has been traversed by at least one vehicle and the combined cost of all tours is minimal [12].

This problem can be viewed upon as having multiple mailmen delivering mail to all streets in a city. It is sufficient that only one mailman visits a street but all streets has to be handled by at least one mailman, and the combined distance traveled should be minimal. To formalize the k-CPP, instead of finding f , we need to find a set T = tt1, t2, . . . , tku of

size k, where each element t P T is a function t : E Ñ N0denoting how many times each

(11)

2.4. The Min Max k-Chinese Postman Problem

by at least one of the tours and each tour starts and stops in the starting point of the graph vsP V. Using this set, T, the k-CPP can be formalized as in 2.3.

minimize z=¸ tPT ¸ ePE (c(e) t(e) ) subject to ¸ tPT t(e)¥ 1 @e P E, ( ¸ w:(w,v)PE t((w, v)) ) + ( ¸ w:(v,w)PE t((v, w)) )  0(mod 2) @v P V @t P T,

te P E : t(e)¥ 1u composes a connected graph @t P T,

t((vs, w))¥ 1 Dw P V @t P T

(2.3)

Finding one of the tours of a solution for the k-CPP is identical to finding a solution to the RPP. This implies that the k-CPP cannot be easier than the RPP and is therefore

N P-Hard [12].

2.4

The Min Max k-Chinese Postman Problem

The Min Max k-Chinese Postman Problem (MM k-CPP) formulates the problem of minimizing the most expensive tour rather than the total sum of all tours [2, 12].

This problem could be viewed upon as minimizing the total time taken for the last mail-man to return to the post office.

The formalization of this problem is a lot similar to formula 2.3 except that the objective function minimizes the maximum rather than the sum. It can be formalized as in 2.4.

minimize z=max tPT ( ¸ ePE c(e) t(e)) subject to ¸ tPT t(e)¥ 1 @e P E, ( ¸ w:(w,v)PE t((w, v)) ) + ( ¸ w:(v,w)PE t((v, w)) )  0(mod 2) @v P V @t P T,

te P E : t(e)¥ 1u composes a connected graph @t P T,

t((vs, w))¥ 1 Dw P V @t P T

(2.4)

Using the same reasoning as for the k-CPP, the MM k-CPP is alsoN P-Hard[11].

2.5

The Weighted k-Chinese Postman Problem

The Weighted k-Chinese Postman Problem (W k-CPP) is defined by Holmberg as the weighted sum of the k-CPP and the MM k-CPP [8].

This problem can be viewed upon as delivering all mail in a city, using multiple mailmen, and taking into consideration both the total completion time and the combined environmen-tal impact of the entire team.

(12)

2.6. Dynamic Programming

To formalize this problem a constant is required λ P [0, 1] representing to what degree each of the sums affect the objective function value. The problem can be formalized as in formula 2.5. minimize z=λ( max tPT ( ¸ ePE c(e) t(e)) ) + (1 λ)( ¸ tPT ¸ ePE c(e) t(e) ) subject to ¸ tPT t(e)¥ 1 @e P E, ( ¸ w:(w,v)PE t((w, v)) ) + ( ¸ w:(v,w)PE t((v, w)) )  0(mod 2) @v P V @t P T,

te P E : t(e)¥ 1u composes a connected graph @t P T,

t((vs, w))¥ 1 Dw P V @t P T

(2.5)

Inspecting formula 2.5 reveals that setting λ = 1 would turn the W k-CPP into the MM k-CPP. Setting λ = 0 would turn it into the k-CPP. This means that the W k-CPP must be

N P-Hard.

2.6

Dynamic Programming

According to Bellman, Dynamic Programming is a method for solving complex problems by dividing the problem into sub-problems, solving the sub-problems individually, storing these problems in memory and then using the stored solutions to solve the complex problem [3]. Each problem solved by a dynamic programming algorithm is stored in memory for usage in later problems. This means that dynamic programming is only advised to use when a problem domain contains overlapping sub-problems.

Dynamic programming is not to be confused with the Divide and Conquer method since the Divide and Conquer method does not store any previous solutions in memory.

2.7

Lower Bounds

A lower bound to a problem is a value which is guaranteed to always be lower or equal to the value of the global optimum. Lower bounds are often used in order to evaluate the performance of a heuristic since it is not possible to calculate the actual optimal value of an

N P-Hard problem in reasonable time.

2.7.1

Lower Bounds for W k-CPP

According to Holmberg, the lower bound for the W k-CPP can be calculated using for-mula 2.6 [8].

LBWkCPP =λ(LBMMkCPP) + (1 λ)(LBkCPP) (2.6)

2.7.2

Lower Bounds for MM k-CPP

The lower bounds for the MM k-CPP can be calculated as described by Holmberg and by Ahr and Reinelt [2, 8]. It is calculated as in formula 2.7.

LBMMkCPP=

cost(CPP)

(13)

2.8. Metaheuristics

2.7.3

Lower Bounds for k-CPP

The cost of the CPP solution can serve as a lower bound to the k-CPP. This is proven using a proof of contradiction.

1. Suppose that cis the optimal solution to the CPP.

2. Suppose that there exists a solution T° = tt1, t2, . . . , tku to the k-CPP such that tPT

cost(t)  cost(c).

3. Then there exists another tour c2=t1t2. . . tn.

4. The cost of c2=

°

tPT

cost(t) ùñ cost(c2)  cost(c) ùñ K

2.8

Metaheuristics

According to C. Blum and A. Roli, several attempts of defining metaheuristics has been made [5]. They describe metaheuristics in short as high level strategies for exploring search spaces using different methods. Rather than finding all the neighbours of a given solution, the metaheuristics consists of algorithms for choosing which neighbouring solution to be used in the next iteration. They often depend on other heuristics to find all the neighbouring solutions in the current search-space. They are, in a sense, heuristics of a higher abstraction level.

2.8.1

Tabu Search

Tabu Search is essentially an improved version of the Hill Climbing local search algorithm. The Hill Climbing algorithm works as follows:

1. Find all neighbors of the current solution. 2. Choose the best solution of all those neighbors.

3. If the objective function value of the best neighbor is worse than the current solution, return the current solution as the final answer. Otherwise, replace the current solution with the best neighbor and return to step 1.

This algorithm performs quite poorly in practice since it will most often get stuck in a local optimum. According to Bianchi, Dorgio, Gambardella and Gutjahr, local optima are often much worse than the global optimum in combinatorial problems [4]. Getting stuck in local optima is avoided in the Tabu Search heuristic by utilizing the following concepts: best improvement, tabu lists and aspiration criteria. The best improvement concept means that the best neighbor always will be chosen, regardless if the current solution is better. This means that Tabu Search will never get stuck in a local optimum. While this solves local optimum problem, it produces another problem: If the best neighbor always replaces the current solu-tion, we will enter a cycle as soon as we find a local optimum since we will alternate between the local optimum and the best neighbor to that local optimum. That problem is solved by remembering the chosen solutions and forbidding them in the next iteration. They are re-membered by getting stored in tabu lists. Most often, the transition is stored in the tabu list rather than the actual solution in order to consume less memory.

The heuristic still lacks one final component. Currently, the tabu search contains no stop-ping criteria. This is why we need the aspiration criteria. These criteria contains conditions as to when the tabu search has finished its search and can consist of conditions regarding both the objective function value as well as the transition options. The algorithm in Algorithm 2.1

(14)

2.8. Metaheuristics

is an implementation of the Tabu Search Heuristic where f is a function calculating the ob-jective function value of a solution, x is the initial solution, and δ is a function calculating the transition between two solutions.

Algorithm 2.1: Tabu Search Implementation 1 f u n c t i o n tabu(f , x, δ) 2 TÐ[ ] 3 while criteria_not_passed(x): 4 NÐ generate_neighborhood(x) 5 bÐ min nPtePN : δ(e,x)RTuf(n) 6 T.push(δ(x, b)) 7 xÐ b 8 r e t u r n x

(15)

3

Method

The study started with a planning phase where the decision was made to split the study into three phases: a Pre-Study Phase, an Implementation Phase and an Evaluation Phase. After the planning phase, some prior research was made in order to gain a brief understanding of the problem at hand, the terminology, and the basic concepts required to perform this study. The majority of this information was found in the book Optimering: metoder, modeller och teori för linjära, olinjära och kombinatoriska problem by Holmberg [10].

3.1

Pre-Study

After the initial knowledge was aquired, several articles regarding the CPP and some of its variations were read. It was noted how other authors constructed the lower bounds and how they chose to evaluate their heuristics. The graphs used to evaluate the W k-CPP heuristic in the study by Holmberg, representing different neigborhoods in Sweden, were gathered to be used in this study (see Figure 4.1 - Figure 4.5). Studies regaring meta heuristics were read in order to make an informed decision as to which meta heuristic to be used along with the heuristic to be implemented.

3.2

Implementation

Before any heuristic could be implemented, data structures for both the graphs and the tours were required.

Once the data structures were created, the Cycle Trade heuristic was implemented. The idea behind the heuristic was that by swapping cycles between the most expensive and the cheapest tour in the solution, the cost of all tours would eventually "even out". If the trades between the tours could be done in the cheapest possible manner it would also have a mini-mal impact on the combined cost. This would, in theory, result in a low W k-CPP cost.

After the swapping algorithm was implemented, the tabu search was constructed to choose the most promising cycle swap. In order to decrease the execution-time of each it-eration by the heuristic, instead of creating one solution for each cycle trade, a candidate data structure was implemented, only containing the gain of the trade and which cycle that was to be traded between which two tours. This immensively improved the execution time of an iteration.

(16)

3.3. Evaluation

3.3

Evaluation

The evaluation of this heuristic was performed similarly to the evaluation made by Ahr and Reinelt on their tabu search heuristic for the MM k-CPP [2]. In their evaluation they made computational tests on the heuristic using several different graph instances. For each graph, one test was performed for each integer kP[2, 10]. For each test, the tabu search was termi-nated if either the best solution was not improved in a set amount of iterations or the search had been active for a set amount of time. In this evaluation a similar method of evaluation will be used, albeit different graphs. The weight λ will be set to k+1k , where k represents the number of vehicles, so that, for all tests, the maximal traveling distance and the combined traveling distance will be of equal importance.

The graphs used in this study includes 5 graphs representing neighbourhoods in Sweden fetched by Holmberg from OpenStreetMaps [9, 1].

(17)

4

Results

This chapter presents the results obtained using the method described in the Method chapter. First, the implementation of the heuristic is described, followed by a description of how the results are formatted. Finally the data obtained by running the tests is presented.

4.1

Implementation

This section describes how the heuristic was implemented as well as how the data structures were modelled.

4.1.1

The Data Structures

The different data structures used in the program were implemented as described below. The Graph Abstraction

The graph was implemented as a class containing two members: the total number of ver-tices,|V|, and the edges in the graph, E. It was implemented so that |V| = 10 ùñ V =

t0, 1, 2, 3, . . . , 9u. E was a implemented as a map containing a cost for each edge in the graph. Since this study only considered undirected graphs, E was constructed such that Ex,y=Ey,x@(x, y)P V2.

The Tour Abstraction

A tour was implemented as a class containing two members: the total cost of the tour, c, and an ordered list, t, representing the tour taken, where the index of the list determined the order in which the edges were traversed. So a tour with the member t= [1, 2, 3, 4, 2, 1]would represent the tour 1Ñ 2 Ñ 3 Ñ 4 Ñ 2 Ñ 1. This means that the edges were traversed in the following order:t1, 2u, t2, 3u, t3, 4u, t4, 2u, t2, 1u.

4.1.2

The Cycle Trade Heuristic

The Cycle Trade Heuristic generates all neighbouring solutions by, for all cycles in the most expensive tour, giving a cycle to the cheapest tour. The heuristic of generating new solutions

(18)

4.2. Evaluation

can be described by the function in Algorihtm 4.1 where T is a set of tours representing a solution to the W k-CPP. Choosing which of the neighboring solutions that is to be used in the next iteration is handled by the tabu search.

Algorithm 4.1: The Cycle Trade Heuristic. 1 f u n c t i o n cycle_trade(T): 2 NeighboursÐ H 3 t1Ð max tPT tcost(t)u 4 t2Ð min tPTtcost(t)u 5 f o r e a c h cP get_all_cycles(t1): 6 t3Ð with_cycle_excluded(c, t1) 7 t4Ð with_cycle_included(c, t2) 8 nÐ(Tztt1, t2u)Y tt3, t4u 9 NeighboursÐ Neighbours Y n 10 r e t u r n Neighbours

In order to add a cycle, the shortest paths from all vertices in the cycle to all vertices in the receiving tour are calculated. The shortest path of these paths is chosen as the connecting path between the tour and the cycle and will be added immediately before traversing the cycle and the reversed path will be added immediately after traversing the cycle. The cycle is placed in the tour where the connecting vertex is visited for the first time. The cycle is rotated to connect with the path added.

Calculating the shortest paths from each vertex in the tour to each vertex in the cycle is an expensive operation. To enhance the computation speed, dynamic programming was applied. For each path found by the program in a given graph, that path, and all subpaths, are stored in memory to be used in later calculations. This means that calculating the shortest path becomes increasingly faster as more paths have been calculated.

4.2

Evaluation

For each problem, there is a Graph illustrating the problem (Figure 4.1 - Figure 4.5), a chart and a table. The chart represents the value of the objective function during each iteration of the heuristic, and for each value K. For all the tests, the size of the tabu list was set to 10.

Note that even though the objective function in a specific iteration may be higher than a previous answer, the best solution is always kept in memory.

For some tests, the heuristic was unable to complete 100 iterations due to all neighbours being blocked by the tabu list. Then the current best solution was returned.

(19)

4.2. Evaluation

4.2.1

Åtvidaberg

Figure 4.1: Åtvidaberg – 68 nodes, 95 edges

0 20 40 60 80 100 900 1,300 1,700 2,100 2,500 Iteration Curr ent Solution Cost

Current solution cost at each iteration

K=2 K=3 K=4 K=5 K=6 K=7 K=8 K=9 K=10

K Weight Obj. Func. Val LowerBound Rel. Error Execution Time (s)

2 0.67 1865.01 1730.72 8% 12.70 3 0.75 1495.80 1298.04 15% 7.16 4 0.80 1338.44 1038.43 29% 5.48 5 0.83 1221.73 865.36 41% 4.21 6 0.86 1191.67 741.74 61% 3.91 7 0.88 1075.28 649.02 66% 2.76 8 0.89 1083.62 576.91 88% 2.84 9 0.90 1017.11 519.22 96% 2.45 10 0.91 975.38 472.02 107% 1.91

(20)

4.2. Evaluation

4.2.2

Colonia

Figure 4.2: Colonia – 24 nodes, 36 edges

0 20 40 60 80 100 70 90 110 130 150 Iteration Curr ent Solution Cost

Current solution cost at each iteration

K=2 K=3 K=4 K=5 K=6 K=7 K=8 K=9 K=10

K Weight Obj. Func. Val LowerBound Rel. Error Execution Time (s)

2 0.67 114.78 105.87 8% 1.14 3 0.75 96.98 79.40 22% 0.14 4 0.80 88.94 63.52 40% 0.33 5 0.83 84.73 52.94 60% 0.12 6 0.86 81.72 45.37 80% 0.18 7 0.88 79.47 39.70 100% 0.16 8 0.89 77.71 35.29 120% 0.18 9 0.90 76.31 31.76 140% 0.22 10 0.91 75.16 28.87 160% 0.24

(21)

4.2. Evaluation

4.2.3

Skänninge

Figure 4.3: Skänninge – 62 nodes, 80 edges

0 20 40 60 80 100 500 700 900 1,100 1,300 Iteration Curr ent Solution Cost

Current solution cost at each iteration

K=2 K=3 K=4 K=5 K=6 K=7 K=8 K=9 K=10

K Weight Obj. Func. Val LowerBound Rel. Error Execution Time (s)

2 0.67 973.65 895.84 9% 11.84 3 0.75 781.25 671.88 16% 5.87 4 0.80 700.66 537.50 30% 3.31 5 0.83 679.96 447.92 52% 3.04 6 0.86 629.16 383.93 64% 2.57 7 0.88 610.24 335.94 82% 2.70 8 0.89 587.54 298.61 97% 1.75 9 0.90 569.37 268.75 112% 1.81 10 0.91 554.51 244.32 127% 1.54

(22)

4.2. Evaluation

4.2.4

Studentryd

Figure 4.4: Studentryd – 387 nodes, 519 edges

0 20 40 60 80 100 1,000 1,750 2,500 3,250 4,000 Iteration Curr ent Solution Cost

Current solution cost at each iteration

K=2 K=3 K=4 K=5 K=6 K=7 K=8 K=9 K=10

K Weight Obj. Func. Val LowerBound Rel. Error Execution Time (s)

2 0.67 2705.97 2612.41 4% 1720.20 3 0.75 2127.60 1959.30 9% 697.81 4 0.80 1713.86 1567.44 9% 263.61 5 0.83 1503.35 1306.20 15% 232.08 6 0.86 1369.48 1119.60 22% 203.99 7 0.88 1268.65 979.65 29% 142.96 8 0.89 1182.20 870.80 36% 109.92 9 0.90 1141.03 783.72 46% 125.39 10 0.91 1088.77 712.47 53% 87.68

(23)

4.2. Evaluation

4.2.5

Vadstena

Figure 4.5: Vadstena – 581 nodes, 778 edges

0 20 40 60 80 100 0.25 0.44 0.64 0.81 1 10 4 Iteration Curr ent Solution Cost

Current solution cost at each iteration

K=2 K=3 K=4 K=5 K=6 K=7 K=8 K=9 K=10

K Weight Obj. Func. Val LowerBound Rel. Error Execution Time (s)

2 0.67 6916.44 6913.97 0% 4281.33 3 0.75 5232.14 5185.48 1% 1634.07 4 0.80 4290.74 4148.38 3% 630.36 5 0.83 3684.81 3456.99 7% 644.99 6 0.86 3231.06 2963.13 9% 634.68 7 0.88 2978.81 2592.74 15% 348.47 8 0.89 2803.54 2304.66 22% 413.34 9 0.90 2630.47 2074.19 27% 310.30 10 0.91 2618.16 1885.63 39% 294.08

(24)

5

Discussion

This chapter contains the analysis of the results and method used in this study. Thoughts regarding the ethical and societal aspects of this area are also presented.

5.1

Results

First of all, it should be noted that the results of the smaller graphs are of less importance than the larger ones, since heuristics are mainly used on problems too large for an optimal search algorithm to handle. The purpose of these graphs are to show tendencies found when increasing the size, rather than to evaluate the performance of the heuristic.

The Cycle Trade heuristic tends to be solving the problem increasingly faster when the number of vehicles in the problem increase. This is probably due to the heuristic only giving cycles from the most expensive tour to the least expensive. An increasing number of vehicles would result in all cycles being distributed on more vehicles, which, in turn, would lead to a lot fewer cycles to calculate the trading cost of.

The heuristic seems to be closest to the lower bound for the problems with the fewest number of vehices. One of the reasons may be that the heuristic only gives cycles from the most expensive tour to the cheapest. It results in a lot of cycle-trades not being considered since they are not in the most expensive tour. Another reason may be that the lower bound formula does not scale well for increasing number of vehicles. The formula is calculated by dividing CPP cost by k which may not be an accurate estimation for increasing number of k.

A lot of the tests seems to have repeating patterns in the later iterations. This may be an indicator that the tabu list size was too small, allowing the search to loop between already discovered solutions.

The heuristic results in solutions relatively closer to the lower bound for graphs of greater size. It is suspected that this is due to the larger graphs containing more tradeable cycles and cycles of more varied sizes, which results in a more even disitribution of workload for all ve-hicles. This behaviour is especially promising, since heuristics are mainly used on problems too large to solve using brute force methods.

A surprising trend in the results is the starting improvement speed of each iteration. For the majority of the tests, the best solution was found in the first 20 iterations. The cause for this

(25)

5.2. Method

not have any profitable trades available, but trading a tour from the second most expensive tour might lower the solution cost even further.

5.2

Method

Since the W k-CPP is a relatively new problem, theory and heuristics regarding the subject is scarse. To better evaluate the performance of this heuristic, other heuristics to be used for comparison would have been immensely helpful.

In the tests, the attribute time was used to evaluate the effort required to perform all it-erations. Measuring the effort of a procedure using time is not an accurate method, since it depends on the currently available processing power which may heavily fluctuate during the test. In order to get a better estimate of the effort, either the mean time over several executions of the same test, or the required CPU-time, could have been used.

As noted in the discussion of the results, it was suspected that the tabu search got stuck in loops in the later iterations of the heuristics. If that is the case, then the size of the tabu list was too small. And for some of the smaller problems, the test was aborted due to all neighbours being blocked by the tabu list. Using a tabu list of increasing size for increasing problem sizes would probably remove these isues, given that the tabu size was the cause.

In this study, the lower bound for the MM k-CPP part was calculated using formula 2.7. This formula seems to be too simple for higher values of K, since it assumes that the graph can be perfectly divided into K tours. And for an increasing number of tours this estimaton gets increasingly worse. A proposal for a new lower bounds estimaton would be to simply find all cycles in the graph and divide them as evenly as possible, ignoring the fact that the path for each of the vehicles has to be a tour.

5.3

The Work in a Wider Context

As with all optimizations, there are some inevitable consequences. Optimizing the plowing of a city might result in fewer snow plowers being required. This may, in term, result in some of the workers loosing their employment. And since snow plowing is not the only area where this problem is applicable, the magnitude of this problem increases. That being said, optimizing these types of problems results in solving them with less required resources, which leads to a lower environmental impact of the performed task. In the case of snow plowing, it also results in faster snow removal time, which means that there will be less people stuck in traffic.

(26)

6

Conclusion

6.1

Answer to Research Questions

In this study, a heuristic consisting of trading cycles between all tours in the solution has been implemented. The results shows that the heuristic performs suprisingly well on larger graphs with a low number of tours. For the smaller graphs, there exists to few cycles to be able to divide the graph into an equitable distribution between the tours. When using too many vehicles, the heuristic considers too few alternatives in each step, since it only considers trading cycles from the most expensive tour to the cheapest.

Regarding question Q.1, the solution found by the heuristic is close to the optimum for large problems having low values of k. For higher values of k, the solution quality becomes increasingly worse, though for larger problems the heuristic handles higher values of k better. Regarding question Q.2, the time required depends heavily on the number of vehicles, more vehicles leads to faster computation time. The size of the graph is also a significant factor to the execution time. However, in real life applications it will most often be the case that a larger problem is handled by several vehicles, meaning that the computation time will remain within feasible bounds.

6.2

Further Research

In order to further improve the solution, a heuristic considering more tours in the trade, is proposed. It is believed that enabling more tours to trade cycles between would, by sacrific-ing the computation time of the iterations, yield much higher quality for all problems when the number of vehicles in the problem increases.

Since this heuristic shows promise for the W k-CPP, it might also be a good heuristic for the composing problems, namely the MM k-CPP and the k-CPP. Evaluating the performance of this heuristic in these sub-problems might prove valuable.

(27)

Bibliography

[1] OpenStreetMap contributors. Graph data retrieved from https://www.openstreetmap.org.c https://www.openstreetmap.org. 2017.

[2] Dino Ahr and Gerhard Reinelt. “A tabu search algorithm for the min–max k-Chinese postman problem”. In: Computers & Operations Research 33.12 (2006). Part Special Issue: Recent Algorithmic Advances for Arc Routing Problems, pp. 3403–3422. ISSN:

0305-0548.DOI: http://dx.doi.org/10.1016/j.cor.2005.02.011.URL: http: //www.sciencedirect.com/science/article/pii/S0305054805000663. [3] Richard Bellman. The theory of dynamic programming. Tech. rep. RAND CORP SANTA

MONICA CA, 1954.

[4] L. ( 1 ) Bianchi, L.M. ( 1 ) Gambardella, M. ( 2 ) Dorigo, and W.J. ( 3 ) Gutjahr. “A survey on metaheuristics for stochastic combinatorial optimization.” In: Natural Com-puting 8.2 (2009), pp. 239–287.ISSN: 15677818.URL: https://login.e.bibl.liu. se/login?url=https://search- ebscohost- com.e.bibl.liu.se/login. aspx ? direct = true & AuthType = ip , uid & db = edselc & AN = edselc . 2 52 . 0 -67349194941&lang=sv&site=eds-live&scope=site.

[5] Christian Blum and Andrea Roli. “Metaheuristics in Combinatorial Optimization: Overview and Conceptual Comparison.” In: ACM Computing Surveys 35.3 (2003), pp. 268–308.ISSN: 03600300.URL: https://login.e.bibl.liu.se/login?url= https://search- ebscohost- com.e.bibl.liu.se/login.aspx?direct= true&AuthType=ip, uid&db=buh&AN=10913758&lang=sv&site=eds- live& scope=site.

[6] Jack Edmonds and Ellis Johnson. “Matching, Euler tours and the Chinese postman.” In: Mathematical Programming 5.1 (1973), p. 88.ISSN: 00255610.URL: https://login.e. bibl.liu.se/login?url=https://search.ebscohost.com/login.aspx? direct = true & AuthType = ip , uid & db = edb & AN = 71011031 & lang = sv & site = eds-live&scope=site.

[7] Martin Grötschel and Ya-xiang Yuan. “Euler, mei-ko kwan, königsberg, and a chinese postman”. In: Optimization Stories (2012), p. 43.

[8] Kaj Holmberg. “Heuristics for the weighted k-Chinese/rural postman problem with a hint of fixed costs with applications to urban snow removal.” In: (2015).URL: https: //login.e.bibl.liu.se/login?url=https://search.ebscohost.com/

(28)

Bibliography

login . aspx ? direct = true & AuthType = ip , uid & db = edsbas & AN = edsbas . ftlinkoepinguniv.oai.DiVA.org.liu.122168&lang=sv&site=eds-live& scope=site.

[9] Kaj Holmberg. On Using OpenStreetMap and GPS for Optimization. Tech. rep. 2015:15. Linköping University, Faculty of Science & Engineering, 2015, p. 35.

[10] Kaj Holmberg. Optimering : metoder, modeller och teori för linjära, olinjära och kombina-toriska problem. Stockholm : Liber, 2010, 2010. ISBN: 9789147099351. URL: https : / / login . e . bibl . liu . se / login ? url = https : / / search . ebscohost . com / login . aspx ? direct = true & AuthType = ip , uid & db = cat00115a & AN = lkp . 576466&lang=sv&site=eds-live&scope=site.

[11] C. S. Orloff. “A fundamental problem in vehicle routing”. In: Networks 4.1 (1974), pp. 35–64.ISSN: 1097-0037. DOI: 10 . 1002 / net . 3230040105. URL: http : / / dx . doi.org/10.1002/net.3230040105.

[12] André Osterhues and Frank Mariak. “On variants of the k-Chinese Postman Problem”. In: Operations Research and Wirtschaftsinformatik, University Dortmund 30 (2005).

References

Related documents

The objective of this master thesis is to design and implement (using full custom layout) an Active Pixel Sensor (APS) with accompanying readout circuitry in a 0.35 µm CMOS

To choose a solution offered by traditional security companies, in this paper called the firewall solution (Figure 6), is today one of the most common, Identity management market

In short, the essay "About the World I Really Inhabit" [Sobre el mundo donde verdaderamente habito] offers proof of a phenomenological project: the task of gathering the

Thus, for equal-stakes with self- or common-interested voters or a mix thereof, the weighted majority rule can be shown to be weakly collectively optimal on the rather

This value is attained by subtracting the sum of the length of all complete solutions of the tabu search algorithm from the sum of the length of all complete solutions of the

To summarize, Theorem 3.5, that uses the theory of integrable operators, gives us a way to understand the Fredholm determinant in terms of an integral, and Theorem 3.6, that uses

A hybrid of the mixed graph and alternative graph (a derivation of the disjunctive graph, which satisfies the blocking constraint [11]) formulation is used for modelling the

Sea Traffic Management is defined by its services where the services are exposed by service providers for discovery by service consumers in the service registry.. The service