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?