Skip to content

a Python library for visualizing various aspects of mathematical programming

License

Notifications You must be signed in to change notification settings

CHEN-JIANGHANG/GrUMPy

 
 

Repository files navigation

#GrUMPy 0.8

Graphics for Understanding Mathematical Programming in Python (GrUMPy) is a Python library for visualizing various aspects of mathematical programming, including visualizations of the branch-and process, branch-and-bound trees, polyhedra, cutting plane methods, etc. The goal is clarity in implementation rather than eficiency. Most methods have an accompanying visualization and are thus appropriate for use in the classroom.

Documentation for the API is here:

http://pythonhosted.org/coinor.grumpy

Installation:

easy_install coinor.grumpy

##Installation Notes

  1. GrUMPy depends on GiMPy, which will be automatically installed as part of the setup. However, in order for GiMPy to visualize the branch-and-bound tree, it's necessary to install GraphViz and choose one of these additional methods for display:
  • Recommanded: xdot along with PyGtk and call set_display_mode('xdot')
  • Python Imaging Library and call set_display_mode('PIL')
  • Pygame and call set_display_mode('pygame')
  • Call set_display_mode('file') to just write files to disk that have to then be opened manually.

It is also possible to typeset labels in LaTex and to output the graph in LaTex format using dot2tex. After installing dot2tex, this can be done by simply calling the method write(basename='fileName', format='dot'), and then doing dot2tex --tmath fileName.dot or by calling set_display_mode('dot2tex') and then display() as usual. At the moment, the latter only seems to work with version 2.9.0dev available here. For the former method, just using easy_install dot2tex should work fine. 2. GrUMPy can also visualize 2D polyhedra with the installation of pypolyhedron, which must be installed from source.

##Examples

Branch and bound tree

Figure 1 made with GrUMPy

Figure 2 made with GrUMPy

Figure 3 made with GrUMPy

About

a Python library for visualizing various aspects of mathematical programming

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 50.9%
  • Python 37.6%
  • Makefile 11.5%