Is it possible to use a matrix as a decision variable for GA?

4 views (last 30 days)
For my optimization problem, I have a 13x144 matrix as a binary decision variable. Since it is integer and non-linearly constrained, I cannot use fmincon. Is it possible to use GA? If so, how do I define nvars, lb, and ub?
If ga will not work, is there another Matlab solver that I should use for this kind of problem?
I'm running Matlab R2014a.
Thank you

Accepted Answer

Alan Weiss
Alan Weiss on 15 Apr 2015
All you have to do is take your matrix of decision variables and reshape it to a row vector for use in GA. For example, if x0 is a 13x144 matrix, then
b = (x0(:))';
is a row vector. To turn the row vector back into a matrix, use reshape:
c = reshape(b,size(x0));
That said, I do not think that you will have much luck with that many decision variables and GA. I believe GA is suitable for perhaps up to 100 decision variables, not thousands. You would probably have better luck using intlinprog with a linear approximation to your constraints, along the lines of this example.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!