Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 47 (2015) 229–236 www.elsevier.com/locate/endm
A Variable Neighborhood Search for the Vehicle Routing Problem with Time Windows and Preventive Maintenance Activities Amine Dhahri a
a,1
Kamel Zidi
a,2
Khaled Ghedira
b,3
National School of Computer Science (ENSI), Tunis, Tunisia b
SOIE, Higher Institute of Management, Tunis, Tunisia
Abstract In this paper we address a vehicle routing problem with time windows (VRPTW) with preventive maintenance (VRPTW-PM) and we propose a mathematical formulation for this problematic situation as well as a variable neighborhood search (VNS) metaheuristic to be solved. First, we solve the standard VRPTW with 100 customer solomon benchmark to produce the original plan, then we introduce maintenance activity to the vehicle that made the longest distance based on the original plan. A scheduling model is presented based on the VNS metaheuristic for the vehicle routing problem with time windows when one or more vehicles require preventive maintenance activities after the supply of a set of customers. Computational results show the efficiency of the proposed approach. Keywords: Preventive maintenance, VNS, Routing problem, time windows.
1 2 3
Email:
[email protected] Email:
[email protected] Email:
[email protected]
http://dx.doi.org/10.1016/j.endm.2014.11.030 1571-0653/© 2014 Elsevier B.V. All rights reserved.
230
1
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
Introduction
The majority of studies concerned with the planning of the supply chain are placed in an environment where all vehicles are available. However, in reality this is not the case. Indeed, physical resources such as vehicles may be unavailable for various reasons such as the preventive maintenance implemented by the maintenance department, or other factors. Vehicles can therefore be unavailable during certain periods, where dates and times are fixed and known beforehand (deterministic case) which is our case study. Among the first studies that have treated disruption management, Yu and Yang in [7] are the first to explore issues related to real-time control of airline operations; and the successful application of their ideas has led to a growing interest in disruption managements. In this work, we propose a Variable Neighborhood Search (VNS) algorithm to treat the VRPTW-PM. VNS [4] is a metaheuristic based on the systematic exploration of different neighborhood structures, within a local search routine. This method has been used in numerous classes of problems, namely in different variants of vehicle routing problems [2].
2
Problem Definition
The problem addressed in this paper is a variant of VRPTW. In this case, the availability involves a vehicle vi that requires preventive maintenance activities at time t after leaving the depot and before delivering to the final customer on its route. We only look at the case where one vehicle is available because it is unusual to have more than one vehicle that require maintenance activities at the same period of planification. In this situation, we need to prepare a plan reflecting the constraints and objectives of the evolved environment while minimizing the negative impact of disruption. Extra vehicles (EVs) may have to be used to finish serving not served customers knowing that EV is available in the depot. The Solution that does not require the use of an EV is always better than the one that requires an EV and the number of vehicles used in the original plan (planification without maintenance activity). The number of vehicles used in the original plan is maximized when preparing the plan where maintenance activity is taken into account also the distance is minimized. The objective is to minimize the number of vehicles used and to minimize the total traveled distance by all the vehicles. If a vehicle is available due to a maintenance constraint when it is serving a customer, this customer will not need to be visited by another vehicle so priority is given to minimizing the number of vehicles. Therefore, a solution with fewer vehicles will always be
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
231
better than a solution with more vehicles. For those solutions with the same number of vehicles, the solution with the minimum total travel distance is preferred. The VRPTW-PM is defined as follows: given a graph (V ,A) where V = {0, ..., n + 1} a customer set and A = {(i; j)|i, j; ∈ V } an arc set. Node 0 is the depot, and node i is a customer location with demand qi , service time windows (ei , li ) where ei is the earliest time that service can begin and li is the latest time that service can begin and service time si . Each arc (i, j) has a non-negative distance dij . A set K of identical vehicles with capacity Q should attend n customers, represented by vertices 1, .., n. Consider that N = V − {0; n + 1} the total demand of each route that should not exceed Q. Tk denotes the time that vehicle k starts a preventive maintenance activities (PM), and πk denotes the time that take PM. 1 if vehicle k used in the original plan αk = 0 else 1 if Tk ∈ [bik , bjk ] zijk = 0 else xijk =
1 if vehicle k travel from customer ci to cj 0 sinon
min z =
n v n
cij xijk − μ
i=0 j=0 k=1
s.t.
n v n
αk x0jk
(1)
i=0 j=0 k=1
xijk = 1 ∀i ∈ N
(2)
k∈K j∈V
x0jk = 1 ∀k ∈ K ∀k ∈ V
j∈V
xijx −
i∈V
i∈N
xjix = 0 ∀k ∈ K
(4)
i∈V
xi(n+1)k = 1 ∀k ∈ K ∀k ∈ K
j∈V
(3)
qi
j∈V
xijk ∀k ∈ K
(5) (6)
232
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
bik + si + tij + zijk πk ≤ M ∗ (1 − xijk ) + bjk i, j = 0, 1, .., n, i = j ∀k ∈ K ∀(i, j) ∈ A ei ≤ bik ≤ li ∀k ∈ K, ∀i ∈ V xijk ∈ {0, 1}
(7) (8) (9)
The objective function (1) represents the total cost to be minimized. Constraints (2) assure that customer i is delivered only by one vehicle k. Constraints (3)-(5) are flow constraints of the vehicle k; that is, each vehicle leaves the depot, visits the customers, and then, returns to the depot. Constraints (6) guarantee that the vehicle capacity is not exceeded. Constraints (7) and (8) signify the time constraints; to make sure that time window is not violated, knowing that the value of zijk depends on bik where bik represents the time from which the vehicle k begins to serve the customer i and Mij are large constants. According to [1], Mij can be replaced by max {ei + di + cij − ej , 0} ∀i, j ∈ A. Constraints (9) define the domain of the decision variables xijk .
3
Variable neighborhood search for the VRPTW-PM
Algorithm 1 Basic steps of VNS Initialization:choose a set of neighborhood structure Nk , k = 1, ..., kmax and Nk , k = 1, ..., kmax choose a distribution function of random variable, initial solution x and define the stopping criterion. repeat K←1 repeat Shaking: generate randomly a solution y from the kth neighborhood y ∈ Nk(x) ; kth neighborhood y ∈ Nk(x) Local search: apply Local Search procedure 3.3 with Ns and y initial solution to obtain a local optimum denoted y1 if the local optimum y1 is better than x then (1) (x ← y1 ) (2) continue the search with N1 (k = 1) else k ← k + 1. end if until k < kmax until the stopping criterion is checked
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
233
3.1 Initial Solution In this work we used The Nearest Neighbor algorithm for which Solomon in [5] proposed a cost function to generate a initial solution. The nearest-neighbor heuristic every route by finding the unrouted customer closest(in terms of a measure)to the depot. At every subsequent iteration, the heuristic searches for the customer closest to the last customer added to the route. This search is performed among all the customers. 3.2 Shaking In the shaking phase customers how will be changed are selected randomly and also the target route were we will insert the segment of customers is selected randomly, the algorithm stopped with the first changed solution. T wo − opt, Insert − Move (change the position of γ ∈ [1, 2] consecutive customers), swap − move (swap the position of two different customers), T wo − opt∗ , Exchange (exchange of a value of γ customers between two different routes where in our case γ ∈ [1, 5]) and Relocate (exchanged the location of γ customers located consecutively in the original route with γ ∈ [1, 5]). All these moves are used to generate neighborhoods, see [2] for more details. 3.3 Local Search To ameliorate the solution obtained through the shaking process, it will be subjected to a Local search LS method using five neighborhood, N1 ..N9 with the best improvement strategy; T wo − opt, Relocate with the relocation of one vertex and two vertices, T wo − opt∗ , swap − moves, insert − move(1), insert − move(2) and Exchange with the exchange of one and two vertices. 3.4 Acceptance Criterion We put in place a system that is inspired by the simulated annealing (SA) [3]. A solution obtained after the local search procedure is always accepted if the quality of the solution obtained is better and it is also accepted with a cost higher than the current solution with a probability exp(−(f (x ) − f (x)/T )) with f (x) the cost of the solution see [3] to more details.
4
Experimental Results
In this section we describe preliminary results of applying The VNS algorithm for the VRPTW-PM that was implemented by JAVA and executed on a 2.53
234
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
GHz Intel Core i5 with 4GB RAM and the results of resolution of the MIP Model coded with C++ with the same configuration machine. The proposed VNS approach is tested by the classical set of 56 benchmark problems of Solomon [6]. Two problems are selected for each type. For the original plan, the VNS algorithm is also used to solve the classical VRPTW with parameter settings, initial temperature value of T0 = 100, the stopping criterion is the execution time, set to 200 seconds for each configuration. Table 1 shows several configurations used to test the impact of such deterministic unavailability to the VRPTW; (2,10,20) denotes that vehicle 2 starts the maintenance activity at time 10 and takes 20 unit of time. A benchmark of 25 customers (from customer 1 to 25) from Problem R101 is used. To see the effectiveness of VNS approach for the VRPTW-PM, a series of experiments is conducted using different scenarios of unavailability of vehicles with different commencements of maintenance activity throughout the horizon plan (Table 2). As shown in Table 1 solutions produced by the VNS approach are near to the optimal solution obtained by the implementation of the MIP model, in 2 problems optimal solutions are found. When testing problems with 100 customers, (Table 3) and in terms of solution quality, we can see that the proposed procedure performs consistently better than when using the easy plan. Table 1 Comparison with the results of MIP model and VNS metaheuristic VRPTW-PM (VNS)
Easy Plan
VRPTW-PM(MIP)
NV
TT
NV
TT
NV
TT
(1,10,20)
3
314.15
4
350.10
3
310.52
(1,80,50)
4
322.14
4
343.03
3
332.18
(1,100,30)
3
307.77
4
350.09
3
307.77
(2,10,20)
3
314.15
4
341.37
3
310.52
(2,80,50)
3
342.91
4
333.71
3
332.18
(2,100,30)
3
320.75
4
328.88
3
307.77
(3,10,20)
3
307.77
3
307.77
3
307.77
(3,80,50)
4
342.13
4
352.50
3
332.18
(3,100,30)
3
307.77
3
307.77
3
307.77
(1,10,20),(2,10,20)
4
337.91
4
362.48
3
313.46
(1,10,20),(3,10,20)
3
347.05
4
350.10
3
313.46
(1,30,40),(2,40,20)
4
320.83
4
370.67
3
325.51
(1,30,20),(3,40,20)
3
321.25
4
350.10
3
314.36
(2,10,20),(3,10,20)
3
314.15
4
341.37
3
313.46
(2,30,40),(3,40,20)
3
326.03
4
333.71
3
326.03
235
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
Table 2 Configuration for maintenance activity R1
γ=1
γ=2
γ=3
(30,40)
(100,40)
(200,40)
R2
(50,40)
(500,40)
(900,40)
C1
(100,40)
(700,40)
(1000,40)
C2
(100,40)
(1500,40)
(2500,40)
RC1
(30,40)
(100,40)
(200,40)
RC2
(50,40)
(100,40)
(200,40)
Table 3 Computational results Problem
R102 R104 R205 R208 C101 C108 C206 C202 RC104 RC108 RC204 RC205
values
Original Plan
Easy Plan
VRPTW-PM (VNS)
γ=1
γ=2
γ=3
γ=1
γ=2
γ=3
NV
18
19
19
19
19
19
19
TT
1484.38
1484.38
1524.93
1519.44
1477.84
1518.20
1497.98
NV
11
12
12
11
12
12
11
TT
991.57
1058.45
1044.12
991.57
1029.78
1028.63
991.57
NV
3
4
4
3
4
4
3
TT
1081.85
1222.48
1108.22
1081.85
1114.96
1108.22
1081.85
NV
2
3
3
3
3
3
3
TT
791.92
883.10
832.3
883.10
888.28
889.95
923.32
NV
10
10
10
10
10
10
10
TT
828.93
828.93
828.93
828.93
828.93
828.93
828.93
NV
10
10
10
10
10
10
10
TT
828.93
828.93
828.93
828.93
828.93
828.93
828.93
NV
3
4
4
4
4
4
4
TT
588.49
623.59
623.59
623.59
620.30
620.69
620.30
NV
3
4
4
4
4
4
4
TT
588.49
623.59
623.59
626.65
607.93
609.44
607.93
NV
10
11
11
10
11
11
10
TT
1151.50
1284.74
1243.63
1151.50
1182.05
1188.79
1151.50
NV
14
15
15
14
15
15
14
TT
1427.91
1517.52
1500.44
1427.91
1478.51
1484.00
1427.91
NV
3
4
4
4
4
4
4
TT
955.74
1047.86
1047.88
1018.67
1026.53
983.50
958.99
NV
4
5
5
5
5
5
5
TT
1371.43
1483.22
1483.22
1483.22
1392.60
1403.49
1403.49
236
5
A. Dhahri et al. / Electronic Notes in Discrete Mathematics 47 (2015) 229–236
Conclusion
In this paper, we have presented a scheduling model for the vehicle routing problem with time windows in case of unavailability of vehicles due to preventive maintenance activities at a given time and for a defined period after that a subset of customers have been visited. The objective function is to find a new planification that minimizes the deviation from the original planning in term of number of vehicles and total traveled distance. Although the problem of planification is complicated by a variety of factors, this paper provides an approach based on VNS to treat this type of problem. Experiments were equally carried out to study how maintenance activity works. Experimental results also showed that the VNS algorithm consistently produces high performance.
References [1] Cordeau, J.-F., G. Desaulniers, J. Desrosiers, M. M. Solomon and F. Soumis, VRP with time windows, The vehicle routing problem 9 (2001), pp. 157–193. [2] Dhahri, A., K. Zidi and K. Ghedira, Variable neighborhood search based set covering ILP model for the vehicle routing problem with time windows, Procedia Computer Science 29 (2014), pp. 844–854. [3] Kirkpatrick, S., Optimization by simulated annealing: Quantitative studies, Journal of statistical physics 34 (1984), pp. 975–986. [4] Mladenović, N. and P. Hansen, Variable neighborhood search, Computers & Operations Research 24 (1997), pp. 1097–1100. [5] Solomon, M. M., Algorithms for the vehicle routing and scheduling problems with time window constraints, Operations research 35 (1987), pp. 254–265. [6] Solomon, M. M., VRPTW benchmark problems, Excerpt from unpublished article, n. pag. http://w.cba.neu.edu/~msolomon. (15 May 2000). [7] Yu, G. and J. Yang, “Optimization applications in the airline industry,” Springer, 1999.