add_default_solver: Add a default solver

Description Usage Arguments Details See Also Examples

View source: R/add_default_solver.R

Description

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

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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 May 12, 2021, 1:07 a.m.