prevent genetic algorithm ga from repeating values

1 view (last 30 days)
I am using genetic algorithm to optimize two variables for a specific function. However, as I thought would be the general demand, I don't want ga to repeat the evaluation of pairs of variables, i.e., I want ga to test only unique pairs of values. There are a few pairs of values that it repeats several times and not only as an elite, but as spawn as well.
I would like to know if it possible to prevent this. Thank you. Best Regards, Pedro

Answers (2)

Matt J
Matt J on 21 Dec 2012
Edited: Matt J on 21 Dec 2012
Since there are only 2 unknown variables, can't you get a good fix on the global optimum using exhaustive search on an MxN discrete grid of the parameter values? If you restrict your initial population to include the discrete global minimum and points nearby, I'd guess you would not only avoid repetitions, but get very quick convergence as well.
  2 Comments
Pedro
Pedro on 21 Dec 2012
As in most functions, my grid has several local minima. Therefore I would not be able to obtain the global minimum simply by grid search. Furthermore, what you are suggesting, would not guarantee the prevention of repetions, only "faster" convergence.
Matt J
Matt J on 21 Dec 2012
You should at least be able to rule out large regions of local minima. Using the MIN function on a grid of samples would find the global minimum over those samples. If the grid is fine enough relative to how sharply your function varies, that should correspond reasonably closely with the continuous-space global minimum.

Sign in to comment.


Sean de Wolski
Sean de Wolski on 21 Dec 2012
This seems to contradict the theories behind genetic algorithms. The good candidates are supposed to breed and create other good candidates nearby and this is how these algorithms converge.
Also, it is the general recommendation that you should try patternsearch() before using ga()

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!