cartography_from_layers.py

NAME

cartography_from_layers.py - compute the total degree and the multiplex participation coefficient of all the nodes of a multiplex.

SYNOPSYS

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

DESCRIPTION

Compute and print on output the total degree and the multiplex participation coefficient Pi for each node i of a multiplex. The participation coefficient is defined as:

           [     M   [α] ]
     -M----     ∑   ki--2
Pi = M − 1  1 −    ( oi )
                α=1

Note that Pi takes values in [0,1], where Pi = 0 if and only if node i is active on exactly one of the layers, while Pi = 1 if node i has equal degree on all the M layers.

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:

  deg_n P_n col_n

where deg_n is the total degree of node n, P_n is the participation coefficient of node n and col is the integer representation of the activity bitstring of node n, which is a number between 0 and 2M 1. The field col might be useful for the visualisation of the multiplex cartography diagram, where it would be possible to associate different colors to nodes having different node activity patterns.

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 is set to zero.

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