简体   繁体   English

建议GA运营商解决TSP问题?

[英]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. 如果您有兴趣比较实现的性能,我有一个Java Applet,它使用有序的交叉和变异来实现TSP

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. 这些交叉算子中有几个是订单交换(OX)和边缘交叉算子。

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. 顺便说一句,由于您已经标记了“ python”,因此请查看Pyevolve ,它也有一个TSP示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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