Learn R Programming

ROI.plugin.msbinlp (version 1.0-1)

Example-1: Multiple Solutions - Binary LP

Description

$$maximize \ \ x + y$$ $$subject \ to \ \ x + y = 1$$ $$ x, y \in \{0, 1\} $$

Arguments

Examples

Run this code
if (FALSE) {
library(ROI)
op <- OP(objective = c(1, 1),
         constraints = L_constraint(c(1, 1), "==", 1),
         types = c("B", "B"))

x <- ROI_solve(op, solver = "msbinlp", method = "glpk", nsol_max = 2L)
x
## 2 optimal solutions found.
## The objective value is: 1.000000e+00
solution(x)
## [[1]]
## [1] 1 0
##
## [[2]]
## [1] 0 1
}

Run the code above in your browser using DataLab