AMPL
{{Short description|Algebraic modeling language}}
{{Use dmy dates|date=November 2020}}
{{Infobox programming language
| name = AMPL
| logo = File:AMPL (textbook cover).jpg
| caption =
| designers = Robert Fourer
David Gay
Brian Kernighan
Bell Labs
| paradigm = Multi-paradigm: declarative, imperative
| developer = AMPL Optimization, Inc.
| released = {{Start date and age|1985}}
| latest release version = 20230430
| latest release date = {{Start date and age|df=yes|2023|04|30}}
| latest test version =
| latest test date =
| typing =
| implementations =
| dialects =
| operating system = Cross-platform: Linux, macOS, Solaris, AIX, Windows
| license = Proprietary (translator),
free and open-source (AMPL Solver Library)
| genre = Algebraic modeling language (AML)
| website = {{URL|www.ampl.com}}
| file ext = .mod, .dat, .run
}}
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).
{{cite book
| last1 = Fourer | first1 = Robert
| last2 = Gay | first2 = David M
| last3 = Kernighan | first3 = Brian W
| author-link1 = Robert Fourer
| author-link3 = Brian Kernighan
| title = AMPL: a modeling language for mathematical programming
| date = 2003
| publisher = Duxbury Press/Brooks/Cole Publishing Company
| location = USA
| isbn = 978-0-534-38809-6
}}
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.{{cite web
| title=Position Available
| url=http://www.ampl.com/OPENINGS/2011July.html#Product
| access-date=2011-07-29
| archive-date=11 September 2011
| archive-url=https://web.archive.org/web/20110911191129/http://www.ampl.com/OPENINGS/2011July.html#Product
| url-status=dead
}}
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{{cite web|url=http://neos-guide.org/About/|title=About|access-date=11 August 2015}}) 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
- 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:
- Linear programming
- Quadratic programming
- Nonlinear programming
- Mixed-integer programming
- Mixed-integer quadratic programming with or without convex quadratic constraints
- Mixed-integer nonlinear programming
- Second-order cone programming
- Global optimization
- Semidefinite programming problems with bilinear matrix inequalities
- Complementarity theory problems (MPECs) in discrete or continuous variables
- Constraint programming
{{Cite journal
|author-link = Robert Fourer
| title = Extending an Algebraic Modeling Language to Support Constraint Programming
| journal = INFORMS Journal on Computing
| volume = 14
| issue = 4
| pages = 322–344
| year = 2002
| url = http://joc.journal.informs.org/content/14/4/322
| doi=10.1287/ijoc.14.4.322.2825| last1 = Fourer
| first1 = Robert
| last2 = Gay
| first2 = David M.
| citeseerx = 10.1.1.8.9699
}}
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.
Availability
AMPL is available for many popular 32 & 64-bit operating systems including Linux, macOS, Solaris, AIX, and Windows.{{cite web|url=https://ampl.com/products/platforms/|title=Platforms|website=AMPL Optimizations Inc.|access-date=1 November 2019|archive-date=14 May 2022|archive-url=https://web.archive.org/web/20220514181833/https://ampl.com/products/platforms/|url-status=dead}}
The translator is proprietary software maintained by AMPL Optimization LLC. However, several online services exist, providing free modeling and solving facilities using AMPL.{{cite web|url=http://www.neos-server.org/neos/|title=NEOS Server for Optimization|access-date=11 August 2015}}{{cite web|url=http://www.ampl.com/TRYAMPL/|title=Try AMPL!|access-date=11 August 2015}} A free student version with limited functionality and a free full-featured version for academic courses are also available.{{cite web|url=http://www.ampl.com/DOWNLOADS/index.html|title=AMPL Downloads|access-date=11 August 2015|archive-url=https://web.archive.org/web/20150526013237/http://www.ampl.com/DOWNLOADS/index.html|archive-date=26 May 2015|url-status=dead}}
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.
class="wikitable" |
Year
! Highlights |
---|
1985 |
1990
| Paper describing the AMPL modeling language was published in Management Science {{Cite journal | author-link1 = Robert Fourer | author-link3 = Brian W. Kernighan | title = A Modeling Language for Mathematical Programming | journal = Management Science | volume = 36 | issue = 5 | pages = 519–554–83 | year = 1990 | url = http://www.ampl.com/REFS/amplmod.pdf | doi=10.1287/mnsc.36.5.519| last1 = Fourer | first1 = Robert | last2 = Gay | first2 = David M. | last3 = Kernighan | first3 = Brian W. }} |
1991
| AMPL supports nonlinear programming and automatic differentiation |
1993
| Robert Fourer, David Gay and Brian Kernighan were awarded ORSA/CSTS Prize{{cite web|url=http://computing.society.informs.org/pdf/GreenbergHistory.pdf|title=ICS - INFORMS|author=INFORMS|access-date=11 August 2015|archive-date=7 October 2006|archive-url=https://web.archive.org/web/20061007164141/http://computing.society.informs.org/pdf/GreenbergHistory.pdf|url-status=dead}} 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 |
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
| AMPL Modeling Language Google group opened{{Cite web | url=https://groups.google.com/group/ampl | title=Google Groups}} |
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.{{cite web|url=http://www.informs.org/Blogs/E-News-Blog/INFORMS-Impact-Prize|title=INFORMS Impact Prize|author=INFORMS|access-date=11 August 2015|archive-url=https://web.archive.org/web/20131022091250/https://www.informs.org/Blogs/E-News-Blog/INFORMS-Impact-Prize|archive-date=22 October 2013|url-status=dead}} |
2012
| AMPL book becomes freely available online{{cite web|url=https://ampl.com/learn/ampl-book/|title=The AMPL Book: A comprehensive guide to building optimization models, for beginning or experienced users|access-date=5 March 2021}} |
2013
| A new cross-platform integrated development environment (IDE) for AMPL becomes available{{cite web|url=https://groups.google.com/forum/#!topic/ampl/y1FJcYZz-_Q|title=Google Groups|access-date=11 August 2015}} |
{{anchor|example}}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.
{{cite book |first=George |last=Dantzig |author-link=George Dantzig |chapter=3. Formulating a Linear Programming Model |title=Linear Programming and Extensions |chapter-url=https://books.google.com/books?id=hUWPDAAAQBAJ&pg=PA32 |date=2016 |orig-year=1963 |publisher=Princeton University Press |isbn=978-1-4008-8417-9 |pages=32–62}}
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;
Solvers
Here is a partial list of solvers supported by AMPL:{{cite web|url=http://www.ampl.com/solvers.html|title=Solvers - AMPL|access-date=21 January 2018|archive-date=27 February 2014|archive-url=https://web.archive.org/web/20140227083015/http://www.ampl.com/solvers.html|url-status=dead}}
See also
- sol (format)
- GNU MathProg (previously known as GMPL) is a subset of AMPL supported by the GNU Linear Programming Kit{{cite web|url=https://www.gnu.org/software/glpk/|title=GLPK official site|access-date=17 September 2020}}
References
{{Reflist|30em}}
External links
- {{Official website|www.ampl.com}}
- [https://web.archive.org/web/20061127232734/http://iems.northwestern.edu/~4er/ Prof. Fourer's home page] at Northwestern University
{{Mathematical optimization software}}
{{DEFAULTSORT:Ampl}}
Category:Computer algebra systems
Category:Mathematical modeling
Category:Mathematical optimization software
Category:Numerical programming languages
Category:Text-oriented programming languages