AMPL is an algebraic modeling language to describe and solve high-complexity problems for large-scale mathematical computing. It was developed by Robert Fourer, David Gay, and Brian Kernighan at Bell Laboratories. AMPL supports dozens of solvers, both open source and commercial software, including CBC, CPLEX, FortMP, Gurobi, MINOS, IPOPT, SNOPT, KNITRO, and LGO. Problems are passed to solvers as nl files. AMPL is used by more than 100 corporate clients, and by government agencies and academic institutions.

One advantage of AMPL is the similarity of its syntax to the mathematical notation of optimization problems. This allows for a very concise and readable definition of problems in the domain of optimization. Many modern solvers available on the NEOS Server accept AMPL input. According to the NEOS statistics AMPL is the most popular format for representing mathematical programming problems.


1. Features

AMPL features a mix of declarative and imperative programming styles. Formulating optimization models occurs via declarative language elements such as sets, scalar and multidimensional parameters, decision variables, objectives and constraints, which allow for concise description of most problems in the domain of mathematical optimization.

Procedures and control flow statements are available in AMPL for

  • the construction of hybrid algorithms for problem types for which no direct efficient solvers are available.
  • data pre- and post-processing tasks around optimization models
  • the exchange of data with external data sources such as spreadsheets, databases, XML and text files

To support re-use and simplify construction of large-scale optimization problems, AMPL allows separation of model and data.

AMPL supports a wide range of problem types, among them:

  • Mixed-integer programming
  • Linear programming
  • Semidefinite programming problems with bilinear matrix inequalities
  • Mixed-integer nonlinear programming
  • Mixed-integer quadratic programming with or without convex quadratic constraints
  • Second-order cone programming
  • Constraint programming
  • Quadratic programming
  • Nonlinear programming
  • Complementarity theory problems MPECs in discrete or continuous variables
  • Global optimization

AMPL invokes a solver in a separate process which has these advantages:

  • User can interrupt the solution process at any time
  • Solver errors do not affect the interpreter
  • 32-bit version of AMPL can be used with a 64-bit solver and vice versa

Interaction with the solver is done through a well-defined nl interface.


2. Availability

AMPL is available for many popular 32- and 64-bit operating systems including Linux, macOS, Solaris, AIX, and Windows. The translator is proprietary software maintained by AMPL Optimization LLC. However, several online services exist, providing free modeling and solving facilities using AMPL. A free student version with limited functionality and a free full-featured version for academic courses are also available.

AMPL can be used from within Microsoft Excel via the SolverStudio Excel add-in.

The AMPL Solver Library ASL, which allows reading nl files and provides the automatic differentiation, is open-source. It is used in many solvers to implement AMPL connection.


3. A sample model

A transportation problem from George Dantzig is used to provide a sample AMPL model. This problem finds the least cost shipping schedule that meets requirements at markets and supplies at factories.

  • AMPL P - 2000 class of interceptor boats are series of ten watercraft built by M s Anderson Marine Private Limited, Goa, India for the Indian Coast Guard
  • problems. Initially this format has been invented for connecting solvers to AMPL It has also been adopted by other systems such as COIN - OR as one of the
  • solvers. Initially this format has been invented for connecting solvers to AMPL but then it has been adopted by other systems such as FortSP for interacting
  • operational research and management science. He is currently President of AMPL Optimization, Inc and is Professor Emeritus of Industrial Engineering and
  • which stands for Stochastic AMPL is an algebraic modeling language resulting by expanding the well - known language AMPL with extended syntax and keywords
  • MathProg previously known as GMPL which shares many parts of the syntax with AMPL and solved with standalone solver GLPSOL. GLPK can also be used as a C library
  • via automatic differentiation routines in modeling environments such as AMPL If no Hessians are provided, IPOPT will approximate them using a quasi - Newton
  • flight controls for Unmanned Aerial Vehicles UAVs APOPT is supported in AMPL APMonitor, Gekko, Julia, MATLAB, Pyomo, and Python. WO patent 2012005740
  • library in C and Python. It supports the following modelling languages: AMPL ASL GAMS Pyomo The engine also has interfaces for the following solvers: