AMPL

Last updated

AMPL
AMPL (textbook cover).jpg
Paradigm Multi-paradigm: declarative, imperative
Designed by Robert Fourer
David Gay
Brian Kernighan
Bell Labs
Developer AMPL Optimization, Inc.
First appeared1985;39 years ago (1985)
Stable release
20230430 / 30 April 2023;11 months ago (2023-04-30)
OS Cross-platform: Linux, macOS, Solaris, AIX, Windows
License Proprietary (translator),
free and open-source (AMPL Solver Library)
Filename extensions .mod, .dat, .run
Website www.ampl.com
Influenced by
AWK, C
Influenced
Pyomo

AMPL (A Mathematical Programming Language) is an algebraic modeling language to describe and solve high-complexity problems for large-scale mathematical computing (e.g. large-scale optimization and scheduling-type problems). [1] 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, MOSEK, 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. [2]

Contents

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 (formerly hosted at the Argonne National Laboratory, currently hosted at the University of Wisconsin, Madison [3] ) accept AMPL input. According to the NEOS statistics AMPL is the most popular format for representing mathematical programming problems.

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

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:

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

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

Availability

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

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.

Status history

This table present significant steps in AMPL history.

YearHighlights
1985AMPL was designed and implemented [1]
1990Paper describing the AMPL modeling language was published in Management Science [9]
1991AMPL supports nonlinear programming and automatic differentiation
1993 Robert Fourer, David Gay and Brian Kernighan were awarded ORSA/CSTS Prize [10] by the Operations Research Society of America, for writings on the design of mathematical programming systems and the AMPL modeling language
1995Extensions for representing piecewise-linear and network structures
1995Scripting constructs
1997Enhanced support for nonlinear solvers
1998AMPL supports complementarity theory problems
2000Relational database and spreadsheet access
2002Support for constraint programming [4]
2003AMPL Optimization LLC was founded by the inventors of AMPL, Robert Fourer, David Gay, and Brian Kernighan. The new company took over the development and support of the AMPL modeling language from Lucent Technologies, Inc.
2005AMPL Modeling Language Google group opened [11]
2008Kestrel: An AMPL Interface to the NEOS Server introduced
2012 Robert Fourer, David Gay, and Brian Kernighan were awarded the 2012 INFORMS Impact Prize as the originators of one of the most important algebraic modeling languages. [12]
2012AMPL book becomes freely available online [13]
2013A new cross-platform integrated development environment (IDE) for AMPL becomes available [14]

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. [15]

setPlants;setMarkets;# Capacity of plant p in casesparamCapacity{pinPlants};# Demand at market m in casesparamDemand{minMarkets};# Distance in thousands of milesparamDistance{Plants,Markets};# Freight in dollars per case per thousand milesparamFreight;# Transport cost in thousands of dollars per caseparamTransportCost{pinPlants,minMarkets}:=Freight*Distance[p,m]/1000;# Shipment quantities in casesvarshipment{Plants,Markets}>=0;# Total transportation costs in thousands of dollarsminimizecost:sum{pinPlants,minMarkets}TransportCost[p,m]*shipment[p,m];# Observe supply limit at plant ps.t.supply{pinPlants}:sum{minMarkets}shipment[p,m]<=Capacity[p];# Satisfy demand at market ms.t.demand{minMarkets}:sum{pinPlants}shipment[p,m]>=Demand[m];data;setPlants:=seattlesan-diego;setMarkets:=new-yorkchicagotopeka;paramCapacity:=seattle350san-diego600;paramDemand:=new-york325chicago300topeka275;paramDistance:new-yorkchicagotopeka:=seattle2.51.71.8san-diego2.51.81.4;paramFreight:=90;

Solvers

Here is a partial list of solvers supported by AMPL: [16]

SolverSupported problem types
APOPT mixed integer nonlinear programming
Artelys Knitro linear, quadratic and nonlinear programming
Bonminmixed integer nonlinear programming
BPMPD linear and quadratic programming
COIN-OR CBC mixed integer programming
COIN-OR CLP linear programming
CONOPTnonlinear programming
Couenne [17] mixed integer nonlinear programming (MINLP)
CPLEX linear, quadratic, second-order cone and mixed integer programming
CPLEX CP Optimizer [18] constraint programming
FILTERnonlinear programming
FortMP linear, quadratic and mixed integer programming
Gecode [19] constraint programming
IPOPT nonlinear programming
JaCoP [20] constraint programming
LGO [21] global and local nonlinear optimization
lp_solve [22] linear and mixed integer programming
MINOS linear and nonlinear programming
MINTO mixed integer programming
MOSEK linear, mixed integer linear, quadratic, mixed integer quadratic, quadratically constrained, conic and convex nonlinear programming
Octeract Engine All types of optimisation problems without differential or integral terms, including discontinuous problems with min and max elementary functions.
SCIP mixed integer programming
SNOPT nonlinear programming
Sulum [23] linear and mixed integer programming
WORHP nonlinear programming
XAlinear and mixed integer programming
Xpress linear and convex quadratic optimization and their mixed integer counterparts

See also

Related Research Articles

IBM ILOG CPLEX Optimization Studio is an optimization software package.

The general algebraic modeling system (GAMS) is a high-level modeling system for mathematical optimization. GAMS is designed for modeling and solving linear, nonlinear, and mixed-integer optimization problems. The system is tailored for complex, large-scale modeling applications and allows the user to build large maintainable models that can be adapted to new situations. The system is available for use on various computer platforms. Models are portable from one platform to another.

Convex optimization is a subfield of mathematical optimization that studies the problem of minimizing convex functions over convex sets. Many classes of convex optimization problems admit polynomial-time algorithms, whereas mathematical optimization is in general NP-hard.

IPOPT, short for "Interior Point OPTimizer, pronounced I-P-Opt", is a software library for large scale nonlinear optimization of continuous systems. It is written in Fortran and C and is released under the EPL. IPOPT implements a primal-dual interior point method, and uses line searches based on Filter methods. IPOPT can be called from various modeling environments and C.

The Galahad library is a thread-safe library of packages for the solution of mathematical optimization problems. The areas covered by the library are unconstrained and bound-constrained optimization, quadratic programming, nonlinear programming, systems of nonlinear equations and inequalities, and non-linear least squares problems. The library is mostly written in the Fortran 90 programming language.

<span class="mw-page-title-main">COIN-OR</span>

Computational Infrastructure for Operations Research (COIN-OR), is a project that aims to "create for mathematical software what the open literature is for mathematical theory." The open literature provides the operations research (OR) community with a peer-review process and an archive. Papers in operations research journals on mathematical theory often contain supporting numerical results from computational studies. The software implementations, models, and data used to produce the numerical results are typically not published. The status quo impeded researchers needing to reproduce computational results, make fair comparisons, and extend the state of the art.

The TOMLAB Optimization Environment is a modeling platform for solving applied optimization problems in MATLAB.

Algebraic modeling languages (AML) are high-level computer programming languages for describing and solving high complexity problems for large scale mathematical computation. One particular advantage of some algebraic modeling languages like AIMMS, AMPL, GAMS, Gekko, MathProg, Mosel, and OPL is the similarity of their syntax to the mathematical notation of optimization problems. This allows for a very concise and readable definition of problems in the domain of optimization, which is supported by certain language elements like sets, indices, algebraic expressions, powerful sparse index and data handling variables, constraints with arbitrary names. The algebraic formulation of a model does not contain any hints how to process it.

FortMP is a software package for solving large-scale optimization problems. It solves linear programming problems, quadratic programming problems and mixed integer programming problems. Its robustness has been explored and published in the Mathematical Programming journal. FortMP is available as a standalone executable that accepts input in MPS format and as a library with interfaces in C and Fortran. It is also supported in the AMPL modeling system.

nl is a file format for presenting and archiving mathematical programming problems. Initially, this format has been invented for connecting solvers to AMPL. It has also been adopted by other systems such as COIN-OR, FortSP, and Coopr.

<span class="mw-page-title-main">WORHP</span> Mathematical software library

WORHP, also referred to as eNLP by ESA, is a mathematical software library for numerically solving large scale continuous nonlinear optimization problems.

APOPT is a software package for solving large-scale optimization problems of any of these forms:

SAMPL, which stands for "Stochastic AMPL", is an algebraic modeling language resulting by expanding the well-known language AMPL with extended syntax and keywords. It is designed specifically for representing stochastic programming problems and, through recent extensions, problems with chance constraints, integrated chance constraints and robust optimization problems. It can generate the deterministic equivalent version of the instances, using all the solvers AMPL connects to, or generate an SMPS representation and use specialized decomposition based solvers, like FortSP.

MINOS is a Fortran software package for solving linear and nonlinear mathematical optimization problems. MINOS may be used for linear programming, quadratic programming, and more general objective functions and constraints, and for finding a feasible point for a set of linear or nonlinear equalities and inequalities.

Convex Over and Under ENvelopes for Nonlinear Estimation (Couenne) is an open-source library for solving global optimization problems, also termed mixed integer nonlinear optimization problems. A global optimization problem requires to minimize a function, called objective function, subject to a set of constraints. Both the objective function and the constraints might be nonlinear and nonconvex. For solving these problems, Couenne uses a reformulation procedure and provides a linear programming approximation of any nonconvex optimization problem.

Deterministic global optimization is a branch of numerical optimization which focuses on finding the global solutions of an optimization problem whilst providing theoretical guarantees that the reported solution is indeed the global one, within some predefined tolerance. The term "deterministic global optimization" typically refers to complete or rigorous optimization methods. Rigorous methods converge to the global optimum in finite time. Deterministic global optimization methods are typically used when locating the global solution is a necessity, when it is extremely difficult to find a feasible solution, or simply when the user desires to locate the best possible solution to a problem.

Artelys Knitro is a commercial software package for solving large scale nonlinear mathematical optimization problems.

<span class="mw-page-title-main">NEOS Server</span>

The NEOS Server is an Internet-based client-server application that provides free access to a library of optimization solvers. Its library of solvers includes more than 60 commercial, free and open source solvers, which can be applied to mathematical optimization problems of more than 12 different types, including linear programming, integer programming and nonlinear optimization.

Algebraic modeling languages like AIMMS, AMPL, GAMS, MPL and others have been developed to facilitate the description of a problem in mathematical terms and to link the abstract formulation with data-management systems on the one hand and appropriate algorithms for solution on the other. Robust algorithms and modeling language interfaces have been developed for a large variety of mathematical programming problems such as linear programs (LPs), nonlinear programs (NPs), mixed integer programs (MIPs), mixed complementarity programs (MCPs) and others. Researchers are constantly updating the types of problems and algorithms that they wish to use to model in specific domain applications.

The GEKKO Python package solves large-scale mixed-integer and differential algebraic equations with nonlinear programming solvers. Modes of operation include machine learning, data reconciliation, real-time optimization, dynamic simulation, and nonlinear model predictive control. In addition, the package solves Linear programming (LP), Quadratic programming (QP), Quadratically constrained quadratic program (QCQP), Nonlinear programming (NLP), Mixed integer programming (MIP), and Mixed integer linear programming (MILP). GEKKO is available in Python and installed with pip from PyPI of the Python Software Foundation.

References

  1. 1 2 Fourer, Robert; Gay, David M; Kernighan, Brian W (2003). AMPL: a modeling language for mathematical programming. USA: Duxbury Press/Brooks/Cole Publishing Company. ISBN   978-0-534-38809-6.
  2. "Position Available". Archived from the original on 11 September 2011. Retrieved 29 July 2011.
  3. "About" . Retrieved 11 August 2015.
  4. 1 2 Fourer, Robert; Gay, David M. (2002). "Extending an Algebraic Modeling Language to Support Constraint Programming". INFORMS Journal on Computing. 14 (4): 322–344. CiteSeerX   10.1.1.8.9699 . doi:10.1287/ijoc.14.4.322.2825.
  5. "Platforms". AMPL Optimizations Inc. Archived from the original on 14 May 2022. Retrieved 1 November 2019.
  6. "NEOS Server for Optimization" . Retrieved 11 August 2015.
  7. "Try AMPL!" . Retrieved 11 August 2015.
  8. "AMPL Downloads". Archived from the original on 26 May 2015. Retrieved 11 August 2015.
  9. Fourer, Robert; Gay, David M.; Kernighan, Brian W. (1990). "A Modeling Language for Mathematical Programming" (PDF). Management Science. 36 (5): 519–554–83. doi:10.1287/mnsc.36.5.519.
  10. INFORMS. "ICS - INFORMS" (PDF). Archived from the original (PDF) on 7 October 2006. Retrieved 11 August 2015.
  11. "Google Groups".
  12. INFORMS. "INFORMS Impact Prize". Archived from the original on 22 October 2013. Retrieved 11 August 2015.
  13. "The AMPL Book: A comprehensive guide to building optimization models, for beginning or experienced users" . Retrieved 5 March 2021.
  14. "Google Groups" . Retrieved 11 August 2015.
  15. Dantzig, George (2016) [1963]. "3. Formulating a Linear Programming Model". Linear Programming and Extensions. Princeton University Press. pp. 32–62. ISBN   978-1-4008-8417-9.
  16. "Solvers - AMPL". Archived from the original on 27 February 2014. Retrieved 21 January 2018.
  17. "Couenne". Archived from the original on 29 October 2013. Retrieved 27 October 2013.
  18. "mp/solvers/ilogcp at master · ampl/mp · GitHub". GitHub. Retrieved 11 August 2015.
  19. "mp/solvers/gecode at master · ampl/mp · GitHub". GitHub. Retrieved 11 August 2015.
  20. "mp/solvers/jacop at master · ampl/mp · GitHub". GitHub. Retrieved 11 August 2015.
  21. "LGO - AMPL" . Retrieved 11 August 2015.
  22. "Using lpsolve from AMPL" . Retrieved 11 August 2015.
  23. "mp/solvers/sulum at master · ampl/mp · GitHub". GitHub. Retrieved 11 August 2015.
  24. "GLPK official site" . Retrieved 17 September 2020.