Skip to main content

Graph Methods in Python

Project description

GiMPy 2.1

DOI

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 bin directory (usually C:\Program Files (x86)\Graphviz2.38\bin) to your PATH
  • 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

Forestry

Display Window in XDot

XDot

Lehigh ISE Prerequisite Graph

ISE Prerequisites

Graph of Actors Starring Together in Movies in IMDB

Bacon

Branch and Bound Tree

Branch and Bound

SAT Game Tree

SAT

Flow Problem

Max Flow

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coinor_gimpy-2.1.3.tar.gz (59.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coinor_gimpy-2.1.3-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

Details for the file coinor_gimpy-2.1.3.tar.gz.

File metadata

  • Download URL: coinor_gimpy-2.1.3.tar.gz
  • Upload date:
  • Size: 59.3 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for coinor_gimpy-2.1.3.tar.gz
Algorithm Hash digest
SHA256 4345abcdfe432cf75321150091c69dce8b4141879ab7a9b41d4098dc64c90ccc
MD5 a580638ed91b3389d598d8395d0c20cd
BLAKE2b-256 f6bd9def3f7ed5f29acfd231cd939528e205b45052c5167c5cea785ba965ca74

See more details on using hashes here.

File details

Details for the file coinor_gimpy-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: coinor_gimpy-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 55.5 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for coinor_gimpy-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1591ee8029848ac53a667875b21eaf314d12845ce6db46c0027045294ac88bf8
MD5 8dfd124c39c52f451e94dc903c6bb8e2
BLAKE2b-256 c2efd258089493acc2ef35c48953de74e2ddbc20f2fea1dcf89b81e7e8fdfe63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page