AMPL

AMPL

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).[1] 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.[2]

Quick Facts Paradigm, Designed by ...

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[3]) 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:

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.[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 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.

More information Year, Highlights ...

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.[15]

 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:[16]

More information Solver, Supported problem types ...

See also


References

  1. Fourer, Robert; Gay, David M; Kernighan, Brian W (2003). AMPL: a modeling language for mathematical programming. USA: Duxbury Press/Brooks/Cole Publishing Company. ISBN 978-0-534-38809-6.
  2. "Position Available". Archived from the original on 11 September 2011. Retrieved 29 July 2011.
  3. "About". Retrieved 11 August 2015.
  4. "Platforms". AMPL Optimizations Inc. Archived from the original on 14 May 2022. Retrieved 1 November 2019.
  5. "NEOS Server for Optimization". Retrieved 11 August 2015.
  6. "Try AMPL!". Retrieved 11 August 2015.
  7. "AMPL Downloads". Archived from the original on 26 May 2015. Retrieved 11 August 2015.
  8. Fourer, Robert; Gay, David M.; Kernighan, Brian W. (1990). "A Modeling Language for Mathematical Programming" (PDF). Management Science. 36 (5): 519–554–83. doi:10.1287/mnsc.36.5.519.
  9. INFORMS. "ICS - INFORMS" (PDF). Archived from the original (PDF) on 7 October 2006. Retrieved 11 August 2015.
  10. INFORMS. "INFORMS Impact Prize". Archived from the original on 22 October 2013. Retrieved 11 August 2015.
  11. "Google Groups". Retrieved 11 August 2015.
  12. Dantzig, George (2016) [1963]. "3. Formulating a Linear Programming Model". Linear Programming and Extensions. Princeton University Press. pp. 32–62. ISBN 978-1-4008-8417-9.
  13. "Solvers - AMPL". Archived from the original on 27 February 2014. Retrieved 21 January 2018.
  14. "Couenne". Archived from the original on 29 October 2013. Retrieved 27 October 2013.
  15. "LGO - AMPL". Retrieved 11 August 2015.
  16. "Using lpsolve from AMPL". Retrieved 11 August 2015.
  17. "GLPK official site". Retrieved 17 September 2020.

Share this article:

This article uses material from the Wikipedia article AMPL, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.