Reputation: 9
Is it possible that anyone has a link to a graph class/library that I can use to produce a graph in Java?
Thanks for any help!
Upvotes: 0
Views: 3230
Reputation: 27326
My top choice would be JGraph as others have suggested; I am using JGraph5 because it is better documented than the newer alternative, JGraphX. EDIT: JGraphX turns out to be the far superior version, despite the lack of documentation. It's not that hard to figure out.
Other alternatives I've researched:
"JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms...complete source code included, under the terms of the GNU Lesser General Public License." (http://jgrapht.sourceforge.net/)
Upvotes: 4
Reputation: 1471
A really good alternative is to used the Google Charts API. Platform independent, easy to use, and fast processing (done on Google Server side)
Upvotes: 1
Reputation: 417
I would recommend JGraphT. I used it to create multi-leveled graphs in my dissertation and as the base of a GPS Routing Software, understanding what is going on I found a bit of a mind bender, but once looking at how the algorithms package works I found it quite easy to implement A*/D* heuristic algorithms. For working out the distance between nodes on the graph I'd also recommend looking at the Haversine function, if that's your thing.
Upvotes: 0
Reputation: 308813
graphviz would be my choice. It's not Java, but still terrific and easy to use.
There is a Java component that works with dot to generate graphs. I've used it - very nice, indeed.
Upvotes: 0
Reputation: 5303
I used JGraph as a visualizer for networks of nodes/topologies at my previous job, it's not half bad once you get past the architecture (it's a big state machine if I recall correctly).
Upvotes: 3
Reputation: 67832
Visual graph: JFreeChart
You may also wish to consider the Google Charts API, if you can make web service requests.
Upvotes: 1