Home
Name Modified Size InfoDownloads / Week
pymprog-1.0 2018-03-08
v1.1.1 2018-01-23
v1.0.2 2017-04-10
v1.0.1 2017-03-31
pymprog-0.4 2010-01-08
pymprog 2009-09-26
pyglpk 2009-05-18
README.rst 2016-12-20 2.0 kB
Totals: 8 Items   2.0 kB 2

PyMathProg

An easy and flexible mathematical programming environment for Python.

Description

PyMathProg is a pythonic reincarnation of AMPL and GNU MathProg modeling language, implemented in pure Python, connecting to GLPK via swiglpk. Create, optimize, report, change and re-optimize your model with Python, easily integrate database, plotting, etc.

PyMathProg provides an easy and flexible modelling syntax using Python to create and optimize mathematical programming models. Optimization is done by open source optimization packages such as the GNU Linear Programming Kit (GLPK) that is made available to PyMathProg by swiglpk.

Great features offered by PyMathProg include:

  • Ergonomic syntax for modelling
  • Friendly interactive session
  • Sensitivity report
  • Advanced solver options
  • Automatic model update on parameter changes
  • Parameters sharable between models
  • Deleting variables/constraints
  • Supporting both Python 2 and 3
  • Supporting all major platforms

Installation

pip install pymprog

That's it. Since it is a pure Python project that only depends on swiglpk, it can be installed this way wherever swiglpk can be installed. Currently, swiglpk comes with binary wheels for Windows, Mac, and Linux. If you'd like to have PyMathProg installed on other platforms, the only hurdle to overcome is to get swiglpk installed there first.

Example

Below is a small example taken from the dive-in turorial in the PyMathProg Documentation:

from pymprog import *
begin('bike production')
x, y = var('x, y') # variables
maximize(15 * x + 10 * y, 'profit')
x <= 3 # mountain bike limit
y <= 4 # racer production limit
x + y <= 5 # metal finishing limit
solve()

Help in the following ways are more than welcome:

  1. tutorials and samples.
  2. bug reports
  3. feature requests
  4. code contribution

I hope you will find it useful.

Source: README.rst, updated 2016-12-20