I am using the genetic algorithm to solve a integer (binary) problem with linear constraints.
Because the solution space is so large (~400 binary solution vector) and I do not have a lot of time to run the algorithm, I inject a handful of strategic solutions into the initial population. This way the GA is refining those solutions rather than starting randomly (and hence, better solutions are found quicker).
The problem is that the fitness function is a bottleneck on run time. The initial generation takes upwards of 30 minutes to evaluate 500 random feasible solutions. After the first generation, crossover turns the population mostly infeasible (and infeasible solutions are not evaluated by the fitness function - so the generations progress much more quickly). Over time, feasible solutions begin to emerge and the population becomes (almost) completely feasible.
(Note: The mathworks documentation on this is currently incorrect. Crossover DOES produce infeasible solutions in certain uses of the GA).
Since the random solutions are uniformly "fit" after the first generation, I don't want to waste precious time running each of them through the fitness function in the initial generation.
Is there a way to tell the fitness function to ignore certain population members? Such as population(100:end,:) if Generation < 1? As far as I can tell, there's no straightforward way to pass which population member is being evaluated to the fitness function. (Even if you can pass other parameters).
My other thought it to use the output function to change the fitness function. For the first generation, it could use a very simple function. Then after the first crossover, I can use the output function to inject the strategic solutions into the population and switch over to the better fitness function.
Does anyone have any thoughts on this?