Example_01: Multiple Solutions - Binary LP

Example-1R 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)

ROI.plugin.msbinlp documentation built on July 9, 2023, 5:52 p.m.