Академический Документы
Профессиональный Документы
Культура Документы
Cari: Solving Practical Vehicle Routing Problem with Time Windows Using Metaheuristic Algorithms
graphs are used where costs in opposite direction are 3. INITIAL SOLUTION
not same cij ! c ji . The homogeneous fleet of K vehi-
cles is available in the depot and each vehicle is used In order to effectively solve VRPTW problem, it is
only for one route which begins and ends in the depot. necessary to obtain a feasible initial solution in which
Let route of single vehicle R is sequence of custom- all constraints are satisfied. Due to the fact that finding
ers starting and ending in the depot. If there are only of a feasible solution for VRPTW problem with minimal
capacity constrains in the problem it can be treated number of vehicles is a very complex task, construc-
as Capacitated Vehicle Routing problem (CVRP). Each tive heuristic algorithms often produce solutions of
customer has non-negative demand mi while each ve- bad quality which serve only as a starting point for fur-
hicle ki is limited by maximal capacity qi . Basic variant ther optimization. Best known constructive algorithm
of problem can be extended by additional constraints. for VRPTW is Solomon I1 heuristic. Simplified descrip-
Figure 1 shows different variants of VRP problem and tion is presented in Algorithm 1 and more details can
relations between them [1]. be found in original paper [7]. Function FindSeed()
selects the first customer which will be inserted into
the vehicle route. Criteria for its selection are the mea-
VRP sure of how far away it is from the depot and how close
is its time window opening. Inside main loop function
Capacity
constraints FindNewCustomer(v) searches for un-served customer
that can be inserted into a route of current vehicle v
CVRP Mix
without violation of time and capacity constraints.
g
aulin ed
ser If it fails, a new vehicle is engaged and a new seed
ckh Time vic
Ba
Windows
e customer is added to the route. Function Terminate()
checks if there are more un-routed customers.
VRPB VRPTW VRPPD
Algorithm 1. Solomons I1 insertation heuristic
procedure SolomonI1()
c := FindSeed()
VRPBTW VRPPDTW v :=NewVehicle()
AddToRoute(c, v)
Figure 1 - VRP variants and their interconnections while not Terminate() do
Source: prepared by the author on the basis of [1] c := FindNewCustomer(v)
if c != null then
If customers request delivery within a specific time InsertCustomer(c, v)
window, the problem can be modelled as vehicle rout- else
ing problem with time windows (VRPTW). In case of c:=FindSeed()
simultaneous pickup and delivery of goods, the prob- v :=NewVehicle()
lem can be modelled as vehicle routing problem with
AddToRoute(c, v)
pickup and delivery (VRPPD). In case of vehicle rout-
endif
ing problem with backhauls (VRPB), a vehicle needs
endwhile
to collect goods after it completes delivery. Last two
problems can also be extended with time constraints return CurrentSolution()
(VRPBTW and VRPPDTW). In this paper the practical end
problem of postal delivery company is modelled as
the VRPTW problem. Service of each customer has to 4. IMPROVEMENT OPERATORS
be done inside time window 6ei, li @ , where ei is earliest
and li latest possible time when service must occur. If Initial solution can be significantly improved by
vehicle arrives before opening of time window it has simple operations such as relocation, exchange and
to wait. It is forbidden to start service after closing of reposition of customers in/between routes of vehicles.
time window li because it would produce an unfea- Simplest improvement operators are presented bel-
sible solution. The depot has also time window that low and more complex ones can be found in [8]. Intra
represent its opening and closing time. The primary Route operators relocate one or more customers from
objective of VRPTW optimization is to find the minimal one position in route to another position in same route.
number of vehicles that can accomplish delivery task Inter Route operators relocate and exchange custom-
in a way that each route satisfies all time and capacity ers between two different routes. Intra Relocate op-
constraints and that each customer is serviced only erator shown in Figure 2 removes one customer from
once. The secondary objective is to minimize overall a route and inserts it to the other position inside the
travelled distance or time. same route. Such operation will cause shifting of one
a0 a2 a0 a2
R R'
a1 a1
b1 b0 b1 b0
a0 b0 a0 b0
R R'
b1 a1 b1 a1
a0 a2 a0 a2
R1 R1'
a1 a1
R2 R2'
b0 b1 b0 b1
or more customers as well. The customer a1 is insert- and inserts it between customers b0 and b1 in new
ed between customers b0 and b1 if there is a positive route R2l if there is positive saving expressed as the
saving in the new route Rl . Saving u is expressed as following sum:
the following sum: u = ^c^a0, a1h + c^a1, a2h + c^b0, b1hh -
u = ^c^a0, a1h + c^a1, a2h + c^b0, b1hh - -^c^a0, a2h + c^b0, a1h + c^a1, b1hh (3)
-^c^a0, a2h + c^b0, a1h + c^a1, b1hh (1) Route R1l will keep all constraints fulfilled after re-
Intra TwoOpt operator shown in Figure 3 modifies moval of a1 but for route R2l time and capacity fea-
route in such a way that it removes crossings in the sibility has to be checked because insertion of a1
route R and reverses travel directions between cus- can produce overload and delay to customers. Inter
tomers b0 and a1 . Savings u produced by a new route Exchange operator shown in Figure 5 swaps two cus-
Rl have to be positive and they are expressed as the tomers from different routes. Customer a1 from route
following sum: R1 is exchanged with customer b1 from route R2 . It
u = ^c^a0, a1h + c^b0, b1hh - ^c^a0, b0h + c^a1, b1hh (2) is necessary to check the feasibility of both routes
Beside savings calculation in Intra Route operators and reject exchange combination " a1, b1 , if it will
it is also necessary to check for feasibility of the time produce overload or delay in any of two routes. Sav-
window constraints for new route Rl . Capacity con- ings of exchange move are expressed as the following
straints do not need to be checked because they are sum:
already examined in route R. Inter Relocate operator u = ^c^a0, a1h + c^a1, a2h + c^b0, b1h + c^b1, b2hh -
shown in Figure 4 removes customer a1 from route R1 -^c^a0, b1h + c^b1, a2h + c^b0, a1h + c^a1, b2hh (4)
a0 a2 a0 a2
V1 b1 V 1' b1
a1 a1
V2 V 2'
b2 b0 b2 b0
It is important to note that each improvement op- generates new solution sl using modified variants of
erator among all feasible moves selects the one that Intra Relocate, Inter Relocate and Inter Exchange op-
will produce maximal saving u. erators in which negative savings are allowed. In the
next step local search procedure is applied in order to
5. LOCAL SEARCH AND METAHEURISTICS produce solution sm which represents local optimum
[13]. Solution sm is automatically accepted as starting
Improvement operators are iteratively applied in point for next iteration if objective function yields bet-
the local search procedure in order to improve solution ter value than for solution s. Otherwise, acceptance
as much as possible. Each operator searches for nar- criterion for solution sm follows the probability function
row neighbourhood of the current solution and tries to known as Metropolis condition [11]:
f^ smh - f^ sh
find a better one. Eventually, local search will stop in a
pt = e- T (5)
local optimum or suboptimal solution if there are no
feasible solutions that can be found using the same Temperature T determines how likely solution sm
improvement operators. In order to continue improving will be accepted. As temperature drops throughout
the obtained solution it is necessary to move to an- the process, the probability of accepting worse solu-
other area of solution space by temporarily accepting tion decreases. This is called cooling schedule and
worse solutions and applying the local search again. determines the number of iterations of the algorithm.
Metaheuristic methods are developed in order to The cooling schedule is a geometric function T = T $ a ,
reduce the solution search space and to consider eval- where 0 # a 1 1 . The maximal (initial) and the mini-
uating only areas which have high probability to con- mal temperature are empirically determined for each
tain good solutions. Moving from one neighbourhood problem set. The objective function that evaluates the
to another by accepting worse solutions can lead to quality of the given solution is calculated as follows:
global optima in successive iterations of local search. f ^ s h = v s $ ds (6)
where vs is the number of vehicles used in the solu-
5.1 Simulated annealing tion and ds is the sum of route distances. Solution best
is updated in case of improvement of the evaluation
Methodology of SA is analogous to the physical pro- function (6). The first factor of this function greatly
cess of annealing in metallurgy [9, 10, 11]. In order increases the value of the function thus forcing the
to obtain perfect crystal structures of metal without ir- algorithm to accept solutions with less used vehicles
regularities, solid metals are melted and then cooled (routes). The second factor is needed to reduce the
down slowly. Heat enables atoms to become unstuck overall distance if the number of the used vehicles is
from their initial positions which correspond to local maintained. Function Terminate() is responsible for
optimum of minimal energy and wander randomly stopping the algorithm after temperature T reaches
through states of higher energy. In this analogy, the its allowed minimum. Additionally, the temperature is
different energy levels represent candidate solutions, reset to the initial value a given number of times, to re-
and evaluation function represents the internal energy peat the cooling process again starting from the best
of the solid [12]. Cooling needs to be done slowly in solution found at the time.
order to increase the chance of getting a configuration
Algorithm 2. Simulated Annealing
with minimal internal energy (global optimum). Simu-
lated annealing (Algorithm 2) starts from the initial fea- procedure SA()
sible solution obtained by Solomons I1 insertion heu- T := InitialTemperature()
ristic described in the previous section (Algorithm 1). init := SolomonI1()
In each iteration of the main loop function Escape(s) s := LocalSearch(init)
Table 1 - Comparison of the results for the number of vehicles and distances obtained by ILS and SA to the best
proposed results for Solomons VRPTW problems. CM = cumulative values. HG = (Homberger & Gehring, 2005) [15],
BC = (Le Bouthillier & Crainic, 2005)[16], PR = (Pisinger &Rpke, 2005)[17], MBD = (Mester et al., 2007)[18]
R1 R2 C1 C2 RC1 RC2 CM
12.08 2.82 10.00 3.00 11.50 3.25 408.00
HG
1,211.67 950.72 828.45 589.96 1,395.93 1,135.09 57,422.00
12.08 2.73 10.00 3.00 11.50 3.25 407.00
BC
1,209.19 936.62 828.38 589.86 1,389.22 1,143.70 57,412.00
11.92 2.73 10.00 3.00 11.50 3.25 406.00
PR
1,212.39 957.72 828.38 589.12 1,387.12 1,123.49 57,332.00
12.00 2.73 10.00 3.00 11.50 3.25 406.00
MBD
1,208.18 954.09 828.38 589.12 1,387.12 1,119.70 46,812.00
13 3.09 10 3 12.62 3.62 434
SA
1,206.07 979.81 838.70 590.69 1,378.70 1,131.91 57,609.57
12.67 3.09 10 3 12.5 3.62 429
ILS
1,199.98 955.99 832.85 590.12 1,371.97 1,125.08 57,108.85
service time, and since they have got higher capacity prepared for the optimization using the described
vehicles, they are able to supply more than 10 cus- algorithms. The collected data include 1,200 served
tomers per route. In each set of problems, the custom- customers located in the area of the cities of Vinkov-
ers geographical distributions, the demand and the ci, Vukovar and upanja in the Republic of Croatia. In
service time do not change. Table 1 shows the com- total, 44 real-world VRPTW problems are considered
parison of results obtained by SA and ILS algorithms for optimization. Each customer has a certain de-
implemented here with results of authors that used mand and defined period in which the ordered prod-
different methods for solving VRPTW. ucts have to be delivered. The serving and unloading
Compared to the results published by other rele- time depends on the amount of cargo and ranges
vant authors, SA and ILS algorithms implemented here from 2 minutes to 12 minutes per customer. Each
produce solutions of less quality for standard bench- vehicle has the same predefined time when it must
mark problems. Due to the fact that minimization of leave the depot.
vehicle number is the primary optimization criteria Although available vehicles have limited freight
in solving VRPTW, better or similar average travelled capacity, these restrictions were not taken into con-
distance on some instances should not be taken into sideration. The nature of the cargo (relatively small
consideration while comparing the results. The main mass and dimensions) relaxed the problem because
reason for obtaining solutions with greater number the vehicle capacity was never a limiting factor. Major
of vehicles on the average is the lack of specialized problem were the restrictive time windows. The col-
strategy or phase for vehicle number minimization. An- lected data show that 59 of 1,200 customers were not
other possible reason is the absence of more complex served on time.
improvement operators used in other papers. ILS pro- In order to solve the practical vehicle routing prob-
duced better overall results than SA because of more lem it is necessary to operate with real-world distances
intensive search of solution space around best solu- and travel times based on the street topology and traf-
tions found during the optimization. Tuning of SA algo- fic regulations. The geographical locations of custom-
rithm for specific problem instances is harder because ers determined by street name and house number
temperature parameters used for controlling diversifi- were geocoded in the geographic information system
cation and intensification ratio depend on the custom- with a digital map of the region. In order to solve the
ers spatial and/or temporal configuration. time-constrained problems, as in the case of VRPTW,
an additional matrix containing forecast travel times
7. OPTIMIZATION OF PROBLEMS data between each pair of customers has to be avail-
able. Therefore, the problems are defined by two traffic
IN CASE STUDY
matrices: the distance asymmetric look-up matrix and
the related forecast travel time matrix. The calculation
7.1 Data collection and preparation of the travel time matrix is based on the average speed
specified for different types of roads and calculated
Historical data were obtained from the postal ser- using the Geographic Information System (GIS) and
vice provider for the period of 15 working days and navigation map of Croatia.
The road networks are spread within three small lation, even the smallest one, the delivery company
towns and their rural parts. The number of customers pays a certain money penalty. The solution routes for
for each problem is relatively small (27.3 on average). one day of delivery in the City of Vinkovci are shown in
There are three time widows: from 8:00 a.m. till 10:00 Figure 7.
a.m., from 8:00 a.m. till 3:00 p.m. and from 8:00 a.m. Due to very inefficient manually constructed route
till 7:00 p.m. The geographical distribution of custom- plans it is possible to obtain much better results even
ers for one day in the City of Vinkovci is shown in Figure with algorithms that do not perform well on benchmark
6. problems. This is because of the following character-
istics of the real world problems: short-term planning
7.2 Case study results horizon, short service time, and wide time windows for
large number of customers. Since there are no capac-
The results show improvement of up to 40% for ity constraints, vehicles are able to supply more cus-
overall travelled distance. In some cases algorithms tomers per route. The difference between overall trav-
produced solutions with increased number of used elled distance before and after optimization of all 44
vehicles in order to service all customers in the desig- problems in case study is shown in Figure 8.
nated time. This is not a problem considering the fact
that the number of available vehicles in this case study 8. CONCLUSION
exceeds the number of the used ones. That strategy is
much more effective because of the time constraints The Vehicle Routing Problem is a combinatorial op-
imposed by the customers. For every time window vio- timization task that occurs during organizing delivery
[km]
120 Before optimization
After optimization
100
80
60
40
20
0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43
and/or collection of goods in a certain area. Success- moe obaviti i uz 40% manji ukupni prijeeni put, te da su
ful solving of VRP requires knowledge of mathemati- runo raeni planovi ruta vrlo neuinkoviti.
cal models that represent real world problems. One
of these models is the Vehicle Routing problem with KLJUNE RIJEI
Time Windows, the solving of which is done with me- problem usmjeravanja vozila s vremenskim ogranienjima,
taheuristic algorithms which produce relatively good simulirano kaljenje, iterativna lokalna pretraga, metaheuris-
results in a reasonable time. Two metaheuristic strat- tike
egies with tuned parameters were developed for this
case study and their efficiency was tested on the stan- LITERATURE
dard Solomons benchmark problems. Optimization
approach with GIS tools and optimization algorithms [1] Toth, P., Vigo, D.: Vehicle Routing Problem, SIAM Pub-
requires minimal investment and almost no change in lishing, monographs on discrete mathematics and ap-
the companys technological system, but produces sig- plications, Philadelphia, 2002
nificant results. The delivery companies usually have [2] Brysy, O., Gendreau, M.: Vehicle Routing Problem
practice of manual construction of delivery routes with Time Windows Part I: Route Construction and Lo-
cal Search Algorithms, Transportation Science, Vol. 39,
which are often inefficient and produce extra transport
No. 1, 2005, pp. 104-118
costs. Routes of a company that is specialized in pack- [3] Brysy, O., Gendreau, M.: Vehicle Routing Problem with
age delivery were analyzed. In total, 44 separate de- Time Windows, Part II, Metaheuristics, Transportation
livery plans were optimized using the proposed algo- Science, Vol. 39, No. 1, 2005, pp. 119-139.
rithms and the average distance reduction per process [4] Golden, B., Raghavan, S., Wasil, E.: The Vehicle Rout-
is 40%. Because of the restrictive time windows im- ing Problem, Latest Advances and New Challenges,
posed by the customers it was necessary to increase Springer, 2008.
the number of vehicles for some of the problems. This [5] Nagata, Y., Brysy, O., Dullaert, W.: A penalty-based
strategy is more effective because of money penalty edge assembly memetic algorithm for the vehicle rout-
ing problem with time windows, Computers and Opera-
for the company in case of time window violation. The
tions Research, Vol. 37, 2010, pp. 724-737.
optimization of manually constructed routes on real [6] Cordeau, J.F., Desaulniers G., Desrosiers, J., Solomon,
world vehicle routing problems using metaheuristic al- M., Soumis, F.: The VehicleRouting Problem with Time
gorithms shows two achievements: reduction in total Windows. Toth, P., Vigo, D. (eds.) The Vehicle Routing
travelled distance and successful solving of time win- Problem,. SIAM Publishing, Philadelphia, 2002, pp.
dow violation problem. 157193
[7] Solomon, M.: Algorithms for the Vehicle Routing and
FILIP TANER, dipl. ing. Scheduling Problems with a Time Windows Constraints.
E-mail: filip.taner@gmail.com Operations Research. Vol. 35, 1987, pp. 254265
ANTE GALI, dipl. ing. [8] Cari, T., Gali A., Fosin, J., Gold, H., Reinholz, A.: A
E-mail: ante.galic@fpz.hr Modelling and Optimization Framework for Real-World
TONI CARI, Ph. D. Vehicle Routing Problems: Cari T., Gold H. (eds.) Vehi-
E-mail: tonci.caric@fpz.hr cle Routing Problem, I-TECH, Vienna, 2008, pp. 15-34
Sveuilite u Zagrebu, Fakultet prometnih znanosti [9] Kirkpatrick, S., Gelatt, C.D., Vecchi, Jr. M.P.: Optimiza-
Vukelieva 4, 10000 Zagreb, Hrvatska tion by Simulated Annealing, Science, 220, 1983, pp.
671680
SAETAK [10] Cerny, V.: A Thermodynamical Approach to the Travel-
ling Salesman Problem: An Efficient Simulation Algo-
RJEAVANJE PRAKTINOG PROBLEMA rithm, Journal of Optimization Theory and Applications
USMJERAVANJA VOZILA S VREMENSKIM 45, 1985, pp. 4151
OGRANIENJIMA UPORABOM [11] Metropolis, N., Rosenbluth, A.W., Rosenbluth, M.N.,
METAHEURISTIKIH ALGORITAMA Teller, A.H.: Equations of State Calculations by Fast
Computing Machines. The Journals of Chemical Phys-
U ovome lanku analiziran je problem usmjeravanja ics 21, 1953, pp. 10871092
vozila s vremenskim ogranienjima. Primjenom algoritama [12] Hoos, H.H., Stutzle, T.: Stochastic local search, founda-
za rjeavanje razliitih klasa VRP problema mogu se bitno tions and applications, Elsevier, Morgran Kaufmann,
smanjiti trokovi koji se pojavljuju kod distribucije dobara. 2005
Za rjeavanje primijenjena su dva algoritma: Simulirano [13] Cari, T., Fosin, J., Gali, A., Gold, H., Reinholz, A.:
kaljenje i Iterativna lokalna pretraga. Oba algoritma generi- Empirical Analysis of Two Different Metaheuristics for
raju poetno rjeenje pomou konstruktivnih heuristika i Real-World Vehicle Routing Problems, Bartz-Beielstein
rabe operatore i razliite strategije za iterativno poboljanje T. et al. (Eds.): Hybrid Metaheuristics 2007, Lecture
rjeenja. Algoritmi su testirani na testnim (benchmark) kao Notes in Computer Science (LNCS), Springer-Verlag,
i na stvarnim problemima usmjeravanja vozila s vremens- Berlin Heidelberg 2007 4771, pp. 3144
kim prozorima. Ukupno 44 stvarna distribucijska procesa [14] Solomon benchmark available from web page (last
optimizirana su navedenim algoritmima. Dobiveni rezultati accessed on July 2011): http://www.sintef.no/Project-
pokazali su da se isti posao distribucije u nekim sluajevima web/TOP/Problems/VRPTW/Solomon-benchmark/
[15] Homberger, J., Gehring, H.: A two-phase hybrid me- [17] Pisinger, D., Rpke, S.: A general heuristic for vehicle
taheuristic for the vehicle routing problem with time routing problems. Technical Report, Department of
windows, European Journal of Operational Research, Computer Science, University of Copenhagen, Copen-
Vol. 162, No. 1, 2005 pp. 220238 hagen, Denmark, 2005
[16] Le Bouthillier, A., Crainic, T.G.: Cooperative parallel [18] Mester, D., Brysy, O., Dullaert, W: A multi-parametric
method for vehicle routing problems with time win- evolution strategies algorithm for vehicle routing prob-
dows. Computers and Operations Research, Vol. 32, lems. Expert Systems with Applications, Vol. 32, No. 2,
No. 7, 2005, pp. 1685-1708 2007, pp. 508-517