Example_01: Multiple Solutions - Binary LP

Description Examples

Description

maximize \ \ x + y

subject \ to \ \ x + y = 1

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)

Example output

ROI.plugin.glpk: R Optimization Infrastructure
Registered solver plugins: nlminb, msbinlp, glpk.
Default solver: auto.
2 optimal solutions found.
The objective value is: 1.000000e+00
[[1]]
[1] 1 0

[[2]]
[1] 0 1

ROI.plugin.msbinlp documentation built on Aug. 30, 2020, 3 a.m.