Package 'ROI.plugin.highs'

Title: 'HiGHS' Plugin for the 'R' Optimization Infrastructure
Description: Enhances the 'R' Optimization Infrastructure ('ROI') package with the quadratic solver 'HiGHS'. More information about 'HiGHS' can be found at <https://highs.dev>.
Authors: Florian Schwendinger [aut, cre]
Maintainer: Florian Schwendinger <[email protected]>
License: GPL-2 | GPL-3
Version: 1.0-3
Built: 2024-12-27 02:02:08 UTC
Source: https://github.com/cran/ROI.plugin.highs

Help Index


Linear Problem 1

Description

maximize  2x1+4x2+3x3maximize \ \ 2 x_1 + 4 x_2 + 3 x_3

subject to:subject \ to:

3x1+4x2+2x3603 x_1 + 4 x_2 + 2 x_3 \leq 60

2x1+x2+2x3402 x_1 + x_2 + 2 x_3 \leq 40

x1+3x2+2x380x_1 + 3 x_2 + 2 x_3 \leq 80

x1,x2,x30x_1, x_2, x_3 \geq 0

Examples

Sys.setenv(ROI_LOAD_PLUGINS = FALSE)
library("ROI")
library("ROI.plugin.highs")
mat <- matrix(c(3, 4, 2,
                2, 1, 2,
                1, 3, 2), nrow=3, byrow=TRUE)
x <- OP(objective = c(2, 4, 3),
        constraints = L_constraint(L = mat,
                                   dir = c("<=", "<=", "<="),
                                   rhs = c(60, 40, 80)),
        maximum = TRUE)
opt <- ROI_solve(x, solver = "highs")
opt
## Optimal solution found.
## The objective value is: 7.666667e+01
solution(opt)
## [1]  0.000000  6.666667 16.666667