# Reoptimization Heuristic for the Capacitated Vehicle Routing Problem

Authors: Rodrigo Linfati; John Willmer Escobar
Journal: Journal of Advanced Transportation
 (2018)

---

## Abstract

The solution to a dynamic context of the Capacitated Vehicle Routing Problem (CVRP) is challenging. Routing and replenishment decisions are necessary by considering the assignment of customers to vehicles when the information is gradually revealed over horizon time. The procedure to solve this type of problems is referred to as route reoptimization, which is the best option for minimizing expected transportation cost without incurring failures of unsatisfied demand on a route. This paper proposes a heuristic algorithm for the reoptimization of CVRP in which the number of customers increases. The algorithm uses proposed performance metrics to reduce route dispersion and minimize length. The initial solution is generated using the savings algorithm and then enhanced using the Record-to-Record travel metaheuristic. By including or reducing new customers in the system, a reoptimization is performed which considers the visited nodes and edges as fixed. The optimization of the algorithm is implemented hierarchically by first minimizing dispersion and then minimizing distance. Next, the local search procedure is executed to improve the solution. A classic optimization is performed on all instances using the original and new customers’ information for later comparison to minimize distance. The efficiency of the proposed algorithm was validated using real-world cases from the literature. The results are promising and show the effectiveness of the proposed method for solving the considered problem by using reoptimization procedures in order to achieve good approximation ratios within short computing times.


---

## Body

## 1. Introduction

The transportation industry has various problems of different levels of complexity. Perhaps one of the most interesting of these problems is route development, which is usually performed based on expert knowledge. Although the vehicle routing problem has been studied for more than 70 years, the challenge of solving it has increased as more difficult variants arise in the prominent area of development.The vehicle routing problem (VRP), which is an extension of the well-known traveling salesman problem (TSP) [1], is considered NP-hard within the research area of combinatorial optimization problems. In TSP, a list of cities and the distances between each pair of cities are used to find the path that minimizes the distance traveled. For CVRP, a set of customers with known location and demand must be satisfied by a single depot by distributing vehicles of known capacity to design the routes of these vehicles to minimize traveling costs.The considered reoptimization problem uses an initial set of customers for designing routes for each vehicle. The vehicles start the routes with the previously scheduled customers until a part of the customers have been fulfilled, and some routes have been performed. Then, new customers are gradually revealed over the horizon time, each with known demand, which must be served by the used vehicles on the current routes, without exceeding their capacity and without modifying the sequence of customers already visited. However, the order of the initial unvisited customers on the routes could be modified. Therefore, it is desired to reoptimize the routing problem when new customers appear at any moment of a day.This paper proposes a route reoptimization heuristic for VRP when the number of customers increases after the development of the initial routes to reduce route dispersion and evaluate whether to modify or entirely redesign the route and its associated costs and provide relevant information for decision-making. However, the proposed approach could be used to reoptimize the routes when the customers decrease. This case is trivial due to the fact that the initial routes are reordered by considering less initial customers. A heuristic for reoptimizing vehicle routing, which delivers information on route dispersion and cost variation via key performance indicators (KPI), offers new decision elements for the transportation industry and streamlines the process of decision-making when including new customers.Currently, many studies on the vehicle routing problem focus on VRP variants, such as capacity-constrained VRP [2], multidepot VRP [3], heterogeneous fleet [4], time-frame VRP [5, 6], and Backhauls customers [7]. However, there is little information available for reoptimization when the number of customers increases in VRP. For this study, we considered the Capacitated Vehicle Routing Problem (CVRP) for route reoptimization. Toth and Vigo [8] proposed the formal definition of CVRP as follows: consider the distribution of goods from a singledepot, denoted as point 0, to a given group of n points (normally known ascustomers, N
=
1
,
2
,
…
,
n), where the amount to be delivered to each customer i
∈
N is known as the demand (
q
i
) and must meet the condition that q
i
≥
0. In addition, there is a homogeneous vehicle fleet K
=
1
,
2
,
…
,
K, which means that K vehicles are available in the depot, all with the same capacity Q
>
0. In the CVRP problem, a vehicle serving a subgroup of customers S
k
⊆
N starts in the depot, moves once towards each customer in S
k, and finally returns to the depot. A vehicle moving from i to j incurs in a travel cost c
i
j. CVRP aims to find the group of routes that minimize the cost of the distance travelled, with a route defined as the sequence r
=
(
i
0
,
i
1
,
i
2
,
…
,
i
s
,
i
s
+
1
) with i
0
=
i
s
+
1
=
0 in which group S
k
=
{
i
1
,
…
,
i
s
}
⊆
N of customers is visited. Route r has a cost c
r
≔
∑
p
=
0
S
c
i
p
,
i
p
+
1.In a possible solution of CVRP, the capacity constraintsq
S
≔
∑
i
∈
S
q
i
≤
Q are met, and additionally, no customer is visited more than once; that is, i
j
≠
i
k for each 1
≤
j
<
k
≤
s. In this case, it is said that S
k
⊆
N is afeasible cluster. One solution to the CVRP problem consists of K possible routes, one for each vehicle k
∈
K. Routes r
1
,
r
2
,
…
,
r
K and their corresponding clusters S
1
,
S
2
,
…
,
S
K provide a possible solution for CVRP if all routes are feasible and the clusters form an N partition.The problem considered in this study is of general interest given its relevance in the transportation industry because adding new customers can affect the routing of existing customers if the modification of initially planned routes is required. Therefore, it is necessary to analyze this situation and generate indicators that allow the measurement of the route's efficiency and the load balance between vehicles and the cost variation while minimizing the distance traveled and met the requirements of the customers. The load balance factor of vehicles represents the work distribution in the routes developed. Optimizing the balance in a route produces benefits such as a generation of savings and reduction in the use of extra hours and perceived equality regarding workers receiving fair treatment [9]. A good balance influences service quality and customer satisfaction; therefore, it is a relevant factor for decision-making.For reoptimization, which is similar to solving a dynamic VRP, a series of static VRPs is solved (multiple times) using several methods. An initial situation is a group of customers that produce a portion of the requests received during a particular time of the day and are assigned specific routes by a traditional optimization method. At a given point during the route, each vehicle stops and waits to receive a route update, including a new customer to visit, which can be a node modification of its original itinerary. Given that the information of new customers is not previously known, the initial routes do not consider the position or demand of new customers; therefore, reoptimization depends on more comprehensive constraints than does classic VRP.


## 2. Review of Literature

Dantzig and Ramserin first presented the vehicle routing problem (VRP) in 1959 under the name “the Truck Dispatching Problem” [10]. Since then, several variants of this problem have been studied, and an increasing number of reports show interest in this topic. Eksioglu et al. [11] estimate an exponential annual growth of 6.09% for the number of papers published on VRP.Several methods have been introduced to solve VRP; they can be classified as exact methods, heuristic algorithms, and metaheuristic algorithms [2]. Exact methods can solve small and medium VRP instances. Due to this limitation, most algorithms used to solve VRP are heuristic and metaheuristic [10]. Both heuristic and metaheuristic algorithms offer approximate solutions in reasonable computing times, so they are more practical for real-world cases and commercial applications.There are several variants of VRP; each variant is presented in scientific publications, and most variants include specific constraints that differentiate them. Toth and Vigo [8] reported approximately 40 variants of the problem and showed a classification that helps identify the general characteristics of VRP. Additionally, several taxonomies that consider the problem approached, solution methods, or other factors have been created to classify VRP literature. Eksioglu et al. [11] proposed a method for organizing VRP literature, while Psaraftis et al. [12] suggested a taxonomy for articles on dynamic and static VRPs. In particular, the problem targeted by this article is directly related to dynamic CVRP.However, stochastic and dynamic VRPs (DVRPs) are not mutually exclusive. Some articles show algorithms that can solve both problems [8]. A routing problem is dynamic if part of the relevant information about the conditions of the system becomes available during operations, and it is stochastic if the requirements of the system are unknown; a probability distribution describes this uncertainty.Currently, available solutions for DVRP are based on a simulated environment in which there is an event administrator who generates a static problem to be solved at every decision to create a new updated solution [13]. Several algorithms have been proposed to address DVRP [14–16]. Solving dynamic routing problems is challenging because the problem requires optimization in two directions. In principle, routes to be developed must be planned, while in a second stage, uncertain changes in the future must be anticipated to quantify their impact on the development of routes. Ulmer [17] compared the efficiency of reoptimization versus anticipation for DVRP with stochastic requirements, while Secomandi and Margot [16] developed and analyzed a Markovian process with a finite horizon for the problem of a single vehicle by establishing a partial characterization of the optimal policy.Periodic reoptimization is a solution strategy used for dynamic routing in which critical information becomes known over time. Thus, the entire instance is only known at the end of the planning horizon [18]. Therefore, exact methods provide an optimal solution for the current state, but they do not guarantee that the solution will remain optimal once new data is available. Thus, most dynamic approaches are based on heuristics that rapidly calculate a solution for the current problem state. For deterministic dynamic VRPs, there are two main solution approaches: periodic reoptimization and continuous reoptimization. The complexity of reoptimization processes increases for NP-Hard problems, according to Ausiello et al. [19].In the reviewed literature, few reports exist which are related to VRP reoptimization. Relevant studies in this area have been performed by Yang et al. [20], Montemanni et al. [13], Chen et al. [14], Hanshar and Ombuki-Berman [21], Créput et al. [15], Dan et al. [22], Yu et al. [23], Elhassania et al. [24], and Elhassania et al. [25]. Of these studies, the use of distance minimization as the objective function is prevalent [15, 23–25]. In Dan et al. [22], the number of vehicles and total traveled distance are considered in a weighted objective function. Montemanni et al. [13] discuss the travel time as the objective function given that, in cases applied for the same distance, there are different travel times, either because of traffic or terrain limitations. In contrast, Chen et al. [14] consider a combination of travel time and response time as the objective function of the system. Finally, Yang et al. [20] and Hanshar and Ombuki-Berman [21] consider cost (more specifically, travel cost) as the objective function, while Yang et al. [20] discuss the sum of multiple costs, such as empty travel costs, marginal costs derived from serving every new customer, and customer-rejection costs.Regarding the solution methods used, algorithms based on Ant Colony Optimization (ACO) have been introduced by Montemanni et al. [13], Dan et al. [22], Yu et al. [23], and Elhassania et al. [24]. In contrast, Hanshar and Ombuki-Berman [21] and Elhassania et al. [25] consider Genetic Algorithms (GA), and Yang et al. [20] propose methods based on local search procedures for stochastic DVRP with pick-up and delivery constraints. In particular, this study suggests policies based on the reoptimization of static VRP with insertion methods that calculate the marginal cost of serving a new customer and adding them at the end of the route. Chen et al. [14] propose a method based on the generation of columns to optimize travel and response times. Créput et al. [15] suggest a memetic algorithm based on organizational maps for dynamic scenarios.Most studies proposed for DVRP with reoptimization strategies focus on obtaining reduced computation times because the goal of dynamic VRP is obtaining information on routes as soon as possible, especially in real-world situations, for which it is necessary to transmit route adaptation information to a driver. Recent studies on reoptimization of similar problems have been proposed by AbdAllah et al. [26], Zhu et al. [27], Ninikas & Minis [28], and Archetti et al. [29].Contrary to what is found in, the literature we propose the use of measurements that calculate various indicators when reoptimizing to measure the difference between each generated scenario. In particular, we propose a methodology for obtaining solution alternatives that indicate performance measurements, and we consider factors such as the efficiency, balance, and homogeneity of the routes. Thus, the goal is reducing the impact on the route and the drivers to reduce costs.


## 3. Proposed Solution Method

### 3.1. Efficiency Measurements

The algorithm proposed uses quantitative factors that influence the efficiency of a route, which allows an objective comparison of various solutions in several dimensions. In particular, we propose four KPIs for measuring the length, balance, and dispersion of each route. Example of such measurements are: route length, average route efficiency [30], workload distribution [9], the marginal cost of adding a new customer, travel time, travel time as a percentage of the work day, and empty travel percentage [20].In this paper, we propose four KPIs: the well known of minimizing the total distance traveled, the minimization of the route length plus load dispersion, the minimization of the route load dispersion, and the minimization of the route length dispersion. The proposed criteria of efficiency measurement are as follows:(i)
Route length (MRlen): this is calculated as the total length of every route. This KPI corresponds to the classical measure of performance from the point of view of the owner of the vehicles.
(ii)
Route length load dispersion (MLLSD): this is calculated as the standard deviation of the length of every route by its load. It considers both measures in the same indicator, which is a benefit. It is used to balance route length and load. This KPI is directly related to the fuel consumption. (1)
σ
l
l
=
∑
i
=
1
n
x
i
-
μ
i
2
n
whereμ
i is the mean of the length by the route load, x
i is the length by the route load i, and n is the number of routes.
(iii)
Route load dispersion (MLoadSD): this measures standard deviation of the load on a route, that is, customer demand. It corresponds to the standard deviation of the route load.(2)
σ
l
o
a
d
=
∑
i
=
1
n
y
i
-
γ
i
2
n
whereγ
i is the mean load of all routes, y
i is the load of route i, and n is the number of routes.
(iv)
Route length dispersion (MLengthSD): this measures the length standard deviation on a route, that is, distance traveled. It can be used as a measure to guarantee a balanced workload and similar working times, thus avoiding driver overload. Given that it uses the standard deviation as a measure of dispersion, for a perfect balance, this dispersion should be zero.(3)
σ
=
∑
i
=
1
N
z
i
-
δ
i
2
n
Hereδ
i is the mean route length i, z
i is the length of route i, and n is the number of routes.For vehicle routing, reoptimization problems focused on route balance, a decision that focuses on minimizing dispersion. Nonetheless, there are not enough studies or dispersion measures tested or used as decision criteria to be used in this paper.


### 3.2. Description of the Proposed Algorithm

In this study, we proposed a heuristic algorithm that considers four variants to solve the reoptimization VRP. The first variant minimizes the total distance. The other variants correspond to methods of dispersion reduction of long∗ load, load, and length. These KPIs correspond to the minimization of the objective function only with one variant.An algorithm based on local searches is applied to improve the solution of the resultant VRP with the new information of the customers. The proposed algorithm is hierarchal, and it is split into three phases: (i) the first procedure establishes the routes with the original customers; (ii) then a reoptimization of the KPIs with the new customers is performed; and (iii) finally the reoptimization of the distance for each route is developed by keeping the performance of the KPIs. The details are presented below.


#### 3.2.1. Phase 1: Heuristic Solution with Only Initial Customers

The initial solution is generated using the VRPH library, which is based on the methods proposed by Groër et al. [31] [3, 32, 33]. Several algorithms are available in this library, including Record to Record (RTR) and Simulated Annealing (SA). Although both methods can create good feasible solutions, a priori comparison regarding length and computation time was performed to select the best algorithm between RTR and SA. In particular, RTR was chosen to generate the initial solution because it offers a shorter computation time with similar solution quality.


#### 3.2.2. Phase 2: KPI Minimization Procedure with Initial and New Customers

After phase 1, the clock stops when the vehicles have traveled part of the routes. At this moment, information is received from new customers, which must be scheduled considering the customers that have not been visited yet. The order on the routes of the unvisited customers can be modified during this phase.The new customers are inserted with a procedure for a KPI minimization implemented within Pseudocode1. In particular, we considered three methods that use the previously described efficiency measures. The first minimizes the length∗load using the standard deviation of the length∗load (MLLSD), the second minimizes the standard deviation of the load (MLoadSD), and the third minimizes the standard deviation of the length (MLengthSD). All three measures have the same code structure, while the comparison measurement is changed for each according to the method used. The code structure resembles the structure in Pseudocode 1, which shows the hierarchical nature of the algorithm.Pseudocode 1:Dispersion minimization reoptimization algorithm.
1For each  node in nodes  do:
2    r = NULL, KPI = +inf
3For each  route in routes  do:
4If  load(route) + demand(node) > capacity  then  Skip route
5             KPIm = KPI marginal when inserting node in route
6If  (KPI < KPIm)  then
7            r = route
8            KPI = KPIm
9If  r == NULL then
10         r = new route
11    cheapest insertion of node in r
12End


#### 3.2.3. Phase 3: Local Search Procedure with Initial and New Customers

After reoptimization is performed, there is a local search [34] improvement stage that uses insertion and swap neighborhoods. The goal of this stage is improving the distance for each route. The local search approach could be seen as descendant gradient algorithm, where the neighborhood solutions could be performed moving a customer from the current position and inserting it in another position (Insertion) or exchanging the order of customers within routes (Swap) [35, 36]. The pseudocode is presented in Pseudocode 2.Pseudocode 2:Local search reoptimization algorithm.
1For each route in routes do:
2     mov = NULL; node1 = NULL, node2 = NULL, delta = +inf
3For each  n1, n2 in routes  do:
4if  cost-insertion(n1, n2) < delta,  then
5             mov = insertion; node1 = n1; node2 = n2; delta = then cost-insertion(n1, n2)
6if  cost-swap(n1, n2) < delta,  then
7             mov = swap; node1 = n1; node2 = n2; delta = then cost-insertion(n1, n2)
8if  temporal dispersion < initial dispersion  then:
9if  delta <= 0 and mov == insertion,  then
10       apply-insertion(node1, node2)
11if  delta <= 0 and mov == swap,  then
12        apply-swap(node1, node2)
13End


## 3.1. Efficiency Measurements

The algorithm proposed uses quantitative factors that influence the efficiency of a route, which allows an objective comparison of various solutions in several dimensions. In particular, we propose four KPIs for measuring the length, balance, and dispersion of each route. Example of such measurements are: route length, average route efficiency [30], workload distribution [9], the marginal cost of adding a new customer, travel time, travel time as a percentage of the work day, and empty travel percentage [20].In this paper, we propose four KPIs: the well known of minimizing the total distance traveled, the minimization of the route length plus load dispersion, the minimization of the route load dispersion, and the minimization of the route length dispersion. The proposed criteria of efficiency measurement are as follows:(i)
Route length (MRlen): this is calculated as the total length of every route. This KPI corresponds to the classical measure of performance from the point of view of the owner of the vehicles.
(ii)
Route length load dispersion (MLLSD): this is calculated as the standard deviation of the length of every route by its load. It considers both measures in the same indicator, which is a benefit. It is used to balance route length and load. This KPI is directly related to the fuel consumption. (1)
σ
l
l
=
∑
i
=
1
n
x
i
-
μ
i
2
n
whereμ
i is the mean of the length by the route load, x
i is the length by the route load i, and n is the number of routes.
(iii)
Route load dispersion (MLoadSD): this measures standard deviation of the load on a route, that is, customer demand. It corresponds to the standard deviation of the route load.(2)
σ
l
o
a
d
=
∑
i
=
1
n
y
i
-
γ
i
2
n
whereγ
i is the mean load of all routes, y
i is the load of route i, and n is the number of routes.
(iv)
Route length dispersion (MLengthSD): this measures the length standard deviation on a route, that is, distance traveled. It can be used as a measure to guarantee a balanced workload and similar working times, thus avoiding driver overload. Given that it uses the standard deviation as a measure of dispersion, for a perfect balance, this dispersion should be zero.(3)
σ
=
∑
i
=
1
N
z
i
-
δ
i
2
n
Hereδ
i is the mean route length i, z
i is the length of route i, and n is the number of routes.For vehicle routing, reoptimization problems focused on route balance, a decision that focuses on minimizing dispersion. Nonetheless, there are not enough studies or dispersion measures tested or used as decision criteria to be used in this paper.


## 3.2. Description of the Proposed Algorithm

In this study, we proposed a heuristic algorithm that considers four variants to solve the reoptimization VRP. The first variant minimizes the total distance. The other variants correspond to methods of dispersion reduction of long∗ load, load, and length. These KPIs correspond to the minimization of the objective function only with one variant.An algorithm based on local searches is applied to improve the solution of the resultant VRP with the new information of the customers. The proposed algorithm is hierarchal, and it is split into three phases: (i) the first procedure establishes the routes with the original customers; (ii) then a reoptimization of the KPIs with the new customers is performed; and (iii) finally the reoptimization of the distance for each route is developed by keeping the performance of the KPIs. The details are presented below.


### 3.2.1. Phase 1: Heuristic Solution with Only Initial Customers

The initial solution is generated using the VRPH library, which is based on the methods proposed by Groër et al. [31] [3, 32, 33]. Several algorithms are available in this library, including Record to Record (RTR) and Simulated Annealing (SA). Although both methods can create good feasible solutions, a priori comparison regarding length and computation time was performed to select the best algorithm between RTR and SA. In particular, RTR was chosen to generate the initial solution because it offers a shorter computation time with similar solution quality.


### 3.2.2. Phase 2: KPI Minimization Procedure with Initial and New Customers

After phase 1, the clock stops when the vehicles have traveled part of the routes. At this moment, information is received from new customers, which must be scheduled considering the customers that have not been visited yet. The order on the routes of the unvisited customers can be modified during this phase.The new customers are inserted with a procedure for a KPI minimization implemented within Pseudocode1. In particular, we considered three methods that use the previously described efficiency measures. The first minimizes the length∗load using the standard deviation of the length∗load (MLLSD), the second minimizes the standard deviation of the load (MLoadSD), and the third minimizes the standard deviation of the length (MLengthSD). All three measures have the same code structure, while the comparison measurement is changed for each according to the method used. The code structure resembles the structure in Pseudocode 1, which shows the hierarchical nature of the algorithm.Pseudocode 1:Dispersion minimization reoptimization algorithm.
1For each  node in nodes  do:
2    r = NULL, KPI = +inf
3For each  route in routes  do:
4If  load(route) + demand(node) > capacity  then  Skip route
5             KPIm = KPI marginal when inserting node in route
6If  (KPI < KPIm)  then
7            r = route
8            KPI = KPIm
9If  r == NULL then
10         r = new route
11    cheapest insertion of node in r
12End


### 3.2.3. Phase 3: Local Search Procedure with Initial and New Customers

After reoptimization is performed, there is a local search [34] improvement stage that uses insertion and swap neighborhoods. The goal of this stage is improving the distance for each route. The local search approach could be seen as descendant gradient algorithm, where the neighborhood solutions could be performed moving a customer from the current position and inserting it in another position (Insertion) or exchanging the order of customers within routes (Swap) [35, 36]. The pseudocode is presented in Pseudocode 2.Pseudocode 2:Local search reoptimization algorithm.
1For each route in routes do:
2     mov = NULL; node1 = NULL, node2 = NULL, delta = +inf
3For each  n1, n2 in routes  do:
4if  cost-insertion(n1, n2) < delta,  then
5             mov = insertion; node1 = n1; node2 = n2; delta = then cost-insertion(n1, n2)
6if  cost-swap(n1, n2) < delta,  then
7             mov = swap; node1 = n1; node2 = n2; delta = then cost-insertion(n1, n2)
8if  temporal dispersion < initial dispersion  then:
9if  delta <= 0 and mov == insertion,  then
10       apply-insertion(node1, node2)
11if  delta <= 0 and mov == swap,  then
12        apply-swap(node1, node2)
13End


## 3.2.1. Phase 1: Heuristic Solution with Only Initial Customers

The initial solution is generated using the VRPH library, which is based on the methods proposed by Groër et al. [31] [3, 32, 33]. Several algorithms are available in this library, including Record to Record (RTR) and Simulated Annealing (SA). Although both methods can create good feasible solutions, a priori comparison regarding length and computation time was performed to select the best algorithm between RTR and SA. In particular, RTR was chosen to generate the initial solution because it offers a shorter computation time with similar solution quality.


## 3.2.2. Phase 2: KPI Minimization Procedure with Initial and New Customers

After phase 1, the clock stops when the vehicles have traveled part of the routes. At this moment, information is received from new customers, which must be scheduled considering the customers that have not been visited yet. The order on the routes of the unvisited customers can be modified during this phase.The new customers are inserted with a procedure for a KPI minimization implemented within Pseudocode1. In particular, we considered three methods that use the previously described efficiency measures. The first minimizes the length∗load using the standard deviation of the length∗load (MLLSD), the second minimizes the standard deviation of the load (MLoadSD), and the third minimizes the standard deviation of the length (MLengthSD). All three measures have the same code structure, while the comparison measurement is changed for each according to the method used. The code structure resembles the structure in Pseudocode 1, which shows the hierarchical nature of the algorithm.Pseudocode 1:Dispersion minimization reoptimization algorithm.
1For each  node in nodes  do:
2    r = NULL, KPI = +inf
3For each  route in routes  do:
4If  load(route) + demand(node) > capacity  then  Skip route
5             KPIm = KPI marginal when inserting node in route
6If  (KPI < KPIm)  then
7            r = route
8            KPI = KPIm
9If  r == NULL then
10         r = new route
11    cheapest insertion of node in r
12End


## 3.2.3. Phase 3: Local Search Procedure with Initial and New Customers

After reoptimization is performed, there is a local search [34] improvement stage that uses insertion and swap neighborhoods. The goal of this stage is improving the distance for each route. The local search approach could be seen as descendant gradient algorithm, where the neighborhood solutions could be performed moving a customer from the current position and inserting it in another position (Insertion) or exchanging the order of customers within routes (Swap) [35, 36]. The pseudocode is presented in Pseudocode 2.Pseudocode 2:Local search reoptimization algorithm.
1For each route in routes do:
2     mov = NULL; node1 = NULL, node2 = NULL, delta = +inf
3For each  n1, n2 in routes  do:
4if  cost-insertion(n1, n2) < delta,  then
5             mov = insertion; node1 = n1; node2 = n2; delta = then cost-insertion(n1, n2)
6if  cost-swap(n1, n2) < delta,  then
7             mov = swap; node1 = n1; node2 = n2; delta = then cost-insertion(n1, n2)
8if  temporal dispersion < initial dispersion  then:
9if  delta <= 0 and mov == insertion,  then
10       apply-insertion(node1, node2)
11if  delta <= 0 and mov == swap,  then
12        apply-swap(node1, node2)
13End


## 4. Results and Discussion

The proposed algorithm was implemented in PHP 5.6 using a computer with a 3.10-GHz AMD FX(tm)-8120 microprocessor with 8-GB RAM and 64-bit Microsoft Windows 8 Pro. The most recent set of instances presented by Uchoa et al. [37] was used to test the efficiency of the proposed approach. This set contains 100 instances ranging from 100 to 1,000 customers.Due to the dynamic nature of the VRP problem, the existing instances must be adapted. The customers for each instance are divided into original and new customers. These nodes are randomly selected using the method proposed by Matsumoto and Nishimura [38]. Then phase 1 is executed, and new customers are added reoptimizing phases 2 and 3. For each classic instance, five random seeds were generated to create a unique set of extracted nodes. The results show the mean of the measurements for each instance and method. Figure 1 shows the experimental layout.Figure 1
Experimental layout.


### 4.1. Results of the Mean Length by Method

When comparing the dispersion methods with length reoptimization, we observed that all methods show an increase between 10.4% and 11.3% (Table1). From a business point of view, the variations correspond to an increase in the travelled distance to obtain routes with less deviation to achieve smaller differences in load, length, or load by length.Table 1
Length variation.
Method
Mean variation
MLLSD – MRlen
10.49%
MLoadSD – MRlen
11.26%
MLengthSD – MRlen
10.42%


### 4.2. Mean Standard Deviation Results

Table2 shows the difference between the methods in the row minus the method in the column. Thus, if we aim for minimal load deviation, minimizing length deviation (21.65%) or length by load (14.94%) is more expensive than the other method. Based on the results, we recommend having a minimal deviation of length per load because, with this method, the load (4.97%) and length (1.48%) deviations have smaller increases than the methods in columns 1 and 2. This result is important because length per load has a direct relationship with fuel consumption.Table 2
Difference in the standard deviation of each method.
Mean variation
MLoadSD
MLengthSD
MLLSD
MLoadSD
-
7.26%
4.97%
MLengthSD
21.65%
-
1.48%
MLLSD
14.94%
1.32%
-Regarding computation time, we found that the CPU time for all four methods is quite similar in instances of up to 400 nodes; for larger instances, the computation time of the length reoptimization method rapidly increases and is longer than the other methods for these instances. Finally, when the MRlen method is removed, we observed that, on average, the algorithm does not surpass 40 seconds of CPU time.Likewise, a local search (phase 3) provides a significant contribution to the objective function in all reoptimization methods, especially for the method that minimizes the standard deviation of the load of the routes. Table3 summarizes these findings.Table 3
Contribution of the local search of each method.
Method
Average contribution
MRlen
2.07%
MLLSD
5.33%
MLoadSD
23.14%
MLengthSD
3.78%When comparing the original problem, that is, having complete information at the beginning of optimization, with the length reoptimization case, the length was observed to increase by an average of 36.96%. For the reoptimization method, the load dispersion cost was minimized by 52.26% more than the method with perfect information. The cost of the planner is based on taking naive decisions for each additional customer inserted (see Table4). This is understood as the no-information cost or as the cost of not having complete information at the beginning of optimization. In contrast, for the instances used, demand is generated in seven ways. Thus, balancing the load in an instance will be affected by the structure of demand, which, according to Uchoa et al. [37], also affects the length of the routes.Table 4
Cost relative to perfect information.
Method
Increase
MRLen-Ori
36.96%
MLLSD-Ori
51.19%
MLoadSD-Ori
52.26%
MLengthSD-Ori
51.07%
Planner
72.18%This procedure could be extended to the case where the number of customers is reduced by applying the methodology proposed by Ausellio et al. [39]. In the case that some customers must be added and others must be eliminated, the customers assigned to the existing routes must be removed from the current routes, and then the new customers must be added by using the proposed algorithm.The proposed approach could be extended to other variants of the VRP, being able to distinguish two cases. The first case could be adapted to problems when the capacity of the vehicle is considered a fundamental constraint, and it is previously verified. The first problem of this case is the Vehicle Routing Problem with Backhauls (VRPB) [7]. In the VRPB, the insertion of new customers does not invalidate the route due to the fact that they are inserted in the phase of linehaul and/or backhaul stage. The second problem could be the Vehicle Routing Problem with Pickup and Delivering (VRPPD) and other related problems with similar characteristics.The second case occurs when the new inserted customers could invalidate the planned routes. The insertion of new customers for problems such as Vehicle Routing Problem with Time Windows (VRPTW) could become unfeasible routes due to the time windows constraints. In this case, a new algorithm must be developed considering a penalty scheme to avoid infeasible solutions.


## 4.1. Results of the Mean Length by Method

When comparing the dispersion methods with length reoptimization, we observed that all methods show an increase between 10.4% and 11.3% (Table1). From a business point of view, the variations correspond to an increase in the travelled distance to obtain routes with less deviation to achieve smaller differences in load, length, or load by length.Table 1
Length variation.
Method
Mean variation
MLLSD – MRlen
10.49%
MLoadSD – MRlen
11.26%
MLengthSD – MRlen
10.42%


## 4.2. Mean Standard Deviation Results

Table2 shows the difference between the methods in the row minus the method in the column. Thus, if we aim for minimal load deviation, minimizing length deviation (21.65%) or length by load (14.94%) is more expensive than the other method. Based on the results, we recommend having a minimal deviation of length per load because, with this method, the load (4.97%) and length (1.48%) deviations have smaller increases than the methods in columns 1 and 2. This result is important because length per load has a direct relationship with fuel consumption.Table 2
Difference in the standard deviation of each method.
Mean variation
MLoadSD
MLengthSD
MLLSD
MLoadSD
-
7.26%
4.97%
MLengthSD
21.65%
-
1.48%
MLLSD
14.94%
1.32%
-Regarding computation time, we found that the CPU time for all four methods is quite similar in instances of up to 400 nodes; for larger instances, the computation time of the length reoptimization method rapidly increases and is longer than the other methods for these instances. Finally, when the MRlen method is removed, we observed that, on average, the algorithm does not surpass 40 seconds of CPU time.Likewise, a local search (phase 3) provides a significant contribution to the objective function in all reoptimization methods, especially for the method that minimizes the standard deviation of the load of the routes. Table3 summarizes these findings.Table 3
Contribution of the local search of each method.
Method
Average contribution
MRlen
2.07%
MLLSD
5.33%
MLoadSD
23.14%
MLengthSD
3.78%When comparing the original problem, that is, having complete information at the beginning of optimization, with the length reoptimization case, the length was observed to increase by an average of 36.96%. For the reoptimization method, the load dispersion cost was minimized by 52.26% more than the method with perfect information. The cost of the planner is based on taking naive decisions for each additional customer inserted (see Table4). This is understood as the no-information cost or as the cost of not having complete information at the beginning of optimization. In contrast, for the instances used, demand is generated in seven ways. Thus, balancing the load in an instance will be affected by the structure of demand, which, according to Uchoa et al. [37], also affects the length of the routes.Table 4
Cost relative to perfect information.
Method
Increase
MRLen-Ori
36.96%
MLLSD-Ori
51.19%
MLoadSD-Ori
52.26%
MLengthSD-Ori
51.07%
Planner
72.18%This procedure could be extended to the case where the number of customers is reduced by applying the methodology proposed by Ausellio et al. [39]. In the case that some customers must be added and others must be eliminated, the customers assigned to the existing routes must be removed from the current routes, and then the new customers must be added by using the proposed algorithm.The proposed approach could be extended to other variants of the VRP, being able to distinguish two cases. The first case could be adapted to problems when the capacity of the vehicle is considered a fundamental constraint, and it is previously verified. The first problem of this case is the Vehicle Routing Problem with Backhauls (VRPB) [7]. In the VRPB, the insertion of new customers does not invalidate the route due to the fact that they are inserted in the phase of linehaul and/or backhaul stage. The second problem could be the Vehicle Routing Problem with Pickup and Delivering (VRPPD) and other related problems with similar characteristics.The second case occurs when the new inserted customers could invalidate the planned routes. The insertion of new customers for problems such as Vehicle Routing Problem with Time Windows (VRPTW) could become unfeasible routes due to the time windows constraints. In this case, a new algorithm must be developed considering a penalty scheme to avoid infeasible solutions.


## 5. Conclusions and Future Studies

In this study, we proposed a heuristic algorithm for capacitated vehicle routing reoptimization with an increase in the number of customers. The algorithm uses several proposed efficiency metrics to reduce route dispersion and minimize length.The initial solution is generated using the Record-to-Record (RTR) algorithm proposed in the VRPH library from Groër et al. [31]. Following the inclusion of new customers in the system, a reoptimization is performed which considers the visited nodes and edges as fixed. The optimization of the algorithm is performed hierarchically; KPI is first minimized, and then distance is minimized. Next, a local search procedure is executed using insertion and swap neighborhoods to improve the solution.The effectiveness of the algorithm proposed has been confirmed using real-world instances from the literature. The proposed key performance indicators (KPIs) are designed to improve the balance among routes, generate savings, reduce the number of extra hours, and increase the perception of the fair treatment of workers. In contrast, planners are willing to consider longer routes if the workload is equally distributed among the vehicle fleet [40].The results show that is necessary to make significant sacrifices regarding route cost to minimize dispersion. On average, the cost of minimizing load dispersion is 11.26% to obtain a reduction of at least 12.81%. The costs of this policy surpass the perfect information cost by 52.26%. Regarding the local searches used, for the load standard deviation method, a mean reduction of 23.14%, in terms of KPI, is achieved.For future studies, we recommend the design of a metaheuristic focused on minimizing dispersion; particularly, the use of tabu search or simulated annealing is recommended. Moreover, adding new local search neighborhoods specialized for the minimization of dispersion and reoptimization is recommended.



---

*Source: 3743710-2018-11-01.xml*