How to extract the dual objective value and the dual residues?

325 views
Skip to first unread message

Juan

unread,
May 1, 2014, 11:20:25 AM5/1/14
to yal...@googlegroups.com
Hello Johan,

I'm using YALMIP to solve some SDPs that written down symbolically look like

min <B,M>
M>=0
<D_1,M>=1
<D_i,M>=0  for  i=2,...,n.

Where the decision variable is the symmetric matrix M and <B,M> := trace(BM).

Often these sdps are large (and/or badly conditioned) and so the solvers I try (SeDuMi/SDPT3/MOSEK) are unable to find the optimum (when they 'give up', there's still non-trivial gap). However, any dual feasible point and it's corresponding dual objective value are of interest to me (since they lower bound the optimum, which in the original context from which problem comes from is also a lower bound on some other quantity). So once I call solvesdp, how can I extract value of the dual objective and the residues of the dual (to check whether I have a dual feasible point)? Also, do you have any advice on how best to model the problem in YALMIP so that, even if the solvers cannot solve it, they are likely to return a dual feasible point (is it best to send to the solver the primal problem in dual form, the primal problem in primal form, the dual problem in dual form, etc?)?

Thanks in advanced,

Juan
---------------------------------------------------------

Here's what I've been attempting, consider the example

A = [-1 2;-3 -4];
P = sdpvar(2,2);
F = [A'*P+P*A <= 0,P(1,1) == 2];
solvesdp(F,trace(P),sdpsettings('solver','mosek'));

My understanding is that YALMIP re-writes the above in dual form

max b'y
C - A_1y_1-A_2y_2-A_3y_3 >= 0
Fy == f

where C = zeroes(2), A_1 : = [-2,2;2,0], A_2 ] [-6,-5;-5,4], A_3, b = [-1,0,-1]', F = [1,0,0] and f = 2 (and by calling see(F(1)) this seems to be the case). After calling solvesdp, I can extract the dual variables with

X = dual(F(1)); t = dual(F(2));

To check dual feasibility, I need to make sure that both that X >= 0 (which I can do simply by min(eig(X)) or by calling checkset(F(1))) and that || [<A_1,X>;<A_2,X>;<A_3,X>] + F't - b ||_inf is ''reasonably small''. To find the dual objective I need to compute <C,X>+f't. In this small example this is not an issue for me (calling see(F(1)) and see(F(2)) I can check the C, A_i,b,F and f yalmip is using). However, this doesn't seem the best of approaches, specially for bigger problems. So my question is, how can I extract C, A_i,b,F and f from YALMIP or alternatively how can extract || [<A_1,X>;<A_2,X>;<A_3,X>] + F't - b ||_inf and <C,X>+f't? Sorry for the long-winded post.


Johan Löfberg

unread,
May 1, 2014, 12:26:51 PM5/1/14
to yal...@googlegroups.com
To begin with, are you telling YALMIP to interpret this as a representation of the primal problem? By default, YALMIP interprets everything as a representation of the dual problem, which will be very inefficient if n < O(size(M)^2)
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.AutomaticDualization

Duals are extracted using dual.

Juan

unread,
May 1, 2014, 1:30:27 PM5/1/14
to yal...@googlegroups.com
I'm importing the models from gloptipoly3 (using their command myalmip). My understanding is that the primal problem then is in dual form and that for those type of problems this is efficient (I could be completely wrong though). I understand how to use dual to extract the dual variables X and t. What I'd like to do is find the value of the objective of the dual problem, when the solver terminated, and checking dual feasibility. In particular, I'm having trouble extracting the problem data (C,A,b,F,f) to then compute || A(X) + F't - b ||_inf and <C,X>+f't.

Johan Löfberg

unread,
May 2, 2014, 2:20:02 AM5/2/14
to
Turn on the options savesolveroutput aand savesolverinput, and all that data will be available in the output from solvesdp

Juan

unread,
May 4, 2014, 5:42:41 AM5/4/14
to yal...@googlegroups.com
Thank you.
Reply all
Reply to author
Forward
0 new messages