3

I am trying to solve a MILP problem set up in PYOMO whith SCIP as solver. I run the problem from within PyDev using the python ANACONDA interpreter.

I can run and solve the problem with other solvers, namely CBC, GLPK, and IPOPT.

However, it does not work when using SCIP as solver. It seems like there is something wrong with the SCIP/AMPL interface... Anybody can help out?

Below are some details on the error prompt and system configuration.


I tried with 'scip' and 'scipampl'.

With 'scip'

opt = SolverFactory('scip')
instance = model.create_instance("test1.dat")
results = opt.solve(instance)
instance.display()

WARNING: "[base]/site-packages/pyomo/solvers/plugins/solvers/SCIPAMPL.py", 68, _default_executable Could not locate the 'scipampl' executable, which is required for solver scip Traceback (most recent call last): File "/home/alessandro/Documents/Eclipse workspace/test1/src/test1.py", line 48, in results = opt.solve(instance) # solves and updates instance File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 539, in solve self.available(exception_flag=True) File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/solver/shellcmd.py", line 122, in available raise ApplicationError(msg % self.name) pyutilib.common._exceptions.ApplicationError: No executable found for solver 'scip'

With 'scipampl'

opt = SolverFactory('scipampl')
instance = model.create_instance("test1.dat")
results = opt.solve(instance)
instance.display()

WARNING: "[base]/site-packages/pyomo/opt/base/solvers.py", 202, solver_call Failed to create solver with name 'scipampl': Failed to set executable for solver asl. File with name=scipampl either does not exist or it is not executable. To skip this validation, call set_executable with validate=False. Traceback (most recent call last): File "/home/alessandro/Documents/Eclipse workspace/test1/src/test1.py", line 48, in results = opt.solve(instance) File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 127, in solve self._solver_error('solve') File "/home/alessandro/anaconda3/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 155, in _solver_error + "\n\toptions: %s" % ( self.options, ) ) RuntimeError: Attempting to use an unavailable solver.

The SolverFactory was unable to create the solver "scipampl" and returned an UnknownSolver object. This error is raised at the point where the UnknownSolver object was used as if it were valid (by calling method "solve").

The original solver was created with the following parameters: executable: scipampl type: scipampl _args: () options: {}

The Eclipse version is "Oxygen.1 (4.7.1)" and the PyDev version is "6.0.0".

The python, pyomo, and solvers versions are as follows:

~$ python
Python 3.6.2 |Anaconda custom (64-bit)| (default, Sep 30 2017, 18:42:57) [GCC 7.2.0] on linux

~$ pyomo --version
Pyomo 5.2 (CPython 3.6.2 on Linux 4.10.0-35-generic)

~$ cbc
Welcome to the CBC MILP Solver 
Version: 2.9.9 
Build Date: Jul  6 2017

~$ glpsol
GLPSOL: GLPK LP/MIP Solver, v4.63

~$ ipopt
No stub!
usage: ipopt [options] stub [-AMPL] [<assignment> ...]

~$ scip 
SCIP version 4.0.1 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 3.0.1] [GitHash: 8a04b84]
Copyright (C) 2002-2017 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)
External codes: 
SoPlex 3.0.1         Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash: 24cffa9]
CppAD 20160000.1     Algorithmic Differentiation of C++ algorithms developed by B. Bell (www.coin-or.org/CppAD)
ZLIB 1.2.8           General purpose compression library by J. Gailly and M. Adler (zlib.net)
GMP 6.1.0            GNU Multiple Precision Arithmetic Library developed by T. Granlund (gmplib.org)
ZIMPL 3.3.4          Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)
Ipopt 3.12.8         Interior Point Optimizer developed by A. Waechter et.al. (www.coin-or.org/Ipopt)
user parameter file <scip.set> not found - using default parameters
SCIP> ^C

I installed the CBC, GLPK and IPOT packages as follows:

conda install -c conda-forge coincbc
conda install -c conda-forge glpk
conda install -c conda-forge ipopt

I installed the latest SCIPOPTSUITE version "4.0.1" with the Linux-Debian package "SCIPOptSuite-4.0.1-Linux.deb"

I also installed AMPL-MP SCIPOPTLIB and PYSCIPOPT as follows:

conda install -c conda-forge ampl-mp
conda install -c leethargo scipoptlib
conda install -c leethargo pyscipopt
sasap
  • 33
  • 1
  • 4

1 Answers1

3

EDIT: follow these instructions: http://zverovich.net/2012/08/07/using-scip-with-ampl.html

Several things that might help:

  • the conda package at leethargo is not the official conda package (because there is none)
  • try installing and running PySCIPOpt via pip first
  • PySCIPOpt is not interfaced to PYOMO, so you most likely need to rely on AMPL for the SCIP support
  • does PYOMO even support SCIP? I couldn't figure that out from their documentation

Ah, look what I found after googling "pyomo scip":

So, PYOMO only supports SCIP through the AMPL interface (ASL).

mattmilten
  • 6,242
  • 3
  • 35
  • 65
  • So, does it mean that I need full access to AMPL (I dont have a license for that) or is there any other way to fix the probleem? I liked SCIP for being fast and free for academia but had to use MATLAB for it. I then started with pyomo and woulde be great if I could keep using scip... – sasap Oct 05 '17 at 16:52
  • 1
    No you don't need AMPL. Follow these instructions to generate the necessary `scipampl` executable for PYOMO. It looks a bit obscure but I just tried it with the latest SCIP 4.0.1 and it still works. – mattmilten Oct 05 '17 at 17:07
  • I cant see the instructions, is it missing a link? – sasap Oct 06 '17 at 06:52
  • 1
    I'm sorry, I forgot to paste the link. Here it is: http://zverovich.net/2012/08/07/using-scip-with-ampl.html – mattmilten Oct 06 '17 at 07:53
  • It is totally possible to setup SCIP with pyomo as long as the AMPL interface is properly installed. See https://stackoverflow.com/a/56886542/7382307, https://stackoverflow.com/a/66736905/7382307 and https://stackoverflow.com/a/69549587/7382307 – billjoie Oct 13 '21 at 04:03