pa-ode-gen, the Preferential Attachment ODE Generator, is a small, proof-of-concept tool for generating ODEs describing the time evolution of arbitrary moments of star-counting functions in preferential attachment networks.
-
pa-ode-gen is written in Scala, which runs on the JVM. So for starters, you'll need an up-to-date JRE/JDK. If you're on a Debian/Ubuntu system, this should do the trick:
$ sudo apt-get install openjdk-7-jre
-
Get an up-to-date Scala distribution.
-
Clone the GitHub repository:
$ git clone https://github.com/sstucki/pa-ode-gen.git
-
Run
./ode-gen -h
to build the ODE generator and get basic instructions on how to run it.
pa-ode-gen has various output formatting options so one can
- generate code to solve the ODEs in Matlab or GNU/Octave,
- generate pretty pictures of various graph motifs using Graphviz,
- generate TeX for the ODEs.
For example, running
$ ./ode-gen 3 2 odes.m
will generate a Matlab/Octave file called odes.m
containing the
necessary function for computing the time evolution of the 2nd-order
moment of a 3-star, as well as some instructions on how to perform the
computation (i.e. specify rates, time steps, etc).
Similarly, to generate the ODEs in TeX, just run
$ ./ode-gen 3 1 gluings.tex
You can also generate a DOT file for visualizing a all the graph motifs necessary to compute the mean evolution of the 3-star by running
$ ./ode-gen 3 1 gluings.dot
This will generate a single DOT file named gluings.dot
with four
graph definitions (one per gluing) that you can process with Graphviz
to generate a PDF like so:
$ dot gluings.dot | gvpack -array_6 | neato -Tpdf -n2 -o gluings.pdf
If you just want to visualize the motifs, you can use e.g.
$ ./ode-gen -d 3 1 | dot | gvpack | neato -Tx11
Here the -d
flag tells the generator to produce DOT output directly
to standard out (there's no file name so it can't infer the format).
For a summary of all format options, run
$./ode-gen -h
We're working on it...
Visit pa-ode-gen on GitHub.