Specify that the Gurobi software
(Gurobi Optimization LLC 2021) 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 gurobi package to be installed
(see below for installation instructions).
add_gurobi_solver( x, gap = 0.1, time_limit = .Machine$integer.max, presolve = 2, threads = 1, first_feasible = FALSE, numeric_focus = FALSE, verbose = TRUE )
x 


gap 

time_limit 

presolve 

threads 

first_feasible 

numeric_focus 

verbose 

Object (i.e. ConservationProblem
) with the solver
added to it.
Gurobi is a stateoftheart commercial optimization software with an R package interface. It is by far the fastest of the solvers available for generating prioritizations, however, it is not freely available. That said, licenses are available to academics at no cost. The gurobi package is distributed with the Gurobi software suite. This solver uses the gurobi package to solve problems. For information on the performance of different solvers, please see Schuster et al. (2020) for benchmarks comparing the run time and solution quality of different solvers when applied to different sized datasets.
Please see the Gurobi Installation Guide vignette for details on installing the Gurobi software and the gurobi package. You can access this vignette online or using the following code:
vignette("gurobi_installation", package = "prioritizr")
Gurobi Optimization LLC (2021) Gurobi Optimizer Reference Manual. http://www.gurobi.com.
Schuster R, Hanson JO, StrimasMackey M, and Bennett JR (2020). Exact integer linear programming solvers outperform simulated annealing for solving conservation planning problems. PeerJ, 8: e9258.
# \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_gurobi_solver(gap = 0.1, verbose = FALSE) # generate solution %>% s < solve(p) # plot solution plot(s, main = "solution", axes = FALSE, box = FALSE)# }