Visualizing Dynamic Networks with Python, Igraph, and SONIA

August 8th, 2009

igraph2sonia Example 1 from michael bommarito on Vimeo.

When it comes to quickly motivating a point or engaging students in a classroom, one of the most effective tools is visualization. Not only do movies provide fun and excitement, but they also allow viewers to leverage the abilities of the visual cortex to infer dynamics and patterns in the animated system.

For our recent research, dynamic graphs are the type of system of interest. As I’ve covered before, Python is my language of choice for most programming tasks. Furthermore, Python is a very accessible language, even for beginners. However, when it comes to visualizing dynamic networks, we need another tool.  Our tool of choice is SONIA, the Social Network Image Animator.

I thought I’d provide a helpful little function to generate SONIA input files from igraph objects, along with a few examples.

This function takes as input an igraph.Graph object and a file name to store the SONIA output in. Every vertex in the Graph object should have a time attributed specified, either simply as an integer indicating the start time, or as a tuple or list of the form (startTime,endTime). Check out the following two examples if you need more guidance. Both examples visualize the construction of a periodic lattice. However, in the second example, nodes decay after some random time. Make sure not to miss the second video at the bottom of the post!


igraph2sonia Example 2 from Michael J Bommarito II on Vimeo.

Related posts:

  1. GraphMovie: A Library for Generating Movies from Dynamic Graphs with igraph
  2. Programming Dynamic Models in Python-Part 3: Outbreak on a Network
  3. How to Use Python to Collect Data from the Web [From Drew Conway]
  4. Programming Dynamic Models in Python: Coding Efficient Dynamic Models
  5. Programming Dynamic Models in Python

mjbommar Uncategorized , , , ,

  1. November 9th, 2009 at 09:00 | #1

    Very interesting work,
    I too have been working on visualizing social networks using igraph (though not as complex as this). My idea is using the face tagging in Picasa to generate networks. Check it out, I’m still working on the website.
    http://sites.google.com/site/picasafacenetwork/

  1. No trackbacks yet.

Comment moderation is enabled. Your comment may take some time to appear.

Computational Legal Studies™