Use ga optimization inside the cost/nonlincon function of a ga optimization possilbe?

2 次查看(过去 30 天)
Dear Matlab Community,
I would like to use a ga optimization within the cost or nonlincon function of another ga optimization. Is this possible in general? I run into strage errors. If I replace the outer ga by fmincon, everything works fine. However, I expect the ga to perform better than fmincon...
Thank you in advance :-)
  2 个评论
John D'Errico
John D'Errico 2023-1-5
编辑:John D'Errico 2023-1-5
Is it possible? Yes, though with some caveats, since GA, as a stochastic optimizer of sorts, means that you will not always find the same solution arise from multiple repeat starts. And that alone makes things slightly problematic. GA CANNOT insure it will always find the global optimum. It just tries as hard as it can.
Is your code correct? Surely not, since your code failed, and I just stated it is technically possible.
Where/what is the error in your code? That is impossible to know, since we don't see what you wrote. The only answer here is "Probable user error".
Should GA perform better than FMINCON? Not always. In fact, it will often be the case that fmincon converges more rapidly and to a tighter tolerance than GA for the number of function evals taken.
Walter Roberson
Walter Roberson 2023-1-5
In my experience, ga is almost always slower and less precise. It does, however, have theoretical advantages where the function is discontinuous or has multiple basins to explore.

请先登录,再进行评论。

回答(1 个)

Anshuman
Anshuman 2023-4-17
Yes it is possible but using a GA optimization within the cost or nonlinear constraint function of another GA optimization can lead to performance issues, such as slower convergence and longer computation times. This is because the optimization algorithm needs to evaluate the fitness of each individual in the population, and each evaluation requires running the inner GA optimization.
It is also essential to make sure that the parameters of the inner and outer GA are appropriately configured to avoid conflicts and ensure optimal performance. Also we have to check the compatibility of the objective and constraint functions used in the inner and outer GA optimizations.
In case of errors you can try to use other optimization methods, such as fmincon, to check if this issue is related to the nested GA optimization or not. Also it might be helpful to debug the code to identify the source of the issue.
Hope it helps!

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by