-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support The R Optimization Infrastructure (ROI) #16
Comments
Hi, Thanks for getting in touch about ROI! Yeah, I think it would be great if we could integrate ROI into prioritizr so we could get access to lots of different solvers. At the moment, we're using an Is there an equivalent class in ROI that we could convert our Cheers, Jeff |
Hey Jeff, there is a class called library(ROI)
library(ROI.plugin.glpk)
# max: x1 + x2 + x3 + x4
# s.t. x1 + x2 + x3 + x4 <= 4
# 0 <= x1 <= 0
# 0 <= x2 <= 1
# 0 <= x3 <= 1
# 0 <= x4 <= 0
bounds <- ROI::V_bound( # <- sparse bound encoding
ui = c(1, 2, 3, 4),
ub = c(0, 1, 1, 0)
)
constraints <- ROI::L_constraint(L = matrix(c(1, 1, 1, 1), ncol = 4) # <- can be sparse,
dir = "<=",
rhs = 4)
op <- ROI::OP(c(1, 1, 1, 1), # <- can be sparse
constraints,
bounds = bounds,
types = c("I", "I", "I", "I"),
max = TRUE)
result <- ROI::ROI_solve(op, "glpk") # here you can use different solvers
result$solution
Florian Schwendinger is also working on a Gurobi plugin: https://r-forge.r-project.org/scm/viewvc.php/pkg/ROI.plugin.gurobi/?root=roi |
Thank you very much for the demo and the heads up on Gurobi support. It looks like it would be pretty straight forward to implement this. I'd really like to implement this. I'm a bit busy at the moment though, so it might take a while before I get to it. |
I'm disappointed that I never got around to implementing ROI. I just wanted to say it's still on the cards. Do you know if there are any plans to make the gurobi plugin available on CRAN? |
If you support ROI as a solver interface, users can use a number of different solvers out of the box. Currently plugins for the ILP solvers GLPK, symphony, lpsolve and cplex are on CRAN.
I am also currently working on CBC as a ROI plugin.
There are also two ROI plugins for Gurobi on Github.
The text was updated successfully, but these errors were encountered: