genetic algorithm - Simple GA very fast convergence -
i'm trying apply ga solve problem , having couple questions.
first question selection - i've seen in many implementations population sorted according score/fitness prior selection. necessary? example in tournament selection individuals should picked uniformly sorting seems have no meaning. or lets consider roulette wheel selection. following implementation sorting again seems unnecessary (pseudo code):
totalfitness = sum individuals i.fitness roulettevalue = totalfitness * random 0.0 1.0 selected = null = 0; while roulettevalue >= 0.0 selected = individuals[i++] roulettevalue -= selected.fitness return selected
so necessary sort population selection?
another question quick convergence: i'm trying out simple ga crossover probability 0.9, mutation probability 0.01, population size 30 , initial population contains 'very-good-solution' (known). crossover produces 2 offsprings always, 1 iteration follows (pseudo code):
for = 0 population-size mother = select-one population while father != mother father = select-one population if should-crossover crossover-probability (sister, brother) = apply-crossover mother father else sister = copy mother brother = copy father if should-mutate mutation-probability apply-mutation sister if should-mutate mutation-probability apply-mutation brother insert-at new-population sister insert-at new-population i+1 brother = + 2 swap new-population population
also because of nature of problem crossover never provides better results parents had.
so, speaking, happens because 'good solution' better other solution in initial population selected reproduction more other individual (lets probability 0.1 30 individuals). if crossover not applied (probability 0.1) 'good solution' carried on new population. population size 30 on average crossover skipped 1.5 pair. after 15 iterations 22 crossovers skipped. 'good solutions' selection probability 0.1 after 22 skipped crossovers i'll have 2 'good solutions' inserted new population. after happens 'good solution' proliferates fast.
is there way overcome problem?
on convergence problem - judging parameters described, converging seeded known-good solution because population near large enough.
assuming remainder of population randomly generated, odds these 29 individuals have components generate more-fit offspring extremely low. combined 10% no-crossover chance, known-good individual consistently dominate.
to generate more-fit individual via ga known-good, need increase population, , increase crossover probability well. need weaken selection algorithm prevent single strong individual dominating reproduction cycle in given generation.
Comments
Post a Comment