Skip to content

Commit f0e265d

Browse files
committed
Updating README
1 parent 108b760 commit f0e265d

File tree

1 file changed

+25
-36
lines changed

1 file changed

+25
-36
lines changed

README.md

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# GrUMPy 0.9.2
2-
3-
## Now with Python 3 support!
1+
# GrUMPy 0.95
42

53
[![DOI](https://zenodo.org/badge/18217673.svg)](https://zenodo.org/badge/latestdoi/18217673)
64

@@ -30,38 +28,40 @@ pip install coinor.grumpy
3028
```
3129

3230
1. GrUMPy depends on [GiMPy](https://github.com/coin-or/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](http://www.graphviz.org) and choose one of these additional methods for display:
33-
* Recommended: [xdot 0.6](https://pypi.python.org/pypi/xdot).
34-
* Install with `pip install xdot==0.6`
35-
* Call `set_display_mode('xdot')`
36-
Note that xdot 0.6 depends on [PyGtk](http://www.pygtk.org/) (see below for platform-specific installation instructions for installing).
37-
* [Python Imaging Library](http://www.pythonware.com/products/pil/) and call `set_display_mode('PIL')`
38-
* [Pygame](pygame.org) and call `set_display_mode('pygame')`
39-
* Call `set_display_mode('file')` to just write files to disk that have to then be opened manually.
31+
* Recommended: [matplotlib](https://pypi.org/project/matplotlib/) and call
32+
`set_display_mode('matplotlib')
33+
* [Python Imaging Library](http://www.pythonware.com/products/pil/) and
34+
call `set_display_mode('PIL')`
35+
* Call `set_display_mode('file')` to just write files to disk that have to
36+
then be opened manually.
4037

41-
It is also possible to typeset labels in LaTex and to output the graph in LaTex format using `dot2tex` (**Warning**: recent versions of `dot2tex` have not perfectly, your mileage may vary). 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](https://github.com/Alwnikrotikz/dot2tex). For the former method, just using `easy_install dot2tex` should work fine.
38+
It is also possible to typeset labels in LaTex and to output the graph in
39+
LaTex format using `dot2tex` (**Warning**: recent versions of `dot2tex` have
40+
not perfectly, your mileage may vary). After installing `dot2tex`, this can be
41+
done by simply calling the method `write(basename='fileName', format='dot')`,
42+
and then doing `dot2tex --tmath fileName.dot` or by calling
43+
`set_display_mode('dot2tex')` and then `display()` as usual. At the moment,
44+
the latter only seems to work with version `2.9.0dev` available
45+
[here](https://github.com/Alwnikrotikz/dot2tex). For the former method, just
46+
using `easy_install dot2tex` should work fine.
47+
4248
1. GrUMPy also creates some visualizations with [gnuplot](https://sourceforge.net/projects/gnuplot/). For tips on installing `gnuplot`, see below.
4349
1. GrUMPy can also visualize 2D polyhedra with the installation of [pypolyhedron](https://github.com/tkralphs/pypolyhedron), which can be install with `pip install pypolyhedron`
4450

4551
# Additional Notes for Windows Installation
4652

4753
* To install Graphviz, download the installer [here](http://www.graphviz.org/Download.php). **Important**: after installing, you must manually add the graphviz `bin` directory (usually `C:\Program Files (x86)\Graphviz2.38\bin`) to your `PATH`
48-
* If you want to use `xdot`, there are some more requirements:
49-
* Unfortunately, you must have a 32-bit version of Python 2.7
50-
* You must install the [PyGtk version 2.22.6](http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/pygtk-all-in-one-2.22.6.win32-py2.7.msi). Version 2.24 is buggy on Windows.
51-
* To install `gnuplot`, download the installer [here](https://sourceforge.net/projects/gnuplot/). Note that the CYGWIN version of gnuplot may not work when called from Python.
54+
* To install `gnuplot`, download the installer [here](http://www.gnuplot.info/). Note that the CYGWIN version of gnuplot may not work when called from Python.
5255

5356
# Additional Notes for Linux Installation
5457

5558
* Graphviz can be installed as a package on most Linux distros, e.g., `sudo apt-get install graphviz`
56-
* To use `xdot`, you need to install PyGtk. On Debian/Ubuntu, do `sudo apt-get install python-gtk2`
57-
* Gnuplot should be available for installation with your favorite package manager.
59+
* Gnuplot should also be available for installation with your favorite package manager.
5860

5961
# Additional Notes for OS X Users
6062

6163
* The situation with Python on OS X is a bit of a mess. It is recommended to install python using [homebrew](http://brew.sh) with `brew install python`).
62-
* With homebbrew, one can also easily install graphviz (`brew install graphviz`), PyGtk (`brew install pygtk`), and gnuplot (`brew install gnuplot`)
63-
64-
There have been reports of incompatibilities with recent versions of PyGtk, but I have not attempted yet to track this down. If things break, you may try some variant of the instructions above for installing on Windows.
64+
* With homebbrew, one can also easily install graphviz (`brew install graphviz`) and gnuplot (`brew install gnuplot`)
6565

6666
## Examples of Visualizations
6767

@@ -217,23 +217,12 @@ for line in file:
217217
To display the visualizations, do
218218

219219
```python
220-
import sys
221-
import StringIO
222-
from PIL import Image as PIL_Image
223-
224-
#BAK-style visualizations
225-
226-
#gnuplot_image = StringIO.StringIO(bt.GenerateHistogram()
227-
gnuplot_image = StringIO.StringIO(bt.GenerateTreeImage())
228-
#gnuplot_image = StringIO.StringIO(bt.GenerateScatterplot()
229-
#gnuplot_image = StringIO.StringIO(bt.GenerateIncumbentPath()
230-
#gnuplot_image = StringIO.StringIO(bt.GenerateForecastImages()
231-
im = PIL_Image.open(gnuplot_image)
232-
im.show()
233-
234-
#GiMPy visualization (GraphViz)
220+
# BAK style
221+
bt.set_display_mode('matplotlib')
222+
bt.display('tree')
235223

236-
bt.set_display_mode('xdot')
224+
# Graphviz style
225+
bt.set_layout('dot')
237226
bt.display()
238227
```
239228

0 commit comments

Comments
 (0)