A Metaheuristic ACO to Solve the Multi-Depot Vehicle Routing Problem with Backhauls

In this paper, a metaheuristic algorithm based on the ant colony optimization is presented to solve the multi-depot vehicle routing problem with delivery and collection of package. Each performed route consists of one sub-route in which only the delivery task is done, in addition to one sub-route in which only the collection process is performed. The proposed algorithm tries to find the best order to visit the customers at each performed route. In addition, the proposed approach determines the best connection between the sub-routes of delivery and collection, in order to obtain a global solution with the minimum travelling cost. The efficiency of the proposed algorithm has been evaluated by considering a set of instances adapted from the literature. The computational results have been compared with a greedy heuristic algorithm based on the nearest neighborhood approach. Finally, conclusions and suggestions for future works are presented.


INTRODUCTION
The transportation and logistics companies are facing demanding situations with fewer resources.Currently, an important aspect is to optimize the use of existing resources in order to perform specific tasks.Many of these tasks in real-world problems can be solved by a network representation containing nodes, connections, variables, parameters, and their interactions.In recent decades, there have been various proposals for solving vehicle routing problems with backhauls by considering only capacity constraints.Toth and Vigo [1] propose the first approach to the formulation of a vehicle routing problem based on a fuel distribution problem.In Clarke and Wright [2], the first effective heuristic algorithm for solving the Capacity Vehicle Routing Problem (CVRP) is proposed.This method starts with a set of vehicles located at the depot.Some of these vehicles are selected to deliver the cargo to the customers through predefined routes.Then, two routes are selected iteratively in order to determine if a lower distance can be generated as a consequence of merging them.In this case, the routes are merged to create a route that will be attended by only one vehicle.In all possible scenarios, the capacity of the vehicle must be ensured.The Multiple-Depot Vehicle Routing Problem with Backhauls (MDVRPB) could be defined as follows: Given two sets of predefined customers, where is the set of Linehaul customers (customers to be delivered products), and the set of Backhaul customers (customers to be collected products).In addition, given a set of geographically dispersed depots; the objective is to consider the routes to be performed from the selected depots to the customers by a fleet of homogeneous vehicles in order to satisfy the demand of the customers (products to be collected or products to be delivered).In such case, the vehicles must attend first the customers with delivery requirements before the customers with collection requirements.The features of the customers, depots and vehicles, as well as the different operating constraints on the performed routes, leads to different variants of the problem: The Vehicle routing Problem with Backhaul (VRPB) in which only one depot is considered, the IJIEM Mixed Vehicle routing Problem with Backhaul (MVRPB) in which a fleet of homogeneous capacity vehicles is concerned, and the VRPB with time windows (VRPBTW) in which the expected time to serve the clients is constrained.The MDVRPB is considered as NP-hard, and has not been deeply explored in the literature.The variants of the MDVRPB can be classified into three categories: (i) simultaneous collecting and dispatching of products; (ii) collecting first, following the delivery of products; and (iii) collecting after of the delivering process.Recently, several algorithms have been proposed to solve the VRPB.In [1], an exact model for the formulation of the VRPB in a fuel distribution scenario is proposed.The first heuristic algorithm for VRPB has been proposed by Deif and Bodin [3].This algorithm is an extension of the known method of saving method proposed by Clarke and Wright [2].The algorithm starts with a feasible solution, where each customer is visited by a different route.Then, the routes are combined iteratively by considering the possible reduction in the objective function, i.e. the traveling cost of the route that can be achieved by serving different type of customers with the same vehicle.The results show that the evolution of the algorithm is affected by the constraint of precedence of customers with delivery requirements.This fact substantially reduces the number of feasible links between different types of customers.Deif and Bodin [3] experimentally show that the best results are obtained when mixed routes are initially constructed.Therefore, [3] propose a modification of definition of savings in order to penalize the edges connecting customers of different types.Thus, avoiding the union of backhauling customers at the end of the algorithm.The savings generates with the use of the edge 'is defined in equation ( 1). ( Where is an estimate of the maximum savings between a Linehaul customer ( ) and a Backhaul customer ( ), and is a penalty factor set to .Deif and Bodin in [3] have tested the proposed algorithm on cases randomly generated with instances between 100 and 300 customers, and a percentage of backhaul customers among 10% to 50% of the total of customers.The Multi Depot Vehicle Routing Problem with Backhauls (MDVRPB) is an extension of the wellknown VRPB by considering several depots, which are not necessarily used.Salhi and Nagy [4] propose a heuristic approach to solve the MDVRPB.The algorithm is based on the idea of "Border Customers", defined as the customers geographically located in a middle point between two depots.Min [5] introduced the MDVRPB by considering collection process after delivery of products.
A unified heuristic for different vehicle routing problems with backhaul is presented in [6].In this work, the version of mixed pickup and delivery with multiple depots is considered.Two algorithms based on ant colony for the multi depot vehicle routing problem with multiple depots and mixed pickup and delivery are presented in [7]- [8].Finally, genetic algorithms for solving the MDVRPB have been proposed by Chunyu & Xiaobo [9] and Chunyu [10].This paper proposes an algorithm based on an Ant Colony System to solve the MDVRPB with collection of products exclusively after delivery of products.The efficiency of the proposed algorithm has been compared in 33 instances taken from the literature, proposed by Salhi and Nagy [4].These instances have been used to test the two first categories of the MDVRPB (simultaneous collecting and dispatching of products and collecting first, following the delivery of products).However, there is no relevant literature on the subject of the variant solution of collecting products after of the delivering process.Therefore, for comparison purposes, we have implemented a greedy algorithm based on the nearest neighbor idea.The paper is organized as follows: Section 2 provides a brief description of the MDVRRPB.Section 3 shows described the metaheuristic Ant Colony System.In Section 4, the proposed algorithm is introduced.Finally, in Sections 5 and 6, we present the analysis of computational results and the conclusions for future research, respectively.

PROBLEM STATEMENT
The vehicle routing problem with Backhaul, is an extension of the well-known VRP involving demand nodes and collection of products [1].The VRPB can be defined as the problem of determining a set of routes to visit every customer concerning the following constrains: each vehicle develops a single route; each route starts and ends at the depot; the routes must firstly deliver products to customers defined as Linehaul, and finally pick up products from customers defined as Backhaul.The MDVRPB is an extension of VRPB by considering potential depots from which we can generate different routes.In the MDVRPB all deposits are not necessarily used.The MDVRPB can be formulated as a Graph Theory Problem.Let be a complete undirected graph, where is the set of vertices, and is the set of arcs.The set is partitioned into two subsets: the set of customers , and the set of potential depots .Additionally, the set is divided into a subset of Linehaul nodes (Linehaul customers - ), and the Backhaul nodes (Backhaul customers -).Therefore, .Each customer has a nonnegative amount of product to be delivered or to be picked up . Each depot has a fictitious demand, i.e. , with . A set of identical vehicles with a given capacity is initially placed at each depot.It must be clarified that all vehicles are not necessarily used.For each edge merging the vertices with the vertices , a nonnegative cost is associated, where for each arc .As the symmetrical condition is assumed, for each arc we assume that = , where .The main goal of the MDVRPB is to find the minimum cost (traveled distance) of routes, where the following conditions must be satisfied: a) Each vehicle must start from a depot , and return to the same depot ; b) Each customer must be visited exactly once.c) The sum of the demands of customers belonging to a determined route must not exceed the vehicle capacity ; d) For each performed route, the Linehaul customers must precede the Backhaul customers in the sequence; e) The flow between depots is not allowed.f) The objective is to minimize the total traveled distance, defined as the sum of the costs of the arcs belonging to the performed routes.[1] A mathematical model for the MDVRPB has been introduced in [11].The objective function is calculated as the minimization of the total traveled distance by the performed routes (1).So, the binary variable is set to 1 when the vehicle passes by the edge .
Otherwise is set to 0 (2) (5) Equations ( 2) constrain that a single vehicle visits each customer once.Additionally, the set of equations ( 3) impose the flow constraints for each customer.Each performed route must be started and finished at the same depot (4).The capacity of the vehicles is constrained by equations ( 5) and ( 6) for linehaul and backhaul customers, respectively.Finally, linehaul customers must be addressed before the backhaul customers (7).Solving the mathematical model ( 1) -( 7) by exact methods, the computational time grows exponentially as the number of vertices V is increased.For this reason, metaheuristic algorithms based on Ant Colony System appear as an alternative for the solution of MDVRPB.

METAHEURÍSTIC ALGORITHM BASED ON ANT COLONY SYSTEM
The Ant Colony metaheuristic is based on the natural behavior of ants searching food.The logical tendency of each ant is to reduce the effort and time required to gather food.This goal is achieved by reducing the distance between two specific points for collecting food.
The ants are individuals with relatively simple features.However, they perform highly complex work in a simple way.The success lies in the interaction of many individuals with the environment and by indirect communication between them through chemicals substances called pheromones [12].This behavior is emulated in artificial intelligence to find good quality solutions to optimization problems characterized by a wide space of solutions.The concept makes the equivalence between the natural ant colony and the artificial system moving within a computational environment [12].

Selecting arcs
The proposed algorithm interprets an ant as the emulation of a vehicle in the process of performing its route.An artificial ant begins its travel from a depot selected randomly to a first customer.The decision of the next client to be visited is based on heuristic preferences biased by the distance among nodes and the emulation of the natural pheromone.
A probabilistic transition rule defines the likelihood that the ant (one ant for each available vehicle), placed at node , decides to move to the node (selecting the arc The rule is defined according to the equation ( 8).(8) Where is the amount of pheromone on the edge , and is the heuristic information of , i.e. the distance to travel from the node i to the node j.The level of importance on the rule decision from both the heuristic information and the amount of pheromone is given by parameters and , respectively.Generally, these parameters must have optimized at an off-line process.Finally, is the set of neighborhood IJIEM nodes of node i, which have not visited yet by the ant .

Setting of parameters and
In particular, if the nearest nodes have more probability to be selected (well-known algorithm of the gradient with multiple starting points).If only the level of pheromone is considered, generally obtaining solutions with low quality, especially if .Indeed, this case causes a stagnation of an algorithm, because all the ants follow the same way generating sub optimal solutions.A proper update pheromone matrix directly impacts the diversity in decision-making process by an ant for the following arcs.We have considered that when an ant travels by an arc a certain level of pheromone is deposited, which is evaporated with the time.
In particular, an additional positive feedback of the amount of pheromone is used to reinforce future components of good solutions.For a better solution, more pheromone is provided at its arcs.The equation ( 9) determines the rule for increasing the quantity of pheromone, where is the amount of pheromone deposited at the arcs visited by the ant k, where is the total cost of the solution generated by the ant k, i.e., the total distance of the route developed by the vehicle k.The arcs visited by the entire ants in the current solution will receive an extra contribution of pheromone.(9) In addition, pheromone evaporation is used to prevent an unlimited increasing of pheromone trails and to forget low quality solutions.The evaporation level is the same for all pheromone trails, eliminating a predefined percentage of the current value for each arc through a predefined rate ρ, with 0 ≤ ρ ≤ 1.Thus, the evaporation mechanism could exhibit a behavior more active than the presented in natural environments.The equation (10) describes the general rule for updating the pheromone matrix at the edge , at the iteration t. (10)

Ant System (AS)
In the ant system algorithm, an artificial colony of ants cooperate to find good solutions for discrete, static, and dynamic combinatorial optimization problems.Three different variants for the AS have been proposed: Ant-Density, Ant-Quantity and Ant-Cycle [13].In the first two variants, the pheromone updating process is performed after each selection arc process, while in the third variant (Ant-Cycle), the amount of pheromone is only updated once the ants have completed the entire routes.The first two versions generally obtain worse results than the third variant [13].Therefore, we consider the process for updating the pheromone by assigning a fixed amount of pheromone at each iteration.The equation ( 11) is generally used to determine this value, where is the number of ants, i.e. the number of alternative of solutions, and is the tour length obtained at the construct solution procedure. (11)

Encoding Solution
The problem of MDVRPB is solved by an ant colony algorithm [13].Then, the implemented encoding is presented.The distance matrix is constructed from the coordinates of the vertices, i.e. the matrix contains the Euclidean distances among depots and customers.In order to improve the efficiency in the search process, the information is arranged in a redundant way.So, the Figure 1 shows the distance matrix is a threedimensional array with dimensions .It is shown that this matrix can be understood as a set of submatrix each one dedicated to a particular depot.At any submatrix, the element represents the cost for travel through the edge merging the customer i with the customer j.In the plane corresponding to the distances between customers, for each deposit, the diagonal is greater as possible, and the no diagonal values are symmetrical.The Figure 1 sketches the structure of the distance matrix.The Visibility Matrix is obtained from each element of the matrix elements of distances.It contains the inverse of the distance.This matrix is not modified during the execution of the algorithm and it is symmetrical.Again, each plane corresponds to a particular depot, and its diagonal is high enough.The Linehaul and Backhaul customers use the same representation because the algorithm identifies the delivery or pick up of products (Figure 2).Finally, we proceed to generate the pheromone matrix with all positions initialized with the same amount of pheromone.As shown in the Figure 3, all the elements at the diagonal are zero, and it is initially a symmetric matrix.Their values are generated with the equation (11), and the updating process is restricted to thus elements in the route traveled by each ant.Note that the proposed algorithm not considers the distance among depots, since these distances should not be considered in the distance of the performed routes.Indeed, the algorithm uses a new vehicle to continue visiting other customers.Therefore, the visibility matrix or net matrix is replaced by a squared array of random values that provides diversity in the searching of the new depot to be aggregated to the solution.The total number of depots gives the dimension of the visibility matrix, and its values are IJIEM initialized using the equation (11).The nodes are updated only if they belonging to the route traveled by a vehicle.In addition, a vector of not visited customers is required.It contains the feasible customers to be selected.Initially, it contains Linehaul customers, and each selected customer is removed from the vector.The first element of the vector is 1, and the final element is set to the total number Linehaul customers ( ).Similarly, it is needed a vector for Backhaul not visited customers.It starts with the total Backhaul customers ( ).When a feasible customer is selected, it is removed from the vector.The first element of vector for Backhaul not visited customers is the total number of Linehaul customers + 1, and the final element is set to total number or customers ( ).The solution vector is also required.Its first element is set to the number of a depot, which is randomly selected.It is followed by a sequence of customer until a new depot has been selected again.This shape is continued until the entire customers have been selected.However, at each sequence of customers, a Linehaul customer must not appear between two Backhaul customers, and vice versa.Additionally, the Backhaul customers are visited before the Linehaul customers.The Figure 4 shows an example of a route of the proposed solution.The process to construct an alternative of solution is repeated until the population of the algorithm is complete.The number of the ants to create is a parameter to be established by an off-line process.Finally, an array stores the solution vectors found by different ants.This array represents the population matrix, for which every row is able to store only one alternative of solution found by an ant.The number of rows is the number of iterations by the number of depots and the number of columns is at least the number of customers plus the number of depots to satisfy the collections and delivery of products.In the Figure 5, a set of alternative of solutions is shown.At this example, there are three (3) depots, four (4) Linehaul customers, and three (3) Backhaul customers.

Types of constructed routes
Let us define the total number of depots as m: i.e.
, the total number of linehaul customers as nl: L 1 , L 2 , ..., L nl and the number of backhaul customers as nb: B1, B2, ..., B nb .As a example, the proposed algorithm performs the following routes for a system with three (3) depots: M 1 , M 2 and M 3 ; with seven (7) linehaul customers: L 1 , L 2 , L 3 , L 4 , L 5 , L 6 and L 7 ; and seven (7) backhaul customers: B 1 , B 2 , B 3 , B 4 , B 5 , B 6 and B 7 .We can consider the following types of routes:  A linehaul -backhaul route.The Figure 6 describes this type of route.Its main feature is that both the linehaul sequence and the backhaul sequence are reaching the capacity of the vehicle.The performed route is  A single linehaul route.This route contains only linehaul customers.This route is shown in the Figure 7.The performed route is M 1 -L 4 -L 2 -L 3 -L 5 -M 1 (Figure 7). A single backhaul route.This type of route is depicted in the Figure 8.It contains only backhaul customers.The performed route is The alternative of solution is conformed as a combination of the possible types of routes.In the proposed algorithm, the construction of a multi-depot solution requires that the ant performs as many subroutes as needed to visit all the customers, and each sub-route comprises a tour considering linehaul and backhaul customers.A possible alternative of solution is shown in the Figure 9.The dashed line represents the entire tour performed by the ant, and it is equivalent to an alternative of solution.

Instances
The proposed algorithm has been evaluated in 33 instances MDVRPB described by Salhi and Nagy [5].The respective set has a diverse number of Linehaul and Backhaul customers (from 50 to 250), a number of depots is between 2-5, and a homogeneous set of vehicles is considered.Euclidean distance for each arc is performed.The set of benchmark instances has been used to solve the problem of allowing MDVRPB percentages in the delivery and pickup of 10%, 25% and 50% (Salhi and Nagy [5] and Ropke and Pisinger [6]).However in the reviewed literature, there is not found papers that solve the problem MDVRPB with Backhauls at the end of the routes.Therefore, we have implemented a simple greedy heuristic based on the IJIEM nearest neighborhood in order to make a comparison with the proposed approach.

Description of the Greedy algorithm
The greedy algorithm is a constructive approach based on the nearest neighbor, i.e. the lower distance to the current location.Hence, starting from a particular depot, the route in construction receives the customer with the lower distance to the depot among the customers not assigned yet.This rule is sequentially repeated, but the current location regards a last customer added to the solution.So, the feasible customer is evaluated through the distance to the last customer in the route in consideration.When a backhaul customer is added to the solution, the next location cannot be a linehaul customer, and only backhaul customers are considered, as well as coming back to the initial depot.A random decision determines whether the next route will be started from the current depot, or at other depot.At each case, the procedure described before is repeated.The overall process is executed until all customers had been attended.

Obtained Results
The proposed algorithm has been implemented in MatLab, and computational experiments have been run on a PC with Core i5 1.4 GHz processor and 8GB of RAM.The Table 1 shows the obtained results in comparison with the heuristic nearest neighborhood.We report the computing time and the values reached by the metaheuristic objective proposed.The algorithm has been executed for 10 runs over 100 iterations, reporting the average results and the best results of all runs.

CONCLUDING REMARKS
In this paper, an effective algorithm for the Multi-Depot Vehicle Routing Problem with Backhauls (MDVRPB) is proposed.The development of the proposed algorithm has been evaluated by considering benchmarking instances proposed in the literature.However comparison of the results obtained have been performed with a simple heuristic based on the nearest neighborhood due to that there is not algorithms in the literature that have considered the same variant of the problem.Computational results show the proposed algorithm is capable of producing, within short computational times, several solutions of high quality.In fact, the former algorithm exceeds the results obtained by the greedy heuristic based on the nearest neighborhood in an 19.01%.The results suggest that the proposed algorithm could be applied to other routing problems such as the Multi Depot Vehicle Routing Problem (MDVRP), the Periodic Location Routing Problem (PLRP), the Muti-Depot Vehicle Routing Problem with Heterogeneous Fleet (HMDVRP), among others.

Figure 1 .
Figure 1.Encoding of the distance matrix.

Table 1 .
Obtained results over 10 executions with 100 iterations of the proposed algorithm