简体   繁体   中英

Suggested GA operators for a TSP problem?

I'm building a genetic algorithm to tackle the traveling salesman problem. Unfortunately, I hit peaks that can sustain for over a thousand generations before mutating out of them and getting better results. What crossover and mutation operators generally do well in this case?

Ordered mutation and ordered cross-over (see this article ). Standard mutation and cross-over operations will usually result in invalid solutions (ie duplicate and/or missing cities in a route).

There was a similar question recently.

I have a Java applet that implements the TSP using ordered cross-over and mutation , if you are interested in comparing the performance of your implementation.

If your problem is that peaks remain for over one thousand generations, then the problem might not be with the crossover and mutation operators. You might not be introducing or keeping enough variation to your population: I would examine the proportions of crossovers, of mutations, and of survivors from one generation to the next, and possibly raise the proportion of mutations.

Could you please clarify

"Unfortunately, I hit peaks that can sustain for over a thousand generations before mutating out of them and getting better results" ?

You could check on the crossover operators, which make sure that you have no repeating nodes in the child chromosomes. Couple of those crossover operators are the Order Crossover (OX) and the Edge Crossover operators.

Mutation can be as simple as simply swapping two positions in a single chromosome.

BTW, since you have tagged "python", take a look at Pyevolve , it also has a TSP example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM