New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_rsymphony_solver gap > 1 error #44

Closed
ricschuster opened this Issue Nov 9, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@ricschuster
Copy link
Member

ricschuster commented Nov 9, 2017

When trying to use a gap > 1 add_rsymphony_solver throws an error, but according to the help page users should be allowed to specify gaps > 0 for this solver:
But for other solvers (e.g. Rsymhpony), this gap is absolute and expresses the acceptable deviance from the optimal objective. For example, solving a minimum set objective problem with a gap of 5 will cause the solver to terminate when the cost of the solution is within 5 cost units from the optimal solution.

library(prioritizr)
data(sim_pu_polygons)
data(sim_features)

p1 <- problem(sim_pu_polygons, features = sim_features,
cost_column = "cost") %>%
add_min_set_objective() %>%
add_relative_targets(0.2) %>%
add_binary_decisions() %>%
add_rsymphony_solver(gap = 2)

# Error: isTRUE(x = gap <= 1) is not TRUE

@ricschuster ricschuster added the bug label Nov 9, 2017

@mstrimas

This comment has been minimized.

Copy link
Contributor

mstrimas commented Nov 9, 2017

Also, the following:

a gap of 5 will cause the solver to terminate when the cost of the solution is within 5 cost units from the optimal solution.

Would more correctly be expressed with "cost" replaced by "objective function", which reduces to cost in the simple case of a minimum set cover problem with no boundary term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment