output slack variables of an LP

29 views
Skip to first unread message

guanglei wang

unread,
Apr 10, 2017, 9:01:25 PM4/10/17
to YALMIP
Dear all,

I solved an LP problem using yalmip with cplex solver.  I want to extract the binding constraints  of an LP.

One way to do this is to get the slack variables of constraints.

Having googled around, I think learn that we can extract output of a solver via:

   --  sdpsettings(savesolverout, '1 ')

   --  sol = optimize(LP, options);

   --   sol.solveroutput.lambda.ineqlin

My questions are:


-- what is the meaning of "lambda.ineqlin", are they representing slack variables of each constraint?

-- how to set the precision of the slack variables ?

-- How to display slack variables of a subset of constraints ?


Thanks in advance


Guanglei


Johan Löfberg

unread,
Apr 11, 2017, 1:53:19 AM4/11/17
to YALMIP
lambda.ineqlin are duals for inequalities.

For myconstraint = A*x<=b, sdpvar(myconstraint) will return b-A*x, hence to get the slack you would do value(sdpvar(myconstraint)). 

guanglei wang

unread,
Apr 11, 2017, 8:45:01 AM4/11/17
to YALMIP
Thanks, Johan. 

I accept your explanation. 
Reply all
Reply to author
Forward
0 new messages