From f414406948d2bad95265564168159f29a9790f98 Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 31 Mar 2023 15:28:43 +1300 Subject: [PATCH 1/6] Update README --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c514051..b4814dc 100644 --- a/README.md +++ b/README.md @@ -5,21 +5,30 @@ [![Build Status](https://github.com/jump-dev/Cbc.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/Cbc.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/jump-dev/Cbc.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jump-dev/Cbc.jl) -`Cbc.jl` is a wrapper for the [COIN-OR Branch and Cut (Cbc)](https://projects.coin-or.org/Cbc) +[Cbc.jl](https://github.com/jump-dev/Cbc.jl) is a wrapper for the [COIN-OR Branch and Cut (Cbc)](https://projects.coin-or.org/Cbc) solver. The wrapper has two components: * a thin wrapper around the complete C API - * an interface to [MathOptInterface](https://github.com/jump-dev/MathOptInterface) + * an interface to [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl) -*Note: This wrapper is maintained by the JuMP community and is not a COIN-OR -project.* +## Affiliation + +This wrapper is maintained by the JuMP community and is not a COIN-OR project. + +## License + +`Cbc.jl` is licensed under the [MIT License](https://github.com/jump-dev/Cbc.jl/blob/master/LICENSE.md). + +The underlying solver, [coin-or/Cbc](https://github.com/coin-or/Cbc), is +licensed under the [Eclipse public license](https://github.com/coin-or/Cbc/blob/master/LICENSE). ## Installation Install Cbc.jl using `Pkg.add`: ```julia -import Pkg; Pkg.add("Cbc") +import Pkg +Pkg.add("Cbc") ``` In addition to installing the Cbc.jl package, this will also download and From dd98d35c0328760488ddf8b6ca0cd2b0c9fea2e3 Mon Sep 17 00:00:00 2001 From: odow Date: Sat, 1 Apr 2023 12:11:24 +1300 Subject: [PATCH 2/6] Add supported problem types --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index b4814dc..976f2cd 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,27 @@ model = Model(Cbc.Optimizer) set_optimizer_attribute(model, "logLevel", 1) ``` +## Supported problem types + +List of supported objective function types: + + * `MOI.ScalarAffineFunction{Float64}` + +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.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}` + ## Options Options are, unfortunately, not well documented. From 732f9aa3d8a08089eb88b20532008bb0e2160a03 Mon Sep 17 00:00:00 2001 From: odow Date: Sat, 1 Apr 2023 12:49:12 +1300 Subject: [PATCH 3/6] Update --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 976f2cd..d9475a5 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,10 @@ set_optimizer_attribute(model, "logLevel", 1) ## Supported problem types -List of supported objective function types: +List of supported model attributes: - * `MOI.ScalarAffineFunction{Float64}` + * `MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}` + * `MOI.ObjectiveSense` List of supported constraint types: From cbf67272e3157c93b3d1cb8d9678076144a1d4e2 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 3 Apr 2023 14:35:38 +1200 Subject: [PATCH 4/6] Update --- README.md | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d9475a5..a0b5da3 100644 --- a/README.md +++ b/README.md @@ -43,30 +43,35 @@ To use Cbc with [JuMP](https://github.com/jump-dev/JuMP.jl), use `Cbc.Optimizer` ```julia using JuMP, Cbc model = Model(Cbc.Optimizer) -set_optimizer_attribute(model, "logLevel", 1) +set_attribute(model, "logLevel", 1) ``` -## Supported problem types +## MathOptInterface API -List of supported model attributes: +The COIN Branch-and-Cut (Cbc) optimizer supports the following constraints and attributes. + +List of supported objective functions: - * `MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}` - * `MOI.ObjectiveSense` + * [`MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}`](@ref) 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.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}` + * [`MOI.ScalarAffineFunction{Float64}`](@ref) in [`MOI.EqualTo{Float64}`](@ref) + * [`MOI.ScalarAffineFunction{Float64}`](@ref) in [`MOI.GreaterThan{Float64}`](@ref) + * [`MOI.ScalarAffineFunction{Float64}`](@ref) in [`MOI.Interval{Float64}`](@ref) + * [`MOI.ScalarAffineFunction{Float64}`](@ref) in [`MOI.LessThan{Float64}`](@ref) + * [`MOI.VariableIndex`](@ref) in [`MOI.EqualTo{Float64}`](@ref) + * [`MOI.VariableIndex`](@ref) in [`MOI.GreaterThan{Float64}`](@ref) + * [`MOI.VariableIndex`](@ref) in [`MOI.Integer`](@ref) + * [`MOI.VariableIndex`](@ref) in [`MOI.Interval{Float64}`](@ref) + * [`MOI.VariableIndex`](@ref) in [`MOI.LessThan{Float64}`](@ref) + * [`MOI.VariableIndex`](@ref) in [`MOI.ZeroOne`](@ref) + * [`MOI.VectorOfVariables`](@ref) in [`MOI.SOS1{Float64}`](@ref) + * [`MOI.VectorOfVariables`](@ref) in [`MOI.SOS2{Float64}`](@ref) + +List of supported model attributes: + + * [`MOI.ObjectiveSense()`](@ref) ## Options From 1112a57ce7c79e130cacceccd207255121d6b657 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 3 Apr 2023 14:53:03 +1200 Subject: [PATCH 5/6] Update --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a0b5da3..fe7d337 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,10 @@ List of supported objective functions: * [`MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}`](@ref) +List of supported variable types: + + * [`MOI.Reals`](@ref) + List of supported constraint types: * [`MOI.ScalarAffineFunction{Float64}`](@ref) in [`MOI.EqualTo{Float64}`](@ref) From 424abfe97dfc74e6b59426aee1f5a96b5b725ee2 Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 4 Apr 2023 13:28:06 +1200 Subject: [PATCH 6/6] Update --- README.md | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index fe7d337..5bd2c1a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ solver. The wrapper has two components: + * a thin wrapper around the complete C API * an interface to [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl) @@ -25,21 +26,21 @@ licensed under the [Eclipse public license](https://github.com/coin-or/Cbc/blob/ ## Installation -Install Cbc.jl using `Pkg.add`: +Install Cbc using `Pkg.add`: ```julia 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.) +install the Cbc binaries. You do not need to install Cbc separately. To use a custom binary, read the [Custom solver binaries](https://jump.dev/JuMP.jl/stable/developers/custom_solver_binaries/) section of the JuMP documentation. ## Use with JuMP -To use Cbc with [JuMP](https://github.com/jump-dev/JuMP.jl), use `Cbc.Optimizer`: +To use Cbc with JuMP, use `Cbc.Optimizer`: ```julia using JuMP, Cbc model = Model(Cbc.Optimizer) @@ -83,38 +84,20 @@ Options are, unfortunately, not well documented. The following options are likely to be the most useful: -* `seconds` -- Solution timeout limit. - - For example, `set_optimizer_attribute(model, "seconds", 60.0)`. - -* `logLevel` -- Set to 1 to enable solution output. - - For example, `set_optimizer_attribute(model, "logLevel", 1)`. - -* `maxSolutions` -- Terminate after this many feasible solutions have been found. - - For example, `set_optimizer_attribute(model, "maxSolutions", 1)`. - -* `maxNodes` -- Terminate after this many branch-and-bound nodes have been evaluated. - - For example, `set_optimizer_attribute(model, "maxNodes", 1)`. - -* `allowableGap` -- Terminate after optimality gap is less than this value (on an absolute scale). - - For example, `set_optimizer_attribute(model, "allowableGap", 0.05)`. - -* `ratioGap` -- Terminate after optimality gap is smaller than this relative fraction. - - For example, `set_optimizer_attribute(model, "ratioGap", 0.05)`. - -* `threads` -- Set the number of threads to use for parallel branch & bound. - - For example, `set_optimizer_attribute(model, "threads", 2)`. +| 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. -You can start the `cbc` executable from Julia as follows: +Start the `cbc` executable from Julia as follows: ```julia using Cbc_jll Cbc_jll.cbc() do exe