A Memetic Algorithm for the Capacitated Location-Routing Problem

In this paper, a hybrid genetic algorithm is proposed to solve a Capacitated Location-Routing Problem. The objective is to minimize the total cost of the distribution in a network composed of depots and customers, both depots and vehicles have limited capacities, each depot has a homogenous vehicle fleet and customers’ demands are known and must be satisfied. Solving this problem involves making strategic decisions such as the location of depots, as well as tactical and operational decisions which include assigning customers to the opened depots and organization of the vehicle routing. To evaluate the performance of the proposed algorithm, its results are compared to those obtained by a greedy randomized adaptive search procedure, computational results shows that the algorithm gave good quality solutions. Keywords—hybrid genetic algorithm; capacitated locationrouting problem; location; assigning; vehicle routing


INTRODUCTION
Managing distribution is one of the most challenging problems for companies that aim to minimize the costs of their activities and meet the customers' needs in an environment where the competitiveness continues to increase.
Location problems and routing problems have long been treated separately, combining these two problems is the location and routing problem (LRP) whose objective is to optimize the costs of the distribution in a logistic network in taking strategic decisions that relate to the location of facilities, and allocation and organization of vehicle routing which are solved at the tactical and operational levels.
Salhi and Rand highlight the importance of tackling both problems simultaneously and the effect of ignoring routes when locating depots [1].There are different formulations of the LRP, some consider depots and vehicles with limited capacities [2], while others, such as List and Mirchandani [3], offer formulations without capacity constraints.Wu et al. [4] have considered constraints on the vehicles and formulated a model for LRP with limited heterogeneous fleet, and Liu and Lee included inventory costs in LRP [5].The reader is referred to the survey by Nagy and Salhi [6] for more LRP variants.
Exact methods have been proposed to solve the Capacitated Location-Routing Problem (CLRP), Laporte et al. [7] solved the problem through a branching method based on the relaxation of subtour elimination and the chain baring constraints, Baldacci et al. [8] and Contardo et al. [9] found good quality solutions to the LRP using exact methods ; Baldacci Proposed a branch and price algorithm and Contardo developed an algorithm based on cut-and-column generation for the CLRP.Prins et al. [10] solved the CLRP with a Greedy Randomised Adaptive Search Procedure (GRASP) followed by a path relinking algorithm and Duhamel et al. [11] proposed a GRASP hybridized with Evolutionary local search (GRASP X ELS) while Ting et al. [12] proposed a multiple ant colony optimization algorithm.Prodhon [13] presented a survey on the CLRP methods of resolution and other variants of the LRP.Our point of focus in this paper is on the evolutionary algorithms that are presented in the sequel.
Genetic algorithms have been proposed for the first time by J. Holland (1962), and then developed by D. Goldberg (1989), they are inspired by the natural evolution in genetics, where a population of individuals represents a set of solutions, an individual is represented by a chromosome and each chromosome contains genes.
Genetic algorithms have been successfully applied to the resolution of combinatorial optimization problems, several algorithms have been developed; Potvin [14] have presented a genetic algorithm for the Traveling Salesman Problem (TSP), Zhao [15] proposed a hybrid genetic algorithm to solve a TSP with pickup and delivery, while Prins [16] have presented an efficient genetic algorithm to solve the vehicle routing problem (VRP), Vidal et al. [17] have also used genetic algorithm to solve a multi-depot and periodic vehicle routing problem.For an overview of genetic algorithms, Reeves' book [18] is a good reference.
The first step of a genetic algorithm is to initialize the population and represent it in the form of chromosomes.The first generation is often randomly generated.The second step is to assess the individuals of a population in order to measure the goodness of each solution and select them according to their fitness in order to enable the best chromosomes to survive, then comes the stage of the crossover which involves crossing two chromosomes parents in order to obtain one or two new children called offspring.An offspring is better than the parents if it takes the better part of each.After the crossover, a mutation can be applied to the obtained children in order to prevent a premature convergence of the algorithm.In the incremental mode, only two parents breed and their children www.ijacsa.thesai.orgare integrated in the current population, while in the generational mode, each iteration reproduces all the children who will be the next generation.
Genetic algorithms provide results of good qualities but hybridized with a local search, the results are better, the two methods complement each other; the first explores the different regions of the search space while the other exploits it intensively [19].Local research is a powerful means to obtain quality solutions for optimization problems, it allows improving a solution by exploring its neighborhood, the latter is obtained by applying transformations to the solution, the best solution of this neighborhood is called a local minimum.
Genetic Algorithms hybridised to a local search are called Memetic algorithms.they have been introduced by Moscato in 1989 [19], they have led to excellent results for different problems, Krasnogor and Smith [20] have reviewed some applications of memetic algorithms to well known combinatorial optimization problems and Neri and Cotta have presented a literature review of these algorithms [21].Various memetic algorithms have been developed for routing problems; Freizleben and Mertz [22] used it to solve the TSP, Cattaruzza et al. [23] for the multi-trip vehicle routing, Mendoza et al. [24] for the multi-compartment vehicle routing problem with stochastic demands, Prins [25] and Lima et al. [26] have proposed memetic algorithms to solve heterogenous fleet vehicle routing problem.The most recent method has been proposed by Sörensen and Sevaux [27], it is a memetic algorithm with population management (MA/PM) that defines a measure of distance in order to diversify the chromosomes parents of the algorithm.This paper aims to solve a capacitated location routing problem while minimizing the total cost which includes the depots opening cost, the vehicles cost of use and the routing cost using a memetic algorithm.The paper is organized as follows: Section II describes the problem, the algorithm and its components are presented in Section III, Section IV provides the parameters used and computational experiments and some concluding remarks are presented in Section V.

II. PROBLEM DESCRIPTION
In this paper a capacitated location routing problem is treated.Let ( , , )  is the set of arcs linking the different nodes in the graph and Each customer j has a demand j d which must be satisfied.A vehicle can serve multiple customers during his tour but a customer is served by only one vehicle.Each vehicle returns to its depot of departure after the last visited customer.We assume that the overall capacity of the depots satisfies the demand of all customers and that the request of a customer does not exceed the capacity of a vehicle.The objective is to minimize the total cost which is the sum of the depots opening costs and the routing costs while responding to all the customers' requests.

III. A MEMETICALGORITHM FOR THE CLRP
In order to solve this problem, a memetic algorithm is proposed, this section includes the details of its different components.

A. Initial population
The initial population is obtained using a constructive algorithm based on the principle of the Nearest Neighbor Search (NNS), depots to be opened are randomly selected, which allows the exploration of the solutions space.In the sequel, Ct represents the solution cost, the variables i x and ijm y take respectively the value 1 if the depot i is open and if the customer j is served by the depot i via the vehicle im v , 0 otherwise.Fig. 1. presents the steps of the proposed algorithm, it starts by opening a depot selected in a random way, as long as its capacity allows, the closest customer to the last visited node which is not yet served is assigned to it, once the depot capacity no longer allows to provide customers, the approach is reiterated and another depot is opened until all customers are affected.
Note: During the initialization of the population, it is necessary to check that there are no clones, in case two chromosomes have equal costs, one of them is deleted and replaced by another one selected randomly.

B. Solution encoding
Solutions encoding is an important step that can influence the performance of genetic algorithms, in the proposed algorithm, the encoding method proposed by Prins [28]  ) then return the initial solution

C. Selection and crossover
The first parent is selected using the binary tournament method on half of the best individuals of the population, the second also is chosen with this method but this time on the whole population except the first chosen parent.A single child is kept randomly, it gives better results than keeping the best one or both.
Crossover for the depots sequence acts as on a sequence of binary (one crossover point), a cut-off point is randomly chosen between 1 and 1 d l  where d l is the length of the depot sequence.The depot part of the child consists of the left part before the cut point of the first parent and the right part after the cut point of the second parent.The classical order crossover (OX) is used to obtain the customers sequence, two cut points p and q are chosen randomly, such as 1 1 c p q l  , where c l is length of the customers sequence.The part between the two cut points of the first parent is copied in the same order and in the same position in the child chromosome, then the latter is supplemented by scanning the genes of the second parent from the position 1 q  up to c l , then from the position 1 up to q and copying each element not yet in the child.

D. Chromosome repair
After the crossover, it is necessary to check that the chromosome obtained is valid, we begin by verifying that all customers have been assigned, it is sufficient to check the existence of 1 in the depots sequence, it is also necessary to verify that the depots capacities have been respected, if this is not the case, customers should be removed one by one from such a the depot and assigned to the nearest one whose capacity allows, until all depots capacities are respected.If none of the opened depots allows it, a closed depot is opened.Fig. 4. describes the repair procedure steps.Variables i C and i Sd represent respectively the set of customers assigned to a depot i and the sum of customers assigned to this depot demands.The function ( , ) Close j E returns the index of the nearest node to j in a set of nodes E .

E. Solution cost
In order to obtain a solution cost, the procedure presented in Fig. 5. is proposed, it also allows deducing the vehicle routing organization; For each depot, as long as the capacity of the vehicle allows, the closest customer to the last one of the tour is added, once no more customers can be added, the vehicle returns to the depot, and another tour begins via another vehicle of the same depot fleet, it begins from the nearest customer of the depot which is not yet visited.This procedure allows to obtain and to optimize the depots opening costs and the routing costs.The function

 
, im Add T j adds the node j at the end of the tour im T via the vehicle im v .

Procedure: SolCost
Return the total cost of the solution, Ct

F. Local search
The Local Search allows improving a solution by exploring its neighborhood, for this, four movements are used and presented in the sequel, each is illustrated by an example.The movements are applied to customers that can belong to the same tour or from different tours.Tours can belong to the same depot or to different ones, for each case the constraints are presented.Fig. 10.describes the steps of the procedure, the neighborhood of a solution is explored and the procedure returns the best solution and its cost.
In the sequel, S is a solution, i Sd is the sum of demands that provides the depot i and im Qt is the amount transported during a tour via the vehicle im v RouteTrans ( , , ', ) S i i m : a random tour im T is transferred from its current depot i to the best opened one ' i .Constraint (1) ensures that the capacity of the depot to which a tour is transferred is respected.
Sd Qt  (1) www.ijacsa.thesai.orgS i i m m j j : a customer j , randomly selected, is transferred from its current position in a tour m to another position after a node ' j in a tour ' m that may be in the same route (' ii  and ') mm  in another one from the same depot (' ii  and ') mm  or from another route from another depot (' ii  and ') mm  . Constraints (2) and (3) ensure that both capacities of the vehicle and the depot, to which a customer is transferred, are respected.S i m m j j : the edges incoming to nodes j and ' j are deleted and two new edges are created, tours begin from the same depot i and edges may be in the same tour ( ') mm  or in different tours ( ') mm  . Constraints ( 8)-( 11) ensure that both capacities of the new tours' vehicles and their departure depots are respected.

G. The memetic algorithm
The memetic algorithm is obtained by gathering the components previously presented, it starts with generating an initial population using GenInitialSol procedure, a maximum number of generations max gen is fixed , as long as the latter is not reached the selection and the crossover are repeated, each child obtained is repaired with ChromRepair procedure, if it does not already belong to the population it is improved using LocalSearch procedure with a probability ls p and replaces the worst element of the population, once max gen is reached, the procedure returns the best solution of the last obtained population.The Local Search is applied only once to each offspring, which allows exploring its neighborhood, applying it several times would take a lot of time and would lead to the local optimum.Table .1. Provides a comparison between the results obtained by the proposed memetic algorithm and those obtained by the GRASP proposed by Prodhon, Podhon's set consists of 30 instances, results are given on average by instances size.For each case, the number of depots to open, the number of tours and the solution cost are presented.The gap between the two algorithms is obtained by calculating [(MA cost -GRASP cost)/ GRASP cost]*100.As shown in the table, good quality solutions are obtained by MA, it presents a gain in term of cost which is in average of 1.08%.The best improvements have been obtained for the large sizes where the gain reaches 2.73%.Both MA and GRASP returns the same number of depots to be opened, MA uses one less vehicle on certain instances from 100 customers, costs are reduced thanks to the opened depots location and not to their number, MA provides access to diverse solutions of good quality, which allows obtaining lower cost solutions.www.ijacsa.thesai.orgV. CONCLUSION This paper treats a location-routing problem where both potential depots and vehicles have limited capacities.A memetic algorithm is developed to solve the problem which objectives are to minimize the total cost of distribution and meet the customers' needs.The algorithm is tested on instances of the literature and compared to a GRASP.The proposed algorithm provides obtaining good quality solutions, it may be used to obtain a good initial solution to exact methods.

where ijc
is the cost of the trip via the arc   , ij .Each depot i has a limited capacity i Cap , a fixed cost of opening i O and a homogeneous fleet i F of vehicles im v of a capacity im cpv and a cost of use im vc .There is no limit on the number of vehicles.

Fig. 1 ..Fig. 2 .
Fig.1.The procedure to generate an initial solution solution is represented as a chromosome, the latter indicates the status of the depots as well as the allocation of customers to opened depots.Each chromosome consists of two sequences, the first relates to the depots and the other to the customers, there is no trip delimiter.If a gene of the depots sequence is zero, this means that the depot is closed, otherwise it contains the index of the first customer assigned to it.The customers sequence is a concatenation of trips.For each chromosome S, vectors ds and cs represent respectively the depots and the customers sequences.Fig. 2. represents an example of a chromosome, the depot 2 is closed because (2) 0 ds  , the depot 1 is open, the set of customers affected to it is 1 {1, 2,3, 4} C  , this sequence begins with the first customer assigned to the depot and ends by the one just before the first customer assigned to another opened depot, depot 3 is also open and the set of customers affected to it is 3 {5,6,7,8,9,10} C  .

Fig. 5 .
Fig. 5.The procedure to obtain a solution cost

Fig. 7 .Fig. 8 .
Fig. 7. Example of a CustTrans operator CustSwap ( , , ', , ', , ') S i i m m j j : two customers randomly selected j and ' j are exchanged, they may be in the same route ( ') mm  or in different routes ( ') mm  from the same depot ( ') ii  or different depots ( ') ii  .Constraints (4)-(7) ensure that both capacities of the vehicles and the depots, to which customers are transferred are respected.

TABLE I .
COMPUTATIONAL RESULTS OF THE MEMETIC ALGORITHM