ADAPTATION OF THE VARIABLE NEIGHBORHOOD SEARCH HEURISTIC TO SOLVE THE VEHICLE ROUTING PROBLEM

The vehicle routing problem is investigated by using some adaptations of the variable neighborhood search (VNS). The initial solution was obtained by Dijkstra’s algorithm based on cost network constructed by the sweep algorithm and the 2-opt. Our VNS algorithm use several neighborhoods which were adapted for this problem. In addition, a number of local search methods together with a diversification procedure were used. The algorithm was then tested on the data sets from the literature and it produced competitive results if compared to the solutions published.


INTRODUCTION
The Vehicle Routing Problem (VRP) has an important role in distribution management and it is one of the most widely studied problems in combinatorial optimization.The VRP is a problem where a number of customers need to be served by a number of homogeneous vehicles based at a single depot.In this problem, each customer is visited exactly once; the maximum capacity of the vehicle and the maximum length of the route must not be exceeded.The objective here is to find a set of routes which fulfil all requirements mentioned above with the least cost.There are two types of methods used to solve the VRP, namely exact methods and heuristic methods.For small instances (say n<30), the VRP could be solved in a reasonable computing time by using exact methods such as Integer Linear Programming.However, these methods become ineffective for large problems as the computation becomes too time consuming.The increase in computing time is due to the fact that the VRP is an NP-hard problem (Lenstra and Rinnooy Kan, 1975).In other words, it is unlikely that a polynomial time algorithm can be found for such a problem.
There are many papers addressing the VRP.The following are some VRP paper that we divide into two categories, exact and heuristic methods.Exact Methods, exact methods for solving the VRP were developed starting from the late 1950s by Dantzig and Ramser (1959) and Garvin et al.(1975).Dantzig and Ramser (1959) modified the algorithm, originally proposed for the TSP by Dantzig et al. (1954) to address the VRP.Eilon et al. (1971) developed a Dynamic Programming approach to address the VRP.Laporte and Norbert (1987) and Laporte et al. (1992) proposed a Branch and Bound approach.Heuristic Methods, the saving algorithm was proposed by Clarke and Wright (1964).It then became a basis of many algorithms developed to solve the VRP.Christofides and Eilon (1969) proposed an improvement method for the VRP which uses the 2-opt and the 3-opt initially developed by Lin (1965) to solve the TSP.Salhi and Rand (1987) developed a heuristic that considers several refinement procedures including the perturb procedure which consider three routes simultaneously to improve the initial solution.Osman (1993) applied Simulated Annealing and Tabu Search metaheuristics with his λinterchange method.Taillard (1993) proposed a procedure that partitioned large problems into several sub-problems before applying Tabu Search.Xu and Kelly (1996) introduced a heuristic search using a network flowbased Tabu Search.Neural Network algorithm was also put forward and this was carried out by Torki et al. (1997).A variant of the threshold accepting algorithm called Backtracking Adaptive Threshold Accepting algorithm (BATA) was developed by Tarantilis et al. (2002).Prins (2004) developed a method based on Genetic Algorithm (GA).Pisinger and Ropke (2007)introduced a general heuristic that can solve five different variants of the VRP.An Improved Ant Colony Optimization (IACO) was proposed by Yu et al. (2009).The remaining parts of the paper are organized as follows.The proposed VNS algorithm is presented in Section 2. The explanation of its main steps is provided in Section 3. The computational results are given in Section 4. The last section summarizes our findings.

Adaptation of the Variable Neighborhood Search
Variable Neighbourhood Search (VNS) is a metaheuristic method first proposed by Mladenovic (1995) and later formally formulated by Mladenovic and Hansen (1997).This heuristic has been applied to several NP-hard problems with excellent success.The main reasoning of this metaheuristic is based on the idea of a systematic change of neighborhoods within a local search method.The basic VNS algorithm is presented in Figure 1 and follows closely the notation of the authors.
Initialization.Select a set of neighbourhood structures N k , for k = 1,..., k max that will be used in the search; find an initial solution x and choose a stopping condition; Repeat the following sequence until the stopping condition is met: 1) Set k 1 2) Repeat the following steps until k = k max : a) Shaking Generate a point at random from the k th neighbourhood of x( ∈ N k (x)); b) Local search Apply some local search method with as an initial solution; denote with the so obtained local optimum; c) Move or not If the local optimum is better than the incumbent x, move there (x" ), and continue the search with N 1 (k 1); otherwise, set k k+1 and go to Step 2(a).

The basic VNS algorithm
The basic VNS algorithm starts by selecting a set of neighborhood structures N k (k = 1,..., k max ), where N k is the k th neighborhood.Given an initial solution x, a random point in N k (x) is generated using a neighborhood structure N k and then a local search, starting from is performed to produce .The use of can be considered as a way of maintaining diversification through the search.If is better than the incumbent best solution x, then x = , and the search returns to N 1 , otherwise the search explores the next neighborhood N k+1 .This is repeated until k = k max .Interesting new variants of this classical VNS are presented in Hansen and Mladenovic (2003).

Some enhancements to the basic VNS algorithm
In this study, the basic VNS algorithm is adapted to solve the VRP.To our knowledge, this is the first VNS implementation to this particular routing problem.The basic VNS algorithm is enhanced by the use of additional features which include adopting a set of local search procedures including Dijkstra, and introducing a diversification scheme.The proposed algorithm is described in Figure 1.

An overview of the proposed algorithm
An initial solution x is first generated and it is used as the initial global best, x best .We have a set of neighborhood structures N k , (k=1,..., k max ) and a set of refinement procedures which will be described later.The search begins by generating a random feasible solution from N 1 (x), which is taken as the temporary solution.is then improved by the set of local searches (refinement procedures) which are implemented within a multi-level framework (Salhi and Sari 1997).If the solution obtained by the multi-level approach, , is better than the incumbent best solution x, then x = and the search reverts back to N 1 .But if is found to be worse or the same as x, we generate from the next neighborhood say N k (x) and apply the Step (0) Initialization.Define a set of neighborhood structures N k , for k = 1, ..., k max and a set of local searches R l , for l =1, ..., l max .Set the maximum number of diversifications, NbDivMax and the number of diversifications, NbDiv = 0. Generate an initial solution x and set Apply a multi-level approach to find the best neighbour .
(c) Move or not.If the local optimum is better than the incumbent x, set x and go to (2); otherwise set k k+1.
Step (4) Construct the cost network using the incumbent x and apply Dijkstra's algorithm to get .If the new solution is better than x, set x and go to (2).
Step (5) If the solution x is better than x best , set x best x; If NbDiv > NbDivMax then stop, else set NbDiv NbDiv + 1, apply the diversification procedure and go to (1).

METHOD
The procedures used within the steps of the algorithm are as follow.

Initial solution (Step 0)
The initial solution is obtained in three steps; (a) construct a giant tour using the sweep algorithm of Gillett and Miller (1974), (b) improve this tour using the 2-opt of Lin (1965), and (c) construct the cost network and then apply Dijkstra's algorithm (1959) to find the optimal solution for the shortest path based on the corresponding cost network.This partitioning procedure based on solving the shortest path problem was presented by Beasley (1983) for solving the VRP and by Golden et al. (1984) for the Heterogeneous Fleet VRP.To avoid using the largest distance between two successive customers in a given route, the starting points, in the construction of the cost network, are used as those that generate the highest largest distances between two successive customers (i.e.gaps) in the giant tour.The number of gaps (NG) generated is defined as follows: where, NR is the number of routes found by Dijkstra's algorithm, (i,i+1) the ordered sequence of customers, g i the i th gap (i.e. the distance between customer i and i+1), the average gap, and g + the largest gap.The reasoning of using ( 1) is based on the idea of linking the value of NG to the number of routes and also to the number of gaps that relate to the average as well as the largest gap.For each of the NG selected gaps, say (i 1 ,i 1 +1), two cost networks are then generated starting from i 1 anticlockwise and from i 1 +1 clockwise.Dijkstra's algorithm is then applied to each of these 2 × NG cost networks.

Neighborhood Structures (Step 3a)
Six neighborhoods, which are briefly described in this subsection, are used in this study (i.e.k max = 6).
These include the 1-1 interchange (swap), two types of the 2-0 shift, the 2-1 interchange, and two types of the perturbation.The order of the neighborhoods is as follows; the 1-1 interchange is used as N 1 , the 2-0 shift of type 1 as N 2 , the 2-1 interchange as N 3 , the perturbation of type 1 as N 4 , the perturbation of type 2 as N 5 , and finally the 2-0 shift of type 2 as N 6 .

The 1-1 interchange (the swap procedure)
This neighborhood is aimed at generating a feasible solution by swapping a pair of customers from two routes.This procedure starts by taking a random customer from a randomly chosen route and tries to swap it systematically with other customers by taking into consideration all other routes.This procedure is repeated until a feasible move is found.

The 2-0 shift
In the 2-0 shift, two consecutive random customers from a randomly chosen route are selected.These two customers are considered together for possible insertion in other routes in a systematic manner.This procedure is repeated until a feasible move is found.We name this procedure the 2-0 shift of type 1.Another 2-0 shift, which we refer to as the 2-0 shift of type 2, is similar to the above shift except that the two customers are allowed to be inserted into two different routes.

The 2-1 interchange
This type of insertion attempts to shift two consecutive random customers from a randomly chosen route to another route selected systematically while getting one customer from the receiver route until a feasible move is obtained.

A new perturbation mechanism
This scheme was initially developed by Salhi and Rand (1987) for the VRP by considering three routes simultaneously.Here, it starts by taking a random customer from a randomly chosen route and tries to relocate that customer into another route without considering capacity and time constraints in the receiver route.A customer from the receiver route is then shifted to the third route if both capacity and time constraints for the second and the third route are not violated.We refer to this as the perturbation of type 1.An extension of such a perturbation is the one that shifts two consecutive customers from a route.In this procedure, instead of removing one customer at the beginning we remove two customers.We name this procedure as the perturbation of type 2.

Local Search (Step 3b)
Six refinement procedures are adopted to make up our local search.The order of the refinement procedures is as follows: the 1-insertion inter-route as the first refinement procedure R 1 , the 2-opt interroute as R 2 , the 2-opt intra-route as R 3 , the swap intra-route as R 4 , 1-insertion intra-route as R 5 , and finally the 2-insertion intra-route as R 6 .
The process starts by generating a random feasible solution from N 1 , which is used as the temporary solution.The multi-level approach then starts by finding the best solution using R 1 .If is better than , then = and the search returns to R 1, otherwise the next refinement procedure is applied.This process is repeated until R 6 cannot produce a better solution.

The 1-insertion procedures (inter-route and intra-route)
Two types of the 1-insertion procedures are used.The first is the 1-insertion intra-route and the second is the 1-insertion inter-route.In the 1-insertion intraroute we remove a customer from its position in a route and try to insert it elsewhere within that route in order to have a better solution.Meanwhile, in the 1-insertion inter-route, each customer from a route is shifted from its position and tried to be inserted elsewhere into another route.If this shifting does not violate any constraints and improves the solution, the selected customer is then permanently removed.

The 2-insertion (intra-route)
The 2-insertion intra-route allows us to remove two consecutive customers and insert them elsewhere within a route to produce a cheaper route.

The 2-opt (inter-route and intra-route)
The 2-opt intra-route, usually refer to as the 2opt (Lin, 1965), is an old but a simple and an effective improvement procedure that works by removing two non adjacent arcs and adding two new arcs while maintaining the tour structure.A given exchange is accepted if the resulting total cost is lower than the previous total cost.The exchange process is continued until no further improvement can be found.The 2-opt inter-route is similar to the 2-opt intra-route except that it considers two routes where each of the two arcs belong to a different route and reverse directions of the corresponding affected path of each route.

The swap (intra-route)
The swap intra-route is aimed at reducing the total cost of a route by swapping positions of a pair of customers within the route.

Use of Dijkstra's Algorithm as an Extra Refinement (Step 4)
Dijkstra's algorithm, besides being used to generate an initial solution, is also applied as a post optimizer.Here, the cost network is constructed from the incumbent best solution.The aim is to see whether the optimal solution for the shortest path based on the corresponding cost network is different to the current one or not.In this procedure, the two end points of the first route of the incumbent best solution are used as the starting points and then all the other routes are combined to form the giant tour.The steps of this procedure, when the first point of the first route is used to construct a network, are presented in Figure 3.
Step 1. Use the first node of the first route as the starting point.When we start from the other end point (i.e., the last node) of the first route, the order of that route is reversed but step 2 and step 3 of Figure 3 are similar.This construction obviously ensures that the current solution is feasible and hence Dijkstra's algorithm might discover a better one.Note that this construction can obviously be started from the end points of any route, not necessarily the first one.

The Diversification Procedure (Step 5)
This procedure is used when there is no further improvement after all the local searches are performed.The idea is to explore other regions of the search space that may not have been visited otherwise.The incumbent best solution is used as an input for the diversification procedure to obtain the new initial solution.The idea is to construct a cost network by starting from a node which is not the first point of any route, when following clockwise direction, and also not the end point of any route, when following anticlockwise direction.This will ensure that a route from this incumbent best solution will be split, a new cost network constructed and hence a new solution generated.The steps of the diversification procedure are presented in Figure 4.In this study, the number of diversifications (ND) is set as ND = MIN (100, 2N), where N represents the number of customers in a given instance.

RESULT Computational Experience
The algorithm is programmed in C++ and tested to solve VRP instances of Christofides (1979).The results and CPU time are given in Table 1 and Table 2 respectively.Table 1 show that our algorithm produces good results.Three solutions for instance #1, instance #6 and instance #7 are similar to the best known solution.The solution for instance #2 and instance #3 are close to their corresponding best known solution.VNS produces better results when compared to the results of Osman (1993), Barbazoglu andOzgur (1999), andTarantilis et al. (2002).This is shown by the number of best solutions obtained and the average deviation of the 524.61solutions.In terms of CPU time, our algorithm consumes more CPU time than Xu and Kelly (1996), Prins (2004) and Yu et al. (2009).

CONCLUSIONS
We have put forward an adaptation of the basic VNS algorithm to tackle the VRP.This is enhanced by the use of additional features which include adopting a set of local search procedures including Dijkstra's algorithm and introducing a diversification scheme.It was found that our proposed VNS heuristics yield competitive results when compared to the best known results found in the literature.Finally, this study shows that a suitable implementation of VNS can be applied successfully to solve the VRP and it can be developed other related distribution problems such as Multi-depot VRP.Improving the solution quality and CPU time will be our concern in the future.Barbazoglu, G. and Ozgur, D. 1999

Figure 3 .
Figure 3.Construction of the cost network

Figure 4 .
Figure 4.The diversification procedure -level approach again.The process is repeated until the search reaches N kmax If the solution obtained from Step 3 is worse than the incumbent x best , a cost network, as described in Section 3, is constructed based on x and then Dijkstra's algorithm is utilized on this cost network to generate .If is better than multi Step 2. Connect the nearest end points of other routes with the last node of the first route.Select the route which has the nearest end point as the next route.If the nearest end point is the last point in that route, reverse the route order.

Table 2 .
CPU time comparison in seconds Connect all points; the last point of the previous route is connected to the first point of the next route.Step 2. Calculate all distances between two consecutive points.Step 3. Select the largest distance between two consecutive points which are not two end points of different routes, say e 1 ,e 2 as the starting point.Step 4. Construct the cost network starting from e 2 clockwise and apply the Dijkstra's Algorithm.Step 5.As in Step 4, but start from e 1 counter clockwise.