AMPL (A Mathematical Programming Language) is an
algebraic modeling language Algebraic modeling languages (AML) are high-level computer programming languages for describing and solving high complexity problems for large scale mathematical computation (i.e. large scale optimization type problems). One particular advantage of ...
to describe and solve high-complexity problems for large-scale mathematical computing (i.e., large-scale optimization and
scheduling
A schedule or a timetable, as a basic time-management tool, consists of a list of times at which possible task (project management), tasks, events, or actions are intended to take place, or of a sequence of events in the chronological order ...
-type problems).
[
]
It was developed by
Robert Fourer
Robert Fourer (born September 2, 1950) is a scientist working in the area of operations research and management science. He is currently President of AMPL Optimization, Inc and is Professor Emeritus of Industrial Engineering and Management Science ...
, David Gay, and
Brian Kernighan
Brian Wilson Kernighan (; born 1942) is a Canadian computer scientist.
He worked at Bell Labs and contributed to the development of Unix alongside Unix creators Ken Thompson and Dennis Ritchie. Kernighan's name became widely known through co-au ...
at
Bell Laboratories
Nokia Bell Labs, originally named Bell Telephone Laboratories (1925–1984),
then AT&T Bell Laboratories (1984–1996)
and Bell Labs Innovations (1996–2007),
is an American industrial research and scientific development company owned by mult ...
.
AMPL supports dozens of
solver
A solver is a piece of mathematical software, possibly in the form of a stand-alone computer program or as a software library, that 'solves' a mathematical problem. A solver takes problem descriptions in some sort of generic form and calculates t ...
s, both
open source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
and
commercial software
Commercial software, or seldom payware, is a computer software that is produced for sale or that serves commercial purposes. Commercial software can be proprietary software or free and open-source software.
Background and challenge
While soft ...
, including CBC,
CPLEX
IBM ILOG CPLEX Optimization Studio (often informally referred to simply as CPLEX) is an optimization software package. In 2004, the work on CPLEX earned the first INFORMS Impact Prize.
History
The CPLEX Optimizer was named for the simplex me ...
,
FortMP
FortMP is a software package for solving large-scale optimization problems. It solves linear programming problems, quadratic programming problems and mixed integer programming problems (both linear and quadratic). Its robustness has been explored ...
,
MINOS
In Greek mythology, Minos (; grc-gre, Μίνως, ) was a King of Crete, son of Zeus and Europa. Every nine years, he made King Aegeus pick seven young boys and seven young girls to be sent to Daedalus's creation, the labyrinth, to be eaten ...
,
IPOPT
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 (formerly CPL). IPOPT implemen ...
,
SNOPT
SNOPT, for Sparse Nonlinear OPTimizer, is a software package for solving large-scale nonlinear optimization problems written by Philip Gill, Walter Murray and Michael Saunders. SNOPT is mainly written in Fortran, but interfaces to C, C++, Pyth ...
,
KNITRO
Artelys Knitro is a commercial software package for solving large scale nonlinear mathematical optimization problems.
KNITRO – (the original solver name) short for "Nonlinear Interior point Trust Region Optimization" (the "K" is silent) – wa ...
, 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
Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
problems. This allows for a very concise and readable definition of problems in the domain of
optimization
Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
. Many modern solvers available on the
NEOS Server 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 mathemati ...
(formerly hosted at the
Argonne National Laboratory
Argonne National Laboratory is a science and engineering research United States Department of Energy National Labs, national laboratory operated by University of Chicago, UChicago Argonne LLC for the United States Department of Energy. The facil ...
, currently hosted at the
University of Wisconsin, Madison
A university () is an institution of higher (or tertiary) education and research which awards academic degrees in several academic disciplines. Universities typically offer both undergraduate and postgraduate programs. In the United States, t ...
) 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
In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an ''imper ...
statements are available in AMPL for
* the exchange of data with external data sources such as
spreadsheet
A spreadsheet is a computer application for computation, organization, analysis and storage of data in tabular form. Spreadsheets were developed as computerized analogs of paper accounting worksheets. The program operates on data entered in cel ...
s,
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
s,
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
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
Linear programming (LP), also called linear optimization, is a method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear function#As a polynomial function, li ...
*
Quadratic programming
Quadratic programming (QP) is the process of solving certain mathematical optimization problems involving quadratic functions. Specifically, one seeks to optimize (minimize or maximize) a multivariate quadratic function subject to linear constra ...
*
Nonlinear programming
In mathematics, nonlinear programming (NLP) is the process of solving an optimization problem where some of the constraints or the objective function are nonlinear. An optimization problem is one of calculation of the extrema (maxima, minima or sta ...
*
Mixed-integer programming
* Mixed-integer quadratic programming with or without
convex
Convex or convexity may refer to:
Science and technology
* Convex lens, in optics
Mathematics
* Convex set, containing the whole line segment that joins points
** Convex polygon, a polygon which encloses a convex set of points
** Convex polytope ...
quadratic constraints
* Mixed-integer nonlinear programming
*
Second-order cone programming
A second-order cone program (SOCP) is a convex optimization problem of the form
:minimize \ f^T x \
:subject to
::\lVert A_i x + b_i \rVert_2 \leq c_i^T x + d_i,\quad i = 1,\dots,m
::Fx = g \
where the problem parameters are f \in \mathbb^n, ...
*
Global optimization
Global optimization is a branch of applied mathematics and numerical analysis that attempts to find the global minima or maxima of a function or a set of functions on a given set. It is usually described as a minimization problem because the max ...
*
Semidefinite programming Semidefinite programming (SDP) is a subfield of convex optimization concerned with the optimization of a linear objective function (a user-specified function that the user wants to minimize or maximize)
over the intersection of the cone of positive ...
problems with
bilinear matrix inequalities
*
Complementarity theory
A complementarity problem is a type of mathematical optimization problem. It is the problem of optimizing (minimizing or maximizing) a function of two vector variables subject to certain requirements (constraints) which include: that the inner pr ...
problems (MPECs) in discrete or continuous variables
*
Constraint programming
Constraint programming (CP) is a paradigm for solving combinatorial problems that draws on a wide range of techniques from artificial intelligence, computer science, and operations research. In constraint programming, users declaratively state th ...
[
]
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- and 64-bit
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s including
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
,
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
,
Solaris
Solaris may refer to:
Arts and entertainment Literature, television and film
* ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem
** ''Solaris'' (1968 film), directed by Boris Nirenburg
** ''Solaris'' (1972 film), directed by ...
,
AIX
Aix or AIX may refer to:
Computing
* AIX, a line of IBM computer operating systems
*An Alternate Index, for a Virtual Storage Access Method Key Sequenced Data Set
* Athens Internet Exchange, a European Internet exchange point
Places Belgi ...
, and
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
.
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
Microsoft Excel is a spreadsheet developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android and iOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a macro (comp ...
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.
A sample model
A transportation problem from
George Dantzig
George Bernard Dantzig (; November 8, 1914 – May 13, 2005) was an American mathematical scientist who made contributions to industrial engineering, operations research, computer science, economics, and statistics.
Dantzig is known for his dev ...
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.
set Plants;
set Markets;
# Capacity of plant p in cases
param Capacity;
# Demand at market m in cases
param Demand;
# Distance in thousands of miles
param Distance;
# Freight in dollars per case per thousand miles
param Freight;
# Transport cost in thousands of dollars per case
param TransportCost :=
Freight * Distance, m
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
/ 1000;
# Shipment quantities in cases
var shipment >= 0;
# Total transportation costs in thousands of dollars
minimize cost:
sum TransportCost, m
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
* shipment, m
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
# Observe supply limit at plant p
s.t. supply: sum shipment, m
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
<= Capacity
# Satisfy demand at market m
s.t. demand: sum shipment, m
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
>= Demand
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
solver
A solver is a piece of mathematical software, possibly in the form of a stand-alone computer program or as a software library, that 'solves' a mathematical problem. A solver takes problem descriptions in some sort of generic form and calculates t ...
s supported by AMPL:
See also
*
sol (format)
sol is a file format for representing solutions of mathematical programming problems. It is often used in conjunction with the nl format to return solutions from the solvers. Initially this format has been invented for connecting solvers to ...
* GNU MathProg (previously known as GMPL) is a subset of AMPL supported by the
GNU Linear Programming Kit
The GNU Linear Programming Kit (GLPK) is a software package intended for solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems. It is a set of routines written in ANSI C and organized in the form ...
References
External links
*
Prof. Fourer's home pageat
Northwestern University
Northwestern University is a private research university in Evanston, Illinois. Founded in 1851, Northwestern is the oldest chartered university in Illinois and is ranked among the most prestigious academic institutions in the world.
Charte ...
{{DEFAULTSORT:Ampl
1990 software
Computer algebra systems
Mathematical modeling
Mathematical optimization software
Numerical programming languages
Scripting languages
Text-oriented programming languages
Programming languages created in 1985
Proprietary cross-platform software