a Java library of graph theory data structures and algorithms
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
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
designed for performance, with near-native speed in many cases
adapters for memory-optimized fastutil representation
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.3.0</version>
(See the wiki for information on how to use the latest SNAPSHOT build instead.)
First, find out how to set up your favorite IDE (or the command line) to work with 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!
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.
Older releases are also available. They have less functionality, but may be useful with obsolete JDK’s or JRE’s.
12-Nov-2018: Release 1.3.0 is now available!
Read the release announcement for more info.
And to celebrate the release, we have a new website and logo :)
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.
If you enjoy using JGraphT, show us by clicking the Like button for our Facebook page!