Professional Documents
Culture Documents
Technical paper
A new mathematical model for a competitive vehicle routing problem with time
windows solved by simulated annealing
R. Tavakkoli-Moghaddam a , M. Gazanfari b , M. Alinaghian b, , A. Salamatbakhsh c , N. Norouzi c
a
b
c
a r t i c l e
i n f o
Article history:
Received 8 June 2010
Received in revised form 8 April 2011
Accepted 27 April 2011
Keywords:
Vehicle routing problem
Competitive situation
Transportation
Simulated annealing
a b s t r a c t
This paper presents an extension of a competitive vehicle routing problem with time windows (VRPTW)
to nd short routes with the minimum travel cost and maximum sale by providing good services to
customers before delivering the products by other rival distributors. In distribution of the products with
short life time that customers need special device for keeping them, reaching time to customers inuences
on the sales amount which the classical VRPs are unable to handle these kinds of assumptions. Hence, a
new mathematical model is developed for the proposed problem and for solving the problem, a simulated
annealing (SA) approach is used. Then some small test problems are solved by the SA and the results are
compared with obtained results from Lingo 8.0. For large-scale problems, the, Solomons benchmark
instances with additional assumption are used. The results show that the proposed SA algorithm can nd
good solutions in reasonable time.
2011 The Society of Manufacturing Engineers. Published by Elsevier Ltd. All rights reserved.
1. Introduction
Transportation has an important role in various domains, such as
enterprise, economic and service systems. By this way, researchers
are interested in improving the routes, deleting the unnecessary
travels and creating the replacement short routes. In addition,
many problems, such as traveling salesman problem (TSP), vehicle routing problem (VRP) and the like, are developed by this
approach. VRPs include problems where eet of vehicles presents
service from depot to geographically dispersed customers set with
specic demands so that the cost function of transportation is
minimized. The VRP was formulated mathematically by Dantzig
and Ramser [1]. Clarke and Wright [2] developed Dantzig and
Ramsers approach by using a saving algorithm. Also, a different
approach based on the branch-and-bound algorithm was presented
by Loporte et al. [3]. Christian et al. [4] solved the capacitated
VRP with stochastic demands by a branch-and-price algorithm.
Since VRPs are categorized as NP-hard problems [5] that no exact
algorithm is used to solve them in large sizes due to high computational cost; thus approximate and heuristic algorithms are used in
practice. Thus, many researchers developed heuristics and metaheuristics, such as local search [6], minimum K-trees [7], adaptive
memory (AM) [8], column generation [9], simulated annealing (SA)
Corresponding author.
E-mail address: alinaghian@iust.ac.ir (M. Alinaghian).
0278-6125/$ see front matter 2011 The Society of Manufacturing Engineers. Published by Elsevier Ltd. All rights reserved.
doi:10.1016/j.jmsy.2011.04.005
84
It is proven that VRPs belong to the category of NP-hard problems [5]; therefore the model is solved by simulated annealing (SA)
for large-scale problems. For some small cases, the related results
of the proposed SA are compared with the results obtained by the
Lingo8 software using a branch-and-bound algorithm. The related
results show the appropriate efciency for solving the problem,
especially for large sizes.
The rest of this paper is organized as follows. Section 2 introduces the problem and Section 3 represents the model formulation.
The problem-solving methodology is described in Section 4 and
the computational results are discussed in Section 5. Finally, the
conclusion is presented in Section 6.
2. Problem denition
In a competitive environment, it is very important to attend the
service time presented to customers in such a way that if the vehicle
presents the service to customers later than its rival, it will miss a
partial of its sale. For this reason, distributing companies dene the
route of their vehicles based upon other rival companies strategies
for serving customers. In other words, sometimes in competitive
situations considering the competition between vehicles is needed.
The competition in distribution of products with a short life cycle
is an example, which customers need a special device for keeping
them. Therefore reaching time of a distributor to customers inuences on the amount of sales. Hence, a model presented in this
paper is to nd the routing of vehicles in a competitive environment such that it can be considered as a new version of the VRPTW.
This problem is proposed under a condition that a competition is
between distributors for obtaining more sales and market shares.
Before presenting the model, these parameters are introduced
for clarication of the problem. Let G = (V, A) be a graph, where
V = {v1 , v1 , . . ., vn } is the nodes set and, A = {(vi , vj ): vi , vj V} is the
arcs set which each arc (vi , vj ) is associated with a non-negative cost
Cij .
tli lower bound of rivals arrival time to node i
tui upper bound of rivals arrival time to node i
tri rivals arrival time to node i
tdi actual distributers vehicle arrival time to node i
fr (x) probability distribution function of rivals arrival time to node
i
Fr (x) cumulative distribution function of rivals arrival time to node
i
dtdi time dependent demand of node i
dini time independent demand of node i
Di maximum number of customers demand in node i
E(Di ) Expected coverage of the ith customers demand
Demand of each customer is divided of two parts, the rst part
(dini ), does not depend on time and should be sent to the customer
completely, the second part (dtdi ), is time-dependent and it would
be lost if the rivals arrival time is earlier than vehicles arrival time
to the customer. Eq. (1) shows the relation between components of
the demand.
Di = dini + dtdi
(1)
85
Cij travel cost (i.e., length of the arc) between customers i and j
W obtained benet of each unit of product
Tv maximum travel time of vehicle v
S = {i|i = 1, . . ., n} collection of nodes
3.2. Decision variables
The decision variables used in the presented model are as follows:
(2)
p(tdi ) =
1
1 Fr (tdi )
0
if tdi tli
if tli tdi tui
if tdi tui
E(Di ) =
Di
dini + [1 Fr (tdi )]dtdi
didi
if
if
if
tdi tli
tli tdi tui
tdi tui
xijv = 0 Otherwise
(3)
tdi
min
n
Cij xijv W
Oi dtdi + qi
i=1
t t
ui
di
tui tli
dtdi
(5)
s.t.
nv
n
xijv = 1,
j = 2, ..., n
(6)
xijv = 1,
i = 2, ..., n
(7)
i=1 v=1
nv
n
j=1 v=1
n
v
xip
n
i=1
v = 0,
xpi
p = 1, 2, ..., n, v = 1, 2, ..., nv
(8)
i=1
n
n
tiv
i=1
xijv +
n
n
j=1
tdj =
tijv xijv Tv ,
v = 1, 2, ..., nv
(9)
i=1 j=1
n
nv
tdi
i=1
n
zi + yi = 1,
xijv +
v=1
j = 2, ..., n
(10)
i=1 v=1
n
(Di dtdi zi )
i=2
nv
n
xijv Kv ,
v = 1, 2, ..., nv
(11)
j=1
i = 1, 2, ..., n
(12)
i = 1, 2, ..., n
(13)
i = 1, 2, ..., n
(14)
86
i = 1, 2, ..., n
(15)
i = 1, 2, ..., n
(16)
(tli ti ) M(i ) 0,
qi + i = 1,
i = 1, 2, ..., n
(17)
i = 1, 2, ..., n
(18)
v = 1, 2, ..., nv
(19)
xiv = 1,
1
i=2
nv
(20)
v=1 j S j/
S
oi dtdi +
i=1
ti 0, t1 = 0
(21)
t
ui
qi
tui tli
[q t ]
i
di
tui tli
dtdi
(22)
N
i=1
t
ui
oi dtdi + qi
tui tli
i Mqi , i = 2, ..., n
i tdi , i = 2, ..., n
i tdi M(1 qi ), i = 2, ..., n
i
tui tli
dtdi
(23)
(24)
4. Problem-solving approach
The problem-solving methodology based on the simulated
annealing (SA) algorithm is presented in this section. A decoding
method and an initial solution generation are also discussed. Then
some of the neighborhood search methods for improving solutions
are proposed.
4.1. Simulated annealing
Simulated annealing (SA) is a stochastic relaxation technique
that has its origin in statistical mechanics. The SA methodology
draws its analogy from the annealing process of solids. In the
annealing process, a solid is heated to a high temperature and gradually is cooled to crystallize. As the heating process allows atoms
to move randomly, if the cooling is done too slowly, it gives atoms
enough time to align themselves in order to reach a minimum
energy state, namely stability or equilibrium. This analogy can be
used in combinatorial optimization problems, in which the state of
solid is corresponding to the feasible solution, the energy at each
state is corresponding to the improvement in the objective function
and the minimum energy state is the optimal solution.
SA uses a stochastic approach to direct the search. It allows the
search to proceed to a neighboring state even if the move causes the
value of the objective function to become worse. It guides the original local search method in the following way. If a move to a neighbor
X
in the neighborhood N(X) decreases the objective function value,
or leaves it unchanged, then the move is always accepted. More
precisely, the solution X
is accepted as the new current solution if
0, where = C(X
) C(X) and C(X) is the value of the objective
function. Moves, which increase the objective function value, are
accepted with a probability of e(/T) to allow the search to escape a
local optimum, where T is a parameter named as temperature. The
value of T varies from a relatively large value to a small value close
to zero. These values are controlled by a cooling schedule that species the initial and incremental temperature values at each stage
of the algorithm [18].
87
88
To set T0 , an initial solution is rst generated and then 20 neighbors of the initial solution are found. Finally, the objective functions
of them are calculated. fmin and fmax are set for the minimum
and maximum changes on the objective function obtained from
neighbors, respectively. T0 is set based on Eq. (25):
fmin + 0.1(fmax fmin )
(25)
5. Computational results
Computational results are shown in small and large-scale cases
for the model verication and the SA results, respectively. For the
model verication, 10 test problems in small sizes are solved by
the Lingo 8.0 software. The coordination of nodes is generated
randomly in the uniform distribution [0,100] and the customers
demand is generated randomly in the uniform distribution [0,10].
The total vehicles capacity is considered as to 1.2 times of the total
demands of customers. To determine the time windows boundaries, the given problem is solved without considering customers
time windows boundaries the maximum travel time of vehicles is
considered as U. then the value of time windows boundaries are
calculated in a = Rand (0, U U/n) and b = a + U/n for each customer
where a and b are the lower and upper bounds of time windows,
respectively. Also, all the solution procedures are coded in the MATLAB7 program and all the test problems are run using the Intel Dual
Core, 2.5 GHz compiler and 1 GB of RAM.
The comparison of Lingo with the proposed algorithm shows
that our proposed algorithm can obtain approximately an optimal
solution in less time than Lingo as shown in Table 2. The average
gap between the optimal and the SA solutions is 1.288% showing
the efciency of the proposed SA. Furthermore, increasing the size
of the problem increases the solution time of Lingo exponentially
while it does not tangible effect on the solution time of the proposed
algorithm.
To evaluate the proposed SA on large-scale problems, it is tested
on a set of 56 Solomons test cases [29]. In these problems and for
all of the test problems in the original data, there are 100 customers
that are divided into six sets of R1, R2, C1, C2, RC1 and RC2. In sets of
R1 and R2, the customer locations, demands and time windows are
randomly and uniformly distributed; however, they are clustered in
sets C1 and C2. Sets RC1 and RC2 display a combination of uniformly
distributed and their clusters.
Because of the difference between the given problem (VRPCTW)
and the classical VRPTW, some assumptions are inserted into the
Solomons test problems for adjusting the standard test problems
with the given problem. Hence, all of the customers demands
are considered as time dependent demands. Also, in the classical
Table 1
SA parameters.
SA parameter settings
No. of iterations
a
EL
89
Table 2
Results in small-sized problems.
No. of problems
No. of customers
1
2
3
4
5
6
7
8
9
10
nv
8
8
8
10
10
10
12
12
12
12
Lingo 8
2
2
3
2
3
4
2
2
3
4
SA (200 iterations)
Best solution
Time (s)
Best solution
Time (s)
Gap (%)
17.71
22.40
15.68
22.26
29.37
21.11
24.78
29.04
28.20
27.08
12
12
78
127
320
430
489
542
1245
2530
17.71
22.40
15.96
22.26
29.68
21.45
25.32
29.40
28.85
27.81
12.528
13.188
15.081
14.781
15.016
16.494
17.543
15.467
18.769
18.653
0.000
0.000
1.754
0.000
1.082
1.619
2.196
1.237
2.288
2.708
24.084
15.752
1.288
23.763
Average
578.5
Table 3
Comparison of the performance of the proposed SA algorithm for a set of C.
Problem
C101
C102
C103
C104
C105
C106
C107
C108
C109
C201
C202
C203
C204
C205
C206
C207
C208
nv
10
10
10
10
10
10
10
10
10
3
3
3
3
3
3
3
3
Average
100 iterations
200 iterations
500 iterations
Best solution
Time (s)
Gap (%)
Best solution
Time (s)
Gap (%)
Best solution
Time (s)
34.83
78.14
89.65
93.31
37.35
33.57
39.88
50.67
54.47
24.49
67.23
69.19
81.02
24.90
25.69
25.48
25.58
253.67
320.71
225.56
291.24
214.26
225.32
213.77
228.82
221.55
320.56
337.71
349.91
362.07
354.64
345.12
334.64
355.16
3.2
58.1
76.7
50.0
4.8
0.1
4.1
32.6
47.3
1.5
39.4
59.8
55.1
2.8
3.1
4.8
5.4
34.01
65.35
69.13
80.24
35.80
34.59
39.03
43.79
40.40
24.31
51.76
62.89
73.20
24.46
25.08
24.97
24.34
756.57
649.36
506.18
626.01
534.22
628.06
544.60
476.25
532.90
814.36
788.76
840.94
886.64
746.88
745.45
679.57
689.22
0.8
32.2
36.3
28.9
4.8
3.1
1.9
14.6
9.3
0.7
7.3
45.2
40.1
1.0
0.6
2.7
0.3
33.74
49.41
50.73
62.23
35.65
33.56
38.30
38.21
36.97
24.14
48.22
43.31
52.25
24.23
24.92
24.31
24.27
1373.37
1066.51
1292.34
1051.22
1055.68
1497.61
1000.58
938.61
1127.72
1786.14
1688.32
1909.99
1817.24
1785.99
1766.83
1761.36
1760.13
50.32
291.45
26.4
44.32
673.29
13.3
37.91
1451.74
Table 4
Comparison of the performance of the proposed SA algorithm for a set of R.
Problem
R101
R102
R103
R104
R105
R106
R107
R108
R109
R110
R111
R112
R201
R202
R203
R204
R205
R206
R207
R208
R209
R210
R211
Average
nv
19
17
13
10
14
12
10
9
11
10
10
9
4
3
2
3
3
3
2
3
3
3
2
100 iterations
200 iterations
500 iterations
Best solution
Time (s)
Gap (%)
Best solution
Time (s)
Gap (%)
Best solution
Time (s)
69.92
68.57
119.96
171.43
49.61
98.36
124.76
167.07
48.08
47.49
56.88
50.31
46.61
68.08
87.81
129.73
52.17
69.86
103.13
134.83
44.61
49.44
59.02
51.96
46.23
49.48
62.20
44.90
51.33
59.56
63.97
48.54
54.33
53.39
57.57
152.85
351.28
389.05
1173.53
342.97
368.53
1193.48
1111.53
358.55
365.44
1599.35
18.7
24.3
55.5
46.1
7.6
54.0
47.3
59.4
13.4
6.4
40.9
22.4
39.9
68.2
52.7
74.6
56.8
66.7
71.9
69.4
33.0
53.6
59.9
62.24
69.05
104.85
145.24
49.34
97.78
102.60
148.21
45.75
44.76
48.88
44.64
37.23
64.68
75.27
99.01
40.65
52.06
79.91
114.32
41.85
43.69
49.60
90.23
89.48
96.13
120.46
98.16
84.84
109.59
120.40
102.37
107.88
115.26
118.61
325.59
784.42
888.67
2453.90
770.71
930.32
2411.69
2510.75
741.87
730.40
2598.85
5.7
25.2
35.9
23.8
7.0
53.1
21.2
41.5
7.9
0.3
21.1
8.6
11.8
59.8
30.9
33.2
22.2
24.2
33.2
43.6
24.8
35.8
34.4
58.90
55.17
77.14
117.31
46.11
63.87
84.67
104.78
42.40
44.62
40.37
41.10
33.31
40.48
57.50
74.32
33.27
41.90
60.01
79.59
33.53
32.18
36.92
349.09
326.19
319.03
356.37
242.26
309.63
283.68
737.77
438.31
514.65
508.49
712.90
692.93
1901.95
1660.74
5522.43
1899.95
1691.04
5384.14
5612.23
1791.94
1868.25
5515.25
83.38
350.00
45.3
72.24
713.07
26.3
56.50
1679.97
90
Table 5
Comparison of the performance of the proposed SA algorithm for a set of RC.
Problem
RC101
RC102
RC103
RC104
RC105
RC106
RC107
RC108
RC201
RC202
RC203
RC204
RC205
RC206
RC207
RC208
nv
14
12
11
10
13
11
11
10
4
3
3
3
4
3
3
3
Average
100 iterations
200 iterations
500 iterations
Best solution
Time (s)
Gap (%)
Best solution
Time (s)
Gap (%)
Best solution
Time (s)
63.24
117.86
158.38
211.79
56.76
61.31
65.28
55.75
48.14
92.68
111.23
135.58
49.93
62.84
51.12
54.46
95.72
232.49
178.91
247.03
120.26
173.38
172.94
233.54
181.37
404.86
382.96
371.83
177.45
359.15
357.09
358.92
10.3
28.4
35.1
44.9
11.7
15.1
23.7
12.2
35.5
57.4
46.8
47.4
55.4
81.2
26.1
42.1
59.94
95.43
134.88
163.53
51.30
54.35
54.83
52.40
39.99
72.52
97.61
116.32
39.78
51.67
47.50
43.05
208.69
326.71
433.66
557.77
202.61
304.10
317.27
426.42
383.54
729.11
747.02
719.33
364.43
806.13
748.87
717.19
4.5
4.0
15.1
11.9
0.9
2.1
3.9
5.5
12.5
23.1
28.9
26.5
23.8
49.0
17.2
12.3
57.34
91.77
117.21
146.11
50.82
53.25
52.78
49.69
35.54
58.89
75.74
91.96
32.12
34.68
40.53
38.33
300.41
408.58
508.68
562.94
370.16
493.11
542.65
277.23
940.65
1867.27
1786.43
2000.79
984.50
1623.57
1858.59
1915.30
87.27
252.99
35.8
73.44
499.55
15.1
64.17
1027.55
RA BR
100
BR
91
Fig. 8. Schematic routes for Problem C108 with 100, 200 and 500 iterations.
6. Conclusion
This paper has presented a special type of the vehicle routing
problem with time windows (VRPTW), in which a competition
exists between distributors. In distribution of the products with
short life time that customers need special device for keeping them,
reaching time to customers inuences on the sales amount which
the classical VRPs are unable to handle these kinds of assumptions.
In addition, a new mathematical model related to this problem
has been presented to nd the short routes with the minimum
travel cost of eet, traveled distances and maximum sale for a company. To verify the solution technique, 10 test problems have been
solved by the Lingo 8.0 software and the related results obtained
[1] Dantzig G, Ramser JH. The truck dispatching problem. Management Science
1959;6:8091.
[2] Clarke G, Wright JW. Scheduling of vehicles from a central depot to a number
of delivery points. Operations Research 1964;12:56889.
[3] Laporte G, Mercure H, Nobert Y. A branch and bound algorithm for a class
of asymmetrical vehicle routing problems. Journal of Operational Research
Society 1992;43:46981.
[4] Christian HC, Lysgaard J. A branch-and-price algorithm for the capacitated
vehicle routing problem with stochastic demands. Operations Research Letters
2007;35(6):77381.
[5] Lenstra JK, Rinnooy Kan AHG. Complexity of vehicle routing and scheduling
problems. Networks 1981;11:2217.
[6] Zachariadis EE, Kiranoudis CT. A strategy for reducing the computational
complexity of local search-based methods for the vehicle routing problem.
Computers & Operations Research 2010;37(12):2089105.
[7] Fisher ML. Optimal solution of vehicle routing problems using minimum Ktrees. Operations Research 1994;42:62642.
[8] Golden B, Laporte G, Taillard E. An adaptive memory heuristic for a class of
vehicle routing problems with minmax objective. Computers and Operations
Research 1999;24:44552.
[9] Taillard ED. A heuristic column generation method for the heterogeneous eet
VRP. Rairo OR 1999;33(1):114.
[10] Chiang WC, Russell R. Simulated annealing meta-heuristics for the vehicle
routing problem with time windows. Annals of Operations Research 1996;93:
327.
[11] Koulamas C, Antony S, Jaen R. A survey of simulated annealing applications to
operations research problems. Omega 1994;22(1):4156.
[12] Thangiah SR, Osman IH, Sun T, Hybrid genetic algorithm, simulated annealing
and tabu search methods for vehicle routing problems with time windows,
Technical Report 27, Computer Science Department, Slippery Rock University;
1994.
[13] Gendreau M, Hertz A, Laporte G. A tabu search heuristic for the vehicle routing
problem. Management Science 1994;40:127690.
[14] Gendreau M, Laporte G, Musaraganyi C, Taillard ED. A tabu search heuristic for
the heterogeneous eet vehicle routing problem. Computers and Operations
Research 1999;26:115373.
[15] Yu B, Yang Z-Z, Yao B. An improved ant colony optimization for vehicle routing
problem. European Journal of Operational Research 2009;196(1):1716.
[16] Gajpal Y, Abad P. An ant colony system (ACS) for vehicle routing problem
with simultaneous delivery and pickup. Computers and Operations Research
2009;36(12):321523.
[17] Tavakkoli-Moghaddam R, Saremi AR, Ziaee MS. A memetic algorithm for a vehicle routing problem with backhauls. Applied Mathematics and Computation
2006;181:104960.
[18] Tavakkoli-Moghaddam R, Safaei N, Gholipour Y. A hybrid simulated annealing
for capacitated vehicle routing problems with the independent route length.
Applied Mathematics and Computation 2006;176:44554.
[19] Golden BL, Assad AA, editors. Vehicle routing: methods and studies. Amsterdam, The Netherlands: Elsevier; 1988.
[20] Solomon MM. On the worst-case performance of some heuristics for the vehicle routing and scheduling problem with time window constraints. Networks
1986;16:16174.
[21] Ombuki B, Ross BJ, Hanshar F. Multi-objective genetic algorithm for vehicle
routing problem with time windows. Applied Intelligence 2006;24:1730.
[22] Geiger MJ. Multi-criteria und Fuzzy Systeme in Theorie und Praxis. In: A computational study of genetic crossover operators for multi-objective vehicle
routing problem with soft time windows. Deutscher Universities-Verlag; 2003.
p. 191207.
[23] Cordeau JF, Desaulniers G, Desrosiers J, Solomon MM, Soumis F, The VRP with
time windows. In: Toth P, Vigo D, editors. The vehicle routing problem, SIAM
Monographs on Discrete Mathematics and Applications, Vol. 9, Philadelphia,
PA; 2002. p. 157194.
92
[24] Qureshi AG, Taniguchi E, Yamada T. An exact solution approach for vehicle routing and scheduling problems with soft time windows. Transportation
ResearchPart E 2009;45:96077.
[25] Taillard E, Badeau P, Guertin F, Gendreau M, Potvin J. A tabu search heuristic for
the vehicle routing problem with soft time windows. Transportation Science
1997;31:17086.
[26] Tavakkoli-Moghaddam R, Safaei N, Shariat MA. A multi-criteria vehicle routing
problem with soft time windows by simulated annealing. Journal of Industrial
EngineeringInternational 2005;1(1):2836.
[27] Braysy O, Gendreau M. Vehicle routing problem with time windows, part
I: route construction and local search algorithms. Transportation Science
2005;39:10418.
[28] Solomon MM, Desrosiers J. Time window constrained routing and scheduling
problems. Transportation Science 1988;22(1):113.
[29] Solomon MM. Algorithms for the vehicle routing and scheduling problem with time windows constraints. Operations Research 1987;35:254
65.