An efficient improvement of ant colony system algorithm for handling capacity vehicle routing problem

Article history: Received November 1


Introduction
In recent years, logistic distribution has become the main activity in logistic management. Capacitated vehicle routing problem (CVRP) is an appropriate model for logistic distribution (Puerta et al., 2015). The CVRP fills an important role in decreasing the costs of transportation in logistic distribution and it is considered as one of the most important combinatorial optimization problems. In this problem, a group of customers with various demands are located in a graph. The vehicle that delivers service to the customers is programmed to get one or more objectives when its route satisfies the needs of customers along the routes (Prins, 2004;Puerta et al., 2015;Uher et al., 2016). The classical CVRP includes determining minimum-cost paths for a set of homogeneous vehicles located in a depot to deliver services to customers that are geographically scattered. These services may be delivery goods, pick-up and delivery of students, or gather the packets to deliver incoming emails, etc. (Hosseinabadi et al., 2017;Balas, 2017).
The CVRP, which is an extension of the Traveling Salesman Problem (TSP), has many applications in real-world high transportation cost in commerce such as transferring waste materials, collection and delivery of goods, school bus routing, street cleaning, etc. The CVRP has taken much attention because of its importance and complexity and the multitude of applications of a daily nature, Theoretically, the CVRP of NP-hard is an extension of previous studies, a major area of research in optimization research, and practically, most of the theoretical results consequent from the study of capacitated vehicle routing problem of a daily nature, which uses optimal solution methods, have been used in different fields such as industry, logistic services, and play an important role in strategic decision-making (Janjarassuk & Masuchun, 2016;de Araujo Lima et al., 2018).
The CVRP plays an important role because the optimal solution to this problem might be critical in many real applications in the areas of transportation and distribution, and it has been largely studied because of the interest in its applications in logistics and supply-chain management of several companies that are involved with the transportation of goods or people. This problem is regularly faced by the distribution systems of these corporations and its solution quality may have direct implications on the logistic performance (Stodola et al., 2014;Kuo & Zulvia, 2017). Since the CVRP belongs to the NP-hard problems and due to its complexity no efficient exact algorithms exist for solving large-size instances with reasonable computational time. So, Most of the research efforts aimed at solving the CVRP have focused on many of heuristic and meta-heuristic algorithms are developed to get approximate solution of the CVRP, such as ant colony optimization (ACO) algorithm, simulated annealing (SA) algorithm, genetic algorithm (GA) and tabu search (TS) (Sun, 2017;Kheirkhahzadeh et al., 2009;Janjarassuk & Masuchun, 2016;Kuo & Zulvia, 2017;Boltužić, 2012).
The contribution of this paper is to suggested new improvements in the ACS algorithm by the ideas which were not suggested in the past in the literature review. This improvement seeks to achieve the objectives: To reduction the distance as long distances negatively affect the course of the process since it consumes a great time to visit all customers and (2) To carry out the improvement of the ACS algorithm on new data from the database of CVRP. The rest of this paper as follows: Section 2 presents a Mathematical model of Capacitated Vehicle Routing Problem (CVRP), while section 3 is associated with a Literature review, Methods have been introduced in section 4, section 5 includes the Computational Results, finally, the conclusion has been discussed in section 6.

Mathematical model of Capacitated Vehicle Routing Problem (CVRP)
CVRP is a well-known combination problem which falls into the category of NP-Hard problems (Yu et al., 2009), and it refers to a whole class of problems related to a set of routes for a fleet of vehicles where one or several depots must be determined for a number of geographically dispersed customers, and vehicles have the maximum load capacity. VRP and CVRP utilized similar approaches and the sole distinction is that there is a restriction in CVRP vehicle capability. CVRP is comparable to VRP if the entire customer's request for every route does not surpass the capacity of the vehicles. VRP and CVRP objectives are to reduce total cost of traveling (i.e., a weighted function of the number of vehicles and the travel distance of vehicles) to serve a set of customers with known demands. The route must be designed in such a way that each customer is visited once and by only one vehicle.
 CVRP classic version necessitates all customer demands information to be identified earlier.
 The uniformed vehicle fleet originates from one station only.  Each order must not be separated or served by more than one vehicle.
CVRP is defined as a problem of finding optimal route that visits a set of customers and satisfying the customer's demand with subject to several constraints. General components of CVRP are as the following: The mathematical model of the vehicle routing problem was first introduced by Dantzig and Ramser (1959) which is follows: subject to the following restrictions: where: Eq.
(2) represents the target trajectory that reduces the total distance traveled. Constraint (3) and (4) represent the degree of constraints. Constraint (5) expresses continuity to direct the postman to the roads imposed on each postman to visit and leave each node once. Constraint (6) indicates that customers' requests do not exceed the capacity of the postman and constraint (7) on the maximum length of the road. Constraints (8) and (9) guarantee each customer service once and through one postman departing and returning to the main distribution center. The constraint (10) is a binary constraint so that = 1 and = 0 otherwise.

Literature Review
The Vehicle Routing Problem (VRP) is a combinatorial optimization problem and it has been the subject of intensive and fast-growing research that has been studied in applied mathematics and computer science for decades due to their economic importance and their theoretical interest due to their economic importance and their theoretical interest. VRP is known to be a computationally difficult problem for which many exact and heuristic algorithms have been proposed but providing fast and reliable solutions is still a challenging task. In the simplest form of the VRP, every capacitated vehicle is responsible for delivering items to multiple customer nodes; the vehicle must return to the depot to pick up additional items when it runs out. The objective is to optimize a set of routes, all beginning and ending at a given node, called the depot, in order to attain the maximum possible reward, which is often the decreasing of the total vehicle distance or reduce the number of vehicles or average service time (Nazari et al., 2018;Vidal et al., 2019;Gayialis et al., 2019;Coelho et al., 2016). The issues were presented in VRP by reviewing the literature and that is not found an optimal solution for it until now, so the problem is considered open research. The vehicle routing problem is increasingly complex due to increased demand, government regulations, traffic congestion, environmental issues and other issues. VRP is one of the most widely studied topics in operations research and is a major transport problem (Koç & Çaʇri, 2016) and distance can be considered the most important workload (Nahum, 2019). It is necessary to develop and test appropriate methodologies that assess all aspects relevant to this context to get the minimum distance. As in many real world problems (Alaei & Setak, 2015;Lehuédé et al., 2018), one of the main issues in VRP is the number of vehicles that meet the requirements of all customers and although this problem has been studied for more than five decades, real applications remain a challenge due to the difficulty presented by VRP and its issues, including a reduction in the number of vehicles, which reduces the overall transportation costs of vehicles, derived from total fixed costs and it also reduces Fuel used and reduces damage CO2 to the environment, thus get efficient delivery and good service for customers (Dechampai et al., 2017;Gayialis, 2018;Syahputra et al., 2019).
Next issue to consider in VRP is to find the tour with minimum travel time to reduce travel costs between geographically dispersed customers as it depends on reducing the possible time intervals between customers to visit them depending on several factors and these factors affect the feasibility of the routing plan. Reducing the time required to cut the distance required for customer service helps reduce costs and fuel consumption (Nalepa & Blocho, 2016;He et al., 2018). One the other hand, fuel consumption is considered of the issues of the vehicle routing problem. VRP is characterized by the coordination of environmental and economic costs by implementing effective ways to meet environmental concerns and reduces energy consumption. Reducing fuel consumption reduces total cost and reduces environmental pollution from emissions of CO2 (Norouzi et al., 2017;Zhang et al., 2018). Finally, it is considered that CO2 is one of the issues of VRP where VRP seek to find the shortest tour that passes all the points exactly once, starting and ending at the same point with the consideration of additional targets functions that reduces carbon dioxide CO2 emissions and contaminants (Hosseini-Nasab & Lotfalian, 2017;Stellingwerf et al., 2018). The methods that have solved VRP are divided into two categories. The first category is called the exact algorithms and the second category is called the approximate algorithms. Exact algorithms as Branch and cut algorithm can solve the cases of small size within a reasonable time, although the ideal solutions to The Vehicle Routing Problem (VRP) that can be obtained by many the exact methods require a large and expensive computing time (Wu et al., 2016;Sun, 2017;Hameed et al., 2020). The inability of exact algorithms to solve many combinatorial optimization problems within a reasonable time has prompted researchers to develop approximate algorithms that attempt to overcome the difficulty of NP-hard problems (Golden et al., 2008;Sun, 2017). On other hand, the approximate algorithms have been divided into two category heuristic and meta-heuristic algorithms. The heuristic algorithms produce optimal approximation solutions that are good, practical and often fast at a reasonable time for large-scale cases. Thus, the use of these algorithms provides good solutions in a reasonable period of time but it is not effective in escaping from falling into the local optimization (Wang, 2016;Bouyahyiouy & Bellabdaoui, 2017). In recent decades, most research in recent decades has focused on the design of meta-heuristics algorithms that was more effective than classical extension algorithms and provides high-quality solutions to a variety of complex problems of a daily nature restricted for many years and it is effective in escaping from falling into the local optimization (Janjarassuk & Masuchun, 2016, Kuo & Zulvia, 2017Lu et al., 2017). Through the effort to analyze the study of literature review and to find a method to solve the problem, we found the category of swarm intelligence is the most appropriate which through it we can find the best solutions to the problem, especially when using ACO because it has advantages that correspond to the nature of the problem. The ACO is a swarm intelligence technique and a metaheuristic which is inspired by the behavior of real ants in their search for food. A colony is a population of simple, independent, and asynchronous agents that cooperate to find a good solution to the problem at hand. The ants in ACO are stochastic solution construction procedures that probabilistically and iteratively build complete solutions from smaller components. It is this cooperation on a colony level that gives the members of the ACO algorithm family their distinctive aver. The following is explanation what the different components do: Initialize: The parameters are set, and the pheromone variables are initialized to the value.

Construct Ant Solutions: A set of m ants constructs solutions. Each ant starts with an empty solution and extends it one component at a time.
Apply Local Search: Once complete candidate solutions have been obtained, they may be further improved by applying a local search algorithm on them.
Update Pheromones: The purpose of pheromone update is to make solution components of good solutions more desirable for the ants operating in subsequent iterations. The update is implemented using pheromone deposit and pheromone evaporation. The ACO has many types such as Ant System (AS) (Dorigo et al., 1991;Yu et al., 2009;Dorigo et al., 2006;Huo et al., 2014;Mazzeo & Loiseau, 2004), Elitist Ant System (EAS) Matos, 2004;Xia, 2009;Venkata Narasimha et al., 2013), Rank-Based Ant System (AS rank ) (Bullnheimer et al., 1999;Kheirkhahzadeh et al., 2009;Tan et al., 2012;Gupta & Saini, 2018), MAX-MIN Ant System (MMAS) (Stützle & Hoos, 2000;Sankar & Krishnamoorthy, 2010;Tang et al., 2014;Song et al., 2018). Ant Colony System (ACS) as the most interesting contribution of ACS is the introduction of a local pheromone update in addition to the pheromone update performed at the end of the construction process (called offline pheromone update), (Bell & McMullen 2004;Zhang et al., 2019). The local pheromone update is performed by all the ants after each construction step. Each ant applies it only to the last edge traversed. It is reduced the edges that belong to the best tour so far.
Pheromone is deposited on the edges of the best tour so far Based on the comprehensive survey of the previous studies ACS has been selected for the proposed study of this paper which is one of the types ACO family to solve CVRP because of its advantages and good characteristics. This method was applied in to the problem of symmetric and asymmetric traveling salesman problem , and the results show that this method is among the best metrics, especially when combined with specialized local search procedures (Donati et al., 2008). The experiments which have been performed on a series of standard problems showed the excellent performance of ACS when compared it to other optimization methods to solve difficult optimization problems (Tan et al., 2006;Lu et al., 2017). The ACS colony system is characterized from the rest of types of the ACO by its ability to move the solutions from the local optimum to the global optimum in a better way. ACS is distinguished from the other types in three aspects (Donati et al., 2008;Necula & Raschip, 2017): (1) Enhance the exploration about good solutions (local pheromone updating) by reducing the amount of pheromone at the edges visited by ants, in order to prevent early stagnation for search, (2) Focuses on the good solutions that have been found, with the global pheromone updating only on the edges belonging to the best existing solutions so far and not on all edges for not wasting time, (3) A modified transitional rule is applied to a new state based on edge selection with a quasi-random proportional rule, which tends to reduce randomness, where focuses more on exploitation.
On the other hand, the updating of pheromone is a very important component of ACS and allows for the improvement of future solutions in the next iteration. The goal is to exchange information of colonies by updating pheromone. It mimics the real evaporation of pheromone for this reason, it is necessary to updat this information locally for each ant and globally to change the entire quantity (very important for pheromone) where the exploitation of the search experience accumulated in ants is strongly in ACS more than the rest of types due to local update (Bouyahyiouy & Bellabdaoui, 2017). The main objective of local updating is the diversification search and exploration new ways while the main objective of global updating is to intensification and exploitation the best solutions. The ACS are considered the best type from other types of ACO because it benefit from the experience accumulated from the movement of any ant in the system unlike the rest who take experience after all the ants finish their tours and in this way wasting of time and not benefit from the experience of movement of any ant and because of the cooperation between the ants (through local updating) we reach the fastest solution where the reduction of pheromone helps to explore promising areas and helps prevent ants to go on one road so as not to bedevil the work of the transition equation.
In conclusion, the ACS differ from the rest as it is the only one that updates the local pheromone for all ants but updates the global pheromone only for the best ant, while the rest update the global pheromone only and for all ants and this threatens to fall in the local optimum in addition that it depends on the random transition rule on the exploitation and exploration while the semi-random transition rule in the rest depends on the mechanism of exploration only.

Method
In this study the proposed method to improve the algorithm ACS to enhancement the solutions of CVRP is presented. The steps of the proposed algorithm are presented as follows: Step I: Initialization In the beginning, we will initialize the pheromone primary matrix, the vision matrix, the distance matrix, the number of ants used and the parameters setting (τ, α, β, ρ, Q ≥ 0), (τ , η , α, β ≥ 0). The total quantity of goods that a vehicle carries should be less than its capacity Q. The primary level of pheromone for each rib (i, j) is based on the relationship: τ = And τ > 0 is a parameter of the initial value of the effects of the pheromone, n the number of nodes, and l is the cost produced by the nearest neighbor algorithm (NN).

Step II: Solution construction
The transitional rule is considered important in the structure of the algorithm to improve solutions based on this equation which is moving the ant from one node to another node so it must be used appropriately for better transition and that avoids the wrong move to the inappropriate node as this leads to the loss of time and increase the cost. In this study, the transition rule is used in two methods. The first method is to move from one node to another to build solutions, while the second method relies on moving from one node to a sub-path to build solutions. The purpose of choosing a sub-path instead of a node for the next transition speeds up finding the best solution sometimes the transition from one node to another node leads to an increase from the best solutions if the next node is not suitable, so the experience of the subpath was used to improve the work of the algorithm in the speed of reaching to the best solutions, for this, the best sub-paths are saved after the end of each iteration in a table where these sub-paths are used instead of relying on nodes (traditional method). For this, the best sub-paths are saved after the end of each iteration in a table where these sub-paths are used instead of relying on nodes (the traditional method), and these paths start from a specific node and end with a specific node where are calculated the total distance, as well as the calculation of the pheromone and its savings for each sub-path of these paths and that in order to apply the transitional equation on them after being considered as one edge. Improvement of the transition rule that favors either depending on the transition node or the transition depending on sub-paths is given as the following: where h coefficient to utilize the experience of sub-paths and 0<α<1 is randomly chosen value. In the classic transitional rule, a tour is built node by node: every ant iteratively adds new nodes until all nodes have been visited, when ant k is located in node i, it takes the next node j in the set of feasible nodes U (i.e., the set of the nodes that still have to be visited) depending on the following transitional rule: where (i, l) is an edge and l is a city not yet visited by the ant k. If ≤ , exploitation is chosen while if 0 q q  , exploration is chosen and is the random variable is specified according to the probability transition rule  which is applied as following: if : where  is the savings algorithm and , , are control parameters. The transition rule that depends on sub-paths is given as the following: if : W is a set of nodes that are the ends of all possible sub-paths that start with i where these sub-paths contain other nodes between the beginning node and the end node and is not repeated in the ribs where the only common feature between these sub-paths that they start from the same node but different in the rest of the nodes also it ends with a different node from path to other.
    , ,....., n n r r r r  are nodes located in the subpath between nodes i and r and each sub-path contains n+2 of nodes. It is illustrated one case as an example in the table below: In the ACS the effect of the pheromone is associated with the rib that links the last customer where the ribs used earlier are favored by the other ants, this is due to the increase in the amount of pheromone and sometimes called the attraction of the pheromone which is inversely proportional to the length of the rib that connects two nodes, and some parameters are also used in the probabilistic base to determine the relative importance of the effect of the pheromone and the heuristic information, during the construction of the solution, each ant updates the effect of the pheromone on the ribs visited in a process known as the local pheromone update.

Local pheromone update
The local update is based on the improved ant colony system algorithm (and the local pheromone update is based on limits on its concentration which helps to explore the unused roads to produce different solutions and also helps to avoid falling in a local optimal, which is the main goal of performance the local pheromone update and makes the road less desirable for the next ants) given by the following relationship: where 0 ≤ ρ ≤ 1 is a user-defined parameter called evaporation coefficient, and = ( × ) is the initial pheromone level of edges, n is the number of nodes and is the tour length produced by the Nearest Neighbor algorithm (NN).

Step III: Local Search
In the ant colony system algorithm ACS, after all the ants have built their solutions, these solutions are improved by applying a local search where local search helps to improve the quality of the solution of each ant. The main idea is that the best solution may have a greater chance of finding the best local improved solution by applying the local search; on the other hand, the local search algorithm is used to change the nodes and improve the road of each vehicle. This phase seeks through the application of local research to improve the best solutions and thus improve the best sub-paths, which benefit from their experience in the subsequent iteration, and by this, it obtains the maximum from improvement to these sub-paths to use their expertise in the global update.

Step V: Global Pheromone Update
It is executed at the end of each iteration where the values of the pheromone are updated that depend on the quality of the solutions that have been created or found in the current iteration, and this is usually accomplished by reducing the values of pheromone for all solutions in a process called evaporation and increase the values of pheromone for good solutions. In our IACS, the best elitist ants of the iteration, are allowed to lay pheromone on the ribs they traversed. The global updating rule is described as follow: where: where μ is the ranking index, Δ ij   denotes the increase of trail level on edge (i, j) caused by the th   best ant, L  is the tour length of the th   best ant, Δ i j   denotes the increase of trail level on edge (i, j) caused by the elitist ants,  is the number of elitist ants, L  represents the tour length of best solution found, t denotes the iteration counter and ∈ (0, 1] is the parameter to regulate the reduction of . Global update aims to accumulate the experience of the previous iteration and that is through the update of the pheromone of the best solution by a different coefficient from the coefficient, which is used for distinctive solutions that are less efficient but solutions elitist. In the proposed algorithm, the experience of distinct sub-paths from the previous iteration was retained for later use to build solutions based on this experience of paths for better results in less time.

Computational Results
This section is presented in two-phases; the first phase presents the parameters setting used for the proposal algorithm. The second phase involves implementing the proposed algorithm on the instances of CVRP dataset and discussing the results. MATLAB was employed on a PC with Intel (R) Core (TM) i7-3770 CPU @ 1.8 GHz. Also, the PC which was used operates under MS Windows 10 and has 4GB RAM.

Parameters Setting
The setting of parameters is very important for algorithms since they are effective factors in obtaining or improving results. Table 3 shows the parameters used in the proposed algorithm.  Golden et al. (1998), and Uchoa et al. (2014). The accuracy of an algorithm is calculated using a percentage deviation or gap. In this study, the solution quality criterion was used in calculating the accuracy, which is calculated through Gap = (CBest -C * ) / C * ×100 where CBest is the best objective value found after 10 runs, while C * is the best-known value taken from CVRP instances. Through the literature review related to the ACO family no study has been discussed on the implementation of the ACS algorithm on a type of CVRP data which has been proposed by (Uchoa et al., 2017) this reason has been motivated by this study to address these data via suggestion of the improvement ACS algorithm. This section includes two scenarios; the first scenario is related to the implementation of the proposed algorithm on 25 instances of CVRP data. While the second scenario involves a comparison between the proposed algorithm and some other algorithms that studied the same instances. From a computational point of view, there are many statistical criteria that have been used in this study such as finding the best solution, finding the best gap, as well as finding the standard deviation, and finally were calculated the time of implementation. On the other hand, the Table 4 reports the results obtained by the carrying out of the proposed algorithm. The implementation was executed on 25 instances based on the parameter from Table 3 and within 10 runs. The results have proved the accuracy of the algorithm to find 25 instances the optimal solution or the best-known solution out of 25 instances of CVRP dataset. The reason for the strength and features of this proposed algorithm due to the dependence on the experience of sub-paths in building solutions as this experience helps to find good solutions in a reasonable time because this idea helps to reduce the distances covered as it does not allow to repeat the sub-paths that were repeated several times in the previous iterations and this excludes the waste of time by taking advantage from the experience of these paths and if the distance of the sub-path increases, that speeds up to find a good solution. Table 4 This section presents the second scenario which includes the comparison of the proposed method with different studies (Hosseinabadi et al., 2017). On the other hand, Table 5 presents the results of the comparison where the results show the superiority of the proposed algorithm over all cases for improved SA algorithm, while the results of the comparison with the GELS are shown. The proposed algorithm has improved the resolution of X-n143-k7, X-n289-k60, X-n701-k44 and X-n783-k48, and it has found the best value of the gap for these four cases was 0%, while the results of GELS recorded the best value for the gap as follows: X-n143-k7 is 0.057, X-n289-k60 is 0.091, X-n701-k44 is 0.002 and X-n783-k48 is 0.056.  Table 5 Comparison proposed algorithm with other algorithms