Convex Conic Problem Local Optimum is not Global Optimum?

50 views
Skip to first unread message

Aras

unread,
Aug 29, 2018, 8:21:36 PM8/29/18
to YALMIP
Dear Yalmip users,

I have a convex conic optimization model. Since it is convex, there is one local=global minimum. 

I solve it with Knitro with:
optimize(Constraints,Objective,sdpsettings('solver','mosek'));

And I get:
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 37              
  Cones                  : 8               
  Scalar variables       : 48              
  Matrix variables       : 0               
  Integer variables      : 0               
Interior-point solution summary
  Problem status  : PRIMAL_AND_DUAL_FEASIBLE
  Solution status : OPTIMAL

ans =

    5.7208

So the global optimum is 5.7208.

Then, I only change that specific line to:
optimize(Constraints,Objective,sdpsettings('solver','knitro'));

which gives me:
EXIT: Locally optimal solution found.

Final Statistics
----------------
Final objective value               =  6.18909620224944e+000
Final feasibility error (abs / rel) =   1.00e-010 / 1.00e-010
Final optimality error  (abs / rel) =   7.03e-007 / 7.03e-007
# of iterations                     =        199 
# of CG iterations                  =         89 
# of function evaluations           =        367
# of gradient evaluations           =        200
Total program time (secs)           =       0.197 (     0.203 CPU time)
Time spent in evaluations (secs)    =       0.165

===============================================================================

Elapsed time is 2.618804 seconds.



So my question is: Is this about the iterations limit? If yes, it shouldn't tell me 'local' optimum right?

What can I do here?

Thank you!

Erling D. Andersen

unread,
Aug 30, 2018, 12:46:53 AM8/30/18
to YALMIP
Some guesses 

* You model is unstable/numerically bad.
* Knitro contains a bug.
* There is a bug elsewhere.

Mosek could be wrong but since you do not include the full solution summary it is hard to say.

Johan Löfberg

unread,
Aug 30, 2018, 1:59:05 AM8/30/18
to YALMIP
You would have to supply the code so it can be run for analysis. As Erling says, could be a bug anywhere (including YALMIP)

Aras

unread,
Aug 30, 2018, 9:25:35 AM8/30/18
to YALMIP
Thank you for your reply. I am sharing the code. It is short and I will be more than happy to hear the problem. Change the solver to knitro, it will give a different result. Maybe it is a numerical issue about the size of the derivative (knitro error)?

n = 2;
q
= 5;
I
= eye(n);
tau
= sdpvar(1,1);
u
= sdpvar(q,1);
V
= sdpvar(q,n);
r
= sdpvar(q,1);


Q
= [1 0; 0 1];


b
= [-2.4 ; -1.2];
c
= 1.8;
L
= chol(Q);


z1
= sdpvar(1,1);
z2
= sdpvar(n,1);
z3
= sdpvar(q,1);
%
%
d
= [1; 4; 1; 3 ; 2];
D
= [-2 1;1 1;0.5 -1;1 0; 0 1];
%


Objective = tau + c;
Constraints = [];
Constraints = [Constraints, d.'*u+z1 + b.'*(V.'*d)  <= tau];
Constraints = [Constraints, (1+d.'
*r+z1)/2 >= norm([(1+d.'*r-z1)/2; L*(V.'*d)])];


for i=1:n
Constraints = [Constraints, -D(:,i).'*u+z2(i)  + b.'*(I(:,i)-V.'*D(:,i)) <= 0];
Constraints = [Constraints,(-D(:,i).'
*r + z2(i))/2 >= norm([L*(I(:,i)-V.'*D(:,i)); (-D(:,i).'*r - z2(i))/2])];
end




for i=1:q
Constraints = [Constraints, -u(i)+z3(i) + b.'*(-V(i,:).') <= 0]; %Make sure about this one!
Constraints = [Constraints, (-r(i)+z3(i))/2 >= norm([(-r(i)-z3(i))/2; L*(-V(i,:).')])];
end

tic
optimize(Constraints,Objective,sdpsettings('
solver','knitro'));
toc

value(Objective)

Johan Löfberg

unread,
Aug 30, 2018, 9:38:53 AM8/30/18
to YALMIP
Interesting, I can reproduce your issue.

It appers to be in knitro. If I switch to fmincon, it works as expected, and YALMIP uses the same code for gradient evaluations etc for both knitro and fmincon. Hence, I suspect the issue is in knitro on this model. Note that knitro does not support direct specification of socp cones (they've added it in the solver in v11, but as far as I've seen it cannot be used via matlab) so the norm operators are implemented as as nonlinear constraints (yalmip internally squares the constraint during constraint gradient computation to get a smooth quadratic)

I will have to look around a bit to see if it is on YALMIPs side. Simple problems work, so I am not sure...

>> x = sdpvar(2,1);
>> optimize([norm(x-[0;3]) <= 3,norm(x+3) <= 6],sum(x),sdpsettings('solver','knitro'));


Mark L. Stone

unread,
Aug 30, 2018, 9:47:19 AM8/30/18
to YALMIP
Plans for second order cone constraint support in KNITRO under MATLAB are discussed at https://groups.google.com/forum/#!topic/knitro/gOVwjqg2Zwg .

Johan Löfberg

unread,
Sep 1, 2018, 10:39:02 AM9/1/18
to YALMIP
FYI, I've checked in an update in develop to improve this

still wouldn't recommend anyone to use a nonlinear solver on SOCP problems

Aras

unread,
Sep 2, 2018, 6:27:22 PM9/2/18
to YALMIP
Thank you, Professor Lofberg. The reason I was using Knitro on SOCP was: I will modify my SOCP and it will not be SOCP anymore. So I could only use Knitro. So I was benchmarking with Mosek in a SOCP case before my modificaiton.
Reply all
Reply to author
Forward
0 new messages