Example-1 {ROI.plugin.msbinlp}R Documentation

Multiple Solutions - Binary LP

Description

maximize \ \ x + y

subject \ to \ \ x + y = 1

x, y \in \{0, 1\}

Examples

## Not run: 
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

## End(Not run)

[Package ROI.plugin.msbinlp version 1.0-1 Index]