  Here we propose a new method to compare the modular structure of a pair of
node-aligned networks. The majority of current methods, such as normalized
mutual information, compare two node partitions derived from a community
detection algorithm yet ignore the respective underlying network topologies.
Addressing this gap, our method deploys a community detection quality function
to assess the fit of each node partition with respect to the other network's
connectivity structure. Specifically, for two networks A and B, we project the
node partition of B onto the connectivity structure of A. By evaluating the fit
of B's partition relative to A's own partition on network A (using a standard
quality function), we quantify how well network A describes the modular
structure of B. Repeating this in the other direction, we obtain a
two-dimensional distance measure, the bi-directional (BiDir) distance. The
advantages of our methodology are three-fold. First, it is adaptable to a wide
class of community detection algorithms that seek to optimize an objective
function. Second, it takes into account the network structure, specifically the
strength of the connections within and between communities, and can thus
capture differences between networks with similar partitions but where one of
them might have a more defined or robust community structure. Third, it can
also identify cases in which dissimilar optimal partitions hide the fact that
the underlying community structure of both networks is relatively similar. We
illustrate our method for a variety of community detection algorithms,
including multi-resolution approaches, and a range of both simulated and real
world networks.
