Você está na página 1de 9

IMPLEMENTATION OF GENETIC ALGORITHM

CONTROL TECHNIQUES WITH FUZZY LOGIC


TRAVELLING SALESMAN TO OVERCOME
PROBLEM USING MATLAB
(Case Study PT . Pos Indonesia Tugu Semarang DC )
ABSTRACT
Fitriana , Nurul Erma . 2014. Genetic Algorithm Implementation Technique
Fuzzy Logic Control To Solve Traveling Salesman Problem
using Matlab (Case Study PT . Pos Indonesia Tugu Semarang DC ) .
Thesis, Department of Mathematics Faculty of Mathematics and Natural Sciences
Semarang State University. Supervisor: Endang Sugiharti , S.Si , M.Kom .
Keywords : Genetic Algorithm , Fuzzy Sugeno , MATLAB , Travelling Salesman
Problem.
Travelling Salesman Problem ( TSP ) is the problem of searching for optimal route
for an itinerant salesman visiting the city with every city
visit one except the city of origin . This thesis will examine one case
TSP on issues pngirimin mail and goods in PT . Pos Indonesia DC Monument
Semarang with 22 destination address of the recipient in the District Ngaliyan
Semarang city. In this study, used a genetic algorithm techniques
fuzzy logic control in MATLAB 7.8.0 ( R2009a ) .
Data collection was performed by means of documenting data
PT . Pos Indonesia DC Tugu Semarang . Data taken the form of addresses
recipients and goods in the District Ngaliyan Semarang , hereinafter
conducted searches coordinates of each location with the help of the site
wikimapia.org and conduct surveys directly on some samples
address so that the distance between the location can be determined . Data analysis was
performed
using the mechanism of genetic algorithm with fuzzy logic control techniques
applied in MATLAB program . Determination probilitas crossover
( Probability of mutation ( the number of chromosomes in one generation , and
younger generations have a significant influence on the solution
the optimum that can be obtained .
From the analysis of the genetic algorithm with fuzzy logic control techniques
showed that the optimal solution using a population of 100 and enter
generation of 1000 was better than the optimal solution obtained with insert
population and generation respectively ( 100 and 100 ) , ( 100 and 200 ) , ( 100
and 500 ) , ( 200 and 100 ) , ( 500 and 100 ) and ( 1000 and 100 ) . Then
these are best obtained 1 -3-4-6-9-8-7-19-18-16-17-20-21-22-15-12-1110-14-13-5-2-1 and best path length is 22.63 km and
insert a population of 100 and 1000 generation .
From the analysis , it is expected PT Pos Indonesia DC Tugu Semarang
applying the method of calculating the optimal route with the genetic algorithm
fuzzy logic control techniques in order to find the path MATLAB
The shortest distribution of mail and services so as to reduce costs
transportation , and apply it in the form of a GUI in order to simplify the user

in the program.
TABLE OF CONTENTS
Page
INTRODUCTION ................................................................... ......... ..... V
ABSTRACT .............................................................................. ... vii
Viii TABLE OF CONTENTS ........................................................................... ...
.................................................................. ... Xiii LIST OF FIGURES
TABLES ..................................................................... ... xv
OF APPENDIX ............................................................... ... xvi
CHAPTER 1 INTRODUCTION ..................... ... ....................................... 1
1.1 Background. 1
1.2 Problem Formulation .......................................................... 2
1.3 Limitation Problem ......................................................... 3
1.4 Objectives and Benefits Research ...... ... ..................................... 3
1.5 Benefits Research ........ .............................................. .... ... .. 4
1.6 Systematics Writing ...................................................... ... 4
Section 1.6.1 Early ......................................................... ... 4
1.6.2 Section Contents ............................................................ ... 4
1.6.3 Final Part ......................................................... .. 6
CHAPTER 2 THEORETICAL ....................................................... .... 7
2.1 Graph Theory .................. .. ............................................. ....... 7
2.1.1 Definition of Graf .................. .. ....................................... ... 7
2.1.2 Types of Graf ...................... ....... ....... ....... ....... ...... .... 8
2.1.3 Road (Walk) .................. .. .......... ....... ....... .......... ...... .... 9
2.1.4 The trail (Trail) ...................... ....... ....... ....... ....... ....... ... .... 10
Tracks 2.1.5 (Path) .................. .. ......... ... ... ... ... ... ... ... ... ... ... ... 10
2.1.6 Circuit ............................................................... .. .... 11
Graf Graf 2.1.7 Semi-Euler and Euler ..................................... 12
2.1.8 Tracks and Circuits Hamilton ........................................ 13
2.1.9 Connected Graf (Connected Graph) .............................. .... 13
2.1.10 Graf Weighted .......................................................... 14
2.1.11 Tracks Shortest ................................................ .... 15
2.2 Overview of MATLAB ................................................ .. 16
History 2.2.1 Travelling Salesman Problem ..................... .. ...... ... 18
2.2.2 Example Developments Emerging Issues ......... ..... ......... 18
2.3 Genetic Algorithm ......................................................... .. 19
2.4 Fuzzy .................. .............................. .. ........................ .. 32
Fuzzy Logic 2.4.1 ......................................................... ... 32
2.4.2 Fuzzy Association ................................................ .. ...... 33
Fuzzy Membership Function 2.4.3 ...... .. .................................... 36
2.4.4 Fuzzy Inference System ............................................. .... 40
2.4.4.1 Methods Sugeno .............................. .. ............... .. 40
2.4.5 Fuzzy Logic Control ............................................. ..... 42
2.4.6 IF-THEN Rule ......................................................... .. 43
2.5 Relationship between Genetic Algorithm with Logic Control

Fuzzy .................................... ... .................................... ....... 44


2.6 Overview of MATLAB .......................................... ... ...... 45
2.6.1 Some part of the Window MATLAB ...................... ... .. 46
2.6.2 Request Help ................................................... ..... 47
2.6.3 interupting and Terminating in MATLAB ............... .... 47
2.6.4 Variables in MATLAB .................................... ....... ... .. 47
2.7 Preparation of a GUI-Based Applications ........................................ 48
2.7.1 Introduction ......................................................... .. 48
2.7.2 GUI ..................................................................... .. 48
2.7.3 M-File Editor ............................................................ 49
CHAPTER 3 METHODS ................................... ............................ 50
3.1 Finding the problem ...................................................... ... 50
3.2 Formulating Problems .................................... .. ................... 50
3.3 Data Collection ................................................... ... ....... 50
3.4 Analysis and Troubleshooting ............... .... ......................... 53
3.4.1 Application Requirements ................................. .. ............. .... 54
3.4.1.1Analisis Needs Input (Input) ......... .. ...... ... .... 54
3.4.1.2 Requirements Analysis Process .... .... .... .... .... .... ... .... ... ....
3.4.1.3 Needs Analysis Output (Output). ... .. ... .. .... ... ....
3.4.2 Software Design .... .... .... ... .. .... .... .... ............
3.5 Withdrawal Conclusion ...................................................... ..
CHAPTER 4 RESULTS AND DISCUSSION ... .. .........................
55
55
56
59
60
............................................................... 60 4.1 Research Results
4.1.1 Encoding Chromosome .................................. ............. 61
4.1.2 Initialization Population ........................................... ......... 62
4.1.3 Evaluation of Individual ...................................................... 63
4.1.4 Roulette Wheel Selection ............................................. 64
4.1.5 Update Crossover Probability and Probability Mutation ......... 65
4.1.6 Implementation Program ..................................... ......... ... 66
4.1.7 Simulation Results Program ........................................ ....... 69
4.1.7.1 The calculation using the input population of 100 and
generation 100 ....................................................... ... .. 69
4.1.7.2 The calculation using the input population of 100 and
generation 200 ....................................................... ... .. 75
4.1.7.3 The calculation using the input population of 100 and
generation 500 ....................................................... ... .. 78
4.1.7.4 The calculation using the input population of 100 and
generation 1000 ....................................................... ... .. 80
4.1.7.5 The calculation using the input population of 200 and

generation 100 ....................................................... ... .. 85


4.1.7.6 The calculation using the input population of 500 and
generation 100 ....................................................... ... .. 84
4.1.7.7 The calculation using the input population 1000 and
generation 100 ....................................................... ... .. 86
4.1.8 Analysis Using Traveling Salesman Problem Resolution
Application of Genetic Algorithm with Fuzzy Logic Control Techniques
in the Mail Delivery and Goods in PT. Pos Indonesia DC Monument
....................................................................................... 88
.................................................................. 91 4.2 Discussion
CHAPTER 5 CONCLUSION ...................................................... ... ............ .... 94
5.1 Conclusions ..................................................................... .. 94
5.2 Suggestions ............................................................................ 95
REFERENCES .................................................................. .. 96

LIST OF FIGURES
Pictures Home
Figure 2.1 Example of graph G ......... .. ....... ....... ...... .. ..................... ... 8
Figure 2.2 Graf based orientation (a) a directed graph and (b) graph
undirected .................. .. ...... .. ...... .. ...... .. ...... .. ...... .. ...... .. ... ... 9
Figure 2.3 Road at Graf G ............... .. ...... .. ............................ 10
Figure 2.4 The trace on Graf G ... ... ......... .. ...... .. ...... .. ...... .. ....... ....... 10
Figure 2.5 Tracks on Graf G .......... ...... .. ...... .. ...................... 11
Figure 2.6 Circuit in Graf G .......... ......... .. ............ .. ............... 12
Figure 2.7 Eulerian on Graf G .......... .............................. .. ...... 12
Figure 2.8 Hamiltonian on a graph G .................. ..... ..................... 13
Figure 2.9 (a) connected graphs, (b) is not connected Graf ..................... 14
2:10 Picture Example Graf Weighted .......... .................................. 15
2:11 Image Illustration Selection with Roulette Machine ........................ 24
2:12 Sample Pictures before and after gene mutation
coding tree ............................................................ 31
2:13 Picture Association of fuzzy to the age variable ......................... ... 34
2:14 Picture Association of fuzzy on the temperature variable .................. .. ... 35
2:15 Graph liner ride ............ ... ................................................. 37
2:16 linear graph down ... .............................. ............................ 37
2.17 Graph Representation triangle function ... .................................. ... ... 38

2:18 Graph Membership fuzzy numbers A ... ........................... .. ....... 39


Fuzzy Numbers 2:19 Graph L-R ... ........................... .. ............. ....... 40
2:20 Diagram Sugeno fuzzy ... ..................... .. ...................... .......... 42
2:21 Conceptual Diagram general chronology of the process ... ....... ......................... 42
Figure 3.1 wikimapia front page ... ......... ........................ ....... 51
Figure 3.2 Result ... ..................... ..................... place. 52
Login Menu 3.3 wikimapia ......... ................................................ 52
Figure 3.4 The result of the distance measurement ....................................... ... ... 53
Figure 4.1 Position 22 Address in Graph ...................... ............ .. 61
Figure 4.2 The population initialization syntax ... ....................................... 62
Figure 4.3 Syntax individual evaluation ................... ........................ .. 63
Figure 4.4 Syntax Roulette Wheel Selection ................................. .. 64
4.5 Display Fuzzy Sugeno ... ..................................... ...... ... ...... .. 65
4.6 Display TSP ... ................................................ .. ............ ... 67
4.7 Display Test Results ... ............................................. .... ......... .. 68
4.8 Display Display coordinates or address City Intended ... ............ ... 69
4.9 Display TSP After Entering Coordinates City, Population, and
Generation ............................................................... .. ...... .. 70
4:10 Picture Search Result mutation and crossover probability .... .... ...... 71
4:11 Views TSP after being run ......................... .................. .. 72
4:12 Views graph coordinates the destination address .............................. 72
4:13 Display test results in generation of a population of 100 and 100 ............... ... 73
4:14 Display Data that has been stored in Excel ............................ 73
xiii
4:15 calculation process with the best path length 22.63 .................. 90
LIST OF TABLES
table page
Table 4.1 Calculation Results using population 100 and Generation
100 .... ........................................................................ ....
74
Table 4.2 Calculation Results using population 100 and Generation
200 .... ........................................................................ .... 76
Table 4.3 Calculation Results using population 100 and Generation
500 .... ........................................................................ .... 78
Table 4.4 Calculation Results using population 100 and Generation
1000 .... ........................................................................ .. 80
4.5 Calculation Results Table use and generation Population 200
100 .... ........................................................................ .. 82
Table 4.6 Calculation Results using population 500 and Generation
100 .... ........................................................................ .... 84
Table 4.7 Calculation Results using Population 1000 and Generation
100 .... ........................................................................ .... 86
Table 4.8 Top Line Results of Long .... ................................. ... ... 88

Results Table 4.9 Probability of mutation and crossover .... ..................... ... 90
xiv

CHAPTER 1
PRELIMINARY
1.1 Background
The process of distribution of mail and goods is an activity that never
separated from life. The long distance as well as the deployment of widespread public
one of the reasons for people to use delivery services
goods rather than deliver their own items to be shipped. issues
distribution of goods becomes an important point for service providers
freight and mail. It is in need of consideration and
an exact calculation as it relates to transportation costs which should
issued in the distribution process.
PT. Pos Indonesia is one company that is engaged in
the field of freight and mail in Indonesia. PT. Pos Indonesia itself
has branches in every city throughout Indonesia. In submitting items
as well as a letter from the center to customers in different places and in many cities,
the need for a system that is able to minimize shipping costs and
so we will get the maximum benefit. issues
as this is a problem with the network model similar problems
the hawkers or so-called Traveling Salesman Problem (TSP).
TSP is one of the optimization problem. TSP is a
the problem to find a Hamilton cycle having a total weight of hand
minimum. TSP aims to find the city of origin to destination cities

on the condition that each city can only be visited once, except starting towns.
Many algorithms are applied to the TSP problems among which are
nearest neighbor heuristic, cheapest insertion heuristic, two way exchange
improvement heuristic, nearest insertion heuristic, ant colony Optimation, and
branch and bound method.
There are other algorithms that can be described as a method for
find the solution of a problem TSP, namely Genetic Algorithm and
combining the fuzzy logic control technique with expectations
obtain the best quality of Genetic Algorithms. On
principle, the fuzzy logic control technique is used to control the value of
Genetic Algorithm parameters in a generation automatically (automatic
fine-tuning) based on information obtained from previous population.

In addition to using the manual settlement, in line with


the successful development and application of technology, the problems
optimization can be completed more quickly and easily. calculations
so complicated if completed manually, can now be completed in
a relatively shorter time. There are some computer software
allowing optimization problems resolved by
easier and faster. Some of these programs include the
Lindo software, MATLAB, QM for Windows, SkyNet, Solver, and WinQSB.
From the background mentioned above, in this paper the author
want to try to solve the problems contained in the TSP network
a company. In addition to using the manual completion algorithm
genetics, the author will also complete this optimization problem with a
namely computer software MATLAB. By choosing settlement TSP network
through a Genetic Algorithm with Fuzzy Logic control technique using
MATLAB, is expected to be obtained by the TSP network solutions to problems
optimized so as to minimize the expenditure of the company through a distance
The most minimal.
1.2 Problem Formulation
Issues to be examined in this study are as follows.
1. What is the minimum distance of the search results in the TSP network
delivery of mail and goods in PT. Pos Indonesia Tugu Semarang DC
using a Genetic Algorithm with Fuzzy Logic control techniques
in its application in MATLAB?
2. How does the TSP network that has a minimum distance in
delivery of mail and goods by using Genetic Algorithms
with Fuzzy Logic control techniques in PT. Pos Indonesia DC Monument
Semarang?
1.3 Limitation Problem
In the preparation of this paper, the author discusses the determination of the distance
minimum and optimal route of TSP network on the delivery of goods and
letter in PT. Pos Indonesia Tugu Semarang DC using Genetic Algorithms
Fuzzy Logic control techniques. The problem is assumed as a

TSP symmetrical, where the distance from the city 1 to city 2 is equal to the distance from the
town 2 to
town 1. Software used in this study is MATLAB.
1.4 Research Objectives
The objectives to be expected in this study are as follows.
1. Determining the optimal route network which has a minimum distance of TSP in
delivery of mail and goods by using the Genetic Algorithm
Fuzzy logic control technique in PT. Pos Indonesia Tugu Semarang in DC

application in MATLAB.
2. Determine the minimum distance from the search results in the TSP network
delivery of mail and goods in PT. Pos Indonesia Tugu Semarang DC
using a Genetic Algorithm with Fuzzy Logic control techniques.
1.5 Benefits Research
The expected benefits of this research are as
following.
1. Can add insight and knowledge about the distribution and
transport network.
2. Be able to apply the techniques of Genetic Algorithm with Fuzzy Logic recognize
in solving the TSP.
3. Can apply Matlab software in the completion of the distribution network
mail and goods.

1.6 Systematics Writing


Systematics is useful for ease in understanding the way
thought overall thesis. Writing this essay outline
divided into 3 parts are as follows.
1.6.1 The Beginning
This section contains a title page, abstract, endorsement page, the page motto
and offerings, preface, table of contents, list of tables, lists pictures and lists
attachment.
1.6.2 Section Contents
This section contains five chapters, namely:
CHAPTER I INTRODUCTION
Contains a global overview of the contents of the thesis are background issues,
pemasalahan formulation, restrictions on the problem, research objectives and benefits
research and systematic writing.
CHAPTER II. THEORETICAL BASIS
The theoretical basis will elaborate on definitions and ideas
which is used as the underlying theoretical framework of problem solving
at this research that these problems optimal and minimum distance from the network
TSP in the delivery of mail and goods in PT. Pos Indonesia Tugu Semarang DC
which will be solved by genetic algorithm techniques Logic control
Fuzzy using Matlab software. This section is divided into several sub
namely chapter Graph Theory, Travelling Salesman Problem (TSP), Genetic Algorithm,
Fuzzy Logic Relationship between Genetic Algorithm with fuzzy logic control.

CHAPTER III. RESEARCH METHODS


This chapter outlines the work steps to be taken, including
find the problem, data collection, analysis and problem solving, as well as

drawing conclusions.
CHAPTER IV. RESULTS AND DISCUSSION
This chapter contains a discussion of the issues raised. The chapter is divided
into two sub-chapters, namely the research and discussion. Research result
contains the results of calculations and analysis of data obtained from the literature
as well as solving the case of determining the route and the minimum distance from the TSP
network
the delivery of mail and goods in PT. Pos Indonsia DC Tugu Semarang
using a Genetic Algorithm with Fuzzy Logic control techniques in
application in MATLAB.
CHAPTER V. CLOSING
This chapter is divided into two sub-chapter, the conclusions and suggestions. Conclusion
contains
the outline of the contents in the thesis, while the suggestions in the form of comments,
the arguments are advised to companies dependent on the
variables that exist in the thesis.
1.6.3 Final Part
This section contains a list of libraries as a reference for writing and attachments
supports the thesis completeness.

Você também pode gostar