rank_occurrence.py

NAME

rank_occurrence.py - compute the intersection of two rankings.

SYNOPSYS

rank_occurrence.py <rank1> <rank2> <increment>

DESCRIPTION

Get two rankings rank1 and rank2 and compute the size of the k-intersection, i.e. the number of elements which are present in the first k positions of both rankings, as a function of k. The parameter increment determines the distance between two subsequent values of k.

Each input file is a list of node IDs, one per line, where the first line contains the ID of the highest ranked node.

OUTPUT

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

  k num_k

where num_k is the number of nodes which are present in the first k positions of both rankings.

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