Problem with linear constraints in Genetic algorithm - optimtool.

Hi all. We have a problem with genetic algorithm in optimtool. We use linear contraints to minimize cost function. It seems that optimtool cannot get linear constraints into account during computation. We have simple cost function: y= -(1000*x(1) + 2000*x(2)); Linear constraints: function [c, ceq] = simple_constraint(x); c = [50*x(1) + 80*x(2) - 100]; ceq = []; We use bitstring as genes in chromozomes. Minimizing this function, x = [0 1]. Cost function value is -2000. When we use function "ga" in m-file, everything is OK. But when we use optimtool, we assign cost function, then we insert matrix A = [50 80] and vector b = [100] as linear constraints. But result of minimizing of this problem is x = [1 1] and cost function value is -3000. It seems that with bitstring coding constraints are not computed. When we use another example for double vector minimizing problem, everything is OK. We have also tried to set all parameters in OPTIONS in funtion ga and parameters in optimtool same, but still we have different results.
If anybody of you have some example with genetic algorithm in optimtool with bit coding (bitstring) to minimize cost function with linear constraints we would be pleased to see your solution.
Thanks a lot.
Best regards.
Jiri Kocian, Czech Republic

Answers (0)

Asked:

on 28 Apr 2011

Community Treasure Hunt

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

Start Hunting!