a Java library of graph theory data structures and algorithms
now with Python bindings too!
flexible
any object can be used for vertex and edge types, with full type safety via generics
edges can be directed or undirected, weighted or unweighted
simple graphs, multigraphs, and pseudographs
unmodifiable graphs allow modules to provide “read-only” access to internal graphs
listenable graphs allow external listeners to track modification events
live subgraph views on other graphs
compositions and converter views for combining and adapting graphs
customizable incidence and adjacency representations
powerful
specialized iterators for graph traversal (DFS, BFS, etc)
algorithms for path finding, clique detection, isomorphism detection, coloring, common ancestors, tours, connectivity, matching, cycle detection, partitions, cuts, flows, centrality, spanning, and the list goes on
exporters and importers for popular external representations such as GraphViz
live adapters to other graph libraries such as JGraphX visualization and Guava Graphs
generators and transforms
efficient
designed for performance, with near-native speed in many cases
adapters for memory-optimized fastutil representation
sparse representations for immutable graphs
Jumpstart
Maven
JGraphT releases are published to the Maven Central Repository, so you can easily add us as a dependency to your project:
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-core</artifactId>
<version>1.5.2</version>
(There are also instructions for how to use the latest SNAPSHOT build instead.)
Development Environment
First, find out how to set up your favorite IDE (or the command line) to work with JGraphT.
Hello JGraphT
Next, try compiling and running the hello world example.
Once you get that working, dig into the user guide to learn more about JGraphT!
Docs
README
User Guide
Wiki
Javadoc for latest release
Javadoc for latest SNAPSHOT build
Javadoc for older releases, e.g. javadoc-1.0.0
Documentation for python bindings
Research Paper in ACM TOMS
Download
Latest Release
For development without Maven, or for running demos from the command line, you can download a full archive of the release:
Regardless of which archive format you download, you’ll have the same release contents after unpacking.
Historical Releases
Older releases are also available. They have less functionality, but may be useful with obsolete JDK’s or JRE’s.
Community
Get answers on StackOverflow
Browse known issues or report a new issue
Join the user mailing list
Check out open pull requests
Learn how to contribute your first improvement
Tell us your success story: how are you are using JGraphT?
Cite JGraphT in your research
News
2-May-2023: Release 1.5.2 is now available!
29-Jun-2020: First Release of Python Bindings!
Read the announcement here.
14-Jun-2020: Release 1.5.0 is now available!
Read the release announcement for more info.
21-May-2020: JGraphT Research Paper Published!
Our paper, published in the ACM Transactions on Mathematical Software, provides an in-depth look at the design of JGraphT, and also includes performance comparisons against other libraries.
21-Feb-2020: Release 1.4.0 is now available!
Read the release announcement for more info.
Thanks
The JGraphT team is grateful to all of our contributors over the years for making the project what it is today!
JGraphT is dual-licensed under LGPL 2.1 and EPL 2.0. As a recipient of JGraphT, you may choose which license to receive the code under. Licensing information for libraries on which the project depends is available in the README.
Project development takes place on github, but we still make use of sourceforge for some resources as well.
This website is built using Jekyll, with help from the SinglePaged theme and the Primer theme.
If you enjoy using JGraphT, show us by clicking the Like button for our Facebook page!