Vous êtes sur la page 1sur 5

A genetic algorithm metaheuristic for Bakery

Distribution Vehicle Routing Problem with Load

Timur Keskinturk

Mehmet Bayram Yildirim

Department of Quantitative Methods, School of Business

Istanbul University
Avcilar Yerleskesi, Bogazici Cad.
Istanbul, 34320 TURKEY

Department of Industrial and Manufacturing Engineering

Wichita State University
1845 N Fairmount St.
Wichita, KS, 67260-0035 USA

Abstract In this paper, we analyze a distribution problem at a

bakery company in Istanbul, Turkey. The bakery wants to
distribute products with the available fleets of trucks, while
maintaining balance in workload between different truck drivers.
The resulting problem is very similar to a capacitated vehicle
routing problem with load balancing objective with a maximum
distribution time and truck capacity constraints. A genetic
algorithm meta-heuristic approach is proposed to obtain good
quality solutions. The proposed meta-heuristic is utilized on a
case study where different trucks serve customers in a large
metropolitan area. The distance matrix is generated via a web
application using Google Maps. The solutions obtained via the
meta-heuristic are compared with the companys own
distribution plan and global ant colony optimization algorithm.

convergence rate. Because exact approaches are generally

inadequate and inflexible, heuristics are commonly used. In
this paper, to solve the proposed model, we utilize a genetic
algorithm with local search to obtain good results in
reasonable amount of time. For discussions on VRP, we refer
the reader to Toth and Vigo [3] and Ralphs et al. [4].
Workload balancing on similar resources is a well-studied
problem. For example, in a manufacturing setting Duman et al.
[5] show that a balanced load in parallel resources may
improve the flexibility and deficiency of the production line.
Assigning tasks to workers in an office or shop floor is another
viable example. To maintain the morale of the workforce, it is
of utmost important to keep the assignment of jobs to
employees working in the same area as equally balanced as
possible (i.e., assign approximately equal workload) to
minimize tension on the office or shop floor, or in this case,
between the truck drivers. In vehicle routing problems, to
minimize disparities and achieve fairness between drivers,
workload balancing objectives have been introduced. In a
vehicle routing problem, workload for a driver on a tour can be
defined in terms of the length of the tour, volume transported
during a period [6] duration of the tour (which may include
loading and unloading operations [7], [8], or as a number of
customers whom needs to be visited. The objective may be
minimization of the sum of the dierences between the
workload of each tour and the smallest workload [8] or the
dierence between the workload of the longest tour and the one
of the shortest tour [7], [9], [10].

Keywords-component; Load balancing, Vehicle Routing with

capacity constraints, Bakery Distribution, metaheuristics, genetic



In this paper, we propose a mathematical model for a

distribution planning problem at a bakery in Istanbul Turkey
with a load balancing objective [1]. The bakery owns a fleet of
trucks which are used in distribution of fresh perishable bakery
products. The trucks loaded with fresh bakery products may
visit several grocery stores, markets and restaurants on a tour to
satisfy the customer demand and return back to the bakery
three times a day. Currently, the bakery has partitioned the
demand by regions, and serves each region via a truck. We
model this problem as a capacitated vehicle routing problem
with load balancing objective and maximum tour length. Our
goal is to propose a framework to improve the current
distribution plan by the bakery management by minimizing the
imbalance between the workloads of drivers.

The Vehicle Routing Problem (VRP) with load balancing

consists of designing a set of delivery or collection routes such
that: 1) Each route starts and ends at the depot, 2) each service
request is visited exactly once by exactly one vehicle, 3) the
total demand of each route does not exceed the capacity of a
truck; 4) the total duration of each route (including travel and
service times) does not exceed a preset limit due to
perishability of bakery products; and 5) the total workload
imbalance is minimized.

The VRP introduced by Dantzig ve Ramser [2] is a hard

combinatorial optimization problem and only relatively small
instances can be solved to optimality. Exact algorithms are
only capable of solving small instances with the amount of
customers typically being less than 50. This is because the
lower bounds of the objective value are difficult to derive, so
partial enumerations based on exact algorithms have a slow

The organization of the paper is as follows: In section 2, the

assumptions, parameters and the model for the VRP problem

978-1-61284-922-5/11/$26.00 2011 IEEE


with load balancing are presented. Next, a genetic algorithm

meta-heuristic to solve VRPLB is described. After results
computational experimentation on a case study, conclusions are
presented in section 5.

x ijk d y ik

Constraint (6)/constraint (7) ensures that a demand point must

be before/after another demand point on a vehicles tour.
x d y
k K, j J




i J,k Ki, j Jk



i J k

To describe the VRPLB model the following notation is

utilized: K is the set of vehicles, and |K| denotes the number of
vehicles. Similarly, J is the set of demand points. Kj is the
subset of vehicles which may serve demand at j, and Jk is the
subset of demand points which can be served by vehicle k.
Sijk is the distance (duration) for vehicle k if demand point i
precedes j on vehicle ks tour. pik is the amount of time
required to load/unload the demand at i by if vehicle k is

x ijk d y ik


k K ,i Jk

j J k

Constraint (8) represents sub-tour elimination constraints,

which ensure that a demand point cannot be the immediate
predecessor or successor of two or more different demand
points at the same time on a vehicles tour.
x d| J |  1




i J k j J k

The imbalance is defined as C m ax  C k where the minimization

Constraint 9 limits the amount of demand that can be satisfied

by vehicle k as Qk.
d y dQ ,

objective will force C m ax to have the value of maximum

completion time of jobs on all vehicles, i.e.,

where di is the demand at i.

Let C k be the total completion time of the tour for vehicle k.

C m ax

The relative imbalance for vehicle k is the ratio of imbalance

and the maximum completion time on all machines, i.e.,
C m ax  C k
C m ax

m ax


C m ax

Note that any solution with a zero ARPI value is optimal. The
VRPLB model has an exponential number of possible
solutions and is a very difficult problem to solve. This
motivated us to develop a genetic algorithm to determine good
solutions in a reasonable amount of time.



Mathematically, the total completion time of vehicle ks tour,

C k is defined as

y ik p ik 

i J

x ijk s ijk



i J k j J k

if dem and i is assigned to vehicle k

otherw ise

x ijk


Genetic algorithms (developed by Holland [11]-[12] and a

meta-heuristic that mimic the process of evolution in order to
solve complex combinatorial problems), have been applied
successfully to vehicle routing problems. Genetic Algorithms
(GAs) updates a population of solutions via genetic operators
such as crossover, mutation and selection to achieve offsprings
with better quality until some convergence criteria are met. At
each generation, a genetic algorithm is capable of producing
and maintaining a set of feasible solutions, maintaining a
population of candidate solutions, and evaluating the quality
of each candidate solution according to the problem-specific
fitness function. The pseudo-code of the genetic algorithm is
presented in Fig.1. The components of the proposed genetic
algorithm are explained in detail below:

y ik

Below is a mathematical program to minimize average relative

percentage imbalance for a vehicle routing problem with
heterogeneous fleet where the goal is to minimize the average
relative percentage of imbalance (ARPI).
m in


To ensure the daily number of deliveries to a demand point, a

limit on the total length of a tour by vehicle k (Tk) is imposed
by the following constraint:
C d Tk

m ax k K C k .

relative im balance k =

i J

if i is the im m ediate predecessor of j on vehicle k ' s tour

otherw ise

Constraint (3) ensures that the maximum workload is greater

than or equivalent to individual workloads.
C m ax t C k

Representation (Coding): Each solution to the genetic

algorithm is represented as a super chromosome having the size
of the number of customers (|J|). This chromosome has subchromosomes that represent the sequence of visits to customers
on a tour for each vehicle (see Figure 2 for a chromosome that
represents ten costumers and three vehicles). The customers
which will be served by the first vehicle are listed in the
scheduled order on a tour is listed first on the super

Constraint (4) ensures that each demand point is assigned to a

i J
y 1


Constraint (5) guarantees that only two demand points on the

same vehicles tour can precede each other.


chromosome, followed by customers of vehicle 2 and then

vehicle 3. In another array of size of the number of vehicles
(|K|), information on the number of customers scheduled for
each vehicle is kept.

Mutation: The mutation operator moves a gene randomly to

another position on the chromosome, with a probability equal
to the mutation probability, Pm. If the new position is in the
same vehicle, then only the customers order is changed.
However, if the gene is moved to another vehicle, the number
of customers and order of customers on both vehicles may

Genetic Algorithm
STEP 0: Generate an initial population
STEP 1: Evaluate the fitness value of the
STEP 2: Perform selection operation and give those
individual that have better fitness values a
more chance to survive in the next generation.
STEP 3: Perform crossover and mutation operations.
Apply Feasibility Check for each new
STEP 4: Perform local search (optional)
STEP 5: Repeat steps 1, 2, 3 and 4 until the GA is
run for the predetermined number of
STEP 5: Select the best chromosome.

Feasibility Check: For each new offspring obtained via

mutation or crossover operation, the feasibility should be
checked. If not feasible, i.e., at least one of the trucks tour
violate the total capacity of a vehicle, apply the following one
pass heuristic possibly to obtain a feasible solution: if the total
demand/duration for vehicle k is more than its capacity/max
tour length, include all customers on the tour that the vehicle
capacity/tour length can handle. Move those who cannot be
handled to the next vehicle, k+1.
Local Search (optional): A 2-exchange heuristic, a first
improvement local search, is utilized to switch positions of two
customers on a chromosome (i.e., either in the same vehicle or
on different vehicles). Apply feasibility check. If the exchange
improves the current solution, it is kept. At each iteration, |J|2
number of exchanges is performed.

Figure1. Pseudocode for the genetic algorithm

Vehicle 1

Vehicle 2


Vehicle 3

Two variants of the genetic algorithm without (GA) and with

local search (GA*) are utilized to solve the problem.

Figure 2. Representation of a chromosome for a 3 vehicle 10 customers



The bakery company has 74 customers and 4 trucks. These

vehicles are used to deliver fresh bakery products three times a
day. Each truck has a capacity of 6000 units, and can deliver
to all customer locations. It is assumed that the demand for
each customer is known through historical data, and each
customer can be served by any vehicle. Furthermore, it is
assumed that it takes the same amount of time to load/unload
at each demand point. The locations of each customer are
marked on the map in Figure 3 (Google Inc.[14]). The
distances and duration times between each customer are
calculated using Google Maps. These distances were verified
by the bakery management team and the drivers of the trucks

Evaluation of Fitness Function: The fitness function f for a

chromosome : is the objective function value, (ARPI) of
solution : while severely penalizing the infeasibilities in the
capacity and maximum trip length constraints (equations 9 and


f (AR PI: )


m in 0 , Q k  d i y ik  m in 0 , C k  Tk


i J


Selection: The selection model should reflect nature's survival

of the fittest. In this paper, the roulette wheel system is used to
select parents for the next generation [13].

The computational experimentation is performed on a Pentium

Dual Core Machine with 4 GB of memory and 120 GB of hard
drive using MATLAB R2007b as the programming medium to
code develop the meta-heuristics. The value of performance
measures is obtained by averaging the results over 10 runs of
1000 iterations for 10.
Through experimentation, the
crossover and mutation probability and a population size is
determined as 0.9, 0.01, and 40, respectively. The
computational results are presented in Table 1.

Crossover: Once parents are selected, the single point

crossover operation is applied with a probability of Pc to
generate two new offspring solutions: Two parent strings are
selected randomly from the population. A random number
between 2 to |J|-1 is generated to determine the crossover
point. When crossover is finished, the genes before the
crossover point in the first chromosome are the first part of the
first child chromosome. The second part of the first child
chromosome is generated by checking the genes from the
second chromosome one by one and adding those genes that
are not yet in the child chromosome. Similarly, the 2nd child
chromosome is generated. Note that the number of demand
points for each vehicle is kept constant.

In Table 1, the ARPI values for the current solution by the

company, and also by a global ant colony optimization
algorithm (GACO) to solve the vehicle routing problem
without any side constraints by Keskinturk [1]. The GACO,


current ARPI is 16%, whereas the GA* has an ARPI value of

8%, so an improvement of 50% is ARPI values. As can been
seen in figure 4, when the maximum allowable tour length
increases, the ARPI decreases. However, this also results in
longer tour lengths and durations. The GACO which provides
the solution with the shortest tour length (since its aim is to
minimize the total tour length, but not minimization of ARPI,
and does not have any capacity constraint as well as total tour
length constraint) has the worst ARPI value. With some
modifications in the length of the tour, a more balanced
GACO algorithm which determines the minimum length
distribution plan has a total tour length of 342 minutes while
having an ARPI value of 41% By increasing the total
distribution time by 25% (i.e., 80 minutes), the ARPI value
can be decreased to 9%.

originally proposed by Keskintrk and Soyler [15], is a

population based ant colony optimization meta-heuristic, was
developed to solve the lot sizing problems [1]. To avoid local
minimums, GACO utilizes an operator similar to mutation
operators in genetic, by mutating the routes of the ants to
obtain new potential solutions. When applied to VRP
problems, computational experimentation proved the
effectiveness of GACO algorithm over classical metaheuristics such as variants of ant colony optimization
algorithms and genetic algorithms [1].

Figure 3. Locations of the customers [1]

Figure 4. ARPI as a function of tour travel time constraint

The maximum tour length parameter is varied to 102, 108, 114

and 120 minutes for most of the vehicles. However, it was
observed that regardless of the objective function, the trucks
serving customers located in the northwest quadrant could not
be served in less than 120 minutes when there is meaningful
workload for that vehicle, so the minimum tour length for that
vehicle was kept constant at 120 minutes.



In this paper, a capacitated vehicle routing problem with load

balancing objective and maximum tour length constraint is
proposed. A genetic algorithm with local search is developed.
The solution framework is applied on a real life case study
from a bakery. It was observed that the genetic algorithm with
local search outperformed the solutions obtained from the one
without local search, and the companys solution.
Furthermore, it was observed that when the maximum tour
length constraint is relaxed, better ARPI values are obtained.
However, the tour lengths increase. As a future research, one
can try to develop a solution algorithm for a multi-objective
capacitated VRP problem with load balancing and total tour
length objectives.

In Table 1, firm represents the companys current schedule

and GACO is the ARPI values for VRP problem without
capacity and tour lengths obtained with GACO algorithm,
unconstrained column represents the ARPI values for the VRP
problem with load balancing objective, however, without tour
length constraint. For all solutions, the tour length for each
vehicle is listed in Table 1. Note that the ARPI values for firm
and GACO algorithm are significantly higher than solutions
for which load balancing was the objective. If no tour duration
contraint is imposed, one can obtain perfect ARPI values with
an objective function value of 0.01.

This paper was partially supported by the Istanbul University.
Research Foundation Project (BAP) No: 10625.

The results indicate that the genetic algorithm with local

search (GA*) outperforms other solutions. The companys




GA (minutes)




Vehicle 1



Vehicle 2































































Total Delivery












Vehicle 3
Vehicle 4

Vehicle 4s constraint was upped to 120 minutes







GA* (minutes)

T. Keskinturk, Global Ant Colony Optimization for Vehicle Routing

Problems, PhD Dissertation, Istanbul Universitesi, Institute of Social
Sciences, Published by Economic Research Foundation, Istanbul,
Turkey, 2010.
G.B. Dantzig, and J.H. Ramser, The truck dispatching problem,
Management Science, Vol. 6(1), (6), No:1,1959, pp. 80-91.
P. Toth ve D. Vigo, The vehicle routing problem, SIAM, Philadelphia,
T.K. Ralphs, L. Kopman, W.R. Pulleyblank and L.E. Trotter, On the
Capacitated Vehicle Routing Problem, Math. Programming, Vol. 94,
2003, pp.343359.
E. Duman, M. B. Yildirim and A. F. Alkaya, Scheduling continuous
aluminum casting lines, International Journal of Production Research,
Vol. 46 (20), 2008, pp. 5701-5718
R. Ribeiro and H.R. Lourenco, A multi-objective model for a multiperiod distribution management problem,
in proceedings of
Metaheuristic International Conference 2001, pp.91102, 2001.
N. El-Sherbeny, Resolution of a vehicle routing problemwith multiobjective simulated annealing method. Ph.D. thesis, Faculte
Polytechnique de Mons, Mons, Belgium, 2001.






T.R. Lee and J.H. Ueng, A study of vehicle routing problem with load
balancing, International Journal of Physical Distribution and Logistics
Management, 29, 1998, pp. 646648.
N. Jozefowiez, Modelisation et resolution approchees de proble`mes
de tournees multi-objectif. Ph.D. thesis, Laboratoire dInformatique
Fondamentale de Lille, Universite des SciencesetTechnologiesde
Lille,VilleneuvedAscq, France, December 2004.
N. Jozefowiez, F. Semet, E-G. Talbi, Parallel and hybrid models for
multi-objective optimization: Application to the vehicle routing problem,
in: J.J. Merelo Guervos et al. (Eds.), Parallel Problem Solving from
Nature VII, Lecture Notes in Computer Science, vol. 2439, SpringerVerlag, 2002, pp. 271280.
D.E. Goldberg, Genetic Algorithms in Search Optimization and Machine
Learning, Addison Wesley Publishing Company, USA, 1989.
C.R. Reeves, Modern Heuristic Techniques for Combinatorial Problems,
Mcgraw-Hill Book Company Inc., Europe, 1995.
Ip, W.H., Li, Y., Man, K.F., Tang, K.S., Multi-product planning and
scheduling using genetic algorithm approach Computers & Industrial
Engineering, Vol. 38(2), 2000, pp. 283-296.
Google Inc. (2009). Google Maps. (Online): http://maps.google.com/
Keskinturk, T., Soyler H., Global Ant Colony Optimization Journal of
The Faculty of Engineering and Architecture of Gazi University,Vol.
21(4), 2006, pp. 689-698, 2006. (In Turkish)