GiMPy 2.1
Graph Methods in Python (GiMPy) is a Python graph library containing pure Python implementations of a variety of graph algorithms. 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:
https://coin-or.github.io/GiMPy
Pypi download page is here:
https://pypi.python.org/pypi/coinor.gimpy
Installation Notes
To install, do
pip install coinor.gimpy
In order for GiMPy to visualize the graphs it produces, it's necessary to install
GraphViz (Important: after installing
graphviz, you must add the graphviz bin directory, usually
C:\Program Files (x86)\Graphviz2.38\bin, to your PATH)
and choose one of these additional methods for display:
- Recommended: matplotlib and call `set_display_mode('matplotlib')
- Python Imaging Library and
call
set_display_mode('PIL') - 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.
Additional Notes for Windows Installation
- To install Graphviz, download the installer here. Important: after installing, you must manually add the graphviz
bindirectory (usuallyC:\Program Files (x86)\Graphviz2.38\bin) to yourPATH - If you want to use
xdot, there are some more requirements:- Unfortunately, you must have a 32-bit version of Python 2.7
- You must install the PyGtk version 2.22.6. Version 2.24 is buggy on Windows.
- To install
gnuplot, download the installer here. Note that the CYGWIN version of gnuplot may not work when called from Python.
Additional Notes for Linux Installation
- Graphviz can be installed as a package on most Linux distros, e.g.,
sudo apt-get install graphviz
Additional Notes for OS X Users
- The situation with Python on OS X is a bit of a mess. It is recommended to install python using homebrew with
brew install python). - With homebbrew, one can also easily install graphviz (
brew install graphviz).
Examples
Forestry Model
Display Window in XDot
Lehigh ISE Prerequisite Graph
Graph of Actors Starring Together in Movies in IMDB
Branch and Bound Tree
SAT Game Tree
Flow Problem
Release files for coinor.gimpy 2.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coinor_gimpy-2.1.3.tar.gz | 59.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coinor_gimpy-2.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 114.8 kB
Release files / coinor_gimpy-2.1.3.tar.gz
| Download URL | coinor_gimpy-2.1.3.tar.gz |
|---|---|
| Size | 59.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4345abcdfe432cf75321150091c69dce8b4141879ab7a9b41d4098dc64c90ccc
|
|
BLAKE2b-256 checksum How to use checksums |
f6bd9def3f7ed5f29acfd231cd939528e205b45052c5167c5cea785ba965ca74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / coinor_gimpy-2.1.3-py3-none-any.whl
| Download URL | coinor_gimpy-2.1.3-py3-none-any.whl |
|---|---|
| Size | 55.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1591ee8029848ac53a667875b21eaf314d12845ce6db46c0027045294ac88bf8
|
|
BLAKE2b-256 checksum How to use checksums |
c2efd258089493acc2ef35c48953de74e2ddbc20f2fea1dcf89b81e7e8fdfe63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|