Two-dimensional optimization (especially using GLPK)
17 views (last 30 days)
Show older comments
Suppose I want to perform an optimization where the solution matrix X is a two-dimensional matrix rather than a vector. The constraints and objective functions can therefore operate on various rows/columns of the solution matrix; for example, the sum of the elements in each column of the matrix must be as close as possible to a certain value, but the sum of n consecutive elements in each row must be less than or equal to 1.
Are there any functions or combinations of functions in MATLAB that allow me to do this, and is it also possible to do this using the GLPK package?
0 Comments
Answers (1)
Matt J
on 21 Jun 2013
Edited: Matt J
on 21 Jun 2013
The examples you describe can be handled by any solver just be reshaping X into a vector first. For example the problem you describe is equivalent to
[m,n]=size(A);
ec=ones(m,1);
er=ones(n,1);
S=kron(speye(n),ec.');
A=kron(er.',speye(m));
x=X(:);
min norm(S*x -certainvalue).^2
s.t.
A*x<=ec
Also, in MATLAB Optimization Toolbox functions, no constraints or objective functions that are expressed via function handles (instead of matrix data) ever need to process X as a vector. Same with ub,lb data, I think.
6 Comments
Matt J
on 21 Jun 2013
I have no experience with GLPK/Matlab, I'm afraid. I think if it allowed you to formulate the argument space in matrix form, that would be very obvious in the documentation. I can't see much benefit in having this for linear solvers, though, so I would be surprised if it were supported. Same thing with "Cx-d".
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!