Looking for a simple Java API for creating graphs (edges + nodes)

api, graph-theory, java

Solution

JGraphT sounds like what you're after.

JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms. JGraphT supports various types of graphs.

Their API can create graphs from various input and also supports creating graphs using `addVertex`, `addEdge`. They support finding shortest paths using various well know algorithms such as Bellman-Ford and Dijkstra They also have a complete javadoc available online.

Problem

I'm trying to find a simple Java API for creating graph relationships. It should have some functionality like `addEdge()`, `addNode()`, `isConnected(node1, node2)`, `findPaths(node1, node2)`, etc. I need no UI, just logic. I found a bunch of academic projects, but none seems to be "The Definitive Graph API". Does anyone know about such an API?

Original source