MINLP solving by Bonmin: how to reduce running time

339 views
Skip to first unread message

Corinna

unread,
Jun 11, 2014, 2:33:26 AM6/11/14
to
Hi,

I'm using Bonmin solver (B-OA) to solve a complex MINLP problem which only includes 6 binary variables. However, the running time of this problem is so long (about several hours), which i think should be much smaller. 

So here is my question: 

         In order to know why it costs such a long time, how should i set the solver options so that it will show me what each step is  and how long it costs in this step?   That is , can the program show me  how the branch-and-cut works and how the continuous NLP is solved in detail and their separate running time?

         Thanks!

Corinna
         

Jonathan Currie

unread,
Jun 11, 2014, 7:17:19 PM6/11/14
to Corinna, opti-tool...@googlegroups.com

Hi Corinna,

 

The time taken to solve any optimization problem is never a function of the number of decision variables alone, but rather a complex combination of the type of problem (smooth, discontinuous, differentiable, convex, etc), as well as the types of constraints (linear, nonlinear,  integer, etc), how good the initial guess is, whether the solver can exploit these problem properties, as well as problem construction.

 

Normally, if I am having a problem with a MINLP problem, I relax the integer/binary constraints, by either fixing them as constants, or letting them be continuous variables. Then use IPOPT to solve one relaxed problem and examine the problem solution statistics, e.g.:

 

Total CPU secs in IPOPT (w/o function evaluations)   =      0.159

Total CPU secs in NLP function evaluations           =      0.001

 

If you find CPU secs in NLP function evaluations is significant, then you will need to revisit how you have constructed your objective/constraint callbacks (and/or derivative functions). Conversely if it is in IPOPT that most time is taken, then it is most likely the linear solver (MA57?) which is the bottleneck. This is much harder to speed-up, but we can look at this if this is the case.

 

If that doesn’t provide anything meaningful, add the following line to line 27 of opti_bonmin.m (just for debugging)

 

nlprob.options.display=3;

 

Jonathan

--
You received this message because you are subscribed to the Google Groups "OPTI Toolbox Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opti-toolbox-fo...@googlegroups.com.
To post to this group, send email to opti-tool...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gmail

unread,
Jun 12, 2014, 1:44:44 AM6/12/14
to Jonathan Currie, opti-toolbox-forum
Hi Jonathan,
 
Thank you so much for your advice.
Following your direction, I relax all my binary variables to be continuous variables. Then this is the result:
 
 
 
Number of objective function evaluations             = 255
Number of objective gradient evaluations             = 133
Number of equality constraint evaluations            = 259
Number of inequality constraint evaluations          = 259
Number of equality constraint Jacobian evaluations   = 1
Number of inequality constraint Jacobian evaluations = 152
Number of Lagrangian Hessian evaluations             = 151
Total CPU secs in IPOPT (w/o function evaluations)   =     37.370
Total CPU secs in NLP function evaluations           =    144.472
 
It seems the NLP function evaluation is significant than in IPOPT. So does it means I need to change the description of objective/constraints and their derivative functions (I use exact derivative functions)? If yes, what kind technique should I take in constructing objective/constraints?  
 
Regards
 

Corinna

此电子邮件不含病毒和恶意软件,因为 avast! 杀毒软件 保护处于活动状态。


Jonathan Currie

unread,
Jun 12, 2014, 4:12:11 AM6/12/14
to liuhx.corinna, opti-toolbox-forum

Hi Corinna,

 

I’m glad to see you are using exact derivatives. If it takes around 3 minutes to solve one relaxed problem I’m not surprised it is taking much longer for a MINLP!

 

I would start with the profiler for each of your functions:

 

>> profile viewer

 

i.e. use objective(x) as the code to run, then examine the output. Repeat for each callback function. See where the time is being taken and whether you can see easy ways to speed up the evaluation.

 

I have a page on the Wiki which also had some ideas for helping speed up your code:

 

http://i2c2.aut.ac.nz/Wiki/OPTI/index.php/Advanced/LargeScale

 

Alternatively, try seeing if some the settings in ipoptset / bonminset can assist. It is always a bit difficult knowing which ones to play with though…

 

Jonathan

gmail

unread,
Jun 19, 2014, 11:02:15 PM6/19/14
to Jonathan Currie, opti-toolbox-forum
Hi Jonathan,
 
I reduced those actually useless constraints following your direction and it works. The program is now running much faster than before.
 
Thanks a lot!
Reply all
Reply to author
Forward
0 new messages