Example_02: Multiple Solutions - Binary LP

Description References Examples

Description

maximize \ \ - x_1 - x_2 - x_3 - x_4 - 99 x_5

subject \ to

x_1 + x_2 ≤q 1

x_3 + x_4 ≤q 1

x_4 + x_5 ≤q 1

x_i \in \{0, 1\}

References

Matteo Fischetti and Domenico Salvagnin (2010) Pruning moves. INFORMS Journal on Computing 22.1: 108-119.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
library(ROI)
op <- OP()
objective(op) <- L_objective(c(-1, -1, -1, -1, -99))
mat <- simple_triplet_matrix(rep(1:3, 2), 
                             c(c(1, 3, 4), c(2, 4, 5)), 
                             rep(1, 6))
constraints(op) <- L_constraint(mat, 
                               dir = leq(3), 
                               rhs = rep.int(1, 3))
types(op) <- rep("B", length(op))

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

## End(Not run)

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