AMPL (programming Language)
   HOME

TheInfoList



OR:

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 (e.g. 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 tasks, events, or actions are intended to take place, or of a sequence of events in the chronological order in which such things ...
-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 January 30, 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 ...
at
Bell Laboratories Nokia Bell Labs, commonly referred to as ''Bell Labs'', is an American industrial research and development company owned by Finnish technology company Nokia. With headquarters located in Murray Hill, New Jersey, the company operates several lab ...
. 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 Library (computing), software library, that 'solves' a mathematical problem. A solver takes problem descriptions in some sort of generic ...
s, both
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
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 ...
, including CBC,
CPLEX IBM ILOG CPLEX Optimization Studio (often informally referred to simply as CPLEX) is an optimization software package. History The CPLEX Optimizer was named after the simplex method implemented in the C programming language. However, today ...
,
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 explore ...
,
MOSEK MOSEK is a software package for the solution of linear, mixed-integer linear, quadratic, mixed-integer quadratic, quadratically constrained, conic and convex nonlinear mathematical optimization problems. The applicability of the solver varies wi ...
,
MINOS Main injector neutrino oscillation search (MINOS) was a particle physics experiment designed to study the phenomena of neutrino oscillations, first discovered by a Super-Kamiokande (Super-K) experiment in 1998. Neutrinos produced by the NuMI ...
,
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 C++ (after migrating from Fortran and C) and is released under the EPL ( ...
,
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++, ...
,
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 criteria, from some set of available alternatives. It is generally divided into two subfiel ...
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 criteria, from some set of available alternatives. It is generally divided into two subfiel ...
. 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 Solver, optimization solvers. Its library of solvers includes more than 60 commercial, free and open source solvers, which can be applied to mat ...
(formerly hosted at the
Argonne National Laboratory Argonne National Laboratory is a Federally funded research and development centers, federally funded research and development center in Lemont, Illinois, Lemont, Illinois, United States. Founded in 1946, the laboratory is owned by the United Sta ...
, currently hosted at the
University of Wisconsin, Madison A university () is an institution of tertiary education and research which awards academic degrees in several academic disciplines. ''University'' is derived from the Latin phrase , which roughly means "community of teachers and scholars". Univ ...
) 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 Declarative may refer to: * Declarative learning, acquiring information that one can speak about * Declarative memory, one of two types of long term human memory * Declarative programming, a computer programming paradigm * Declarative sentence, a t ...
and imperative programming styles. Formulating optimization models occurs via declarative language elements such as sets, scalar and multidimensional parameters, decision variables, objectives and
constraints Constraint may refer to: * Constraint (computer-aided design), a demarcation of geometrical characteristics between two or more entities or solid modeling bodies * Constraint (mathematics), a condition of an optimization problem that the solution m ...
, 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 '' ...
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 c ...
s,
database In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
s,
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
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 and objective are represented by linear function#As a polynomia ...
*
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 constr ...
*
Nonlinear programming In mathematics, nonlinear programming (NLP) is the process of solving an optimization problem where some of the constraints are not linear equalities or the objective function is not a linear function. An optimization problem is one of calculation ...
*
Mixed-integer programming An integer programming problem is a mathematical optimization or feasibility program in which some or all of the variables are restricted to be integers. In many settings the term refers to integer linear programming (ILP), in which the objective ...
* 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 polytop ...
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 operations research, applied mathematics, and numerical analysis that attempts to find the global minimum or maximum of a function or a set of functions on a given set. It is usually described as a minimization ...
*
Semidefinite programming Semidefinite programming (SDP) is a subfield of mathematical programming 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 po ...
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 pro ...
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 t ...
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 system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s including
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
,
Solaris Solaris is the Latin word for sun. It 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 ** ''Sol ...
,
AIX Aix or AIX may refer to: Computing * AIX, a line of IBM computer operating systems *Alternate index, for an IBM Virtual Storage Access Method key-sequenced data set * Athens Internet Exchange, a European Internet exchange point Places Belg ...
, and
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
. 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 editor developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android, iOS and iPadOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a ...
via the
SolverStudio SolverStudio is a free Excel plug-in developed at the University of Auckland that supports optimization and simulation modelling in a spreadsheet using an algebraic modeling language. It is popular in education, the public sector and industr ...
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. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
/ 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. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
* shipment
, m The comma is a punctuation mark that appears in several variants in different languages. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
# 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. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
<= 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. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
>= 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 Library (computing), software library, that 'solves' a mathematical problem. A solver takes problem descriptions in some sort of generic ...
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 GNU MathProg is a high-level mathematical modelling language designed for creating and solving linear programming (LP), mixed integer programming (MIP), and other related optimisation problems. It is a subset of the AMPL (A Mathematical Programming ...
(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 fo ...


References


External links

*
Prof. Fourer's home page
at
Northwestern University Northwestern University (NU) is a Private university, private research university in Evanston, Illinois, United States. Established in 1851 to serve the historic Northwest Territory, it is the oldest University charter, chartered university in ...
{{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