Add a CBC solver
Specify that the CBC
(COIN-OR branch and cut) software (Forrest &
Lougee-Heimer 2005) should be used to solve a conservation planning
problem()
.
This function can also be used to customize the behavior of the solver.
It requires the rcbc package to be installed
(only available on GitHub,
see below for installation instructions).
add_cbc_solver( x, gap = 0.1, time_limit = .Machine$integer.max, presolve = TRUE, threads = 1, first_feasible = FALSE, verbose = TRUE )
x |
|
gap |
|
time_limit |
|
presolve |
|
threads |
|
first_feasible |
|
verbose |
|
CBC is an
open-source mixed integer programming solver that is part of the
Computational Infrastructure for Operations Research (COIN-OR) project.
Although formal benchmarks examining the performance of this solver for
conservation planning problems have yet to be completed, preliminary
analyses suggest that it performs much faster than the other open-source
solvers (i.e. add_rsymphony_solver()
, add_rsymphony_solver()
), and
so we recommend using this solver if the Gurobi and IBM CPLEX solvers
are unavailable.
Object (i.e. ConservationProblem
) with the solver
added to it.
The rcbc package is required to use this solver. Since the rcbc package is not available on the the Comprehensive R Archive Network (CRAN), it must be installed from its GitHub repository. To install the rcbc package, please use the following code:
if (!require(remotes)) install.packages("remotes") remotes::install_github("dirkschumacher/rcbc")
Note that you may also need to install several dependencies – such as the Rtools software or system libraries – prior to installing the rcbc package. For further details on installing this package, please consult official installation instructions for the package.
Forrest J and Lougee-Heimer R (2005) CBC User Guide. In Emerging theory, Methods, and Applications (pp. 257–277). INFORMS, Catonsville, MD. doi: 10.1287/educ.1053.0020.
## Not run: # load data data(sim_pu_raster, sim_features) # create problem p <- problem(sim_pu_raster, sim_features) %>% add_min_set_objective() %>% add_relative_targets(0.1) %>% add_binary_decisions() %>% add_cbc_solver(gap = 0.1, verbose = FALSE) # generate solution %>% s <- solve(p) # plot solution plot(s, main = "solution", axes = FALSE, box = FALSE) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.