Abstract

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 best-improvement 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.

1. 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.

2. Literature Reviews

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 [3]. The dynamic full-truckload pickup and delivery problem has been studied by Fleischmann et al. [4] and Yang et al. [5]. Montemanni et al. [6] proposed the vehicle scheduling model with random dynamic demand and solved it using an ant colony algorithm. In Gendreau et al. [7] neighborhood search heuristics for dial-a-ride problems are finally presented. Goel and Gruhn [8] studied the mathematical model of dynamic vehicle routing problems under the conditions of the real-life information. Schönberger and Kopfer [9] studied the real-time decision-making and autonomous decision-making of DVRP. Novoa and Storer [10] introduced the approximate solution algorithm with stochastic demands. Branchini et al. [11] presented local search algorithm for a dynamic vehicle routing problem. Müller [12] studied DVRP with time window and analyzed the algorithm for the model suboptimal solution.

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 [13] gave the internal design of the VND and RVNS algorithm in detail, analyzed the VRPTW problem, and indicated the VND algorithm as one of the most effective ways to solve VRPTW problems. Polacek et al. [14] designed VNS to solve the multidepot vehicle routing problem with time windows MDVRPTW. His algorithm used the neighborhood structure of swap and cross to do shaking operation for the current solution, to do local search with a constrained 3-opt operator to accept the part of the poor solution to avoid getting into a local optimum for the algorithm by Threshold Accepting. Kytöjoki et al. [15] designed the guided VNS algorithm to handle the 32 existing large-scale VRP problems and compared it to the TS algorithm. The result showed that the VNS algorithm was more effective than TS algorithm in solving time. Goel and Gruhn [16] introduced the RVNS to solve the general VRP problem including time windows, vehicle constraints, path constraints, travel departure time constraints, capacity constraints, the order models compatibility constraints, multisupplier point of the orders, and transport and service position constraints. Hemmelmayr et al. [17] proposed the VNS algorithm for periodical VRP problem, adopted the saving algorithm for the construction of the initial solution, designed the move and cross neighborhood, used 3-opt operator as local search strategies, and contrasted it with other research results. Fleszar et al. [18] adopted VNS algorithm to solve the open-loop VRP problem and tested 16 benchmark problems.

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 in-depth 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.

3. 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 right-hand 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 is the vertex set and is the arc set. The vertices’ set corresponds to the depots. 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. Mathematical Formulation
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:

3.2.2. Problem Constraints

The constraints of the problem consist of vehicle constraints, demand constraints, routing constraints, and other constraints.

Assignment of Nodes to Vehicles. Equation (3) ensure that each customer has a vehicle service for only one time and the vehicle does not return to the yard:

Relationship between the Vehicle and Depot. Constraint (4) ensures that the number of vehicles departed from the yard does not exceed the maximum number of vehicles belonging to the distribution center:

Relationship between the Vehicle and Route. Constraint (5) ensures that customers on the same route are delivered by the same vehicle:

Assignment of Nodes to Vehicles. Equation (6) states that every customer node must be serviced by a single vehicle:

Capacity Constraints. Constraint (7) states that the overall load to deliver to customer sites serviced by a used vehicle should never exceed its capacity:

Subcircuit Constraints. Equation (8) ensures to eliminate subcircuit:

Time Constraint Violations due to Early/Late Services at Customer Sites. One has

Other Constraints. One has

4. An Improved Variable Neighborhood Search Algorithm

VNS is a metaheuristic for solving combinatorial and global optimization problems proposed by Hansen and Mladenović [1, 2]. Starting from any initial solution, a so-called shaking step is performed by randomly selecting a solution from the first neighborhood. This is followed by applying an iterative improvement algorithm. This procedure is repeated as long as a new incumbent solution is found. If not, one switches to the next neighborhood (which is typically larger) and performs a shaking step followed by the iterative improvement. If a new incumbent solution is found, one starts with the first neighborhood; otherwise one proceeds with the next 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.

4.1. 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.

Main: Clarke And Wright savings algorithm
Input: the number of customers and vehicles, the capacity of vehicles
Output: set of initial solution
Begin
for each day  do
while  number of routes number of vehicles  do
  shortest route:= find route with fewest number of customers
  for each customer shortest route do
   delete current route
   insert in cheapest position of the remaining routes
  end for
end while
end for
end Begin

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.

4.2. 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 to both routes to further increase the extent of the perturbation; then the probability of the exchange operator is . 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.

4.3. Local Search

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 time-consuming 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 and as a local search operator in order to obtain the good quality local optimal solution in a short period; they are shown in Figure 4. According to the probability, one of the two operators is selected in each local search process. The parameter represents the probability of selection for ; similarly, the probability of selection for can be expressed as . This mixed operator can develop optimization ability for and and expand the solution space 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 the 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.

4.4. 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 .

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 3. If , some processes are carried out; they are , , , , and , jump to Step 2; otherwise, .

Step 4. If , the algorithm will be terminated; otherwise, jump to Step 2.

4.5. 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 , where denotes a random number on the interval , where denotes the maximal VNS iterations, and an initial temperature value is :

5. 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.

5.1. 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 , 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.(1)The parameter settings for simulated annealing accepted criteria are initial temperature , every generation to update temperature , to end the algorithm.(2)The parameters value of the Shaking operation are as follows: , , and .(3)The value is 0.5 in local search.

5.1.2. 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 best-improvement 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 the four algorithms of search success rate from the smallest to largest is tabu search algorithm, two-stage algorithm, genetic algorithm, and IVNS; the order for the worst value is as follows: the average value from small to big is IVNS, two-stage algorithm, genetic algorithm, and tabu search algorithm; it reflects the IVNS has the better global search capability. The number of iterations for four algorithms from the smallest to the largest is IVNS, tabu search algorithm, two-stage algorithm, and genetic algorithm, this also shows that convergence rate of IVNS is faster than the other algorithms, and it can be more appropriate to solve dynamic vehicle routing problem to some extent.

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 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. 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 relative error is −2.01; the average values of driving distance respectively are 1118.63 and 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 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.

5.3. 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.

6. 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 and 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.

Acknowledgments

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.