add_default_solver: Add a default solver

View source: R/add_default_solver.R

add_default_solverR Documentation

Add a default solver

Description

Identify the best solver currently installed on the system and specify that it should be used to solve a project prioritization problem().

Usage

add_default_solver(x, ...)

Arguments

x

ProjectProblem object.

...

arguments passed to the solver.

Details

Ranked from best to worst, the solvers that can be used are: gurobi, (add_gurobi_solver()), Rsymphony (add_rsymphony_solver()), lpsymphony (add_lpsymphony_solver()), and lpSolveAPI (add_lpsolveapi_solver()). This function does not consider solvers that generate solutions using heuristic algorithms (i.e. add_heuristic_solver()) or random processes (i.e. add_random_solver()) because they cannot provide any guarantees on solution quality.

See Also

solvers.

Examples

# load data
data(sim_projects, sim_features, sim_actions)

# build problem with default solver
p <- problem(sim_projects, sim_actions, sim_features,
             "name", "success", "name", "cost", "name") %>%
     add_max_richness_objective(budget = 200) %>%
     add_binary_decisions() %>%
     add_default_solver()

# print problem
print(p)

## Not run: 
# solve problem
s <- solve(p)

# print solution
print(s)

# plot solution
plot(p, s)

## End(Not run)

oppr documentation built on Sept. 8, 2022, 5:07 p.m.