Dynamic Vehicle Routing Using an Improved Variable Neighborhood Search Algorithm

,


Introduction
Dynamic Vehicle Routing Problem (DVRP) is a variant of the Vehicle Routing Problems (VRPs) that has arisen due to recent advances in real-time communication and information technologies.The VRP is a nondeterministic polynomial hard (NP-hard) problem that calls for the determination of the optimal set of routes to be performed by a fleet of vehicles to serve a given set of customers.However, a majority of the information is unpredictable before path optimization, such as the customer's geographic position, customer demand, and vehicle travel and service time.This information is dynamic and new information may appear or existing information changes, and so forth.Many different factors must be considered when a decision about the allocation and scheduling of a new request is taken: the current location of each vehicle, their current planned route and schedule, characteristics of the new request, travel times between the service points, characteristics of the underlying road network, service policy of the company, and other related constraints.The DVRP is a complex problem compared to the classic VRP, and variable neighborhood search (VNS) is proposed as a means to effectively and efficiently tackle the dynamic problem and optimize the planned routes between the occurrences of new events.VNS was initially proposed by Hansen and Mladenović [1,2] for solving combinatorial and global optimization problems.The main reasoning of this metaheuristic is based on the idea of a systematic change of neighborhoods within a local search method.
This paper has two main contributions.First, according to the characteristic of DVRP, we gave the graph expression and formulated the mathematical model.Second, the proposed algorithm is improved in initial solution, shaking and local search based on classic VNS.The later optimization process is presented, and the results show that the algorithm is feasible and competitive with other existing algorithms.The remainder of the paper is organized as follows: literature reviews are illustrated in Section 2 and the mathematical formulation problem is discussed in Section 3. Section 4 introduces the main ideas of the improved variable neighborhood search, while computational results are presented and discussed in Section 5. Section 6 concludes the paper.the solution within the acceptable range.This paper presents an improved variable neighborhood search algorithm to solve DVRP; it integrates local search operator, optimization process, and the simulated annealing algorithm into the VNS algorithm framework.Through the comparison with other algorithms, it shows that the proposed algorithm can get the better solution.

Problem Descriptions
3.1.Problem Definition.Larsen [19] defined DVRP with two aspects: not all information relevant to the planning of the routes is known by the planner when the routing process begins; information can change after the initial routes have been constructed.And he illustrated a dynamic vehicle routing situation.The simple example is shown in Figure 1.As seen from it, two uncapacitated vehicles must service both advance and immediate request customers without time windows.The advance request customers are represented by yellow nodes, while those that are immediate requests are depicted by black nodes.The solid blue lines represent the two routes the dispatcher has planned prior to the vehicles leaving the depot.The two thick arcs indicate the vehicle positions at the time the dynamic requests are received.Ideally, the new customers should be inserted into the already planned routes without the order of the nonvisited customers being changed and with minimal delay.This is the case depicted on the righthand side route.However, in practice, the insertion of new customers will usually be a much more complicated task and will imply a replanning of the nonvisited part of the route system.This is illustrated by the left-hand side route where servicing the new customer creates a large detour.
We can also describe the DVRP with a mathematic approach.The problem is defined on a complete graph  = (, ), where  = { 0 , . . .,   } is the vertex set and  = {(  ,   ) :   ,   ∈ ,  ̸ = } is the arc set.The vertices' set  = { 0 } corresponds to the depots.( Assignment of Nodes to Vehicles.Equation (6) states that every customer node must be serviced by a single vehicle: Capacity Constraints.Constraint (7)  neighborhood, and so forth.The description consists of the building of an initial solution, the shaking phase, the local search method, and the acceptance decision.The flow of VNS is shown in Figure 2.

Initial Solution.
Using variable neighborhood search algorithm, first, it needs to build one or more initial feasible solution; a clustering algorithm for an initial feasible solution mainly completes two tasks: customer allocation and path planning.For obtaining an initial solution, each customer is assigned a visit day combination randomly.Routes are constructed by solving a vehicle routing problem for each day using the Clarke and Wright savings' algorithm [20].The Clarke and Wright savings' algorithm terminates when no two routes can feasibly be merged; that is, no two routes can be merged without violating the route duration or capacity constraints shown in Algorithm 1.As a result, the number of routes may exceed the number of available vehicles.In that case, a route with the fewest customers is identified and the customers in this route are moved to other routes (minimizing the increase in costs).Note that this may result in routes that no longer satisfy the duration or capacity constraints.This step is repeated until the number of routes is equal to the number of vehicles.Since the initial solution may not be feasible, the VNS needs to incorporate techniques that drive the search to a feasible solution.
The initial solution obtained by the above method can basically meet the needs of the follow-up work, building the foundation to achieve optimal feasible solution in the following algorithm.

Shaking.
Shaking is a key process in the variable neighborhood search algorithm design.The main purpose of the shaking process is to extend the current solution search space, to reduce the possibility that the algorithm falls into the local optimal solution in the follow-solving process, and to get the better solution.The set of neighborhood structures used for shaking is the core of the VNS.The primary difficulty is to find a balance between effectiveness and the chance to get out of local optimal.In the shaking execution, it first selects a neighborhood structure   from the set of neighborhood structures of current solution ; then according to the definition of   ,  corresponds to change and generate a new solution  * .
There are two neighborhood structures to achieve the shaking: insert and exchange.Insert operator denotes a certain period of consecutive nodes moving from the current path to another path; exchange operator refers to interchange the two-stage continuous nodes belonging to different paths.The insert and exchange operators are shown in Figure 3.The cross-exchange operator was developed by Taillard et al. [21].The main idea of this exchange is to take two segments of different routes and exchange them.Compared with the VNS by Polacek et al. [14], the selection criterion is slightly changed.Now it is possible to select the same route twice.This allows exploring more customer visit combinations within one route.An extension to the CROSS exchange operator is introduced by Bräysy [13]; this operator is called improved cross-exchange-Cross exchange for short.Both operators are used to define a set of neighborhood structures for the improved VNS.
In each neighborhood, the insert operator is applied with a probability  insert to both routes to further increase the extent of the perturbation; then the probability of the exchange operator is 1 −  insert .IVNS selects randomly an exchange operator to change path for each shaking execution.The shaking process is somewhat similar to the crossover operation of the genetic algorithm.When the process is finished, the only two paths have the exchange of information; most of the features of the current solution will be preserved, to speed the convergence of the algorithm.There are mainly two search strategies: first-improvement and best-improvement in local search algorithm.The former refers to access the neighborhood solution of the current  solution successively in the solution process, if thev current access neighborhood solution   is better than , to make  =   and update neighborhood solution.We repeat these steps until all the neighborhood solutions of  are accessed.Finally,  will be obtained as a local optimal solution.The latter refers to traverse all of the neighborhood solution of current  solution in the solution process, to select the optimum neighborhood solution   as a local optimal solution.In this paper, we adopt the best-improvement strategy; it enables the algorithm to achieve a better balance in the solution quality and run time.

Later Optimization Process.
In order to accelerate the convergence speed and improve the solution quality, the later optimization process is proposed in the IVNS algorithm.After the local search is completed, if the local optimal solution  is better than the global optimal solution , that is, () < (), the later optimization process will be continued to be implemented in order to seek a better global optimal solution [22].The algorithm of later optimization process which was proposed by Gendreau et al. is suitable for solving the traveling salesman problem and the vehicle routing problem with time windows.The algorithm processes can be simply described as follows.
Step 1.There are some assumptions.The path that will be optimized is , its length is , and its value of the evaluation function is .The final optimized path is  * , the value of the evaluation function is  * , and  * = ,  * = , and  = 1.
Step 2. The Unstring and a String processes [23] are, respectively, performed for the th customer in the , the optimized path   can be obtained, and its value of the evaluation function value is   .
Step 4. If  =  + 1, the algorithm will be terminated; otherwise, jump to Step 2.

Acceptance Decision.
The last part of the heuristic concerns the acceptance criterion.Here we have to decide whether the solution produced by VNS will be accepted as a starting solution for the next iteration.To avoid that the VNS becomes too easily trapped in local optima, due to the cost function guiding towards feasible solutions and most likely complicating the escape of basins surrounded by infeasible solutions, we also allow to accept worse solutions under certain conditions.This is accomplished by utilizing a Metropolis criterion like in simulated annealing Kirkpatrick [24] for inferior solutions  * and accepting them with a probability of (11), depending on the cost difference to the actual solution  of the VNS process and the temperature .We update  every   iterations by an amount of ( ×   )/ max , where  0 denotes a random number on the interval [0, 1], where  max denotes the maximal VNS iterations, and an initial temperature value is  0 = 10:

Numerical Experiments
In order to assess the performance of the improved variable neighborhood search algorithm to solve DVRP, three test problems with respect to different sizes (small, medium, and large) have been done.We analyze the solution quality and efficiency of our proposed algorithm.IVNS algorithm is implemented by the C # language, and the main configuration of the computer is an Intel Core i3 1.8 GHz, 2 GB RAM running Windows XP.

Case 1
5.1.1.Experimental Data and Setting.In order to assess the performance of the improved variable neighborhood search algorithm to solve DVRP, the data sets from the literature [25] are used.Firstly, the VNS algorithm is applied to solve the DVRP, and then the results are analyzed and compared with other existing algorithms.
The dynamic distribution network is randomly generated by the computer.The distribution area is a square of 50 km × 50 km; 30 static demand customers and 10 the dynamic demand customers are randomly generated.Each customer's demand is a random number of [0, 2], the vehicle's capacity of distribution centers is 8 t, and the maximum driving distance of vehicle once is 100 km.These information including the coordinates and demand of 30 static customers and 10 dynamic customers are randomly generated by the computer, the location of the distribution center is  (25 km, 25 km), and the number of vehicles is 3.The objective is to arrange the delivery route of the vehicle reasonably, so that the distribution mileage is the shortest.For simplicity, the distance between customer and distribution center uses the straight-line distance.The coordinates and demands of static customers and dynamic customers are shown in   Tables 1 and 2, respectively, the specific position relationship for the customer and the customer, and the customer and distribution center are shown in Figure 5.
The initial values of the various parameters for IVNS algorithm are set as follows.
(2) The parameters value of the Shaking operation are as follows:  insert = 0.2,  cross = 0.15, and  cross = 0.1.(3) The  2− value is 0.5 in local search.

Numerical Results
. First, distribution of fixed-demand customer is optimized, solved, and generated initial distribution route, as shown in Table 3.
The customers' demand information is updated at period 1; at this moment, the service requests are put forward by six dynamic customers of A, D, E, F, G, and I.According to the known information on real-time optimization stage, the improved variable neighborhood search algorithm is used to solve the distribution network at period 1 and output scheduling plan, as shown in Table 4, and the specific route is shown in Figure 6.At period 2, the four dynamic demand customers of B, C, H, and J have the service request, and now according to customer requests, we update the relevant information.Based on known real-time information on the dynamic distribution network, the improved variable neighborhood search algorithm is applied to solve the distribution network at period 2, and then the scheduling plan is output, as shown in Table 5, while specific vehicle route is shown in Figure 7.
These results show that the improved variable neighborhood search algorithm can solve the real-time requirements of the dynamic vehicle routing problem; the bestimprovement search strategy and the insert and exchange operators speed the convergence of the algorithm and obtain better solution.In order to verify that the improved variable neighborhood search for solving the dynamic vehicle routing problem, we compare it with the genetic algorithms (GAs), tabu search (TS), and a two-stage algorithm (TPA) based on the above example.The parameters setting of GA, TS, and TPA can be seen in the relevant literature [22,25].A comprehensive comparison is made from the optimal value, the worst value, the average value, search success rate, and the number of iterations.The results of the experiment are shown in Table 6.
As can be seen from Table 6, the four algorithms consistently find an optimal solution, but the worst and average values have obvious differences; there are differences in search success rate and the number of iterations.The order of For each question in the Solomon example, there are five data sets corresponding to it.They are 90%, 70%, 50%, 30%, and 10% five dynamic degree.The dynamic degree is described as follows: is the number of dynamic customer demand, and   is the number of static customer demand.Table 7 gives the comparison results of the Solomon problem to IVNS and Lackner under different dynamic degrees.From the number of vehicles, the average driving distance, and the average calculation time, we compared the calculation results and the relative error.For five dynamic degrees, the average values of the number of vehicles, respectively, are 8.637 and 8.81 for IVNS and Lackner, the  7, the following conclusions can be drawn.
(1) In terms of the total driving distance, relative to the best results which are obtained by Lackner's various algorithms, except for the RC1, R1, and C2, the proposed algorithm can obtain better calculation results for other type's dynamic degrees.
(2) The present algorithm, in which the average computation time is less than 90 seconds, fully meets the requirements of real-time scheduling.The average calculation time of IVNS is lower than Lackner; it demonstrates that the algorithm has better search capabilities.

Case 3.
In order to verify the proposed variable neighborhood search algorithm to solve the large-scale dynamic vehicle routing problem effectively, this paper extends to large-scale test instances with 1000 customer which are presented by Gehring and Homberger.Table 8 gives the comparison results of the first path adjustment for the part instance based on Gehring and our proposed algorithm.
As shown in Table 8, the results of the objective value, the number of vehicles, and the calculation time are compared based on Gehring and IVNS.107.33 average new demands are occurred, and 692.33 total demands are handled in the path adjustment instance; only 1.17 customer demands failed to be satisfied, while the service level is close to 100%.In dealing with a large-scale problem, the algorithm running time is an important evaluation index; the average running time of our proposed algorithm is 274.10 s; it is smaller than Gehring's algorithm.The number of vehicle is closely related to the cost, and it is decreased from 62.17 to 60.67.The objective value is reduced from 40044.58 to 39926.00; it demonstrates that the results have been improved.According to the analysis, to some extent, the proposed algorithm can solve the large-scale dynamic VRP and improve the results.

Conclusions
In this research, we proposed a formulation for a dynamic vehicle routing problem.We also presented an improved variable neighborhood search (IVNS) metaheuristic for DVRP.In the initial solution, the routes are constructed by solving a vehicle routing problem for each day using the Clarke and Wright savings algorithm Clarke and Wright [20].In the shaking execution, there are two neighborhood structures to achieve the shaking: insert and exchange.This paper selects 2− and 3− as a local search operator in order to obtain the good quality local optimal solution in a short period.In order to accelerate the convergence speed and improve the solution quality, the later optimization process is proposed in the IVNS algorithm.To test the performance of the proposed improved variable neighborhood search algorithm, we test three problems with respect to different sizes (small, medium, and large) and compare the results with other algorithms.The results show that the proposed model and the algorithm are effective and can solve the DVRP within a very short time and improve the quality of solution to some extent.

Figure 1 :
Figure 1: An example for dynamic vehicle routing problem.

Figure 5 :
Figure 5: The position relationship of customer and depot.
Each vertex   ∈  has several nonnegative weights associated with it, namely, a demand   , a arrival time   , the waiting time   , service time   , and an earliest   and latest   possible start time for the service, which define a time window [  ,   ].    is the transportation cost from customer  to customer  in the period .Each vehicle  has associated with a nonnegative capacity   . refers to the number of time periods,   is the fixed cost for a vehicle,   is the traveling cost per unit time, and  is a very large number.The variables are defined as follows: 3.2.1.Objective Function.The dynamic vehicle routing problem with time windows is formulated in this section as a mixed integer linear programming problem.The objective of the formulation is to minimize the total cost that consists of the fixed costs of used vehicles and the routing costs:

Table 1 :
The position and demand of static customers.

Table 2 :
The position and demand of dynamic customers.

Table 3 :
Initial distribution route of fixed-demand customer.

Table 4 :
Scheduling plan at the period 1.

Table 5 :
Scheduling plan at the period 2.

Table 6 :
The comparison results of different algorithms.

Table 7 :
The comparison results of Lackner and IVNS.
5.2.Case 2. The experimental test uses the benchmark data which was 100-node VRPTW calculation example and compiled by Solomon in 1987.Every sample contains 100 nodes and distributes into 100 × 100 Euclidean plane.The sample is divided into six categories: R1, R2, C1, C2, RC1, and RC2.DVRPTW adopts the Lackner dynamic test data set which is designed in 2004 based on the Solomon example.

Table 8 :
The comparison results of Gehring and IVNS. the average values of driving distance respectively are 1118.63and 1183.72 for IVNS and Lackner, and the relative error is −5.50; the average values of calculation time, respectively, are 32.46 and 33.03 for IVNS and Lackner, and the relative error is −1.72.According to Table