Skip to main content
Log in

Pyomo: modeling and solving mathematical programs in Python

  • Full Length Paper
  • Published:
Mathematical Programming Computation Aims and scope Submit manuscript

Abstract

We describe Pyomo, an open source software package for modeling and solving mathematical programs in Python. Pyomo can be used to define abstract and concrete problems, create problem instances, and solve these instances with standard open-source and commercial solvers. Pyomo provides a capability that is commonly associated with algebraic modeling languages such as AMPL, AIMMS, and GAMS. In contrast, Pyomo’s modeling objects are embedded within a full-featured high-level programming language with a rich set of supporting libraries. Pyomo leverages the capabilities of the Coopr software library, which together with Pyomo is part of IBM’s COIN-OR open-source initiative for operations research software. Coopr integrates Python packages for defining optimizers, modeling optimization applications, and managing computational experiments. Numerous examples illustrating advanced scripting applications are provided.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. ACRO: ACRO optimization framework (2009). http://software.sandia.gov/acro

  2. AIMMS: AIMMS home page (2008). http://www.aimms.com

  3. AMPL: AMPL home page (2008). http://www.ampl.com/

  4. Anbalagan, P., Vouk, M.: On reliability analysis of open source software—FEDORA. In: 19th International Symposium on Software Reliability Engineering (2008)

  5. APLEpy: APLEpy: an open source algebraic programming language extension for Python (2005). http://aplepy.sourceforge.net/

  6. Bertsimas D., Tsitsiklis J.N.: Introduction to Linear Optimization. Athena Scientific/Dynamic Ideas, Belmont (1997)

    Google Scholar 

  7. Birge J.R., Louveaux F.: Introduction to Stochastic Programming. Springer, Berlin (1997)

    MATH  Google Scholar 

  8. Bonmin: The Bonmin wiki page (2011). https://projects.coin-or.org/Bonmin

  9. BSD: Open Source Initiative (OSI)—the BSD license (2009). http://www.opensource.org/licenses/bsd-license.php

  10. COINOR: COIN-OR home page (2009). http://www.coin-or.org

  11. Forrester Consulting: Open source software’s expanding role in the enterprise (2007). http://www.unisys.com/eprise/main/admin/corporate/doc/Forrester_research-open_source_buying_behaviors.pdf

  12. COOPR: Coopr: A common optimization python repository (2009). http://software.sandia.gov/coopr

  13. CUTEr: Cuter: A constrained and unconstrained testing environment, revisited (2011). http://www.hsl.rl.ac.uk/cuter-www/index.html

  14. CVXOPT: CVXOPT home page (2008). http://abel.ee.ucla.edu/cvxopt

  15. Dimitrov: Nedialki Dimitrov, naval postgraduate school. Personal Communication (2011)

  16. Dolan E.D., Fourer R., Goux J.-P., Munson T.S., Sarich J.: Kestrel: an interface from optimization modeling systems to the NEOS server. INFORMS J Comput 20(4), 525–538 (2008)

    Article  MathSciNet  Google Scholar 

  17. FLOPC++: FLOPC++ home page (2008).https://projects.coin-or.org/FlopC++

  18. Fourer R., Gay D.M., Kernighan B.W.: AMPL: a mathematical programming language. Manag. Sci. 36, 519–554 (1990)

    Article  MATH  Google Scholar 

  19. Fourer R., Gay D.M., Kernighan B.W.: AMPL: a Modeling Language for Mathematical Programming, 2nd edn. Brooks/Cole Thomson Learning, Pacific Grove (2003)

    Google Scholar 

  20. Fourer R., Ma J., Martin K.: Optimization services: a framework for distributed optimization. Oper. Res. 58(6), 1624–1636 (2010)

    Article  MathSciNet  Google Scholar 

  21. GAMS: GAMS home page (2008). http://www.gams.com

  22. Geoffrion A.M.: An introduction to structured modeling. Manag. Sci. 33(5), 547–588 (1987)

    Article  Google Scholar 

  23. GLPK: GLPK: GNU linear programming toolkit (2009). http://www.gnu.org/software/glpk/

  24. GPL: GNU general public license (2009). http://www.gnu.org/licenses/gpl.html

  25. Hackebeil, G., Laird, C.: Global optimization for estimation of on/off seasonality in infectious disease spread using pyomo (2010). https://software.sandia.gov/trac/coopr/attachment/wiki/Pyomo/global_opt.pptx

  26. Hart, W.E.: Python Optimization Modeling Objects (Pyomo). In: Chinneck, J.W., Kristjansson, B., Saltzman, M.J. (eds.) Operations Research and Cyber-Infrastructure (2009). doi:10.1007/978-0-387-88843-9_1

  27. Hart W.E., Phillips C.A., Berry J., Boman E.G. et al.: US Environmental Protection Agency uses operations research to reduce contamination risks in drinking water. INFORMS Interfaces 39, 57–68 (2009)

    Google Scholar 

  28. Hebrard, E., O’Mahony, E., O’Sullivan, B.: Constraint Programming and Combinatorial Optimisation in Numberjack. In: Lodi, A., Milano, M., Toth, P. (eds.) Proceedings of CPAIOR 2010, LNCS, vol. 6140. Springer, Berlin (2010)

  29. Ipopt: The Ipopt wiki page (2011). https://projects.coin-or.org/Ipopt

  30. Jones, E., Oliphant, T., Peterson, P., et al.: SciPy: open source scientific tools for Python (2009). http://www.scipy.org/

  31. Kallrath J.: Modeling Languages in Mathematical Optimization. Kluwer, Dordrecht (2004)

    MATH  Google Scholar 

  32. Karabuk, S., Grant, F.H.: A common medium for programming operations-research models. In: Proceedings of the IEEE Software, pp. 39–47 (2007)

  33. Marsten R.E.: The design of the XMP linear programming library. ACM Trans. Math. Softw. 7(4), 481–497 (1981)

    Article  Google Scholar 

  34. Oliphant, T.E.: Python for scientific computing. Computing in Science and Engineering, pp. 10–20 (2007)

  35. OpenOpt: OpenOpt home page (2008). http://scipy.org/scipy/scikits/wiki/OpenOpt

  36. OptimJ: Ateji home page (2008). http://www.ateji.com

  37. Ortools: Google OR tools—operations research tools developed at Google (2011). http://code.google.com/p/or-tools

  38. Prechelt, L.: An empirical comparison of seven programming languages. Computer 33(10), 23–29 (2000). doi:10.1109/2.876288. ISSN: 0018-9162

    Google Scholar 

  39. Psyco: Psyco (2008). http://psyco.sourceforge.net/

  40. PuLP: PuLP: a Python linear programming modeler (2008). http://130.216.209.237/engsci392/pulp/FrontPage

  41. PyMathProg: PyMathProg home page (2009). http://pymprog.sourceforge.net/

  42. PyPI: Python package index (2009). http://pypi.python.org/pypi

  43. PYRO: PYRO: Python remote objects (2009). http://pyro.sourceforge.net

  44. Python: Python programming language—official website (2009). http://python.org

  45. PythonVSJava: Python & Java: a side-by-side comparison (2008). http://www.ferg.org/projects/python_java_side-by-side.html

  46. PyUtilib: PyUtilib optimization framework (2009). http://software.sandia.gov/pyutilib

  47. Roelofs, M., Bisschop, J.: AIMMS 3.9—The User’s Guide (2009). http://lulu.com

  48. Sayfan, G.: Building your own plugin framework. Dr. Dobbs J. (2007)

  49. Shapiro, A., Dentcheva, D., Ruszczynski, A.: Lectures on Stochastic Programming: Modeling and Theory. Society for Industrial and Applied Mathematics (2009)

  50. Sage, W.S.: Open Source Mathematical Software (Version 2.10.2). The Sage Group (2008). http://www.sagemath.org

  51. Szyperski C.: Component Software: Beyond Object-Oriented Programming. ACM Press, New York (1998)

    Google Scholar 

  52. TOMLAB: TOMLAB optimization environment (2008). http://www.tomopt.com/tomlab

  53. Tratt L.: Dynamically typed languages. Adv. Comput. 77, 149–184 (2009)

    Article  Google Scholar 

  54. Watson, J.-P., Woodruff, D.L., Hart, W.E.: Pysp: modeling and solving stochastic programs in python (2010). https://software.sandia.gov/trac/coopr/attachment/wiki/PySP/pysp_jnl.pdf

  55. YAML: The official YAML web site (2009). http://yaml.org/

  56. Zhou Y., Davis J.: Open source software reliability model: an empirical approach. ACM SIGSOFT Softw. Eng. Notes 30, 1–6 (2005)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to William E. Hart.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Hart, W.E., Watson, JP. & Woodruff, D.L. Pyomo: modeling and solving mathematical programs in Python. Math. Prog. Comp. 3, 219–260 (2011). https://doi.org/10.1007/s12532-011-0026-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12532-011-0026-8

Keywords

Mathematics Subject Classification (2000)

Navigation