Model and Solve Mixed Integer Linear Programs

Model mixed integer linear programs in an algebraic way directly in R. The model is solver-independent and thus offers the possibility to solve a model with different solvers. It currently only supports linear constraints and objective functions. See the 'ompr' website <> for more information, documentation and examples.


ompr 0.8.0

General changes

  • Removed dplyr dependency
  • Added MILPModel, a new, vectorized backend for mixed integer linear programs that can handle very large models. It will eventually replace MIPModel.
  • Added two functions (get_column_duals, get_row_duals) to extract the dual (column and row) values from an LP.
  • The minimum supported R version is now 3.2.0
  • get_solution now always return a solution, even if the solution status is not optimal.
  • get_solution has a third argument type with permitted values being "primal" and "dual" to return the respective column primal or dual values.


  • You can now extract solutions of indexed variables that have length one (#198)

ompr 0.7.0

Breaking changes

  • ompr now uses sparse constraint matrices. extract_constraints now returns a sparse matrix and objective_function returns a sparse vector.
  • The minimum supported R version is now 3.3.0
  • Fixed an issue with Rcpp. The minimum Rcpp version is now 0.12.12

Minor changes

  • New progress bar based on the progress package.

ompr 0.6.0

  • First version on CRAN

Reference manual

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


1.0.1 by Dirk Schumacher, 3 days ago

Report a bug at

Browse source code at

Authors: Dirk Schumacher [aut, cre]

Documentation:   PDF Manual  

Task views: Optimization and Mathematical Programming

MIT + file LICENSE license

Imports lazyeval, rlang, listcomp, methods, data.table, Matrix, fastmap

Suggests covr, magrittr, testthat

Imported by OTrecod, ompr.roi.

See at CRAN