I am using a genetic algorithm to fit the max number of circles into a box. Right now my cromossomes are both coordinates of the each circle. I am not sure how to crossover and mutate the x and y coordenates in order not for the to converge but to keep a distance.
Can someone please shed some light? Thank you
This is where I am getting at:
But there is the last ball always overlaps. I think my problem is with the crossover.
So far and by gathering all the ideas here this is what I have reached: Given a fixed number of circles (easier to explain) this is what I am doing.
- Create a random set of circles for each individual in the population
Calculate the fitness of every individual base on the overlaping area are and area outside the box.
I then order the individuals by their fitness
Do a cross over. For that I am using a cumulative sum to choose randomly but with priorities which individuals are likely to go through to the next generation based on the fitness. The fittest have a higher probability of being chosen.
After choosing them indivudals I am aplying the crossover to I randomly choose the chromosse to which I do the single point cross over.
Then repeat for n generations
I am doing this but not getting to any convergion in terms of solution.