AMPL

Revision as of 19:12, 22 April 2025 by imported>Wgarn (Added internal link to MathProg)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:Use dmy dates Template:Infobox programming language

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).<ref name="ampl-book"> Template:Cite book </ref> 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.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

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<ref name="neos-uwm">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>) accept AMPL input. According to the NEOS statistics AMPL is the most popular format for representing mathematical programming problems.

FeaturesEdit

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

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:

Template:Cite journal </ref>

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.

AvailabilityEdit

AMPL is available for many popular 32 & 64-bit operating systems including Linux, macOS, Solaris, AIX, and Windows.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The translator is proprietary software maintained by AMPL Optimization LLC. However, several online services exist, providing free modeling and solving facilities using AMPL.<ref name="neos">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> A free student version with limited functionality and a free full-featured version for academic courses are also available.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

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 historyEdit

This table present significant steps in AMPL history.

Year Highlights
1985 AMPL was designed and implemented<ref name="ampl-book"/>
1990 Paper describing the AMPL modeling language was published in Management Science<ref>

Template:Cite journal </ref>

1991 AMPL supports nonlinear programming and automatic differentiation
1993 Robert Fourer, David Gay and Brian Kernighan were awarded ORSA/CSTS Prize<ref>{{#invoke:citation/CS1|citation CitationClass=web

}}</ref> by the Operations Research Society of America, for writings on the design of mathematical programming systems and the AMPL modeling language

1995 Extensions for representing piecewise-linear and network structures
1995 Scripting constructs
1997 Enhanced support for nonlinear solvers
1998 AMPL supports complementarity theory problems
2000 Relational database and spreadsheet access
2002 Support for constraint programming<ref name="cp-support" />
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 from Lucent Technologies, Inc.
2005 citation CitationClass=web

}}</ref>

2008 Kestrel: 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.<ref>{{#invoke:citation/CS1|citation CitationClass=web

}}</ref>

2012 citation CitationClass=web

}}</ref>

2013 A new cross-platform integrated development environment (IDE) for AMPL becomes available<ref>{{#invoke:citation/CS1|citation CitationClass=web

}}</ref>

Template:AnchorA sample modelEdit

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.<ref> Template:Cite book </ref> <syntaxhighlight lang="ampl">

set Plants;
set Markets;
# Capacity of plant p in cases
param Capacity{p in Plants};
# Demand at market m in cases
param Demand{m in Markets};
# Distance in thousands of miles
param Distance{Plants, Markets};
# Freight in dollars per case per thousand miles
param Freight;
# Transport cost in thousands of dollars per case
param TransportCost{p in Plants, m in Markets} :=
    Freight * Distance[p, m] / 1000;
# Shipment quantities in cases
var shipment{Plants, Markets} >= 0;
# Total transportation costs in thousands of dollars
minimize cost:
    sum{p in Plants, m in Markets} TransportCost[p, m] * shipment[p, m];
# Observe supply limit at plant p
s.t. supply{p in Plants}: sum{m in Markets} shipment[p, m] <= Capacity[p];
# Satisfy demand at market m
s.t. demand{m in Markets}: sum{p in Plants} shipment[p, m] >= Demand[m];
data;
set Plants := seattle san-diego;
set Markets := new-york chicago topeka;
param Capacity :=
    seattle   350
    san-diego 600;
param Demand :=
    new-york 325
    chicago  300
    topeka   275;
param Distance : new-york chicago topeka :=
    seattle        2.5      1.7     1.8
    san-diego      2.5      1.8     1.4;
param Freight := 90;

</syntaxhighlight>

SolversEdit

Here is a partial list of solvers supported by AMPL:<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Solver Supported problem types
APOPT mixed integer nonlinear programming
Artelys Knitro linear, quadratic and nonlinear programming
Bonmin mixed integer nonlinear programming
BPMPD linear and quadratic programming
COIN-OR CBC mixed integer programming
COIN-OR CLP linear programming
CONOPT nonlinear programming
Couenne<ref>{{#invoke:citation/CS1|citation CitationClass=web

}}</ref>

mixed integer nonlinear programming (MINLP)
CPLEX linear, quadratic, second-order cone and mixed integer programming
citation CitationClass=web

}}</ref>

constraint programming
FILTER nonlinear programming
FortMP linear, quadratic and mixed integer programming
Gecode<ref>{{#invoke:citation/CS1|citation CitationClass=web

}}</ref>

constraint programming
IPOPT nonlinear programming
JaCoP<ref>{{#invoke:citation/CS1|citation CitationClass=web

}}</ref>

constraint programming
citation CitationClass=web

}}</ref>

global and local nonlinear optimization
citation CitationClass=web

}}</ref>

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 Template:Math and Template:Math elementary functions.
SCIP mixed integer programming
SNOPT nonlinear programming
citation CitationClass=web

}}</ref>

linear and mixed integer programming
WORHP nonlinear programming
XA linear and mixed integer programming
Xpress linear and convex quadratic optimization and their mixed integer counterparts

See alsoEdit

|CitationClass=web }}</ref>

ReferencesEdit

Template:Reflist

External linksEdit

Template:Mathematical optimization software