0% found this document useful (0 votes)
18 views7 pages

Application of Genetic Algorithm, A Mega-Heuristic Approach, To Solve A Real-Size Vehicle Routing Problem: A Case Study

Most of the 3PL companies that provide transportation services are handling thousands of orders per day. Vehicle routing problems (VRPs) help plan the distribution of goods with the optimum fleet of vehicles and delivery routes and play an important role in helping businesses reduce transportation costs while ensuring service level. VRPs are NP-hard combinatorial optimization problems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

Application of Genetic Algorithm, A Mega-Heuristic Approach, To Solve A Real-Size Vehicle Routing Problem: A Case Study

Most of the 3PL companies that provide transportation services are handling thousands of orders per day. Vehicle routing problems (VRPs) help plan the distribution of goods with the optimum fleet of vehicles and delivery routes and play an important role in helping businesses reduce transportation costs while ensuring service level. VRPs are NP-hard combinatorial optimization problems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

BOHR International Journal of Operations Management Research

and Practices
2023, Vol. 2, No. 1, pp. 10–16
DOI: 10.54646/bijomrp.2023.12
www.bohrpub.com

METHODS

Application of genetic algorithm, a mega-heuristic approach,


to solve a real-size vehicle routing problem: a case study
Phong Nguyen Nhu * and Thao Do Thi
HCMC University of Technology, Ho Chi Minh, Vietnam

*Correspondence:
Phong Nguyen Nhu,
[email protected]

Received: 17 July 2023; Accepted: 19 July 2023; Published: 27 July 2023

Most of the 3PL companies that provide transportation services are handling thousands of orders per day. Vehicle
routing problems (VRPs) help plan the distribution of goods with the optimum fleet of vehicles and delivery routes
and play an important role in helping businesses reduce transportation costs while ensuring service level. VRPs
are NP-hard combinatorial optimization problems. It is quite difficult to achieve an optimal solution for real-size
problems with a mathematical modeling approach because of its NP-hard structure. Genetic algorithm (GA) plays
a major role in searching for near-optimal solutions for NP-hard optimization problems. This article develops the
GA model for VRPs. The result shows that the delivery cost is reduced by 17.88%, while the service level increase
from 88.7 to 100%. It indicates that the model can be a good technique for VRPs.
Keywords: distribution planning, mathematical modeling, vehicle routing problems, genetic algorithm

1. Introduction facilities. The model of the problem is built based on the


above assumptions, objectives, and constraints.
In today’s fiercely competitive business environment, A genetic algorithm (GA) is built. Based on the model
companies need to optimize their supply chains. Logistics is of the problem, the GA will find a good solution for
one of the key areas in supply chain management. Vehicle the problem, and this solution will be compared with the
routing problem (VRP) is a core problem in logistics that solution of the currently used heuristic model to evaluate the
refers to a class of combinatorial optimization in which effectiveness of the GA.
customers are served by several vehicles. VRP is a problem
in which there is a set of vehicles and a set of customers; each
customer requires a certain number of goods. 2. Literature review
This problem is a type of distribution problem that
determines the transportation facilities and their delivery 2.1. Vehicle routing problems
routes with specific objectives and constraints. The problem
to be solved is a VRP with an assumption that the trucks start Vehicle routing problem is about finding optimal routes for a
at the real warehouse and end at the virtual warehouse, the fixed fleet of vehicles in order that they can meet the demands
travel time between the points is fixed, the unloading time at of a set of given customers by traveling through those paths
the points is fixed, the speed of the trucks is the same and (1). Vehicle routing is an important area in the field of supply
fixed, and the factors of failure, accident, and weather are not chain management. Therefore, solving VRP efficiently plays
taken into account. a vital role in the effective implementation of supply chain
The objective of the problem is to minimize the practices for any organization (2).
transportation cost. The constraints are on the level of Open VRP (OVRP) is a type of VRP, where routes finish
customer service and on the capacity of the transportation after servicing the last client (3). The OVRP differs from the

10
10.54646/bijomrp.2023.12 11

classic VRP because either the vehicles are not required to The VRP is a challenging combinatorial optimization
return to the depot or they have to return by revisiting the problem (7). Complexity in solving the problem increases
customers assigned to them in the reverse order (4). exponentially as the problem size increases. GA is a
The capacitated VRP is a problem risen in the fields of widely applied search method to complex problems such
transportation, distribution, and logistics in which a fleet as VRPs (2).
of delivery vehicles must service known customer demands
for a single commodity from a common depot at minimum
cost (5). In the well-known VRP, a set of identical vehicles, 2.2. Genetic algorithm
based at a central depot, is to be optimally routed to supply
customers with known demands subject to vehicle capacity Genetic algorithm, first introduced by Holland in 1975, is
constraints (6). an artificial intelligence search method that uses the process
of evolution and natural selection of individuals called
chromosomes. It is an efficient tool for solving optimization
TABLE 1 | Loads, time limits, and fleet costs. problems. In order to apply GA to a problem, generally the
solution space of the problem is represented by a population
v 1 2 3 4 5 6 of chromosomes where each chromosome is a possible
Qv (kg) 300 300 300 400 400 500
solution to the problem. Chromosomes are represented by
fv (M) 3 3 3 4 4 5
strings. A method of coding is the selection of a string
Tv (h) 8 8 8 8 8 8
format for the chromosomes. A fitness value is associated
with each chromosome. The fitness function is a measure of
the extent to which the objective of the problem is achieved.
The fitness function is derived from the objective function of
TABLE 2 | Demand, unloading time at delivery points. the problem. A certain number of chromosomes are chosen
i 1 2 3 4 5 6 7 8 to form the initial generation. The chromosomes of the
next generation are generated by applying genetic operators,
di (kg) 50 300 200 150 100 150 50 100 including selection, crossover, mutation, and replacement, to
Si (h) 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 the chromosomes of the existing generation.
Starting from an initial population, the algorithm produces
a new population of individuals, which are presumably more
TABLE 3 | Travel time Tij (h) between nodes.
fit than their ancestors. The process is repeated until a pre-
specified termination rule becomes true. At each generation,
i\j 0 1 2 3 4 5 6 7 8 every new chromosome corresponds to a solution.

0 – 0.068 0.137 0.133 0.143 0.345 0.203 0.261 0.202


1 – 0.08 0.065 0.076 0.345 0.228 0.265 0.236 TABLE 5 | Values of Fi , Pi , and the cumulative probability
2 – 0.062 0.049 0.301 0.221 0.231 0.238 function (CPF).
3 – 0.019 0.362 0.27 0.289 0.283 P(0) S1 S2 Z F P CPF
4 – 0.349 0.265 0.279 0.28
5 – 0.165 0.084 0.189 C1 [1, 3, 2, 4, 7, 5, 6, 8] [2, 3, 4, 5, 1, 6] 14 1 0.25 0.25
6 – 0.088 0.03 C2 [1, 4, 3, 8, 2, 6, 7, 5] [3, 1, 2, 4, 5, 6] 13 2 0.5 0.75
7 – 0.117 C3 [6, 4, 1, 7, 8, 3, 5, 2] [1, 3, 4, 5, 6, 2] 14 1 0.25 1
8 – C4 [8, 5, 1, 7, 6, 2, 3, 4] [1, 2, 4, 6, 3, 5] 15 0 0 1

TABLE 6 | The elite population PE (0) = {C2, C1, C3, C3}.


TABLE 4 | The initial population P(0) .
Ri 0.569 0.194 0.828 0.913
P(0) S1 S2 Routes V Z F
PE (0) C2 C1 C3 C3
C1 [1, 3, 2, 4, 7, 5, [2, 3, 4, 5, [1, 3]; [2]; [4, 2, 3, 4, 5 14 1
6, 8] 1, 6] 7, 5]; [6, 8]
C2 [1, 4, 3, 8, 2, 6, [3, 1, 2, 4, [1, 4]; [3, 8]; 3, 1, 2, 4 13 2 TABLE 7 | The crossover list Pc = {C2, C3}.
7, 5] 5, 6] [2]; [6, 7, 5]
C3 [6, 4, 1, 7, 8, 3, [1, 3, 4, 5, [6, 4]; [1, 7, 8]; 1, 3, 4, 5 14 1 PE (0) C2 C1 C3 C3
5, 2] 6, 2] [3, 5]; [2]
C4 [8, 5, 1, 7, 6, 2, [1, 2, 4, 6, [8, 5, 1, 7]; [6]; 1, 2, 4, 6 15 0 Ri 0.47 0.91 0.11 0.88
3, 4] 3, 5] [2]; [3, 4] Pc C2 - C3 -
12 Nhu and Do Thi

3. The vehicle routing problem The objective of the problem is to minimize the total
delivery cost. The constraints of the problem include the
The problem to be solved is an OVRP, where vehicles after following: Each route starts at the warehouse and ends at
delivery to customers do not need to return to the starting a customer point. The number of vehicles starting at the
point. The distribution system consists of a warehouse and real warehouse and ending at the virtual warehouse is equal
a fleet of vehicles Vv , v = 1÷V. Each vehicle Vv has max and does not exceed the limited number of vehicles. The
load Qv , limited delivery time Tv , and operating cost fv . number of cars arriving and leaving at each node is equal.
The system distributes for N customers, and each customer Each customer is only served once by one vehicle. The
is 1 point on the distribution network. The distribution total delivery time does not exceed the time limit. The total
network consists of N + 1 nodes, with node 0 being the demand of the customers in each route does not exceed the
warehouse, node i, i = 1÷N corresponding to the ith vehicle tonnage.
customer. Customers at node i have demand di, unloading The model is set up with the decision variable yij v ,
time Si, i = 1÷N. On a distributed network, the travel time i = 0÷N−1, j = 1÷N, v = 1÷V. If vehicle v moves from node
from node i to node j is Tij , i = 0÷N−1, j = 1÷N. i to node j, then yij v is 1; otherwise, yij v is 0. The model is as
follows:
V X
X N
v
TABLE 8 | The crossover population PC = {C5, C6}. Min Z, Z = fv y0j
v = 1j = 1
PC S1 S2

C5 [6, 4, 3, 8, 1, 7, 5, 2] [3, 1, 2, 4, 5, 6] V X
X N V X
X N
v v
C6 [1, 4, 2, 8, 3, 5, 6, 7] [1, 3, 4, 5, 2, 6] St. : y0j = yi0 ≤ V
v = 1j = 1 v = 1i = 1

V X
N
TABLE 9 | The mutation list Pm = {C1}. X
yijv = 1, j ∈ N\{0}, i 6 = j
PE (0) C2 C1 C3 C3 v = 1i = 0

Ri 0.49 0.12 0.23 0.86


N N
Pm – C1 – – X
v
X
v
yie = yej , v ∈ V, e ∈ N\{0}, e 6 = i, e 6= j
i=0 j=0

TABLE 10 | The mutation population PM = {C7}. N X


N
X
PM S1 S2 (dj yijv ) ≤ Qv , v ∈ V, i 6 = j
i = 0j = 1
C7 [6, 8, 2, 4, 7, 5, 1, 3] [4, 5, 2, 3, 1, 6]

N X
X N
[(tij + sj )yijv ] ≤ T, v ∈ V, i 6 = j
TABLE 11 | The genetic population PG (0) . i = 0j = 0

PG (0) S1 S2 Z
yijv ∈ {0, 1}, v ∈ V, j ∈ N, i ∈ N, i 6 = j
C5 [7, 4, 3, 8, 2, 6, 1, 5] [3, 1, 6, 4, 5, 2] 13
C6 [2, 8, 7, 1, 4, 3, 6, 5] [3, 4, 5, 1, 2, 6] 14
C7 [6, 8, 2, 4, 7, 5, 1, 3] [4, 5, 2, 3, 1, 6] 14 4. The GA model for the pilot VRP
The pilot problem is a VRP problem with six trucks and eight
TABLE 12 | The next population. customers (V = 6, N = 8). The parameters of fleet, customers,
and travel time between nodes are as in Tables 1–3. The pilot
P(1) S1 S2 Z F problem model is set up according to the above parameters.
The GA model is used to solve the problem by the following
C2 [1, 4, 3, 8, 2, 6, 7, 5] [3, 1, 2, 4, 5, 6] 13 2
procedure:
C5 [7, 4, 3, 8, 2, 6, 1, 5] [3, 1, 6, 4, 5, 2] 13 2
C6 [2, 8, 7, 1, 4, 3, 6, 5] [3, 4, 5, 1, 2, 6] 14 1 Step 1: Initialize the GA model.
C7 [6, 8, 2, 4, 7, 5, 1, 3] [4, 5, 2, 3, 1, 6] 14 1
Step 2: Generate the initial population P(0) . Set k = 0.
10.54646/bijomrp.2023.12 13

FIGURE 1 | The objective values Z in nine combinations of Pc , Pm .

Step 3: Generate elite population PE (k) . Customers are numbered from 1 to 8. Each sub-
chromosome S1 is a string of eight genes, Gci , i = 1÷8,
Step 4: Generate the genetic population PG (k) .
corresponding to eight customers. The sequence of genes in a
Step 5: Generate the next population P(k+1) . Set k = k sub-chromosome represents the sequence of customers being
+1. served: S1 = (Gc1 , Gc2 , Gc3 , Gc4 , Gc5 , Gc6 , Gc7 , Gc8 ). Vehicles
Step 6: Check the termination rule. If no, return to Step are numbered from 1 to 6. Each sub-chromosome S2 is a
3. If yes, finish the loop. string of six genes, Gvj , j = 1÷6, corresponding to six vehicles.
The sequence of genes in a sub-chromosome represents the
Step 1: Initialize the GA model sequence of vehicles being used:
This step sets up factors of GA models, including the
method of coding, the population size, the fitness function,
the parameters of GA operators, and the termination rule. S2 = (Gv1 , Gv2 , Gv3 , Gv4 , Gv5 , Gv6 )
The method of coding: Each chromosome C is a string of
The population size P is chosen to be 4:
two sub-chromosomes, S1 is corresponding to the customer
sequence, and S2 is corresponding to the vehicle sequence:
P = 4.
C = [S1, S2] The fitness function F is defined as Fi = Zmax − Zi , where
Fi and Zi are the fitness and objective values of chromosome
i and Zmax is the maximum objective value in the population.
The GA operators include selection, crossover, mutation,
and replacement operators. The selection method is based
on selection probabilities, determined by fitness values. The
crossover method is OX (Order Crossover), the mutation
method is SWAP, and the replacement method is acceptance
threshold. The crossover probability Pc , the mutation
probability Pm , and threshold K are chosen as follows:

Pc = 0.8; Pm = 0.2; K = 2.

The termination rule: The best objective value


of the population Zmin does not decrease after 15
FIGURE 2 | The objective value Z in combination of 0.8, 0.5. consecutive iterations.
14 Nhu and Do Thi

Step 2: Generate the initial population P(0) , set k = 0. Step 5: Generate the next population P(k+1)
The initial population consists of four chromosomes. Each This step uses the replacement operator to generate the
initial individual is created including customer sequence next population P(k+1) from the populations P(k) & PG (k) .
and vehicle sequence, by randomizing the customer delivery The chromosomes from PG (k) will be added to the current
points and available vehicles. The initial population P(0) is population P(k) to make the next population P(k+1) if their
shown in Table 4: P(0) = {C1, C2, C3, C4}. objective values are better than the acceptable threshold,
From customer sequence S1 , vehicle sequence S2 , based on defined by the objective value of the threshold chromosome.
the constraints, the vehicles used, and their corresponding The threshold chromosome is a chromosome in P(k) with
routes are determined, as shown in Table 4. From that, position n defined by population size P and threshold
the objective values Z and fitness values F of each parameter K: n = P/k. With a population size of 4, and the
chromosome can be determined. In the initial population replacement parameter K of 2, the acceptable threshold is
P(0) , the best chromosomes are C2, with the best objective selected as the value of the second chromosome of P(k) in the
value Z of 13 (M). top–down ranking.
Step 3: Generate elite population PE (k) . On the other side, in order to keep the next population
This step uses the selection operator to generate elite size constant, some chromosomes in P(k) with the lowest
population PE (k) from P(k) . Each chromosome in the current fitness values are removed. In P(0) , C1 is the second
population has a corresponding fitness value Fi and is chromosome in the top–down list, and the acceptable
selected for inclusion in the elite population PE (k) with threshold is 14. Looking at the objective values of the
selection probability Pi determined as follows: chromosomes in population PG (0) , C5, C6, and C7 move
into P(1) and C1, C3, and C4 have to move out
Pi = Fi /6 i = 1÷4 (Fi ). to keep P(1) population size constant. Table 12 shows
the chromosomes in the next population P(1) . In P(1) ,
With population P(0) , the values of Fi , Pi , and the the best chromosomes are C2 and C3, with the best
cumulative probability function (CPF) are calculated as objective value of 13.
shown in Table 5. Random numbers Ri are generated 4 times.
Based on CPF, the chromosomes selected into the population
PE (0) are as Table 6. P(1) = {C2, C5, C6, C7}
Step 4: Generate the genetic population PG (k) .
This step uses the crossover and mutation operators
to generate genetic population PG (k) from the elite TABLE 13 | Loads, time limits, and fleet costs.
population PE (k) . The genetic population PG (k) includes V 1÷6 7÷9 10 11÷12
the new chromosome generated from the crossover and
mutation operators. Qv (kg) 1000 1400 1900 2000
The chromosomes of PE (0) are selected to be included fv (M) 1.150 1.600 1.800 2.000
in the crossover list Pc with the crossover probability of Tv (h) 8 8 8 8
0.8. After generating four random numbers Ri , the set Pc is
determined as shown in Table 7. Each pair of chromosomes
in Pc is selected to cross over by the OX method, on both TABLE 14 | Demand, unloading time at delivery points.
sub-chromosomes, resulting in two new chromosomes in
i 1 2 3 4 ... 97
population PC . C2 and C3 are crossed over to each other
and generate two children, C5 and C6. The population PC di (kg) 14.5 17 9 14.5 ... 1000
is shown in Table 8. Si (h) 0.25 0.25 0.25 0.25 ... 0.25
The chromosomes of PE (0) are also selected to be included
in the mutation list Pm with the mutation probability of
0.2. After generating four random numbers Ri , the set
TABLE 15 | Travel time Tij (h) between nodes.
Pm is determined as shown in Table 9. Each chromosome
in Pm is selected to mutate by the SWAP method, on 0 1 2 3 4 ... 97
both sub-chromosomes, resulting in one new chromosome
in population PM . C1 is mutated and generates C7. The 0 – 0.313 0.214 0.124 0.521 ... 0.365
population PM is shown in Table 10. 1 – 0.651 0.145 0.689 ... 0.287
After crossover and mutation, three new chromosomes are 2 – 0.09 0.871 ... 0.697
created in the population PG (0) . Chromosomes in PG (0) with 3 – 0.416 ... 1.010
their genes and objective values are shown in Table 11. 4 – ... 0.723
... – ...
97 –
PG (0) = {C5, C6, C7}
10.54646/bijomrp.2023.12 15

and 0.7. The run charts of the objective values Z in


nine combinations of Pc , Pm are shown in Figure 1. The
nine combinations (Pc , Pm ) give the same objective value,
but the combination (0.8, 0.5) has the smallest number
of iterations. This combination is used to solve real-
world problems.
The nine combinations (Pc , Pm ) give the same objective
value, but the combination (0.8, 0.5) has the smallest number
of iterations, as shown in Figure 2. This combination is used
to solve real problems.

6. The GA model for the real VRP


FIGURE 3 | Total cost Z. The real problem is a VRP problem with 12 trucks and
97 customers (V = 12, N = 97). The parameters of fleet,
customers, and travel time between nodes are shown in
Step 6. Check the termination rule. Tables 13–15.
After iteration 1, the best objective value is 13, appearing The real problem model is set up according to the above
only twice. The termination rule is not satisfied, so parameters. The GA model is used to solve the problem with
iteration 2 is executed. the parameter:

P = 20, PC = 0.8, PM = 0.5


5. The GA model with experiments
for the pilot VRP .
The run chart of the total cost Z is as Figure 3.
Experiments are performed on the above GA model with The result has a total cost of 7.1 million with the
a population size P of 20, and the two input factors vehicles used and the corresponding route as shown in
are the probability of crossover Pc and the probability Table 16.
of mutation Pm . The probability Pc has three levels 0.8, The comparison between the current method and the GA
0.9, and 1. The probability Pm has three levels 0.3, 0.5, model is shown in Table 17. Compared with the current
model, the GA model has a cost reduction of 7.55 million
to 7.1 million (17.88%), the number of late delivery points
TABLE 16 | The vehicles used and the corresponding route by reduced from 11 to 0, and the service level increased from
genetic algorithm. 88.7 to 100%.
v Route

2 [0, 12, 77, 82, 64, 50, 60, 42, 69, 93, 28, 87, 30, 11, 21, 32, 96, 25, 56, 91, 7. Conclusion
53, 5, 23]
5 [0, 6, 75, 66, 57, 9, 72, 73, 22, 16, 41, 89, 81, 13, 19, 36, 20, 79, 92, 74, 24, The GA model has been used to solve the VRP in a
43, 2, 90] distribution system with one warehouse, 12 trucks, and
7 [0, 97, 26, 44, 95, 48, 15, 4] 97 customers. The results show that the GA model gives
8 [0, 71, 94, 45, 18, 51, 14, 3, 59, 84, 70, 65,88, 52, 8, 38, 61, 63, 86, 58, 10, lower cost and higher service level than the heuristic
54, 62]
method, being used. However, the parameters of the
9 [0, 7, 31, 47, 1, 29, 80, 40, 76, 67, 39, 49, 37, 35, 68, 46, 83, 17, 78, 34, 55,
27, 33, 85]
model are only selected empirically, so the results are
not very good. Future research is to use experimental
design DOE to determine the model parameters to get
suboptimal results.
TABLE 17 | Total cost between the current method and the genetic
algorithm (GA) model.

Model Total cost Number of late Service level (%) Author contributions
(million) delivery nodes

Current model 7.55 11 88.7


PN is the thesis advisor of TT. PN and TT contributed to the
GA 7.1 0 100
thesis conception and design. PN has developed the research
models for the thesis. TT has collected and analyzed data and
16 Nhu and Do Thi

written program to run the algorithms, based on References


the models. PN has composed the article, based on
the thesis. Both authors read and approved the final 1. Foroutan RA, Rezaeian J, Mahdavi I. Green vehicle routing and
manuscript. scheduling problem with heterogeneous fleet including reverse logistics
in the form of collecting returned goods. Appl Soft Comput. (2020)
94:106462.
2. Kumar V, Panneerselvam R. A study of crossover operators
Acknowledgments for genetic algorithms to solve VRP and its variants and new
sinusoidal motion crossover operator. Int J Comput Intell Res. (2017)
13:1717–33.
We extend our heartfelt appreciation to everyone who
3. Ruiz E, Soto-Mendoza V, Ruiz Barbosa AE, Reyes R. Solving the open
has contributed to the completion of this research vehicle routing problem with capacity and distance constraints with a
article, especially our families, HCMC University of biased random key genetic algorithm. Comput Ind Eng. (2019) 133:207–
Technology, and the scientific community for their 19.
invaluable support. 4. Sariklis D, Powell S. A heuristic method for the open vehicle routing
problem. J Oper Res Soc. (2000) 51:564–73.
5. Liu S, Huang W, Ma H. An effective genetic algorithm for the fleet size
and mix vehicle routing problems. Transp Res E. (2008) 45:434–45.
Conflict of interest 6. Baldacci R, Battarra M, Vigo D. Routing a heterogeneous fleet of vehicles.
In: Golden B, Raghavan S, Wasil E editors. The vehicle routing problem:
latest advances and new challenges. Boston, MA: Springer (2008).
The research was conducted in the absence of any
7. Kan H, Lee AHI. An enhanced approach for the multiple vehicle routing
commercial or financial relationships that could be construed problem with heterogeneous vehicles and a soft time window. Symmetry.
as a potential conflict of interest. (2018) 10:650.

You might also like