hamming_dist.py

NAME

hamming_dist.py - compute the normalised Hamming distance between all the pairs of layers of a multiplex.

SYNOPSYS

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

DESCRIPTION

Compute and print on output the normalised Hamming distance Hα,β (i.e., the fraction of nodes which are active on either of the layers, but not on both) between all pairs of layers. The layers are given as input in the files layer1, layer2, etc.

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:

  layer1 layer2 hamm

where layer1 and layer2 are the IDs of the layers, and hamm is the value of the normalised Haming distance Hlayer1,layer2. Layers IDs start from zero, are are associated to the layers in the same order in which the layer files are provided on the command line.

REFERENCE

V. Nicosia, V. Latora, “Measuring and modeling correlations in multiplex networks”, Phys. Rev. E 92, 032805 (2015).

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