【发布时间】:2018-03-13 21:38:12
【问题描述】:
我正在尝试实现解决 TSP 的遗传算法。它适用于少数城市(比如 10 个)的 TSP 并产生最佳解决方案。然而,当城市数量增加到50个城市时,它过早地收敛。我尝试更改参数(突变概率、交叉概率、初始种群大小、生成数),但它仍然没有收敛到最优解。
我实现的算法如下:
Create an initial population randomly of size p
Calculate the fitness
Pick p/2 random individuals to the parents
While counter < p/2
pick parent1 and parent2 by tournament selection
child1, child2 = mutate and crossover parent1 and parent2
add child1 and child2 to new population
pick p/2 distinct individuals from initial population and store in new population
谁能告诉我我做错了什么?
【问题讨论】:
-
谁说遗传算法是防弹的?
标签: optimization genetic-algorithm convergence