r/javahelp • u/lemoussel • Apr 11 '20
Which Java library of graph theory data structures and algorithms would you recommend?
I have to perform operations on large graphs (PageRank, DFS,/BFS traversal , etc).
The structural properties are:
directed edges: an edge has a source and a target
self-loops: whether to allow edges which connect a vertex to itself
multiple edges: whether to allow more than one edge between the same vertex pair
Both Nodes (Vertex) and Relationsships (Edges) must be able to contain properties.
I don't want to use a graph database such as Neo4J .
I've found JGraphT
Is this a good Java graph library?
Would you recommend others?
2
u/WestCoastTyyppi Apr 11 '20
Yes jgrapht will work well. It can handle multiple edges , loops, directed graphs, etc. You can define your own Edge and Vertex classes to allow you to store whatever you need to in them.
1
u/kyromoto Jun 18 '20
Do u have a clue how I can make a graph out of different entites? I used a abstract class for my different kinds of entites, but I do not know how to access an entity as subclass. Or is there a better way?
0
Apr 11 '20
[deleted]
2
u/lemoussel Apr 12 '20
I don't need a distributed graph database. And it must work on Raspberry Pi with 2Gb of RAM.
6
u/aragonSkywalker Apr 11 '20
JUNG looks promising. I used it just for random graph generation but it seems capable for your needs