JGraphT is a free Java class library that provides mathematical graph-theory objects and algorithms.

See: Description

Packages 
Package Description
org._3pq.jgrapht
The front-end API's interfaces and classes, including Graph, DirectedGraph and UndirectedGraph.
org._3pq.jgrapht.alg
Algorithms provided with JGraphT.
org._3pq.jgrapht.alg.util
Utilities used by JGraphT algorithms.
org._3pq.jgrapht.demo
Demo programs that help to get started with JGraphT.
org._3pq.jgrapht.edge
Implementations of various edge interfaces.
org._3pq.jgrapht.event
Event classes and listener interfaces, used to provide a change notification mechanism on graph modification events.
org._3pq.jgrapht.ext
Extensions and integration means to other products.
org._3pq.jgrapht.generate
Generators for graphs of various topologies.
org._3pq.jgrapht.graph
Implementations of various graphs.
org._3pq.jgrapht.traverse
Graph traversal means.
org._3pq.jgrapht.util
Non-graph-specific data structures, algorithms, and utilities used by JGraphT.