Mixed Integer Programming For Vehicle Routing Problem With Time Windows
Mixed Integer Programming For Vehicle Routing Problem With Time Windows
1/2, 2019
Vijay Kumar received his BTech from the M.M. Engineering College, Mullana.
He received his MTech from the Guru Jambheshwer University of Science
and Technology, Hisar. He received his PhD from the National Institute of
Technology, Kurukshetra. He has been an Assistant Professor at the
Department of Computer Science and Engineering, Thapar University, Patiala,
Punjab. He has more than nine years of teaching and research experience.
He has more than 40 research papers in international journals, book chapters
and conference proceedings. He is on the panel of reviewers of Elsevier and
Springer journals. His main research focuses on soft computing, image
processing, data clustering and multi-objective optimisation.
This paper is a revised and expanded version of a paper entitled ‘Mixed integer
programming for vehicle routing problem using CPLEX’ presented at
International Conference on Cloud, Big Data and IoT, Coimbatore, India,
29–30 March, 2017.
1 Introduction
Logistics distribution has a keen role in the present logistics management. For the last
few decades, vehicle routing problem (VRP), due to its key role in logistics distribution,
has become a topic of main concern for researchers working in the field of distribution
and computation. It has been observed that distribution costs include half of the total
system cost in most of the businesses such as food or drinks. These might sums up to
70% of the total cost (De Backer and Furnon, 1997; Golden and Wasil, 1987; Halse,
1992). Hence, the planning of vehicles and routes could help to minimise the input
resources. Toth and Vigo (2002) reported in their work that computerised methods
would decrease the transportation cost by 5–20%. The well-known examples of VRP are
supermarket distribution, freight transportation and industrial gases delivery.
The simple routing problem is known as travelling salesman problem (TSP).
It suggests that a salesman visiting number of cities should visit all the cities travelling
the minimum distance and returning to the same city where started. The VRP is the
extension of multiple travelling salesman problem (MTSP) in which each request is
associated with each city and each vehicle has a specific capacity limit. When the time
window is added to each customer location then the problem becomes vehicle routing
problem with time windows (VRPTW). The VRPTW is an expansion of VRP. The aim
of VRP is to promote an arrangement of customers with known requests while
minimising the cost on given set of routes. VRPTW involves the delivery in specific time
window provided by the customers.
The time window constraint can be further classified into two categories such as soft
and hard time windows. The former one involves the violation of time constraint at the
sake of cost. If the vehicle arrives before its earliest time period, then vehicle can violate
time window constraints. A new penalty function is added to vehicle in case of arriving
late or early. The former one does not take into consideration a vehicle to arrive after the
latest time to begin service. Hard time window constraint restricts the service time to fall
between the earliest and the latest time constraints. If the vehicle arrives before its earliest
time, then it has to wait until the time window starts.
The focus of this paper is hard time window constraint. The mixed integer
programming (MIP) has been used to solve the VRPTW. A novel constraint has been
designed to minimise the number of vehicle used. This constraint has been utilised in the
MIP. The proposed model has been tested on two instances of Solomon’s benchmark
problem. The remaining paper is structured as follows. Section 2 presents the basic
concepts of VRP and VRPTW. Section 3 introduces the overview of related work done in
the field of VRPTW. The problem formulation is described in Section 4. The
computational results are presented in Section 5. Finally, the concluding remarks are
drawn in Section 6.
6 D. Aggarwal and V. Kumar
2 Background
This section provides the basic concepts used in VRP and VRPTW.
Figure 1 A classical vehicle routing problem (see online version for colours)
having hard time window constraint. The routes in VRPTW are discriminated through
colour lines. Each customer has fixed time constraint window.
Figure 2 A typical vehicle routing problem with time windows (see online version for colours)
The main difference between VRPTW and VRP is that there are time windows imposed
by customers. Each customer can only be visited within the time window. For VRPTW,
the time window is the important factor during the selection of routes. The VRP is only
routing problem. VRPTW is the combination of routing and scheduling problem. Besides
these dissimilarities, both VRP and VRPTW are NP-hard optimisation problems.
3 Literature review
Various researches have been done in the field of VRPTW which can be used to specify
many real world problems. The early works on the VRPTW include case studies such as
Pullen and Webb (1967), Knight and Hofer (1968) and Madsen (1976). Earlier studies on
VRPTW include both optimisation algorithms and heuristic approaches. However, the
focus of current research is heuristic approaches. Various surveys have been done in the
field of VRPTW such as Golden and Assad (1986, 1988), Desrochers et al. (1988) and
Solomon and Desrosiers (1988). Many real-life applications have been proposed for
VRPTW including bank deliveries (Lambert et al., 1993), postal deliveries (Mechti et al.,
2001), industrial refuse collection (Golden et al., 2001), national franchise restaurant
services (Russell, 1995) and industrial gases delivery (Campbell et al., 2001).
VRPTW has been solved using heuristic and exact optimisation approaches. Owing to
the complexity of the VRP family problems, exact methods become useless especially
when large-scale instances are tackled. Kolen et al. (1987) used branch and bound
approach to solve a VRPTW having customer nodes varying between 6 and 15. When the
number of nodes is set to 6, then computation took about 1 min. The branch and bound
8 D. Aggarwal and V. Kumar
approach was unable to process for 12 customer nodes. Sam (1995) worked on reducing
the delivery costs by considering only travel time taken by vehicle while traversing from
one customer to another customer. Moreover, this work involves product delivery by
violating the time windows and compensating it by adding a penalty in the objective
function. Dondo et al. (2003) proposed a mixed integer linear programming (MILP) for
solving multi-depot heterogeneous-fleet VRPTW problem. Dondo and Cerda (2007)
offered three-phase heuristics for m-depot routing problem with time windows and
heterogeneous vehicles. The clustering algorithm was applied on VRPTW which could
solve at most 25 nodes by restructuring MILP.
Cetinkaya et al. (2013) proposed a hybrid approach that combines both MIP and
memetic algorithm (MA) for solving two-stage VRP with arc time windows. He added
time variant to each and every arcs. Suwansuksamran and Ongkunaruk (2013) presented
a MIP for a case study company. In this problem, a binary variable is used to indicate
whether a customer has time window constraint or not. Simbolon and Mawengkang
(2014) suggested a mixed integer approach for VRP with window having a variant of
avoiding routes. When pair of edges occurs frequently, then the sub-route is avoided to
eliminate the heavy traffic. The experimental results revealed that MIP formulation gave
good results for both small- and medium-size instances. However, it was concluded that
MIP formulation is good enough for instances having up to 50 customers.
Besides these, various researchers have applied heuristics techniques for VRPTW.
Holland (1975) proposed a genetic algorithm which initialises the random chromosome
and generates the solution for VRPTW in bit strings. Thereafter, chromosomes were
selected for crossover and mutation process to produce children. The process keeps on
repeating until the evolution has been converged. El-Sherbeny (2001) solved VRPTW
problem using a multi-objective simulated annealing (MOSA) method. Here, three
objectives were defined such as minimising the vehicle used, total time and concerning
the flexible duration of routes. Beatrice et al. (2006) presented a hybrid approach that
comprises of genetic algorithm (GA) and Pareto ranking to solve VRPTW. This method
was applicable on problems with more than 100 customer nodes.
Sabar et al. (2015) suggested an approach that consists of two phases, i.e., math phase
and hyper heuristic phase. This approach is better than the simple hyper heuristics
approach. Hokama et al. (2016) suggested branch-and-cut approach for solving VRP
having loading constraints. It solves the problem in smaller computation time,
but packing strategies and lower bounds could be improved. Ozbaygin et al. (2017)
proposed a branch-and-price algorithm for VRP. This technique used the concept of
roaming delivery locations. The proposed approach provided optimal solution. However,
it requires the prior knowledge of travel time and itinerary of customer.
From the literature, it has been observed that there are two main research issues
associated with VRPTW. First, the identification of route feasibility is an important issue
for VRPTW. Second, the selection of time window during the design of routes is another
research issue.
4 Proposed approach
4.1 Motivation
After the thorough investigation of VRPTW, it has been observed that the high
transportation cost and long scheduling time are the main two areas of concern. The time
window constraint makes the VRP more applicable in real instances. Moreover, it has
been noticed that there is scope to design VRPTW problem as a bi-objective problem that
minimise both the transportation cost and used number of vehicles.
Decision variables
The model includes two types of decision variables X and S. The decision variable Xijk is
defined as follows:
⎧1, if edge from customer i to customer j is traversed by vehicle k
X ijk = ⎨
⎩0, otherwise
The another decision variable Sik represents the time at which vehicle k service
customer i.
Let us assume that S0k = 0 and S(n+1)k denote the time at which vehicles arrives at
returning depot. The objective of model is to design a set of minimal cost routes, one for
each vehicle, such that all customers are serviced exactly once while minimising the
number of vehicles. Therefore, the objective function is considered as bi-objective.
The split deliveries are not allowed. The routes must be feasible with respect to the
capacity of vehicles and time windows of the customers serviced.
The mathematical model of VRPTW is given below:
Minimise ∑ ∑
k ∈C ′ ( i , j )∈E
cij X ijk (1)
Subject to
∑∑ X
k ∈V j∈C ′
ijk = 1, ∀i ∈ C (2)
∑r ∑ X
i∈C
i
j∈C ′
ijk ≤ Q, ∀k ∈ V (3)
∑X
j∈C ′
ojk = 1, ∀k ∈ V (4)
∑X
i∈C ′
ipk − ∑ X hjk = 0, ∀p ∈ C , ∀k ∈ V
j∈C ′
(5)
∑X
i∈C ′
i , n +1, k = 1, ∀k ∈ V (6)
ei ≤ Sik ≤ li , ∀i ∈ C ′, ∀k ∈ V (8)
The objective function (1) states that the total cost should be minimised. Constraint (2)
suggests that only one vehicle should service one node while constraint (3) ensures that
the capacity constraint is fulfilled. Here, no vehicle can serve the customer demands
beyond its capacity permits. Constraints (4)–(6) fulfil the flow constraint for the path
traversed by vehicle k. Constraint (7) makes sure that vehicle k, k ∈ V should not arrive at
customer j before Sik + tij if travelling from node i to j. Constraint (8) checks for the
satisfaction of time constraint. An unused vehicle is represented by an empty route from
node 0 to n + 1.
Mixed integer programming for vehicle routing problem with time windows 11
∑∑x
k ∈V j∈C ′
0 jk ≤ V , ∀k ∈ V , ∀j ∈ C ′ (10)
Note that constraint (7) may results in non-convex optimisation because it involves
quadratic terms. These terms are rewritten in linear form which is given below.
Sik + tij − M ij (1 − X ijk ) ≤ S jk ∀i, j ∈ C ′, ∀k ∈ V (11)
4.4.1 Algorithm
Step 1. a) Obtain the initial linear relaxation of the mixed integer programming
formulation.
b) Construct the initial feasible solution and designate this solution as upper
bound.
c) Add the root node to tree and set the root node as current node.
Step 2. If termination criterion is satisfied, then
Return the upper bound and Exit
Else
Select a node that has the smallest objective function value
Endif
Step 3. Solve the corresponding linear relaxation and obtain the optimal solution
Step 4. If current node is infeasible or worse than upper bound, then
Remove the current node from the tree and goto Step 2.
Endif
Step 5. If Optimal solution is integer, then
Update the upper bound and remove it from tree and goto Step 2.
Endif
Step 6. If Optimal solution is not integer, then
Construct a feasible solution from existing solution and update the upper bound.
Endif
The proposed approach is tested on two test instances of VRPTW. The used test
instances are taken from Solomon’s VRPTW instances (Solomon, 1983). The test
instances are R101 and C101. The first test instance namely R101 that belongs to class
with randomly generated customers. This class is solvable up to 33 customer nodes. The
second test instance namely C101 that belongs to class having clustered customer
locations. This class is solvable up to 60 customer nodes. The objective of proposed
approach is to minimise the number of vehicles and carrying capacity of each vehicle
should be 200 units.
Figure 4 Convergence curve obtained from CPLEX (a) 10 customer nodes (b) 25 customer nodes
for test instance R101 (see online version for colours)
Mixed integer programming for vehicle routing problem with time windows 15
Figure 5 Convergence curve obtained from CPLEX (a) 10 customer nodes (b) 25 customer nodes
for test instance C101 (see online version for colours)
Therefore, mentioned results depict that the proposed model provides better convergence
towards the optimal solution. The performance of proposed model is least affected for
above-mentioned customer nodes.
increases with increase in the value of customer nodes. The result reveals that the number
of vehicles used is six for both 20 and 25 customer nodes.
Figure 6 Comparison between customer nodes and vehicles used with average time on secondary
axis for R101 instance (see online version for colours)
Figure 7 Comparison between customer nodes and vehicles used with average time on secondary
axis for C101 instance (see online version for colours)
For C101 test instances, the performance of proposed approach is greatly reduced with
increase in number of customers. The results obtained from Figure 6 depict that
the number of vehicles used and average computation time increase with increase in
Mixed integer programming for vehicle routing problem with time windows 17
customer nodes. The optimum number of vehicle used is one for 5 and 10 customer
nodes. It can also be observed that the minimum number of vehicle used is three for 20
and 25 customer nodes.
This paper presents an approach for solving VRPTW using MIP. The proposed approach
has been used to minimise transportation cost and number of vehicles used
simultaneously. A new constraint has been designed to optimise the number of vehicles
used. The proposed approach has been tested on two well-known test instances
of Solomon’s benchmark problem. The computational results reveal that both cost and
number of vehicles are optimised at reasonable time. The sensitivity analysis for
customer nodes has been investigated on proposed approach, where it was noticed that
the computational time and number of vehicle used increase with increase in number of
customer node.
This work opens several research directions for future studies. First, metaheuristic
techniques can be applied to solve this problem. Second, metaheuristic can be integrated
with MIP to improving their performance. Third, investigation of different constraint for
VRPTW under different environment would be a valuable contribution. Also, it is worth
to investigate and find the best constraint satisfaction technique among the available
techniques.
Acknowledgements
The work on this paper was partially supported by Thapar University, Patiala under
the seed research grant number TU/DORSP/57/2135. This support is gratefully
acknowledged.
References
Beatrice, O., Brian, J.R. and Franklin, H. (2006) ‘Multi-objective genetic algorithms for vehicle
routing problem with time windows’, Applied Intelligence, Vol. 24, No. 1, pp.17–30.
Campbell, A., Clarke, L. and Savelsbergh, M. (2001) ‘Inventory routing in practice’, in Toth, P.
and Vigo, D. (Eds.): The Vehicle Routing Problem, SIAM, USA, pp.309–330.
Cetinkaya, C., Karaoglan, I. and Gokcen, H. (2013) ‘Two-stage vehicle routing problem with arc
time windows: a mixed integer programming formulation and a heuristic approach’, European
Journal of Operational Research, Vol. 230, pp.539–550.
Dantzig, G.B. and Ramser, J.H. (1959) ‘The truck dispatching problem’, Management Science,
Vol. 6, No. 1, pp.80–91.
De Backer, B. and Furnon, V. (1997) ‘Meta-heuristics in constraint programming experiments with
tabu search on the vehicle routing problem’, Second International Conference on
Metaheuristics (MIC’97), Sophia Antipolis, France, pp.1–14.
Desrochers, M., Lenstra, J.K., Savelsbergh, M.W.P. and Soumis, F. (1988) ‘Vehicle routing with
time windows: optimization and approximation’, in Golden, B. and Assad, A. (Eds.): Vehicle
Routing: Methods and Studies, Elsevier Science Publishers, Holland, pp.65–84.
18 D. Aggarwal and V. Kumar
Dondo, R. and Cerda, J. (2007) ‘A cluster-based optimization approach for the multi-depot
heterogeneous fleet vehicle routing problem with time windows’, European Journal of
Operational Research, Vol. 176, pp.1478–1507.
Dondo, R., Mendez, C.A. and Cerda, J. (2003) ‘An optimal approach to the multiple-depot
heterogeneous vehicle routing problem with time window and capacity constraint’, INTEC
(UNL-CONICET) Guemes, Santa Fe, Argentina, pp.3450–3000.
El-Sherbeny, N. (2001) Resolution of a Vehicle Routing Problem with Multiobjective Simulated
Annealing Method, PhD Dissertation, Faculte Polytechnique de Mons, Belgique.
Golden, B.L. and Assad, A.A. (1986) ‘Perspectives on vehicle routing: exciting new
developments’, Operations Research, Vol. 34, pp.803–809.
Golden, B.L. and Assad, A.A. (1988) Vehicle Routing: Methods and Studies, Elsevier Science
Publishers, New York, USA.
Golden, B.L. and Wasil, E.A. (1987) ‘Computerized vehicle routing in the soft drink industry’,
Operations Research, Vol. 35, pp.6–17.
Golden, B.L., Assad, A.A. and Wasil, E.A. (2001) ‘Routing vehicles in the real world: applications
in the solid waste, beverage, food, dairy and newspaper industries’, in Toth, P. and Vigo, D.
(Eds.): The Vehicle Routing Problem, SIAM, Philadelphia, pp.245–286.
Halse, K. (1992) Modeling and Solving Complex Vehicle Routing Problems, PhD Thesis, Institute
of Mathematical Modelling, Technical University of Denmark, Lyngby, Denmark.
Hokama, P., Miyazawa, F.K. and Xavier, E.C. (2016) ‘A branch-and-cut approach for the vehicle
routing problem with loading constraints’, Expert Systems With Applications, Vol. 47,
pp.1–13.
Holland, J.H. (1975) Adaptation in Natural and Artificial Systems, University of Michigan Press,
Ann Arbor, MI.
Knight, K. and Hofer, J. (1968) ‘Vehicle scheduling with timed and connected calls: a case study’,
Operational Research Quarterly, Vol. 19, pp.299–310.
Kolen, A.W.J., Rinnooy Kan, A.H.G. and Trienkens, H.W.J.M. (1987) ‘Vehicle routing and
scheduling with time windows’, Operations Research, Vol. 35, No. 2, pp.266–273.
Lambert, V., Laporte, G. and Louveaux, F. (1993) ‘Designing collection routes through bank
branches’, Computer’s and Operations Research, Vol. 20, pp.783–791.
Madsen, O.B.G. (1976) ‘Optimal scheduling of trucks – a routing problem with tight due times for
delivery’, in Strobel, H., Genser, R. and Etschmaier, M. (Eds.): Optimization Applied to
Transportation Systems, IIASA, International Institute for Applied System Analysis,
Laxenburgh, pp.126–136.
Mechti, R., Poujade, S., Roucairol, C. and Lemari, B. (2001) Global and Local Moves in Tabu
Search: A Real-Life Mail Collecting Application, Manuscript, PriSM Laboratory, University
of Versailles, France.
Ozbaygin, G., Karasan, O.E., Savelsbergh, M. and Yaman, H. (2017) ‘A branch-and-price
algorithm for the vehicle routing problem with roaming delivery locations’, Transposition
Research Part B, Vol. 100, pp.115–137.
Pullen, H. and Webb, M. (1967) ‘A computer application to a transport scheduling problem’,
Computer Journal, Vol. 10, pp.10–13.
Russell, R.A (1995) ‘Hybrid heuristics for the vehicle routing problem with time windows’,
Transportation Science, Vol. 29, pp.156–166.
Sabar, N.R., Zhang, X.J. and Song, A. (2015) ‘A math-hyper-heuristic approach for large-scale
vehicle routing problems with time windows’, Evolutionary Computation (CEC), IEEE
Congress, Sendai, Japan, pp.830–837.
Sam, R.T. (1995) Vehicle Routing with Time Windows using Genetic Algorithms, submitted to the
book on Application Handbook of Genetic Algorithms, New Frontiers, pp.253–277.
Mixed integer programming for vehicle routing problem with time windows 19
Simbolon, H. and Mawengkang, H. (2014) ‘Mixed integer programming model for the
vehicle routing problem with time windows considering avoiding route’, International
Journal of Advanced Research in Computer Engineering & Technology (IJARCET), Vol. 3,
pp.2741–2744.
Solomon, M.M. and Desrosiers, J. (1988) ‘Time window constrained routing and scheduling
problems’, Transportation Science, Vol. 22, pp.1–13.
Solomon, M.M. (1983) Vehicle Routing and Scheduling with time Windows Constraints: Models
and Algorithms, PhD Dissertation, Department of Decision Sciences, University of
Pennsylvania.
Solomon, M.M. (1987) ‘Algorithms for the vehicle routing and scheduling problems with time
window constraints’, Operations Research, Vol. 35, pp.254–265.
Suwansuksamran, S. and Ongkunaruk, P. (2013) ‘A mixed integer programming for a vehicle
routing problem with time windows: a case study of a Thai seasoning company’, Proceedings
of the 4th International Conference on Engineering, Project, and Production Management,
Bangkok, pp.1214–1221.
Toth, P. and Vigo, D. (2001) The Vehicle Routing Problem, Monographs on Discrete Mathematics
and Applications, SIAM, Philadelphia.