next up previous
Next: Crossover Up: Modified GAs for TSPs Previous: Modified GAs for TSPs

Encoding

To use a GA to solve TSPs, we make some changes to the traditional genetic algorithm. We do not use binary chromosomes to encode TSPs because TSPs are sequential problems. Instead, we use a path representation where the cities are listed in the order in which they are visited. For example, assuming there are 5 cities 0, 1, 2, 3, 4, if a salesman goes from city 3, through city 0, city 1, city 4, city 2 and returns back to city 3, the chromosome will be 3 0 1 4 2. For an N cities TSP, we initialize the population by randomly placing 0 to N-1 into N length chromosomes and guaranteeing that each city appears exactly once. Thus chromosomes stand for legal tours.



Sushil J. Louis
Sat Jan 18 20:12:20 PST 1997