Develop Branch vs Main Branch of YALMIP: BMIBNB issue

30 views
Skip to first unread message

AS95

unread,
Mar 29, 2020, 11:28:12 PM3/29/20
to YALMIP
I have this small non-convex optimization problem:

x = sdpvar(2,1);
Objective = log_sum_exp(x);
a
= [2;1];
rho
= 2;
Constraints = (norm(x-a, 2) <= rho^2);


solution
= optimize(Constraints, -Objective, sdpsettings('solver', 'bmibnb'));

This was working in the main version of YALMIP, but the develop version has issues. It gives a lot of errors, and also complains that I am using logsumexp() but should switch to log_sum_exp() which is what I am doing.

Is this an expected thing?

Johan Löfberg

unread,
Mar 30, 2020, 1:36:17 AM3/30/20
to yal...@googlegroups.com
There is no command in yalmip called log_sum_exp, and never has been. You must have destroyed your installation, or you have some other software interfering ("which logsumexp")

Runs without problems here when using yalmip code, i.e. logsumep or log(sum(exp(x)))

I am a bit concerned though as it picks mosek as upper bound solver, which shouldn't be possible as the problem isn't exp-cone representable since you maximize a convex function.
* Starting YALMIP global branch & bound.
* Branch-variables : 2
* Upper solver     : MOSEK
* Lower solver     : CPLEX
* LP solver        : CPLEX
 Node       Upper      Gap(%)       Lower    Open
    1 :   -5.787E+00     5.94     -6.203E+00   2  Improved solution  
    2 :   -5.954E+00     3.51     -6.203E+00   3  Improved solution  
    3 :   -6.007E+00     0.26     -6.025E+00   4  Improved solution  
* Finished.  Cost: -6.0068 Gap: 0.25807
* Termination with relative gap satisfied 
* Timing: 2% spent in upper solver (3 problems solved)
*         5% spent in lower solver (7 problems solved)
*         46% spent in LP-based domain reduction (40 problems solved)


I would make sure I use a nonlinear solver here

>> solution = optimize(Constraints, -Objective, sdpsettings('solver', 'bmibnb','bmibnb.uppersolver','fmincon'));
* Starting YALMIP global branch & bound.
* Branch-variables : 2
* Upper solver     : fmincon
* Lower solver     : MOSEK
* LP solver        : SCIP
 Node       Upper      Gap(%)       Lower    Open
    1 :   -6.007E+00     2.76     -6.203E+00   2  Improved solution  
    2 :   -6.007E+00     2.76     -6.203E+00   3    
    3 :   -6.007E+00     2.48     -6.183E+00   2  Infeasible  
    4 :   -6.007E+00     2.48     -6.183E+00   3    
    5 :   -6.007E+00     0.44     -6.038E+00   2  Poor bound  
* Finished.  Cost: -6.0068 Gap: 0.44374
* Termination with relative gap satisfied 
* Timing: 57% spent in upper solver (3 problems solved)
*         1% spent in lower solver (8 problems solved)
*         39% spent in LP-based domain reduction (38 problems solved)



Mark L. Stone

unread,
Mar 30, 2020, 7:49:56 AM3/30/20
to YALMIP
log_sum_exp is a CVX command. 

More confusingly, there is also a logsumexp command in CVX which tells you to use log_sum_exp and then calls log_sum_exp .With CVX ahead of YALMIP in the path, attempts to use logsumexp in YALMIP fail.

The same also applies to geo_mean and geomean in CVX.

My "solution" is to delete (or rename out of effective existence) the CVX functions, logsumexp and geomean .

Johan Löfberg

unread,
Mar 30, 2020, 7:51:24 AM3/30/20
to YALMIP
Ok, problem solved then

Johan Löfberg

unread,
Mar 30, 2020, 7:57:05 AM3/30/20
to YALMIP
my concern there was false alarm. YALMIP does indeed select mosek for the nonconvex case thinking it will be able to exp-cone represent the logsum exp, but it never uses this incorrectly during the branching process. It will only lead to no upper bound solutions being made available from the selected upper bound solver (but YALMIP is able to construct a good solution rather quickly from the lower bound relaxations anyway in this particular case)

AS95

unread,
Mar 30, 2020, 3:45:19 PM3/30/20
to YALMIP
Great, thank you!! Is there an easy way to obtain the best lower and upper bound values found by bmibnb? 

Johan Löfberg

unread,
Mar 30, 2020, 3:48:27 PM3/30/20
to YALMIP

solution = optimize(Constraints, -Objective, sdpsettings('solver', 'bmibnb','savesolveroutput',1));
solution
.solveroutput
ans
=


 
struct with fields:


         lower
: -6.0325
    lower_hist
: [-6.2028 -6.2028 -6.1853 -6.1853 -6.0325]
    upper_hist
: [-5.7877 -5.9914 -5.9914 -5.9914 -6.0068]



AS95

unread,
Mar 30, 2020, 4:28:17 PM3/30/20
to YALMIP
Thank you very much!

AS95

unread,
Mar 30, 2020, 4:39:55 PM3/30/20
to YALMIP
There is no lower_hist or upper_hist in other solvers like IPOPT. I guess this is because they are using interior point methods and stopping at the first local optimum. Can I always obtain upper and lower values with global solvers, e.g., BARON? Sorry for the off-topic questions, I am going to stop now:)!

Johan Löfberg

unread,
Mar 30, 2020, 5:01:01 PM3/30/20
to yal...@googlegroups.com
If they don't output it when turning on savesolveroutput then it is not available (although it is a bit odd that you talk about ipopt in this context as it is not a global solver, however ipopt is primal-dual solver as far as I remember hence it has a similar concept for convex problems)

AS95

unread,
Mar 30, 2020, 5:04:37 PM3/30/20
to YALMIP
Thank you. The reason I talk about ipopt is such a problem is solvable by a general purpose nonlinear solver, not CPLEX GUROBI or MOSEK, so I just wanted to find methods to compare lower&upper bounds given by many solvers.

Johan Löfberg

unread,
Mar 31, 2020, 1:07:10 AM3/31/20
to YALMIP
these bound only make sense in global solvers
Reply all
Reply to author
Forward
0 new messages