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

19 views (last 30 days)
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?

Accepted Answer

Matt J
Matt J on 3 Nov 2013
Edited: Matt J on 3 Nov 2013
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 Comments
Matt J
Matt J on 3 Nov 2013
Edited: Matt J on 3 Nov 2013
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.

Sign in to comment.

More Answers (3)

imed NASRI
imed NASRI on 3 Nov 2013
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 on 3 Nov 2013
Edited: Matt J on 3 Nov 2013
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 Comments
imed NASRI
imed NASRI on 3 Nov 2013
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.

Sign in to comment.


Matt J
Matt J on 3 Nov 2013
Edited: Matt J on 3 Nov 2013
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 Comments
Vitor Ribeiro
Vitor Ribeiro on 10 Sep 2014
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 on 22 Jun 2015
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. :-(

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!