How can I avoid trivial solution (norm(x) =0) for binary ga optimization?
2 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
Alan Weiss
on 8 Jan 2014
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
3 Comments
Alan Weiss
on 8 Jan 2014
Perhaps you are using the bitstring data type. Indeed, this data type does not allow for constraints.
However, you can formulate the problem for binary GA by using mixed integer optimization, and setting lower bounds of 0 and upper bounds of 1. You can use linear inequality constraints with mixed integer GA.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!