add_rsymphony_solver: Add a SYMPHONY solver with 'Rsymphony'

View source: R/add_rsymphony_solver.R

add_rsymphony_solverR Documentation

Add a SYMPHONY solver with Rsymphony


Specify that the SYMPHONY software should be used to solve a project prioritization problem() using the Rsymphony package. This function can also be used to customize the behavior of the solver. It requires the Rsymphony package.


  gap = 0,
  time_limit = .Machine$integer.max,
  first_feasible = FALSE,
  verbose = TRUE



ProjectProblem object.


numeric gap to optimality. This gap is relative and expresses the acceptable deviance from the optimal objective. For example, a value of 0.01 will result in the solver stopping when it has found a solution within 1% of optimality. Additionally, a value of 0 will result in the solver stopping when it has found an optimal solution. The default value is 0.1 (i.e. 10% from optimality).


numeric time limit in seconds to run the optimizer. The solver will return the current best solution when this time limit is exceeded.


logical should the first feasible solution be be returned? If first_feasible is set to TRUE, the solver will return the first solution it encounters that meets all the constraints, regardless of solution quality. Note that the first feasible solution is not an arbitrary solution, rather it is derived from the relaxed solution, and is therefore often reasonably close to optimality. Defaults to FALSE.


logical should information be printed while solving optimization problems?


SYMPHONY is an open-source integer programming solver that is part of the Computational Infrastructure for Operations Research (COIN-OR) project, an initiative to promote development of open-source tools for operations research (a field that includes linear programming). The Rsymphony package provides an interface to COIN-OR and is available on CRAN. This solver uses the Rsymphony package to solve problems.


ProjectProblem object with the solver added to it.

See Also



## Not run: 
# load data
data(sim_projects, sim_features, sim_actions)

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

# print problem

# solve problem
s <- solve(p)

# print solution

# plot solution
plot(p, s)

## End(Not run)

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