Multiple Ant Colony Optimization for a Rich Vehicle ... - Semantic Scholar

29 downloads 131 Views 410KB Size Report
... required by the subtours. We use the metaheuristic approach known as Ant Colony Optimization. 2 ... As it is widespread practise in this sector, the firm allows the customer to choose when to ..... able on the web page www.paola.pellegrini.it.
Multiple Ant Colony Optimization for a Rich Vehicle Routing Problem: a Case Study Paola Pellegrini, Daniela Favaretto, Elena Moretti∗ Department of Applied Mathematics University Ca’ Foscari of Venice Dorsoduro 3825/E, I–30123 Venice, Italy e-mail: [email protected], [email protected], [email protected]

Abstract Rich vehicle routing problems try to represent situations that can be found in reality. Starting from a case study, in this paper a rich vehicle routing problem is analyzed. The elements that characterize it are mainly the presence of multiple objectives, constraints concerning multiple time windows, heterogeneous fleet, maximum duration of the subtours, and multiple visits. Two variants of the Ant Colony Optimization metaheuristic are proposed for tackling this problem. The specific framework is called Multiple Ant Colony Optimization. It is finalized to the consideration of multi-objective problems. Two algorithms are tested. The results appear very satisfactory.

Keywords: vehicle routing problem, multiple objectives, multiple time windows, heterogeneous fleet, multiple visits, multiple ant colonies ∗ The

authors would like to thank Mauro Birattari for the useful advice during the prepa-

ration of this paper. They also thanks IRIDIA, Universit´ e Libre de Bruxelles, Belgium, for allowing the use of computing power.

1

The vehicle routing problem (VRP) has been first proposed by Dantzig and Ramser (1959). It consists in the determination of the optimal set of routes to serve a given set of customers using a fixed fleet of vehicles. Following this study, many algorithms have been presented. Both optimal and approximated approaches have been considered. This problem is known to be NP -hard (Lenstra and Rinnooy Kan, 1981). Many variants have been also analyzed. They are obtained by adding different kinds of constraints. These constraints can be related to: time windows in which the service must be performed, the requirement of inserting in the same tours both pickup and delivery of goods, the availability of different types of vehicles, the presence of more than one depot, etc. Introducing these features implies a significant increase in the complexity of the problem, which further reduces the dimension of the instances that can be solved to optimality within a reasonable time. For this reason the literature is more and more focusing on heuristic and metaheuristic approaches. In recent years, moreover, thanks to the increasing efficiency of these methods and the availability of a larger computing power, the interest has been shifted to other variants identified as rich VRP. The problems grouped under this denomination have in common the characteristics of including additional constraints, aiming a closer representation of real cases. Following this trend, the rich vehicle routing problem studied in this paper is inspired by the analysis of a case study. It is characterized by many different types of constraints, each of which unanimously classified as challenging even when considered alone. These features are: the presence of multiple time windows, the availability of different types of vehicles, the requirement of multiple visits to some customers and the limitation of the duration of each subtour. Moreover, the problem is multi-objective with two objectives to be considered in hierarchic order. The first one is the minimization of the number of vehicles used, and the second one is the minimization of the total time required by the subtours. We use the metaheuristic approach known as Ant Colony Optimization 2

(Dorigo and St¨ utzle, 2004) to tackle this problem. We consider two of its most successful variants: Ant Colony System (Dorigo and Gambardella, 1997a) and MAX–MIN Ant System (St¨ utzle and Hoos, 1997). They are both studied in a multiple colonies framework. The respective results are compared. The Randomized Nearest Neighbor heuristic and a Tabu Search algorithm are used as reference elements. The instances used to evaluate the different behavior of the algorithms are produced using an instance generator. The analysis is performed on four classes of instances. In Section 1 the case study is presented. This priority is due to the main role that the practical case has in the development of this study. In Section 2 the resulting rich vehicle routing problem is proposed. In Section 3 the two Ant Colony Optimization algorithms considered are described. Section 4 presents the Tabu Search approach and Section 5 the Randomized Nearest Neighbor heuristic. Section 6 describes the instances used for the analysis and Section 7 the experimental setup. Finally Section 8, reports the computational results and Section 9 some conclusions.

1

The Case Study

The case study at the basis of this study is concerned to an Italian firm. Its major activity consists in the delivery of a wide number of food products to restaurants and retailers in the North-East region of the country. This task is accomplished by external suppliers of vehicles. The cost of each vehicle consists in a fixed amount related to the vehicle itself and in a variable one due to the working hours of the driver. The firm decides the set of customers to be assigned to each vehicle and the sequence according to which the customers must be visited. The fee owed to a driver is much lower for the first eight hours than for the following ones, and then the firm imposes tours of limited duration. This structure allows to consider as virtually unlimited the dimension of the fleet available. Moreover, the usable vehicles are of two kinds. They differ for what concerns the external dimensions and the load and unload system. In 3

particular, the bigger vehicles are endowed with a large posterior door, while the smaller ones are characterized by a system of plural lateral doors. As a consequence, the use of the first type is very convenient for serving customers with high demand. At the same time the second type is more practical for visiting the customers requiring low quantities. In this sense, the demand of each customer may imply the use of one or the other kind of vehicle. Another element having an impact on the choice of the kind of vehicle to be used is the geography of the area considered. The customers are all located in a quite well defined region which includes both cities and smaller towns. Most of these urban areas are characterized by an ancient historical center. Owing to the narrow dimension of the streets belonging to these centers, the customers there located must be served using small vehicles. As it is widespread practise in this sector, the firm allows the customer to choose when to receive the delivery. To this aim, they can indicate at most three time intervals for each of the five working days of the week. This gives a total of at most fifteen time windows per customer. Moreover, each customer can require to be served more than once a week. When this is the case, the firm must take care of placing the visits in non-consecutive days unless the customer himself explicitly requires consecutive visits. The aim of the firm is the minimization of the cost of completing all the deliveries. As previously explained, this cost has two main components: a fix one, which is related to the utilization of the vehicle, and a variable one, which is related to the amount of time required to complete the tour assigned. The fix component has the stronger impact. This makes a set of few tours requiring a certain time preferable to another set including more tours and implying a smaller amount of hours. The general aim then can be split in two objectives which have to be pursued hierarchically: the first is the minimization of the number of vehicles required to complete the services, the second is the minimization of the total time needed. The procedure currently applied by the firm to establish the tours consists first of all in splitting the customers in groups of seventy to eighty, and then 4

in deciding the assignments to the different vehicles according to a weekly time horizon. Tours are scheduled on the basis of the experience and the knowledge of the territory of the logistic manager. In agreement with the firm, the aim of the research presented in this paper is proposing an algorithm for solving this second step, considering then the first clusterization as non-modifiable.

2

The rich vehicle routing problem

The VRP has been solved in the literature with exact methods, heuristics and metaheuristics. Examples of exact methods can be found in: Agarwal, Mathur and Salkin (1989); Christofides, Mingozzi and Toth (1981); Fisher (1994); Hadjiconstantinou, Christofides and Mingozzi (1995). Some heuristics are presented in: Beasley (1983); Dror and Levy (1986); Gillett and Miller (1974); Stewart and Golden (1984). And finally metaheuristics are described in: Alfa, Heragu and Chen (1991); Bullnheimer, Hartl and Strauss (1999); Gendreau, Hertz and Laporte (1994); Potvin, Dub´e and Robillard (1996). For a quite complete review of the papers available on this argument we refer the reader to Toth and Vigo (2002). On the other hand, to the best of our knowledge, the rich vehicle routing problem object of this paper has not yet been considered. Following the characteristics of the case study presented in the previous section, this problem consists in the determination of the set of subtours that allow to serve all the customers using the minimum number of vehicles, as first objective, and the minimum total time. First of all, let us analyze the constraint related to the requirement of multiple visits to a single customer. In the classical formulations of VRP, every customer must be visited exactly once. In order to maintain this logic, the multiple services are treated as follows. Each customer j requiring sj > 1 services is duplicated sj − 1 times. All the characteristics of j, such as the type of vehicle required or the distances from all the other customers, are replicated for the new dummy customers. The distance between them is set infinite. The wj time windows of customer j are equally distributed among j and the dummy cus5

tomers related to him. Finally, some constraints must be added to assure that different visits are scheduled at a suitable time distance, as will be discussed and explained in the following. The time horizon considered is split in disjoint subperiods, which represent different days. Each subtour must belong to only one of these subperiods and its total time length must not exceed a fixed duration. As in the classical VRP the demand of all the customers must be met and the capacity of the vehicles has to be respected. Moreover, a specific type of vehicle must be associated to each subtour.

3

Multiple Ant Colony System and Multiple MAX– MIN Ant System

3.1

Dealing with the Ant Colony Optimization’s frameworks

Ant Colony Optimization (ACO) is a metaheuristic based on the foraging behavior of ants. Ants are able to find the shortest path between the nest and a food source by using as indirect communication the pheromone trail (Goss et al., 1989). The metaheuristic starting from this model, consists in using the solutions previously found to modify the pheromone values, biasing in this way the search toward high quality solutions (Zlochin et al., 2004). A complete analysis of this metaheuristic can be found in Dorigo and St¨ utzle (2004). Many ACO algorithms have been proposed in the literature. The two most successful variants, when dealing with routing problems are recognized to be Ant Colony System (ACS) first proposed by Dorigo and Gambardella (1997a,b) and MAX–MIN Ant System (MMAS) first introduced by St¨ utzle and Hoos (1997). The general framework of the ACO algorithms implemented for this study is reported in Table 1. In this study, the swap local search is combined

6

Table 1: General framework of ACO algorithms Procedure ACO Initialize data Find the starting solution with the Deterministic Nearest Neighbor heuristic Pheromone Trail Initialization Determine the nearest neighbor list for each node i ∈ N while (time elapsed < time available) do For each ant a Construct Solution Select the best ant ˆ a Apply Local Search to Solution ˆ a Check if new best Solution is found Apply Pheromone Update If (iteration number is multiple of 50) Check if it is time for pheromone re-initialization end-Procedure

with the algorithm. This procedure consists in the inversion in the sequence of the position of couples of consecutive customers. When all the couples have been considered the procedure stops. When an improvement is found the inversion procedure is restarted one step before the improvement. This local search is well known in the literature and it was first proposed by Lin (1965). It offers the advantage of not being very expensive in terms of computational time although it offers satisfactory results. In our case this element is crucial since the addition of many constraints could make most of the other typical procedures very time consuming. Peculiarities of this implementation are the presence of the nearest neighbor (nn) list (Dorigo and St¨ utzle, 2004, pag. 101-102) and the re-initialization of the pheromone. In particular, this re-initialization is performed when a measure of the convergence of the algorithm becomes greater than a determined threshold. The measure of convergence is represented by the inverse of the average branching factor introduced by Gambardella and Dorigo (1995). The two ACO variants considered differ for the three procedures referred to as Pheromone Trail Initialization, Construct Solution, and Pheromone 7

Table 2: Summary of the relevant formulas related to pheromone for ACS and MMAS algorithms ACS Pheromone Trail

MMAS

τ0 =

1 |N |·Cost Starting Solution s

Initialization Pheromone Update

bsf τij = (1 − ρ)τij + ρ∆τij

bsf τij = (1 − ρ)τij + ∆τij

( bs ∆τij

1/Cost bsf

if (i, j) ∈ bsf

0

otherwise

(bsf = best-so-far solution) if τij > τMAX then τij = τMAX if τij < τmin then τij = τmin τMAX



τmin



Local Pheromone

1 |N |·Cost bsf

−1

τMAX (1−0.05|N | |N |

)

−1

( 2 −1)0.05|N |

τij = (1 − ψ)τij + ψτ0



Update

Update. In particular, as for the way pheromone is treated, the procedures are shown in Table 2, with τ0 pheromone initialization level, τij pheromone level on the arc (i, j), and ρ and ψ parameters of the algorithms. The element that characterizes the MAX–MIN Ant System approach is the limitation of the possible range of pheromone trail values to the interval [τmin , τMAX ]. By the Construct Solution procedure a feasible solution with a fixed number of vehicles is generated. The procedure is reported in Table 3, with an highlight on the part in which the two algorithms differ. As it can be seen, the difference consists in what is called pseudorandom proportional rule that characterizes the Ant Colony System. It allows to define more explicitly in which measure to concentrate the search of the system around the best-so-far solution. Moreover, the application of a Local Pheromone Update, again typical of ACS, is needed to make the pheromone evaporating from the edge just used. This is done for allowing a greater exploration of different tours. It is applied on every

8

Table 3: Procedure for constructing solutions

Procedure Construct Solution Set tabuList = ∅ Set Solution = ∅ Set i = 0 while (|Solution| < |N |) do If (nnListi ∩ tabuList 6= nnListi ) Then SearchSpace = {j ∈ nnListi ∩ tabuListC } Else SearchSpace = {j ∈ tabuListC } If SearchSpace∩ feasible customers 6= ∅ Then \∗ if MMAS ∗ \

\∗ if ACS ∗ \

For each node j ∈ SearchSpace such

Draw a random number q

that j is feasible

If (q ≤ q0 ) Then

Set the probability of being chosen pij =

Next node j =

β

α τij ·ηij ϑν ij

P

α

β

β ν = argmaxz {τiz ηiz ϑiz :

ν

feasible τiz ·ηiz ϑiz Select randomly next node j z∈SearchSpace,z

z ∈ SearchSpace, z feasible} Else For each node j ∈ SearchSpace such that j is feasible Set the probability of being chosen pj =

P

β

τij ηij ϑ(ij)ν β

ν

feasible τiz ηiz ϑiz Select randomly next node j z∈SearchSpace:z

Apply Local Pheromone Update

Solution = Solution ∪ {j} tabuList = tabuList ∪ {j} Update parameters i=j Else if ∃ non inserted depot Then j = depot, reset parameters Else Break end-while end-Procedure

9

arc (i, j) after its insertion in the tour. It must be noticed, moreover, that in the MAX–MIN Ant System procedure for selecting the customer to move to, the pheromone level of the arcs is arisen at the power of α, while in the Ant Colony System this does not happen. In both cases, anyway, the choice follows a measure of attractiveness represented by the product of the pheromone level τij and two heuristic measures ηij and ϑij (Favaretto, Moretti and Pellegrini, 2005). The value of ηij is proportional to the time tij necessary to go from node i to node j and to the urgency of serving customer j. This measure is given by the time interval between the present moment (now) and the one in which the chosen time window ([ˆ ej , ˆlj ]) closes. The number of times in which the node j has not been touched in the previous routes is also considered (INj ). More precisely, ηij =

1 max{1, γ(max{now + tij , eˆj } − now)(ˆlj − now) − INj3 }

,

(1)

where is γ is a scale factor used to have homogeneous quantities. This formula is the one proposed by Gambardella, Taillard and Agazzi (1999) for the VRP with single time windows, apart from the presence of the coefficient γ and from the raising to the third power of INj , which is introduced to privilege the choice of customers “difficult” to visit. The computation of ϑij is focused on the presence of multiple time windows. It depends both on the time still available to visit node j being in node i at the instant now and on the number of time windows of customer j:  1, if SWj = ∅,    1 ½ ¾ , otherwise ϑij = £P ¤  v v max 3  (l −ej ) ·(lj −now−tij )−wj  max 1, ξ v∈SWj j

(2)

where SWj = {v ∈ {1, . . . , wj }|ljv > ˆlj } is the set of the time windows of customer j subsequent the one chosen, ljmax is the end of his last time window and ξ is a scale factor introduced to have homogeneous quantities. Remark that if there is no time windows successive to the current instant, the value of ϑ must be set equal to 1 so that the criterion on which the next node is chosen relies completely on η and τ . 10

3.2

Dealing with specific constraints

In order to apply these procedures to the rich VRP considered, two elements must be clarified concerning the satisfaction of the different constraints: the definition of feasible customers has to be given, and a way for dealing with the multiple time windows has to be stated. First of all, the constraint on the duration of each subtour is quite easy to treat. This can be done by stating that if visiting customer j and going back to the depot implies that the current subtour lasts more than the available time, then j is unfeasible. For taking into account the differences among vehicles, the following procedure has been applied. First of all, one type of vehicle kˆ is fixed as default. Then the insertion of the customers begins considering the capacity constraint ˆ and without taking into account the type of vehicle possibly imposed by type k, required by the customers. When the first customer requiring a specific type of vehicle is inserted, this type is considered for the subtour. The following customers will be feasible if either they do not require a specific class of vehicles or they require the class already established. When considering customers for the insertion while the vehicle is still the default one, if the cumulated demand is larger than the capacity of some type of vehicle, then all the customers requiring such types are set as unfeasible. Finally, periodic constraints must be satisfied. In the same way as explained in the description of the problem in Section 2, before starting all the procedures, the set of customers is analyzed, and each of those requiring more than one visit is duplicated assigning to each dummy customer some time windows of the original one. If this division of the time windows allows a suitable separation between the services, it is recorded that the visits to these customers must happen with at least a certain distance. This distance depends from the number of visits required. When constructing a solution, these customers are treated as totally independent apart from the necessary distance between the services, when imposed, which might render some of them unfeasible at some step.

11

As far as the multiple time windows are concerned, the procedure used is quite straightforward. It consists in choosing dynamically the one to be considered. It corresponds to the first one closing after the moment in which the customer can be reached, if such time window exists. The number and duration of the not yet closed time windows is nonetheless taken into account in the choice via the computation of the heuristic measure ϑ.

3.3

Dealing with multiple objectives

For facing the problem proposed by the firm and analyzed in Sections 1 and 2, the algorithms must operate considering the two objectives in hierarchical order. They represent the minimization of the number of vehicles used, and the minimization of the time required to complete the tour. To this aim, a very interesting approach has been presented Gambardella, Taillard and Agazzi (1999) consisting in the implementation of a system of multiple colonies, according to which two kinds of colonies with different specializations are exploited. This system has been developed to tackle a multi-objective vehicle routing problem with time windows using Ant Colony System and has never been implemented for other ACO variants, despite reaching very encouraging results. The two kinds of colonies employed (VEI and TIME ) are specialized following the two objectives of the problem. Given a certain number of vehicles v, the VEI colonies search for a feasible solution, while the TIME ones try to improve its quality in terms of total time. The implementation proposed here is sequential, differently from the parallel one proposed in Gambardella, Taillard and Agazzi (1999), in which the two type of colonies work at the same time. Here, VEI colonies are started first. Their aim is to fix the minimum number of vehicles with which ants are able to find a feasible solution. As soon as a feasible solution is found with a certain number of vehicles, VEI colonies are restarted decreasing this number. Then, once the final number of vehicles is fixed, TIME colonies are activated. This change imposes the choice of some criteria accord-

12

ing to which the algorithm should pass from VEI to TIME colonies. Since the stop criterion of the whole procedure is the computational time, we decided to express in terms of time also the chance allowed to VEI colonies to improve the solution according to their own objective. It is quite predictable that the lower the number of vehicles used is, the lower the number of feasible solutions is, and so the more difficult it is to find them. Then, when diminishing v, it is expected that the VEI colonies need a longer time to find a solution. On the other hand, if such a solution does not exist, it is not convenient wasting computational time that might be used to improve the current solution in terms of total time. For dealing with this trade off, the VEI colonies are allowed to operate for a time tVEI :

tˆ =

   0       t prev

tVEI = max{2, 5tˆ}

(3)

if the current number of vehicles is the first one considered by a VEI colony

(4)

otherwise

with tprev equal to the time that has been necessary for the VEI colonies to find a feasible solution with the previous number of vehicles considered. We will refer to the value tVEI as partial stopping criterion. In Gambardella, Taillard and Agazzi (1999) the number of vehicles is decreased of one unit at a time, starting from the one used in the solution found by the Deterministic Nearest Neighbor heuristic. In this implementation, once a feasible solution is found with v vehicles, new VEI colonies are started (with a re-initialized pheromone matrix as for Gambardella, Taillard and Agazzi (1999)) being allowed to use only v − 2 vehicles. If a better solution is found, this procedure is repeated. Otherwise, if a solution with v − 2 vehicles has not been found after the partial stopping criterion is met, VEI colonies are started using v − 1 vehicles. When the TIME colonies are started the level of pheromone is reset equal to the one present when the feasible solution with that number of vehicles was found. This procedure is not present in the original algorithm (Gambardella, Taillard and Agazzi, 1999), and has been inserted here since it has proved to be very efficient in earlier experiments. 13

At each solution built by these TIME colonies a check for the number of vehicle used is performed. This is done since proceeding in the successive trials, ants tend to concentrate on profitable areas of the search space. It is possible, and not too infrequent, that they manage to find a solution with one vehicle less than the available ones. In this case this new number is recorded and used for the following iterations. The solution with the lower number of vehicles becomes the new best-so-far. In this sense we might state that the TIME colonies used in this paper are somehow hybrids of the TIME and the VEI ones proposed by Gambardella, Taillard and Agazzi (1999). A remarkable feature characterizing the VEI colonies is related to the pheromone update. As soon as an ant finds a feasible tour with the desired number of vehicles, the activity of the colony stops and new colonies are activated with less vehicles available. Following Gambardella, Taillard and Agazzi (1999), the pheromone update during the activity of this kind of colony is performed twice according to the formula for the Pheromone Update reported in Table 2. First of all, the best feasible solution found so far is considered. Remark that this solution uses a number of vehicles greater that the one currently considered. Then, the best solution with the current number of vehicles is used. This current best solution is the one including the greater number of nodes. In case this number is common to more than one sequence, it is the one implying the shortest total time. In a way then, also VEI colonies can be considered as hybrid. The two algorithms obtained following these steps will be referred as Multiple Ant Colony System (M-ACS) and Multiple MAX–MIN Ant System (MMMAS).

4

Tabu Search

Tabu Search (Glover, 1986; Glover and Laguna, 1997) is one of the most successful metheuristics for the vehicle routing problem with single time windows. For this reason it is considered as a reference point for the algorithms proposed 14

here. The idea represented by this metaheuristic consists in exploring the solution space via a local search procedure, using a short term memory in order to avoid sequences of moves that constantly repeat themselves. In the algorithm considered here, the starting solution is generated with the Deterministic Nearest Neighbor heuristic and its neighborhood is explored via the swap local search procedure. The short term memory is represented by a list of forbidden moves (called tabu list): The algorithm records the last solutions found and excludes them from the set of available feasible ones. The tabu list can include either complete or partial solutions, in order to reduce the computational inefficiency (Gendreau, 2003, p.43). Clearly if solution components are stored, it is possible that good quality solutions are forbidden for being partly equal to another recently visited. To avoid this counter effect an aspiration criterion (Gendreau, 2003, p.44) is used, allowing forbidden moves in case the new solution is the new best one. In this implementation solution components are considered, recording subsequences of 6 customers centered on the swapped couple. The solutions including forbidden components with probability pf > 0 (the other solutions are evaluated with probability pa ). The length of this list, i.e. the number of solutions forbidden at each step, known as tabu tenure (Gendreau, 2003, p.43-44), is a parameter of the algorithm. If its value is low, the search is concentrated on small areas of the search space. If it is high, a larger region is explored. In this implementation, a random value between λ · |N | and |N | is assigned to the tabu tenure at each step, with |N | number of customers and λ parameter (0 ≤ λ ≤ 1: the higher the value is, the higher is the probability of having a large value associated with the tabu tenure). The tabu list is handled in a Fist In First Out manner.

15

5

Randomized Nearest Neighbor

As additional reference point to evaluate the performance of the two ACO algorithms presented, the Randomized Nearest Neighbor heuristic (Pellegrini, 2005) is considered. It consists in an adaptation of the Nearest Neighbor heuristic proposed by Solomon (1987) for tackling the rich VRP analyzed, joined to a stochastic element. The original algorithm consists in the successive insertion of the nearest customer. The concept of closeness when dealing with time windows is not easy to define. The reason is that the waiting time implied by the choice of the spatially closest feasible customer may have a great impact on the quality of the solution. Solomon proposed a measure based on the weighted sum of the distance of the customer from the current location, the urgency of serving him (related to the lateness of the closure of his time window), and the waiting time that his immediate insertion would imply. The tours are constructed choosing one after the other the customer that allow to minimize this distance until feasible moves are available, and returning to the depot when this is not the case. This procedure is iterated until all the customers have been served. In order to apply this procedure to the problem we are considering, the same methods explained in Section 3.2 are applied. After the construction of a tour, moreover, the swap local search is performed. The insertion of the stochastic element consists in modifying the choice criterion for the first node of each subtour, making this selection randomly among the customers not yet visited. After this choice, the procedure continues deterministically until the depot is reached again and a new subtour must be started. The Randomized Nearest Neighbor (RNN), then, consists in the reiteration of this procedure alternated to the local search one. The multiple objectives are considered when solutions are compared. In this case the preferred one is always the one implying fewer vehicles, and if this number is equal, the one requiring the smaller total time.

16

6

The Instances Considered

Being the case study presented in Section 1 the starting point of this analysis, we study the behavior of the different algorithms when having to deal with instances similar to those that have to be solved by the firm itself. We implemented therefore an instances generator. The first need is then to analyze the structure of a typical instance. As said in Section 1, we are interested in sets of customers with cardinality of the order of 70 to 80 elements, as for the subsets of customers considered by the firm. The customers are geographically quite close, so that they can be considered as grouped in one cluster. A city is represented as a set of concentric circles, the number of which depends on the population of the city considered (the higher the population, the higher the number of circles). Given that the towns in the interested region of Italy are not very large, we consider a cluster made of either one or two circles. We will refer to the areas bounded by two consecutive circles as to zones. The nodes are uniformly distributed in each zone and the depot is located in the most external one. The matrix of distances is produced for each instance. Distances are expressed in travel time. They are calculated associating to each zone a coefficient, that represents the speed, for which the Euclidean distance must be multiplied. To reproduce the situation of real cities, where this speed decreases when one approaches the center, the coefficient becomes smaller while moving from a zone to a more internal one. The speed considered in order to compute these coefficients are 15 km/h for the most internal circle of the city and 40 km/h for the most external one. For a detailed description of this procedure we refer the reader to Pellegrini and Birattari (2005), in which an instances generator for the vehicle routing problem with stochastic demand is described. In this framework the same procedure for the localization of the nodes is used. Apart from the geographical location of the nodes, many characteristics must be assigned to each customer in order to consider all the present constraints. Again, before deciding the ratio according to which fixing these features, we

17

need to take a look to the way they are settled in practice. The data relative to an instance representative of those supplied by firm are reported in Table 7 (Appendix). They are related to the type of vehicle needed for the service, the number of services required and the demand relative to each one. The requirement of multiple visits is quite rare, while the need of a specific type of vehicle is observable more often and it is split almost equally between the two available ones. These two elements are almost constant in all the available real instances, and so we decided to keep them constant also in the ones generated: The number of customers requiring a specific type of vehicle varies between 15 and 18 and the number of those requiring multiple services (in our case two) is equal to 5. The specific customers are randomly drawn according to a uniform distribution. Given that two types of vehicles are available to the firm, we considered two different types as well. The capacities are set equal to 200 and 300. As shown in Table 7 (Appendix) the distribution of the demands is characterized by a quite high variance. In previous studies (Pellegrini, 2005) this element has proven to increase quite strongly the difficulty of the instances. In order to test the algorithms on instances able to reflect the real ones, but also to get a deeper understanding of their behavior when dealing with cases with different and somehow recognized level of difficulty, we decided to consider the situations with both low and high variance of the distribution from which the demands are drawn. For this reason the bounds of this distribution are set equal either to 10 and 15, 10 and 20, or 10 and 25 - low variance - or to 5 and 45, 5 and 50, or 5 and 55 - high variance -. Finally, the parameters related to the assignment of the time windows must be fixed. The time windows concerning the representative instance considered in Table 7 are reported in Figure 4 (Appendix). A time horizon of a week, five working days, is considered. The starting and ending values of the time windows are considered in terms of the number of minutes elapsed, starting the count at 0:00 am of the first day. The time horizon is then equal to the interval [0, 7200] and is reproduced in our generator. As it is expected being a real 18

case, the distribution of these intervals does not follow a strict schema, even if a main trend is detectable. The first clear element is that for each day all the time windows are fixed in an interval shorter than the 24 possible hours. This element is very common in reality, but it is seldom reproduced in benchmark instances. For reproducing this situation we impose that the time windows can neither start before 7:00 am nor end after 7:00 pm. Secondly, apart from some exceptions, most of the customers allow to be served in few time windows with a quite long duration. As before, the impact of the number and the duration of the time windows on the difficulty of an instance has been analyzed in Pellegrini (2005), resulting that the configuration with many short intervals is more difficult than one with less longer ones. In order to differentiate the characteristics of the instances, then, we decided to consider two structures for the time windows varying the intervals from which their number (nTW ), their duration (du) and the minimum distance between two consecutive ones (di ) are drawn: In one case nTW ∈ [2, 5], du ∈ [240, 420] minutes, di = 60 minutes. In the other nTW ∈ [4, 10], du ∈ [120, 180] minutes, di = 80 minutes. The procedure used to assign the time windows is presented in detail in Pellegrini (2005). Combining the two configurations of the time windows with those concerning the variance of the demands we obtain four classes of instances: 1. dem ∈ {[10, 15], [10 − 20], [10 − 25]}, nTW ∈ [2, 5], du ∈ [240, 420], di = 60; 2. dem ∈ {[5, 45], [5, 50], [5, 55]}, nTW ∈ [2, 5], du ∈ [240, 420], di = 60; 3. dem ∈ {[10, 15], [10, 20], [10, 25]}, nTW ∈ [4, 10], du ∈ [120, 180], di = 80; 4. dem ∈ {[5, 45], [5, 50], [5, 55]}, nTW ∈ [4, 10], du ∈ [120, 180], di = 80.

7

Experimental Setup

The experiments have been run on a cluster of an AMD OpteronTM 244. The executables have been generated from C++ source. The code is publicly avail-

19

able on the web page www.paola.pellegrini.it. The computational time considered as stop criterion is 15 seconds for each instance. 900 instances of each class have been generated following the procedure presented in Section 6. Among these, 500 have been used for tuning the parameters and 400 for the experiments. Following Bianchi et al. (2005), some basic procedures as the local search are common to all the algorithms, in order to obtain an unbiased comparison of their behaviors. Following Birattari (2004a,b), we perform the experiments on a large set of instances, running the algorithms once on each of them. For each of these four sets the relevant parameters of each algorithm have been tuned. Moreover, starting all the algorithms from the solution found by the Deterministic Nearest Neighbor heuristic (DNN), its parameters (the weights to be assigned to the three components of the distance measure: c1, c2 and c3) have been tuned as well. The range considered is: c1 ∈ I, c2 ∈ I, c3 ∈ I, I = {ij : i0 = 0.2, ij + 1 = ij + 0.5 ∀j ∈ [0, 13]}. For this aim we use the F-Race algorithm proposed by Birattari et al. (2002). The ranges of values chosen for the parameters and the selected candidates for each class of instances and for each algorithm are reported in Tables 4 and 5 respectively. The number of ants for each colony and the length of the nearest neighbor list have been fixed equal to |N | and

|N | 3

respectively (with |N | number of nodes of the graph), following

the experience of the authors and preliminary experiments.

8

Results

In this section the results of the computational experience are presented, considering as reference the behavior of the Deterministic Nearest Neighbor. The element that first emerges is the dominance of the M-MMAS over the other algorithms. In Figure 1 the ranking of the different approaches is reported for each class of instances. As it appears evident in the strong majority of the cases the M-MMAS outperforms the other approaches. This better behavior is observable also in Table 6, in which the number of instances with an improvement with respect to the DNN, and the average percentage of these improvement, 20

Table 4: Value of the parameters chosen for applying the F-Race procedure for each algorithm M-ACS

M-MMAS

RNN

TS

ρ ∈ {0.05, 0.1, 0.5}

ρ ∈ {0.05, 0.1, 0.5}

β ∈ {2, 3, 5}

β ∈ {2, 3, 5}

ν ∈ {2, 3, 5}

ν ∈ {2, 3, 5}

q0 ∈ {0.8, 0.85, 0.9}

α ∈ {0.5, 0.75, 1.0,

ψ ∈ {0.1, 0.2, 0.3}

1.25, 1.5, 1.75,

0.5, 0.6, 0.7}

pf ∈ {0.5, 0.7, 0.75,

2.0, 2.25, 2.5}

c3 ∈ {0.2, 0.25, 0.3,

0.8, 0.85, 0.9}

c1 ∈ {0.55, 0.6,

λ ∈ {0.5, 0.6,

0.65, 0.7, 0.75,

0.75, 0.8, 0.85, 0.9}

0.8, 0.85}

pa ∈ {0.2, 0.25, 0.3,

c2 ∈ {0.2, 0.3, 0.4,

0.35, 0.4, 0.45}

0.35, 0.4, 0.45} tot 243

tot 243

tot 252

tot 252

Table 5: Selected candidates after the F-Race procedure for each class of instances for each algorithm class

DNN

M-ACS

M-MMAS

RNN

TS

1

c1 = 0.85,

ρ = 0.1, β = 3,

ρ = 0.5, β = 2,

c1 = 0.8,

λ = 0.5,

c2 = 0.65,

ν = 5, q0 = 0.8,

ν = 2, α = 1.0

c2 = 0.6,

pa = 0.2,

c3 = 0.2

ψ = 0.2

c3 = 0.2

pf = 0.9

c1 = 0.85,

ρ = 0.2, β = 5,

ρ = 0.05, β = 2,

c1 = 0.85,

λ = 0.5,

c2 = 0.6,

ν = 3, q0 = 0.8,

ν = 2, α = 1.75

c2 = 0.6,

pa = 0.2,

c3 = 0.2

ψ = 0.1

c3 = 0.2

pf = 0.9

c1 = 0.85,

ρ = 0.1, β = 5,

ρ = 0.5, β = 5,

c1 = 0.8,

λ = 0.5,

c2 = 0.65,

ν = 2, q0 = 0.8,

ν = 2, α = 1.0

c2 = 0.5,

pa = 0.2,

c3 = 0.2

ψ = 0.1

c3 = 0.2

pf = 0.8

c1 = 0.8,

ρ = 0.1, β = 5,

ρ = 0.5, β = 5,

c1 = 0.85,

λ = 0.5,

c2 = 0.7,

ν = 5, q0 = 0.8,

ν = 2, α = 1.0

c2 = 0.4,

pa = 0.2,

c3 = 0.2

ψ = 0.2

c3 = 0.2

pf = 0.85

2

3

4

21

(a) Class 1

(b) Class 2

(c) Class 3

(d) Class 4

Figure 1: Ranking of the performance of the algorithms in terms of a linear combination of the results referred to the two objectives.

are presented for each algorithm. Given the priority of the minimization of the number of vehicles, if a solution is preferable in this sense the travel time is not considered. The second objective is checked when no difference is detectable about the first. As it can be seen, in general M-MMAS and M-ACS behave in a quite similar way. They improve significantly the number of vehicles used in the best solution found and do not make a real difference with respect to the total travel time when they are not able to make a difference in terms of the first objective. It can be observed, moreover, that even if the number of instances in which the number of vehicles decreases with respect to the DNN is very similar for the two algorithms, the average value of this difference is much higher when considering M-MMAS. A completely different behavior is observable for RNN, where the number of vehicles is quite seldom improved (in about 50% of the cases). When this happens the difference is less stressed than for the ACO algorithms. On the other hand the total travel time is diminished much more often. Finally, TS places itself between the ACO algorithms and RNN. The number of instances in which the number of vehicles is improved is close to the one de22

Table 6: Number of instances in which any improvement with respect to the DNN has been found and average percentage improvement. cl.

M-ACS

M-MMAS

RNN

TS

veh.

µ%

veh.

µ%

veh.

µ%

veh.

µ%

1

319

19.67

310

28.80

178

15.29

276

16.16

2

395

21.36

375

25.06

213

12.66

321

12.84

3

247

16.72

316

25.23

189

15.59

304

15.06

4

363

17.06

370

22.74

198

12.52

320

12.28

time

µ%

time

µ%

time

µ%

time

µ%

1

0

0.00

0

0.00

111

12.52

59

9.25

2

0

0.00

0

0.00

97

11.91

42

8.84

3

0

0.00

0

0.00

88

11.81

32

12.01

4

0

0.00

0

0.00

85

10.45

32

9.54

tected for ACO algorithms, and once it is even bigger. Nonetheless, the average improvement is always quite lower. The value referred to the total travel time in this case is comparable to the one concerning RNN. The predominance of the ACO algorithms with respect to the first objective of the problem is clear also when observing Figure 2. Here the distribution of the percentage improvement with respect to the DNN’s solutions is presented. In all the classes of instances the Randomized Nearest Neighbor performs worse than the others, despite often achieving an improvement with respect to its deterministic counterpart. It is also observable, as considered before, that M-MMAS obtains better results than M-ACS, which are in any case much better than those of DNN and RNN. As far as TS is concerned, it is remarkable that in most of the cases its results are located between RNN and M-ACS, a part from class 3 in which it behaves better than this ACO algorithm. Focusing on the differences in the four classes, for RNN the behavior does not significantly change and for TS it changes only in class 1. For both the ACO algorithms it is detectable that the relative performance with respect to DNN is not very sensible to the changes in the configuration of the time windows,

23

(a) Class 1

(b) Class 2

(c) Class 3

(d) Class 4

Figure 2: Percentage improvement in the number of vehicles with respect to DNN’s solutions.

while it appears influenced by the differences related to the distribution of the customers’ demands. In general the improvement is stronger in the most difficult cases. This trend is very evident for M-ACS, while it is just detectable for MMMAS. Figure 3 reports the percentage difference in travel time between the solutions found by couples of algorithm. For each boxplot the instances in which the number of vehicles used is the same for the two algorithms reported in the respective title are considered. The relation used is such that the values greater than zero imply a better performance of the second algorithm reported. The graphics are referred only to class 1, since the results are qualitatively equivalent through the different instances. Considering the ratios represented, the following relations are deductable: TS ≺ M-MMAS ≺ M-ACS ≺ RNN, where with the symbol ≺ we mean that, according to the second objective of the problem, the second algorithm is preferable to the first. The predominance of RNN might be due to the fact that it builds solutions without posing an accent 24

Figure 3: Percentage difference between couple of algorithms in the total time relative to the solutions found, considering the instances of class 1 for which the number of vehicles used is equal.

on one of the two objectives, which are considered only when different sequences must be compared. When solutions with the final number of vehicles are quite easy to find, this approach results advantageous. Instead, ACO algorithms actually waste 4 seconds focusing just on the number of vehicles (2 seconds trying to find a solution with the original number of vehicles decreased by two, and 2 more searching for one with the starting number minus one). As a consequence, they can investigate the one that will be the final search space only for the remaining 60% of the time available. The worse performance of TS can maybe be explained with the fact that it is focused on the first objective for all the computational time. Finally, let us try to compare the approaches presented with the one currently applied by the firm object of the case study. It is not very easy to analyze the differences, since following the tours provided by the firm about 20% of the time windows are violated. In any case, the ACO algorithms find feasible solutions which imply in average the same number of vehicles currently used, even if the total travel time needed is bigger. In terms of average performance TS is the third algorithm, followed by RNN and DNN, all supplying tours requiring more vehicles than those currently used but clearly not violating any constraint. Since only few real instances are available, no more details on the results related to the case study are reported.

25

9

Conclusion

Two Multiple-ACO algorithms are presented for solving a rich vehicle routing problem inspired by a case study. Its characteristics are: multiple hierarchically ordered objectives, multiple time windows, heterogeneous fleet of vehicles, periodic constraints and limited duration of the subtours. As reference elements the Deterministic and Randomized Nearest Neighbor heuristics and a Tabu Search algorithms are considered. The ACO algorithms proposed perform significantly better than these alternatives, both on instances generated for the theoretical analysis and on those available for the case study.

10

Appendix

Table 7: Relevant data about the customers: type of vehicle required (V ∈ {big (b), small (s), indifferent (-) }), number of services (S), demand (D).

n.

V

S

D

n.

V

S

D

n.

V

S

D

n.

V

S

1

-

2

-

1

7

19

-

1

8

37

-

1

29

20

-

1

9

38

-

3

-

4

b

1

17

21

b

1

91

39

1

124

22

-

1

25

40

5

-

1

21

23

-

1

32

6

-

1

26

24

s

1

7

s

2

20

25

s

8

b

1

63

26

9

-

1

7

27

10

s

1

21

11

s

1

12

b

1

13

-

1

14

-

1

15

-

16

-

17 18

1

3

55

-

1

3

1

15

56

-

1

14

-

1

10

57

-

1

19

-

1

13

58

-

1

21

41

-

1

4

59

-

1

18

16

42

-

1

18

60

-

1

2

1

12

43

-

1

7

61

-

1

23

s

1

26

44

-

1

39

62

-

1

20

-

1

20

45

-

1

10

63

-

1

6

28

-

1

5

46

-

1

10

64

-

1

36

8

29

-

1

20

47

-

1

23

65

s

1

10

193

30

-

1

27

48

s

1

23

66

-

1

15

11

31

-

1

51

49

-

1

11

67

s

1

2

16

32

-

1

6

50

-

1

3

68

b

1

75

1

9

33

-

1

29

51

-

1

26

69

b

2

105

1

11

34

-

1

19

52

-

1

10

70

-

1

6

-

1

10

35

-

1

13

53

-

1

11

71

b

2

67

s

1

6

36

-

1

9

54

b

1

69

26

D

Figure 4: Time windows of the customers belonging to a representative instance supplied by the firm.

References Agarwal Yogesh, Mathur Kamlesh and Salkin Harvey M. (1989).“A setpartitioning algorithm for the vehicle routing problem”, Networks 19, 731– 27

749. Alfa Attahiru S., Heragu Sunderesh S. and Chen Mingyuan (1991).“A 3-opt based simulated annealing algorithm for vehicle routing problems”, Computers & Industrial Engineering 21, 255–270. Beasley John E. (1983).“Route-first cluster-second methods for vehicle routing”, Omega 11, 403–408. Bianchi Leonora, Birattari Mauro, Chiarandini Marco, Manfrin Max, Mastrolilli Monaldo, Paquete Luis, Rossi-Doria Olivia and Schiavinotto Tommaso (2005). “Hybrid metaheuristics for the vehicle routing problem with stochastic demand”, accepted for publication on Journal of Mathematical Modelling and Algorithms. Birattari Mauro, St¨ utzle Thomas, Paquete Luis and Varrentrapp Klaus (2002). “A racing algorithm for configuring metaheuristics” In William B. Langdon et al. (Eds.) GECCO 2002: Proceedings of the Genetic and Evolutionary Computation Conference, 11-18. Morgan Kaufmann, San Francisco, CA, USA. Birattari Mauro (2004a). “On the estimation of the expected performance of a metaheuristic on a class of instances. How many instances, how many runs?”, Technical Report TR/IRIDIA/2004-01, IRIDIA, Universit´e Libre de Bruxelles, Brussels, Belgium. Birattari Mauro (2004b). “The problem of tuning metaheuristics, as seem from a machine learning perspective.”, PhD thesis, Universit´e Libre de Bruxelles, Brussels, Belgium. Bullnheimer Bernd, Hartl Richard F. and Strauss Christine (1999).“An improved ant system for the vehicle routing problem”, Annals of Operations Research 89, 319–328. Christofides Nicos, Mingozzi Aristide and Toth Paolo (1981).“Exact algorithms for the vehicle routing problem based on the spanning tree and shortest path relaxation”, Mathematical Programming 20, 1981, 255–282. 28

Dantzig George B., Ramser John H. (1959). “The truck dispatching problem”, Management Science 6, 80–91. Dorigo Marco and Gambardella Luca M. (1997a). “Ant colonies for the traveling salesman problem”, ByoSystems 43, 73–81. Dorigo Marco and Gambardella Luca M. (1997b). “Ant colony system: A cooperative learning approach to the traveling salesman problem”, IEEE Transaction on Evolutionary Computation 1, 53–66. Dorigo Marco and St¨ utzle Thomas (2004). “Ant Colony Optimization”, MIT Press, Cambridge, MA, USA. Dror Moshe and Levy Larry (1986).“Vehicle routing improvement algorithms: Comparison of a greedy and a matching implementation for inventory routing”, Computers and Operations Research 13, 33–45. Favaretto Daniela, Moretti Elena, Pellegrini Paola (2005).“Ant colony system for a vrp with multiple time windows and multiple visits” available on the website www.paola.pellegrini.it. Fisher Marshall L. (1994).“Optimal solution of vehicle routing problems using minimum k -trees”, Operations Research 42, 626–642. Gambardella Luca M. and Dorigo Marco (1995). “Ant-Q: A reinforcement learning approach to the traveling salesman problem”, In Kaufmann Morgan (Ed.) Proceedings of the Eleventh International Conference on Machine Learning, 252–260. Morgan Kaufmann, San Francisco, CA, USA. Gambardella Luca M., Taillard Eric and Agazzi Giovanni (1999). “MACSVRPTW: A multiple ant colony system for vehicle routing problem with time windows”, In Corne David, Dorigo Marco and Glover Fred (Eds.) New idea in optimization, 63–76, McGraw-Hill, London, UK. Gendreau Michel, (2003).“An introduction to tabu search”, In Glover Fred and Kochenberger Gary A. (Eds.) Handbook of metaheuristics, 37–54, Kluwer Academic Publishers, Norwell, MA, USA. 29

Gendreau Michel, Hertz Alain and Laporte Gilbert (1994).“A tabu search heuristic for the vehicle routing problem”, Management Science 40, 1276– 1290. Gillett Billy E. and Miller Leland R. (1974).“A heuristic algorithm for the vehicle dispatch problem”, Operations Research 22, 340–349. Glover Fred, “Future paths for integer programming and links to artificial intelligence”, Computers & Operations Research 13, 533–549. Glover Fred and Laguna Manuel (1997). “Tabu Search”, Kluwer Academic Publishers, Norwell, MA, USA. Second edition. Goss Simon, Aron Serge, Deneubourg Jean L. and Pasteels Jacques M. (1989). “Self-organized shortcuts in the Argentine ant”, Naturwissenschaften 76, 579– 581. Hadjiconstantinou Eleni, Christofides Nicos and Mingozzi Aristide (1995). “A new exact algorithm for the vehicle routing problem based on q-paths and k -shortest paths relaxations ”, Annals of Operations Research 61, 21–43. Lenstra Jan K. and Rinnooy Kan Alexander H.G. (1981). “Complexity of vehicle routing and scheduling problems”, Networks 11, 221–228. Lin Shen (1965). “Computer solutions of the traveling salesman problem”, Bell Systems Technology Journal 44, 2245-2269. Pellegrini Paola (2005). “Application of two nearest neighbor approaches to a rich vehicle routing problem”, TR/IRIDIA/2005-15, IRIDIA, Universit´e Libre de Bruxelles, Brussels, Belgium. Pellegrini Paola and Birattari Mauro (2005). “Instances generator for the vehicle routing problem with stochastic demand”, TR/IRIDIA/2005-10, Universit´e Libre de Bruxelles, Brussels, Belgium.

30

Potvin Jean-Yves, Dub´e Danny and Robillard Christian (1996).“A hibrid approach to vehicle routing using neural networks and genetic algorithms”, Applied Intelligence 6, 241–252. Solomon Marius M. (1987). “Algorithms for the vehicle routing and scheduling problem with time window constraints”, Operation Research 35, 254-265. Stewart William R. Jr and Golden Bruce L. (1984).“A lagrangean relaxation heuristic for vehicle routing”, European Journal of Operational Research 15, 84–88. St¨ utzle Thomas and Hoos Holgers H. (1997).“The MAX–MIN Ant System and local search for the traveling salesman problem”, In B¨ack Thomas, Michalewicz Zbigniew and Yao Xin (Eds.) Proceedings of the 1997 IEEE International Conference on Evolutionary Computation (ICEC’97), 309–314, IEEE Press, Piscataway, NJ, USA. Toth Paolo and Vigo Daniele (2002). “The Vehicle Routing Problem”, SIAM monographs on discrete matemathics and applications, Philadelphia, PA, USA. Zlochin Mark, Birattari Mauro, Meuleau Nicolas and Dorigo Marco (2004). “Model-based search for combinatorial optimization: A critical survey.” Annals of Operations Research 131, 373–395.

31