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
This wrapper is maintained by the JuMP community and is not a COIN-OR project.
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.
Cbc.jl is licensed under the MIT License.
The underlying solver, coin-or/Cbc, is licensed under the Eclipse public license.
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.
To use Cbc with JuMP, use Cbc.Optimizer:
using JuMP, Cbc
model = Model(Cbc.Optimizer)
set_attribute(model, "logLevel", 1)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.VariableIndexinMOI.EqualTo{Float64}MOI.VariableIndexinMOI.GreaterThan{Float64}MOI.VariableIndexinMOI.IntegerMOI.VariableIndexinMOI.Interval{Float64}MOI.VariableIndexinMOI.LessThan{Float64}MOI.VariableIndexinMOI.ZeroOneMOI.VectorOfVariablesinMOI.SOS1{Float64}MOI.VectorOfVariablesinMOI.SOS2{Float64}
List of supported model attributes:
Cbc.StatusCbc.SecondaryStatusMOI.DualStatusMOI.NodeCountMOI.NumberOfVariablesMOI.ObjectiveBoundMOI.ObjectiveSenseMOI.ObjectiveValueMOI.PrimalStatusMOI.RelativeGapMOI.ResultCountMOI.SolveTimeSecMOI.TerminationStatus
List of supported optimizer attributes:
Cbc.SetVariableNamesMOI.AbsoluteGapToleranceMOI.NumberOfThreadsMOI.RawOptimizerAttributeMOI.RelativeGapToleranceMOI.SilentMOI.SolverNameMOI.SolverVersionMOI.TimeLimitSec
List of supported variable attributes:
List of supported constraint attributes:
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