Genetic Algorithm with Python - Source Code Explained - Travelling Salesman Problem - Part 2

preview_player
Показать описание
This is the second part of the video series about Genetic Algorithm and Python implementation of Travelling Salesman Problem(TSP). I prepared Python files and example dataset, and explained each function and steps during the video.

I displayed Chromosome sequence implementation in Python, and you can use the same or similar structure for your optimisation problems. Moreover, I added three different crossover functions. As a selection method, I used “Tournament Selection” method. You can use this or adapt any of other like Wheel Roulette.

Lastly, remember that GA is quite successful and efficient but it doesn’t provide the best solution in all cases. It provides optimal solutions in an efficient time. Therefore, it’s always better to think local optimisation algorithms with GA.

My code is accessible on the Github. You can use or inspire. The link:

Also for other available datasets in TSPLIB:

#geneticalgorithm
#python
#travellingsalesmanproblem
#geneticalgorithmwithpython

Timecode
0:00 Intro, TSP
0:33 Dataset
1:16 General structure, main file, parameters
4:13 Chromosome file, Node class, distance matrix
6:57 Genetic algorithm, steps, operators
8:27 Selection (tournament)
9:21 Crossovers, one point, two points, mixed
12:13 Mutation
12:39 Create a new generation
13:56 Results and evolutionary progress of the paths
Рекомендации по теме
Комментарии
Автор

Thank you for clear explanation! But why the iteration size should be half of the population size ? 'So, iteration size will be half of the population size!'

ruxru
Автор

Sir how to implement Multuple Traveling Salesperson Problem using NSGA-2 in python.

theWorldOfIss
Автор

hi there thanks for the video
Can you please help me with this error: *AttributeError: module 'Chromosome' has no attribute 'dataset'*
I was using your dataset only but this error is coming

divijgajjar