A Hybrid Metaheuristic Approach to Solve the Vehicle Routing
Problem with Time Windows
Arthur T. Gómez, Cristiano Galafassi and Leonardo D. Chiwiacowsky
Master Program on Applied Computing, University of the Sinos Valley, Av. Unisinos,950, São Leopoldo/RS, Brazil
Keywords: Metaheuristics, Tabu Search, Genetic Algorithms, Vehicle Routing Problem.
Abstract: This paper addresses the Capacitated Vehicle Routing Problem with Time Windows, with constraints
related to the vehicle capacity and time windows for customer service. To solve this problem two different
metaheuristics are used: Tabu Search and Genetic Algorithms. Based on these techniques a hybrid algorithm
is developed. The main goal is the development of a Hybrid Algorithm focused on the Vehicle Routing
Problem which uses the intensification power of the Tabu Search and the diversification power of the
Genetic Algorithms, in order to obtain good quality solutions without compromising the computational
time. In the experiments are combined policies of diversification and intensification in Tabu Search and
Genetic Algorithm to verify the efficiency and robustness of the proposed hybrid algorithm. Finally, the
results are compared with the best heuristic and exact methods results found in the literature. The Hybrid
Algorithm here proposed shows efficiency and robustness, with several optimal solutions achieved.
1 INTRODUCTION
The Vehicle Routing Problem (VRP) presents wide
applications, especially to problems related to the
distribution of goods and services, such as (Bräysy
and Mester, 2005): School Bus (Newton and
Thomas, 1974) Newspapers Distribution (Golden et
al, 1977); Urban Public Transport Systems (Ceder
and Stern, 1981), Food Distribution (Bartholdi et al,
1983), Distribution of Manufactured Products (Perl
and Daskin, 1985); Delivery of Correspondent
Banking (Malmborg and Simons, 1989), Routing of
Helicopters (Timlin and Pulleyblank, 1990) Garbage
Disposals (Kulca, 1996), Electronic Products
Distribution (Barbarosoglu and Ozgur, 1999);
Dynamic Routing Airline (Jiang and Barnhart,
2009).
The year 2009 marked the 50th anniversary of
the publication of the first article on the Vehicle
Routing Problem under the title "The truck
dispatching problem" (Dantzig and Ramser, 1959,
Laporte, 2009). Vehicle Routing Problem is the
name given to a class of problems involving
customers visited by vehicles and where a minimum
cost for this task should be sought (Bodin, Golden,
Assad, 1983; Tarantilis et al, 2005). The classic
version of the VRP is known as the Capacitated
Vehicle Routing Problem (CVRP) (Laporte, 1992;
the Thangiah Petrovic, 1997, Ralph et al, 2001, Toth
and Vigo, 2002; Tarantilis et al, 2005 ).
The main goal of this paper is to present a hybrid
algorithm, which combines diversification and
intensification properties from the Genetic
Algorithm and Tabu Search metaheuristics when
applied to the Capacitated Vehicle Routing Problem
With Time Windows (CVRPTW). In order to verify
the efficiency and robustness of the proposed hybrid
method, the known best solutions for different
instances of the problem will be used.
The paper is organized as follows. Section 2
presents a brief bibliographic review on the Vehicle
Routing Problem with Time Windows. Section 3
shows the model considered in this paper, the
mathematical formulation and its hybrid algorithm
developed. Section 4 describes the experiments and
finally Section 5 presents the conclusions.
2 VEHICLE ROUTING
PROBLEM WITH TIME
The CVRPTW is an extension of CVRP where,
beyond the capacity constraints, a time interval [a
i
,
b
i
] associated to each customer i is it imposed. This
time interval is called time window (Toth and Vigo,
183
Gómez A., Galafassi C. and Chiwiacowsky L..
A Hybrid Metaheuristic Approach to Solve the Vehicle Routing Problem with Time Windows.
DOI: 10.5220/0004030001830188
In Proceedings of the 9th International Conference on Informatics in Control, Automation and Robotics (ICINCO-2012), pages 183-188
ISBN: 978-989-8565-21-1
Copyright
c
2012 SCITEPRESS (Science and Technology Publications, Lda.)
2002). Thus, there is a time window associated with
each customer, and a vehicle that needs to visit a
particular client, that cannot be reached after the end
of the time window (Ropke and Cordeau, 2009).
In this version of the problem, the instant in
which the vehicles leaving the depot, the travel time,
t
ij
, for each edge (i, j) A, and an additional time of
service for each customer i itself, are all known and
deterministics. Moreover, typically, the source of
cost and travel time coincide.
Since time windows induce an implicit
orientation for each route, even if the original
matrices are symmetric, the CVRPTW is usually
modeled as an asymmetric problem. The CVRPTW
consists in finding a set of very simple circuits R,
with minimum cost, so that:
Each circuit starts and finishes at the depot
vertex;
Each customer (vertex) is visited by exactly
one circuit;
The sum of the demands of the vertices visited
by a circuit does not exceed the vehicle
capacity Q
k
;
On each client I the vehicle stops for s
i
moments of time, within the time window [a
i
,
b
i
], to unload the product.
The CVRPTW is NP-Hard (Toth and Vigo, 2002;
Ropke and Cordeau, 2009; Dell'Amico et al, 2007),
since it generalizes the CVRP, which arises when a
i
= 0, B = + ∞ for each i V.
3 THE MODEL
This VRP model used in this work is based on the
classic version with capacity constraints and time
windows (CVRPTW). In this version of the
problem, the capacity of all vehicles is the same and
they are initially placed in a single depot. The
respective demand and the time window for each
client are previously known. All routes must start
and finish in the depot. The total demand of a route
cannot exceed the capacity of the vehicle and the
vehicle cannot reach the customer after the end of
the correspondent time window. The goal is to create
a set of routes that meets all clients at once,
minimizing the costs..
3.1 Mathematical Formulation
The CVRPTW can be formally described following
the model of multiproduct network flow with time
windows and capacity constraints, presented by
(Cordeau et al, 2003).







Subject to:



 


 




  



 



 
 

 








  

 
  




 

 



 

The objective function (1) expresses the total cost.
The restriction (2) restricts customers to be served
by exactly one vehicle, where
+
(i) represents the set
of edges that can be covered from the vertex i. The
restrictions (3)-(6) characterize the flow on the path
to be followed by the vehicle where
-
(i) represents
the set of edges arriving at vertex i. Still, the
restrictions (7), (8) and (9) guarantee the feasibility
of sequencing with respect to time and capacity. For
a given vehicle k, the constraint (8) makes w
ik
= 0
whenever the customer i is not visited by the vehicle
k. Finally, the restriction (11) imposes a condition
for the binary flow variables.
The condition (11) allows the condition (7) to be
linearized according to equation (12):
w
ik
- s
i
+t
ij
- w
ik
(1 - x
ijk
)M
ij
,
k
K, (i, j)
A (12)
where M
ij
is a big constant value. In addition, M
ij
can
be replaced by max{b
i
+ s
i
+ t
ij
a
j
, 0}, (i, j) A,
and the constraints (11) and (16) simply need to be
exchanged for arcs (i, j) A such that M
ij
> 0,
otherwise when you max{b
i
+ s
i
+ t
ij
a
j
, 0} = 0,
these constraints are satisfied for all values of w
ik
,
w
jk
e x
ijk
.
ICINCO 2012 - 9th International Conference on Informatics in Control, Automation and Robotics
184
3.2 Hybrid Algorithm
The hybrid optimization process is represented by
two distinct phases. The first phase is characterized
by the Genetic Algorithm application, which
provides appropriate diversity for the population,
enabling the search in unexplored portions of the
search space. The diversification is achieved when
suitable genetic parameters are used. In the GA
phase, the elitism policy (De Jong, 1975) is used,
where only the best individual is copied into the next
population. With this elitism strategy, individuals
can overlap and cover a wider search area in the
solution space. Concerning the genetic operators, the
UOBX was adopted for the crossover and the Swap
Mutation was adopted for the mutation. Both genetic
operators were studied in Geiger (2008).
The second phase of the hybrid optimization
process provides intensification, guiding the search
to promising regions of the solution space. This
intensification will be performed by a Tabu Search
algorithm, where its parameters will be applied in
order to guide the solution to the optimal point in
their search space. In this process, a neighborhood
structure based in four different movements is used.
The first one is called Intra-Route and it is applied
by selecting a random route and trying to exchange a
pair of vertices. The second movement is called
Inter-Route and it is applied by selecting a random
vertex and removing it from its original route and
trying to insert it in every other routes.
The third movement is based in changing the
position of two vertices. A random vertex is selected
to be changed with every other vertex in the same
route. Finally, the last movement is applied by
recreating a route using a nearest neighbour
heuristic. It is applied in every route individually.
Furthermore, an intensification process based on
a memory structure is applied. The five best
individuals provided by the Tabu Search process are
stored. When the current best solution is not
improved after 10 consecutive generations, the best
solution from the list of candidates is extracted and
the search is resumed from this new solution. With
this intensification process, a more consistent
exploration of the search space is sought. However,
in order to have an efficient process, the solution
representation in the Genetic Algorithm and Tabu
Search should be the same, or a conversion process
must be used. In this work, the solution encoding is
the same in both optimization phases. The solution
encoding consists of the sequence of all customers
that the route must be covered so that a new route
starts when any constraint is violated. Therefore,
both optimization phases may use the solutions
generated by the same encoding strategy.
4 EXPERIMENTS
The experiments were performed based on the
problems presented by Solomon (1987). It is
noteworthy that these are minimization problems,
thus, the best results are those of lower value.
According to the author, these problems are divided
into six sets, here separated into three classes: R, C
and RC, and two series: 1 and 2.
The classes differ in the geographic data of
customers. For problems of class R, the spatial data
were generated randomly. In class C data were
obtained from groups of customers, while RC class,
presents graphs that are the combination of some
clusters and some additional nodes scattered
randomly. The series define the flexibility of time
windows. The first series has a narrower horizon of
sequencing, and time windows that allow a
maximum of ten clients per route. On the other hand,
in the series two, time windows have great
flexibility, often not causing problems and
restrictions to allow more than thirty clients to be
served by a route.
Based on these three classes and two series, so a
total of six sets of problems (R1, R2, C1, C2, RC1,
RC2). In each set, geographic location is the same,
and only the variation of the time windows is
considered. The set R1 has twelve problems, ranging
from R101 to R112, R2 has eleven problems, all
ranging from R201 to R211. In this class, the
location of customers was randomly obtained. In
class C, customers were obtained through the
identification of clusters. The sets C1 and C2 have
nine and eight problems, ranging from C101 to C109
and C201 to C208, respectively. Finally, sets RC1
and RC2 present eight problems each, ranging from
RC101 to RC108 and RC201 to RC208,
respectively, where the RC class combines,
randomly, geographically spread customers with
grouped customers. Every problem has a total of one
hundred customers.
All the experiments were performed on a
computer with eight processing cores with 3.0 GHz
each, and 24 GBs of RAM memory.
The Table 1 presents the average solution, the
standard deviation based on the average solutions
and the best solution obtained with the hybrid
algorithm. The best solutions obtained are compared
with the optimal solution and the best heuristic
solution found on literature. The * represents that the
A Hybrid Metaheuristic Approach to Solve the Vehicle Routing Problem with Time Windows
185
Table 1: The best solutions obtained.
Problem
Hybrid Algorithm
Optimal
Solution
Author
Best Heuristic
Solution
Author
Standard
Deviation
Best Solution
Obtained
C101
51,1
827,3*#
827,3
KDMSS
1
828.9
RT
8
C102
39,9
827,3*#
827,3
KDMSS
1
828.9
RT
8
C103
57,2
826,3*#
826,3
KDMSS
1
828.0
RT
8
C104
44,8
822,9*#
822,9
KDMSS
1
824.7
RT
8
C105
35,5
827,3*#
827,3
KDMSS
1
828.9
RT
8
C106
20,4
827,3*#
827,3
KDMSS
1
828.9
RT
8
C107
41,3
827,3*#
827,3
KDMSS
1
828.9
RT
8
C108
51,3
827,3*#
827,3
KDMSS
1
828.9
RT
8
C109
60,7
827,3*#
827,3
KDMSS
1
828.9
RT
8
RC101
25,2
1636,1 #
1619,8
KDMSS
1
1696.9
TBGGP
9
RC102
88,4
1461,6 #
1457,4
CR
2
+KLM
4
1554.7
TBGGP
9
RC103
59,2
1267,3
1258,0
CR
2
+KLM
4
1261.6
S98
10
RC104
89,9
1139,5
1135.4
CLM
11
RC105
57
1520,3 #
1513,7
KDMSS
1
1629.4
BBB
12
RC106
88,8
1424.7
1424.7
BBB
12
RC107
78,4
1221,6 #
1207,8
IV
5
1230.4
S97
13
RC108
82,8
1142,4
1114,2
IV
5
1139.8
TBGGP
9
R101
57,1
1657,7
1637,7
KDMSS
1
1645.7
H
14
R102
50,8
1480,5 #
1466,6
KDMSS
1
1486.1
RT
8
R103
85
1213,9 #
1208,7
CR
2
+L
3
1292.6
LLH
15
R104
13,7
980,8 #
971,5
IV
5
1007.2
M
16
R105
25,7
1367,5 #
1355,3
KDMSS
1
1377.1
RT
8
R106
60,7
1235,4 #
1234,6
CR
2
+KLM
4
1251.9
M
16
R107
51,6
1082,5 #
1064,6
CR
2
+KLM
4
1104.6
S97
13
R108
85,5
983,3
960.8
BBB
12
R109
39,4
1162,9 #
1146,9
CR
2
+KLM
4
1194.7
HG
17
R110
41,5
1084,5 #
1068,0
CR
2
+KLM
4
1118.5
M
16
R111
52,6
1064,6 #
1048,7
CR
2
+KLM
4
1096.7
RGP
18
R112
10,3
1018,2
982.1
GTA
19
C201
11,4
589,1*#
589,1
CR
2
+KLM
4
591.5
RT
8
C202
39,2
589,1*#
589,1
CR
2
+KLM
4
591.5
RT
8
C203
24,7
588,7*#
588,7
KLM
4
591.1
RT
8
C204
22,9
588,1*#
588,1
IV
5
590.6
RT
8
C205
27,6
604,7
586,4
CR
2
+KLM
4
588.8*
RT
8
C206
20,3
594,9 #
586,0
CR
2
+KLM
4
588.4*
RT
8
C207
20,3
585,8*#
585,8
CR
2
+KLM
4
588.2
RT
8
C208
34,2
585,8*#
585,8
KLM
4
588.3
RT
8
RC201
77,4
1267,7 #
1261,8
KLM
4
1406.9
M
16
RC202
52
1096,6 #
1092,3
IV
5
+C
6
1367.0
CC
20
RC203
54,5
1070,3
1049.6
CC
20
RC204
71,3
798.4
798.4
M
16
RC205
58,8
1161,4 #
1154,0
IV
5
+C
6
1297.1
M
16
RC206
17,8
1265,7
1261,8
KLM
4
1146.3
H
14
RC207
65,7
962,9*#
962,9
DLH
7
1061.1
BVH
21
RC208
66,5
828.1
828.1
IKMUY
22
R201
25,5
1159,1 #
1143,2
KLM
4
1252.3
HG
17
R202
73
1209,0
1191.7
RGP
18
R203
53,1
939.5
939.5
M
16
R204
24,4
825.5
825.5
BVH
21
R205
84,6
949.8*#
949,8
DLH
7
994.4
RGP
18
R206
30,5
1011,8
875,9
DLH
7
906.1
SSSD
23
R207
35,8
794,0*#
794,0
DLH
7
893.3
BVH
21
R208
79,5
726.7
726.7
M
16
R209
82,9
909.1
909.1
H
14
R210
52,4
900,5*#
900,5
DLH
7
939.3
M
16
R211
24
892.7
892.7
BVH
21
1
Kohl et al (1999),
2
Cook e Rich (1999),
3
Larsen (1999),
4
Kallehauge et al (2000),
5
Irnich e Villeneuve (2005),
6
Chabrier (2005),
7
Desaulniers, G., Lessard, F., Hadjar,
8
Rochat e Taillard (1995),
9
Taillard et al (1997),
10
Shaw (1998),
11
Cordeau et al (2000),
12
Berger et al (2001),
13
Shaw (1997),
14
Homberger (2000),
15
Li et al (2001),
16
Mester (2002),
17
Homberger e Gehring (1999),
18
Rousseau et al (2002),
19
Gambardella (1999),
20
Czech e Czarnas (2002),
21
Bent e Van Hentenryck (2001),
22
Ibaraki et al (2001),
23
Schrimpf et al (2000).
ICINCO 2012 - 9th International Conference on Informatics in Control, Automation and Robotics
186
hybrid algorithm obtained the optimal solution and
the # represents that the hybrid algorithm obtained
a better or equal solution compared with the best
heuristic solution known.
It is observed that the hybrid algorithm has
obtained optimal solution in 19 out of 56 problems
analyzed, 9 in problems of less complexity (series
1) and 10 in more complex problems (series 2).
By comparing with the best heuristic methods,
the hybrid algorithm provides better solutions in 37
of the 56 problems analyzed and proved to be more
efficient than other heuristic methods applied to
Vehicle Routing Problem with Time Windows.
Increasing the number of customers provides an
increase in computational complexity, which
shows the characteristics of the three techniques.
The Tabu Search intensifies the search in
promising regions, however cannot diversify
effectively. The Genetic Algorithm has proven
ineffective to intensify the search in promising
regions, compared to Tabu Search, however, leads
to a wider search in the search space, reaching
areas not explored by Tabu Search. Combining the
power of diversification of Genetic Algorithm and
the power of intensification of Tabu Search, the
Hybrid Algorithm promotes a broader search space
without losing the power of intensification, which
can be seen in the solutions obtained.
5 CONCLUSIONS
This paper addresses the Capacitated Vehicle
Routing Problem with Time Windows, which must
obeys the capacity constraints of the vehicle and
the time windows of customer service to solve this
problem. Moreover, the metaheuristics Tabu
Search and Genetic Algorithms has been used in a
hybrid algorithm.
Analyzing the results, it is found also that the
Tabu Search obtained better solutions than the
Genetic Algorithm for Capacitated Vehicle
Routing Problem with Time Windows with
smaller standard deviations. This is due to the
intensification policy, which promotes a local
search in promising regions. The experiments
show that the Hybrid Algorithm has higher
efficiency in obtaining better solutions, compared
to Tabu Search and Genetic Algorithm, and it is
still more efficient, generating minor standard
deviations. Although the Hybrid Algorithm has
used the characteristics of both techniques, the
computational time does not undergo a significant
increase, since the difference is only a few seconds
relative to Tabu Search and the Genetic Algorithm.
When comparing the results obtained by
different techniques, the Genetic Algorithm do not
get good quality solutions, compared to Tabu
Search and Hybrid Algorithm. The Tabu Search is
more efficient in some cases, surpassing some
results obtained by the Hybrid Algorithm in
problems of less complexity. However, it looks
inefficient compared to the Hybrid Algorithm, with
the increase in the complexity of the problems. The
Hybrid Algorithm developed shows itself flexible
and efficient in obtaining good quality solutions
for all types of problems analyzed. It is noteworthy
that the Hybrid Algorithm obtained many solutions
known a priori as optimal, and obtained better
solutions for most problems compared with the
best heuristic solutions.
REFERENCES
Barbarosoglu, G., Ozgur, D., 1999, A tabu search
algorithm for the vehicle routing problem.
Computers and Operations Research v.26, p.255-
270.
Bartholdi, J. J., Platzman, L. K., Lu, C.R., Warden,
W.W., 1983. A minimal technology routing system
for meals on wheels. Interfaces. v.13, p.1-8.
Bodin, L.D., Golden, B.L., Assad, A.A., Ball, M.O.,
1983. Routing and Scheduling of vehicles and crews:
The State of the Art. Computers and Operations
Research v.10, p.69-211.
Bräysy, O., 2005. A Parallel Hybrid Genetic Algorithm
for the Vehicle Routing Problem with Time
Windows. Working paper, Defense Research
Establishment Valcartier, Canada.
Ceder, A., Sterny, H. I., 1981, Deficit Function Bus
Scheduling with Deadheading trip insertion for fleet
size reduction. Transportation Science v.15, p.338-
363.
Christofides, N., Mingozzi, A., Toth, P.,1979. The
vehicle routing problem. Combinatorial
Optimization, Wiley, Chichester, UK, p. 315-338.
Cordeau, J. F., Desaulniers, G., Desrosiers, J., Solomon,
M. M., Soumis, F., 2003, VRP with Time Windows.
In: Toth, P. Vigo, D., The Vehicle Routing Problem,
Society for Industrial and Applied Mathematics,
Philadelphia.
Cordeau, J. F., Laporte , G., Mercier, A., 2001. A Unified
Tabu Search Heuristic for Vehicle Routing Problems
with Time Windows. Journal of the Operational
Research Society, v.52, p.928-936.
Dantzig, G. B., Ramser, J. H., 1959. The truck
dispatching problem. Management Science, v.6,
p.80-91.
De Jong, K. A.,1975. Genetic Algorithms in Search,
A Hybrid Metaheuristic Approach to Solve the Vehicle Routing Problem with Time Windows
187
Optimization, and Machine Learning. Addison-
Wesly, Reading, Massachusetts.
Dell'amico, M., Monaci, M., Pagani, C., Vigo, D., 2007.
Heuristic Approaches for the Fleet Size and Mix
Vehicle Routing Problem with Time Windows.
Transportation Science, v.41, p. 516-526.
Geiger, M., 2008. Genetic Algorithms for multiple
objective vehicle routing. Proceedings of the
Metaheuristics International Conference, p.349-353.
Golden, B. L., Assad, A. A., Ball, M. O., 1983. Routing
and Scheduling of vehicles and crews: The State of
the Art. Computers and Operations Research v.10,
p.69-211.
Golden, B. L., Magnanti, T. L., Nguyen, H.Q., 1977.
Implementing Vehicle Routing Algorithms. Networks
v.7, p.113-148.
Jiang, H., Barnhart, C., 2009. Dynamic Airline
Scheduling. Transportation Science, v.43, p. 336-
354.
Kulcart, T. Optimizing Solid Waste Collection in
Brussels, 1996, European Journal of Operational
Research. v.90, p.71-77.
Laporte, G.,1992. The Vehicle Routing Problem: An
overview of exact and approximate algorithms.
European Journal of operational Research v.59,
p.345-458.
Laporte, G., 2009. Fifty Years of Vehicle Routing.
Transportation Science. v43, p. 408416.
Malmborg, C. J., Simons, G. R., 1989. Integrating
logistical and Processing Functions through
mathematical modeling. Applied Mathematical
Modelling v.13, n6, p.357-364.
Newton, R., Thomas,W., 1974. Bus Routing in
Multischoll System. Computers and Operational
Research, v.1, p.213-222.
Perls, J., Daskin, M. S. 1985, A warehouse location-
routing problem. Transportation Research, v.19B,
p.381-396.
Ralph, T. K., Kopman, L., Pulleyblank, W. R., Trotter,
L. E., 2001. On the Capacitated Vehicle Routing
Problem. Mathematical programming, v.94, p.343-
359.
Rochat, Y., Taillard, E. D., 1995. Probabilistic
diversification and intensification in local search for
vehicle routing. Journal of Heuristics, v.1, p.147-
167.
Ropke, S., Cordeau, J. F., 2009. Branch and Cut and
Price for the Pickup and Delivery Problem with
Time Windows. Transportation Science, v.43, p.267-
286.
Solomon, M., 1987, Algorithms for the Vehicle Routing
and Scheduling Problems with Time Window
Constraints. Operations Research, v. 35, p254 - 265.
Taillard, D., 1995. Parallel iterative search methods for
the vehicle routing problems. Networks v.23, p.661-
673.
Taillard, E., Badeau, P., Gendreau, M., Geurtin, F.,
Potvin, J.Y., 1997. A Tabu Search Heuristic for the
Vehicle Routing Problem with Time Windows.
Transportation Science, v. 31, p. 170-186.
Thangiah, S. R., Petrovic, P., 1997. Introduction to
Genetic Heuristics and vehicle Routing Problems
with Complex Constraints. In: Advances in
Computational and Stochastic Optimization, Logic
programming, and Heuristic search. Kluwer
Academic Publishers.
Timlin, M. T., Pulleyblank,W.R., 1990. Precedence
Constrained Routing and Helicopter Scheduling:
Heuristic Design. Interfaces, v. 22, p. 100-111.
Toth, P., Vigo, D., 2002. Models, relaxations and exact
approaches for the capacitated vehicle routing
problem. Discrete Applied Mathematics v.123,
p.487-512.
ICINCO 2012 - 9th International Conference on Informatics in Control, Automation and Robotics
188