Theoretical Computer Science Stack Exchange is a question and answer site for theoretical computer scientists and researchers in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm exploring some graph algorithms, and would like to animate the graph change over time (e.g. when adding a heap node or balancing a tree).

Is there a nice way to animate a sequence of graphviz graphs?

share|cite|improve this question
Yes and No. You will have to do something like this. Better use Ubigraph as @Anthony suggested. – Pratik Deoghare Jun 22 '11 at 11:06
There have already been a number of questions about graph visualisation already asked, such as, so why not look at them. – Dave Clarke Jun 22 '11 at 11:25
A simple approach might be the following: First construct a graph that contains all nodes that existed at some point during the lifetime of the dynamic graph. Use graphviz (or any other tool) to find a nice layout of the graph. Then to animate it, it is sufficient to simply hide/reveal some parts of the graph (e.g., change colour attributes). With a little bit of hacking, it should be fairly easy to automate. – Jukka Suomela Jun 23 '11 at 11:08
I'm voting to close as off-topic given this question asks about visualizing graphs made with particular software. This seems quite unrelated to TCS. – Lev Reyzin Jun 23 '11 at 13:35
up vote 6 down vote accepted

I'm not sure this question is on-topic here, and would suggest StackOverflow instead. For what it's worth, I never heard that what you are asking for is possible, but you might obtain better-looking results with Ubigraph (check out the demos, they are amazing).

share|cite|improve this answer
This is a comment directed to the OP, should he chose this approach. The quality of the results depend upon how the graph changes. The examples suggested by the OP would produce excellent results. On the other hand, animating the graph of the changes in a research group's (or department's) collaboration network is less pretty – at least the way I did it. Changes to a graph at the leaves generally result in gradual changes to the animation. Adding or removing more deeply embedded edges often results in rather jerky animations. – Dave Clarke Jun 22 '11 at 13:22

Not really, unfortunately. A few years ago it looked like a graph animation tool was going to be added to the Graphviz package, but it was removed because it never quite worked.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.