Awesome
Cbc.jl
Cbc.jl is a wrapper for the COIN-OR Branch and Cut (Cbc) solver.
The wrapper has two components:
- a thin wrapper around the complete C API
- an interface to MathOptInterface
Affiliation
This wrapper is maintained by the JuMP community and is not a COIN-OR project.
Getting help
If you need help, please ask a question on the JuMP community forum.
If you have a reproducible example of a bug, please open a GitHub issue.
License
Cbc.jl
is licensed under the MIT License.
The underlying solver, coin-or/Cbc, is licensed under the Eclipse public license.
Installation
Install Cbc using Pkg.add
:
import Pkg
Pkg.add("Cbc")
In addition to installing the Cbc.jl package, this will also download and install the Cbc binaries. You do not need to install Cbc separately.
To use a custom binary, read the Custom solver binaries section of the JuMP documentation.
Use with JuMP
To use Cbc with JuMP, use Cbc.Optimizer
:
using JuMP, Cbc
model = Model(Cbc.Optimizer)
set_attribute(model, "logLevel", 1)
MathOptInterface API
The COIN Branch-and-Cut (Cbc) 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}
inMOI.EqualTo{Float64}
MOI.ScalarAffineFunction{Float64}
inMOI.GreaterThan{Float64}
MOI.ScalarAffineFunction{Float64}
inMOI.Interval{Float64}
MOI.ScalarAffineFunction{Float64}
inMOI.LessThan{Float64}
MOI.VariableIndex
inMOI.EqualTo{Float64}
MOI.VariableIndex
inMOI.GreaterThan{Float64}
MOI.VariableIndex
inMOI.Integer
MOI.VariableIndex
inMOI.Interval{Float64}
MOI.VariableIndex
inMOI.LessThan{Float64}
MOI.VariableIndex
inMOI.ZeroOne
MOI.VectorOfVariables
inMOI.SOS1{Float64}
MOI.VectorOfVariables
inMOI.SOS2{Float64}
List of supported model attributes:
Cbc.Status
Cbc.SecondaryStatus
MOI.DualStatus
MOI.NodeCount
MOI.NumberOfVariables
MOI.ObjectiveBound
MOI.ObjectiveSense
MOI.ObjectiveValue
MOI.PrimalStatus
MOI.RelativeGap
MOI.ResultCount
MOI.SolveTimeSec
MOI.TerminationStatus
List of supported optimizer attributes:
Cbc.SetVariableNames
MOI.AbsoluteGapTolerance
MOI.NumberOfThreads
MOI.RawOptimizerAttribute
MOI.RelativeGapTolerance
MOI.Silent
MOI.SolverName
MOI.SolverVersion
MOI.TimeLimitSec
List of supported variable attributes:
List of supported constraint attributes:
Options
Options are, unfortunately, not well documented.
The following options are likely to be the most useful:
Parameter | Example | Explanation |
---|---|---|
seconds | 60.0 | Solution timeout limit |
logLevel | 2 | Set to 0 to disable solution output |
maxSolutions | 1 | Terminate after this many feasible solutions have been found |
maxNodes | 1 | Terminate after this many branch-and-bound nodes have been evaluated |
allowableGap | 0.05 | Terminate after optimality gap is less than this value (on an absolute scale) |
ratioGap | 0.05 | Terminate after optimality gap is smaller than this relative fraction |
threads | 1 | Set the number of threads to use for parallel branch & bound |
The complete list of parameters can be found by running the cbc
executable and
typing ?
at the prompt.
Start the cbc
executable from Julia as follows:
using Cbc_jll
Cbc_jll.cbc() do exe
run(`$(exe)`)
end