• Tidak ada hasil yang ditemukan

Transportation route optimization using genetic algorithm

N/A
N/A
Protected

Academic year: 2024

Membagikan "Transportation route optimization using genetic algorithm"

Copied!
24
0
0

Teks penuh

(1)

TRANSPORT ROUTE OPTIMIZATION USING GENETIC ALGORITHM

EVIE KHO SlAW HEI

This project is submitted in partial fulfillment of

the requirements for the degree of Bachelor of Engineering with Honours (Electronics and Computer Engineering)

Faculty of Engineering

UNIVERSITI MALAYSIA SARAW AK 2004

Demo (Visit http://www.pdfsplitmerger.com)

(2)

To all my beloved family members.

Demo (Visit http://www.pdfsplitmerger.com)

(3)

Acknowledgement

I would like to express my sincere thanks to my Final Year Project supervisor, Encik Mohd. Saufee bin Muhammad, for his kind guidance and teaching throughout this project.

I would like to take this opportunity to thank all UNIMAS lecturers and staffs, who have help me in one way or another in completing this project.

Finally, not to forget my friends and family members, I would like to record my sincere appreciation for their moral support and encouragement to me all the way until the completion of this project.

Demo (Visit http://www.pdfsplitmerger.com)

(4)

Abstrak

Ilharn di sebalik Masalah Jurujual Bergerak melahirkan cabaran untuk menghasilkan algoritma Pengoptimuman Perjalanan Pengangkutan. Cabaran ini adalah untuk mengira perjalanan yang paling optimium, sarna ada dimaksimumkan atau diminumumkan perjalanan bagi seseorang jurujual untuk bergerak melalui beberapa destinasi, dengan cara yang paling berkesan dan paling menjimatkan kos dan masa. Ilharn Pengoptimuman Perjalanan Pengangkutan dapat dikembangkan untuk diaplikasikan kepada pengguna jalan raya, seperti pemandu teksi dan bas, pelancong dan sesiapa sahaja yang bergerak selalu. Projek ini adalah untuk menghasilkan satu perantararnuka yang dapat membantu dalarn menyelesaikan Masalah Jurujual Bergerak, dengan menghasilkan satu perjalanan yang paling optimum, untuk beberapa destinasi yang diberikan. Algoritma Genetik, salah satu cabang dalarn kebijaksanaan ciptaan, mengaplikasikan konsep pemilihan, persilangan dan mutasi dalarn bidang genetik, digunakan dalam aturcara ini untuk mengoptimumkan sesuatu perjalanan.

ii

Demo (Visit http://www.pdfsplitmerger.com)

(5)

Abstract

The idea behind solving Traveling Salesman Problem gives birth to the challenge to produce a Transport Route Optimization algorithm. The challenge is to calculate the optimized route, either maximized or minimized route for a salesman to travel across multiple destinations in the most efficient, most time and cost saving way. The idea of Transport Route Optimization can be further expanded and to be applied to road users, such as taxi or bus drivers, tourists or any other people who needs to travel frequently.

This project is to develop an interface to assist in solving Traveling Salesman Problem, to produce an optimized route given a number of destinations. Genetic Algorithm, a branch in artificial intelligence, applies the concept of selection, crossover and mutation in genetic discipline, is used as the back end engine in this program to optimize a given route.

iii

Demo (Visit http://www.pdfsplitmerger.com)

(6)

Table of Contents

Content Page

Acknowledgement

Abstrak 11

List of Figures Vlll

Abbreviations XlI

Abstract III

Table of Contents IV

List of Tables IX

CHAPTERl INTRODUCTION

1

1.1

Project Background

1

1.2

Project Objectives

2

1.3

Statement of ProblemsI Hypotheses

2

1.4

Methodology

2

1.5

Software Used 4

1.6

Expected Outcomes and Contribution to Field

5

1.7

Report Structure

5

IV

Demo (Visit http://www.pdfsplitmerger.com)

(7)

CHAPTER 2 LITERATURE REVIEW 7

2.1 Study on Previous Work 7

2.1.1 Hopfield Network 7

2.1.1.1 Features of Hopfield 8 Network

2.1.1.2 Constructions of Hopfield 9 Network

2.1.2 Kohonen Self-Organizing Maps 11 (SOM)

2.1.2.1 Algorithms ofKohonen 12 SOM

2.1.2.2 Implementation ofKohonen 14 SOMinTSP

2.1.3 Genetic Algorithm (GA) 15

2.1.3.1 Encoding Techniques 16

2.1.3.2 Operators of GA 18

2.1.3.3 Structure of GA 23

2.2 Comparison of Different Algorithms 25

2.2.1 Hopfield Network 25

2.2.2 KohonenSOM 26

2.2.3 Genetic Algorithm 26

2.3 Research Outcome 27

v

Demo (Visit http://www.pdfsplitmerger.com)

(8)

28

CHAPTER 3 PROJECT DESIGN

CHAPTER 4

3.1 Infonnation 28

3.2 Representation of Infonnation 30

3.3 Genetic Algorithm Program Design 32

3.3.1 Selection Operator 32

3.3.2 Crossover Operator 34

3.3.3 Mutation Operator 34

3.4 Interface Design 36

3.4.1 The Map Window 37

3.4.2 Destinations Choice Box 39

3.4.3 Starting Point Button 39

3.4.4 Destination Points Button 41

3.4.5 Show Route Button 42

3.4.6 The Reset Button 43

3.4.7 The View Log File Button 44

3.4.8 The Result Box 44

RESUL TS AND DISCUSSIONS 46

4.1 Efficiency and Accuracy of the Simulation 46 Program

4.2 Problems Encountered 64

4.3 Summary 65

VI

Demo (Visit http://www.pdfsplitmerger.com)

(9)

66

CHAPTERS CONCLUSIONS AND RECOMMENDATIONS

REFERENCES APPENDICES

A B

C D

5.1 Conclusion 5.2 Recommendation

GeneticAlgorithm.m Fitness.m

TRO.m

OtherCombination.m

66 68

69 71 72 78 79 90

Vll

Demo (Visit http://www.pdfsplitmerger.com)

(10)

List of Figures

Figure Page

1.1 Methodology of Transport Route Optimization 3

2.1 Architecture of Hopfield Network 11

2.2 Architecture of Kohonen SOM 12

2.3 Ideal neurons model for TSP 14

2.4 Structure of chromosome 16

2.5 Roulette Wheel Selection 19

2.6 Structure of a basic GA 24

3.1 Kuching Map with 10 locations marked 29

3.2 Permutation encoding of possible route 31

3.3 Population of chromosomes with correspondence route length 31

3.4 Algorithm of selection operator 33

3.5 Interface ofTRO 36

3.6 The Map window 37

3.7 TRO interface appearance after show route function is selected 38

3.8 Destination Choice boxes 39

3.9 Starting Point button 39

3.10 Error message regarding on starting point 40

3.11 Error on selected multiple starting points 40

3.12 Destination Points button 41

3.13 Error regarding on destination points 41

3.14 Error prompted for repeat selection on destination point 42

3.15 Show Route button 42

3.16 Error on show route: no starting point 43

3.17 Error on show route: no destination point 43

3.18 Reset button 43

3.19 View Log File button 44

3.20 Result box 44

4.1 Relation between performance and number of generations 63 (with fixed sample)

4.2 Relation between performance and mutation probability 63 (with fixed sample)

V111

Demo (Visit http://www.pdfsplitmerger.com)

(11)

List of Tables

Table Page

2.1

Example of Binary Encoding

17

2.2

Example of Pennutation Encoding

17

2.3

Example of Single-Point Crossover

20

2.4

Example of Two-Point Crossover

20

2.S

Example ofUnifonn Crossover

21

2.6

Example of Arithmetic Crossover

21

2.7

Example of ordinary single-point crossover applied on

22

pennutation encoding

2.8

Example of Crossover for Pennutation Encoding

22

2.9

Mutation applied to binary encoded chromosome

23

2.10

Mutation applied to pennutation-encoded chromosome

23

3.1

Distance between

10

locations that are going to be studied

30 4.1

Ten trials ofthe shortest route length with parameter (i)

47

size of population

= 20;

(ii) no. of generations

= 100;

(iii) mutation probability

0.1

4.2

Ten trials of the shortest route length with parameter (i)

49

Size of population

= 20;

(ii) no. of generations

= 300;

(iii)

mutation probability

0.1

4.3

Ten trials of the shortest route length with parameter (i)

SO

Size of population

20;

(ii) no. of generations

= SOO;

(iii)

mutation probability =

0.1

4.4

Ten trials of the shortest route length with parameter (i)

SI

size of population

20;

(ii) no. of generations

SOO;

(iii)

mutation probability

0.3

4.S

Ten trials of the shortest route length with parameter (i)

S2

size of population

= SO;

(ii) no. of generations =

100;

(iii)

mutation probability

= 0.1

4.6

Ten trials of the shortest route length with parameter (i)

S3

size of population

= SO;

(ii) no. of generations

= SOO;

(iii)

mutation probability

= 0.1

4.7

Ten trials of the shortest route length with parameter (i)

S4

size of population

SO;

(ii) no. of generations

SOO;

(iii)

mutation probability

= 0.3

4.8

Ten trials of the shortest route length with parameter (i)

SS

size of popUlation

= SO;

(ii) no. of generations =

SOO;

(iii)

mutation probability

= O.S

ix

Demo (Visit http://www.pdfsplitmerger.com)

(12)

4.9 Ten trials ofthe shortest route length with parameter (i) 56 size of population

=

50; (ii) no. of generations

=

1000; (iii)

mutation probability 0.1

4.10 Ten trials of the shortest route length with parameter (i) 57 size of population

=

100; (ii) no. of generations

=

500; (iii)

mutation probability

=

0.1

4.11 Ten trials of the shortest route length with parameter (i) 58 size of population

=

100; (ii) no. of generations

=

1000; (iii)

mutation probability

=

0.1

4.12 Ten trials ofthe shortest route length with parameter (i) 59 size of population = 100; (ii) no. of generations

=

1000; (iii)

mutation probability = 0.5

4.13 Ten trials of the shortest route length with parameter (i) 60 size of population

=

100; (ii) no. of generations

=

1000; (iii)

mutation probability 0.7

4.14 Ten trials ofthe shortest route length with parameter (i) 61 size of population

=

200; (ii) no. of generation

=

2000; (iii)

mutation probability

=

0.5

x

Demo (Visit http://www.pdfsplitmerger.com)

(13)

List of Abbreviations

GA Genetic Algoritm

GUIDE Graphical user interface development environment PCB Printed Circuit Board

RWS Roulette Wheel Selection SOM Self-Organizing Map

TRO Transport Route Optimization TSP Travelling Salesman Problem

Xl

Demo (Visit http://www.pdfsplitmerger.com)

(14)

1.1

CHAPTER!

INTRODUCTION

Project Background

Travelling Salesman Problem (TSP) is a typical example of neural network optimization. Optimization means an approach to obtain either a maximized or minimized result. In the TSP, the salesman is required to visit each of a given set of cities once and only once, returning to the starting city at the end of his trip (or tour)[ll.

Considering the time and cost factor, the salesman is required to choose the shortest route. Hence, the optimization method is used to obtain a minimized result.

Nowadays, traffic becomes very complex even within a city. The idea of Transport Route Optimization (TRO) is essential to solve traffic complexity problem.

The solution is not only helpful to a visitor or tourist in a city, but also to taxi drivers.

Clearly, the concept ofTSP is applied into the solution.

1

Demo (Visit http://www.pdfsplitmerger.com)

(15)

1.2 Project Objectives

The objectives of the project are to

• Analyze and compare between Genetic Algorithm and classical algorithms in solving Traveling Salesman's Problem.

• Design a simulation software using Genetic Algorithm to optimize a given transport route for a shuttle based on TSP.

• Develop the simulation program based on Genetic Algorithm using MATLAB Software Programming Tools.

1.3 Statement of Problems! Hypotheses

A tourist might need to travel to several cities in a journey, which are usually not in a linear route. Often, there are many alternative routes to reach the destination. However, distances between destinations have to be taken into consideration to decide the best route.

The TRO is needed, in this case to provide smart travelling, planning and choice.

1.4 Methodology

The methodology for the implementation of TRO is summarized in the Flowchart of Figure 1.1.

2

Demo (Visit http://www.pdfsplitmerger.com)

(16)

Start

Compare different algorithm: Genetic Algorithm, Kohonen SOM and so on.

Further studies on Genetic Algorithm.

Collect transport route information, like name, distance.

Simulate program with aid of the information.

Testing: by selecting certain destinations.

Display result.

No

Yes

End

Figure 1.1 Methodology of Transport Route Optimization

3

Demo (Visit http://www.pdfsplitmerger.com)

(17)

psi Ii"?

First, various previous solutions in solving TSP are analyzed to compare the advantages and disadvantages between one another, hence the strengths and weaknesses on Genetic Algorithm are clear in view. A few algorithms that have been used in this kind of problem include Genetic Algorithm [21 and Kohonen Self Organizing Map (SOM) [31, Genetic Algorithm is chosen in this project to solve TSP. Consequently;

further study will be done on the Genetic Algorithm. Possible improvement is to be incorporated into the algorithm to enhance its performance.

To produce the simulation program, a set of information on transport route is collected as information. At the end of training, the program should be able to recognize the shortest route when certain destinations is given or selected.

1.5 Software Used

The software used for this project is MATLAB 6.5. MATLAB can be considered as a full-featured calculator. It consists of functions for basic as well as the functions for scientific calculator. Meanwhile, it acts like a programmable calculator that enables users to store and retrieve data. At the same time, user can create, execute and save sequences of commands to automate the computation of important equations.

On the other hand, MATLAB overcomes a calculator from the sense of it provides a rich environment for data visualization through its powerful graphics capabilities.

MATLAB also contains sets of intelligent problem-solving tools for specific application areas, called Toolboxes [41. Toolboxes contain collections of frequently used functions. Another important favourable feature in MATLAB is the graphical user

4

Demo (Visit http://www.pdfsplitmerger.com)

(18)

,..

interface development environment (GUIDE). GUIDE helps a lot in implementation of this project by providing visualization.

Overall, MATLAB is a powerful tool for performing mathematical calculations.

1.6 Expected Outcomes and Contribution to Field

The goal of this project is to develop a software simulation for TRO problem. This solution applies neural networks algorithm that will find an optimized solution. At the end of this project, the program should produce a result that satisfies the shortest route criteria for certain destinations.

The benefit of this program is to reduce the time and cost such as petrol and labor that are required for a shuttle to reach each destinations in its path. In addition, a well-planned route can provide a convenient and comfortable driving.

1.7 Report Structure

In chapter I, a brief introduction on this theses is given, which includes the project background on the idea of Traveling Salesman Problem and Transport Route Optimization, the objectives of this project and the statement of problem, the methodology used in solving the Transport Route Optimization problem, namely the Genetic Algorithm, the software used to create the Transport Route Optimization program, and also the expected outcome for this project.

5

Demo (Visit http://www.pdfsplitmerger.com)

(19)

PSt Ii

In chapter 2, a literature review has been done on Hopfield Network, Kohonen Self-Organizing Map and Genetic Algorithm, to find out how these algorithms solve the Traveling Salesman Problem in much detail. Then, these algorithms are being compared for their advantages and disadvantages on their approach in solving Traveling Salesman Problem.

Chapter 3 gives a step-by-step walk through on the design of the Transport Route Optimization program. Here, the front-end of the program, which is the interface of the program as well as the back-end of the program, the Genetic Algorithm and how Genetic Algorithm can produce an optimized route given a number of destinations, are discussed in details.

Chapter 4 discusses the results obtained from the program. In this chapter, we can see that how the number of generations, size of the population and the mutation probability can affect the efficiency and the accuracy of the simulation program. In addition, problems encountered in this project also being discussed.

Chapter 5 shall conclude this project and some recommendations are being made here as welL

6

Demo (Visit http://www.pdfsplitmerger.com)

(20)

CHAPTER 2

LITERATURE REVIEW

2.1 Study on Previous Work

The first algorithm applied to the TSP was Hopfield network. Nowadays, the commonly used networks are Kohonen Self-Organizing Maps (SOM) and Genetic Algorithm (GA),

2.1.1 Hopfield Network

In 1982 John Hopfield of the California Institute of Technology designed a neural network that revived the technology, bringing it out of neural dark ages of the 1970s [51, The model is based on the ideas of Pitts and McCulloch. It enables images to be stored or remembered by the network during a learning process, the network then having the ability to retrieve the complete image when presented with an incomplete or corrupted image [61,

7

Demo (Visit http://www.pdfsplitmerger.com)

(21)

2.1.1.1 Features of Hopfield Network

The standard binary Hopfield network is a recurrently connected network with the following features:

• Symmetrical Connections

The net has symmetrical weight with no self-connection (11. In other word, the weight W from a unit i to itself is zero.

~i =0 (2.1)

If there is a connection going from unit j to unit i, having a connection weight that equals to Wij, then there is also a connection going from unit i to unit j with an equal weight.

(2.2)

• Linear Threshold Activation

If the total weighted summed input (dot product of input and weights) to a unit is greater than or equal to zero, its state is set to 1, otherwise it is -1. Normally, the threshold is zero.

• Asynchronous State Update

Units are visited in random order and updated according to the above linear threshold rule. Hopfield emphasized random, asynchronous update to model a primitive

8

Demo (Visit http://www.pdfsplitmerger.com)

(22)

P

2 ;Pi

level of behavior. Those come closer to the kind of organization, which might be expected from the neurons in an evolving biological nervous system, are not equipped with the lUXUry of orderly synchronized signals. As a practical bonus the use of asynchronous updates in an artificial neural network demonstrates the convergence of the network quickly and easily [71.

• Energy Function

It uses state dynamics to minimize an energy function. Equation for energy function will be discussed in the following section.

• Hebbian Learning

It applies Hebbian learning algorithm. This learning algorithm is based on the facts that when neurons on both sides of a synapse are activated synchronously and repeatedly, the synapse's strength is selectively increased [8l.

(2.3) where Wj Weight

Xi Input Yi = Output

2.1.1.2 Constructions of Hopfield Network

The important features of the Hopfield network are:

• Energy minimization during state updates guarantees that it will converge to a stable attractor.

9

Demo (Visit http://www.pdfsplitmerger.com)

(23)

p

• The learning (weight updates) minimizes energy; therefore, the training patterns will become stable attractors (provided the capacity has not been exceeded).

The Hopfield energy function is called Lyapunov function E:

E (2.4)

where Sj represents the nonlinear output of neuron i,

duo

L

- ' =

W ..+1., dt .. IJ j I

with j¢1

(2.5) where Uj denotes the net function of neuron i,

Wij is the weight, and Ii denotes an external input.

The activation functionfis usually either a hard limiter or a sigmoid.

Figure 2.1 illustrates the structure of Hop field network, which consists of features mentioned in the previous section.

10

Demo (Visit http://www.pdfsplitmerger.com)

(24)

p

j$

Wn ;

Figure 2.1 Architecture of Hopfield Network

2.1.2 Kohonen Self-Organizing Maps (SOM)

In 1981 Tuevo Kohonen of the University of Helsinki demonstrated a new system of neural network. The systems could be built in the way that would organize input data without being supervised or taught in any way [51. This is the Self-Organizing Maps (SOM). SOM belongs to a particular class of neural networks denominated Competitive Neural Networks, where each neuron competes with the others to be activated.

The result of this competition is the activation of only one output neuron at a given moment. On a self-organizing map, the neurons are disposed as nodes of a grid,

11

Demo (Visit http://www.pdfsplitmerger.com)

Gambar

Figure 1.1  Methodology of Transport Route Optimization
Figure 2.1  illustrates the structure of Hop field network, which consists of  features mentioned in the previous section
Figure 2.1  Architecture of Hopfield Network

Referensi

Dokumen terkait

Generally, in developing the prediction model based on BPNN, the percentages of the data used for training, testing and validation are 70%, 15% and 15%

2.2 EE optimization based on Genetic Algorithm Articial intelligence In order to get the optimum number of massive MIMO antennas corresponding to the active users served by 5G cell,

Optimization of Multiple Depot Vehicle Routing Problem MDVRP on Perishable Product Distribution by Using Genetic Algorithm and Fuzzy Logic Controller FLC Elin Haerani1, Luh Kesuma