SCIP.jl is a Julia interface to the SCIP solver.
This wrapper is maintained by the SCIP project with the help of the JuMP community.
SCIP.jl
is licensed under the MIT License.
The underlying solver, scipopt/scip, is licensed under the Apache 2.0 license.
SCIP cannot be installed automatically on Windows. See the "Custom installation" instructions below.
Install SCIP using Pkg.add
:
julia> import Pkg
julia> Pkg.add("SCIP")
On platforms other than Windows, in addition to installing the SCIP.jl package, this will also download and install the SCIP binaries. You do not need to install SCIP separately.
If you use Windows, or you want a custom SCIP installation, you must manually install the SCIP binaries.
Binaries are available for download at https://www.scipopt.org/#download.
Once the binaries are installed, set the SCIPOPTDIR
environment variable to
temporarily point to the installation path (that is, depending on your operating system,
$SCIPOPTDIR/lib/libscip.so
, $SCIPOPTDIR/lib/libscip.dylib
, or
$SCIPOPTDIR/bin/libscip.dll
must exist). Then, install SCIP.jl
using Pkg.add
and Pkg.build
from the Julia command line:
julia> ENV["SCIPOPTDIR"] = raw"C:\Program Files\SCIPOptSuite 9.1.1" # for Windows
julia> import Pkg
julia> Pkg.add("SCIP")
julia> Pkg.build("SCIP")
Use SCIP with JuMP as follows:
using JuMP, SCIP
model = Model(SCIP.Optimizer)
set_attribute(model, "display/verblevel", 0)
set_attribute(model, "limits/gap", 0.05)
See the SCIP documentation for a list of supported options.
The SCIP optimizer supports the following constraints and attributes.
List of supported objective functions:
List of supported variable types:
List of supported constraint types:
MOI.ScalarAffineFunction{Float64}
in MOI.EqualTo{Float64}
MOI.ScalarAffineFunction{Float64}
in MOI.GreaterThan{Float64}
MOI.ScalarAffineFunction{Float64}
in MOI.Interval{Float64}
MOI.ScalarAffineFunction{Float64}
in MOI.LessThan{Float64}
MOI.ScalarQuadraticFunction{Float64}
in MOI.EqualTo{Float64}
MOI.ScalarQuadraticFunction{Float64}
in MOI.GreaterThan{Float64}
MOI.ScalarQuadraticFunction{Float64}
in MOI.Interval{Float64}
MOI.ScalarQuadraticFunction{Float64}
in MOI.LessThan{Float64}
MOI.VariableIndex
in MOI.EqualTo{Float64}
MOI.VariableIndex
in MOI.GreaterThan{Float64}
MOI.VariableIndex
in MOI.Integer
MOI.VariableIndex
in MOI.Interval{Float64}
MOI.VariableIndex
in MOI.LessThan{Float64}
MOI.VariableIndex
in MOI.ZeroOne
MOI.VectorOfVariables
in MOI.SOS1{Float64}
MOI.VectorOfVariables
in MOI.SOS2{Float64}
List of supported model attributes:
All of the public API methods are wrapped and available within the SCIP
package. This includes the scip_*.h
and pub_*.h
headers that are collected
in scip.h
, as well as all default constraint handlers (cons_*.h
.)
The wrapped functions do not transform any data structures and work on the raw
pointers (for example, SCIP*
in C, Ptr{SCIP_}
in Julia). Convenience wrapper
functions based on Julia types are added as needed.
Programming with SCIP requires dealing with variable and constraint objects that use reference counting for memory management.
The SCIP.Optimizer
wrapper type collects lists of SCIP_VAR*
and SCIP_CONS*
under the hood, and it releases all references when it is garbage collected
itself (via finalize
).
When adding a variable (add_variable
) or a constraint (add_linear_constraint
),
an integer index is returned. This index can be used to retrieve the SCIP_VAR*
or SCIP_CONS*
pointer via get_var
and get_cons
respectively.
Supported operators in nonlinear expressions are as follows:
+
-
*
/
^
sqrt
exp
log
abs
cos
sin