reinforcement.py

NAME

reinforcement.py - compute the probability to have a link between two nodes in layer 1 given their weight in layer 2.

SYNOPSYS

reinforcement.py <layer1> <layer2> < Nbins > < minvalue > < maxvalue >

DESCRIPTION

Compute and print on output the probability to have a link between two nodes in layer 1 given their weight in layer 2. As input are given the files layer1, layer2, the number of bins for the link weights of the second layer, the minimum and the maximum values of the binning.

The first file contains the binary edge list of layer 1, the second file contains the weighted edge list of layer 2. each line is in the format:

  bin_min bin_max freq

where bin_min and bin_max are the minimum and maximum values of the link weights of layer 2 in that binning, and freq is the probability to have a link on layer 1 given such weight in layer 2.

OUTPUT

A list of lines, where the n-th line is the minimum and maximum values of the weight of the links in layer 2 in the n-th bin, and the frequency to have a link on layer 2 given that weight.

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