<figure><img src="image_1.png" /></figure>

HAL
open science

# Revising clustering and small-worldness in brain networks

Tanguy Fardet, Emmanouil Giannakakis, Lukas Paulun, Anna Levina

► To cite this version:

Tanguy Fardet, Emmanouil Giannakakis, Lukas Paulun, Anna Levina. Revising clustering and small-worldness in brain networks. 2024. hal-04427288

HAL Id: hal-04427288

https://hal.science/hal-04427288v1

Preprint submitted on 1 Feb 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution - ShareAlike 4.0 International License
# Revising clustering and small-worldness in brain networks

Tanguy Fardet¹,²,³, Emmanouil Giannakakis¹,², Lukas Paulun⁴,⁵, and Anna Levina¹,²

¹ University of Tübingen, Maria-von-Linden Straße 6, 72076 Tübingen, Germany,

² Max Planck Institute for Biological Cybernetics, Max Planck Ring 8, 72076 Tübingen, Germany,

³ LEESU, École des Ponts, Université Paris Est Créteil, Marne-la-Vallée, France,

⁴ Bernstein Center Freiburg, Hansastraße 9a, 79106 Freiburg, Germany,

⁵ University of Freiburg, Friedrichstraße 39, 79098 Freiburg, Germany

As more connectome data become available, the question of how to best analyse the structure of biological neural networks becomes increasingly pertinent. In brain networks, knowing that two areas are connected is often not sufficient, as the directionality and weight of the connection affect the dynamics in crucial ways. Still, the methods commonly used to estimate network properties, such as clustering and small-worldness, usually disregard features encoded in the directionality and strength of network connections. To address this issue, we propose using fully-weighted and directed clustering measures that provide higher sensitivity to non-random structural features. Using artificial networks, we demonstrate the problems with methods routinely used in the field and how fully-weighted and directed methods can alleviate them. Specifically, we highlight their robustness to noise and their ability to address thresholding issues, particularly in inferred networks. We further apply our method to the connectomes of different species and uncover regularities and correlations between neuronal structures and functions that cannot be detected with traditional clustering metrics. Finally, we extend the notion of small-worldness in brain networks to account for weights and directionality and show that some connectomes can no longer be considered “small-world”. Overall, our study makes a case for a combined use of fully-weighted and directed measures to deal with the variability of brain networks and suggests the presence of complex patterns in neural connectivity that can only be revealed using such methods.

## CONTENTS

Open questions and limitations 11

I. Introduction 2

IV. Methods 11

A. Connectomes 12

II. Results 2

B. Nomenclature 13

A. Artificial Networks 3

C. Weighted directed clustering definitions 13

1. Using undirected measures leads to information loss 3

D. Graph generation and shuffling 14

2. Fully-weighted methods are more sensitive to weight contributions 3

E. Small-world propensity 15

3. Fully-weighted methods overcome distortions from spurious connection more reliably than thresholding 5

Acknowledgments 15

References 16

B. Connectomics Data 7

A. Hierarchical structures along the mouse cortical pathways 18

1. Directed clustering patterns in brain networks 7

B. Small-world propensity of the *C. elegans* and mouse connectomes 18

2. Fully-weighted clustering methods reveal hierarchical structures along the mouse cortical pathways 7

C. Clustering patterns correlate with modulatory structures in the drosophila connectome 18

3. On the small-worldness of brain networks 9
# I. INTRODUCTION

Comprehension of the brain connectome at different scales is essential for understanding neural systems. The structure of brain networks can provide valuable insights into their dynamical behaviours and functions, reflecting the ubiquitous relation between form (structure) and function (dynamics) [1]. Today, there is an abundance of structural and functional [2, 3] connectivity data at different scales derived by various methods, ranging from microscale connectomes, which map the connections between individual neurons [4–6], mesoscale connectomes that capture local circuits like cortical columns [7], and macroscale networks, where nodes correspond to entire brain areas [8].

To understand this massive amount of data, network science has developed a variety of measures to extract essential features of different network structures and find similarities between them. The abstract mathematical tools of network science are blind to the particular meanings of nodes and connections in the real world. Therefore, they allow the use of the same analysis techniques to a wide range of different networks and enable comparisons between them [9].

Clustering is a particularly important metric to characterize recurrent interactions between neurons or brain regions through redundancy and shared information transfer. In growing networks, we expect specific clustering properties related to preferential attachment and the segregation of inputs and outputs [10] to emerge. Furthermore, clustering metrics are involved in the computation of higher-order graph properties, such as small-worldness that captures a graph’s propensity to form short average path lengths while maintaining high clustering [11].

Brain networks, at all scales, are intrinsically directed and weighted, with weights often following heavy-tailed distributions. Nonetheless, many network measures, including clustering, are often analysed using the undirected or binary version of the graphs in many standard toolboxes [12–14], ignoring directionality, connection weights, or both. A single toolbox [15] includes directed weighted measures, and it only computes the sum of all directed clustering coefficients (called “total” clustering), which does not provide significant additional information compared to the undirected coefficient. Because the binary clustering and the partially-weighted methods implemented in these toolboxes are very sensitive to spurious edges, computing the clustering coefficient requires pre-processing in the form of thresholding in which low-weight edges are removed, an arbitrary process that often leads to ambiguous results. For binary methods, all edges in the remaining network are then treated as having the same weight.

Removing spurious edges through thresholding is often necessary to recover an approximation of the “ground truth” graph, as most brain networks cannot be measured directly but are inferred from indirect observations. During the inference process, noise and statistical biases can lead to the emergence of spurious low-weight edges. Although a wide range of methods for thresholding have been suggested [16–18], there is no agreement on the best method for any given network. Furthermore, as the weight distributions of spurious and real edges often overlap, perfectly discriminating edges based on weights alone is impossible. This is concerning since spurious edges can have large effects on the network analysis, especially if weights are ignored, and spurious low-weight edges are treated the same as real edges.

In this paper, we propose a solution to the spurious edges and thresholding problems using directional and weighted clustering methods. Instead of focusing on the difficult task of finding a sensible threshold for a given network, we suggest the use of weighted network measures that fulfil what we call the *continuity condition*: This condition requires that a measure should remain as robust as possible if a network is perturbed by the addition or deletion of weak edges and that an edge with infinitesimally small weight should be equivalent to the absence of that edge. We discuss weighted directed clustering coefficients that fulfil the continuity condition and demonstrate how they remove the need for thresholding weighted connectomes altogether. Furthermore, in the second part of the paper, we show that these methods correlate with biological and structural features in several connectomes and are useful to find and analyse new properties linking structure and function in specific circuits. We particularly identify structural features in the mouse connectome that cannot be identified via commonly used hybrid clustering methods. Finally, we define a weighted directed measure using these continuous clustering methods to assess the small-world propensity of connectomes. Using our metric, we show that accounting for both weights and directedness leads to results that challenge the notion that small-worldness is an intrinsic feature of nervous systems and brain networks.

# II. RESULTS

In the following sections, we argue that taking directionality and connection strength into account is a necessary step for reliable network analysis in neuroscience. We further compare different methods of estimating the weighted clustering coefficient and argue that fully weighted definitions provide better insights into network structure.

In the first part of the results, we use artificial networks to demonstrate the importance of using weighted and
<figure><img src="image_3.png" /><figcaption>FIG. 1. Illustration of the four directed clustering motifs. Each possible version of the cycle, fan-in, fan-out and middleman motifs are shown for the top node (in yellow).</figcaption></figure>

directed measures and compare different methods. We then use connectomics data from four species and illustrate the strong effect that different clustering definitions have on the analysis of real neuroscientific data.

## A. Artificial Networks

### 1. Using undirected measures leads to information loss

Directionality critically affects how information flows in the brain, and thus measures developed for directed connectomes should be used. However, many network metrics used in neuroscience disregard directionality [19], as attested by the fact that multiple neuroscience toolboxes implement only the undirected form of the clustering coefficient (e.g. *Conn*, *GRETNA*, or *GraphVar* [12–14], totalling more than 5000 citations). It might seem that undirected clustering already captures all relevant information and is difficult to extend to directed measures, but in this section, we argue that both of these statements are not true.

The classical unweighted clustering coefficient definition ($CC_u$) for undirected networks simply assesses how close the neighbours of a node are to being a fully connected graph. On a practical level, the computation of the $CC_u$ assesses the probability of connection with neighbouring nodes by looking at all the triangles formed by the node and two of its neighbours normalized by the number of possible triangles. To extend the definition to directed networks, we can separately concentrate on different types of possible triangles. In general, there 8 different types of possible directed triange (each link can be oriented two different ways; here, we count bidirectional links as two different links that contribute to their own set of triangles). However, for reasons of symmetry, we need to consider only four different motifs: cycle, middleman, fan-in, and fan-out — Figure 1. To find the corresponding clustering coefficient for each pattern, we simply assess how often the particular type of triangle is

present, normalized by the theoretically possible number of triangles given the links from a node to its neighbours (for exact definition, see Methods IV C).

We first illustrate how the directional clustering coefficient can discern the differences between nodes in the network. For this, we look at simple generated networks that differ only in the directionality of four links, Figure 2A. The first observation is that the network (d1, red) is strongly connected, meaning that information injected in any node of the network can reach any other node. On the other hand, network (d2, orange) has 4 distinct strongly connected components. This means that if information is injected in node 5 of (d2), it can only reach nodes 0 and 1, whereas it can reach all other nodes in (d1) — Figure 2B.

How much of the differences between these two networks can be picked up by the clustering coefficient? As expected, there are no differences when using undirected or total clustering. However, we can obtain deeper insights about information transmission in the networks by considering specific motifs separately — Figure 2C. For example, directed motifs expose significant differences between nodes 4 and 5.

To check whether there are similar differences in the information provided by specific directed clustering motifs in real neuronal connectomes, we studied the unweighted mesoscopic brain network of the mouse [7] — Figure 2D. Looking only at the total clustering, it may seem that undirected clustering already captures most of the information, as they appear strongly correlated in Figure 2E. However, the picture is already quite different for the cycle motif and we show that only a small fraction of the variance (between 0.05 for fan-in and 0.4 for fan-out) can be captured when trying to predict the clustering values of any specific motif from the undirected local clustering — Figure 2F. Thus, additional, complementary information in the different motif-specific clustering coefficients exists, which may lead to novel discoveries when analysing the properties of various nodes (be they neurons or brain areas) together with their function.

### 2. Fully-weighted methods are more sensitive to weight contributions

In biological neural networks, the connection strength carries a significant part of the information about the interactions between nodes. Multiple extensions of measures originally developed for binary networks have been proposed to adequately capture features of weighted networks. We recently suggested [20] to classify these definitions based on their relationship with *binary-based properties* (properties that can be computed directly from the adjacency matrix) in two broad categories. *Hybrid meth-
<figure><img src="image_4.png" /><figcaption>FIG. 2. Using the undirected representation of directed graphs, or undirected measures lead to a significant loss of information. A. Two different directed networks correspond to the same undirected network (differing edges are highlighted in black). Node size gives the total degree, and colour gives the out-degree (low in black to high in yellow). Associated node IDs are shown in grey around the undirected version of the graphs. B. Comparison of the strongly connected components (SCCs, given by node colours) and motifs of the two directed graphs. (d1, dark red) is strongly connected with each node reachable from each other, whereas (d2, orange) falls apart into 4 distinct SCCs. This means that if information is injected in 5 for (d2), it can only reach nodes 0 and 1, whereas it can reach all other nodes in (d1). C. Comparison of the undirected and directed clustering coefficients for nodes 4 and 5 and their evolution (represented by the black line) across graphs d1 (dark red) and d2 (orange). The triangular motifs are represented above (for a chosen node, in yellow); the total clustering considers all possible variations of the directed triangles. Though they seem identical on the undirected graph, nodes 4 and 5 actually differ (either within a single graph or across graphs) for all directed clustering motifs except middleman. D. Mouse brain (same rules as A). E. Linear regression between the undirected clustering ($CC_u$) and two directed motifs ($CC_m$). F. $R^2$ and mean absolute percentage error $\bar{E}$ associated to the regression between the undirected clustering and each directed motif.</figcaption></figure>

ods that use both weights and node degrees (a binary property) to compute the clustering coefficient, such as the methods of Barrat et al. [21], Onnela et al. [22] and their generalizations to directed networks [23, 24] and fully-weighted methods that rely only on the connection weights to compute the clustering coefficient, such as the method of Zhang and Horvath [25] and the continuous method [20].

To demonstrate the increased sensitivity of fully-weighted methods, we consider a spatial network reminiscent of the recurrent connectivity within a cortical layer or neuronal culture Figure 3A. We independently draw the strength of each connection from a log-normal distribution — see Method IV D for details. Many important properties of the connectome are already captured by the adjacency matrix and derived measures (e.g. the binary clustering coefficient $CC_{bin}$). However, for the nodes with similar binary $CC_{bin}$, different realizations of the weight distribution will still result in distinct weighted clustering coefficients. How much difference the particular clustering measure generates reflects its capability to capture the variance of the node properties defined

by the weights. We first consider the nodes with binary clustering among the smallest in the network (between $[1% - 2%]$, the 2nd percentile of all $CC_{bin}$ values in the network, to avoid nodes with null binary clustering), median ($[49\% - 50%]$) and highest ($[99\% - 100\%]$) and investigate which percentiles of the weighted clusterings will correspond to the same nodes depending on the selected definition. We observe that for the median percentile of $CC_{bin}$, all weighted methods generate large variability. However, for the highest and smallest non-null $CC_{bin}$, the variance of the weighted ranks is much larger for the fully weighted methods. In contrast, the hybrid methods follow the binary ranks more closely — Figure 3B.

We capture the full range of $CC_{bin}$ and characterize the variability in the weighted definitions by considering the nodes binned by $CC_{bin}$ in bins of 0.05 and generating 20 networks to improve the statistics. Within each bin, we consider the distribution of the observed $CC_w$. We compute the normalized $CC_w$ spread as an interquartile range (difference of the value at 75th percentile and 25th percentile) normalized by the median of values within the bin for a fair comparison (as the values generated by
<figure><img src="image_5.png" /><figcaption>FIG. 3. Fully-weighted methods are more sensitive to the weights-related features of the nodes. A. 1000-node spatial network with distance-dependent connectivity and weights drawn from a log-normal distribution. Node size indicates the total degree, node color indicates out-degree. B. Difference between binary and weighted middleman clustering ranks of the nodes from the previous graph. Red: 2nd percentile, yellow: 50th percentile, blue 100th percentile. The theoretical locations of the associated binary percentiles are marked by dashed lines of the corresponding colours). While Barrat and Onnela's methods remain relatively close to the binary ranking, notably for extreme values, the fully weighted methods significantly deviate from it even for the lowest and highest percentiles. C. 20 realizations of the spatial network in A, with weights sampled from the same lognormal distribution, are used to make groups of nodes with similar binary clustering coefficients (in bins of 0.05 width). Normalized $CC_w$ spread $s$ is computed as $s = IQ/M$, with $IQ$ the interquartile-range and $M$ the median. Shaded areas give the standard deviation around the mean and are obtained via bootstrapping. The ratio between low and high clustering values is higher for fully weighted clustering methods, meaning that their discriminating power is higher than that of the hybrid methods. The inset is a zoom on the values containing 90% of the measured nodes. See Methods IV D for details about the network, weights, and analysis.</figcaption></figure>

different distributions systematically vary). For all values of binary clustering, the variability of fully-weighted measures is much larger than the hybrid measures. Particularly, Barrat's definition closely follows $CC_{bin}$ without large variability, the continuous definition generates around 25% more variability than Onnela's, and Zhang's goes up to 65% more than Onnela's — Figure 3C.

We showed that, in general, fully weighted methods are significantly more sensitive to the weights-related features as they separate nodes that have similar binary clustering more efficiently based on the weights' contribution. In the following sections, we illustrate how this increased sensitivity impacts the analysis of real connectomics data.

### 3. Fully-weighted methods overcome distortions from spurious connection more reliably than thresholding

Most networks in neuroscience, particularly on the macro and mesoscales, are inferred or derived from indirect measurements. As a result, connectomics data is often corrupted by a large amount of noise that is unlikely to disappear soon [26]. A previous study [27], using non-weighted measures, demonstrated that erroneously included connections (false positives) had a higher impact on network clustering than erroneously omitted ones (false negatives). Therefore, the authors concluded that it is preferable to use high thresholds to discard as many spurious edges as possible. We show that this result does

not hold for the weighted clustering coefficient and that the decision about the measure to use is more critical than correct thresholding — Figure 4.

We test sensitivity to noise on three characteristic network models, assuming that the spurious connections will generally have smaller weights. We consider three ground-truth networks: random, small-world, and scale-free, with weights drawn from a log-normal distribution as was observed in the statistics of neuronal connections [28, 29]. We add probability $p_{spur} = 0.017$ of observing a spurious edge between two unconnected nodes, the weights of spurious edges are drawn from a shifted exponential distribution starting at $10^{-4}$ with a characteristic scale of 1.5. This way, spurious and real weight distributions overlap and cannot be separated using a single threshold, Figure 4A–C.

The implicit assumption of thresholding is that a measure of interest will remain stable and closely aligned with the ground truth upon its application to the optimally thresholded network. Because in our example, the real and spurious weight distributions are known, we can find the optimal thresholding value $\theta_0$ that enables the removal of most spurious edges while preserving most of the real edges, Figure 4B. Additionally, we define a strict threshold $\theta_h$, corresponding to the removal of all spurious edges at the cost of an increase in false negatives, and a lenient threshold, $\theta_l$, where all real edges are preserved at the cost of an increase in false positives. We also consider the whole measured network (M) obtained when setting the threshold at 0. Using these thresholds, we obtain four different networks and can now compare the clus-
<figure><img src="image_6.png" /><figcaption>FIG. 4. Thresholding for the removal of spurious edges strongly affect hybrid, but not fully-weighted clustering measures. **A.** The measured network (M) is a combination of the ground truth (black) and an Erdős-Rényi noise (red). **B.** The distribution of true (black, log-normal) and noisy (red, shifted exponential) weights have a non-zero overlap. Thresholds: low: $\theta_l$ - minimum of ground-truth weight, optimal $\theta_o$, and high $\theta_h$ - maximal weight of the noise network. **C.** Same as B but in linear scale. **D.** Coefficient of determination $R^2$ (blue) measuring the match between the thresholded and ground-truth total clustering values. The dotted line marks the minimal correlation for the measured network with a fully-weighted method, to be compared with the best values of the binary and hybrid methods.</figcaption></figure>

tering coefficients in them to the ground truth. To this end, we regress the local clustering coefficients $CC_w$ in a thresholded or complete network on the ground-truth clustering coefficient obtained by the same method in the noise-free network.

The most striking result from this comparison is that, regardless of the threshold, fully weighted measures provide a notably higher correlation with the ground truth compared to binary and hybrid definitions — Figure 4D. In fact, the best correlation coefficients (using the optimal threshold) for the binary clustering are lower those obtained by applying directly the fully-weighted methods on the measured graph. Even for hybrid measures, their optimal results are at best similar or only marginally higher than the correlation coefficient of fully-weighted methods on the measured graph, and the correlation can drop very quickly as soon as one deviates from the “optimal” threshold.

Correctly thresholding the network led to notable improvements for all methods, improving the correlation to the ground truth. However, finding the precise threshold requires knowledge of the real and spurious weight distribution, and spurious links strongly affect the local

clustering for binary and hybrid methods as soon as one deviates from the optimal threshold. Furthermore, contrary to what happens in binary networks, higher thresholds may decrease the correlation to the ground truth depending on the graph and method. On the other hand, considering the entire network but using fully weighted measures allows us to obtain a nearly perfect inference of the clustering ground-truth network. The reason for this lies in the methods’ mathematical properties, ensuring that spurious low-weight edges have little influence on the local clustering of a node.

For neuroscience applications, we expect that the contribution of a triangle to the weighted clustering coefficient of a neuron should go to zero if any of the weights in the triangle goes to zero. Because the Zhang-Horvath definition does not fulfill this condition and has been shown to be less sensitive to some weight-encoded features, we will default to the continuous clustering when using a fully-weighted measure in some of the following sections (see [20] for detailed discussion and examples). However, it is worth noting that most of the results still hold for the Zhang-Horvath definition and that it may be preferred in some cases due to its higher robustness to spurious edges.
## B. Connectomics Data

### 1. Directed clustering patterns in brain networks

Having demonstrated the advantages of fully weighted directed methods in artificial networks, we proceed to test how various clustering definitions perform on actual connectomics data. Specifically, we use networks derived from the connectomes of four different species: mouse [7], *Drosophila melanogaster* (drosophila, [5]), *C. elegans* [4], and tadpole of *C. intestinalis* (tadpole [30]). For these networks, we study the ability of different methods to extract information from the weighted network. In the following, we will investigate which of the directed clustering patterns (cycle, fan-in, fan-out, and middleman) are over- or underrepresented in biological networks compared to random weight distribution.

We are particularly interested in the impact of weight distribution beyond the information already contained in the adjacency matrix. To access it, we compare the weighted clustering $CC_w$ (using each of the four candidate methods) of the original connectomes to a null model with the same binary connectivity but where all weights have been randomly shuffled. Whereas Bar-rat's and Onnela's definitions do not capture any sig-nificant difference in weighted connectivity motifs over binary, the fully weighted definitions detect a significant over-representation of some directed patterns, notably for middlemen but also for fan-in and fan-out. These results are consistent across species and occur both at the microscale (*C. elegans*, tadpole) and at the mesoscale (neuropills of fly central complex and mouse brain) Figure 5A-D.

The relative contribution of weights (compared to the contribution of the binary network topology) varies greatly from connectome to connectome. Sparse networks, namely the microscale ones and the mesoscale fly central complex, are quite strongly structured, whereas the dense mesoscale mouse brain displays a much weaker binary structure, as can be seen from Figure 5F. Because of this, the correlation between $CC_w$ methods is much higher in structured networks such as *C. elegans* — Figure 5E — than in the mouse brain — Figure 5G.

The difference between middleman/fan-in/fan-out and circular motifs comes from both weight-specific and structural contributions in some connectomes. Both *C. elegans* and the mouse brain display significant differences between these two types of clustering patterns. This effect is less significant for the tadpole and minimal in the fly central complex, where no significant difference can be seen between the motifs' expression levels.

Finally, depending on the method used, the nodes dis-

playing the highest clustering values can differ significantly — Figure 5 H-I. This is especially visible for the mouse brain where top-clustered areas change almost completely between Onnela's and the continuous definition while they display a higher number of common nodes with the Zhang-Horvath definition.

In summary, our analysis reveals that directed motifs are under- or over-represented in brain networks and that the over-representation of weighted patterns associated with redundant information transfer is visible across species and scales. Moreover, to see the specific contribution of connection weights to node clustering, it is necessary to use a fully-weighted method.

### 2. Fully-weighted clustering methods reveal hierarchical structures along the mouse cortical pathways

To better demonstrate the impact of choosing between hybrid and fully weighted directed clustering methods, we highlight how the fully weighted approach is more effective at revealing significant, large-scale patterns in connectomics data, patterns which the hybrid method fails to discern. To this end, we use the mesoscale mouse connectome [7] and investigate different sensory pathways.

There is a natural hierarchy within the sensory and motor areas of the mammalian brain. This hierarchy will likely manifest in the interactions between these areas, potentially reflected in connectivity metrics such as clustering coefficient. Our hypothesis is that higher-level brain areas integrate information from multiple levels of this hierarchy. Therefore, our focus is on investigating the behaviour of fan-in clustering, as it could provide insights into how these upper-tier regions receive, process and consolidate information from various interconnected sources.

Indeed, using fully-weighted clustering methods to estimate the fan-in clustering, we observe that (with the exception of the olfactory pathway, where no pattern is discernible), the clustering steadily increases as we move to higher areas in the sensory (Figure 6A) and motor pathways (Figure 6B).

The significantly above-average fan-in clustering at the high-level sensory and motor processing areas illustrates the interplay between structured connectivity (in this case, fan-in clustering) and function (the processing of more complex information taking place in the higher cortical areas). The exact mechanisms by which the connectivity structures contribute to the specific functions remain unclear, but we can at least establish a clear correlation that, as far as we are aware, has not been observed before.
<figure><img src="image_7.png" /><figcaption>FIG. 5. Expression of directed clustering motifs can vary significantly between clustering methods and connectomes. **A–D.** Clustering propensity of four connectomes for each directed motif and each clustering definition. The values are compared to the average of 10 networks with the same binary structure but shuffled weights (see Methods IV D, for details). The clustering definitions used are Barrat's, "B", and Onnela's, "O" (hybrid measures) as well as continuous, "C", and Zhang-Horvath's, "Z" (fully-weighted measures). **A.** The central brain of drosophila displays a large increase in all directed motifs according to the fully-weighted measures. **B.** The *Ciona intestinalis* tadpole connectome shows almost no effect of weight structure except for a slight increase in middleman motifs and a slight decrease of cycles with the Zhang-Horvath definition. **C.** In the *C. elegans* connectome, weights contribute to a reinforcement of middleman and fan-out patterns and a slight reduction of cycles according to the fully-weighted measures. **D.** Weight distribution in the mouse mesoscale connectome contributes to a notable increase of middleman, fan-in and fan-out motifs but not to cycles, according to the fully-weighted methods. **E.** Using the continuous clustering, comparison between the actual expression levels of the motifs and the expected value in Erdős-Rényi graphs (with the same number of edges and the same set of weights) reveals that, except for cycle motifs in the mouse connectome, all clustering motifs are over-expressed. **F.** Level of expression for the middleman, fan-in, and fan-out motifs compared to cycles according to the four clustering definitions. Each dot represents the ratio of the median value of a motif compared to the median cycle clustering. The fully-weighted methods detect significant over-expression of the three motifs compared to cycles for all connectomes except drosophila. **G, H.** In *C. elegans*, correlations are significant between the continuous clustering and the Zhang-Horvath and Onnela distributions and strong correlations are also observed in the tadpole and drosophila; however, much weaker correlations are observed for the mouse brain. **I.** As expected from the low correlations seen in H, the subnetworks formed by the most clustered areas in the mouse brain differ strongly depending on the method used. Node size express total-degree, colors give the total clustering values, from high (yellow) to low (dark green). For the overlays, nodes and edges from the continuous subnetwork are in grey while Zhang/Onnela are in orange. Nodes present in both subnetworks are marked in red.</figcaption></figure>

Interestingly, the fan-in clustering is the only one among multiple binary (Figure 6C) and weighted (Figure 6D) metrics that correlates well with the cortical hierarchy. In particular, it allows us to effectively discriminate iso-

cortical areas from the other pathway areas via the higher clustering of the former. None of the other clustering metrics presents such a correlation (Appendix Figure 8).
<figure><img src="image_8.png" /><figcaption>FIG. 6. The continuous weighted fan-in clustering coefficient correlates with the functional organisation of most sensory and motor pathways. A. Evolution of the fan-in clustering along several sensory pathways (see the mouse connectome entry in the Methods section (IVA) for a detailed list of the selected areas for each pathway). B. Evolution of the fan-in clustering along the motor pathway. In both A and B, areas belonging to the isocortex are highlighted in grey. The olfactory pathway is the only one that does not involve the isocortex nor displays a clear trend in the clustering coefficient. C. Compared to the binary measures, marked by (b), the weighted fan-in clustering efficiently discriminates the isocortical areas from the rest of the pathway areas: isocortical areas (given by the x-axis) have larger-than-average clustering. D. Even among weighted clustering patterns, fan-in is the only motif that displays a consistent trend along the pathways, with all values significantly below the identity line (dashed). To make them comparable, all properties X were normalized by their average value $\langle X \rangle$ in the network, and the error bars denote the interquartile of the distribution.</figcaption></figure>

Crucially, we see that this link between structure and function can be uncovered only via the fully-weighted, directed methods: while both the continuous and Zhang's definitions capture the gradual increase of the weighted fan-in clustering along the different pathways well, the hybrid methods fail to establish any correlation (Appendix Figure 9).

### 3. On the small-worldness of brain networks

We finally extend the measures of small-worldness to weighted-directed versions using the directed extensions of the clustering coefficient and directed null-model graphs for the small-world propensity, as detailed in the Methods section IV E. In this section, for the directed clustering coefficient, we take the total clustering coefficient without considering individual motifs.

To test how small-worldness measures are affected by the underlying clustering definitions, we construct a Watts-Stogatz network IV D to which we add spurious connections with small-weights. The spurious connections are drawn from a network with either random (Figure 7A)

or scale-free connectivity (Figure 7B) and the connection weights can be either all equal to a small value (Figure 7C) or drawn from an exponential distribution (Figure 7D), leading to four different combinations of spurious connectivity.

We begin by examining how the small word index (SWI) changes for the different types of spurious connections according to the underlying clustering definition. We find that while a strong divergence from the ground truth is visible regardless of the clustering definition used, hybrid definitions fare significantly worse compared to fully-weighted ones (Figure 7 E). We then examine a more recent and reliable metric of small-worldness, the small-world propensity (SWP) [11], and we observe that it is significantly more robust to noise regardless of the underlying clustering definition. Still, we clearly see that using the Zhang-Horvath or continuous definitions leads to more reliable results than using hybrid methods (Figure 7F).

Finally, we find that using directed and weighted small-world measures on connectomes reveals that small-worldness is not a universal feature of neuronal networks per se. Following Muldoon et al. [11] improvements with the introduction of small-world propensity, it is still gen-
<figure><img src="image_9.png" /><figcaption>FIG. 7. Small-worldness measures vary and display different robustness to noise depending on the clustering method used. Most connectomes do not register as small-worlds according to the directed-weighted small-world propensity (SWP). **A–D.** A “measured network” can be represented as the union of a “ground truth” (G.T.) — here a Watts–Strogatz network in dark brown — and spurious small-weight connections (“noise” graphs with: A random, or B scale-free connectivity, in red). We assess the influence of the weight distribution of spurious connections (red) by checking weights that are: **C** all equal and small or **D** following an exponential distribution and overlapping with the real weights (dark brown). **E.** Early measures of small-worldness, such as the small world index (SWI) display high variability depending on the noise and the method. **F.** The more recent small-world propensity (SWP) notably reduces this variability, especially for fully-weighted measures, though hybrid measures still present marked fluctuations. **G.** Though the connectomes often display small-world tendencies (proposed as SWP > 0.6 in [11]) for their undirected binary (grey) or weighted (light steelblue) versions, the situation can change drastically for the directed versions (dark grey and steelblue). Both *C. elegans* and the mouse connectome have relatively low small-world propensity whereas the tadpole and drosophila display higher values, registering as small-world. As all connectomes are weakly connected, the undirected SWP always uses the full network; however, only the mouse connectome is strongly connected so, for directed SWP in the other connectomes we use the largest strongly connected component (SCC) which contain between 85 and 99% of the neurons in the original networks.</figcaption></figure>

erally accepted in the neuroscience community that the “small-world” label should be attributed to a network when its small-world propensity goes over a somewhat arbitrary threshold of SWP = 0.6. However, we see that while the undirected versions of the connectomes (both weighted and unweighted) satisfy this definition of small-worldness, the equivalent directed versions have a significantly lower SWP in three out of the four connectomes (with the exception of the fruit fly). The resulting SWP is significantly below 0.6 for *C. elegans* and below 0.5 for the mouse brain, but remains above the threshold for the fruit fly and the tadpole of *C. intestinalis* (Figure 7G).

Thus, while the connectomes of the fruit fly and the tadpole of *C. intestinalis* retain a high small-world propensity even when properly assessed as weighted directed networks, the connectomes of *C. elegans* and the mouse cannot be considered small-world because of their low clustering levels and long path length — see Appendix Figure 10. These results are consistent for all clustering methods, although hybrid methods tend to estimate lower SWP across connectomes (Figure 7H).
### III. DISCUSSION

Contrary to what happens for binary clustering, we showed that when using weighted measures, false negatives (removal of real edges) can lead to greater errors than false positives (presence of spurious edges) depending on the network structure.

As the problem of finding a sensible threshold for a given network remains unsolved, we suggest a different approach to deal with potentially spurious low-weight edges. To properly assess strong recurrent interactions in weighted networks, one needs a fully weighted definition of clustering that is not influenced by small and spurious connections. Such a measure might eliminate the need for thresholding and enable analysis to be performed directly on a measured network, even if it contains many spurious edges with low weights.

Our analysis of connectomes enabled us to highlight how binary structure and weight correlations contribute to reinforcing redundant information transfer via middle-man, fan-in, and fan-out motifs (Figure 5). In the mouse connectome, fan-in clustering strongly correlates with the organization of most sensory and motor pathways (Figure 6). As such neurons need to reliably integrate large amounts of information, these large clustering values reinforce the hypothesis that redundant and clustered structures play a significant functional role in such circuits. Indeed, as one progresses along sensory pathways, the areas tend to address more and more complex signals, potentially via a combination of the results from the previous areas and the additional synergistic information left in the initial signal, which would require such fan-in motifs. In the mouse, these areas mostly belong to the iso-cortex except for notable outliers such as caudoputamen (CP), which has high clustering values due to its very large size and, therefore, large associated weights, and the inferior and superior colliculus (IC/SC) that are involved in multi-sensory integration [31, 32] and are therefore expected to have high fan-in values.

Finally, regarding small-worldness, one can see a much more complex picture than the previously proposed universal small-worldness of brain networks. Indeed, both at the micro- and mesoscale levels, we find that some connectomes are far from being small-world when compared to the commonly used threshold. Notably, we identify low clustering values and high path lengths for *C. elegans*, and the mouse. Furthermore, most connectomes are not strongly connected, meaning that not all nodes can reach all other nodes (which goes against the concept of small-worldness); this corresponds to 9% of the nodes for *C. elegans* and *C. intestinalis*, and 3% for drosophila. Small-worldness has stirred controversy in neuroscience, and though many of the technical issues raised a few years ago [33] have been partly addressed thanks to weighted

analysis methods and the introduction of the SWP, the fundamental question of its relevance remains. Indeed, as discussed in [33, 34], the relevance of shortest paths for communication in brain networks is questionable. Furthermore, the notion of clustering associated with small-worldness ignores the specificity of directed patterns that play a crucial in identifying specific populations and processing functions.

### Open questions and limitations

Among all sensory pathways in the mouse connectome, the olfactory pathway was the only one that did not display any correlation between the pathway hierarchy and the fan-in clustering values. The fact that this is the only pathway where all nodes belong to the cerebral cortex (and mostly to the same region, the olfactory areas) is probably not a coincidence, but it is unclear why this particular pathway would behave differently from the other sensory pathways.

The immature connectome that we investigated, for the tadpole of *C. intestinalis*, was the only chemical network where no significant influence of connection strength was visible, is also of great interest. Further work on the connectome of a single animal at different developmental stages would bring significant benefits to assess whether clustering and small-world properties vary or remain stable throughout development and how this could relate to functional and behavioural features.

*C. elegans* is an interesting example of small-worldness because it consists of two complementary networks: one composed of chemical synapses has low SWP (cf. Figure 7 G-H) and another, undirected and with high SWP, consists of electrical (or gap) junctions that directly couple the membrane potentials or connected cells. However, these networks correspond to very different types of interactions, and it is therefore unclear whether we can simply combine them together to say that the overall connectome of *C. elegans* displays small-world properties.

### IV. METHODS

All networks were generated and analysed using version 2.7.1 of the NNGT library [35].
## A. Connectomes

This part describes the datasets that were used to generate the connectomes used in this study. The code to build the actual networks from the data is available upon request and will be made public once the article is published.

### Caenorhabditis elegans

The worm connectome was taken from the WormWiring website[36] as the network of chemical synapses from the hermaphrodite *C. elegans* ([4] SI4 and SI5). It was mapped by Cook *et al.* using electron microscopy. We ignore self-loops present in the original data and obtain a network of 302 neurons and 3,709 directed chemical synapses. This corresponds to a network density of 4.1%. Weights are discrete, ranging from 1 to 75, and correspond to the total amount of physical connectivity between neurons, including the number and size of synapses.

The strongly-connected component contains 275 neurons.

### Tadpole of Ciona intestinalis

The tadpole microscale connectome was obtained from [30], from which we investigated the chemical synapses between all 222 cells.

The data is available from the supplementary data 1 from Figure 6[37].

The network contains 222 cells and 3,105 edges with weights, reflecting the size of the synaptic connections in micrometer, with a range from 0.06 to 16.623 for neurons and to more than 114 for connections to muscle nodes.

The strongly-connected component contains 196 neurons and 2,972 edges with weights from 0.06 to 16.623.

### Drosophila melanogaster

The fruit fly connectome was taken from the hemibrain connectome v1.2 which contains a dense reconstruction of the fruit fly's central brain [5]. The connectome was reconstructed using electron microscopy and a combination of machine learning algorithms and manual labor for neuron and synapse detection. We accessed the neuPrint database [38] through its Python API [39].

From the initial 97,900 neurons present in the dataset, we kept the 85,189 that had both in- and out-connections. Consistently with the way neurons were grouped in [5] and [40], we associated them by their two main input and output neuropils (potentially only one of each if a single input or output neuropil was associated to the neuron). Considering all synapses, this gave us a mesoscale connectome consisting of 2,349 nodes containing from 1 to 18,570 neurons each and 328,548 edges. The weights associated to the connections span 6 orders of magnitude, from 1 to 2,931,945.

The strongly connected component contains 2,347 nodes.

If we follow instead the methodology from and keep only strong connections (at least 3 synapses between the neurons), this leads 52,668 neurons with in- and out-connections that were coalesced into a network of 2,356 nodes containing from 1 to 9,565 neurons each and connected via 144,368 edges. The edge weights span 6 orders of magnitude, from 3 to 2,250,066.

The strongly-connected component contains 2,338 nodes.

### Mouse

The mesoscale network from the mouse brain was obtained from the NeuroData[41] file Mouse Brain 1, obtained from the work of [7].

We regenerated the whole brain from this by duplicating each node into its left/right hemisphere instance and generating the associated ipsi- and contra-lateral connections. In the end, this led to a network of 426 nodes and 65,464 edges with weights spanning more than 16 orders of magnitude, ranging from almost zero to slightly more than 20.

All nodes are contained within a single strongly-connected component.

For the pathways detailed on Figure 6, the associated areas as detailed below, in the same order as in the figure. Information about the pathways were obtained from [7] (Extended Data Figure 10) and [42] as well as from pathway-specific studies.

For the gustatory pathway [43], the areas are: Nucleus of the solitary tract (NTC), Parabrachial nucleus (PB), Ventral posteromedial nucleus of the thalamus (parvicellular part, VPMpc), Lateral hypothalamic area (LHA), Basolateral amygdalar nucleus (BLA), Gustatory areas (GU).

For the visual pathway, the areas are: Dorsal part of the lateral geniculate complex (LGd), Ventral part of the lateral geniculate complex (LGv), Superior colliculus, sensory related (SCs), Lateral posterior nucleus of the
thalamus (LP), Lateral visual area (VISI), Anteromedial visual area (VISam), Anterolateral visual area (VISal), Primary visual area (VISp).

For the auditory pathway [44], the areas are: Dorsal cochlear nucleus (DCO), Ventral cochlear nucleus (VCO), Superior olivary complex (SOC), Nucleus of the lateral lemniscus (NLL), Medial geniculate complex (ventral part, MGv), Medial geniculate complex (medial part, MGm), Medial geniculate complex (dorsal part, MGd), Inferior colliculus (external nucleus, ICe), Inferior colliculus (dorsal nucleus, ICd), Inferior colliculus (central nucleus, ICc), Primary auditory area (AUDp).

For the whisker sensory pathway, the areas are: Spinal nucleus of the trigeminal (oral part, SPVO), Spinal nucleus of the trigeminal (caudal part, SPVC), Spinal nucleus of the trigeminal (interpolar part, SPVI), Principal sensory nucleus of the trigeminal (PSV), Superior colliculus, sensory related (SCs), Posterior complex of the thalamus (PO), Ventral posteromedial nucleus of the thalamus (VPM), Primary somatosensory area (barrel field, SSp-bfd).

For the olfactory pathway [45, 46], the areas are: Main olfactory bulb (MOB), Accessory olfactory bulb (AOB), Anterior olfactory nucleus (AON), Olfactory tubercle (OT), Nucleus of the lateral olfactory tract (NLOT), Tænia tecta (TT), Cortical amygdalar area (anterior part, COAa), Cortical amygdalar area (posterior part, COAp), Piriform-amygdalar area (PAA), Piriform area (PIR), Postpiriform transition area (TR), Entorhinal area (lateral part, ENTl).

For the motor pathway [47], the areas are: Primary motor area (MOp), Secondary motor area (MOs), Caudoputamen (CP), Globus pallidus (internal segment, GPi), Globus pallidus (external segment, GPe), Ventral anterior-lateral complex of the thalamus (VAL), Parafascicular nucleus (PF), Ventral medial nucleus of the thalamus (VM), Mediodorsal nucleus of thalamus (MD), Superior colliculus (motor related, SCm), Subthalamic nucleus (STN), Pontine gray (PG), Nucleus raphe magnus (RM).

## B. Nomenclature

For all definitions, we use the following notation: A is the adjacency matrix of a graph. $W = \{w_{ij}\}$ is the normalized weight matrix, obtained from the original weight matrix $\tilde{W} = \{\tilde{w}_{ij}\}$ by $w_{ij} = \tilde{w}_{ij}/\max_{i,j}(\tilde{w}_{ij})$. $d_i$ is the degree of node $i$ and $s_i = \sum_j w_{ij}$ is its strength. $W^{[\alpha]} = w_{ij}^{\alpha}$ and $s_i^{[\alpha]} = \sum_{j \sim i} w_{ij}^{\alpha}$ are the fractional weight matrix and strength for any $\alpha \in \mathbb{R}$.

For the directed definitions, $d_{i,in}$, $d_{i,out}$ and $d_{i,tot} = d_{i,in} + d_{i,out}$ denote the in-, out-, and the total-degree of node $i$. Similarly, $s_{i,in}$, $s_{i,out}$ and $s_{i,tot} = s_{i,in} + s_{i,out}$ denote the in-, out-, and the total-strength of node $i$.

The number of reciprocal edges between $i$ and its neighbors

(i.e. the number of nodes $j$ for which both an edge $i \to j$ and an edge $j \to i$ exist) is denoted by $d_i^{\leftrightarrow}$. The reciprocal strength of $i$ is denoted by $s_{i,\leftrightarrow}$ and can either be defined via the arithmetic mean of reciprocal weights as in [23], for the Barrat's definition $s_{i,\leftrightarrow}^B = \sum_{j \neq i} \frac{w_{ij}+w_{ji}}{2}$, or via their geometric mean for the Zhang-Horvath and continuous definitions, $s_{i,\leftrightarrow} = \sum_{j \neq i} \sqrt{w_{ij}w_{ji}}$. Details are provided if the reciprocal strength is used in a definition of clustering coefficients.

## C. Weighted directed clustering definitions

Weighted directed clustering measures use the edge weights to quantify the importance of each triangle, called triangle “intensity”. Instead of counting the number of triangles $\Delta_{ijk}$ that a node $i$ participates in, they sum the intensities $I_{\Delta_{ijk}}$ of these triangles. Similarly, they can use the same methodology for to quantify triplets via the triplet intensity $I_{Tijk}$. Differences between weighted measures thus lay in the way they define triangle and triplet intensity as the generic definition of the clustering coefficient for a definition $D$ and a motif $m$ is:

$$C_{i}^{D,m} = \frac{I_{\Delta,i}^{D,m}}{I_{T,i}^{D,m}} = \frac{\sum_{j \neq k} I_{\Delta_{ijk}}^{D,m}}{\sum_{j \neq k} I_{T_{ijk}}^{D,m}} \quad (1)$$

We separate the weighted measures into two classes:

* Hybrid definitions, that combine weighted properties (from the weighted connectivity matrix) with binary properties that come from the adjacency matrix (typically node degrees or average weights).

* Fully-weighted definitions, that do not include any binary properties and only use the weighted connectivity matrix.

The two hybrid definitions were introduced by Barrat et al. [21] and Onnela et al. [22], then extended to directed networks by [23] and [24] respectively. The fully weighted definitions include that from Zhang and Horvath [25], originally introduced for undirected networks, then extended to directed networks and the continuous definition [20].
<table><caption>TABLE I. Definitions of the Barrat (B), Onnela (O), Zhang-Horvath (Z), and continuous (C) intensities for each partial mode pattern in directed graph. The triplet intensity of Onnela's method is actually the same as the binary triplet count $n_{T,i}^m$. For Barrat's triplet intensity, the reciprocal strength has been defined in [23] as $s_{i,↔}^B = \sum_{i \neq j} \frac{1}{2}(w_{ij} + w_{ji})$.</caption><thead><tr><th></th><th>Cycle</th><th>Fan-in</th><th>Fan-out</th><th>Middleman</th></tr></thead><tbody><tr><td>I<sup>O,m</sup><sub>Δ,i</sub></td><td>(W<sup>[1/3]</sup>)<sup>3</sup><sub>ii</sub></td><td>(W<sup>[1/3]</sup><sup>T</sup> (W<sup>[1/3]</sup>)<sup>2</sup>)<sub>ii</sub></td><td>((W<sup>[1/3]</sup>)<sup>2</sup> W<sup>[1/3]</sup><sup>T</sup>)<sub>ii</sub></td><td>(W<sup>[1/3]</sup> W<sup>[1/3]</sup><sup>T</sup> W<sup>[1/3]</sup>)<sub>ii</sub></td></tr><tr><td>I<sup>O,m</sup><sub>T,i</sub></td><td>d<sub>i,in</sub>d<sub>i,out</sub> - d<sub>i,↔</sub></td><td>d<sub>i,in</sub>(d<sub>i,in</sub> - 1)</td><td>d<sub>i,out</sub>(d<sub>i,out</sub> - 1)</td><td>d<sub>i,in</sub>d<sub>i,out</sub> - d<sub>i,↔</sub></td></tr><tr><td>I<sup>B,m</sup><sub>Δ,i</sub></td><td>1/2 (WA<sup>2</sup> + (WA<sup>2</sup>)<sup>T</sup>)<sub>ii</sub></td><td>1/2 (W<sup>T</sup>(A + A<sup>T</sup>)A)<sub>ii</sub></td><td>1/2 (W(A + A<sup>T</sup>)A<sup>T</sup>)<sub>ii</sub></td><td>1/2 (WA<sup>T</sup>A + W<sup>T</sup>AA<sup>T</sup>)<sub>ii</sub></td></tr><tr><td>I<sup>B,m</sup><sub>T,i</sub></td><td>1/2 (s<sub>i,in</sub>d<sub>i,out</sub> + s<sub>i,out</sub>d<sub>i,in</sub>) - s<sup>B</sup><sub>i,↔</sub></td><td>s<sub>i,in</sub>(d<sub>i,in</sub> - 1)</td><td>s<sub>i,out</sub>(d<sub>i,out</sub> - 1)</td><td>1/2 (s<sub>i,in</sub>d<sub>i,out</sub> + s<sub>i,out</sub>d<sub>i,in</sub>) - s<sup>B</sup><sub>i,↔</sub></td></tr><tr><td>I<sup>Z,m</sup><sub>Δ,i</sub></td><td>(W)<sup>3</sup><sub>ii</sub></td><td>(W<sup>T</sup>WW)<sub>ii</sub></td><td>(WWW<sup>T</sup>)<sub>ii</sub></td><td>(WWW<sup>T</sup>W)<sub>ii</sub></td></tr><tr><td>I<sup>Z,m</sup><sub>T,i</sub></td><td>s<sub>i,in</sub>s<sub>i,out</sub> - s<sup>[2]</sup><sub>i,↔</sub></td><td>s<sub>i,in</sub>s<sub>i,out</sub> - s<sup>[2]</sup><sub>i,↔</sub></td><td>(s<sub>i,in</sub>)<sup>2</sup> - s<sup>[2]</sup><sub>i,in</sub></td><td>(s<sub>i,out</sub>)<sup>2</sup> - s<sup>[2]</sup><sub>i,out</sub></td></tr><tr><td>I<sup>C,m</sup><sub>Δ,i</sub></td><td>(W<sup>[2/3]</sup>)<sup>3</sup><sub>ii</sub></td><td>(W<sup>[2/3]</sup><sup>T</sup> (W<sup>[2/3]</sup>)<sup>2</sup>)<sub>ii</sub></td><td>((W<sup>[2/3]</sup>)<sup>2</sup> W<sup>[2/3]</sup><sup>T</sup>)<sub>ii</sub></td><td>(W<sup>[2/3]</sup> W<sup>[2/3]</sup><sup>T</sup> W<sup>[2/3]</sup>)<sub>ii</sub></td></tr><tr><td>I<sup>C,m</sup><sub>T,i</sub></td><td>s<sup>[1/2]</sup><sub>i,in</sub>s<sup>[1/2]</sup><sub>i,out</sub> - s<sup>↔</sup><sub>i</sub></td><td>(s<sup>[1/2]</sup><sub>i,in</sub>)<sup>2</sup> - s<sub>i,in</sub></td><td>(s<sup>[1/2]</sup><sub>i,out</sub>)<sup>2</sup> - s<sub>i,out</sub></td><td>s<sup>[1/2]</sup><sub>i,in</sub>s<sup>[1/2]</sup><sub>i,out</sub> - s<sup>↔</sup><sub>i</sub></td></tr></tbody></table>

### D. Graph generation and shuffling

#### 1. Spatial network (Figure 3)

The spatial network is obtained by generating 1000 nodes uniformly, at random, within a disk of radius 300. From each node $i$, an outgoing edge to each other node $j$ in the graph is then generated with probability

$$p(\mathbf{r}_i, \mathbf{r}_j) = \max \left( 1 - \frac{\|\mathbf{r}_i - \mathbf{r}_j\|}{\lambda}, 0 \right) \quad (2)$$

On the figure, a value of $\lambda = 50$ is used.

The weight distribution is sampled from a log-normal distribution with a location of 0 and a scale of 1 associated to the underlying normal distribution. This leads to the resulting distribution having a median value of 1, a mean of $e^{1/2}$, and 95% of the weight values being in the [0.14, 7] interval.

The function used in the code is:
`nngt.generation.distance_rule`.

#### 2. Watts-Strogatz networks (Figure 4 and 7)

The original Watts-Strogatz network [48] consists of a regular lattice basis (characterized by a coordination number $k$) that is then modified, rewiring each edge with a probability $p$. For directed networks, we used a generalization of that method implemented in NNGT which is strictly equivalent except for the fact that edges are now directed:

1. start from a directed regular lattice with coordination number $k$ and reciprocity $r$ (taken as 1 in this paper),

2. rewire each edge with probability $p$.

The original lattice $L(N, k, r)$ has $\frac{1}{2}Nk(1+r)$ edges, leading to the limit cases

* $\frac{1}{2}Nk$ edges if $r = 0$, like the undirected lattice,

* $Nk$ edges if $r = 1$, with all connections being reciprocal.

On Figure 4D and 7A-F (ground-truth graphs), the parameters used are $N = 1000$, $k = 20$, and $r = 0.03$. The weights associated to the edges are drawn from a shifted exponential distribution $SE(w_{min}, \lambda) = w_{min} + \text{Exp}(\lambda)$ with $w_{min} = 0.1$ and $\lambda = 1.5$.

The function used in the code is:
`nngt.generation.watts_strogatz`.
### 3. Erdős–Rényi and scale-free networks (Figure 4)

On Figure 4 E, the Erdős–Rényi graph is $ER(N = 1000, E = 10000)$.

The function used in the code is:

``nngt.generation.erdos_renyi``.

On Figure 4 F, the scale-free graph is generated from a Price network [49]. The graph contains 1000 nodes that are added one after the other, each making at most $m = 10$ out-going edges (for the first 10 nodes, the $i$th only makes $i-1$ out-going edges). These edges target already existing nodes with a probability $p \propto d_{in}^{\gamma} + c$, which leads to an in-degree distribution for $\gamma = 1$:

$$P_{d_{in}} \sim d_{in}^{-(2+c/m)} \quad (3)$$

The function used in the code is:

``nngt.generation.price_scale_free``.

### 4. Graph shuffling (Figure 5)

On Figure 5 A–D, the influence of the weights on the clustering motifs is assessed by comparing the original connectomes to null-models with the same binary connectivity but shuffled weights. In practice, from the initial weighted graph $G(V, E, W)$, one creates $G'(V, E, W')$ such that the new weights $W' = \{w'_{ij}\}$ are a random permutation of the original weights $W = \{w_{ij}\}$.

For Figure 5 E, the combined effect of weights and binary structure is assessed by comparing the original connectome to an Erdős–Rényi graph with the same number of nodes, edges, and the same set of weights. In practice, from the initial weighted graph $G(V, E, W)$, one creates $ER(V, E', W)$ such that $|E| = |E'|$.

## E. Small-world propensity

As in [11], the Small-World Propensity (SWP) of a graph $G$ is defined as:

$$SWP(G) = 1 - \sqrt{\frac{\Delta_C^2 + \Delta_L^2}{2}} \quad (4)$$

with the deviations

$$\Delta_C = \frac{\langle C_l^{tot} \rangle - \langle C_G^{tot} \rangle}{\langle C_l^{tot} \rangle - \langle C_r^{tot} \rangle} \quad \text{and} \quad \Delta_L = \frac{\langle L_G \rangle - \langle L_r \rangle}{\langle L_l \rangle - \langle L_r \rangle} \quad (5)$$

where $\langle C_{l/r}^{tot} \rangle$ is the average total clustering coefficient of latticized/randomized version of $G$ and $\langle L_{l/r} \rangle$ is the associated average path length. The deviations are restricted

to the [0, 1] interval and clipped if they go below zero or above one.

The main difference, besides the use of directed clustering coefficients and paths, lays in the way “latticization” is implemented. Indeed, as the lattice is used as the reference for the maximum local clustering, we used the following algorithm: from the graph $G$ with $N$ nodes and $E$ edges,

1. a fully reciprocal circular of coordination number $k = \lfloor E/2N \rfloor$ is made

2. we define the distance between two nodes via the positive modulo $d_{ij} = |i - j| \mod N$,

3. starting from node 0, the largest weight is attributed to its connection to node 1, then the second largest weight to the reciprocal connection, (1, 0), this is continued with node 1 and connections (1, 2), (2, 1), then with subsequent nodes and connections in a clockwise fashion until all first neighbors are connected

4. this pattern is continued until all $k$-th nearest neighbors have been connected with decreasing weight values

5. the remaining $E_r = E - 2N \lfloor E/2N \rfloor < N$ edges are used to connect the first $\lfloor E_r/2 \rfloor$ nodes to their clockwise $k+1$-th nearest neighbors, and reciprocally, with decreasing edge strength (note that the last connection will not be reciprocated if $E$ is odd)

This leads to a lattice that maximizes the local clustering as the edges of close neighbors are all reciprocated and associated to large weights.

## ACKNOWLEDGMENTS

Tanguy Fardet received funding from a Humboldt Research Fellowship for Postdoctoral Researchers (Alexander von Humboldt Foundation), then from the European Union's Horizon Europe research and innovation programme under the Marie Sklodowska-Curie grant agreement No 101063239. Emmanouil Giannakakis thanks the International Max Planck Research School for Intelligent Systems (IMPRS-IS) and the Tübingen AI center for support. Anna Levina is a member of the Machine Learning Cluster of Excellence, EXC number 2064/1 – Project number 39072764. This work was supported by a Sofja Kovalevskaja Award from the Alexander von Humboldt Foundation We also thank Janne Lappalainen and Zinovia Stefanidi for a valuable discussion about drosophila connectomics.
[1] X.-J. Wang and H. Kennedy, Brain structure and dynamics across scales: in search of rules, Current opinion in neurobiology **37**, 92 (2016).

[2] P. Bonifazi and P. Massobrio, Reconstruction of functional connectivity from multielectrode recordings and calcium imaging, Advances in neurobiology **22**, 207 (2019).

[3] M. J. Brookes, J. R. Hale, J. M. Zumer, C. M. Stevenson, S. T. Francis, G. R. Barnes, J. P. Owen, P. G. Morris, and S. S. Nagarajan, Measuring functional connectivity using meg: methodology and comparison with fcmri, NeuroIm- age **56**, 1082 (2011).

[4] S. J. Cook, T. A. Jarrell, C. A. Brittin, Y. Wang, A. E. Bloniarz, M. A. Yakovlev, K. C. Q. Nguyen, L. T.-H. Tang, E. A. Bayer, J. S. Duerr, H. E. Bülow, O. Hobert, D. H. Hall, and S. W. Emmons, Whole-animal connec- tomes of both caenorhabditis elegans sexes, Nature **571**, 63 (2019).

[5] L. K. Scheffer, C. S. Xu, M. Januszewski, Z. Lu, S.-Y. Takemura, K. J. Hayworth, G. B. Huang, K. Shi- nomiya, J. Maitlin-Shepard, S. Berg, J. Clements, P. M. Hubbard, W. T. Katz, L. Umayam, T. Zhao, D. Acker- man, T. Blakely, J. Bogovic, T. Dolafi, D. Kainmueller, T. Kawase, K. A. Khairy, L. Leavitt, P. H. Li, L. Lind- sey, N. Neubarth, D. J. Olbris, H. Otsuna, E. T. Traut- man, M. Ito, A. S. Bates, J. Goldammer, T. Wolff, R. Svirskas, P. Schlegel, E. Neace, C. J. Knecht, C. X. Alvarado, D. A. Bailey, S. Ballinger, J. A. Borycz, B. S. Canino, N. Cheatham, M. Cook, M. Dreher, O. Duc- los, B. Eubanks, K. Fairbanks, S. Finley, N. Forknall, A. Francis, G. P. Hopkins, E. M. Joyce, S. Kim, N. A. Kirk, J. Kovalyak, S. A. Lauchie, A. Lohff, C. Maldon- ado, E. A. Manley, S. McLin, C. Mooney, M. Ndama, O. Ogundeyi, N. Okeoma, C. Ordish, N. Padilla, C. M. Patrick, T. Paterson, E. E. Phillips, E. M. Phillips, N. Rampally, C. Ribeiro, M. K. Robertson, J. T. Rymer, S. M. Ryan, M. Sammons, A. K. Scott, A. L. Scott, A. Shinomiya, C. Smith, K. Smith, N. L. Smith, M. A. Sobeski, A. Suleiman, J. Swift, S. Takemura, I. Talebi, D. Tarnogorska, E. Tenshaw, T. Tokhi, J. J. Walsh, T. Yang, J. A. Horne, F. Li, R. Parekh, P. K. Rivlin, V. Jayaraman, M. Costa, G. S. Jefferis, K. Ito, S. Saalfeld, R. George, I. A. Meinertzhagen, G. M. Ru- bin, H. F. Hess, V. Jain, and S. M. Plaza, A connectome and analysis of the adult drosophila central brain, eLife **9**, 10.7554/eLife.57443 (2020).

[6] M. Winding, B. D. Pedigo, C. L. Barnes, H. G. Patsolic, Y. Park, T. Kazimiers, A. Fushiki, I. V. Andrade, A. Khandelwal, J. Valdes-Aleman, F. Li, N. Randel, E. Barsotti, A. Correia, R. D. Fet- ter, V. Hartenstein, C. E. Priebe, J. T. Vogel- stein, A. Cardona, and M. Zlatic, The connectome of an insect brain, Science **379**, eadd9330 (2023), https://www.science.org/doi/pdf/10.1126/science.add9330.

[7] S. W. Oh, J. A. Harris, L. Ng, B. Winslow, N. Cain, S. Mihalas, Q. Wang, C. Lau, L. Kuan, A. M. Henry, M. T. Mortrud, B. Ouellette, T. N. Nguyen, S. A. Sorensen, C. R. Slaughterbeck, W. Wakeman, Y. Li, D. Feng, A. Ho, E. Nicholas, K. E. Hirokawa, P. Bohn, K. M. Joines, H. Peng, M. J. Hawrylycz, J. W. Phillips, J. G. Hohmann, P. Wohnoutka, C. R. Gerfen, C. Koch,

A. Bernard, C. Dang, A. R. Jones, and H. Zeng, A mesoscale connectome of the mouse brain, Nature **508**, 207 (2014).

[8] R. C. Craddock, S. Jbabdi, C.-G. Yan, J. T. Vogelstein, F. X. Castellanos, A. Di Martino, C. Kelly, K. Heber-lein, S. Colcombe, and M. P. Milham, Imaging human connectomes at the macroscale, Nature methods **10**, 524 (2013).

[9] D. S. Bassett and O. Sporns, Network neuroscience, Na- ture neuroscience **20**, 353 (2017).

[10] M. E. Newman, Scientific collaboration networks. ii. shortest paths, weighted networks, and centrality, Phys- ical Review E **64**, 016132 (2001).

[11] S. F. Muldoon, E. W. Bridgeford, and D. S. Bassett, Small-world propensity and weighted brain networks, Sci- entific reports **6**, 22057 (2016).

[12] S. Whitfield-Gabrieli and A. Nieto-Castanon, Conn: A functional connectivity toolbox for cor- related and anticorrelated brain networks, Brain Connectivity **2**, 125 (2012), pMID: 22642651, https://doi.org/10.1089/brain.2012.0073.

[13] J. Wang, X. Wang, M. Xia, X. Liao, A. Evans, and Y. He, Gretna: a graph theoretical network analysis toolbox for imaging connectomics, Frontiers in Human Neuroscience **9**, 386 (2015).

[14] L. Waller, A. Brovkin, L. Dorfschmidt, D. Bzdok, H. Wal- ter, and J. Kruschwitz, Graphvar 2.0: A user-friendly toolbox for machine learning on functional connectiv- ity measures, Journal of Neuroscience Methods **308**, 21 (2018).

[15] M. Rubinov and O. Sporns, Complex network measures of brain connectivity: Uses and interpretations, Neu- rolImage **52**, 1059 (2010), computational Models of the Brain.

[16] N. Z. Bielczyk, F. Walocha, P. W. Ebel, K. V. Haak, A. Llera, J. K. Buitelaar, J. C. Glennon, and C. F. Beck- mann, Thresholding functional connectomes by means of mixture modeling, NeuroImage **171**, 402 (2018).

[17] C. J. Stam, P. Tewarie, E. van Dellen, E. C. W. van Straaten, A. Hillebrand, and P. van Mieghem, The trees and the forest: Characterization of complex brain net- works with minimum spanning trees, International jour- nal of psychophysiology : official journal of the Interna- tional Organization of Psychophysiology **92**, 129 (2014).

[18] S. I. Dimitriadis, C. Salis, I. Tarnanas, and D. E. Linden, Topological filtering of dynamic functional brain net- works unfolds informative chronnectomics: A novel data- driven thresholding scheme based on orthogonal minimal spanning trees (omsts), Frontiers in neuroinformatics **11**, 28 (2017).

[19] P. Kale, A. Zalesky, and L. L. Gollo, Estimating the impact of structural directionality: How reliable are undirected connectomes?, Network Neuroscience **2**, 259 (2018).

[20] T. Fardet and A. Levina, Weighted directed cluster- ing: Interpretations and requirements for heterogeneous, inferred, and measured networks, Physical Review Re- search **3**, 043124 (2021).

[21] A. Barrat, M. Barthélemy, R. Pastor-Satorras, and A. Vespignani, The architecture of complex weighted net- works, Proceedings of the National Academy of Sciences
of the United States of America **101**, 3747 (2004).

[22] J.-P. Onnela, J. Saramäki, J. Kertész, and K. Kaski, Intensity and coherence of motifs in weighted complex networks, Physical Review E **71**, 065103 (2005).

[23] G. P. Clemente and R. Grassi, Directed clustering in weighted networks: A new perspective, Chaos, Solitons & Fractals **107**, 26 (2018).

[24] G. Fagiolo, Clustering in complex directed networks, Physical Review E **76**, 026107 (2007).

[25] B. Zhang and S. Horvath, A general framework for weighted gene co-expression network analysis, Statistical applications in genetics and molecular biology **4**, Article17 (2005).

[26] C. Thomas, Q. Y. Frank, M. O. Irfanoglu, P. Modi, K. S. Saleem, D. A. Leopold, and C. Pierpaoli, Anatomical accuracy of brain connections derived from diffusion MRI tractography is inherently limited, Proceedings of the National Academy of Sciences **111**, 16574 (2014).

[27] A. Zalesky, A. Fornito, L. Cocchi, L. L. Gollo, M. P. van den Heuvel, and M. Breakspear, Connectome sensitivity or specificity: which is more important?, NeuroImage **142**, 407 (2016).

[28] G. Buzsáki and K. Mizuseki, The log-dynamic brain: how skewed distributions affect network operations, Nature Reviews Neuroscience **15**, 264 (2014).

[29] Y. Loewenstein, A. Kuras, and S. Rumpel, Multiplicative dynamics underlie the emergence of the log-normal distribution of spine sizes in the neocortex in vivo, Journal of Neuroscience **31**, 9481 (2011).

[30] K. Ryan, Z. Lu, and I. A. Meinertzhagen, The CNS connectome of a tadpole larva of Ciona intestinalis (L.) highlights sidedness in the brain of a chordate sibling, eLife **5**, e16962 (2016).

[31] K. Gruters and J. Groh, Sounds and beyond: Multisensory and other non-auditory signals in the inferior colliculus, Frontiers in Neural Circuits **6**, 96 (2012).

[32] S. Ito and D. A. Feldheim, The Mouse Superior Colliculus: An Emerging Model for Studying Circuit Formation and Function, Frontiers in Neural Circuits **12**, 10 (2018).

[33] D. Papo, M. Zanin, J. H. Martínez, and J. M. Buldú, Beware of the Small-World Neuroscientist!, Frontiers in Human Neuroscience **10**, 10.3389/fnhum.2016.00096 (2016), publisher: Frontiers.

[34] A. Avena-Koenigsberger, X. Yan, A. Kolchinsky, M. P. v. d. Heuvel, P. Hagmann, and O. Sporns, A spectrum of routing strategies for brain networks, PLOS Computational Biology **15**, e1006833 (2019), publisher: Public Library of Science.

[35] T. Fardet, NNGT 2.7.1: improved configuration, scipy, and networkx support (2024).

[36] https://wormwiring.org/pages/adjacency.html.

[37] https://elifesciences.org/articles/16962/figures#SD6-data.

[38] https://neuprint.janelia.org/.

[39] https://github.com/connectome-neuprint/neuprint-python.

[40] B. K. Hulse, H. Haberkern, R. Franconville, D. B. Turner-Evans, S. Takemura, T. Wolff, M. Noorman, M. Dreher, C. Dan, R. Parekh, A. M. Hermundstad, G. M. Rubin, and V. Jayaraman, A connectome of the Drosophila central complex reveals network motifs suitable for flexible navigation and context-dependent action selection, bioRxiv, 2020.12.08.413955 (2020).

[41] https://neurodata.io/project/connectomes/.

[42] B. A. Pailthorpe, Network analysis of mesoscale mouse brain structural connectome yields modular structure that aligns with anatomical regions and sensory pathways, bioRxiv, 755041 (2019).

[43] A. Carleton, R. Accolla, and S. A. Simon, Coding in the mammalian gustatory system, Trends in Neurosciences **33**, 326 (2010), 20493563.

[44] M. Di Bonito and M. Studer, Cellular and Molecular Underpinnings of Neuronal Assembly in the Central Auditory System during Mouse Development, Frontiers in Neural Circuits **11**, 18 (2017), 28469562.

[45] F. De Castro, Wiring olfaction: The cellular and molecular mechanisms that guide the development of synaptic connections from the nose to the cortex, Frontiers in Neuroscience **3**, 4 (2009).

[46] K. Mori, H. Manabe, K. Narikiyo, and N. Onisawa, Olfactory consciousness and gamma oscillation couplings across the olfactory bulb, olfactory cortex, and orbitofrontal cortex, Frontiers in psychology **4**, 743 (2013).

[47] M. Jeong, Y. Kim, J. Kim, D. D. Ferrante, P. P. Mitra, P. Osten, and D. Kim, Comparative three-dimensional connectome map of motor cortical projections in the mouse brain, Scientific Reports **6**, 20072 (2016).

[48] D. J. Watts and S. H. Strogatz, Collective dynamics of 'small-world' networks, in *The Structure and Dynamics of Networks* (Princeton University Press, Princeton, 2006) pp. 301–303.

[49] D. D. S. Price, A general theory of bibliometric and other cumulative advantage processes, Journal of the American Society for Information Science **27**, 292 (1976).

[50] C. Eschbach, A. Fushiki, M. Winding, C. M. Schneider-Mizell, M. Shao, R. Arruda, K. Eichler, J. Valdes-Aleman, T. Ohyama, A. S. Thum, B. Gerber, R. D. Fetter, J. W. Truman, A. Litwin-Kumar, A. Cardona, and M. Zlatic, Recurrent architecture for adaptive regulation of learning in the insect brain, Nature Neuroscience **23**, 544 (2020).
**Appendix A: Hierarchical structures along the mouse cortical pathways**

The hierarchical structures are only visible through fully-
weighted fan-in clustering — Figure 9 — and cannot be
identified by other standard graph measurements — Fig-
ure 8.

**Appendix B: Small-world propensity of the C. elegans and mouse connectomes**

Both *C. elegans* and the mouse mesoscale connectome
have simultaneously low weighted directed clustering
compared to an equivalent lattice and high average path
length compared to an equivalent random graph (cf.
shuffling methods IVD), as shown on Appendix Fig-
ure 10, which leads to their low SWP on Figure 7. Note
the logarithmic scale of the y-axis.

**Appendix C: Clustering patterns correlate with modulatory structures in the drosophila connectome**

We study different motifs on the connectome of the larval
brain of the drosophila. We examine how various motifs

(fan-in, fan-out and middleman) change for different neu-
ron types.

We most prominently find that large fan-out values
clearly distinguish the modulatory neurons (especially
DAN and OAN) from the other neuronal classes (Ap-
pendix Figure 11A). As with the mouse connectome,
we find that both fully weighted methods (continuous
and Zhang- Horvath) identify the correlation between
the neuron types and the fan-out clustering fairly well.
Nevertheless, in this case, we see that one of the hybrid
methods (Onella) identifies the same pattern with the
fully weighted methods, while Barrat's method failed to
generate any pattern at all.

Furthermore, while the middleman and fan-in patterns
do not show any strong correlation with any neuronal
type, very high middleman and fan-in clustering values
are found in neurons targeting the MBIN-11, the only
modulatory input neuron that innervates two distinct
compartments. This reveals a strongly coupled structure
between multiple modulatory neurons that appears to be
more complex than the standard structure proposed in
the original study. These neurons include most of the
highest clustering nodes, with 7 of the top 10 fan-in and
middleman values.
<figure><img src="image_10.png" /><figcaption>FIG. 8. Fully-weighted fan-in clustering is the only graph measure that can consistently identify the cortical areas. This is shown by comparing the normalized values of cortical areas (x-axis) to the normalized values of non-cortical areas (y-axis). Normalization is done by dividing by the average value over all cortical and non-cortical areas. Degree- or strength-based measures do not discriminate the cortical areas (A); neither do standard binary centralities such as betweenness, closeness, and subgraph centrality (B), nor their weighted versions (C).</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>FIG. 9. Different methods of estimating the fan-in clustering enable discrimination of isocortical areas from the rest of the pathway areas for the mouse connectome. Hybrid methods (A. Barrat fails to discern any patterns and B. Onella does not allow reliable discrimination) perform much worse compared to fully weighted methods (C. Zhang and continuous Figure 6 D)</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>FIG. 10. Left: compared to a lattice with the same number of nodes, edges, and the same weights, the mouse and C. elegans connectomes have much lower average clustering coefficients. Right: similarly, they have a longer average path length than an equivalent random graph. Note the logarithmic scaling of the y-axis.</figcaption></figure>
<figure><img src="image_13.png" /><figcaption>FIG. 11. Directed and weighted clustering motifs identify both neuronal types and functional substructures in the drosophila larval mushroom body (MB). **A.** The fan-out clustering distributions are clearly correlated with neuronal types, with the modulatory neurons (especially DAN and OAN) displaying significantly higher clustering with both continuous and Zhang-Horvath (not shown) methods. Neuron types are DAN, dopaminergic, OAN, octopaminergic, MBIN, modulatory input, FB2N, two-step feedback, CHN, chordotonal, FBN, feedback, MBON, modulatory output, FFN, feed-forward, FAN, feed-across, PN, projection, PI, inhibitory projection). Colored types indicate neurons that are involved in the recurrent circuitry of the network and are the same across all panels. **B–C.** No similar correlations are visible for the middleman and fan-in motifs where the distributions are dominated by outliers. For middleman and fan-in motifs, neurons involved in the recurrent circuitry display clustering values that are slightly higher than those of the feed-forward and projection neurons. However the main visible feature is the presence of a few outliers with very high clustering values, which are mostly associated to neurons connected to the MBIN-11 neuron (red diamonds). **D.** Structural organization of the MB into compartments with a proposed connectivity for the recurrent circuitry from [50], involving modulatory (DAN, OAN, MBIN), MBON, FBN/FAN, and FB2N units. The MBIN-11 neuron is the only modulatory input neuron to innervate to distinct compartments. **E–F.** Force-Atlas representations of the network. For each plot, the node sizes represent the clustering values (from left to right: fan-out, middleman, fan-in). Coloured nodes in the two panels are neurons that are connected to MBIN-11 and belong to one of the classes involved in the recurrent circuitry. These neurons display most of the largest clustering values in the network.</figcaption></figure>