Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Bachelor of Science (Hons.

) Mathematics
Center of Mathematics Studies Faculty of Computer and Mathematical
Sciences

TECHNICAL REPORT
GENETIC ALGORITHM FOR VEHICLE ROUTING PROBLEM
MOHAMMAD IZWAN BIN JAMALUDDIN 2014829388
MUHAMAD SYAHMIE ADEEB BIN MOHD SHUKRI 2014407422

K15/34
UNIVERSITI TEKNOLOGI MARA

TECHNICAL REPORT

GENETIC ALGORITHM FOR VEHICLE ROUTING


PROBLEM

MOHAMMAD IZWAN BIN JAMALUDDIN


2014829388 K15/34
MUHAMAD SYAHMIE ADEEB BIN MOHD SHUKRI
2014407422 K15/34

Report submitted in partial fulfillment of the requirement


for the degree of
Bachelor of Science (Hons.) Mathematics
Center of Mathematics Studies
Faculty of Computer and Mathematical Sciences
JULY 2016
ACKNOWLEDGEMENTS

IN THE NAME OF ALLAH, THE MOST GENEROUS, THE MOST GRACIOUS

Alhamdulillah, first of all, I am grateful to Allah S.W.T thus far in my final years and car-

ried me through this very challenging Honours year.Utmost thanks and glory to God Almighty

in the highest for give me the strength to complete this project successfully. I would like to ex-

press my deep appreciate to Madam W.Nurfahizul W.Ifwah, my research supervisors, for giving

enthusiastic encouragement and useful critiques of this research work. Thanks to our parents

for their big hands in supporting us, the advise and also prays for us days and night. For our

siblings, thanks for their encouragements and support.Last but certainly not the least, we would

like to thanks also gratitude to all of friends and for the rest for the rest people who I do not

state here, whom contribute to this study either direct or indirectly. Thanks for such brilliance

ideas and their time

ii
TABLE OF CONTENTS

ACKNOWLEDGEMENTS ii

TABLE OF CONTENTS iii

LIST OF FIGURES iv

LIST OF TABLES vi

ABSTRACT vii

1 INTRODUCTION 1

1.1 Problem Statement 2

1.2 Objective Of The Study 2

1.3 Scope Of The Study 3

1.4 Literature Review 4

1.5 Formula Vehicle Routing Problem 11

1.6 Methods Solution of Vehicle Routing Problem 12

2 METHODOLOGY 13

3 IMPLEMENTATION 18

3.1 Data Analyst 18

3.2 Data Implementation 21

4 RESULTS AND DISCUSSION 22

4.1 Operator Process 22

5 CONCLUSIONS AND RECOMMENDATIONS 44

REFERENCES 45

iii
LIST OF FIGURES

Figure 1.1 Customer Nodes and Company. 7

Figure 1.2 Formula of Vehicle Routing Problem. 11

Figure 2.1 Step of Genetic Algorithm. 13

Figure 2.2 The distance of 25 city. 15

Figure 2.3 Crossover Operator. 16

Figure 2.4 Selection Operator. 16

Figure 2.5 Mutation Operator. 17

Figure 2.6 Inversion Operator. 17

Figure 3.1 The distances between 25 cities in the VRP. 19

Figure 4.1 Iteration 1 : Two Operators. 22

Figure 4.2 Iteration 2 : Two Operators. 23

Figure 4.3 Iteration 3 : Two Operators. 24

Figure 4.4 Iteration 4 : Two Operators. 25

Figure 4.5 Iteration 5 : Two Operators. 26

Figure 4.6 Iteration 6 : Two Operators. 27

Figure 4.7 Iteration 7 : Two Operators. 28

Figure 4.8 Iteration 8 : Two Operators. 29

Figure 4.9 Iteration 9 : Two Operators. 30

Figure 4.10 Iteration 10 : Two Operators. 31

Figure 4.11 Iteration 1: Three Operators. 32

Figure 4.12 Iteration 2 : Three Operators. 33

iv
Figure 4.13 Iteration 3 : Three Operators. 34

Figure 4.14 Iteration 4 : Three Operators. 35

Figure 4.15 Iteration 5 : Three Operators. 36

Figure 4.16 Iteration 6 : Three Operators. 37

Figure 4.17 Iteration 7 : Three Operators. 38

Figure 4.18 Iteration 8 : Three Operators. 39

Figure 4.19 Iteration 9 : Three Operators. 40

Figure 4.20 Iteration 10 : Three Operators. 41

Figure 4.21 Graph of Two Operators. 42

Figure 4.22 Graph of Three Operators. 43

Figure 1 Coding In C++. 46

v
LIST OF TABLES

Table 2.1 Representative of 25 Cities 14

Table 3.1 Representative of 25 Cities 18

Table 3.2 The Series of 25 Cities 20

Table 4.1 The Result of Every Iteration in Two Operators 42

Table 4.2 The Result of Every Iteration in Three Operators 42

Table 4.3 The Result of The Both Operators 43

vi
ABSTRACT

Vehicle Routing Problem (VRP) is a combinatorial optimization that consists of finding

an optimal object from a finite set of objects. The objective of the VRP is to find a series of

routes at a minimal cost which means by finding the shortest direction, minimizing the number

of vehicles and others from the beginning and ending the route at the depot, so that the known

demands of all nodes are fully occupied. We are use four step in methodology as determine

of genetic algorithm characteristic, data input, the process by using operator selection and pre-

diction. the results have been compares with two operator selection to determine the minimum

routes in cities. Based on the study that have been conducted the minimum routes is equal to

3990. The selected order route is 1-2-3-4-5-6-7- 8-9-10-11-12-13-14-15-18-19-16-17-20-21-

22-25-24-23. The results of the studies that have been conducted, it can be concluded that GA

method can be used in the routes of large city. But it is not the best method, in other words,

we can’t guarantee whether the table that solution. Therefore, the solution obtained is regarded

as approximations only. Normally this GA to obtain a solution that is almost the best solution

quickly and easily. Therefore, a more thorough study could be done to improve the methods

that have been discussed, in particular the GA method by setting conditions for the processes in

the GA.

vii
1 INTRODUCTION

Vehicle Routing Problem (VRP) is a combinatorial optimization that consists of discover an

optimal object from a finite set of objects. The objective of the VRP is to observe a series of

routes at a least cost which means by discovering the shortest distance, reducing the number of

vehicles and others from the beginning and ending the route at the depot, so that the identified

demands of all nodes are fully occupied.

Therefore, the management should take an initiative to make the process proficient. The cor-

poration or organization should take seriously all the factor including minimize the cost and

maximize the profit. Vehicle routing problem should determine the optimum path for deliver-

ing to a (n) set total customer which known as nod. Therefore, in this research VRP will be

solved by using Genetic Algorithm (GA) method.

Genetic Algorithm is a search heuristics that similarly to the process of natural selection.

Heuristics is usually to produce usually solutions for optimization and search problems. Heuris-

tic may not be the best way to solve all the actual solution for this problem, but it still worthy be-

cause it does not require a prohibitively long time to find the solution. Genetic algorithms gen-

erate solutions to optimize problems using some methods such as mutation, selection, crossover

and inversion.

1
1.1 Problem Statement

Nowadays, every company has its own transportation. But, the manager of the company have

to figure out this kind of problems:

1. To determine the route they should take for delivering process but it have to be at minimize

cost and minimum distance traveled.

2. To investigate the problem when they shortage number of vehicles for delivering process

and how to deal with it.

3. To investigate the problem when they have excess loading capacity but it have to deliver

it to the drop point on that day.

4. To find out what kind of time interval need to be considered for the vehicle reach to the

drop point on time.

5. To investigate unusual things when the customer were receiving the same item from dif-

ferent vehicles and the item become surplus for the company.

1.2 Objective Of The Study

The main objective of this study is to find a set of routes that minimizes the distance travelled.

We have the following objective as our working strategies and the objectives of research are:-

1. To study about vehicle routing problem (VRP).

2. To acknowledge of applying and solving problem by using Genetic Algorithm method.

2
1.3 Scope Of The Study

This research will focus for solving vehicle routing problem (VRP). We can Genetic Algorithm

method to solve Vehicle Routing Problem. This study will need to be carefully considered for

the algorithm to work as effective possible by values of parameter, population size, probability

of using operators, etc. A review of insertion heuristics in GA and crossover operators in this

project is to resolve the VRP. The genetic algorithm methods discussed in this study can provide

the best solution that minimizes the total travel distance to be travelled. This study will be a

significant the vehicle routing problem (VRP) concerns the service of a delivery company. How

things are delivered from one or more stores that have a particular group of caravan and manage

by a set of drivers who can move on a given road network to a set of customers. It asks for

a resolve of a set of routes S, one route for each vehicle that must start and finish at its own

store such that all customers’ requirements and operational constraints are satisfied and the

transportation rate is decreasing. This rate may be economic, distance or otherwise. Other

than that, using a genetic algorithm method by heuristic is routinely used to generate useful

solutions to l and search problems. Moreover, this study will be helpful to the retail industry and

transportation in service delivery and informing them in the area of routing problem, objective,

and strategies to resolve the problem. It will also serve as a future reference for researchers

on the subject mathematical modelling and delivery companies. And importantly, this research

will educate clients in deciding on whether an industry e.g. retail industry is really fulfilling its

responsibility to the place of delivery of goods from the minimised the cost and route.

3
1.4 Literature Review

1.4 (a) Introduction

Vehicle Routing Problem (VRP) is a common name for a set of problems, in which a group of

vehicles service a set of customers (Vaira, 2014). VRP also called Travelling Salesman Problem

(TSP), where only one vehicle was used and each vehicle have a limited capacity. A number of

different exact and heuristic methods have been studied to explain the VRP that is recognized

to be NP-hard (Vaira, 2014). NP-hard problems are challenging to crack and it means that to

date no optimal algorithm has create, which it is able to answer the problem in polynomial time

(Bjarnadottir, 2004). Discovering an optimal solution to a NP-hard problem is frequently very

time overwhelming or even unfeasible for this kind of the problem, its not reasonable to apply

exact methods to explain huge occasion of the problem (Bjarnadottir, 2004).

These algorithms will result an estimated solution with a miscalculation around 2 until 3 per-

cents, but they are the most efficient cracking this problem (Kovacs, 2008). The technique

solution for the VRP consists of the right approach, classical heuristic methods and Heuristic

methods (Metaheuristic). Heuristic method could explain the problem for the large scale which

is it has a lot of nod. The benefit of the standard heuristics is that they have a polynomial running

time, therefore by using it will enhanced to give fine solutions within a logical amount of time

(Bjarnadottir, 2004). Metaheuristic is another method to solve a complex problem that might

be too difficult or time-consuming by traditional techniques (Vaira, 2014). The Metaheuris-

tic method that usually used are Simulated Annealing (SA), Tabu Search (TA), Ant Colony

Optimization (ACO), Large Neighbourhood Search (LNS), Neural Network (NN) and Genetic

Algorithms (GA)(Kovacs, 2008). At last, GA sustain a population of excellent solutions that

are recombined to produce new solutions (Bjarnadottir, 2004). GA have been explored signifi-

cantly, but mainly in order to explain TSP and VRP with time windows (Bjarnadottir, 2004).

4
For explaining the TSP, Genetic Algorithm and Simulated Annealing is an excellent choice.

This Thesis Work will not focus on solving the TSP, but it will concentrate solving the VRP,

which is a more complicated – multi constrained -– variation of the TSP and he explain process

in VRP can be straightforwardly used also for explaining the TSP (Kovacs, 2008). Genetic al-

gorithms have been motivated by the natural selection procedure present by Darwin. They put

into operation to a population as solutions of the problem nearby, in such a way that the recent

population is improved compared with the earlier population according to a pre – specified cri-

terion meaning (Masum & Faruque, 2011).

The operators applied by genetic algorithms imitate the way natural selection is completed and

the most famous operators used are the crossover, and mutation operators used in that order

to the current population (Masum & Faruque, 2011). Thus genetic algorithms give a search

method used in computing to find exact or estimation solutions to optimization and search

problems (Masum & Faruque, 2011). A new generation is developed by repeating the selec-

tion, crossover and mutation processes until every chromosomes in the recent population swap

those from the old one (Braysy, 2001). An adaptive memory is a group of solutions, which is

dynamically reorganized during the search process by joining some of the solutions in the group

in order to create some new good solutions (Bjarnadottir, 2004). Therefore, it can be considered

an overview of the genetic search.

Genetic Algorithm is used to explain optimization problem. Genetic Algorithm based

on the selection, crossover and mutation operators (Rani & Kumar, 2014). They were used

Roulette Wheel Selection (RWS) with distinct crossover and mutation probability, and it well

known used for optimization problem in Travelling Salesman Problem (TSP). Based on their

research they were compared their results of RWS with a new selection method Stochastic Uni-

versal Selection (SUS) and it reveal that SUS is surpass for small amount of town meanwhile

RWS is much better that SUS when the number of city increasing (Rani & Kumar, 2014). In
5
addition, they evaluate the outcome with a difference between mutation and crossover probabil-

ity, which concludes that mutation, is more efficient for decimal chromosomes (Rani & Kumar,

2014).

From the Srivastava & hoon Kim (2009) were applied Genetic Algorithm in software test-

ing. It was after the verification and validation from the software through dynamic testing in

area of software engineering might be slow. Software testing was used for gain consumers’

confidence in the software. The aim of software testing is to design a set of minimal number of

test cases such that reveals as many faults as possible. The application of genetic algorithm in

software testing is to recognize the most error prone paths in software construct (Srivastava &

hoon Kim, 2009).

Genetic algorithm starts with guesses and attempts to improve the guesses by evolution

(Srivastava & hoon Kim, 2009). Usually genetic algorithm have five parts which were a rep-

resentation of a guess called a chromosome, make an initial pool of chromosomes, define a

fitness function, choose a selection function and a crossover operator and also a mutation oper-

ator (Srivastava & hoon Kim, 2009). A chromosome could be a binary string or more complex

data structure. Next, the initial pool of chromosomes could be able to produce randomly or man-

ually created. After that, the fitness function is to measure the appropriate of a chromosome to

congregate a particular purpose such as a chromosome is filter if it match up to greater coverage

(Srivastava & hoon Kim, 2009). Finally, the selection function determines which chromosomes

will contribute in the evolution phase of the genetic algorithm invented by the crossover and

mutation operators. The crossover operator substitute genes from two chromosomes and create

two new chromosomes meanwhile the mutation operator modify a gene in a chromosome and

generate new one chromosome (Srivastava & hoon Kim, 2009).

6
1.4 (b) Vehicle Routing Problem

Vehicle routing problem is a problem in the journey and it is categorized as a combinatorial

optimization problem, which is very tough for optimization problem (Noor, 2004). A finite

number of feasible solutions developed as N! which is the combinatorial factor of N is the

represent the size of the problem (E.L. Lawlor, 1976). Vehicle Routing Problem is m-Salesman

Travelling Problem. Based on this research, it can conclude m is number of vehicle as one.

Therefore, the solution of Vehicle Routing Problem could be used by same method like solving

Salesman Travelling Problem.

1.4 (c) Classification Of Problem

As it mentioned before, Vehicle Routing Problem is difficult to determine the best way for

delivering substance to customer. Consider the situation on Figure 1.1 that consist a company

that surrounds by a customer nodes that required services.

Figure 1.1: Customer Nodes and Company.

From the Figure 1.1, we know that the manager of the company had to decide which

route is the most optimum for delivering merchandise to customer. The process of delivering

merchandise started from the company to a set of n customer with location and the customer

demand is certainty. Every company has its own vehicle and the vehicle has its own capacity.

Every customer has one trip only by using a vehicle. All routes were started and ending at

the company and the total demand for every customer have been set and it cannot in surplus.

To generate the routes, there are certain objectives need to consider such as minimize the total

distance, minimize the time travel, minimize the transportation cost and minimize the number

7
of the vehicles needed to supply every customers. There are several difficulty for the company

manager to comply with in order to generate the route for delivering merchandise to customers.

We can divide it into two categories which are ;

• Difficulty To Transportation

1. Every vehicle has rest time.

2. Vehicles are not allowed go back to company.

3. The vehicles have carrying limited amount of the merchandise that have to dis-

tribute.

4. Every vehicles has its own time to leave the company.

• Difficulty To Customer

1. Every customer has received a quantity of merchandise for delivering process.

2. Every delivery location has its own time windows. For example, the customer must

be ready to receive the delivery merchandise from 11.00 am to 12.00 pm which it

has been stated in the invoice.

3. Every customer has their own priority in delivering process. For instance, if the

vehicle or driver have unsatisfactory condition or even the bad weather conditions

that stuck the flow of delivering process, the delivery must be done in other ways

such as by using other vehicle or sent it on the next day.

4. Every customer has a set of vehicles that not able to use for delivery process.

8
Meanwhile, Vehicle Routing Problem can occur in our daily life such as to determine

routes for a truck to deliver goods to the customer, determine routes for cargo ship to deliver

container to every dock and determine the routes for taxi driver in order to send the passengers

to their destination. As a conclusion, Vehicle Routing Problem (VRP) can occur in variety

situations. VRP is a problem to determine a series of object to minimize the total cost, distance

or time travel.

1.4 (d) Variants Type Of Vehicle Routing Problem

According to Toro et al. (2015) ,There are different types of vehicle routing problem which are:

1. Capacitated Vehicle Routing Problem (CVRP)

Given n-1 node, a building, the distance between node to building and distance between

every nodes. Every node has the precisely demand. There are a few of truck that have

same cargo to deliver to the node. The problem is to find the route for the lorry in order to

minimize the distance travelled and fulfil node demand without excess capacity loaded.

2. Vehicle Routing Problem With Time Windows (VRPTW)

The purpose is to provide every customer in an identify time interval. Solomon (1987)

display answer, technique and function. In VRPTW, delivery process must on schedule,

which is in M day interval. The goals of VRPTW is to minimize the speed of vehicle and

minimize the time taken to deliver goods for every nodes of customer.

3. Vehicle Routing Problem With Backhauls (VRPB)

It includes both a group of customers to whom merchandise are to distribute, and a group

of merchant whose merchandise need to be transferred back to the delivery centre.

4. Truck and Trailer Routing Problem (TTRP)

9
This problem is an alternative of familiar vehicle routing problem (VRP). Unlike the VRP,

in the TTRP, customers are helped by a convoy of lorry and trailers. Due to some practical

limitation, a few customers can only be assistance by a single lorry. The other customer

can be assistance by a single lorry or a lorry towing a trailer.

5. Multi-Depot Vehicle Routing Problem (MDVRP)

In this alternative some warehouse are be concerned about to serve the customer. Cus-

tomers are commonly allocating to warehouse using clustering tactic. Some result meth-

ods have been applied in this problem. So in other words, a company has a building

for goods store use for delivering process to customer. The problem has been solved by

choosing which one of the company as a distribution centre. Every vehicle has same

starting point which is at the company then it provide the services to the customers and

back to the same company and it is the ending point for the vehicle. The purpose for this

problem is to reduce the number of vehicle and distance travelled.

6. Dial-A-Ride Problem

It is a mathematical problem in which a group of distribution have to complete a group

of accessible routes between permanent resource and destinations, within limited time

period and the chances of switching vehicle for the duration of a trip.

7. Location Routing Problem (LRP)

There are three problems that have to be solved simultaneously which are location of

warehouse, definition of routes and allocate routes to open warehouse.

10
1.5 Formula Vehicle Routing Problem

As we mentioned before, the vehicle routing problem is one of the and it is categorized as

a combinatorial optimization problem, which is quite difficult in optimization problems. The

notation used in this problem as follows:

Figure 1.2: Formula of Vehicle Routing Problem.

11
1.6 Methods Solution of Vehicle Routing Problem

The method solution for VRP consists of classical methods and heuristic methods (metaheuris-

tics). But, until now there is still no exact algorithm for finding optimal routes when there is

large number of city. VRP solution technique for this is described as follows:

Heuristic method

Heuristic method can find feasible solutions for the problems that may be large in size (many

number of nodes). Examples of classical heuristic methods and metaheuristic methods.

• Classical Heuristic Method

For classical heuristic methods, namely the search space is limited to points of the neigh-

borhood that gives better results only. The search will stop if there is no change in the

decision and the best decision will be taken as a solution.

• Metaheuristic Method

Surveys in finding space to get the best solution for this method is greater. Among the

Metaheuristic Method that is commonly used is:

1. Genetic Algorithm Method

2. Simulated Annealing Method

3. Neural Network Method

4. Tabu Search Methods

This method can avoid the local optimum solution less well accepts before the bests solu-

tion obtained.

12
2 METHODOLOGY

We use the primary data that we search through the internet by Google maps. The data were

collect by calculates the route of the every cities in Malaysia from Johor Bahru. From the city,

we choose the 25 cities in Malaysia to find the minimum routes. The software that we use to

calculate the data that we gained from the search is Microsoft Excel and also can use in Borland

C++ (Appendix A). The model that we use is the probability for vehicle to calculate the series

route of vehicles for every city.

Figure 2.1: Step of Genetic Algorithm.

Step 1: Determine the Genetic Algorithm characteristic

From the data that we gain from the Google maps. We will be using the primary data from

the internet about the city routes in Malaysia by Genetic Algorithm characteristic. The operator

process is ours main equation in this study.

13
Step 2: Data input In this part we will use the data from Google maps to determine the

routes of the one city to another city.

City Abbreviation Number Representation


Johor Bahru JB 1
Alor Setar AS 2
Sungai Petani SP 3
Kota Bharu KB 4
Tanah Merah TM 5
Bandaraya Melaka BM 6
Ayer Keroh AK 7
Seremban Se 8
Port Dickson PD 9
Kuantan Ku 10
Temerloh Te 11
Ipoh Ip 12
Kuala Kangsar KK 13
Kangar Ka 14
Kuala Perlis KP 15
Bukit Mertajam Bu 16
Georgetown Ge 17
Butterworth Bt 18
Permatang Pauh PP 19
Shah Alam SA 20
Klang Kg 21
Subang Jaya SJ 22
Kuala Terengganu KT 23
Dungun Dg 24
Kuala Lumpur KL 25

Table 2.1: Representative of 25 Cities

14
Figure 2.2: The distance of 25 city.

15
Step 3: The process by using the operator selection There are three main steps to resolve

the vehicle routing problem using Genetic Algorithm (GA) which are:

Process 1 : Crossover Process Crossover process is a vital procedure in GA. Initially, a

group consist of some journey made randomly. It is known as population and saved as sequence

of numbers. Then, the selection of population is added to two or more for the new generation.

This generation is normally gives a good result than preceding generations. Commonly, the

crossover is the procedure of choosing the best ways at random and switch the location of the

city in the arrangement. For example:

Figure 2.3: Crossover Operator.

Process 2 : Selection Process

The process of selection is a vital feature in the G.A. Once the crossover procedure is

complete, the selection of personal between the old generation and new generation is carry

out to find the best passenger that can give the finest result. In every iteration, the selection

process was handling twice, to be precise, afterwards crossover process and the process of

mutation later. It had process nearby the relevant disagreement there is city that is operate twice

or incomplete journey, then choose city at random by apply a city that is not included in a

sequence of it. For example:

Figure 2.4: Selection Operator.

16
Process 3: Mutation Process

This mutation process is complete by swapping the chromosome in a single pass. Chro-

mosome switch over is complete randomly. At times, the mutation can be proved to an answer

that is best related to the crossover. For example:

Figure 2.5: Mutation Operator.

Process 4: Inversion Process

The inversion process is final by reversing the chromosome in a single pass. Therefore,

the chromosome will invert randomly. Hence, the inversion process can be proved as the best

method compare to the mutation process. For example:

Figure 2.6: Inversion Operator.

Step 4: Prediction

We can determine the future value using the process of operator selection and draw the

graph from the result. Otherwise, we can determine the result when the last three iterations

repeated and stop at the tenth iteration. The best value of minimum routes is chooses as the last

result finding in the Genetic Algorithm process.

17
3 IMPLEMENTATION

3.1 Data Analyst

City Abbreviation Number Representation


Johor Bahru JB 1
Alor Setar AS 2
Sungai Petani SP 3
Kota Bharu KB 4
Tanah Merah TM 5
Bandaraya Melaka BM 6
Ayer Keroh AK 7
Seremban Se 8
Port Dickson PD 9
Kuantan Ku 10
Temerloh Te 11
Ipoh Ip 12
Kuala Kangsar KK 13
Kangar Ka 14
Kuala Perlis KP 15
Bukit Mertajam Bu 16
Georgetown Ge 17
Butterworth Bt 18
Permatang Pauh PP 19
Shah Alam SA 20
Klang Kg 21
Subang Jaya SJ 22
Kuala Terengganu KT 23
Dungun Dg 24
Kuala Lumpur KL 25

Table 3.1: Representative of 25 Cities

18
Figure 3.1: The distances between 25 cities in the VRP.

19
No Iteration
1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 24
3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 25 23
4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 25 24 23
5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 23 25
6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 25 23 24
7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 22 24 25
8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 22 25
9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 25 22 24
10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 22 25 24
11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 22
12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 23 25 24 22
13 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 22 23 25
14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 22 25 23
15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 23 22 25
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 23 25 22
17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 25 22 23
18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 24 25 23 22
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 25 24 23 22
20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 25 24 22 23
21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 21 23 24 25
22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 23 22 21 24 25
23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 24 22 23 21 25
24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 25 22 23 24 21
25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 25 23 24 21 22

Table 3.2: The Series of 25 Cities

Choose the routes randomly. Here, the route 1 and route 10 is selected. Route 1 is repre-

sents as X and route 10 is represent as Y. The quantity of the distance traveled between 25 cities.

20
3.2 Data Implementation

Probability for vehicle to deliver product

(n − 1)! (25 − 1)! 24! 6.20423


N= = = = = 3.102 × 1023
2 2 2 2

It is impossible to list out 3.102 × 1023 routes. This means we can considerate their others

25 routes .

From table above, we used the value of number of cities to calculate the route series of

cities from the formula above. All the result will be show in the chapter 4. We use Microsoft

Excel for all the calculation.

21
4 RESULTS AND DISCUSSION

4.1 Operator Process

4.1 (a) Two Operators Selection

Figure 4.1: Iteration 1 : Two Operators.

22
Figure 4.2: Iteration 2 : Two Operators.

23
Figure 4.3: Iteration 3 : Two Operators.

24
Figure 4.4: Iteration 4 : Two Operators.

25
Figure 4.5: Iteration 5 : Two Operators.

26
Figure 4.6: Iteration 6 : Two Operators.

27
Figure 4.7: Iteration 7 : Two Operators.

28
Figure 4.8: Iteration 8 : Two Operators.

29
Figure 4.9: Iteration 9 : Two Operators.

30
Figure 4.10: Iteration 10 : Two Operators.

After four iterations the last iteration of 7, 8, 9 and 10 found that the value of X and Y is

not changed. The minimum value of X is 4419 while the minimum value of Y is 4464. Here

we choose the value of X as a minimum, with a number of routes is 4419. The order route is

1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-18-17-19-16-20-21-22-23-24-25.

31
4.1 (b) Three Operators Selection

Figure 4.11: Iteration 1: Three Operators.

32
Figure 4.12: Iteration 2 : Three Operators.

33
Figure 4.13: Iteration 3 : Three Operators.

34
Figure 4.14: Iteration 4 : Three Operators.

35
Figure 4.15: Iteration 5 : Three Operators.

36
Figure 4.16: Iteration 6 : Three Operators.

37
Figure 4.17: Iteration 7 : Three Operators.

38
Figure 4.18: Iteration 8 : Three Operators.

39
Figure 4.19: Iteration 9 : Three Operators.

40
Figure 4.20: Iteration 10 : Three Operators.

41
After four iterations the last iteration of 7, 8, 9 and 10 found that the value of X and Y

is not changed. The minimum value of X is 3990 while the minimum value of Y is 4726.

Here we choose the value of X as a minimum, with total distance is 3990. The order route is

1-2-3-4-5-6-7- 8-9-10-11-12-13-14-15-18-19-16-17-20-21-22-25-24-23.

Two Operators

GA I1 I2 I3 I4 I5 I6 I7 I8 I9 I10
X 4440 4440 4440 4419 4419 4419 4419 4419 4419 4419
Y 4726 4726 4464 4464 4464 4464 4464 4464 4464 4464

Table 4.1: The Result of Every Iteration in Two Operators

Figure 4.21: Graph of Two Operators.

Three Operators

GA1 I1 I2 I3 I4 I5 I6 I7 I8 I9 I10
X 3994 3994 3994 3992 3992 3992 3990 3990 3990 3990
Y 4726 4726 4726 4726 4726 4726 4726 4726 4726 4726

Table 4.2: The Result of Every Iteration in Three Operators

42
Figure 4.22: Graph of Three Operators.

Name GA GA1
Operator Selection 2 3
The Minimum Route 4419 3990

Table 4.3: The Result of The Both Operators

From the table, we can see that the minimum route of the 25 cities is 3990 by GA1 as the

use of three operators. The order route is 1-2-3-4-5-6-7- 8-9-10-11-12-13-14-15-18-19-16-17-

20-21-22-25-24-23. So, we can conclude that addition of the operator selection of the inversion

process in the GA is accurate and precise to find the minimum route.

43
5 CONCLUSIONS AND RECOMMENDATIONS

The results have been compares with two operator selection to determine the minimum routes

in cities. Based on the study that have been conducted, the minimum routes is equal to 3990.

The selected order route is 1-2-3-4-5-6-7- 8-9-10-11-12-13-14-15-18-19-16-17-20-21-22-25-

24-23. From the results of the studies, it can be concluded that GA method can be used in

the shortest routes of the large number of cities. But it is not the best method, in other words,

we can’t guarantee whether it is the best solution or not. Therefore, the solution obtained is

regarded as approximations only. Normally this GA to obtain a solution that is almost the best

solution quickly and easily. GA is right that sometimes the best solution is obtained. Although

this heuristic methods do not provide an optimal result for sure, but it can be solve the difficult

problem. By using Vehicle Routing Problem that include a lot of customers, a programming

computer which is Borland C++ can overcome this problem for finding the shortest routes. By

using this software, it can reduce the time taken, minimize the cost and make the distance travel

shorten from one city to another city.

Research conducted in this thesis involves the Vehicle Routing Problem (VRP) in gener-

ally. Since, there are several types of VRP which are VRP as charged, VRP with time constrains,

VRP with a certain time and VRP with the number of the lot, is expected to further and deeper

study can be conducted to identify the problems further study of the method of solution. In ad-

dition, a more thorough study could be done to improve the methods that have been discussed,

in particular the GA method by setting conditions for the processes in the GA.

44
REFERENCES

Bjarnadottir, A. S. (2004). Solving the vehicle routing problem with genetic algorithms. Small(April), 127.

Braysy, O. (2001). Genetic algorithms for the vehicle routing problem with time windows. Arpakan-

nus(Bioinformatics and Genetic algorithms), 33–38.

Kovacs, A. (2008). Solving the vehicle routing problem with genetic algorithm and simulated annealing (Unpub-

lished doctoral dissertation). ECTS, Högskolan Dalarna, Sweden.

Masum, A., & Faruque, M. (2011). Solving the vehicle routing problem using genetic algorithm. Inter-

national Journal, 2(7), 126–131. Retrieved from http://thesai.org/Downloads/Volume2No7/Paper19

-SolvingtheVehicleRoutingProblemusingGeneticAlgorithm.pdf

Noor, N. M. (2004). A study on genetic algorithm (Unpublished doctoral dissertation). UiTM.

Rani, K., & Kumar, V. (2014). Solving travelling salesman problem using genetic algorithm based on heuristic

crossover and mutation operator. Impact Journals(1), 27-34.

Srivastava, P. R., & hoon Kim, T. (2009). Application of genetic algorithm in software testing. International

Journal of Software Engineering and Its Applications(3), 88-96.

Toro, E., Escobar, A., & Granada, M. (2015). Literature review on the vehicle routing problem in the green

transportation context. Luna Azul(42), 362-387.

Vaira, G. (2014). Genetic algorithm for vehicle routing problem.

45
APPENDIX A

Figure 1: Coding In C++.

46
47
48
49
50
51
52

You might also like