2 years ago

#68690

test-img

Sai Bharadwaj Badda

Not running: Error in ROI_solve - no solver found for this signature. How to solve this equation

One F_constraint and objective function is actually a simple linear one

library(ROI)
cbm_total = 100
# f <- function(x) { return(x[1]+x[2]+x[3]) }
  
prob <- OP(objective = L_objective(c(1,1,1,0,0,0)),
           constraints = F_constraint(F = function(x) x[1]*x[4] + x[2]*x[5] + x[3]*x[6],
                                      dir = ">=",
                                      rhs = cbm_total),
           bounds = V_bound(lb = c(0,0,0,0,28,56), ub = c(1,1,1,27,55,65)),
           types = c("B","B","B","I","I","I"),
           maximum = FALSE)
ROI_applicable_solvers(prob)

prob_sol <- ROI_solve(prob, solver = "glpk", start = c(0,0,0,27,55,65))
solution(prob_sol)

r

solver

0 Answers

Your Answer

Accepted video resources