Hybrid Heuristic Algorithm for solving Capacitated Vehicle Routing problem

The Capacitated Vehicle Routing Problem is the most common and basic variant of the vehicle routing problem, where it represents an important problem in the fields of transportation, distribution and logistics. It involves finding a set of optimal routes that achieve the minimum cost and serve scattered customer locations under several constraints such as the distance between customers’ locations, available vehicles, vehicle capacity and customer demands. The Cluster first – Route second is the proposed approach used to solve capacitated vehicle routing problem which applied in a real case study used in that research, it consists of two main phases. In the first phase, the objective is to group the closest geographical customer locations together into clusters based on their locations, vehicle capacity and demands by using Sweep algorithm. In the second phase, the objective is to generate the minimum cost route for each cluster by using the Nearest Neighbor algorithm. The hybrid approach is evaluated by Augerat’s Euclidean benchmark datasets.


INTRODUCTION
The Vehicle Routing Problems (VRP) are Nondeterministic Polynomial-time (NP) hard optimization problems. Its objective is to plan a tour under several constraints for a fleet of vehicles, that can be homogeneous or heterogeneous, the tour represents the best routes between scattered locations or customer nodes with minimum travelling cost. The VRP plays a vital role in distribution and logistics where the collection of household waste, gasoline delivery trucks, goods distribution, snow plough and mail delivery are the most used applications of the classical VRP. Maffioli (2003) mentioned that the use of computerized methods in distribution processes often results in savings ranging from 5% to 20% in transportation costs.
The capacitated vehicle routing problem (CVRP) is a generalization of VRP which represents the most elementary version of the vehicle routing problem. In CVRP model, a fleet of vehicles, located at single or multiple depots need to be scheduled to satisfy the customers' demands, while visiting every customer exactly once and the capacity of the vehicles must not be exceeded at any point in time. The objective is to obtain a solution that either minimizes the number of vehicles and/or total travelling cost (time or distance).
The CVRP can be represented as a weighted directed graph G = ( V, A) where V = {0 ,1 ,2 ,…… , n} represents the set of the vertices and A= {(i , j ): i≠ j } represents the set of arcs. The vertex 0 represents the depot and the others represent the clients. For each arc (i , j) a nonnegative value dij is associated. This value corresponds to the distance between the vertex i and the vertex j in terms of cost or time between the two vertices. A demand qi and time service i (q0 = 0, 0 = 0) are associated with each clients' vertex i . In this case, the objective is to minimize the total cost of routing and at the same time respect the following constraints: (1) Every client is visited exactly once by exactly one vehicle , (2) all the vehicles' paths/routes start and end at the depot, (3) the total demand of the clients of each path/route should not exceed the capacity of each vehicle (El-Hassani et al. 2008).
This paper is organized as follows: section 2 presents related work, Section 3 presents materials and method that used to solve CVRP, Section 4 presents Results and discussion, section 5 presents conclusions , and the paper end with Acknowledgements and References.

RELATED WORK
Exact methods such as branch-and-bound, the branch-and-cut and the branch-and-price algorithms have been developed to solve small-scale VRPs models such small CVRP as in Letchford et al. (2006) which need more computation time. Unlike exact methods, heuristics and meta-heuristics do not provide feasible solutions which proved to be optimal in a global sense. Instead, they provide pretty good ones, but in less time. At the first stage, the VRP is solved by the SW, and at the second stage, the ACS and 3-opt local search are used for improving the solutions. Extensive computational tests on standard instances the effectiveness of the presented approach. Chuhang and Henry at (2013) present an artificial immune systems or AIS-based algorithm to solve Vehicle Routing Problem with Simultaneous Pick-up and Delivery (VRP-SPD).This algorithm is embedded with a sweep approach to generate random initial population. For the mutation operator, a variety of local search techniques are applied to realize the diversity.

Methodolgy
A hybrid heuristic approach based on Sweep algorithm and Nearest Neighbor algorithm (SA & NNA) proposed as a methodology to develop a tour plan for the distribution companies to be able to serve all customers with the minimum travelling cost. The Cluster first -Route second method is used to solve CVRP where it consists of two phases. The first phase is to group customers into clusters by using the Sweep algorithm and the second phase is to find the optimal solution (best route path) for each cluster by using a nearest neighbor algorithm.
Sweep algorithm was firstly introduced by Gillett and Miller (1974) as a heuristic algorithm that have been developed for solving vehicle dispatch problems with load and distance constraints for each vehicle. The objective of sweep algorithm is to generate a route with minimum total distance. That method based on two main stages, first is the clustering stage where the customers are grouped into clusters by minimizes total distance using polar coordinate principle, the second is a route generation stage that optimizes each cluster separately as a traveling salesman problem (TSP). M a r c h 0 5 , 2 0 1 4 Clustering stage started with computing the polar coordinates for each customer location as ( , dij ), where  is the polar angle and dij is the distance for all nodes with respect to the depot. General formula for calculating polar angle is represented in Equation 1: Where:  : angular value of a node (customer location).
x, y : coordinate values in degree of each node.
A general formula for calculating the Euclidean distance is represented in equation 2: Where: dij : distance between two nodes.
Xi : X coordinate value for node i.
Xj : X coordinate value for node j.
Yi : Y coordinate value for node i.
Yj : Y coordinate value for node j.
The second step in clustering stage is to increase the polar angle and ranking the customer locations according to their angles to make customer list that used to group nodes into clusters by joining nodes beginning of the closest node to the depot that has the smallest polar angle. That process is repeated until it satisfies the capacity constraint for the vehicle while the total demands for all nodes in each cluster not exceeding the vehicle capacity.
The route generation stage is aimed to optimize searching method to find the optimal solution that represents the shortest path between all nodes in each cluster. The nearest neighbor algorithm is used as a heuristic method to find the shortest path between each cluster node as a travelling salesman problem. After nodes being clustered, the nearest neighbor algorithm is performed to reorder nodes on each cluster based on the distance of one node to another to generate the shortest routes. The distance matrix between all nodes in each cluster are created by using Equation 2 for calculating Euclidean distance. the first node to be linked in each cluster is the one that has the shortest distance to the depot, the next node to be linked is selected by searching a node that is closest to the first node. This procedure is repeated until all nodes in the same cluster are linked as a route. The same procedure is performed for the next all clusters until all routes are generated.

Case study
Tiba Company for Trade and Distribution is one of Juhayna Group companies that owns 24 distribution centers spread across the majority of the provinces of Egypt, where the distribution network covering 27 provinces, nearly 36,000 retail outlets, through more than 800 car and truck distribution.
Our case study applied in the Tiba Company for Trade and Distribution -Mansoura branch which deliver dairy products from their distribution center to about 850 retail outlets in Mansoura city. The company splits their customers into 3 levels , level-1 represents customers with high demand , level-2 represents customers with medium demand and level-3 represents customers with low demand , we will focus on Level-1 where it services about 20 high demand supermarkets where the company owns a fleet of 4 refrigerated trucks used to serve that level of customers. The objective is to minimize cost by minimizing the total distance traveled and under the following constraints : 1. Each customer is visited exactly once.
2. Each vehicle route starts and ends at the depot.
3. Each customer is serviced by one and only one vehicle.
4. Customers have grouped into clusters and the total customer's demands of each cluster not exceeding the vehicle capacity .
5. Demand at each customer is known.
6. The cost is measured by the total distance of all routes . Figure 1 shows the case study customers that located on the Mansoura city map.  Table 1 shows node name, Cartesian coordinates for each node and demand, which are the required data to apply the clustering process in sweep algorithm.

RESULTS AND DISCUSSION
The proposed approach that's based on hybrid Sweep Algorithm and Nearest Neighbor Algorithm (SA & NNA) was coded in C# on an Intel Core i3-2350M CPU 230 GHz with 3.00 GB of RAM under Windows 8 platform. After clustering process is performed by using the sweep algorithm, the optimal routes achieved by using a nearest neighbor algorithm. The resulted clusters and their demands are shown in table 3. M a r c h 0 5 , 2 0 1 4 The optimum routes that resulted from using (SA & NNA) are as bellows: Vehicle 1# : 0 -19 -20 -11 -12 -13 -14 -0.
Total distance : 565. Figure 2 shows the optimal routes in the graph:  As the tables show, the proposed algorithm finds the same number of routes in 8 cases among 27 cases in Augerat's benchmark class A; on class B, 12 cases among 23; and on class P, 12 cases among 24 cases. Each of these experiments is executed within a hundred of milliseconds. As observed from the evaluation results the proposed algorithm needs more enhancement in the route generation stage to achieve better results comparable to the best known results in benchmark datasets.

CONCLUSION
This paper has proposed a hybrid algorithm, Sweep Algorithm & Nearest Neighbor Algorithm (SA&NNA) for reducing the total cost of the capacitated vehicle routing problem by grouping geographically closest customers' locations together into clusters and then finding out the shortest path of each cluster. The clustering stage is performed by Sweep algorithm and finding the optimal solution stage was achieved by the nearest neighbor algorithm. The proposed hybrid algorithm's results were evaluated by Augerat's Euclidean benchmark datasets A, B, and P of the CVRP. It can be observed that the sweep algorithm is a simple and powerful tool to perform customers clustering stage while using the Nearest Neighbor algorithm in route generation stage is easy to implement and executes quickly. On the other hand, the disadvantage is that it sometimes missing shorter routes which are easily noticed with human insight. The proposed hybrid algorithm is needed more enhancement in the route generation stage to achieve better results. For future work, further optimization algorithms can be applied to develop route generation stage.