Network Evolution

Usage

To run the simulation you need one of the third-party modules: IGraph or NetworkX.

In the settings.py:

  • You can choose IGraph or NetworkX by setting the boolean variable use_igraph_module to True or False.
  • You can set the directory where the measured values are stored.

The simulations can be started with the runs.py program described below.

The measured values are stored in Python shelves, in hierarchical databases. These can be viewed with the shelve module of the standard library of Python. The analyze.py program (as main program or as module) can help to search the data you need, calculate a formula from the values and plot them.

If you want to plot diagrams, you need the matplotlib library. The repositories of Linux distributions usually include it with the name python-matplotlib.

run.py

To run the simulation of a network evolution you need to use the runs.py program. To see the options of runs.py file:

python runs.py --help

(On UNIX/Linux systems it runs without python command, but if the path is not in $PATH, one need the form ./runs.py)

There are two important options can be set for the simulation in this version: R and beta, explained below.

In each step there can be two types of step changing the number of vertices.

  • p_g is the possibility the growth (for example by using a Barabási–Albert step) in a timestep.

  • p_d is the possibility the death of a vertex (for example by random removing of an infected one) in a timestep.

  • R = p_g/p_d We use p_g + p_d = 1, so p_g and p_d are calculated by the program.

    E.g. if R is 1.5, then p_g = 60% and p_d = 40%.

  • beta is the disease spreading probability (for one timestep to one neighbour).

In the simulation a list of R and beta values can be given as the options of runs.py, and one simulation runs for all (R, beta) pairs.

A simulation breaks if it exceeds a given vertex number or a given time limit. These parameters can be set by options too.

The frequency of the measurements can be given in the runs.py program. The values from the measurements are stored in a datebase using the shelve modul of Python. If we run runs.py there will created one database file, and all the simulations with the distinct R and beta values will be stored in this one database. The database files are by default in the network_evolution/Runs directory. The directory can be changed in the settings.py file.

Table Of Contents

Previous topic

mfng - Multifractal network generator

Next topic

cxnet – Összetett hálózatok az oktatásban

This Page