MATLAB: How to avoid trivial solution (norm(x) =0) for binary ga optimization

gaoptimization

Hi, I'm trying to do an optimization using binary ga and after 25 hours of processing, the best result of the algorithm was the trivial solution. How can I insert a constraint for norm(x)=0?

Best Answer

If you have a vector of unknowns x(i) with each x(i) = 0 or 1, then include a linear constraint:
A*x <= -1
where A is a row vector of negative ones.
Alan Weiss
MATLAB mathematical toolbox documentation