Graphing Libraries for Java?
Node and Edge asks: "Many interesting problem domains involve some form of graph-based or graph-like information: network activity visualizations; social software; workflow management; P2P software development; and version control with branching, just to name a few. It is notoriously difficult for people to visualize a graph structure - unless it happens to be a strictly hierarchical tree-like structure, such as what we know from file-system explorers. Now, with all of that said, what graph libraries can you recommend? The following criteria apply, though they're not absolute: Java or Java bindings; simple to use for simple applications; and polished, extensible UI components. I'm familiar with JGraph, JUNG, Prefuse, OpenJGraph, Tigris GEF, Eclipse GEF, Graphviz, but have not had a chance to evaluate them all. Have you used any of these extensively? If so, can you provide any constructive advice? If not, can you recommend something else, ?"
I guess I don't know the exact problem domain you are working with or what application environment you are looking to present graphs with... but server-side SVG generation has worked pretty well for us.
Check out Batik and see if it can fit your solution.
MORTAR COMBAT!
yEd is pretty good. It builds off the yFiles library.
My solution for graph visualization was to use Java to dump graphs in a DOT-format file for Graphviz, and then use dot/neato to generate SVG. It works pretty well - clean output, and reasonably fast for moderately-sized graphs in dot. (Neato is much slower).
gnuplot is kind in this domain. I don't know how you'd cleanly interface to it from inside a jvm other than spawning a native binary of gnuplot and feeding it text commands.
11*43+456^2
"involve some form of graph-based or graph-like information"
The focus of JUNG is on handling graph data structures.
The focus of GraphVIZ is on generating graphical representations of graph structures.
The focus of JGraph, GEF, and others is on creating user interfaces to interact with graph structures.
Indeed, I'm interested in hearing about libraries that address any and all of: rendering graphs, algorithmic graph manipulation, interacting with graphs.
Katy Börner and I have been organizing a workshop on Information Visualization Infrastructures, including graph drawing packages. The results are available at http://vw.indiana.edu/ivsi2004/
There are lots of different tradeofs involved. One being interactive vs. static graphics. Another being the size of the graphs.
For static graphs, such as class hierarchies and such, Graphviz (http://www.graphviz.org/ works fine and is easy to integrate in a system. For some graphs, Graphviz will not work at all so you need to try first.
For large or dense graphs, above 1000 nodes or more than 4 times more edges than vertices (5n etc), node-link diagrams don't work at all. You could use a matrix but people are not used at reading matrices.
For interactive visualization of graphs, Jung (http://jung.sourceforge.net/) and Prefuse (http://prefuse.sourceforge.net/) are fine if you have small graphs ()
If you are a graph wizard and want to analyze large social networks, you can take a look at Pajek (http://vlado.fmf.uni-lj.si/pub/networks/Pajek/) but it is not a free software and runs mostly on Windows.
Other packages are ok for simple things, stereotyped things or more experimental things. You need to try them on your own problem to decide.
Just wanted to point this out to anyone new to the area: The graphs being discussed are NOT something you can make in excel, which should really be called plots or charts (in this context). These are not pie charts, or XY scatter plots, there is no least-squares fitting to a Graph.
What is meant by a graph (in this context) is a collection of nodes (aka vertices) and edges (aka links) connecting those nodes. An example graph could be a friendship network: People are represent as nodes and an edge falls between two nodes when those two people are on a first name basis.
So Graph Visualization is not trivial at all. Very complex relationships are modelled as graphs and good software is important. I for one use the graphviz port on OS X (that won an apple developers award) after becoming thoroughly sickened with Pajek in windows!
I've done a lot of projects requiring scientific and mathematical visualization; with a couple exceptions, I was better served by having a background working with OpenGL than expertise with an existing graphics library.
On average, producing something that looked great and was exactly what I wanted I would estimate the labour effort at between 3-5 productive days. This is at least comparable to the effort I would have spent learning a graphing library, or working around something that I didn't like with an off the shelf solution.
YMMV.
..don't panic
Not to pick nits, but a graph is not a data structure. A graph is an abstract data type, which is commonly implemented using an adjacency matrix or adjacency list. Arrays and linked lists are data structures, graphs are not.
Tired of free ipod spam sigs? Opt ou