Integer constrained optimization using the "ga" (genetic algorithm) solver of MATLAB - can anyone help?

6 次查看(过去 30 天)
I tried to do mono-objective linear optimization subject to linear equality and inequality constraints and over binary decision variables (o or 1) using the "ga" solver of MATLAB. MATLAB optimization "ga" toolbox did not help, because many constraints are violated and not satisfied. However i have transformed the equality constraints to inequality constraints using a tolerance. Does anybody have an explanation or an idea to overcome this problem?

采纳的回答

Matt J
Matt J 2013-11-3
编辑:Matt J 2013-11-3
However i have transformed the equality constraints to inequality constraints using a tolerance.
ga() already applies a tolerance parameter "TolCon" to the constraints.
You can never expect to satisfy equality constraints exactly.
  7 个评论
Matt J
Matt J 2013-11-3
编辑:Matt J 2013-11-3
Because other solvers like LINGO or CEPLEX find the global optimal solution with all constraints (equality and inequality) satisfaction
No, they don't...
Again, no solver can escape from finite precision arithmetic. Everybody has to apply a tolerance, unless I suppose your Aeq, beq constraint data are all integers.

请先登录,再进行评论。

更多回答(3 个)

imed NASRI
imed NASRI 2013-11-3
in the case of my optimization problem, both equality and inequality constraints are violated when i run the mixed integer solver ga of matlab. However, the same problem is solved by CEPLEX solver using!!!!!

Matt J
Matt J 2013-11-3
编辑:Matt J 2013-11-3
I tried to do mono-objective linear optimization subject to linear equality and inequality constraints and over binary decision variables (o or 1) using the "ga" solver of MATLAB. MATLAB optimization "ga" toolbox did not help,
BINTPROG would be the more appropriate solver, if the objective and all constraints are linear.
  6 个评论
imed NASRI
imed NASRI 2013-11-3
i've also tried to add an other constraint to force variable x to be equal to 0 or 1. This constraint is x*(x-1)=0. So with this constraint i'm not obliged to use the IntCon options. Unfortunately, the ga solve dont find feasible solutions.

请先登录,再进行评论。


Matt J
Matt J 2013-11-3
编辑:Matt J 2013-11-3
Another thing you could try is to eliminate the equality constraints by solving for some variables in terms of the others. For example, if you had the single equality constraint
x1+x2+x3=d
then you could eliminate both the constraint and x3 from the problem by replacing x3 everywhere by d-x1-x2. The same kind of thing could be done with systems of inequality constraints.
Then you would be left with inequality constraints only, which ga() can handle.
  73 个评论
Vitor Ribeiro
Vitor Ribeiro 2014-9-10
In fact, after some simulations, with GA working in same parameters as I initially state, I can see that when it finds a feasible solution GA rapidly learn and apparently converge because it is evaluating more feasible solutions around the 1st one it reach.
In many literature there are results showing that GA is a really good choice for solving problems of topology optimization with his basic heuristic formulation. I'm not certain about the mean code of GA function but I am convinced that it respects the heuristic core.
I'm not saying that GA in matlab works better then any other optimization function cause I do not have the knowledge for that. I don't know if BINTPROG or even INTLINPROG works better. I am interested in see documentation explaining how it works before seeing how it's used. If you can provide some link it would be really helpful.
After I can see how it works this functions, about how the solutions are generated or even search space composed by solutions are really searched by this algorithms, if they have an heuristic base, I would be able to choose research more in literature and probably understand which works better before I apply it in my problem indiscriminately.
Thank you all for your answers. I really appreciate each one.
Matt J
Matt J 2015-6-22
I've only now realized that there is a pitfall with the variable elimination approach. When using the equality constraints alone to eliminate variables, there is nothing ensuring that the eliminated variables will end up being integers. :-(

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by