Decomposing and Solving Capacitated Vehicle Routing Problem (CVRP) Using Two-Step Genetic Algorithm (Tsga)
Decomposing and Solving Capacitated Vehicle Routing Problem (CVRP) Using Two-Step Genetic Algorithm (Tsga)
ABSTRACT
Capacitated vehicle routing problem (CVRP) is one of the vehicle routing problem (VRP) that uses
capacity restriction on the vehicles used. There are many methods have been studied to solve CVRP. To
solve CVRP, it is possible to decompose CVRP into regions (sub problems) that can be solved
independently. A two-step genetic algorithm (TSGA) is formulated in this paper. TSGA is used to
decompose CVRP and then find the shortest route for each region using two different simple genetic
algorithms. TSGA is then compared with genetic algorithm (GA). To compare these two algorithms, four
instances is formed, those are P50, P75, P100, and P125. For each instance, fourteen different vehicle
capacities is used. The results show that TSGA is better than GA in terms of computational time and
distance except for some small vehicle capacities at P50 and P75.
Keywords: Capacitated Vehicle Routing Problem (CVRP), Genetic Algorithm (GA), Decomposition, Two-
Step Genetic Algorithm (TSGA)
461
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
462
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
exchange and inversion works can be seen in demand. The second characteristic is taken so that
Figure 2 and Figure 3. CVRP solution that is formed will be good
enough. TSGA1 will try to meet this characteristic
Parents with consider the slope of the line connecting the
1 2 3 4 5 6 7 8 9 customer with the depot. In this case, the use of
slope of the line based on the fact that if the slope
Child between the two lines adjacent to each other, then
1 2 3 4 8 6 7 5 9
the points that exist in the line will also be close
Figure 2. Exchange enough.
Consider the example of a simple CVRP in
Parents
1 2 3 4 5 6 7 8 9
Figure 4 where a large circle represents the depot
and small circles represent the customers. From this
Child example, one of which could be generated
1 2 6 5 4 3 7 8 9 decomposition by TSGA1 can be seen in Figure 5.
Figure 3. Inversion
463
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
(4)
(5)
(6)
Before TSGA1 can be used, every slope of the where is number of digit 1 in the
line must be calculated. Then slopes is sorted from chromosome, is number of vehicle used.
the smallest to the largest. Once the slope is sorted, • Selection is done by selecting two random
each customers from small slope to large slope is chromosomes.
labeled by , where is number of • Crossover operator which is used is 1-point
customers in CVRP instances. TSGA1 is crossover with the crossover probability is 1.
formulated with the following characteristics: The example of how the OX works can be seen
• Chromosome representation which is used is a in Figure 7.
binary representation. For example, if CVRP
instance consist of 20 customers, one of the Parents
chromosomes that can be used is 1 1 1 1 1 1 1 1 1
00010000010010000000. That chromosome 0 0 0 0 0 0 0 0 0
shows that CVRP is decomposed into three
regions. Number of regions which is formed is Child
equal to the number of digit 1. The first area is 1 1 1 1
characterized by sub-chromosome 100000
which represents customers . 0 0 0 0 0 1 1 1 1
Second area is characterized by sub- Figure 7. 1-Point Crossover
chromosome 100 which represents customers
. Third area is characterized by • Mutation operator is done by selecting a
sub- chromosome 10000000 and 000 which random digit and then change the value. If
represents customers . selected value is 1, then changed to 0, and vice
• Population size which is used is 100. versa. Mutation probability is 0.5.
• Suppose that a chromosome represent routes • Population replacement scheme which is used
, , where is is elitism replacement with filtration.
and • Stopping condition which is used is fitness
value is not improved after 2000 generations or
, then the fitness function 100000 generations is reached.
that be used is (7) defined as follows:
4.2. TSGA2 for TSGA
(2)
TSGA2 is used to find shortest route of a
regions formed by TSGA1. These routes are then
combined to become CVRP solution. TSGA2 is
formulated with the following characteristics:
(3) • Chromosome representation which is used is a
permutation of the customers. As an example,
464
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
465
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
P75 consists of a depot and 75 customers that 5.2. Comparison of TSGA and GA
must be d. In this instance, the abscissa and ordinate
of depot is 75, while the abscissa and ordinate of Comparison of TSGA and GA can be done by
customers is between 0 and 150. Each customer has using TSGA and GA to solve P50, P75, P100, and
a demand, that is between 10 to 30. Abscissa, P125 which is created. For each instance, fourteen
ordinate, and demand of each customer can be seen different vehicle capacities is used. Comparison
in Table 2. between TSGA and GA will be seen in terms of
P100 consists of a depot and 100 customers distance and computational time needed to solve
that must be d. In this instance, the abscissa and CVRP.
ordinate of depot is 100, while the abscissa and In term of distance, used
ordinate of customers is between 0 and 200. Each where is
customer has a demand, that is between 10 to 30.
distance obtained by GA and is distance
Abscissa, ordinate, and demand of each customer
obtained by TSGA. This value show how well
can be seen in Table 3.
solution obtained by TSGA when is compared to
P125 consists of a depot and 125 customers
solution obtained by GA. The results are computed
that must be d. In this instance, the abscissa and
after making 3 independent runs, and get the best
ordinate of depot is 125, while the abscissa and
distance from those runs. The comparison between
ordinate of customers is between 0 and 250. Each
TSGA and GA is showed in Table 5, Table 6, Table
customer has a demand, that is between 10 to 30.
7, and Table 8. The bold values in the table shows
Abscissa, ordinate, and demand of each customer
better value between TSGA and GA.
can be seen in Table 4.
Table 5. Comparison of GA and TSGA for P50
Table 4. Abscissa, Ordinate, and Demand of P125
Vehicle GA TSGA
4 152 15 52 81 16 112 136 12 197 187 28 Capacity Distance Time Distance Time
4 12 20 52 60 21 112 19 23 199 47 30 77 1459.428 25 1591.732 10 -9.06
5 179 24 52 149 17 115 236 17 200 148 22 83 1411.733 31 1533.234 10 -8.60
8 225 18 56 102 29 117 35 25 204 179 13
90 1319.670 38 1429.179 10 -8.29
9 6 10 61 71 29 124 195 19 205 6 19
10 246 15 63 77 15 129 7 19 211 124 21
99 1234.570 24 1287.732 7 -4.30
10 135 28 65 32 11 132 48 19 215 138 11 109 1205.129 13 1247.899 5 -3.54
14 78 22 67 246 15 135 83 18 216 77 24 122 1083.415 29 1166.375 6 -7.65
14 119 11 67 238 28 136 153 23 217 66 29 139 1015.836 64 1059.293 5 -4.27
15 103 22 72 140 14 143 139 13 217 28 20 160 985.226 28 915.086 4 7.11
16 34 13 73 177 11 144 126 16 218 237 13
189 899.162 18 863.571 3 3.95
17 119 11 76 74 23 147 112 11 219 140 29
19 139 25 77 19 10 152 44 30 221 116 22 231 801.136 22 801.507 3 -0.04
20 192 11 83 184 20 154 237 14 221 212 28 297 788.582 44 710.183 3 9.94
22 85 29 86 124 16 155 212 18 221 120 28
27 7 30 86 96 29 159 19 30 228 209 10 Table 6. Comparison of GA and TSGA for P75
30 142 17 87 233 25 159 111 26 228 181 19 Vehicle GA TSGA
31 240 10 87 97 25 161 220 22 229 25 21 Capacity Distance Time Distance Time
32 240 15 87 127 27 162 24 16 231 52 20
105 2386.744 85 2404.516 9 -0.74
32 246 14 88 153 13 164 108 22 234 142 12
33 217 10 89 1 15 167 180 24 235 197 16 113 2309.077 104 2401.982 6 -4.02
38 226 16 93 174 15 170 150 29 235 132 14 123 2170.193 65 2203.066 9 -1.51
41 165 16 93 182 16 174 0 16 241 237 25 135 2053.659 115 2068.197 7 -0.70
43 108 30 94 233 13 175 198 13 241 177 30 149 1961.569 55 1885.894 5 3.85
43 106 22 94 145 29 178 18 24 243 166 24
166 1811.217 136 1835.419 6 -1.33
43 165 18 95 30 17 178 114 14 244 77 22
188 1719.833 85 1630.429 4 5.19
45 194 19 96 14 28 183 4 16 244 83 11
47 112 26 99 147 15 190 132 13 247 155 23 217 1698.279 81 1501.133 5 11.6
48 74 29 102 108 26 190 167 22 247 242 30 257 1598.278 98 1377.450 5 13.8
49 230 15 103 15 21 194 38 21 314 1574.126 95 1359.159 5 13.6
49 116 10 103 43 13 195 123 25 404 1514.616 116 1215.419 6 19.7
51 201 23 107 132 28 197 33 24
466
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
For P50, we use 77, 83, 90, 99, 109, 122, 139, computational time, TSGA is better than GA. In
160, 189, 231, 297 as a vehicle capacity. If we use terms of distance, TSGA is better than AG except
77 as vehicle capacity, minimum number of vehicle for some small vehicle capacities at instances P50
that can be used is (where and P75. Larger vehicle capacity will gives larger
value that means TSGA will be better if larger
1040 is total demand of all customers in P50). And
vehicle capacity is used.
if we use 297 as vehicle capacity, minimum number
of vehicle that can be used is . REFERENCES:
Similar reasons are used to choose the vehicle
capacities for P75, P100, and P125. [1] Nazif, H. and Lee, L.S.. 2012. “Optimized
Crossover Genetic Algorithm for Capacitated
Table 7. Comparison of GA and TSGA for P100 Vehicle Routing Problem”. Applied
Vehicle GA TSGA Mathematical Modelling 36, 2110-2117.
Capacity Distance Time Distance Time [2] Yucenur, G.N. and Demirel, N.C.. 2011. “A
151 3951.525 123 3664.148 10 7,27 New Geometric Shape-Based Genetic
164 3622.753 153 3428.708 11 5,35 Clustering Algorithm for The Multi-Depot
178 3588.194 125 3119.468 9 13,0 Vehicle Routing Problem”. Expert System with
195 3454.294 166 2958.256 5 14,3 Applications 38, 11859-11865.
215 3287.016 293 2726.513 6 17,0 [3] Karakatic, S. and Podgorelec, V.. 2015. “A
240 3060.496 231 2604.126 5 14,9 Suvey of Genetic Algorithms for Solving Multi
273 2717.931 171 2463.602 6 9,35 Depot Vehicle Routing Problem”. Applied Soft
314 2829.297 256 2216.962 7 21,6 Computing 27, 519-532.
372 2742.865 164 2094.614 8 23,6 [4] Toth, P. and Vigo, D.. 2002. The Vehicle
454 2638.619 148 1939.120 13 26,5 Routing Problem. Philadelpia: University City
26,1 Science Center.
584 2458.270 232 1814.500 17
[5] Hozairi, Buda, K., Masroeri, and Irawan, M.I..
Table 8. Comparison of GA and TSGA for P125 2014. “Implementation of Non-dominated
GA TSGA Sorting Genetic Algorithm-II (NSGA-II) for
Vehicle
Capacity Distance Time Distance Time Multiobjective Optimization Problems on
15,0
Distribution of Indonesian Navy Warship”.
183 5269.657 364 4476.805 24
Journal of Theoretical and Applied Information
198 5100.448 435 4352.449 10 14,6
Technology 64, 274-281.
215 4996.808 298 4141.080 14 17,1
[6] Santoso, P., Buda, K., Masroeri, Irawan, M.I.,
235 4706.922 444 3806.193 7 19,1
and Dinariyana. 2014. “The Implementation of
260 4597.851 507 3594.609 7 21,8
Binary Genetic Algorithm (BGA) for
291 4505.065 372 3280.790 8 27,1
Optimizing the Task of Indonesian Navy Ship
330 4440.228 643 3165.287 12 28,7
Patrols Related to The Security of Indonesia
380 4275.217 499 3003.622 12 29,7 Seas”. Journal of Theoretical and Applied
449 4164.521 407 2817.172 17 32,3 Information Technology 67, 247-253.
549 3928.582 514 2603.215 20 33,7 [7] Chang, P. C., Chen, S.H., Fan, C.Y., and Chan,
706 3502.791 522 2525.264 47 27,9 C.L.. 2008. “Genetic Algorithm Integrated with
Artificial Chromosomes for Multi-Objective
Average computation time of TSGA for P50, Flowshop Scheduling Problems”. Applied
P75, P100, and P125 does not exceed 20 seconds Mathematics and Computation 205, 550-561.
while the GA is in the range from 30 seconds to [8] Liu, Y., Wu, X., and Shen, Y.. 2011.
400 seconds. So in terms of computational time, “Automatic Clustering Using Genetic
TSGA is better than AG. Algorithms”. Applied Mathematics and
Computation 218, 1267-1279.
6. CONCLUSIONS
[9] Aliabadi, D. E., Kaazemi, A., and
Pourghannad, B.. 2013. “A Two-Level GA to
Based on the results that has been presented, it
can be concluded that TSGA can be used to solve Solve an Integrated Multi-Item Supplier
CVRP in a different way from the AG. In terms of
467
Journal of Theoretical and Applied Information Technology
31st May 2016. Vol.87. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
468
Reproduced with permission of the copyright owner. Further reproduction prohibited without
permission.