package lp

  1. Overview
  2. Docs
LP and MIP modeling in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

0.0.2.tar.gz
md5=4bc3f413ebb6ce4078ed89e6da5285de
sha512=6393fcfc0a60584dc80dd4de4568b1463299f66223a1c85fff69080f498357175bd36697e3d3c7c4f7528d8be35b44789b676e7467c79c8bd477081c3118fc10

Description

This library is a modeling tool for Linear Programming (LP) and Mixed Integer Programming (MIP). The model can be exported to CPLEX LP file format, which can be loaded by various solvers. Importing models from LP file is also supported.

Published: 22 Apr 2020

README

ocaml-lp : LP and MIP modeling in OCaml

This library is a modeling tool for Linear Programming (LP) and Mixed Integer Programming (MIP). The model can be exported to CPLEX LP file format, which can be loaded by various solvers. Importing models from LP file is also supported.

Install

# optional but recommended to pin dev-repo as it's on quite early stage of development
opam pin lp --dev-repo
opam install lp

Example

let problem =
  let open Lp in
  let x = var "x" in
  let y = var "y" in
  let c0 = x + c 1.2 * y <$ c 5.0 in
  let c1 = c 2.0 * x + y <$ c 1.2 in
  let obj = maximize (x + y) in
  let cnstrs = [c0; c1] in
  (obj, cnstrs)

let () =
   if Lp.validate problem then
       Lp.write "my_problem.lp" problem
   else
       print_endline "Oops, my problem is broken."

Status

Currently only basic features of LP file format are supported. (There is no standard of LP file, though.)

supported

  • Single objective (linear and quadratic)

  • Constraints (linear and quadratic)

  • Bounds

  • Variable types (General Integers and Binary Integers)

not-supported

  • Semi-continuous variables

  • Multi-objective

  • Lazy constraint

  • Special ordered set (SOS)

  • Piecewise-linear objective and constraint

  • General Constraint

  • Scenario

References

Some references to LP file format.

License

MIT

Dependencies (3)

  1. menhir
  2. dune >= "2.2.0"
  3. ocaml >= "4.08.0"

Dev Dependencies (1)

  1. alcotest with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.