package lp
Install
Dune Dependency
Authors
Maintainers
Sources
md5=c9e78b48f2ce4479c895f560b978dad1
sha512=ce258f4b50d19ccce7e52f9242b3fbc5b4644a05f64fe42504ae5371b79353d1519b26fcbdf2930deff5f9676b6437d575f08723a39de20e9dfa063b6a35c209
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: 14 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.
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 = Obj.Min [x; y] in
let cnstrs = [c0; c1] in
(obj, cnstrs)
let () =
if Lp.validate problem then
Lp.write "my_problem.lp" problem
else ()
Status
Currently only basic subset of LP file format is 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