reset password
Author Message
sdo8
Posts: 54
Posted 00:33 Nov 29, 2019 |

From my understanding of genetic algorithms, the mating pool size comes from a randomly selected sample of the population (Assuming we are using tournament selection).
We then sort the mating pool by each of the individuals' fitness, and select an elite size (number of best individuals that moves directly into the children population).
Using the mating pool, we now begin to cross breed randomly selected individuals from the mating pool using 1 or 2 point crossover. We repeat this process until we have enough children for the next population.

Finally, we set a chance for mutation for each individual in the children and repeat the process for n many generations.

I'm having trouble determining the best combination of population size, elite size, and mating pool size to solve the problem. 
Would it be better to select a mating pool size around 90% the size of the population or lower? Would it be better to generally just have larger elite/mating pool/population sizes in general?

How long should it take for a GA for, let's say.. a 5x5 Nurikabe take to solve?

After attempting some GA problems, I'm starting to feel like calculating Fitness for some problems was like writing heuristics for Pac-man. 
Currently, calculating Fitness for Nurikabe has been a big issue for me - and I'm starting to believe that determining Fitness is one of the biggest challenges for GA.

 

Thanks & Happy Holidays!

rabbott
Posts: 1649
Posted 11:54 Nov 29, 2019 |

Population size, tournament size, etc. are all somewhat arbitrary. The best sizes will depend on the problem. An important consideration is that you want to maintain diversity in the population. 

Given a diverse population, what's important are the evolution operators (crossover and mutation). You want to select or create operators that have a good chance to move an individual (or a pair of individuals) toward a solution. You also want your fitness function to identify important features so that individuals that have those features are likely to be included in subsequent populations. 

As long as you continue to generate some individuals with improved qualities, don't worry about generating other individuals with low fitness. They will just fall out of the population. 

rabbott
Posts: 1649
Posted 13:09 Nov 29, 2019 |

To ensure diversity, the Population selects its next generation by selecting a certain percentage the usual way, e.g., tournament selection, and the rest as random new individuals. You can specify what percentage will be random. See one_max_2D.  If you make select_pct_random=0.9 (as it's currently set), evolution almost always find a solution. If you set it to  select_pct_random=0.1 it often fails to find a solution.

Last edited by rabbott at 13:10 Nov 29, 2019.