coin-or / Bonmin

Basic Open-source Nonlinear Mixed INteger programming
https://coin-or.github.io/Bonmin
Eclipse Public License 1.0
121 stars 22 forks source link

Equip i-FP with Cplex #4

Open CJNeumann opened 5 years ago

CJNeumann commented 5 years ago

I have successfully installed Bonmin as described in this issue. Yet, when I try to equip Bonmin's algorithm b-ifp with Cplex as a sub-solver, I get outputs from the MILP solves that seem to indicate that Cbc is used instead:

Bonmin trunk using Cbc 2.10 and Ipopt 3.12 bonmin: bonmin.algorithm=b-ifp bonmin.milp_solver=Cplex [...] NLP0014I 1 OPT 3.513512 21 0 build initial OA NLP0014I 2 OPT 3.5135116 4 0 FP for MINLP OCbc0013I At root node, 0 cuts changed objective from -139 to -139 in 1 passes OCbc0014I Cut generator 0 (Probing) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100

I use python 3.6.5, pyomo 5.3, an academic version (12.9) of Cplex and the following commands: opt = SolverFactory('bonmin') opt.options['bonmin.algorithm'] = 'b-ifp' opt.options['bonmin.milp_solver'] = 'Cplex'

I have attached the python file that produces the issue. Here, I try to find a feasible point for the problem du-opt from the MINLP using b-ifp + Cplex.

Any hint is appreciated.

PS: I am able to successfully address Cplex from pyomo with opt = SolverFactory('cplex') so it should be properly installed and its path is findable.

du-opt.zip

tkralphs commented 5 years ago

You probably need to enable CPLEX at configure/build time (it has to be found and linked to the Osi library), as there is not dynamic loading of the library yet with Osi. You can add something like

--with-cplex-lib="-L/usr/local/cplex/lib/x86-64_sles10_4.1/static_pic/ -lcplex -lpthread -lm" --with-cplex-incdir=/usr/local/cplex/include/ilcplex"

to either the coinbrew build command-line or the configure command line (depending on how you actually built it). Then it should hopefully work.

CJNeumann commented 5 years ago

Thanks for your Answer Ted. I had actually built it using these lines. I think it could have to do with the way it is set up using WSL, so probably I'll just switch to Linux if I really need Cplex as a subsolver.

CJNeumann commented 5 years ago

Unfortunately, the problem remains when building Bonmin using coinbrew under Linux (Mint 19.1 Tessa). The output is exactly as described above. What would be displayed, if Cplex were used instead of Cbc? Is there maybe another way to tell Pyomo that Bonmin should use Cplex as subsolver?

Also, I find it quite strange that the FP gets stuck at the first LP as the problem seems to be not too difficult.