An implementation of TSP(Traveling Salesman Problem) by Genetic Algorithm in Java.
- Solve TSP in Java.
- Adopt Object-Oriented.
- Divide into 4 Classes: GeneticAlgorithm, SpeciesNode, SpeciesList and Constant.
- Verify respectively in 3 different size of cities: 10 cities, 20 cities and 31 cities.
- GeneticAlgorithm: controls the whole algorithm's life cycle and do some genetic operation including select, cross, mutate.
- SpeciesNode: contains the sequence of gene, the length of route and fitness of this species.
- SpeciesList: represents a list(group) of species(SpeciesNode)
- Constant: contains the data of map, the max length of every group of species, the max number of generations, the probability of cross, mutate and so on.
If you want to learn more information about this implementation, please visit the following three sites(but a pity only in Chinese):