overlap_degree.py

NAME

overlap_degree.py - compute the total (overlapping) degree of all the nodes of a multiplex and the corresponding Z-score.

SYNOPSYS

overlap_degree.py <layer1> <layer2> [<layer3>...]

DESCRIPTION

Compute and print on output the total degree oi of each node i of a multiplex, defined as:

    ∑   ∑   [α]
oi =       aij
     α   j

and the corresponding Z-score:

       oi − ⟨o⟩
z(oi) = ---σ---
           o

where oand σo are, respectively, the mean and the standard deviation of the total degree computed over all the active nodes of the multiplex.

Each input file contains the (undirected) edge list of a layer, and each line is in the format:

  src_ID dest_ID

where src_ID and dest_ID are the IDs of the two endpoints of an edge.

OUTPUT

The program prints on stdout a list of lines in the format:

  ID_n deg_n z_n

where ID_n is the ID of the node, deg_n is its total degree, and z_n is the corresponding Z-score.

As usual, node IDs start from zero and proceed sequentially, without gaps, i.e., if a node ID is not present in any of the layer files given as input, the program considers it as being isolated on all the layers, and the node is omitted from the output.

REFERENCE

F. Battiston, V. Nicosia, V. Latora, “Structural measures for multiplex networks”, Phys. Rev. E 89, 032804 (2014).

Link to paper: http://journals.aps.org/pre/abstract/10.1103/PhysRevE.89.032804