I’m writing a GP that I need some advice on for crossover and mutation operations. The GP is attempting to find the best solution for a matrix that has hard row constraints and softer column constraints.
For a given solution in the population, the rows contain a random combination of object type ids from a fixed set. The GP is trying to find a solution where, after the rows are laid out, if you tally the id’s in each column, the number of each type must fall within a recommended range for that id. I wrote a fitness function that allows me to grade the solution on how close it comes to the columns constraints – 100% being all the columns fall within specs.
Where I need a little advice is on my crossover. Parents are chosen from solutions with higher fitness scores. I have a one-point crossover where I slice some rows from the top of the father and the complimentary bottom rows from the mother to generate the offspring. I can’t slice by column because that would almost always make the solution infeasible.
Does this approach seem reasonable for crossover? I’m worried that not enough good genetic ‘material’ passes from generation to generation to ultimately make this feasible. For mutation, I just plan on re-randomizing a row or two and checking the new fitness score for the solution.
Thanks for any advice as I plod along.
In any genetic algorithm, the crossover method should be chosen to appropriate to the encoding of the solution. If crossing over in a particular way would make many of the offspring non-viable, then you shouldn’t cross them like that. However, it does sound like crossing over rows would prevent you from exploring the search space thoroughly.
There are several approaches that you could use to address this: