Specify that the CBC
(COINOR branch and cut) software (Forrest &
LougeeHeimer 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 

Object (i.e. ConservationProblem
) with the solver
added to it.
CBC is an
opensource mixed integer programming solver that is part of the
Computational Infrastructure for Operations Research (COINOR) 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 opensource
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.
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 LougeeHeimer R (2005) CBC User Guide. In Emerging theory, Methods, and Applications (pp. 257277). INFORMS, Catonsville, MD. doi: 10.1287/educ.1053.0020 .
# \dontrun{ # 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)# }