On community structure validation in real networks

Community structure is a commonly observed feature of real networks. The term refers to the presence in a network of groups of nodes (communities) that feature high internal connectivity, but are poorly connected between each other. Whereas the issue of community detection has been addressed in several works, the problem of validating a partition of nodes as a good community structure for a real network has received considerably less attention and remains an open issue. We propose a set of indices for community structure validation of network partitions that are based on an hypothesis testing procedure that assesses the distribution of links between and within communities. Using both simulations and real data, we illustrate how the proposed indices can be employed to compare the adequacy of different partitions of nodes as community structures in a given network, to assess whether two networks share the same or similar community structures, and to evaluate the performance of different network clustering algorithms.


Introduction
The growing availability of data on real world networks has inspired the study of complex networks in the multidisciplinary fields of social, technological and biological networks. What makes networks so attractive? We are constantly dealing with networks: supermarkets use networks to propose specific deals to targeted groups; banks orchestrate a complex system of transactions between them and clients; media networks dominate our lives, and inside each living being genes express and co-regulate themselves via complex networks (even when we sleep). Graphs constitute a mathematical representation of complex systems, whose understanding requires a careful study of their structure. Such a task can be particularly challenging for large graphs featuring hundreds or thousands of nodes. The study of the structure of a graph is often achieved by decomposing it into its constituent modules or communities. Girvan and Newman (2002) address the concept of community structure as a network property. Indeed networked systems can be described via main statistical properties such as small-world property, power-law degree distributions, network transitivity and clustering coefficient. They highlight that the property of community structure is found in most real networks. This essentially means that nodes within a network are connected together in tightly joined groups, while between those groups connections are looser. Identifying communities in a network is highly relevant, as it enables to disclose the presence of an internal network structure at a very preliminary analysis step. Over the years, a significant effort has been devoted to the development of several community detection algorithms (Clauset et al., 2004;Pons and Latapy, 2005;Newman, 2006;Blondel et al., 2008;Newman and Clauset, 2016), with a strong focus on the scalability of these methods to large networks. In applied network analysis, the communities that constitute a network are usually unknown. A network may not have any property of community structure; or, even if it does have a community structure, the communities remain unknown and have to be reconstructed via a community detection algorithm. Once the communities have been estimated with a network clustering algorithm, the analyst is then left with questions on the adequacy of the retrieved clusters. On the one side, the nodes may be misclassified (assigned to the wrong community); on the other, the graph at hand may not have a true underlying community structure, and the clusters may thus be scarcely relevant. The question that motivates our work is thus: how can we evaluate when a partition of a given network is meaningful ? In the analysis of real networks where no information on the true communities is available, it is common practice to try to relate the clusters obtained through a certain community detection algorithm to known features of the nodes. If an association between some features and the clusters can be found, this may be taken as a confirmation of the goodness of the clusters. However, this practice is problematic, because it does not take into account network topology, which is what actually determines the community structure. For example, a network may exhibit a strong community structure even if this structure cannot be related to any observed feature of the nodes; and, on the contrary, it is possible that in a network without community structure, a community detection procedure may produce clusters that can be related to certain nodal attributes, but that are nevertheless meaningless. Thus, a more robust approach to community validation, based on network topology, is needed. Two recent attempts to assess the quality of network partitions have focused on the possibility to improve clustering methods by exploiting metadata, i.e. additional information about the nodes (Newman and Clauset, 2016;Peel et al., 2017). Newman and Clauset (2016) proposed a novel clustering method that combines a network and its metadata, arguing that relevant metadata can improve the performance of clustering methods. On the other hand, Peel et al. (2017) argued against the use of metadata as ground truth for the assessment of the quality of clusters in real-world network. Finally, Carissimo et al. (2018)   In the example, we use the Zachary Karate club graph. (b) Define a partition of the nodes into q clusters or communities. The communities may either be known a priori, or be the result of a clustering procedure. (c) Following the testing procedure outlined in Section 2.1, perform q tests of enrichment within each community and q(q −1)/2 (or q 2 −q if the graph is directed) tests of enrichment between each pair of different communities. (d) Combine the results of the tests thus performed in the Community Structure Validation Index (CSV), as illustrated in Section 2.2.
method for the evaluation of network partitions that does not take metadata as ground truth; instead, the method evaluates the stability of the partition recovered by a given algorithm against random perturbations of the original graph structure. In this article we propose a new method for the validation of network partitions as community structures. We focus on the idea that the validation of network partitions should primarily focus on the distribution of links between nodes in the different clusters, rather than simply consider the distribution of nodes among clusters or try to identify observed attributes that correlate with the clusters. Indeed, when assessing the goodness of different partitions of a network, intuitively we would like to rate better partitions with more links connecting nodes within the same community, and less links connecting nodes in different communities. Our method is based on a significance testing procedure for the number of links that are observed between and within the communities; the results from these tests are then combined into a community structure validation (CSV) index that provides an overall assessment of whether a certain partition of nodes induces a community structure in the network. Figure  1 summarizes the steps for the construction of the CSV index.
Our work borrows the concept of network enrichment from the literature on cross-talk enrichment between gene sets and pathways in biological networks, implementing in particular a one-tailed adaptation of the Network Enrichment Analysis Test (NEAT) proposed by Signorelli et al. (2016). Although the comparison of genetic networks has been an important driver of our work, we emphasize that the proposed methodology is more general and it can be applied to other types of networks as well. Our approach provides also a practical way of comparing networks, by assessing similarity and differences in their community structures. The remainder of the paper is organised as follows: in Sections 2 and 3 we describe the construction of community structure validation indices and we discuss how they can be employed to validate network partitions and to compare community structures across networks. The proposed methodology is evaluated through simulations in Section 4 and illustrated with two example applications in Section 5. Section 6 briefly summarizes the results obtained in this paper.

Community structure validation
In this Section we introduce the main methodological contributions of our work. In Section 2.1 we propose a statistical testing procedure to assess whether a specific partition is a valid community structure for a given graph. In Section 2.2 we define a set of indices that summarize the results from the testing procedure, allowing to quantify the strength of the evidence that a partition induces a valid community structure in a network. We have implemented the proposed methodology in the R programming language (R Core Team, 2020). The code used in this paper is available from github.com/mirkosignorelli/csv.

Inferential procedure
We consider a graph G = (V, E), which consists of a set of vertices (or nodes) V connected by a set E of edges or arrows. Although in this paper we focus mostly on undirected graphs, our approach can be applied to directed and mixed graphs as well. We denote by P V = {C 1 , ..., C q } a partition of V into q disjoint sets, such that C r ∩ C s = ∅ if r = s and ∪ q r=1 C r = V . In order to assess whether P V induces a community structure in G, we compare the observed number of links within and between each set with the number of links that we would expect to observe by chance if the groups were irrelevant. We do this by implementing a one-tailed adaptation of NEAT, the Network Enrichment Analysis Test proposed by Signorelli et al. (2016). For undirected networks, NET compares the observed number of edges n AB between the set of nodes A and B with an hypergeometric null model which assumes that where d A , d B and d V denote the total degrees of sets A, B and V . For directed networks, NEAT compares the observed number of arrows n AB from the set of nodes A to the set of nodes B with where o A denotes the outdegree of A and i B and i V are the indegrees of B and V .
In its original implementation (Signorelli et al., 2016), NEAT tests the null hypothesis H 0 : µ AB = µ 0 AB that the expected number of edges (arrows) between A and B, µ AB = E(N AB ), is equal to the expected number of links µ 0 AB = E(N AB |H 0 ) = nK/N obtained from models (1) or (2) against the two-tailed alternative H 1 : µ AB = µ 0 AB . Here, instead, we implement a onetailed adaptation of NEAT and consider two distinct one-tailed tests, one for overenrichment, H 0 : µ AB = µ 0 AB vs H 1 : µ AB > µ 0 AB , and one for underenrichment, H 0 : µ AB = µ 0 AB vs H 1 : µ AB < µ 0 AB . Since a community structure features high internal connectivity within each community and few connections between different communities, we assess the extent to which P V generates a community structure by testing 1. overenrichment within each community C r , r ∈ {1, ..., q}: where µ rr = E(N rr ) denotes the expected number of links between nodes in C r , and µ 0 rr is the corresponding null expectation from model (1) if G is undirected, or from model (2) if it is directed. Then, we compute the mid-p-values p rr = 1 2 P (N rr = n rr |H 0 ) + P (N rr > n rr |H 0 );

underenrichment between each pair of communities
where µ rs = E(N rs ) denotes the expected number of links between nodes in sets C r and C s , and µ 0 rs the null expectation from model (1) if G is undirected, or (2) if it is directed. Here, we obtain the mid-p-values p rs = 1 2 P (N rs = n rs |H 0 ) + P (N rs < n rs |H 0 ). Because the procedure outlined above requires the computation of q(q + 1)/2 tests for undirected graphs, or q 2 tests for directed graphs, we account for multiple testing using the multiple testing correction procedure proposed by Heyse (2011) (which is an adaptation of the Benjamini-Hockberg method for p-values obtained from discrete test statistics) and we derive the adjusted p-valuesp rr andp rs . Alternative multiple testing corrections, or no multiple testing correction at all, may be considered as well.

Community structure validation indices
Ideally, evidence that a partition induces a clear community structure is strongest if every null hypothesis is rejected for a given type I error α, i.e.,p rr < α andp rs < α ∀r, s. More generally, a large proportion of rejections can be regarded as sufficient evidence of a valid community structure. We summarize this intuition through a set of Community Structure Validation (CSV) indices. The steps involved in the construction of the CSV indices are illustrated in Figure 1. For undirected graphs, we define the CSV index as The corresponding index for directed graphs is given by CSV U and CSV D represent the proportion of null hypotheses described in Section 2.1 that can be rejected at a given significance level α (after correcting for multiple testing). Unless otherwise stated, hereafter we set α = 0.05 for the computation of the CSV indices. By definition, CSV U ∈ [0, 1] and CSV D ∈ [0, 1]; higher values of CSV provide stronger evidence that a partition of nodes induces a community structure in a graph. Besides evaluating the validity of a partition as a whole with the CSV index, it may be interesting to also check whether each cluster C r ∈ P V is well separated from the others. This can be done by considering, for each set C r , the proportion of tests involving C r that lead to a rejection at the α level: Lastly, a valuable feature of the CSV indices defined in equations (5) and (6) is that they can be directly interpreted as the proportion of null hypotheses that can be rejected for a given α level. However, one may additionally be interested in evaluating the "strength" of each rejection by weighting each rejection by the distance betweenp rs and α. This can be done by considering a weighted version of CSV, which we call WCSV, where we weight each rejection I(p rs ≤ α) by α−prs α ∈ [0, 1]. For example, for undirected graphs this yields An equivalent definition for directed graphs can be obtained by adding weights to Equation (6). Similarly to CSV, also W CSV ∈ [0, 1]; moreover, W CSV ≤ CSV . As we will show in Section 4.2, CSV and WCSV typically differ for small graphs, and they tend to achieve the same value for larger graphs ( Figure 3).

Comparing different network partitions and different networks 3.1 Comparing different partitions of a network
Network clustering represents a common way to summarize the set of relations encoded in a network. However, in practice this task is complicated by the availability of several alternative clustering algorithms that typically produce different network partitions. When this happens, one is left with the question of which partition can separate better the retrieved clusters.
In Figure 2 we show how CSV can be employed to compare different partitions of a network: by computing the value of CSV for each partition, we can obtain a quantification of how strong is the evidence that each network partition induces a community structure with wellseparated communities. The higher the value of CSV, the stronger the evidence that a partition produces a clear community structure.

Comparing community structures across networks
The difficulty to inspect and visualize relations between thousands of nodes represents a primary challenge in the analysis of large networks. As discussed in Section 3.1, network clustering algorithms are often employed to simplify this task, summarizing a network into a set of clusters of nodes. In addition to this, clustering algorithms are also employed to compare networks. The idea, in this context, is that we may expect similar networks to share similar communities, so that the comparison of communities in networks can point out structural similarities and differences between networks.
A simple way to put this idea in practice is to apply a clustering algorithm to the networks of interest, and check the overlap (proportion of shared genes) between the communities of each network: a high overlap between the partition P 1 of graph G 1 and the partition P 2 of graph G 2 can be taken as an indication that the networks share similar community structures. However, such a comparison directly compares only the allocations of nodes within P 1 and P 2 , ignoring the different distribution of edges in the two graphs. In this Section we illustrate how CSV allows to carry out a more comprehensive assessment of the overall similarity between the community structures of two graphs.
We propose a procedure that is based on the assessment of the validity of P 1 as community structure for G 2 , and of P 2 as community structure for G 1 . The idea at the basis of this approach is that if G 1 and G 2 have the same (or similar) community structure, then the communities extracted from one graph should also induce a community structure in the other graph. This procedure comprises the following steps: • choose a community detection method and apply it to G 1 so as to derive its partition in q communities P 1 = {C 11 , ..., C 1q }. Similarly, obtain P 2 from G 2 ; • compute the community structure validation indices of P 1 in G 1 and in G 2 , and of P 2 in G 1 and in G 2 ; • compute the relative indices which compare the values of the CSV index of partition P i in graph G j with the value of CSV for P i in G i .
The rationale behind R CSV (P i |G j ) is that since P i is the partition in communities of G i , we expect CSV (P i |G i ) to be close to 1, or at least as high as possible for G i . The value of CSV (P i |G j ) will be typically smaller than CSV (P i |G i ): we expect it to be close to 0 if P i provides a bad partition for G j ; however, if P i partitions G j well, the value of CSV (P i |G j ) can be expected to be closer to CSV (P i |G i ).
As a result, we expect higher values of R CSV (P 1 |G 2 ) and R CSV (P 2 |G 1 ) when G 1 and G 2 share similar communities; if, on the other hand, the communities in the two graphs are different, we expect R CSV (P 1 |G 2 ) and R CSV (P 2 |G 1 ) to be close to 0. In Section 5.2 we provide an example of this use of the CSV index.

Simulations
In this section we study the behaviour of CSV in three different simulation studies. In Section 4.1 we introduce a degree-corrected stochastic blockmodel for binary graphs that we employ to simulate the data. In Section 4.2 we study how graph size and modularity affect the capacity of CSV to detect a clustering of nodes as valid community structure. In Section 4.3 we study the behaviour of CSV with respect to increasing levels of community degradation, considering at the same time different values of modularity. Finally, in Section ?? we employ CSV to compare the performance of four different network clustering algorithms.

A degree-corrected stochastic blockmodel for binary graphs
The assessment of the performance of the CSV indices requires a realistic generative model of graphs with weak and strong community structures. This is tipically achieved by recurring to stochastic blockmodels (Holland et al., 1983), in which the probability of observing an edge between two nodes depends on the communities they belong to. A problem with stochastic blockmodels, however, is that they are often too simple to reproduce the behaviour of real networks, mainly because they assume all nodes within a community to behave similarly. This, for example, implies that in graphs generated from such models, nodes within each community have roughly the same degree: a fact, this, that is in sharp contrast with most real networks, which feature a strong heterogeneity in the degree distribution.
To overcome this limitation, several different extensions of stochastic blockmodels have been proposed (Wang and Wong, 1987;Karrer and Newman, 2011;Signorelli and Wit, 2018). Among them, Karrer and Newman (2011) proposed a degree-corrected stochastic blockmodel (DCSBM) for edge-weighted undirected graphs where the value of an edge between nodes i and j depends both on their communities C i and C j , and on nodal weights w i and w j : To simulate networks in our simulation studies, we employ a DCSBM for binary undirected graphs that is closely related to that of Karrer and Newman (2011). We assume that the probability π ij of an edge between nodes i and j depends both on their communities C i and C j by means of a block-interaction parameter θ C i C j , and on nodal weights w i and w j : where Note that the weights are defined in such a way that the average nodal weight in each community is 1; to wit, w i > 1 will indicate that the expected degree of node i is above the average expected degree of nodes in community C i .

Simulation 1: performance of CSV with respect to modularity and number of vertices
The aim of our first simulation is to evaluate how CSV is affected by the modularity (Newman and Girvan, 2004) and number of vertices of the graph. CSV relies on a significance testing procedure between each pair of groups, whose power is expected to be affected both by the size of the groups between which enrichment is tested and by the extent to which the communities are well-separated in the graph (to wit, the modularity). Therefore, we expect that CSV performs better with larger and denser networks and, for a given network size, with higher modularity and smaller number of communities. In order to assess the performance of CSV with respect to network size and modularity, we consider four sequences of graphs with number of vertices v ∈ {100, 500, 1000, 5000}.
For each v, we generate a sequence of 100 binary graphs with p = 6 communities from the DCSBM described in Section 4.1, where the probabilities to have an edge between nodes belonging to the same community are fixed in such a way that E r (θ rr ) = 0.3 and θ rr ∈ [0.22, 0.38] ∀r ∈ {1, 2, ..., 8}, and we progressively increase the probability to have an edge between nodes belonging to different communities, i.e., θ rs ∈ {0, 0.003, ..., 0.297, 0.3} ∀r = s. Since the θ rr s are fixed, increasing θ rs reduces the modularity of the graphs. For each of the graphs thus generated, we compute the CSV U and W CSV U indices associated to the partition of nodes induced by the true communities, following the procedure outlined in Sections 2.1 and 2.2. Figure 3 shows how the value of the two indices changes for different values of modularity and v. We can observe that the difference between WCSV and CSV tends to vanish in large networks. Since we are testing enrichments between the true communities, ideally we would like the CSV indices to attain their maximum possible value of 1; however, the fact that CSV relies on a hypothesis testing procedure implies that this value can only be achieved for sufficiently large networks, and for partitions that have a good level of modularity. Indeed, for small graphs (v = 100) the index seldom achieves its maximum; this is due to the fact that if the communities are small, rejecting the null hypotheses of no enrichment is harder. For larger graphs (v ∈ {500, 1000, 5000}), instead, the indices achieve their maximum value when the modularity is approximately above 0.3; on the other hand, the value of the indices start to drop as the modularity of the partition generated by the true communities decreases (Q < 0.2). This result is desirable, because the low modularity indicates that the partition do not induce an actual community structure in the network.

Simulation 2: behaviour of CSV with respect to community degradation
In Section 4.2 we have assessed how network size and modularity affect the capacity of CSV to declare that the real communities result into a community structure. The purpose of this second simulation, instead, is to understand the sensitivity of CSV to different levels of community degradation. This is important because when dealing with real data the true communities are typically be unknown, and analysts need to estimate them with a clustering algorithm that is likely to misclassify some nodes. From a practical point of view, thus, it is important to know whether CSV is capable to validate community structures even when With larger networks (top right, and bottom panels), instead, the true communities are easily identified as valid network partitions, provided that they generate an actual community structure (i.e., the modularity is not too low). Note how the difference between CSV and WCSV vanishes in large networks.
a small proportion of nodes is misclassified. Our desired behaviour for CSV is that a partition of nodes where most of the nodes are correctly classified, and only a small proportion of nodes is assigned to a wrong cluster, still induces a community structure in the network, and it should thus yield high CSV values. Higher proportions of wrongly classified nodes, instead, should progressively destroy the community structure, determining a sharp decrease of the CSV index.
To verify this behaviour, we generate six graphs with v = 1000 nodes and p = 8 blocks from a degree-corrected stochastic blockmodel where we keep constant the probabilities of interaction within blocks, θ rr = 0.3 ∀r ∈ {1, 2, ..., 8}. We progressively increase the probabilities of interaction between blocks θ rs , r = s from 0.01 in Simulation 2A to 0.3 in Simulation 2F. Note that the modularity of the graphs decreases (from 0.68 in 2A to 0.17 in 2F) as θ rs increases.
In each of the 6 scenarios considered, we take the graph thus generated and its communities as reference. Then, we generate a sequence of graphs from a degree-corrected stochastic blockmodel where we keep the same block-interaction probabilities θ rr and θ rs , but we change community to a proportion q of nodes. We consider 100 graphs for each level of community degradation q ∈ {0, 0.05, 0.10, ..., 0.95, 1} and compute the CSV associated to the reference communities. Supplementary Figures 1 and 2 show how the distribution of CSV changes for different levels of community degradation q. In Supplementary Figure 1 we can observe that for high values of modularity, partitions of nodes with levels of community degradation up to 20-25% still result into a clear community structure. The tolerance to community degradation is instead lower when the modularity decreases, as shown in Supplementary Figure 2. In both cases, the CSV index is stable around 1 for moderate values of community degradation, after which it rapidly decreases towards 0, indicating that higher levels of perturbation of the real communities break the community structure. These results show that CSV adheres to the desired behaviour described at the beginning of this section.

Applications
In this Section we discuss two examples that illustrate how community structure validation indices can be employed to compare different partitions of the same network (Section 5.1) and to compare community structures across networks (Section 5.2). We begin with an application to a network of collaborations between deputies in the Italian Chamber of Deputies, where we explore the usefulness of incorporating metadata in community detection algorithms, and we conclude with a comparison of community structures across 30 tissue-specific gene co-regulation networks.

Community detection and metadata: an application to bill cosponsorships
In Section 1 we mentioned that the use of nodal metadata for community detection and community validation has recently become an active topic of discussion among network scientists. Network data are often accompanied by annotations, or metadata, that describe properties of nodes (such as age, gender and ethnicity in a social network, or data capacity and location of nodes in the Internet network). Newman and Clauset (2016) argued in favour of the use of metadata for community detection, and proposed a community detection algorithm that uses both the graph structure and one categorical variable to identify clusters of nodes. They claimed that when a network is not very informative about communities, a given set of nodal labels (metadata) can improve the accuracy of the clustering. On the other hand, Peel et al. (2017) observed that whereas metadata describe the features of a node, the concept of community is about the edges that exist between the nodes, rather than about the nodes themselves, and they warned against the common practice of using metadata to validate communities in networks.
In this Section we use the CSV index to compare the performance of the 4 community detection algorithms considered in Section ??, which do not exploit metadata, to that of the method from Newman and Clauset (2016) (referred to as "Newclau" hereafter), which makes use of metadata. The network that we use for this comparison is a bill cosponsorship network that summarizes the bill cosponsorship activity of 663 Deputies in Italian Chamber of Deputies during the XVI legislature (2008-2013) (Briatte, 2016;Signorelli and Wit, 2018). In particular, we consider a binary, undirected network where each Deputy is a node, and an edge indicates that two Deputies have cosponsored together at least one bill during the legislature; moreover, we consider gender and party affiliation as metadata. A graphical illustration of the network is presented in Supplementary Figure 4; it can be observed that nodes therein tend to cluster according to party affiliation, but not based on gender. Application of the fast greedy clustering algorithm leads to the identification of 3 clusters, whereas Louvain and the leading eigenvalue methods detect 4 clusters; finally, walktrap extracts 4 clusters and a few isolate nodes. Since the Newclau method does not select automatically the number of communities K, we set K = 3 for its comparison to fast greedy, and K = 4 to compare it to Louvain, leading eigenvalue and walktrap. We compare each of the partitions thus obtained following the procedure for the comparison of different partitions of the same network outlined in Section 3.1. Table 1 reports the value of the adjusted random index (ARI) for the methods that produce 3 clusters; it can be observed that Newclau using party or gender as metadata result in almost the same partition, which is instead quite different from that of fast greedy. The values of the CSV index, reported in  Table 2: Value of the CSV index for network partitions with 3 clusters.
As concerns the comparison of the methods that produce 4 clusters, the values of the ARI presented in Table 3 show that three methods (Louvain, Newclau using party as metadata, and Newclau using gender as metadata) yield very similar network partitions, whereas walktrap and leading eigenvalue retrieve somewhat different partitions. The values of the CSV index, reported in

Comparison of 30 tissue-specific gene regulatory networks
In this section we apply the procedure for the comparison of community structures in different networks outlined in Section 3.2 to a collection of 30 tissue specific gene co-regulatory networks that were inferred in Gambardella et al. (2013). The data are publically available from https://bitbucket.org/ggambard/dina-differential-network-analysis.
In this study, 30 tissue-specific co-regulation networks comprising 11730 human genes were reverse-engineered from data from 2930 microarrays. The identification of similarities and differences between these networks is complicated both by the size of the networks, which prevents an effective graphical comparison, and by the large number of networks considered.
Here, we use the CSV 1 index to compare community structures between each pair of networks as illustrated in Section 3.2, and derive a similarity matrix between networks that will provide a synthetic overview of the networks at hand. We apply the Louvain network clustering method (Blondel et al., 2008) to obtain a partition P i of graph G i and a partition P j of G j .
To guarantee statistical power in the testing procedure, only communities of size greater than 5 are retained in our analysis. Then, we compute the relative indices R CSV (P i |G j ) defined in Section 2.2 for each pair of graphs, deriving a 30×30 matrix R such that R ij = R CSV (P i |G j ).
In order to have a general picture of the tissues similarity, we build a similarity matrix S = R + R T /2, derive the corresponding distance matrix D = 1−S and apply a completelinkage clustering over D. The dendrogram resulting from the clustering is represented in Figure 4 in circular layout. By cutting the dendrogram at different heights, one can partition the 30 tissue-specific networks into a different number of clusters. In Figure 4, in particular, we discriminate among 13 clusters, highlighted in different colours. Three of these clusters are, in fact, singletons (testis, skin and cartilage). Ideally, one could expect gene networks associated to tissues that share similar structure or function to be more similar with each other and, thus, to obtain as a result higher R CSV s and similarities for such tissues so that, in the end, most of the clusters displayed in the dendrogram would reflect analogies in tissues' structure and function. Indeed, this intuition seems corroborated (at least in part) by the results in Figure 4: for example, one cluster exclusively comprises all the cerebral tissues considered in the analysis (cerebrum, cerebellum, mid brain and brain stem), and one the only two striated muscles (heart and skeletal muscle) involved in the study. Moreover, the reproductive system female organs (mammary gland, uterus and ovary) are linked together in the same cluster, and the two tissues from the lower digestive system (colon and intestine) form together a unique cluster. Although a biological interpretation of these results is beyond the scope of this paper, overall we can observe that CSV tends to find higher similarities between graphs corresponding to tissues with structural or functional similarities, in line with our initial expectations.

Conclusion
Community structure is a commonly observed property of real networks. The term refers to the presence, in a network, of groups of nodes (also referred to as modules or communities) that are strongly tied to each other, and sporadically connected to other nodes in the network; this feature is often exploited to simplify the interpretation of large networks and to identify their relevant modules. Whereas the problem of community detection in networks has received wide attention, the assessment of the validity of a partition of nodes as community structure for a given graph has received considerably less attention. In this article, we have proposed a strategy to perform community structure validation of a partition P of nodes that consists of two steps. First, the presence of enrichment between any two sets in P is assessed with a one-tailed modification of NEAT, the test for network enrichment analysis proposed by Signorelli et al. (2016). Then, the results from these tests are summarized into a synthetic index for community structure validation (CSV), which can either be unweighted (CSV) or weighted (WCSV). The rationale behind the CSV indices, which range between 0 and 1, is that they will approach 1 when there is evidence of a strong separation between the sets in P -to wit, when P induces a clear community structure -and they will be close to 0 otherwise. In this sense, the CSV indices can be used to validate P as community structure.
Our simulations indicate that the performance of the proposed indices is poor for very small networks (e.g., v = 100), where the hypothesis testing procedure is not enough powerful to reject the null hypothesis of no enrichment between gene sets, but it heavily improves for larger networks (v ≥ 500), where CSV behaves as expected and the difference between CSV and W CSV rapidly vanishes (Section 4.2). Thus, CSV is capable to identify whether a partition of nodes induces a community structure as long as the network at hand is not too small. It is also robust to a moderate extent of community degradation (Section 4.3), thus making allowance for the possibility that a clustering algorithm may misclassify a small number of nodes. In Section ??, we have employed CSV to compare four popular clustering algorithms for networks on synthetic data. Our results indicate that the Louvain and walktrap clustering algorithms typically outperform the leading eigenvalue and fast greedy methods. As illustrated in Section 3, CSV indices can be employed to compare the goodness of different partitions of the same network as community structures, as well as to evaluate whether different networks share similar or different community structures. An example of the first task is given in Section 5.1, where we have compared partitions obtained with several different clustering algorithms in a network representing cosponsorship between Deputies in the Italian Parliament. An example of the second task, instead, is provided in Section 5.2, where we have employed community structure validation to quantify the extent of similarity across the community structures of 30 tissue-specific gene co-regulation networks. A limitation of the proposed indices is that because they depend on an hypothesis testing procedure, they are affected by a lack of power for very small or very sparse networks, and they may be "too powerful" when very large and dense networks are considered instead. Moreover, the choice of the significance level α is somehow arbitrary. Although throughout this paper we kept α = 0.05 fixed for illustration purposes, it may be advisable to consider a larger α when small networks are at hand, and smaller ones with larger networks.

Declarations Funding
The authors gratefully acknowledge funding from the COST Action CA15109 "European Cooperation for Statistics of Network Data Science", supported by COST (European Cooperation in Science and Technology). The work of Luisa Cutillo has been supported by the European Union under Horizon 2020, Marie Sklodowska-Curie Individual Fellowship CONTESSA (ID: 660388).