建议 GA 操作员解决 TSP 问题?

发布于 2024-08-20 04:01:42 字数 86 浏览 11 评论 0原文

我正在构建一种遗传算法来解决旅行商问题。不幸的是,我达到的峰值可以维持一千多代,然后才突变出来并获得更好的结果。在这种情况下,哪些交叉和变异算子通常表现良好?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

遮云壑 2024-08-27 04:01:42

有序突变和有序交叉(参见本文)。标准变异和交叉操作通常会导致无效的解决方案(即路线中重复和/或丢失城市)。

最近有一个类似的问题

我有 一个使用有序交叉和突变实现 TSP 的 Java 小程序,如果您有兴趣比较您的实现的性能。

Ordered mutation and ordered cross-over (see this article). Standard mutation and cross-over operations will usually result in invalid solutions (i.e. 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.

时光暖心i 2024-08-27 04:01:42

如果您的问题是峰值保持超过一千代,那么问题可能不在于交叉和变异算子。你可能没有向你的群体引入或保留足够的变异:我会检查一代到下一代的交叉、突变和幸存者的比例,并可能提高突变的比例。

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.

烏雲後面有陽光 2024-08-27 04:01:42

你能澄清一下吗

“不幸的是,我达到了可以
维持一千以上
变异之前的几代人
他们并获得更好的结果”?

您可以检查交叉算子,以确保子染色体中没有重复节点。其中的几个交叉算子是顺序交叉 (OX) 和边缘交叉算子。

突变可以是就像简单地交换单个染色体中的两个位置一样简单,

因为您已经标记了“python”,请查看 Pyevolve< /a>,它还有一个 TSP 示例。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文