| AMPL | |
|---|---|
![]() | |
| Paradigm | Multi-paradigm:declarative,imperative |
| Designed by | Robert Fourer David Gay Brian Kernighan Bell Labs |
| Developer | AMPL Optimization, Inc. |
| First appeared | 1985; 41 years ago (1985) |
| Stable release | 20250901 / 1 September 2025; 5 months ago (2025-09-01) |
| 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 |
| Influenced by | |
| AWK,C | |
| Influenced | |
| JuMP,Pyomo | |
AMPL (A Mathematical Programming Language) is analgebraic modeling language to describe and solve high-complexity problems for large-scale mathematical computing (e.g. large-scale optimization andscheduling-type problems).[1]It was developed byRobert Fourer, David Gay, andBrian Kernighan atBell Laboratories.AMPL supports dozens ofsolvers, bothopen source andcommercial software, including CBC,CPLEX,FortMP,MOSEK,MINOS,IPOPT,SNOPT,KNITRO, and LGO. Problems are passed to solvers asnl files.AMPL is used by more than 100 corporate clients, and by government agencies and academic institutions.[2]
One advantage of AMPL is the similarity of its syntax to the mathematical notation ofoptimization problems. This allows for a very concise and readable definition of problems in the domain ofoptimization. Many modern solvers available on theNEOS Server (formerly hosted at theArgonne National Laboratory, currently hosted at theUniversity of Wisconsin, Madison[3]) accept AMPL input. According to the NEOS statistics AMPL is the most popular format for representing mathematical programming problems.
AMPL features a mix ofdeclarative andimperative programming styles. Formulating optimization models occurs via declarative language elements such as sets, scalar and multidimensional parameters, decision variables, objectives andconstraints, which allow for concise description of most problems in the domain of mathematical optimization.
Procedures andcontrol 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-definednl interface.
AMPL is available for many popular 32 & 64-bitoperating systems includingLinux,macOS,Solaris,AIX, andWindows.[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 also provides open-sourceAPIs that enable integration with general-purpose programming languages. Official APIs are available forPython, R, C++, C#, MATLAB and Java, allowing users to generate, update, and solve models programmatically.[9]
AMPL can be used from withinMicrosoft Excel via theSolverStudio 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.
AMPL/MP provides another open-source library to build linear, mixed-integer, andConstraint Programming solvers, replacing ASL for those not requiring automatic differentiation.[10]
This table present significant steps in AMPL history.
| Year | Highlights |
|---|---|
| 1985 | AMPL was designed and implemented[1] |
| 1990 | Paper describing the AMPL modeling language was published inManagement Science[11] |
| 1991 | AMPL supportsnonlinear programming andautomatic differentiation |
| 1993 | Robert Fourer, David Gay andBrian Kernighan were awarded ORSA/CSTS Prize[12] by theOperations Research Society of America, for writings on the design of mathematical programming systems and the AMPL modeling language |
| 1995 | Extensions for representingpiecewise-linear and network structures |
| 1995 | Scripting constructs |
| 1997 | Enhanced support for nonlinear solvers |
| 1998 | AMPL supportscomplementarity theory problems |
| 2000 | Relational database and spreadsheet access |
| 2002 | Support for constraint programming[4] |
| 2003 | AMPL 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 fromLucent Technologies, Inc. |
| 2005 | AMPL Modeling Language Google group opened[13] |
| 2008 | Kestrel: An AMPL Interface to the NEOS Server introduced |
| 2012 | Robert Fourer, David Gay, andBrian Kernighan were awarded the 2012 INFORMS Impact Prize as the originators of one of the most important algebraic modeling languages.[14] |
| 2012 | AMPL book becomes freely available online[15] |
| 2013 | A new cross-platformintegrated development environment (IDE) for AMPL becomes available[16] |
| 2015 | New solver library MP.[10] |
| 2017 | AMPL becomes available within different programming languages throughAPIs.[9] |
A transportation problem fromGeorge 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.[17]
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;
Here is a partial list ofsolvers supported by AMPL:[18]
| Solver | Supported problem types |
|---|---|
| APOPT | mixed integernonlinear programming |
| Artelys Knitro | linear, quadratic and nonlinear programming |
| Bonmin | mixed integernonlinear programming |
| BPMPD | linear andquadratic programming |
| COIN-OR CBC | mixed integer programming |
| COIN-OR CLP | linear programming |
| CONOPT | nonlinear programming |
| Couenne[19] | mixed integer nonlinear programming (MINLP) |
| CPLEX | linear, quadratic,second-order cone and mixed integer programming |
| CPLEX CP Optimizer[20] | constraint programming |
| FILTER | nonlinear programming |
| FortMP | linear, quadratic and mixed integer programming |
| Gecode[21] | constraint programming |
| IPOPT | nonlinear programming |
| JaCoP[22] | constraint programming |
| LGO[23] | global and local nonlinear optimization |
| lp_solve[24] | 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 withmin andmax elementary functions. |
| SCIP | mixed integer programming |
| SNOPT | nonlinear programming |
| Sulum[25] | linear and mixed integer programming |
| WORHP | nonlinear programming |
| XA | linear and mixed integer programming |
| Xpress | linear and convexquadratic optimization and their mixed integer counterparts |