add_lpsolveapi_solver {oppr} | R Documentation |
Add a lp_solve solver with lpSolveAPI
Description
Specify that the lp_solve software should be used to solve a
project prioritization problem()
using the lpSolveAPI
package. This function can also be used to customize the behavior of the
solver. It requires the lpSolveAPI package.
Usage
add_lpsolveapi_solver(x, gap = 0, presolve = FALSE, verbose = TRUE)
Arguments
x |
ProjectProblem object. |
gap |
|
presolve |
|
verbose |
|
Details
lp_solve is an
open-source integer programming solver.
Although this solver is the slowest currently supported solver,
it is also the only exact algorithm solver that can be installed on all
operating systems without any manual installation steps. This solver is
provided so that
users can try solving small project prioritization problems, without
needing to install additional software. When solve moderate or large
project prioritization problems, consider using
add_gurobi_solver()
.
Value
ProjectProblem object with the solver added to it.
See Also
Examples
# load data
data(sim_projects, sim_features, sim_actions)
# build problem with lpSolveAPI solver
p <- problem(sim_projects, sim_actions, sim_features,
"name", "success", "name", "cost", "name") %>%
add_max_richness_objective(budget = 200) %>%
add_binary_decisions() %>%
add_lpsolveapi_solver()
# print problem
print(p)
# solve problem
s <- solve(p)
# print solution
print(s)
# plot solution
plot(p, s)