I have an MINLP problem to solve where I was initially using 'ipopt' solver but the solution was not sticking to 'binary/boolean/integer' domain type for a variable. I am not sure which free solver would be good to go? Also, I understand 'SCIP' is not straight forward to use.
-
1$\begingroup$ It would be considered, Pyomo has a nice facility to deal with the NEOS server to use a dozen solvers without any challenging. Would you see this link? $\endgroup$– A.OmidiCommented Oct 21, 2020 at 15:21
-
$\begingroup$ stackoverflow.com/help/someone-answers $\endgroup$– kur agCommented Oct 23, 2020 at 12:02
3 Answers
You can use SCIP with PYOMO easily. My way is: At first, use an executable SCIP version, it is available for the 7.0 version. After then giving the path of the executable to PYOMO, such as:
solver = SolverFactory('scip', executable="./scip")
It works. But I use BONMIN in same way.
With SCIP 8, you can either download the program from https://scipopt.org/ and add it to your search path, or you can install using Anaconda via conda install scip
.
Once SCIP is installed, you should be able to run pyomo --solver scip --solver-io nl model.py
or use SolverFactory('scip', solver_io='nl')
in your Python code.
If you leave off the solver-io option, Pyomo will try to use a SCIP-specific communication method, which didn't work for me. But specifying --solver-io nl
forces Pyomo to run SCIP in AMPL/ASL mode, which works fine.
You may also be able to get this to run without putting scip
in your search path, by specifying the full path to the program instead of just scip
.
SCIP used to be a bit challenging to set up with PYOMO as we needed to build the ASL interface. It's been a few years so I don't know if that's changed, but you can find a relevant discussion here.
What might be easier would be to use Couenne, which is a deterministic global optimisation solver for MINLP and works out of the box with PYOMO.
If you are a student/academic, you can also use our own global MINLP solver (Octeract Engine) for free.
If you do, you can find a detailed tutorial on how to use it with PYOMO on Windows & Linux here.