Saturday, April 2, 2011

The Simulations!

<Apr 3 2011 10:30 am> It is the most "happening" time of the project - "The simulations". If you've seen my earlier post, you would know the simulations I have planned out. One disclaimer - I am running all these simulations on artificial generated data - due to time constraints. But I hope to run the same on actual data later(hopefully, just a matter of little bash scripting).

After spending considerable time fighting it out with python modules, networkx, guess(a graph exploratory tool scripted in jython) and mencoder(the encoder I wish to employ to create some handy videos), I think I have things sorted out. This will be a rough outline of how all these tools and scripts will fit together :-

1. I generate artificial graphs(this is good enough, as the models I've considered for the simulations are only Random Graphs, Power Law Graphs and Klienberg's grid-based model) using Network-X in Python.

2. Irrespective of  the simulation I am going to do, the input to the GUESS system would be a python(it could've been jython also) script that contains the code to change the color of a single(or multiple if simulating Adamic/Adar's Random Walk with broadcasting) edge, and to export it as a JPEG.

3. The original python script will also output the graph generated in GraphML(GML) format. The problem here is that the node names are simple integers in the range [0,n-1) for a graph with n nodes. GUESS is not fine with it because of reserved keywords or so. A little sed will help here :


sed 's/[0-9][0-9]*/n&/g' $1 > file1
rm $1
mv file1 $1


This means that for each file the original python scripts output, this script will take them in and give the "good" file that GUESS can take as input. Note that GUESS can also take .gdf(which is a GUESS format) files as the database on which to work on.  <Apr 3 2011 10:45 am>



No comments:

Post a Comment