0

I used matlab GA toolbox to solve an integer programming problem. The problem has some binary variables. I used nonlinear constraints such as x*(1-x) = 0 for binary variables, but matlab outputs real values for these variables.

One another problem is that final solution is not feasible! I used this line of code:

options = gaoptimset(options,'CreationFcn', @gacreationlinearfeasible);

But matlab still generating no feasible solutions.

A friend suggested using inequality constraints instead of equality ones, but that failed.

Then there is two problems. 1) say matlab about binary variables, 2) generating feasible solutions.

How can I use matlab GA for my problem?

JalalJaberi
  • 2,417
  • 8
  • 25
  • 41

1 Answers1

0

I'm not sure it is best solution, but I solved my problem by substitute constraints for penalty coefficients in fitness function.

After all, as a suggestion, anyone who has same problem can try GAlib (C++ genetic library) instead of matlab.

JalalJaberi
  • 2,417
  • 8
  • 25
  • 41