[Cbc] Usage of CbcMain1

Tobias Stengel Tobias.Stengel at locom.de
Mon Jun 26 03:50:12 EDT 2017


>>I am creating a CbcModel's object by passing an object of OsiClpSolverInterface to the class. This is being passed to CbcMain0 which in turn is passed to CbcMain1 with "-solve" and "-quit" as the parameters. This calls the MILP solver and taking some time.
This is a correct way to call cbc. The arguments passed to CbcMain1 are the same passed to the command line. See https://projects.coin-or.org/CoinBinary/export/1059/OptimizationSuite/trunk/Installer/files/doc/cbcCommandLine.pdf In my experience options like cut generators are set to reasonable defaults. Nevertheless playing around with them might give a significant speedup for your problem.
Note that solving a MIP is NP-hard, so there are models that take a lot of time. You may want to set a gap or a time limit if a good but not necessarily optimal solution is sufficient.
There are a few typical reasons why an MIP takes long to solve. The console output of CBC helps to investigate.

·         Bad relaxation e.g. large gap. You can try change your model to get a tighter relaxation.

·         Slow LP relaxation. Changing the model can help.

·         Branching does not really improve the lower bound => search tree gets huge. This occures for example if there is symmetry in the model.

·         Solver needs a lot of time to find the first feasible solution. You can try to write a problem specific heuristic (depending on the model this can be easy) or pass a feasible solution to CBC (CbcModel has a method to do this).

·         This list is not complete.




Von: Cbc [mailto:cbc-bounces at coin-or.org] Im Auftrag von A P SHYAM SANKAR ch13b059
Gesendet: Montag, 5. Juni 2017 13:34
An: cbc at list.coin-or.org
Betreff: [Cbc] Usage of CbcMain1

[Das Bild wurde vom Absender entfernt.]
Dear team,
I am Shyam, currently a final year undergraduate at Department of Chemical Engineering, Indian Institute of Technology Madras, India. My project thesis is on optimizing supply chain network using model predictive control techniques under Prof. Raghunathan Rengaswamy.
In my current problem formulation, I am solving an integer problem and I am working on CBC for that. I am currently struck at the way CbcMain1 is being used.
I am creating a CbcModel's object by passing an object of OsiClpSolverInterface to the class. This is being passed to CbcMain0 which in turn is passed to CbcMain1 with "-solve" and "-quit" as the parameters. This calls the MILP solver and taking some time.
The heuristic which I am developing involves calling the MILP solver interface multiple times in the programme. This is taking a lot of computation time each time it is being called. My query here is that if I am using the correct parameters to call the model? Also it would be great if you could provide me with a documentation for CbcMain1. Additionally, I don't have any choice of particular cut generators. I want the solver to choose it's default cut generator or if there is a way by which the solver could figure out the optimal cut generator based on the problem, variables and constraints.
My question is very basic and I am relatively a noob in code optimization techniques though. Any suggestions, or help would be highly appreciated. Looking forward to hearing from you.

Thanks and Regards
Shyam Sankar
Senior Undergraduate
IIT Madras
Chennai, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20170626/7976582c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ~WRD000.jpg
Type: image/jpeg
Size: 823 bytes
Desc: ~WRD000.jpg
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20170626/7976582c/attachment.jpg>


More information about the Cbc mailing list