View source: R/add_highs_solver.R
add_highs_solver | R Documentation |
Specify that the HiGHS software should be used to solve a conservation planning problem (Huangfu and Hall 2018). This function can also be used to customize the behavior of the solver. It requires the highs package to be installed.
add_highs_solver(
x,
gap = 0.1,
time_limit = .Machine$integer.max,
presolve = TRUE,
threads = 1,
verbose = TRUE
)
x |
|
gap |
|
time_limit |
|
presolve |
|
threads |
|
verbose |
|
HiGHS is an open source optimization software.
Although this solver can have comparable performance to the CBC solver
(i.e., add_cbc_solver()
) for particular problems and is generally faster
than the SYMPHONY based solvers (i.e., add_rsymphony_solver()
,
add_lpsymphony_solver()
), it can sometimes take much longer than the
CBC solver for particular problems. This solver is recommended if
the add_gurobi_solver()
, add_cplex_solver()
, add_cbc_solver()
cannot
be used.
An updated problem()
object with the solver added to it.
Huangfu Q and Hall JAJ (2018). Parallelizing the dual revised simplex method. Mathematical Programming Computation, 10: 119-142.
Other solvers:
add_cbc_solver()
,
add_cplex_solver()
,
add_default_solver()
,
add_gurobi_solver()
,
add_lsymphony_solver
,
add_rsymphony_solver()
## Not run:
# load data
sim_pu_raster <- get_sim_pu_raster()
sim_features <- get_sim_features()
# create problem
p <-
problem(sim_pu_raster, sim_features) %>%
add_min_set_objective() %>%
add_relative_targets(0.1) %>%
add_binary_decisions() %>%
add_highs_solver(gap = 0, verbose = FALSE)
# generate solution
s <- solve(p)
# plot solution
plot(s, main = "solution", axes = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.