Im working on comparing segregation across a set of networks of different size using modularity. My issue is that modularity is strongly correlated to network size (nodes and edges).

I would like to know if there is a way to calculate a measure of relative modularity (for example as seen in this paper: https://www.pnas.org/content/114/16/4165)

## Measuring Modularity.

We used modularity (QQ) proposed by Newman ([()) to measure the strength of modular organization in networks. Modularity can be defined as Q=∑Kk=1[LwkL−(LkL)2])Q=∑k=1K[LkwL−(LkL)2]), where LkLk is the total number of edges in a subgroup kk, of which LwkLkw are the edges within the subgroup, and LL is the number of total edges in the network. Community structure, or the number and composition of subgroups, for each animal social network was estimated by using the Louvain method (30). The highest possible modularity in a network (QmaxQmax) is achieved when all individuals in a subgroup kk only interact with each other and no edges are present between subgroups (i.e., subgroups are disjointed). In other words, QmaxQmax of a network is when LwkLkw = LkLk, and can be written as Qmax=∑Kk=1LkL(1−LkL)Qmax=∑k=1KLkL(1−LkL). We measured the relative modularity of networks as Qrel=QQmaxQrel=QQmax.

Any ideas ? Thanks for the help.