'Clp (Coin-or linear programming)' Plugin for the 'R' Optimization Interface

Enhances the R Optimization Infrastructure (ROI) package by registering the COIN-OR Clp open-source solver from the COIN-OR suite < https://projects.coin-or.org/>. It allows for solving linear programming with continuous objective variables keeping sparse constraints definition.


ROI.plugin.clp — 'Clp (Coin-or linear programming)' Plugin for the 'R' Optimization Interface

Installation

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

# devtools::install_github("datastorm-open/ROI.plugin.clp") for developpement version

Use

require(ROI)
require(ROI.plugin.clp)

## Simple linear program.
## maximize:   2 x_1 + 4 x_2 + 3 x_3
## subject to: 3 x_1 + 4 x_2 + 2 x_3 <= 60
##             2 x_1 +   x_2 + 2 x_3 <= 40
##               x_1 + 3 x_2 + 2 x_3 <= 80
##               x_1, x_2, x_3 are non-negative real numbers

LP <- ROI::OP(c(2, 4, 3),
  ROI::L_constraint(L = matrix(c(3, 2, 1, 4, 1, 3, 2, 2, 2), nrow = 3),
    dir = c("<=", "<=", "<="),
    rhs = c(60, 40, 80)),
  max = TRUE)
  
res_lp <- ROI::ROI_solve(x = LP, solver = "clp")
res_lp$solution
res_lp$objval

## control log level (0.2), ?clpAPI::setLogLevelCLP
res_lp <- ROI::ROI_solve(x = LP, solver = "clp", control = list(amount = 1))

News

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.clp")

0.4 by Benoit Thieurmel, 2 years ago


https://github.com/datastorm-open/ROI.plugin.clp, https://projects.coin-or.org/Clp


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


Authors: Benoit Thieurmel [aut, cre]


Documentation:   PDF Manual  


Task views: Optimization and Mathematical Programming


EPL license


Imports methods, stats, ROI, clpAPI, slam, Matrix

Suggests testthat


See at CRAN