In order to effectively solve the dynamic vehicle routing problem with time windows, the mathematical model is established and an improved variable neighborhood search algorithm is proposed. In the algorithm, allocation customers and planning routes for the initial solution are completed by the clustering method. Hybrid operators of insert and exchange are used to achieve the shaking process, the later optimization process is presented to improve the solution space, and the bestimprovement strategy is adopted, which make the algorithm can achieve a better balance in the solution quality and running time. The idea of simulated annealing is introduced to take control of the acceptance of new solutions, and the influences of arrival time, distribution of geographical location, and time window range on route selection are analyzed. In the experiment, the proposed algorithm is applied to solve the different sizes' problems of DVRP. Comparing to other algorithms on the results shows that the algorithm is effective and feasible.
Dynamic Vehicle Routing Problem (DVRP) is a variant of the Vehicle Routing Problems (VRPs) that has arisen due to recent advances in realtime communication and information technologies. The VRP is a nondeterministic polynomial hard (NPhard) 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ć [
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
The DVRP problem is closely related to the actual production and life. In recent years, DVRP gradually becomes a hot topic. Both domestic and foreign scholars mainly focus on the construction of different scheduling models and the designing of simple and efficient heuristic algorithms. A survey of results achieved on the different types of DVRPs can be found in Gendreau and Potvin [
In the past ten decades, a tremendous amount of work in the field of vehicle routing problems has been published, especially literature based on VNS. The Bräysy [
Due to the complexity of the problem, the current solving quality and efficiency for the DVRP are far from the practical requirements. So, there are many problems need to make indepth research such as how to seek feasible solutions, how to prevent falling into local optimum, and how to control 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.
Larsen [
An example for dynamic vehicle routing problem.
We can also describe the DVRP with a mathematic approach. The problem is defined on a complete graph
The variables are defined as follows:
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:
The constraints of the problem consist of vehicle constraints, demand constraints, routing constraints, and other constraints.
VNS is a metaheuristic for solving combinatorial and global optimization problems proposed by Hansen and Mladenović [
The flow of IVNS.
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 [
shortest route:= find route with fewest number of customers
delete current route
insert in cheapest position of the remaining routes
The initial solution obtained by the above method can basically meet the needs of the followup work, building the foundation to achieve optimal feasible solution in the following algorithm.
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 followsolving 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
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 twostage continuous nodes belonging to different paths. The insert and exchange operators are shown in Figure
Insert and exchange operator.
Insert
Cross
In each neighborhood, the insert operator is applied with a probability
In a VNS algorithm, local search procedures will search the neighborhood of a new solution space obtained through shaking in order to achieve a locally optimal solution. Local search is the most timeconsuming part in the entire VNS algorithm framework and decides the final solution quality, so computational efficiency must be considered in the design process of local search algorithm. Two main aspects are considered in the design of local search algorithms: local search operator and the search strategy. Based on the previous studies, this paper selects
There are mainly two search strategies: firstimprovement and bestimprovement in local search algorithm. The former refers to access the neighborhood solution of the current
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
There are some assumptions. The path that will be optimized is
The
If
If
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 [
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.
In order to assess the performance of the improved variable neighborhood search algorithm to solve DVRP, the data sets from the literature [
The dynamic distribution network is randomly generated by the computer. The distribution area is a square of 50 km
The position and demand of static customers.
No.  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30 


29  47  45  32  6  34  44  36  38  5  27  32  17  40  37  26  34  18  43  19  25  26  29  29  14  50  47  8  42  46 

44  9  13  16  1  6  6  46  39  28  7  3  14  47  47  12  19  40  26  3  49  49  3  37  37  10  26  10  27  34 
Demand  0.5  0.2  0.4  2  1.7  0.3  1.7  0.7  0.2  1.2  1.7  0.5  0.3  1.5  0.4  0.8  1.4  1.4  1  1.7  0.2  0.9  0.3  0.2  0.5  0.3  0.9  0.5  1.4  2 
The position and demand of dynamic customers.
No.  A  B  C  D  E  F  G  H  I  J 


8  47  2  9  21  41  39  4  44  13 

19  10  15  9  12  43  25  8  41  49 
Period  1  2  2  1  1  1  1  2  1  2 
Demand  1  1.5  1.6  3  1.4  0.3  0.2  2.2  2.8  1 
The position relationship of customer and depot.
The initial values of the various parameters for IVNS algorithm are set as follows.
The parameter settings for simulated annealing accepted criteria are initial temperature
The parameters value of the Shaking operation are as follows:
The
First, distribution of fixeddemand customer is optimized, solved, and generated initial distribution route, as shown in Table
Initial distribution route of fixeddemand customer.
Vehicle  Route  Utilization %  Mileage/km 

1  017732262719290  90  69.92 
2  046122311160  70  50.82 
3  024122211825100  61.25  75.83 
4  013285200  52.50  68.63 
5  0309141580  60  68.65 
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 realtime 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
Scheduling plan at the period 1.
Vehicle  Route  Utilization %  Mileage/km 

1  01773226271929G0  93.79  67.31 
2  046122311160  90.25  48.35 
3  024122211825100  74.43  75.47 
4  0AD28520E120  91.32  84.11 
5  030IF1415890  99.17  71.43 
The route at period 1.
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 realtime 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
Scheduling plan at the period 2.
Vehicle  Route  Utilization %  Mileage/km 

1  01773B226271929G0  94.54  70.61 
2  046122311160  90.25  48.35 
3  0241222118J25100  83.82  87.93 
4  013E20528DHCA0  93.19  98.79 
5  0309IF141580  99.17  71.43 
The route at period 2.
These results show that the improved variable neighborhood search algorithm can solve the realtime 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 twostage algorithm (TPA) based on the above example. The parameters setting of GA, TS, and TPA can be seen in the relevant literature [
The comparison results of different algorithms.
Algorithm  IVNS  GA  TS  TPA 

The optimal value  470.85  470.85  470.85  470.85 
The worst value  749  1089  1367  879 
The average value  558  823  919  548 
Success rate  40%  14.7%  11.2%  28.5% 
The number of iterations  25.47  47.65  28.17  31.69 
As can be seen from Table
The experimental test uses the benchmark data which was 100node VRPTW calculation example and compiled by Solomon in 1987. Every sample contains 100 nodes and distributes into
The dynamic degree is described as follows:
Table
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.
The present algorithm, in which the average computation time is less than 90 seconds, fully meets the requirements of realtime scheduling. The average calculation time of IVNS is lower than Lackner; it demonstrates that the algorithm has better search capabilities.
The comparison results of Lackner and IVNS.
No.  Dod (%)  Average vehicle number  Average driving distance/km  Average calculating time/s  

IVNS  Lackner  ARE (%)  IVNS  Lackner  ARE (%)  IVNS  Lackner  ARE(%)  
R1  90  14.25  15.15  −5.94  1343.82  1278.33  5.12  16.87  17.85  −5.49 
70  14.23  15.02  −5.26  1331.35  1336.1  −0.36  19.06  19.87  −4.08  
50  15.23  14.19  7.33  1293.81  1329.98  −2.72  25.69  27.46  −6.45  
30  13.47  14.22  −5.27  1286.63  1337.86  −3.83  48.34  46.97  2.92  
10  14.8  13.9  6.47  1259.18  1278.06  −1.48  70.01  68.01  2.94  
 
C1  90  11.25  11.78  −4.50  1235.47  1479.6  −16.50  6.31  6.47  −2.47 
70  11.26  11.87  −5.14  1031.78  1261.3  −18.20  11.08  10.81  2.50  
50  12.21  11.97  2.01  1072.32  1236.06  −13.25  17.77  18.32  −3.00  
30  10.57  10.54  0.28  970.8  1066.89  −9.01  28.06  27.08  3.62  
10  10.23  10.78  −5.10  895.68  996.35  −10.10  42.46  44.25  −4.05  
 
RC1  90  15  15  0.00  1506.43  1475.21  2.12  17.66  17.04  3.64 
70  13.58  14.65  −7.30  1513.23  1488.44  1.67  24.12  28.5  −15.37  
50  13.19  12.57  4.93  1519.12  1448.07  4.91  49.84  47.98  3.88  
30  12.98  13.43  −3.35  1489.96  1439.71  3.49  44.12  46.21  −4.52  
10  12.88  13.15  −2.05  1431.79  1426.89  0.34  86.78  88.21  −1.62  
 
R2  90  3.23  3.56  −9.27  1045.89  1193.33  −12.36  14.1  13.9  1.44 
70  3.79  3.61  4.99  1034.22  1116.93  −7.41  19.32  21.75  −11.17  
50  3.33  3.65  −8.77  1012.11  1138.78  −11.12  32.11  32.08  0.09  
30  4.22  4.87  −13.35  987.42  1085.42  −9.03  55.22  58.29  −5.27  
10  6.22  6.1  1.97  951  1052.85  −9.67  71.01  70.11  1.28  
 
C2  90  3.14  3.02  3.97  695.5  792.46  −12.24  6.21  5.52  12.50 
70  3.67  3.9  −5.90  671.86  743.78  −9.67  9.14  9.91  −7.77  
50  3.88  3.7  4.86  610.98  689.25  −11.36  18  18  0.00  
30  3.19  3.5  −8.86  655.23  632.33  3.62  27.18  28.35  −4.13  
10  4  4  0.00  582.32  629.08  −7.43  62.82  63.67  −1.34  
 
RC2  90  5  5  0.00  1351.21  1476.76  −8.50  9.96  10.89  −8.54 
70  3.98  4.1  −2.93  1256.32  1346.76  −6.72  19.03  18.98  0.26  
50  4.32  4.45  −2.92  1189.13  1269.29  −6.32  25.78  27.96  −7.80  
30  5.21  5.65  −7.79  1151.35  1244.85  −7.51  38.67  39.11  −1.13  
10  6.8  7.1  −4.23  1183.11  1220.9  −3.10  57.1  57.29  −0.33  
 
Average  8.637  8.81  −2.01  1118.63  1183.72  −5.50  32.46  33.03  −1.72 
In order to verify the proposed variable neighborhood search algorithm to solve the largescale dynamic vehicle routing problem effectively, this paper extends to largescale test instances with 1000 customer which are presented by Gehring and Homberger. Table
The comparison results of Gehring and IVNS.
Instance set  Objective  The number of vehicles  The calculation time/s  Total demand  New demand  Reject demand  

Gehring  IVNS  Gehring  IVNS  Gehring  IVNS  
C1_10_1  43494.2  43265.9  100  95  207  201  720  122  0 
C2_10_1  21778.4  21763  31  30  216  212  640  114  2 
R1_10_1  56389.8  56383.1  103  100  189.6  190.3  701  90  0 
R2_10_1  37014.7  36982.2  19  20  237  228  550  49  2 
RC1_10_1  48056.1  48005.7  97  98  316.8  313.5  853  80  3 
RC2_10_1  33534.3  33156.1  23  21  507.6  499.8  690  189  0 
 
Average  40044.58  39926.00  62.17  60.67  279.00  274.10  692.33  107.33  1.17 
As shown in Table
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 [
Funding for this research is supported by the National Science Foundation of China under Grants nos. 90924020, 70971005, and 71271013, the Societal Science Foundation of China under Grant no. 11AZD096, China Postdoctoral Science Foundation funded project no. 2012M520008, and Quality Inspection Projects no. 200910088 and no. 201010268.