Matlab Programs

Home Group Curriculum Vitae Recent Papers Talks Programs Photos

Degree-preserving random rewiring and correlation profile 
of a complex network

MATLAB programs 

To generate a randomized null-model network in which the degrees of all nodes are strictly preserved use:

For a directed network use dir_generate_srand.m 
For undirected network use  sym_generate_srand.m

To calculate the correlation profile quantifying degree-degree correlations use:

For a directed network use dir_correlation_profile.m
For undirected network use sym_correlation_profile.m  

The science behind these algorithms

In our 2002 paper Kim Sneppen and I proposed a numerical algorithm that constructs a null-model of a  given complex network preserving the degrees (numbers of immediate neighbors) of each of its nodes. Such randomized counterpart of a given complex network can be used to identify its  important non-random topological patterns, which are significantly over- (or under-) represented in the real network compared to this null-model. The algorithm implemented in dir_generate_srand.m  and sym_generate_srand.m consists of repeated application (4 x (number of edges) times) of the elementary rewiring step shown below:

Figure 1. A pair of directed edges A ->B and
C -> D is randomly selected. These edges are then rewired
in such a way that A becomes connected to D, while C to B,
provided that none of these edges already exist in the network, in
which case the rewiring step is aborted and a new pair of edges is
selected. Note that the above rewiring algorithm conserves both the in-
and out- connectivity of each individual node

 

Degree-degree correlations in the network are quantified by what we call its correlation profile.  It measures if nodes of a given degree K1  prefer (or, alternatively, avoid) to connect to nodes of another degree K2 . The idea is to compare the number of edges N(K1,K2 ) connecting any pair of nodes with degrees K1 and  K2 in the real complex network and its randomized version  Nr(K1,K2 ) . Deviations from the null-model manifest themselves in the ratio: 
R(K1,K2)=N(K1,K2 )/Nr(K1,K2 ). In the pseudocolor plots generated by dir_correlation_profile.m or sym_correlation_profile.m they are visible as orange/red and blue/green areas.  The  statistical significance of these deviations is quantified by the Z-score: Z(K1,K2 )=(N(K1,K2 )-Nr(K1,K2 ))/sigma(K1,K2 ), where sigma(K1,K2 ) is the standard deviation of Nr(K1,K2 ) in many realizations of the randomized network.