encyclopegia.org

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 Language) and is primarily used with the GNU Linear Programming Kit (GLPK).

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 Language) and is primarily used with the GNU Linear Programming Kit (GLPK). ==Overview== GNU MathProg provides a structured definition of data, decision variables, constraints, and objective functions. It allows users to describe complex optimisation problems in a human-readable form, separate from the solution algorithm. The language supports sets, parameters, variables, constraints, and objective functions, and offers features for reading external data and generating reports. Because of its syntactical similarity to AMPL, MathProg enables easy transition to commercial solvers for larger or more complex problems, while maintaining compatibility with free and open-source software tools. ==Features== Support for linear and mixed-integer linear programming AMPL-like syntax for easy model formulation Built-in data section for embedding problem data Compatibility with GLPK for solving and analysis Ability to import external data using table statements ==Usage== MathProg models are typically written in .mod files (sometimes .mpl) and solved using the GLPK solver via the glpsol command-line tool, a desktop or online interface. The general command-line usage pattern is: glpsol --math my-model.mod --data my-data.dat MathProg is particularly suited for educational purposes, small-scale optimisation, and rapid prototyping of models before deployment in more robust optimisation environments. ==Example== We want to maximise the profit of two products (A and B). The profit for one pallet of A is £80, and £100 for B. Both products rely on the same resources (time and materials). It takes two hours to produce one pallet of product A and four hours for B. The time is limited to 80 hours (per day). To produce one palette of A, we need 80 kg of material. Similarly, 60 kg of material is needed for one pallet of B. The common material for A and B is limited to 2400 kg. How many pallets of A and B must be produced to maximise the profit? The mathematical problem formulation is: \begin{align} &\underset{x_1,x_2}{\text{max}} & & 80x_1+100x_2 \\ & \text{subject to} & & \\ & & & 2x_1+4x_2 \leq 80 \\ & & & 80x_1+60x_2 \leq 2400\\ \end{align} The advantage of the MathProg is its similarity to the mathematical formulation. decision variables var x1; # product A var x2; # product B maximize pounds: 80*x1 + 100*x2; # objective constraints s.t. hours: 2*x1 + 4*x2 This example demonstrates the similarity of the MathProg model to the mathematical formulation. It contains an output code section, allowing the formatted display of essential values such as the objective and optimal decision values. For instance, the above output code generates: The optimal production per day is: 24.0 pallets of product A, 8.0 pallets of product B This will return a profit of 2720.00 pounds ==History== GNU MathProg was developed as part of the GNU Linear Programming Kit (GLPK) by Andrew Makhorin. It serves as an interface for users who prefer a declarative style of optimisation modelling without delving into the C API of GLPK. ==See also== Linear programming Operations research ==External links== GLPK official website MathProg Online solver ==References==

References

  1. Makhorin, Andrew (2008). Modeling Language GNU MathProg (PDF) . Vol. 63. Moscow Aviation Institute. Wikipedia revision 1366459276, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1366459276
    Cite this reference

    MLA "Makhorin, Andrew (2008). Modeling Language GNU MathProg (PDF) . Vol. 63. Moscow Aviation Institute. Wikipedia revision 1366459276, retrieved 2026-11-19." Makhorin, Andrew (2008). 2026-11-18. https://www.cs.unb.ca/~bremner/docs/glpk/gmpl.pdf. Accessed 24 November 2026.

    Chicago "Makhorin, Andrew (2008). Modeling Language GNU MathProg (PDF) . Vol. 63. Moscow Aviation Institute. Wikipedia revision 1366459276, retrieved 2026-11-19." Makhorin, Andrew (2008). 2026-11-18. https://www.cs.unb.ca/~bremner/docs/glpk/gmpl.pdf.

    APA Makhorin, Andrew (2008). (2026). Makhorin, Andrew (2008). Modeling Language GNU MathProg (PDF) . Vol. 63. Moscow Aviation Institute. Wikipedia revision 1366459276, retrieved 2026-11-19. Retrieved November 24, 2026, from https://www.cs.unb.ca/~bremner/docs/glpk/gmpl.pdf

Cite this article

MLA

"GNU MathProg." encyclopegia.org, 2026, https://encyclopegia.org/wiki/gnu-mathprog. Accessed 24 November 2026.

Chicago

"GNU MathProg." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/gnu-mathprog.

APA

encyclopegia.org. (2026). GNU MathProg. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/gnu-mathprog

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Ficulle

enwiki · references available

Guardea

enwiki · references available

Five-room puzzle

enwiki · references available

Lugnano in Teverina

enwiki · references available

Franchi LF-57

enwiki · references available

Thomas J. Perry

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1366459276 · 0.5 · snapshot enwiki-001366459276

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.