Visualising the addition of new nodes and edges to a graph to 'watch it grow' is to something Mathematica is not suited to by default. However this type of animation really helps convey the emergence of graph features (like clustering) to the untrained audience.
There seems to be a lot of interest in doing this from the many users working with graphs in Mathematica. For example here are two questions on the topic (one, two).
I am going to re-ask this basic question with some more specifics.
It seems that JLink is a popular tool, and many users seem to be very comfortable with it and advocate more use (and programming in Java generally). For example, see Leonid's answer to a previous question. Unfortunately I am not a programmer at all and the documentation for JLink uses terminology that is over my head. I've hit a wall of frustration and really need a few pointers.
There are some good Java tools for 2D dynamic graph visualisation. For example, GraphStream.
So my question is, how do I visualise the growth of the below dynamic graph from this question using JLink and GraphStream? The third and forth elements of the lists are the beginning and end time periods when the edge exists).
dynamicGraph =
{{0, 1, 0, 20}, {1, 2, 1, Infinity}, {2, 3, 2, 21}, {3, 4, 3, 22},
{4, 5, 4, Infinity}, {5, 6, 5, Infinity}, {6, 7, 6, 26}, {7, 8, 7, 25},
{8, 9, 8, Infinity}, {9, 10, 9, 24}, {0, 6, 10, 27}, {1, 6, 11, Infinity},
{1, 5, 12, Infinity}, {2, 5, 13, Infinity}, {2, 4, 14, Infinity},
{6, 8, 15, Infinity}, {5, 8, 16, Infinity}, {5, 9, 17, Infinity},
{4, 9, 18, Infinity}, {4, 10, 19, 23}};
There are many parts to the question and many solutions I guess. Answers need only address one part or step in the process.
How do actually use GraphStream with JLink? It consists of a bunch of
.jar
files, so if these are in the notebook directory I to start with something likeNeeds["JLink"]; InstallJava[]; AddToClassPath[NotebookDirectory[]];
. Then what? A quick summary in layman's terms of basics of JLink would be great .Is a workable approach to generate graphs in Mathematica and export them to a file supported by GraphStream (eg.
.dot
, GraphML) then use the JLinked tool to read the file and display the animation (a little like Szabolic's answer here)? Yet I can't understand the format to make the graph in a readable dynamic format (just answering this part would be a huge help). Nor how to execute the code (ideally from within Mathematica).
I hope this question will be of use to many others and answers that cover any steps in the process, or links to examples of using JLink that might aid my learning, would be greatly appreciated.