Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Build Status

Python-JGraphT

Python bindings of the JGraphT graph library.

The JGraphT is a free Java class library that provides mathematical graph-theory objects and algorithms. It contains very efficient and generic graph data-structures along with a sizeable collection of sophisticated algorithms. The library is written with stability, performance and interoperability in mind. It includes algorithms encountered in diverse application domains such as path planning, routing, network analysis, combinatorial optimization, computational biology, and others.

While the original library is written in Java, this package uses a native build provided by the jgrapht-capi project. The native build is in the form of a shared library, created by GraalVM.

The result is a native self-contained library with no dependency on the JVM!

Installing

We automatically build 64-bit wheels for python versions 3.6, 3.7, and 3.8 on Linux, Windows and MacOSX. For linux we use PEP 571 which means that pip version must be >= 19.0.

Thus, on a recent machine, installation should be as easy as:

pip install jgrapht

If your pip version is older than 19.0 you will need to upgrade:

pip install --upgrade pip
pip install jgrapht

If you want to use virtualenv or venv module, you can write:

python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install jgrapht

Installation on the user directory is also possible:

pip install --upgrade pip
pip install --user jgrapht

Documentation

Automatically generated documentation with a tutorial and examples can be found at https://python-jgrapht.readthedocs.io/.

Citing

Are you using the software in your research? We would appreciate if you cite the following publication:

@article{jgrapht,
  title = {{J}{G}raph{T}--{A} {J}ava {L}ibrary for {G}raph {D}ata {S}tructures and {A}lgorithms},
  author = {Michail, Dimitrios and Kinable, Joris and Naveh, Barak and Sichi, John V.},
  year = {2020},
  issue_date = {May 2020},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  volume = {46},
  number = {2},
  journal = {ACM Trans. Math. Softw.},
  month = may,
  articleno = {16},
  numpages = {29},
}

Building

The jgrapht-capi project is included in the sources as a git submodule in folder vendor/source/jgrapht-capi. You need to either initialize the submodule by hand, or you can pass option --recurse-submodules when cloning this repository.

The following pieces of software are required for the build to succeed:

  • GraalVM 20.0 with Java 11 support
  • Native Image component from GraalVM
  • Maven Java build tool
  • GNU C compiler or clang
  • CMake
  • Python 3.6 and above
  • SWIG 3 and above

If all the above are installed properly, building should be as simple as

python setup.py build

For Windows you will need Microsoft Visual C++ (MSVC) 2017 15.5.5 or later. Build the system using the proper Developer Command Prompt for your version of Visual Studio. This means x64 Native Tools Command Prompt. Use Visual Studio 2017 or later.

Install

Install using

pip install .

Develop

Since the library contains parts which are written in C that need to be compiled before use, make sure you have the necessary compilers and development headers installed. Compiled code means that additional steps are required in order to import from the development sources. Using the following commands you can setup an in-place development environment:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

This allows you to import the in-place build from the repository base directory. If you want it to also be visible outside the base dir, you have to adjust the PYTHONPATH accordingly. Note also that the above commands call python setup.py develop. Instead of adjusting PYTHONPATH, this installs a .egg-link file into your site-packages as well as adjusts the easy-install.pth there, so its a more permanent operation.

Tests

Execute the tests by giving

pip install -r requirements/test.txt
pytest

Building the docs

pip install -r requirements/doc.txt
cd docs && make html

License

This library may be used under the terms of either the

or the

As a recipient, you may choose which license to receive the code under. A copy of the EPL license and the LPGL license is included in this repository.

Please note that this library is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Please refer to the license for details.

SPDX-License-Identifier: LGPL-2.1-or-later OR EPL-2.0

Author

(C) Copyright 2020, by Dimitrios Michail

Enjoy!

Download files

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

Source Distribution

jgrapht-1.5.0.0rc1.tar.gz (335.7 kB view details)

Uploaded Source

Built Distributions

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

jgrapht-1.5.0.0rc1-cp38-cp38-win_amd64.whl (9.8 MB view details)

Uploaded CPython 3.8Windows x86-64

jgrapht-1.5.0.0rc1-cp38-cp38-manylinux2010_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

jgrapht-1.5.0.0rc1-cp38-cp38-macosx_10_13_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.8macOS 10.13+ x86-64

jgrapht-1.5.0.0rc1-cp37-cp37m-win_amd64.whl (9.8 MB view details)

Uploaded CPython 3.7mWindows x86-64

jgrapht-1.5.0.0rc1-cp37-cp37m-manylinux2010_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

jgrapht-1.5.0.0rc1-cp37-cp37m-macosx_10_13_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.7mmacOS 10.13+ x86-64

jgrapht-1.5.0.0rc1-cp36-cp36m-win_amd64.whl (9.8 MB view details)

Uploaded CPython 3.6mWindows x86-64

jgrapht-1.5.0.0rc1-cp36-cp36m-manylinux2010_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

jgrapht-1.5.0.0rc1-cp36-cp36m-macosx_10_13_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.6mmacOS 10.13+ x86-64

File details

Details for the file jgrapht-1.5.0.0rc1.tar.gz.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1.tar.gz
  • Upload date:
  • Size: 335.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.12

File hashes

Hashes for jgrapht-1.5.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 5b82d6c63de30f5dabd94b8cd4bf8cd2498c3b4be0469c9bd33f98b7c8bd9b69
MD5 2ddc8e3f3a55690336284a6506414d6b
BLAKE2b-256 6d98d4855d3ac96e5a3e259ee1d088abaec69780171ebb311c048ee0fccde237

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 9.8 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f39be4605a7a5a65696141a9a7afe14491db6e08a1b717dc1bdc8126bbf2b2ce
MD5 eaea796f3120be4bb07c3ccb5127cef5
BLAKE2b-256 4202c314252e278b55f87546384d00114dafbb70f8567fbc429bee28971d02c7

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.12

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 753e4813d6c0107fa7ca35327b2d19a983bcc58a7d120039687d4ebb3fc07e50
MD5 d1f6c0393a5b537c6dde52a5e9b8dc2a
BLAKE2b-256 e42b0de5b3906a95f5bd53aa2668a9756bfcb172a529b29ab1afbbb9c080ac7e

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp38-cp38-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp38-cp38-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 9.2 MB
  • Tags: CPython 3.8, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.5

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b78a7dde70fa2d4d6fec8750e3efc1c8284a417bc21ae1325fc956b76336df01
MD5 1bc88dd3493bf7c928d0468a952b87b8
BLAKE2b-256 9a46292c24c2811b99d1f7903bc6af32dfd529a03052d283bb4b002da106d3e1

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 9.8 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1380238622064dd59b44641b3fb83a70817e89eeea7868ddb3cda89cdaca8a0e
MD5 61bc25cd650dbc324ae74e0166793fe1
BLAKE2b-256 796532699c36f20326592302b36c304fd33e3eafe72cf9343164770dfbbd9a18

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 10.2 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.12

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 6fdd34843fae70bdf63256ea6ee0f5df9eae739a4f26739d9b782abd7f79976b
MD5 6f2d170be8003c943c7f1288dadeb7d3
BLAKE2b-256 1bdd92d0085bc1534f3589cbe6bc60d2d742af44e88c476900dd453d660b27a3

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 9.2 MB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.5

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 aae507d05c4e0d5aba57de0060a3947560e31d89d80505de48aedf9282ab3410
MD5 dec22db1f84e5122f25fe1c3c76da7a1
BLAKE2b-256 795eb3d0a1f314933f5fe960be98ac098c2bf6c272af411432f8d9e5290c342b

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 9.8 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1cd12648e382411bb3a2623bf6c67e79da6a6c409c709a5856f2b6b156de18f3
MD5 4317ad532305ceb116c15f79e88a39e1
BLAKE2b-256 f4be31440573865511faec43fda84947e2f708fc31dcbb955d2e37633e3272e0

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 10.2 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.12

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b6242fa055aef2def9a09c653fbe1ad75526ea6fb53e0f5dee780df57beacabb
MD5 e751e13810621507061fb6ccb11afa06
BLAKE2b-256 3a984d20ab3a305bd906079b2d62780b6f0662c56199d80c88646a7e2b221809

See more details on using hashes here.

File details

Details for the file jgrapht-1.5.0.0rc1-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: jgrapht-1.5.0.0rc1-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 9.2 MB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.5

File hashes

Hashes for jgrapht-1.5.0.0rc1-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ccfed0f42487378f4120ba72e5a0db47be30177a5002e56e6b6e4f6e997c018a
MD5 c790f55aa56eb3df7548b890db36aa0c
BLAKE2b-256 4a060391976549b6b8ebea928a26e451e5c76c2f26ff0e67e3f20d0ceac69600

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 Sentry Error logging StatusPage Status page