Skip to content
An implementation of TSP by Genetic Algorithm in Java.采用遗传算法解决TSP旅行商问题的Java版程序。
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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.

For More

If you want to learn more information about this implementation, please visit the following three sites(but a pity only in Chinese):

You can’t perform that action at this time.