Sys.setenv(ROI_LOAD_PLUGINS = "FALSE")
library(ROI)
library(ROI.plugin.glpk)
library(ROI.plugin.qpoases)
library(ROI.plugin.ecos)
library(ROI.plugin.scs)
library(ROI.plugin.alabama)
library(ROI.plugin.lpsolve)
library(ROI.plugin.gurobi)
str(OP)
## function (objective, constraints, types, bounds, maximum = FALSE)
str(L_objective)
## function (L, names = NULL)
\[1 x + 2 y + 3 z\]
L_objective(c(1, 2, 3), c("x", "y", "z")) lo <-
str(Q_objective)
## function (Q, L = NULL, names = NULL)
\[\frac{1}{2} (x_1^2 + x_2^2 + x_3^2) + 1 x_1 + 2x_2 + 3x_3\]
Q_objective(diag(3), c(1, 2, 3), c("x_1", "x_2", "x_3")) qo <-
str(F_objective)
## function (F, n, G = NULL, H = NULL, names = NULL)
\[x_1^2 + x_2^2\]
F_objective(F = function(x) sum(x^2), n = 2,
fo <-G = function(x) 2*x, names = c("x_1", "x_2"))
str(L_constraint)
## function (L, dir, rhs, names = NULL)
\[ \nonumber \begin{array}{rrrrrrr} 3 x & + & 4 y & + & 1 z & \leq & 90 \\ 1 x & + & 0 y & + & 2 z & \geq & 5 \\ 1 x & + & 1 y & + & 0 z & = & 2 \end{array} \]
L_constraint(L = rbind(c(3, 4, 1), c(1, 0, 2), c(1, 1, 0)),
lc <-dir = c("<=", ">=", "=="), rhs = c(90, 5, 2),
names = c("x", "y", "z"))
str(Q_constraint)
## function (Q, L, dir, rhs, names = NULL)
\[\frac{1}{2} (x^2 + y^2) + 1x + 2y \leq 3\]
Q_constraint(Q = diag(2), L = 1:2, dir = "<=",
qc1 <-rhs = 3, names = c("x", "y"))
\[ \begin{array} x^2 + y^2 + 3x + 1y & \leq & 3 \nonumber \\ x + y & \leq & 4 \nonumber \\ \frac{1}{2} (3x^2 + 3y^2 + 2xy) + 2x + 5y & \leq & 9 \nonumber \end{array} \]
Q_constraint(Q = list(diag(2, 2), NULL, matrix(c(3, 1, 1, 3), 2)),
qc2 <-L = rbind(c(3, 1), c(1, 1), c(2, 5)),
dir = c("<=", "<=", "<="),
rhs = c(3, 4, 9), names = c("x", "y"))
str(F_constraint)
## function (F, dir, rhs, J = NULL, names = NULL)
\[ \begin{array} x^2 & \leq & 2 \nonumber \\ y^2 & \leq & 4 \nonumber \end{array} \]
F_constraint(F = function(x) x^2, dir = c("<=", "<="), rhs = c(2, 4),
fc1 <-J = function(x) diag(x = 2, nrow = 2) * x,
names = c("x", "y"))
or equivalently
F_constraint(F = list(function(x) x[1]^2, function(x) x[2]^2),
fc2 <-dir = c("<=", "<="), rhs = c(2, 4),
J = list(function(x) rbind(c(2, 0) * x),
function(x) rbind(c(0, 2) * x)),
names = c("x", "y"))
## TODO: create an example
## x <- OP(L_objective(c(1, 1)), fc1, maximum=TRUE)
## x <- OP(L_objective(c(1, 1)), fc2, maximum=TRUE)
## solution(ROI_solve(x, start=c(0, 1), solver="alabama"))
By default the variable bounds are set to \(0 \leq x_i \leq \infty \text{ for all } i = 1, ..., n.\)
str(V_bound)
## function (li, ui, lb, ub, nobj, ld = 0, ud = Inf, names = NULL)
\[ -3 \leq x_1 \leq 3, \ -\infty \leq x_2 \leq 7, \ -9 \leq x_3 \leq \infty \]
V_bound(li = 1:3, ui = 1:3, lb = c(-3, -Inf, -9), ub = c(3, 7, Inf)) vb <-
\[ \begin{array}{rrrrr} \text{minimize} & 7 x_1 & + & 8 x_2 \\ \text{subject to} & 3 x_1 & + & 4 x_2 & = 9 \\ & 2 x_1 & + & 1 x_2 & \geq 3 \end{array} \]
\[ -100 \leq x_1, x_2, \leq 100\]
OP(objective = L_objective(c(7, 8), names=c("x", "y")),
lp <-constraints = L_constraint(L = rbind(c(3, 4), c(2, 1)),
dir = c("==", ">="), rhs = c(9, 3)),
bounds = V_bound(li = 1:2, ui = 1:2,
lb = c(-100, -100), ub = c(100, 100)))
ROI_applicable_solvers(lp)
## [1] "glpk" "qpoases" "ecos" "scs" "alabama" "lpsolve" "gurobi"
ROI_solve(lp, solver = "glpk")) (sol <-
## Optimal solution found.
## The objective value is: 1.860000e+01
solution(sol)
## x y
## 0.6 1.8
The solution can be accessed via the function , where
solution(sol)
## x y
## 0.6 1.8
solution(sol, type = "primal")
## x y
## 0.6 1.8
gives the primal solution,
solution(sol, type = "dual")
## [1] 0 0
the dual solution,
solution(sol, type = "msg")
## $optimum
## [1] 18.6
##
## $solution
## [1] 0.6 1.8
##
## $status
## [1] 5
##
## $solution_dual
## [1] 0 0
##
## $auxiliary
## $auxiliary$primal
## [1] 9 3
##
## $auxiliary$dual
## [1] 1.8 0.8
##
##
## $sensitivity_report
## [1] NA
the original message returned from the solver.
\[\begin{array}{rrrrrrr} \text{maximize} & 7 x_1 & + & 3 x_2 & + & 1 x_3 & \\ \text{subject to} & 6 x_1 & + & 4 x_2 & + & 5 x_3 & \leq 60 \\ & 8 x_1 & + & x_2 & + & 2 x_3 & \leq 80 \\ & 9 x_1 & + & 1 x_2 & + & 7 x_3 & \leq 70 \end{array} \] \[x_1, x_2, x_3 \geq 0\]
OP(objective = L_objective(c(7, 1, 3), c("x", "y", "z")),
lp <-constraints = L_constraint(L = rbind(c(6, 4, 5), c(8, 0, 2), c(9, 1, 7)),
dir = c("<=", "<=", "<="),
rhs = c(60, 80, 70)),
maximum = TRUE)
ROI_solve(lp)) (sol <-
## Optimal solution found.
## The objective value is: 5.533333e+01
solution(sol)
## x y z
## 7.333333 4.000000 0.000000
\[\begin{array}{rrrrrrr} \text{maximize} & 7 x_1 & + & 3 x_2 & + & 1 x_3 & \\ \text{subject to} & 6 x_1 & + & 4 x_2 & + & 5 x_3 & \leq 60 \\ & 8 x_1 & + & x_2 & + & 2 x_3 & \leq 80 \\ & 9 x_1 & + & 1 x_2 & + & 7 x_3 & \leq 70 \end{array} \] \[x_1, x_3 \in \mathbb{Z}_{\geq 0}\] \[x_2 \geq 0\]
rbind(c(6, 4, 5), c(8, 0, 2), c(9, 1, 7))
A <- OP(objective = L_objective(c(7, 1, 3), c("x", "y", "z")),
milp <-constraints = L_constraint(L = rbind(c(6, 4, 5), c(8, 0, 2), c(9, 1, 7)),
dir = c("<=", "<=", "<="),
rhs = c(60, 80, 70)),
types = c("I", "C", "I"),
maximum = TRUE)
ROI_solve(milp)) (sol <-
## Optimal solution found.
## The objective value is: 5.350000e+01
solution(sol)
## x y z
## 7.0 4.5 0.0
\[ \begin{array} \text{minimize} & & x_1 & + & 2x_2 & + & 3x_3 & + & \frac{1}{2} (x_1^2 + x_2^2 + x_3^2) \\ \text{subject to} & & x_1 & + & x_2 & & & \geq & 1 \nonumber \\ & & & & x_2 & + & x_3 & \geq & 2 \nonumber \\ & & x_1 & & & + & x_3 & \geq & 3 \nonumber \\ \end{array} \]
OP(Q_objective(diag(3), c(1, 2, 3), c("x", "y", "z")),
qp <-L_constraint(L = rbind(c(1, 1, 0), c(0, 1, 1), c(1, 0, 1)),
dir = c(">=", ">=", ">="), rhs = c(1, 2, 3)))
ROI_solve(qp, solver = "qpoases")) (sol <-
## Optimal solution found.
## The objective value is: 9.333333e+00
solution(sol)
## x y z
## 1.3333333 0.3333333 1.6666667
\[ \text{maximize} \ \ 90 x_1 + 110 x_2 + 160 x_3 - \frac{1}{2} (x_1^2 + x_2^2 + x_3^2) \] \[ \begin{array}{rrrrr} \text{subject to} & x_1^2 + x_2^2 + 4 x_3 & \leq & 4 & \\ & x_2^2 + x_3^2 + x_1 + x_3 & \leq & 3 & \\ & x_1^2 + x_3^2 + 2 x_1 x_3 & \leq & 2 & \\ & x_1, x_2, x_3 \geq 0 & & & \end{array} \]
OP(Q_objective(-diag(3), c(90, 110, 160), c("x", "y", "z")),
qcqp <-Q_constraint(Q = list(rbind(c(2, 0, 0), c(0, 2, 0), c(0, 0, 0)),
rbind(c(0, 0, 0), c(0, 2, 0), c(0, 0, 2)),
rbind(c(2, 0, 2), c(0, 0, 0), c(2, 0, 2))),
L = rbind(c(0, 0, 4), c(1, 0, 1), c(0, 0, 0)),
dir = rep("<=", 3), rhs = c(4, 3, 2)),
maximum = TRUE)
ROI_solve(qcqp, solver = "gurobi")) (sol <-
## Optimal solution found.
## The objective value is: 2.836219e+02
solution(sol)
## x y z
## 1.0606600 1.2086300 0.3535535
or equivalently
Q_constraint(Q = rbind(c(2, 0, 0), c(0, 2, 0), c(0, 0, 0)),
qc1 <-L = c(0, 0, 4), dir = "<=", rhs = 4)
Q_constraint(Q = rbind(c(0, 0, 0), c(0, 2, 0), c(0, 0, 2)),
qc2 <-L = c(1, 0, 1), dir = "<=", rhs = 3)
Q_constraint(Q = rbind(c(2, 0, 2), c(0, 0, 0), c(2, 0, 2)),
qc3 <-L = NULL, dir = "<=", rhs = 2)
OP(Q_objective(-diag(3), c(90, 110, 160), c("x", "y", "z")),
qcqp <-c(qc1, qc2, qc3), maximum = TRUE)
ROI_solve(qcqp, solver = "gurobi")) (sol <-
## Optimal solution found.
## The objective value is: 2.836219e+02
solution(sol)
## x y z
## 1.0606600 1.2086300 0.3535535
Check how tight the bounds are.
sapply(as.function(constraints(qcqp)), function(F) F(solution(sol)))
## [1] 4 3 2
\[\text{maximize } \ \ x + y\] \[\text{subject to } \ \ \sqrt{x^2 + y^2} \leq \sqrt{2}\] \[x, y \geq 0\]
OP(objective = L_objective(c(1, 1), names = c("x", "y")),
socp1 <-constraints = C_constraint(rbind(c(0, 0), c(-1, 0), c(0, -1)),
cones = K_soc(3),
rhs = c(sqrt(2), 0, 0)),
maximum = TRUE)
ROI_solve(socp1)) (sol <-
## Optimal solution found.
## The objective value is: 2.000000e+00
solution(sol)
## x y
## 1 1
\[ \begin{array}{rl} \text{minimize} & x_1 + x_2 - x_3 \\ \text{subject to} & x_1 \begin{pmatrix} 10 & 3 \\ 3 & 10 \end{pmatrix} + x_2 \begin{pmatrix} 6 & -4 \\ -4 & 10 \end{pmatrix} + x_3 \begin{pmatrix} 8 & 1 \\ 1 & 6 \end{pmatrix} \preceq \begin{pmatrix} 16 & -13 \\ -13 & 60 \end{pmatrix} \\ & x_1, x_2, x_3 \geq 0 \nonumber \end{array} \]
rbind(c(10, 3), c(3, 10))
A1 <- rbind(c(6, -4), c(-4, 10))
A2 <- rbind(c(8, 1), c(1, 6))
A3 <- rbind(c(16, -13), c(-13, 60))
A4 <- OP(objective = L_objective(c(1, 1, -1)),
psd <-constraints = C_constraint(L = vech(A1, A2, A3),
cones = K_psd(3),
rhs = vech(A4)))
ROI_solve(psd)) (sol <-
## Optimal solution found.
## The objective value is: -1.486487e+00
solution(sol)
## [1] -4.726329e-06 -1.245669e-06 1.486481e+00
as.matrix(solution(sol, "psd")[[1]])
## [,1] [,2]
## [1,] 0.11049988 0.031337383
## [2,] 0.03133738 0.008887173
The following example taken from the CVXOPT homepage.
\[ \begin{array}{rl} \text{minimize} & x_1 - x_2 + x_3 \\ \text{subject to} & x_1 \ \begin{pmatrix} -7 & -11 \\ -11 & 3 \end{pmatrix} + x_2 \ \begin{pmatrix} 7 & -18 \\ -18 & 8 \end{pmatrix} + x_3 \ \begin{pmatrix} -2 & -8 \\ -8 & 1 \end{pmatrix} \ \preceq \ \begin{pmatrix} 33 & -9 \\ -9 & 26 \end{pmatrix} \ \\ & x_1 \ \begin{pmatrix} -21 & -11 & 0 \\ -11 & 10 & 8 \\ 0 & 8 & 5 \end{pmatrix} + x_2 \ \begin{pmatrix} 0 & 10 & 16 \\ 10 & -10 & -10 \\ 16 & -10 & 3 \end{pmatrix} + x_3 \ \begin{pmatrix} -5 & 2 & -17 \\ 2 & -6 & 8 \\ -17 & 8 & 6 \end{pmatrix} \ \preceq \ \begin{pmatrix} 14 & 9 & 40 \\ 9 & 91 & 10 \\ 40 & 10 & 15 \end{pmatrix} \ \\ & x_1, x_2, x_3 \in \mathbb{R} \end{array} \nonumber \]
c(1, -1, 1)
obj <- matrix(c(-7, -11, -11, 3), 2)
A1 <- matrix(c( 7, -18, -18, 8), 2)
A2 <- matrix(c(-2, -8, -8, 1), 2)
A3 <- matrix(c(33, -9, -9, 26), 2)
A4 <- matrix(c(-21, -11, 0, -11, 10, 8, 0, 8, 5), 3)
B1 <- matrix(c( 0, 10, 16, 10, -10, -10, 16, -10, 3), 3)
B2 <- matrix(c( -5, 2, -17, 2, -6, 8, -17, 8, 6), 3)
B3 <- matrix(c( 14, 9, 40, 9, 91, 10, 40, 10,15), 3)
B4 <- c(vech(A4), vech(B4))
rhs <-
OP(objective = obj,
psd <-constraints = C_constraint(L = rbind(vech(A1, A2, A3), vech(B1, B2, B3)),
cones = K_psd(c(3, 6)), rhs = rhs),
bounds = V_bound(li=1:3, lb=rep(-Inf, 3)))
ROI_solve(psd, solver = "scs")) (sol <-
## Optimal solution found.
## The objective value is: -3.153545e+00
solution(sol)
## [1] -0.3677511 1.8983331 -0.8874605
lapply(solution(sol, type="psd"), as.matrix)
## $`5`
## [,1] [,2]
## [1,] 0.003961385 -0.004339145
## [2,] -0.004339145 0.004752929
##
## $`6`
## [,1] [,2] [,3]
## [1,] 0.05580307 -0.002410670 0.024214081
## [2,] -0.00241067 0.000104140 -0.001046039
## [3,] 0.02421408 -0.001046039 0.010506980
\[ \begin{array} \mathcal{K}_{exp} &=& \{(x, y, z) | y > 0, y e^{\frac{x}{y}} \leq z \} \cup \{(x, 0, z) | x \leq 0, z \geq 0\} \\ \mathcal{K}_{exp}^* &=& \{(u, v, w) | u < 0, -ue^\frac{v}{u} \leq ew\} \cup \{(0, v, w) | v \geq 0, w \geq 0\} \end{array} \]
\[ \begin{array} \text{maximize} & x + y + z \\ \text{subject to} & y e^{\frac{x}{y}} \leq z \\ & x \geq 0, y > 0, z \in [0, e] \end{array} \]
OP(objective = L_objective(c(1, 1, 1)),
expp <-constraints = C_constraint(diag(-1, 3), cones = K_expp(1),
rhs = rep(0, 3)),
bounds = V_bound(li = 2, lb = 1e-12, ui = 3, ub = exp(1)),
maximum = TRUE)
ROI_solve(expp, tol=1e-8, solver="scs")) (sol <-
## Optimal solution found.
## The objective value is: 5.436538e+00
solution(sol)
## [1] 0.0000033677 2.7182633403 2.7182717513
\[ \begin{array} \text{minimize} & u + v + w \\ \text{subject to} & -u e^{\frac{v}{u}} \leq ew \\ & u \in [-1, 0], y, z \geq 0 \end{array} \]
OP(objective = L_objective(c(1, 1, 1), names = c("u", "v", "w")),
expd <-constraints = C_constraint(diag(x=-1, 3), cones = K_expd(1),
rhs = rep(0, 3)),
bounds = V_bound(li = 1, lb = -1, ui = 1, ub = 0, nobj = 3L))
ROI_solve(expd)) (sol <-
## Optimal solution found.
## The objective value is: -6.321080e-01
solution(sol)
## u v w
## -9.999630e-01 4.968136e-06 3.678500e-01
\[ \begin{array} \mathcal{K}_{pwr}^\alpha &=& \{(x, y, z) | x^\alpha y^{1-\alpha} \geq |z|, x, y \geq 0\}, \text{ where } \alpha \in [0, 1] \\ \left(\mathcal{K}_{pwr}^\alpha\right)^* &=& \left\{(u, v, w) | \left(\frac{u}{a}\right)^\alpha \left(\frac{v}{1-a}\right)^{(1-a)} \geq |w|, u \geq 0, v \geq 0 \right\} \end{array} \]
\[ \begin{array} \text{minimize} & x + y \\ \text{subject to} & \sqrt{x} * \sqrt{y} \geq z \\ & x, y \geq 0, z = 4 \end{array} \]
OP(objective = L_objective(c(1, 1, 0), names = c("x", "y", "z")),
powp <-constraints = C_constraint(diag(-1, 3), cones = K_powp(0.5), rhs = rep(0, 3)),
bounds = V_bound(li = 3, ui = 3, lb = 4, ub = 4))
ROI_solve(powp)) (sol <-
## Optimal solution found.
## The objective value is: 7.999982e+00
solution(sol)
## x y z
## 3.999991 3.999991 3.999992
\[ \begin{array} \text{minimize} & u + v \\ \text{subject to} & \sqrt{2 u} * \sqrt{2 v} \geq 4 \\ & u, v \geq 0, z = 4 \end{array} \]
OP(objective = L_objective(c(1, 1, 0), names = c("x", "y", "z")),
powd <-constraints = C_constraint(diag(-1, 3), cones = K_powd(0.5), rhs = rep(0, 3)),
bounds = V_bound(li = 3, ui = 3, lb = 4, ub = 4))
ROI_solve(powd)) (sol <-
## Optimal solution found.
## The objective value is: 3.999977e+00
solution(sol)
## x y z
## 1.999989 1.999989 3.999987
The quadratic problem from above can also be solved by a general purpose solver.
ROI_solve(qcqp, solver = "alabama", start = double(3))) (sol <-
## Optimal solution found.
## The objective value is: 2.836219e+02
solution(sol)
## x y z
## 1.0606602 1.2086300 0.3535534
or equivalently
function(x) {
f <-90 * x[1] + 110 * x[2] + 160 * x[3] - 1 / 2 * (x[1]^2 + x[2]^2 + x[3]^2)
} function(x) {
g <-c((x[1]^2 + x[2]^2 + 4 * x[3]),
2]^2 + x[3]^2 + x[1] + x[3]),
(x[1]^2 + x[3]^2 + 2 * x[1] * x[3]))
(x[
} OP(F_objective(f, n=3),
nlp <-F_constraint(g, dir = rep("<=", 3), rhs = c(4, 3, 2)),
maximum = TRUE)
ROI_solve(nlp, solver = "alabama", start = double(3))) (sol <-
## Optimal solution found.
## The objective value is: 2.836219e+02
solution(sol)
## [1] 1.0606602 1.2086300 0.3535534
or equivalently
OP(Q_objective(-diag(3), c(90, 110, 160), c("x", "y", "z")),
nlp <-F_constraint(g, dir = rep("<=", 3), rhs = c(4, 3, 2)),
maximum = TRUE)
ROI_solve(nlp, solver = "alabama", start = double(3))) (sol <-
## Optimal solution found.
## The objective value is: 2.836219e+02
solution(sol)
## x y z
## 1.0606602 1.2086300 0.3535534
or equivalently
OP(F_objective(f, n=3),
nlp <-Q_constraint(Q = list(rbind(c(2, 0, 0), c(0, 2, 0), c(0, 0, 0)),
rbind(c(0, 0, 0), c(0, 2, 0), c(0, 0, 2)),
rbind(c(2, 0, 2), c(0, 0, 0), c(2, 0, 2))),
L = rbind(c(0, 0, 4), c(1, 0, 1), c(0, 0, 0)),
dir = rep("<=", 3), rhs = c(4, 3, 2)),
maximum = TRUE)
ROI_solve(nlp, solver = "alabama", start = double(3))) (sol <-
## Optimal solution found.
## The objective value is: 2.836219e+02
solution(sol)
## [1] 1.0606602 1.2086300 0.3535534
Optimization problems are commonly stored and shared in specialized plain text files. For LP and MIP the file formats 'mps'
, 'lp'
, 'sif'
and 'freemps'
are commonly used.
ROI_registered_reader()
## type solver
## 1 mps_fixed glpk
## 2 mps_free glpk
## 3 lp_cplex glpk
## 4 mathprog glpk
## 5 lp_lpsolve lpsolve
## 6 mps_fixed lpsolve
## 7 mps_free lpsolve
To read the capri example from the netlib connection the following code can be used.
tempfile()
tmpfile <- gzcon(url("http://www.zib.de/koch/perplex/data/netlib/mps/capri.mps.gz"))
con <-writeLines(readLines(con), tmpfile)
close(con)
ROI_read(tmpfile, type="mps_fixed", "lpsolve")) (capri <-
## ROI Optimization Problem:
##
## Minimize a linear objective function of length 353 with
## - 353 continuous objective variables,
##
## subject to
## - 271 constraints of type linear.
## - 30 lower and 147 upper non-standard variable bounds.
ROI_solve(capri)) (sol <-
## Optimal solution found.
## The objective value is: 2.690013e+03
ROI_registered_writer()
## type solver
## 1 mps_fixed glpk
## 2 mps_free glpk
## 3 lp_cplex glpk
## 4 lp_lpsolve lpsolve
## 5 mps_fixed lpsolve
## 6 mps_free lpsolve
tempfile()
tmpfile <-ROI_write(milp, tmpfile, type = "lp_lpsolve")
cat(readLines(tmpfile), sep="\n")
## /* Objective function */
## max: +7 C1 +C2 +3 C3;
##
## /* Constraints */
## +6 C1 +4 C2 +5 C3 <= 60;
## +8 C1 +2 C3 <= 80;
## +9 C1 +C2 +7 C3 <= 70;
##
## /* Integer definitions */
## int C1,C3;
The software repository NETLIB
contains among many other software also a linear programming test collection.
library("ROI.models.netlib")
netlib()
## [1] "adlittle" "afiro" "agg" "agg2" "agg3" "bandm"
## [7] "beaconfd" "blend" "bnl1" "bnl2" "boeing1" "boeing2"
## [13] "bore3d" "brandy" "capri" "cycle" "czprob" "d2q06c"
## [19] "d6cube" "degen2" "degen3" "dfl001" "e226" "etamacro"
## [25] "fffff800" "finnis" "fit1d" "fit1p" "fit2d" "fit2p"
## [31] "forplan" "ganges" "gfrd.pnc" "greenbea" "greenbeb" "grow15"
## [37] "grow22" "grow7" "israel" "kb2" "lotfi" "maros.r7"
## [43] "maros" "modszk1" "nesm" "perold" "pilot.ja" "pilot"
## [49] "pilot.we" "pilot4" "pilot87" "pilotnov" "recipe" "sc105"
## [55] "sc205" "sc50a" "sc50b" "scagr25" "scagr7" "scfxm1"
## [61] "scfxm2" "scfxm3" "scorpion" "scrs8" "scsd1" "scsd6"
## [67] "scsd8" "sctap1" "sctap2" "sctap3" "seba" "share1b"
## [73] "share2b" "shell" "ship04l" "ship04s" "ship08l" "ship08s"
## [79] "ship12l" "ship12s" "sierra" "stair" "standata" "standmps"
## [85] "stocfor1" "stocfor2" "stocfor3" "truss" "tuff" "vtp.base"
## [91] "wood1p" "woodw" "x25fv47" "x80bau3b"
"boeing1"
problem_name <-netlib("metainfo")[problem_name, -(2:5)]
## name br optimal_value
## boeing1 BOEING1 BR -335.2136
netlib(problem_name)) (model <-
## ROI Optimization Problem:
##
## Minimize a linear objective function of length 384 with
## - 384 continuous objective variables,
##
## subject to
## - 440 constraints of type linear.
## - 6 lower and 156 upper non-standard variable bounds.
ROI_solve(model)) (x <-
## Optimal solution found.
## The objective value is: -3.352136e+02
library("ROI.models.miplib")
miplib("air04")