filmov
tv
Genetic Algorithm with Python - Source Code Explained - Travelling Salesman Problem - Part 2
![preview_player](https://i.ytimg.com/vi/jgbsottGET8/maxresdefault.jpg)
Показать описание
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
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
Комментарии