mp documentation

MP Library is a set of tools recommended to create new AMPL solver interfaces.


  • Reusable building blocks for new interfaces.

    • High-performance .nl file reader which is up to 6x faster than the one provided by ASL. It can be used for most efficient translation of NL format into solver API.

    • Classes mp::Backend and mp::MIPBackend standardize solver behavior such as common options and suffixes and are recommended for new interfaces.

    • Classes mp::FlatConverter and mp::MIPFlatConverter facilitate conversion of NL expressions which are not natively accepted by a solver into simpler forms. For example, max(a, b) is translated into a construct meaning <new var> = max(a, b), which is in turn redefined into a MIP construct or passed to the solver (Gurobi: GRBaddgenconstrMax). Logical and CP constraints are supported.

  • Concrete solver interfaces.

    • Interfaces to solvers with expression-based APIs. For solvers with an expression-based API, NL forests can be efficiently mapped. For example, AMPL expression max(a, b) directly maps to IBM ILOG Concert’s IloMax. The library has the following C++ interfaces of this kind, all of which support AMPL extensions for logic and constraint programming:

    • Interfaces to solvers with “flat” APIs (WIP). For solvers with more traditional “flat” APIs, class mp::MIPFlatConverter translates many non-linear AMPL expressions. Currently there are two experimental implementations:

  • Other utilities.

    • An efficient type-safe C++ adapter for the previous ASL library for connecting solvers to AMPL and other systems: source

    • SMPSWriter, a converter from deterministic equivalent of a two-stage stochastic programming (SP) problem written in AMPL to an SP problem in SMPS format.

    • End-to-end solver testing script for testing of various solver features: source


Indices and tables