'HiGHS' Plugin for the 'R' Optimization Infrastructure

Enhances the 'R' Optimization Infrastructure ('ROI') package with the quadratic solver 'HiGHS'. More information about 'HiGHS' can be found at < https://highs.dev>.


ROI HIGHS Interface

This repository contains an R interface to the HiGHS solver. The HiGHS solver, is a high-performance open-source solver for solving linear programming (LP), mixed-integer programming (MIP) and quadratic programming (QP) optimization problems.

Installation

remotes::install_gitlab("roigrp/solver/roi.plugin.highs")

Basic usage

library("ROI")

LP

# Minimize
#  x_0 +  x_1 + 3
# Subject to
#                 x_1 <= 7
#  5 <=   x_0 + 2 x_1 <= 15
#  6 <= 3 x_0 + 2 x_1
#  0 <=   x_0         <= 4
#  1 <=           x_1
op <- OP(
  objective = L_objective(c(1.0, 1)),
  constraints = L_constraint(
    L = rbind(c(0, 1), c(1, 2), c(1, 2), c(3, 2)),
    dir = c("<=", ">=", "<=", ">="),
    rhs = c(7, 5, 15, 6)
  ),
  bounds = V_bound(lb = c(0, 1), ub = c(4, Inf))
)

s <- ROI_solve(op, "highs")
solution(s)
#> [1] 0.50 2.25

QP

# Minimize
#  2 x_0^2 + x_1^2 + x_0 x_1 + x_1 + x_2
# Subject to
#  x_0 + x_1 = 1
#  x_0, x_1 >= 0
op <- OP(
  objective = Q_objective(rbind(c(2, .5), c(.5, 1)), c(1, 1)),
  constraints = L_constraint(
    L = rbind(c(1, 1)),
    dir = "==",
    rhs = 1
  )
)

s <- ROI_solve(op, "highs")
solution(s)
#> [1] 0.25 0.75

For additional information on the HiGHS solver see the HiGHS homepage, for additional information on ROI see the ROI homepage.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ROI.plugin.highs")

1.0-4 by Florian Schwendinger, 2 years ago


Browse source code at https://github.com/cran/ROI.plugin.highs


Authors: Florian Schwendinger [aut, cre]


Documentation:   PDF Manual  


GPL-2 | GPL-3 license


Imports methods, ROI, highs

Suggests tinytest


Suggested by ROI.plugin.coinclp, WpProj, grouper.


See at CRAN