Back to Browse

Traveling Salesman Problem (01) + Genetic Algorithms (03) - JAVA Prototype Project

24.7K views
Jun 6, 2016
40:58

►Python version @ https://youtu.be/ukFfrOePrJc ►TSP JAVA Framework @ https://youtu.be/EjUDJP846cc ►screenshots: https://prototypeprj.blogspot.com/2020/09/traveling-salesman-problem-tsp-by_11.html 00:01 quickly go over the various parts of this tutorial 00:51 demo a prebuilt version of the application 01:36 highest fitness means shortest distance in the context of this TSP app. 01:50 evolve from one generation to the next by doing selection crossover mutation and elitism 02:36 code the application 02:54 go over the various classes in this app. 04:24 code the City class 05:37 code the City class measureDistance method that uses the haversine formula in order to calculate the distance between 2 cities 07:13 code the Route class representing a route starting at an originating city passing once in every city and than returning to the originating city 10:02 code the Route class calculateTotalDistance method 12:00 code the Population class method that does sorting various routes by their fitness 13:00 define the the various route cities in Driver class (name + latitude + longitude) 13:33 code the GeneticAlgorithm class 14:48 mutation rate is the probability that a chromosome (i.e. route in TSP context) gene (i.e. city in TSP context) does random mutation 15:50 elite routes not subjected to crossover or mutation from one generation to the next 16:27 methods for applying crossover and mutation to population of routes 16:52 public method that evolves population from one generation to the next 17:09 method for applying crossover to route 17:24 method for applying tournament selection to population of routes 17:45 method for applying mutation to route 18:00 code crossoverPopulation method 20:23 code mutatePopulation method 21:00 example route mutation 21:56 code mutateRoute method 22:34 code selectTournamentPopulation method 24:06 example route crossover 26:37 code crossoverRoute method 30:52 code Driver class 32:32 quick test run for generation 0 35:35 code for evolve from one generation to the next functionality 37:39 test run completed application 39:17 compare genetic algorithm obtained best distance against exact best distance using brute force algorithm ► get access to members-only video contents + support: https://www.youtube.com/channel/UCUvwlMMaeppKPdtAK8PxO8Q/join ► website + download source code: https://prototypeprj.com https://ai.prototypeprj.com https://crypto.prototypeprj.com ► download directly: download ai source code @ https://sites.fastspring.com/prototypeprj/instant/ai download crypto source code @ https://sites.fastspring.com/prototypeprj/instant/crypto download source code (old) page # 2 @ https://sites.fastspring.com/prototypeprj/instant/2020 download source code (older) page # 1 @ https://sites.fastspring.com/prototypeprj/instant/all

Download

0 formats

No download links available.

Traveling Salesman Problem (01) + Genetic Algorithms (03) - JAVA Prototype Project | NatokHD