Is it possible to use a different fitness function for certain population members in the Genetic Algorithm?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
2 commentaires
Matt J
le 5 Oct 2018
Why not just remove the members you don't want to process from the initial population altogether?
Réponses (0)
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!