SlideShare a Scribd company logo
1 of 13
Travelling Salesman Problem
Using Genetic Algorithms
By: Priyank Shah(1115082)
Shivank Shah(1115100)
Problem Definition
• The traveling salesman problem consists of a salesman and a
set of cities. The salesman has to visit each one of the cities
starting from a certain one (e.g. the hometown) and returning
to the same city. The challenge of the problem is that the
traveling salesman wants to minimize the total length of the
trip.
Method Used
• We have a set of cities (points) in 2d plane. Each city has
road to each city. We need to find loop-path that will be in
each city only one time and path length is minimal.
• The genetic algorithm is sequence of following operations
that repeated in generations loop:
1) Generate random population and finding path length.
2) find probabilities for selection.
3) prepare to crossover according probabilities.
4) crossover, parents replaced with children.
5) mutations.
STEP 1 : Create Random Population
• So we have a lot of paths with different lengths. A path can have
crossover with another path and mutate. After crossover it will be
replaced by its children. All paths recorded in matrix G :
• here we have population with 6 paths (population size ps=6), and it is
for 4 cities.
• In the code to generate initial population of random paths randperm
matlab function was used. It return randomly permutated numbers, for
example:
>> randperm(4)
ans =
3 4 2 1
STEP 2: Fitness evaluation
• To have fast calculation of paths length before start iteration,
it is calculated in a matrix of distancies dsm.It is a n x n matrix
where n is number of cities, dsm(i1,i2) is distance between
city i1 and city i2.
• The logic used is that if we want to minimize distance then we
want to maximize inverse distance.
• Thus the fitness function we want to maximize is the inverse
of distance
f(x)= 1/d
STEP 3 :SELECTION FOR CROSSOVER
• For this case roulette_wheel_indexes.m function was made. First calculate probabilities as
inverse distances divided by sum of inverse distances:
𝑝𝑖 =
1
𝑑𝑖
𝑖
1
𝑑𝑖
• Here 𝑝𝑖 is probability of 𝑖 path to be put to crossover, 𝑑𝑖 is 𝑖 path length.
• for example we have 6 paths with numbers
1 2 3 4 5 6
• and let it have probabilities
• 0.05 0.5 0.05 0.05 0.05 0.3
• then by using roulette_wheel_indexes.m function we will put for the crossover for example
• 1 2 6 2 6 2
• You can see that 2 most frequent and 6 also frequent, rest ELIMINATED. But all this is
random.
• So after that we have pair wise crossover:
1 and 2 (gives 2 children)
6 and 2 (gives 2 children)
6 and 2 (gives 2 children)
STEP 4: CROSSOVER
• The different crossover techniques used for solving the travelling
salesman problem are listed below:
• Among these PMX, ER and POS are quoted to be the fastest
operators as far as the number of necessary iterations to reach
convergence is concerned . The convergence rates of these three
operators are observed to be similar.
Example of PMX
STEP 5: MUTATION
• There are 3 types of mutations used:
1) Chose 2 random cities
and swap them,
Result:
2 1 3 4
STEP 5: MUTATION (CONT.)
2) mutation by exchange of 2 pieces of path :
• First randomly chose point of spit, for example
between 2 and 3 positions:
• now swap two pieces:
2 13 4
2 1 3 4
STEP 5 :MUTATION (CONT)
3) mutation of flip random piece of path
• first choose some random piece of path:
• now flip it left-right:
• Elitism means that we save best path and put it
manually to next generation without changes.
• G(1,:)=Gb; % elitism
2 71 63 84 5
2 81 63 74 5
References
• Genetic Algorithm Solution of the TSP Avoiding Special
Crossover and Mutation
G¨okt¨urk ¨Uc¸oluk
Department of Computer Engineering
Middle East Technical University
06531 Ankara, Turkey
THANK YOU !!

More Related Content

What's hot

Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Vicky Tyagi
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated AnnealingJoy Dutta
 
Evolutionary computing - soft computing
Evolutionary computing - soft computingEvolutionary computing - soft computing
Evolutionary computing - soft computingSakshiMahto1
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman ProblemMaryam Alipour
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptAntaraBhattacharya12
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codesRevathi Subramaniam
 
Application of fuzzy logic
Application of fuzzy logicApplication of fuzzy logic
Application of fuzzy logicViraj Patel
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point ProcessingGayathri31093
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceSahil Kumar
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationJoy Dutta
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesFahim Ferdous
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation pptGichelle Amon
 

What's hot (20)

AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated Annealing
 
Evolutionary computing - soft computing
Evolutionary computing - soft computingEvolutionary computing - soft computing
Evolutionary computing - soft computing
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman Problem
 
Soft computing
Soft computingSoft computing
Soft computing
 
Tabu search
Tabu searchTabu search
Tabu search
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
 
Application of fuzzy logic
Application of fuzzy logicApplication of fuzzy logic
Application of fuzzy logic
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
Fuzzy Membership Function
Fuzzy Membership Function Fuzzy Membership Function
Fuzzy Membership Function
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 

Similar to Genetic Algorithms Optimize Traveling Salesman Problem Route

Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic AlgorithmComparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic AlgorithmIOSR Journals
 
Simulation of Crowd Evacuation scenarios using NetLogo
Simulation of Crowd Evacuation scenarios using NetLogoSimulation of Crowd Evacuation scenarios using NetLogo
Simulation of Crowd Evacuation scenarios using NetLogoFederico D'Amato
 
The Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptxThe Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptxHalimFerchichi
 
654719957459169719-gann-markov-games-presentation.pptx
654719957459169719-gann-markov-games-presentation.pptx654719957459169719-gann-markov-games-presentation.pptx
654719957459169719-gann-markov-games-presentation.pptxBiswajitLohar
 
Lecture 10 11-signal_flow_graphs
Lecture 10 11-signal_flow_graphsLecture 10 11-signal_flow_graphs
Lecture 10 11-signal_flow_graphsSaifullah Memon
 
3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban Mobility3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban MobilityLIFE GreenYourMove
 
Data Analysis and Algorithms Lecture 1: Introduction
 Data Analysis and Algorithms Lecture 1: Introduction Data Analysis and Algorithms Lecture 1: Introduction
Data Analysis and Algorithms Lecture 1: IntroductionTayyabSattar5
 
lec 2 Robotics time & motion
lec 2 Robotics time & motionlec 2 Robotics time & motion
lec 2 Robotics time & motioncairo university
 
ESCC 2016, July 10-16, Athens, Greece
ESCC 2016, July 10-16, Athens, GreeceESCC 2016, July 10-16, Athens, Greece
ESCC 2016, July 10-16, Athens, GreeceLIFE GreenYourMove
 
Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...
Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...
Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...GreenYourMove
 
robotics presentation (2).ppt is good for the student life and easy to gain t...
robotics presentation (2).ppt is good for the student life and easy to gain t...robotics presentation (2).ppt is good for the student life and easy to gain t...
robotics presentation (2).ppt is good for the student life and easy to gain t...poojaranga2911
 
Popular search algorithms
Popular search algorithmsPopular search algorithms
Popular search algorithmsMinakshi Atre
 
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...GreenYourMove
 
With saloni in ijarcsse
With saloni in ijarcsseWith saloni in ijarcsse
With saloni in ijarcssesatish rana
 
Operation research model for solving TSP
Operation research model for solving TSPOperation research model for solving TSP
Operation research model for solving TSPDrGovindshaysharma
 

Similar to Genetic Algorithms Optimize Traveling Salesman Problem Route (20)

Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic AlgorithmComparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
 
Simulation of Crowd Evacuation scenarios using NetLogo
Simulation of Crowd Evacuation scenarios using NetLogoSimulation of Crowd Evacuation scenarios using NetLogo
Simulation of Crowd Evacuation scenarios using NetLogo
 
The Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptxThe Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptx
 
654719957459169719-gann-markov-games-presentation.pptx
654719957459169719-gann-markov-games-presentation.pptx654719957459169719-gann-markov-games-presentation.pptx
654719957459169719-gann-markov-games-presentation.pptx
 
Lecture 10 11-signal_flow_graphs
Lecture 10 11-signal_flow_graphsLecture 10 11-signal_flow_graphs
Lecture 10 11-signal_flow_graphs
 
Traveling Eco-Salesman
Traveling Eco-SalesmanTraveling Eco-Salesman
Traveling Eco-Salesman
 
3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban Mobility3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban Mobility
 
Data Analysis and Algorithms Lecture 1: Introduction
 Data Analysis and Algorithms Lecture 1: Introduction Data Analysis and Algorithms Lecture 1: Introduction
Data Analysis and Algorithms Lecture 1: Introduction
 
lec 2 Robotics time & motion
lec 2 Robotics time & motionlec 2 Robotics time & motion
lec 2 Robotics time & motion
 
Lec2 state space
Lec2 state spaceLec2 state space
Lec2 state space
 
ESCC 2016, July 10-16, Athens, Greece
ESCC 2016, July 10-16, Athens, GreeceESCC 2016, July 10-16, Athens, Greece
ESCC 2016, July 10-16, Athens, Greece
 
Presentation escc 2016
Presentation escc 2016Presentation escc 2016
Presentation escc 2016
 
Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...
Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...
Presentation of GreenYourMove's hybrid approach in 3rd International Conferen...
 
robotics presentation (2).ppt is good for the student life and easy to gain t...
robotics presentation (2).ppt is good for the student life and easy to gain t...robotics presentation (2).ppt is good for the student life and easy to gain t...
robotics presentation (2).ppt is good for the student life and easy to gain t...
 
Popular search algorithms
Popular search algorithmsPopular search algorithms
Popular search algorithms
 
Presentation 3rd CSUM
Presentation 3rd CSUM Presentation 3rd CSUM
Presentation 3rd CSUM
 
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
 
With saloni in ijarcsse
With saloni in ijarcsseWith saloni in ijarcsse
With saloni in ijarcsse
 
LLSF_for_Imperial
LLSF_for_ImperialLLSF_for_Imperial
LLSF_for_Imperial
 
Operation research model for solving TSP
Operation research model for solving TSPOperation research model for solving TSP
Operation research model for solving TSP
 

Recently uploaded

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 

Recently uploaded (20)

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

Genetic Algorithms Optimize Traveling Salesman Problem Route

  • 1. Travelling Salesman Problem Using Genetic Algorithms By: Priyank Shah(1115082) Shivank Shah(1115100)
  • 2. Problem Definition • The traveling salesman problem consists of a salesman and a set of cities. The salesman has to visit each one of the cities starting from a certain one (e.g. the hometown) and returning to the same city. The challenge of the problem is that the traveling salesman wants to minimize the total length of the trip.
  • 3. Method Used • We have a set of cities (points) in 2d plane. Each city has road to each city. We need to find loop-path that will be in each city only one time and path length is minimal. • The genetic algorithm is sequence of following operations that repeated in generations loop: 1) Generate random population and finding path length. 2) find probabilities for selection. 3) prepare to crossover according probabilities. 4) crossover, parents replaced with children. 5) mutations.
  • 4. STEP 1 : Create Random Population • So we have a lot of paths with different lengths. A path can have crossover with another path and mutate. After crossover it will be replaced by its children. All paths recorded in matrix G : • here we have population with 6 paths (population size ps=6), and it is for 4 cities. • In the code to generate initial population of random paths randperm matlab function was used. It return randomly permutated numbers, for example: >> randperm(4) ans = 3 4 2 1
  • 5. STEP 2: Fitness evaluation • To have fast calculation of paths length before start iteration, it is calculated in a matrix of distancies dsm.It is a n x n matrix where n is number of cities, dsm(i1,i2) is distance between city i1 and city i2. • The logic used is that if we want to minimize distance then we want to maximize inverse distance. • Thus the fitness function we want to maximize is the inverse of distance f(x)= 1/d
  • 6. STEP 3 :SELECTION FOR CROSSOVER • For this case roulette_wheel_indexes.m function was made. First calculate probabilities as inverse distances divided by sum of inverse distances: 𝑝𝑖 = 1 𝑑𝑖 𝑖 1 𝑑𝑖 • Here 𝑝𝑖 is probability of 𝑖 path to be put to crossover, 𝑑𝑖 is 𝑖 path length. • for example we have 6 paths with numbers 1 2 3 4 5 6 • and let it have probabilities • 0.05 0.5 0.05 0.05 0.05 0.3 • then by using roulette_wheel_indexes.m function we will put for the crossover for example • 1 2 6 2 6 2 • You can see that 2 most frequent and 6 also frequent, rest ELIMINATED. But all this is random. • So after that we have pair wise crossover: 1 and 2 (gives 2 children) 6 and 2 (gives 2 children) 6 and 2 (gives 2 children)
  • 7. STEP 4: CROSSOVER • The different crossover techniques used for solving the travelling salesman problem are listed below: • Among these PMX, ER and POS are quoted to be the fastest operators as far as the number of necessary iterations to reach convergence is concerned . The convergence rates of these three operators are observed to be similar.
  • 9. STEP 5: MUTATION • There are 3 types of mutations used: 1) Chose 2 random cities and swap them, Result: 2 1 3 4
  • 10. STEP 5: MUTATION (CONT.) 2) mutation by exchange of 2 pieces of path : • First randomly chose point of spit, for example between 2 and 3 positions: • now swap two pieces: 2 13 4 2 1 3 4
  • 11. STEP 5 :MUTATION (CONT) 3) mutation of flip random piece of path • first choose some random piece of path: • now flip it left-right: • Elitism means that we save best path and put it manually to next generation without changes. • G(1,:)=Gb; % elitism 2 71 63 84 5 2 81 63 74 5
  • 12. References • Genetic Algorithm Solution of the TSP Avoiding Special Crossover and Mutation G¨okt¨urk ¨Uc¸oluk Department of Computer Engineering Middle East Technical University 06531 Ankara, Turkey