All Projects → r-opt → rmpk

r-opt / rmpk

Licence: Unknown, MIT licenses found Licenses found Unknown LICENSE MIT LICENSE.md
Mixed Integer Linear and Quadratic Programming in R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to rmpk

pydata-london-2018
Slides and notebooks for my tutorial at PyData London 2018
Stars: ✭ 22 (-40.54%)
Mutual labels:  linear-programming, quadratic-programming
portfolio allocation js
A JavaScript library to allocate and optimize financial portfolios.
Stars: ✭ 145 (+291.89%)
Mutual labels:  linear-programming, quadratic-programming
gibbous
Convex optimization for java and scala, built on Apache Commons Math
Stars: ✭ 17 (-54.05%)
Mutual labels:  linear-programming, quadratic-programming
rlqp
Accelerating Quadratic Optimization with Reinforcement Learning
Stars: ✭ 71 (+91.89%)
Mutual labels:  quadratic-programming
osqp-cpp
A C++ interface for the OSQP quadratic programming solver.
Stars: ✭ 160 (+332.43%)
Mutual labels:  quadratic-programming
scanalytics
Python implementation to solve Vehicle Routing problem & Master Production Scheduling in Supply Chain Analytics & Design.
Stars: ✭ 50 (+35.14%)
Mutual labels:  mixed-integer-programming
linearprogramming
Code for the Modeling and Solving Linear Programming with R book
Stars: ✭ 38 (+2.7%)
Mutual labels:  linear-programming
EKR-SIMPLEX-PROBLEM-CALCULATOR
simplex problem calculator
Stars: ✭ 13 (-64.86%)
Mutual labels:  linear-programming
covid19 scenarios data
Data preprocessing scripts and preprocessed data storage for COVID-19 Scenarios project
Stars: ✭ 43 (+16.22%)
Mutual labels:  modelling
Linear-Algebra-and-Its-Applications-notes
《线性代数及其应用》笔记
Stars: ✭ 196 (+429.73%)
Mutual labels:  linear-programming
minizinc-python
Access to all MiniZinc functionality directly from Python
Stars: ✭ 92 (+148.65%)
Mutual labels:  linear-programming
flipy
A Python linear programming interface library
Stars: ✭ 23 (-37.84%)
Mutual labels:  linear-programming
blt
Lattice-based integer linear programming solver
Stars: ✭ 60 (+62.16%)
Mutual labels:  linear-programming
QuantumCircuitOpt.jl
A Julia/JuMP Package for Optimal Quantum Circuit Design
Stars: ✭ 45 (+21.62%)
Mutual labels:  mixed-integer-programming
emhass
emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.
Stars: ✭ 54 (+45.95%)
Mutual labels:  linear-programming
conjure
Conjure: The Automated Constraint Modelling Tool
Stars: ✭ 84 (+127.03%)
Mutual labels:  modelling
MITK-Diffusion
MITK Diffusion - Official part of the Medical Imaging Interaction Toolkit
Stars: ✭ 47 (+27.03%)
Mutual labels:  modelling
skrobot
skrobot is a Python module for designing, running and tracking Machine Learning experiments / tasks. It is built on top of scikit-learn framework.
Stars: ✭ 22 (-40.54%)
Mutual labels:  modelling
antaresViz
ANTARES Visualizations
Stars: ✭ 19 (-48.65%)
Mutual labels:  linear-programming
radCAD
A framework for generalised dynamical systems modelling & simulation (inspired by and compatible with cadCAD.org)
Stars: ✭ 59 (+59.46%)
Mutual labels:  modelling

MIP Modelling in R

Lifecycle: experimental R-CMD-check Codecov test coverage

rmpk is a lightweight package to model mixed integer linear programs. It is based on the API of the ompr package and is also inspired by the architecture of Julia JuMP.

The goal is to provide a modelling package that can both be used in packages and also in interactive analyses. It also has a different architecture as the modelling layer modifies a central solver. That solver could be an interface to ROI or a shared pointer to a specific solver. Thus giving the option to directly communicate with the solver while still using an algebraic modelling framework.

This is currently work in progress and experimental - but working. I might merge it with ompr but it could also become the successor of ompr … not sure yet.

If you want to see the package in action take a look at the articles in the docs.

Happy to receive feedback!

Still under development. Anything can change

Installation

You can install the released version of RMPK from CRAN with:

remotes::install_github("r-opt/rmpk")

Supported types

  • Linear Programming (LP)
  • Mixed Integer Linear Programming (MILP)
  • Mixed Integer Quadratic Programming (MIQP)
  • Mixed Integer Quadratically Constrained Programming (MIQCP)

Features

  • Algebraic modelling of mixed integer programming problems

  • Integer, binary and continious variables

  • Linear and quadratic constraints/objective

  • Bindings to most popular solvers through ROI

  • Support for character variable indexes

  • Access row/column duals of Linear Programs

  • Row generation through solver callbacks (e.g. for models with exponential many constraints)

  • 🚧 Variable and constraint names

  • 🚧 Initial feasible solutions

  • 🚧 Almost as fast as matrix code

Low Level ROI Example

library(rmpk)
library(ROI.plugin.glpk)
set.seed(42)
solver <- ROI_optimizer("glpk")
v <- rnorm(10)
w <- rnorm(10)
model <- optimization_model(solver)
x <- model$add_variable("x", type = "binary", i = 1:10)
model$set_objective(sum_expr(v[i] * x[i], i = 1:10), sense = "max")
model$add_constraint(sum_expr(w[i] * x[i], i = 1:10) <= 10)
model$optimize()
model$get_variable_value(x[i])
#>    name  i value
#> 1     x  1     1
#> 2     x  7     1
#> 3     x  5     1
#> 4     x  8     0
#> 5     x  2     0
#> 6     x 10     0
#> 7     x  9     1
#> 8     x  3     1
#> 9     x  6     0
#> 10    x  4     1

List of solvers

rmpk supports all solvers that implement the MOI interface. It also comes with a ROI_optimzer that internally uses ROI and thus gives access to most popular solvers out of the box. Note that ROI has its own plugin system and you need to install these solvers separately in addition to ROIoptimizer.

Solver Name R Package Github URL
alabama ROIoptimizer https://github.com/r-opt/ROIoptimizer
cbc ROIoptimizer https://github.com/r-opt/ROIoptimizer
cccp ROIoptimizer https://github.com/r-opt/ROIoptimizer
clp ROIoptimizer https://github.com/r-opt/ROIoptimizer
cplex ROIoptimizer https://github.com/r-opt/ROIoptimizer
deoptim ROIoptimizer https://github.com/r-opt/ROIoptimizer
ecos ROIoptimizer https://github.com/r-opt/ROIoptimizer
glpk ROIoptimizer https://github.com/r-opt/ROIoptimizer
glpk GLPKoptimizer https://github.com/r-opt/GLPKoptimizer
gurobi ROIoptimizer https://github.com/r-opt/ROIoptimizer
ipop ROIoptimizer https://github.com/r-opt/ROIoptimizer
lpsolve ROIoptimizer https://github.com/r-opt/ROIoptimizer
mosek ROIoptimizer https://github.com/r-opt/ROIoptimizer
msbinlp ROIoptimizer https://github.com/r-opt/ROIoptimizer
neos ROIoptimizer https://github.com/r-opt/ROIoptimizer
nloptr ROIoptimizer https://github.com/r-opt/ROIoptimizer
optimx ROIoptimizer https://github.com/r-opt/ROIoptimizer
qpoases ROIoptimizer https://github.com/r-opt/ROIoptimizer
quadprog ROIoptimizer https://github.com/r-opt/ROIoptimizer
scs ROIoptimizer https://github.com/r-opt/ROIoptimizer
symphony ROIoptimizer https://github.com/r-opt/ROIoptimizer

Contribute

The best way at the moment to contribute is to test the package, write documentation, propose features. Soon, code contributions are welcome as well.

Please note that the ‘rmpk’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

MIT

References and Inspiration

  • Dunning, Iain, Joey Huchette, and Miles Lubin. “JuMP: A modeling language for mathematical optimization.” SIAM Review 59.2 (2017): 295-320.
  • ompr
  • pulp
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].