The hourglass organization of the Caenorhabditis elegans connectome

We approach the C. elegans connectome as an information processing network that receives input from about 90 sensory neurons, processes that information through a highly recurrent network of about 80 interneurons, and it produces a coordinated output from about 120 motor neurons that control the nematode’s muscles. We focus on the feedforward flow of information from sensory neurons to motor neurons, and apply a recently developed network analysis framework referred to as the “hourglass effect”. The analysis reveals that this feedforward flow traverses a small core (“hourglass waist”) that consists of 10-15 interneurons. These are mostly the same interneurons that were previously shown (using a different analytical approach) to constitute the “rich-club” of the C. elegans connectome. This result is robust to the methodology that separates the feedforward from the feedback flow of information. The set of core interneurons remains mostly the same when we consider only chemical synapses or the combination of chemical synapses and gap junctions. The hourglass organization of the connectome suggests that C. elegans has some similarities with encoder-decoder artificial neural networks in which the input is first compressed and integrated in a low-dimensional latent space that encodes the given data in a more efficient manner, followed by a decoding network through which intermediate-level sub-functions are combined in different ways to compute the correlated outputs of the network. The core neurons at the hourglass waist represent the information bottleneck of the system, balancing the representation accuracy and compactness (complexity) of the given sensory information. Author Summary The C. elegans nematode is the only species for which the complete wiring diagram (“connectome”) of its neural system has been mapped. The connectome provides architectural constraints that limit the scope of possible functions of a neural system. In this work, we identify one such architectural constraint: the C. elegans connectome includes a small set (10-15) of neurons that compress and integrate the information provided by the much larger set of sensory neurons. These intermediate-level neurons encode few sub-functions that are combined and re-used in different ways to activate the circuits of motor neurons, which drive all higher-level complex functions of the organism such as feeding or locomotion. We refer to this encoding-decoding structure as “hourglass architecture” and identify the core neurons at the “waist” of the hourglass. We also discuss the similarities between this property of the C. elegans connectome and artificial neural networks. The hourglass architecture opens a new way to think about, and experiment with, intermediate-level neurons between input and output neural circuits.


Introduction
Natural, technological and information-processing complex systems are often hierarchically modular [1,2,3,4]. A modular system consists of smaller sub-systems (modules) that, at least in principle, can function independently of whether or how they are connected to other modules: each module receives inputs from the environment or from other modules to perform a certain function [5,6,7]. Modular systems are often also hierarchical, meaning that simpler modules are embedded in, or reused by, modules of higher complexity [8,9,10,11]. It has been shown that both modularity and hierarchy can emerge naturally as long as there is an underlying cost for the connections between different system units [12,13].
In the technological world, modularity and hierarchy are often viewed as essential principles that provide benefits in terms of design effort (compared to "flat" or "monolithic" designs in which the entire system is a single module), development cost (design a module once, reuse it many times), and agility (upgrade, modify or replace modules without affecting the entire system) [14,15,16]. In the natural world, the benefits of modularity and hierarchy are often viewed in terms of evolvability (the ability to adapt and develop novel features can be accomplished with minor modifications in how existing modules are interconnected) [17,18,19] and robustness (the ability to maintain a certain function even when there are internal or external perturbations can be accomplished using existing modules in different ways) [20,21,22].
It has been observed across several disciplines that hierarchically modular systems are often structured in a way that resembles a bow-tie or hourglass (depending on whether that structure is viewed horizontally or vertically) [23,24]. This structure enables the system to generate many outputs from many inputs through a relatively small number of intermediate modules, referred to as the "knot" of the bow-tie or the "waist" of the hourglass. The "hourglass effect" has been observed in systems of embryogenesis [25,26], metabolism [27,28], immunology [29,30], signaling networks [31], vision and cognition [32,33], deep neural networks [34], computer networking [35], manufacturing [36], as well as in the context of general core-periphery complex networks [37,38].
The few intermediate modules in the hourglass waist are critical for the operation of the entire system, and so they are also more conserved during the evolution of the system compared to modules that are closer to inputs or outputs [39,40,35]. Note that the two terms, bow-tie and hourglass, have not been always interchangeable in the network science literature. In particular, the term bow-tie has been applied even to networks for which the knot includes a large fraction of the network's nodes [41,42].
In this paper, we apply the hourglass analysis framework of [23] on the C. elegans connectome [43]. The C. elegans connectome can be thought of as an information processing network that transforms stimuli received by the environment, through sensory neurons, into coordinated bodily activities (such as locomotion) controlled by motor neurons [43]. Between the sensory and motor neurons, there is a highly recurrent network of interneurons that gradually transforms the input information to output motor activity. An important challenge in applying the analysis framework of [23] on C. elegans is that the former assumes that the network from a given set of input nodes (sources) to a given set of output nodes (targets) is a Directed Acyclic Graph (DAG). On the contrary, the C. elegans connectome includes many nested feedback loops between all three types of neurons. For this reason, we extend the methods of [23] in networks that may include cycles as long as we are given a set of sources and a set of targets. The key idea is to identify the set of feedforward paths from each source towards targets, and to apply the hourglass analysis framework on the union of such paths, across all sources.
Our main result is that the C. elegans connectome exhibits the hourglass effect. This result is robust to the "routing methodology" that separates the feedforward from the feedback flow of information. Further, we observe the hourglass architecture when we consider just chemical synapses, or the combination of the latter with gap junctions. On the contrary, appropriately randomized networks do not exhibit the hourglass property. We also identify the neurons at the "waist" of the hourglass. Interestingly, they are mostly the same set of interneurons that were previously shown, using a different analytical methodology, to constitute the "rich-club" of the C. elegans connectome [44]. We explain that these two network architectures, hourglass and rich-club, are not equivalent -and in fact the hourglass property of the C. elegans connectome is maintained even if we rewire the connections between core neurons so that they do not form a rich-club.
The fact that the core interneurons also form a rich-club suggests that they form an information processing bottleneck that integrates the compressed information from different sensory modalities, before driving any higher-level neural circuits.
We explain the benefits of the hourglass architecture, in the context of neural information processing systems, using an encoder-decoder model that resembles recent architectures in artificial neural networks [34,45]. The encoding component compresses the redundant stimuli provided by the sensory neurons into a low-dimensional latent feature space (represented by the core neurons at the hourglass waist) that encodes the source information in a more efficient manner. Then, the decoding component of the network combines those latent features, which represent intermediatelevel sub-functions, in different ways to drive each output through the motor neurons. The toyexample of Figure 1 illustrates this idea using a Boolean circuit with five binary sources and five output functions.

Connectome
The dataset we analyze describes the neural network of the hermaphrodite C. elegans, as reported in [43]. This connectome is a directed network between 279 neurons (the 282 non-pharyngeal neurons excluding VC6 and CANL/R, which are missing connectivity data). Neurons can be connected with two types of connections: chemical synapses and gap junctions (or, electrical synapses). The former are typically slower but strongest connections, and they transfer information only in one direction. The latter can be thought of as bi-directional connections.
The synaptic network (i.e., the network formed by only chemical synapses) consists of 2194 neural connections, created by 6393 chemical synapses. The weight of a connection is defined as Figure 1: A hypothetical Boolean system with five sources and five targets. The sources are represented by orange nodes while the targets by blue nodes. Each target is a logic function of the sources. The sources are correlated, as shown by their logical expressions. A direct source-to-target computation would require 18 Boolean operations. Instead, we can compute the targets with only 9 operations if we first compute the two intermediate green nodes shown (3 operations) and then reuse those nodes to compute the targets (6 operations). This cost reduction is possible because there are correlations between the target functions. The two intermediate nodes, which represent the hourglass waist in this example, compress the information provided by the sources, computing sub-functions that are re-used at least twice in the targets. In this example the encoding part of the network is the set of connections between sources and intermediate nodes, while the decoding part is the set of connections between intermediate nodes and targets. In general, the encoder and decoder components can include additional nodes, creating a deeper hourglass architecture. the number of chemical synapses between the corresponding pair of neurons. The in-strength or out-strength of a neuron is defined as the sum of connection weights entering or leaving that neuron, respectively.
The complete network includes both chemical synapses and gap junctions. There are 514 pairs of neurons connected through gap junctions, creating the same number of bi-directional connections between those neurons. Unless mentioned otherwise, we analyze the synaptic network. In the Section "Including Gap Junctions: the Complete Network", we extend the analysis to consider the complete network, asking whether there are any major differences when we also consider gap junctions.
The C. elegans neurons can be classified as sensory (S), inter (I) and motor (M) neurons, based on their structure and function [46]. Sensory neurons transfer information from the external environment to the central nervous system (CNS). Motor neurons transfer information from the CNS to effector organs (e.g. glands or muscles). Interneurons process information within the CNS.
The C. elegans connectome has 88 sensory neurons, 87 interneurons and 119 motor neurons. Some of these neurons however have a dual role: ten behave as S and M, two as S and I, and three as M and I. In our analysis, we consider the S-M and S-I dual-role neurons as sensory, and the M-I neurons as motor. Consequently, the final network consists of 88 sensory neurons, 82 interneurons, and 109 motor neurons.
We can think of C. elegans as an information processing system in which the feedforward flow of information, from sensory to motor neurons, transfers sensory cues from the environment to the CNS, processes those signals to extract actionable information, which is then used to drive the behavior/motion of the organism. This feedforward flow however is regulated by multiple feedback loops that transfer information in the opposite direction, as well as lateral connections between neurons of the same type.
The connections that we refer to as feedforward (FF) are those from S to I, I to M, and S to M neurons. In the opposite direction (i.e., from I to S, M to I, and M to S neurons) the connections are referred to as feedback (FB). Connections between neurons of the same type (i.e., S to S, I to I, and M to M neurons) are referred to as lateral (LT). In the synaptic network, there are 901 FF connections, 998 LT connections, and 295 FB connections. Figure 2 shows the breakdown of these connection types in the synaptic and complete networks.
The FB connection weights are often lower than FF and LT weights (see Figure 1(a)). Also, when considering neuron pairs that are reciprocally connected with both FF and FB connections, it is more likely that the FF connection is strongest than the corresponding FB connection (see Figure 1(b)). These observations suggest that the distinction between FF and FB connections has  If we focus on the top-5% stronger connections, relative to all chemical synapses, this set is dominated by feedforward S-to-I and I-to-M connections, as well as by lateral connections between I neurons and M neurons (see Table S1). None of the top-5% connections is of the feedback type.
This observation suggests that feedback connections are weaker -one reason may be that they are involved mostly with the control of feedforward circuits, acting as modulators rather than drivers.

Feedforward Paths from Sensory to Motor Neurons
The "routing problem" in a communication network refers to the selection of an efficient path, or multiple paths, from each source node to each target. In neural networks, there is no established "routing algorithm" that can accurately describe or model how information propagates from a sensory neuron to a motor neuron. Whether a neuron will fire or not depends on how many of its pre-synaptic neurons fire, the timing of those events, the physical size and location of the synapses in the dendritic tree, and several other factors. There are some first principles, however, that we can rely on to identify plausible routing schemes [47,48]. These schemes should be viewed only as phenomenological models -we do not claim that neurons actually choose activation paths based on the following algorithms.
First, neurons cannot form routes based on information about the complete network or through coordination with all neurons (such as the routing algorithms used by the Internet or other technological systems). Instead, whether a neuron fires or not should be a function of only locally available information. So, we cannot expect that neural circuits use optimal routes that minimize the path length ("shortest path routing") or other path-level cost functions [49].
Second, evolution has most likely selected routing schemes that result in efficient (even though not necessarily optimal) neural communication. Consequently, we can reject routing schemes that exploit all possible paths between two neurons as many of those paths would be inefficient.
Third, for robustness and resilience reasons, it is likely that multiple paths are used to transfer information from each sensory neuron to a motor neuron -schemes that only select a single path would be too fragile.
Fourth, given the low firing reliability of neurons, it is unlikely that a sensory neuron can communicate effectively with a motor neuron through multiple intermediate neurons. There should be a limit on the length of any plausible neural path [50].
Putting the previous four principles together, we are led to the following hypothesis: a sensory neuron S communicates with a motor neuron T through multiple paths that may be suboptimal but not much longer than the shortest path length from S to T.
Given this broad hypothesis, we identify several plausible routing schemes -and then examine whether our results are robust to the selection of a specific routing scheme.
To help choose reasonable parameter values for the various routing schemes we consider, we first examine the length and number of shortest paths from each sensory neuron S to each motor neuron M. Figure 2(a) shows the distribution of the length of these paths, measured in "hops" (i.e., connections between neurons). Almost all shortest paths from S to M neurons are between 2-4 hops. So, if the shortest connection from a sensory to a motor neuron is say 3 hops, the second and fourth principles suggest that we may also consider slightly longer paths, say 4 or 5 hops long. Note that only 4% of (S,M) pairs are not connected by any path, about 32% of (S,M) pairs are connected through only one shortest path, while the rest are connected with multiple shortest paths.
The various routing schemes we consider in the rest of the paper are (see Figure 3): 1. "SP ": As a reference point, SP refers to the selection of only shortest paths from a sensory neuron s to a motor neuron t.  5. "SP +2 ": The paths in SP together with all paths that are one or two hops longer than the shortest path from s to t.
10. "P 4 ": All paths from s to t that are at most 4 hops long.
11. "P 5 ": All paths from s to t that are at most 5 hops long.
The last two routing schemes (P 4 and P 5 ) are not variations of shortest path but they are based on the notion of diffusion-based routing. In the latter, information propagates from a source towards a sink selecting among all possible connections either randomly (e.g., random-walk based models) [51] or based on a threshold function (e.g., a neuron fires if at least a certain function of its pre-synaptic neurons fire) [52].

Path Centrality Metric and τ -Core Selection
After utilizing one of the previous routing schemes to compute all paths from a sensory neuron to a motor neuron, we analyze these "source-target" paths based on the hourglass framework, developed in [23]. The objective of this analysis is to examine whether there is a small set of nodes through which almost all source-target paths go through. In other words, the hourglass analysis examines whether there is a small set of neurons that forms a bottleneck in the flow of information from sensory neurons towards motor neurons. The path centrality P (v) of a node v is defined as the number of source-target paths that traverse v. This metric has been also referred to as the stress of a node [53]. Figure 4 illustrates the path centrality of each node in a small network -just for this example, the paths have been computed based on the shortest path (SP) routing algorithm. Any other routing scheme could have been used instead.
The path centrality metric is more general than betweenness or closeness centrality that are only applicable to shortest paths. Katz centrality does not distinguish between terminal and intermediate nodes and it penalizes longer paths. Metrics such as degree, strength, PageRank or eigenvector centrality are heavily dependent on the local connectivity of nodes rather than on the paths that traverse each node.
Given a set of source-target paths, the next step of the analysis is to compute the τ -Core, i.e., the smallest subset of nodes that can collectively cover a fraction τ of the given set of paths. The fraction τ is referred to as the path coverage threshold and it is meant to ignore a small fraction of paths that may be incorrect or invalid. Computing the τ -Core is an NP-Complete problem [23], and so we solve it with the following greedy heuristic (see [23] for an approximation bound): • Initially, the core set is empty.
• In each iteration: 1. Compute the path centrality of all remaining nodes.
2. Include the node with maximum path centrality in the core set and remove all paths that traverse this node from the given set of paths.
• The algorithm terminates when we have covered at least a fraction τ of the given set of paths. Figure 4 illustrates the core of a small network based on the shortest path routing mechanism, for τ =90%.

Hourglass Score
Informally, the hourglass property of a network can be defined as having a small core, even when the path coverage threshold τ is close to one. To make the previous definition more precise, we can compare the core size C(τ ) of the given network G with the core size of a derived network that maintains the same set source-target dependencies of G but that is not an hourglass by construction.
To do so, we create a flat dependency network G f from G as follows: 1. G f has the same set of source and target nodes as G but it does not have any intermediate nodes.
2. For every ST-path from a source s to a target t in G, we add a direct connection from s to t in G f . If there are w connections from s to t in G f , they can be replaced with a single connection of weight w.
Note that G f preserves the source-target dependencies of G: each target in G f is constructed based on the same set of "source ingredients" as in G. Additionally, the number of ST-paths in the original dependency network is equal to the number of paths in the weighted flat network (a connection of weight w counts as w paths). However, the paths in G f are direct, without forming any intermediate modules that could be reused across different targets. So, by construction, the flat network G f cannot have the hourglass property.
Suppose that C f (τ ) represents the core size of the flat network G f . The core of G f can include a combination of sources and targets, and it cannot be larger than either the set of sources or targets. Additionally, the core of the flat network is larger or equal than the core of the original To quantify the extent at which G exhibits the hourglass effect, we define the Hourglass Score, or H-score, as follows: The H-score of G is approximately one if the core size of the original network is negligible compared to the the core size of the corresponding flat network. Figure 5 illustrates the definition of this metric.
An ideal hourglass-like network would have a single intermediate node that is traversed by every single ST-path (i.e., C(1)=1), and a large number of sources and targets none of which originates or terminates, respectively, a large fraction of ST-paths (i.e., a large value of C f (1)). The H-score of this network would be approximately equal to one.

Randomization Method
We examine the statistical significance of the observed hourglass score in a given network G using an ensemble of randomized networks {G r }. The latter are constructed so that they preserve some key properties of G: the number of nodes and connections, the in-degree of each node, and the partial ordering between nodes (explained next). The randomization reassigns connections between pairs of nodes and changes the out-degree of nodes, as described below.
Suppose we are given G and a set of paths P from sources to targets. If there is a path in which node v appears after node u and there is no path in which u appears after v, we say that u is an ancestor of v and write u ∈ A(v). For a pair of nodes (u, v), we can have one of the following cases: (1) u is an ancestor on v, (2) v is an ancestor of u, (3) both u and v depend on each other, and (4) u and v do not depend on each other. We aim to preserve the partial ordering of nodes, as follows: 1. if u is not an ancestor of v in G, then it cannot be that u becomes an ancestor of v in a randomized network, 2. the set of ancestors of v in a randomized network is a subset of the set of ancestors The construction of randomization networks proceeds as follows: for each node v in the original network, we first remove all incoming connections. We then randomly pick in-degree(v) distinct nodes from A(v) and add connections from them to v.
The randomization mechanism is illustrated in Figure 6. It should be mentioned that there are several other randomization methods, preserving different network features [54]. None of them however preserve the partial ordering between nodes, which is an essential feature of a network in which a set of input-output dependency paths captures how information flows from sources to targets.

Location Metric
We also associate a location with each node to capture its relative position in the feedforward network between sources and targets. One way to place intermediate nodes between sources and targets is to consider the number of paths P S (v) from sources (excluding v if it is a source itself) to v as a proxy for v's complexity and the number of paths P T (v) from v to targets (excluding v if it is a target itself) as a proxy for v's generality. Nodes with zero in-degree (which cover most sources) have the lowest complexity value (equal to 0), while nodes with zero out-degree (which cover most targets) have the lowest generality value (equal to 0). The following equation defines a location metric based on P S (v) and P T (v), L(v) varies between 0 (for zero in-degree sources) and 1 (for zero out-degree targets). If there is a small number of paths from sources to a node v (low complexity) but a large number of paths from v to targets (high complexity), v's role in the network is more similar to sources than targets, and so its location should be closer to 0 than 1. The opposite is true for nodes that have high complexity but low generality.

Encoder-Decoder Architecture
Returning to the illustration of Figure The question we focus on here is: how does an hourglass architecture decrease the cost of computing a set of targets T from a set of sources S, and how large is that decrease in the case of C. elegans?
Let C S (T ) be the cumulative cost for computing the set of targets T from the set of sources S: Given a set of intermediate nodes Z, we can produce the targets T in a two-step process: first, compute each node in Z from the sources S, and then compute each target in T from the set of intermediate nodes Z. There may be some source-to-target paths however that bypass the nodes in Z -we need to consider the cost of those "bypass-Z" paths as an extra term that depends on the selection of Z. So, the cost C S,Z (T ) of computing T from S given Z is: where the first summation term is the cost of computing Z from sources, the second is the cost of computing targets from Z, and the third is the cost of bypass-Z paths.
The encoding-decoding gain Φ Z , defined below, quantifies how significant is the cost reduction provided by such an encoder-decoder architecture, If n > 2 and m > 2, we have that n + m < n m, meaning that Φ Z is maximized (equal to On the other hand, if the network includes k + additional intermediate nodes that only connect to one source and one target, the maximum value of Φ Z results when the set Z includes only the k densely connected nodes and leaves the k + nodes in the bypass paths: Returning to the network of Figure 1, the direct cost C S (T ) is t∈T P S (t)=6+5+3+2+6=22.
The cost of constructing the nodes in Z from sources is z∈Z P S (z)= 4+2=6, the cost of constructing targets from Z nodes is t∈T P Z (t)=1+1+1+1+2=6, while the cost of bypass-Z paths is . So, the encoding-decoding gain is 22/16=1.375 while its maximum possible value is 25/10=2.5.

Hourglass Analysis of Feedforward Paths
We defined earlier eleven different routing methods for computing paths from sensory to motor neurons in C. elegans. Table 1 shows some relevant properties for each of these path sets. The number of all possible pairs of sensory-motor neurons is about 9,500. About 90%-95% of these  Table 1: Properties of the eleven paths sets from sensory to motor neurons computed using the eleven routing methods we consider. Given a set P of feedforward paths from sensory to motor neurons, we now apply the hourglass analysis framework (see Section "Hourglass Score"). In particular, the goal is to compute the smallest set of neurons that can cover a percentage τ of all paths in P. That set of neurons is referred to as τ -Core.  Table 2: The identified core neurons when the path coverage threshold is τ = 90% for each path set. For each core neuron, we show the fraction of paths that the corresponding neuron contributes to the core. The neurons are ranked in decreasing order in terms of their contribution to the core (considering the SP set of paths), grouping bilateral neurons together. The last column shows the 11 "rich-club" neurons, as identified in [44].  . For all path sets, the H-score is close to one (its theoretical maximum value) as long as τ < 90%. This suggests an hourglass-like architecture, independent of which routing scheme has produced the set of feedforward paths. Table 2 shows the sequence of core neurons (for τ = 90%) for each path set. The first 10-11 of those neurons appear in almost every path set. The remaining neurons appear in more constrained path sets (such as SP ) and they only cover a small fraction of additional paths (1%-3%).
If we focus on those first 10-11 core neurons, we observe that, first, they are included in the 90%-core of all path sets we consider (with few exceptions).
To simplify the presentation of the results, in the rest of this paper we will focus on the "SP +2 " path set. This path set results in the largest number of paths and a core of 10 neurons when τ =90%.
That set of core neurons includes bilateral pairs of interneurons (namely: AVA, AVB, PVC, AVE, and AVD) -the DVA stretch sensitive core neuron does not appear bilaterally. Seven of (a) Hourglass but not rich-club (b) Rich-club but not hourglass Figure 8: (a) A toy network in which two nodes (m and o) cover more than 90% of all source-target paths (H-score=0.67). This network does not contain a rich-club. (b) A toy network that is not an hourglass (H-score=0) but it has a rich-club (nodes p, q, r, s -the rich-club coefficient is 2.60 [56]).
the core neurons are located in the head region (AVAR/L, AVBR/L, AVER/L, AVDR) and three are in the tail region (PVCR/L, DVA). The original ten core neurons contain nine command interneurons that play a pivotal role in forward and backward locomotion [44]. The other noncommand interneuron of the core, DVA, is a proprioceptive interneuron modulating the locomotion circuit [44].
If we want to extend the set of core neurons slightly by covering τ =95% of all paths instead of 90%, we need to add four more neurons into the core (HSNR, AVDL, RIAL, RIMR).

Comparison with Rich-Club Effect
The existence of a set of densely interconnected nodes in the C. elegans connectome, termed as "rich-club", has been previously established by Towlson et al. [44]. A rich-club is a subgraph of high-degree nodes that are much more densely interconnected with each other than what would be expected based only on their degrees [55]. In other words, the rich-club concept is based on the analysis of local connectivity in a network -rather than the analysis of (shortest or other) network paths. Further, the rich-club analysis does not consider whether some nodes act as inputs (sensory neurons) or outputs (motor neurons) in the network. The hourglass analysis, on the other hand, analyzes the set of feedforward paths from inputs to outputs. So, these two methods are significantly different.
Are these two network properties, rich-club and hourglass effect, equivalent? We can see that this is not the case through simple counter-examples (see Figure 8(a)).
An important observation, however, is that the core neurons that we identify through the hourglass analysis highly overlap with the rich-club neurons of [44]. The first ten core neurons identified by all routing methods we consider also appear in the eleven rich-club neurons reported Figure 9: Distribution of H-score for randomized networks in which we preserve the in-degree of each neuron and the hierarchical ordering between neurons. The probability of observing the H-score value of the original network in randomized networks is less than 10 −3 .
in [44]. The AVDL interneuron is the 11th rich-club member but it appears in the hourglass core only in half of the routing methods we consider (for τ =90%). The fact that two very different methods highlight almost the same set of interneurons as the most important in the system adds confidence in the results of both studies.
The fact that a small set of interneurons act as both the hourglass core and rich-club, even though these two network properties are qualitatively different, raises an interesting hypothesis about the functional role of these interneurons: In the hourglass network of Figure 8(a), the core nodes m, n, o are not connected with each other -such an architecture can compress different input information streams but without integrating them. On the contrary, the core interneurons of C. elegans are densely interconnected and so they form an information processing bottleneck that integrates the compressed information from different sensory modalities, before driving any higher-level neural circuits.

Comparison with Randomized Networks
Is the hourglass effect a genuine property of the C. elegans connectome or would it also be present in similar but randomly connected networks? We generate 1000 random networks using the algorithm described in Section "Randomization Method". The randomization process preserves the in-degree of each neuron and the hierarchical ordering between neurons (i.e., if neuron v depends on neuron u but u does not depend on v in the original connectome, it cannot be that u depends on v in a randomized network). Figure 9 shows the H-score distribution of the randomized networks.
The H-score of the random networks is significantly less than the corresponding original network  Figure 10: H-score distribution of randomized networks in which every connection X-Y between two core neurons X and Y is rewired. In (a), Y is replaced with a randomly chosen interneuron Z that is not in the core. In (b), Y is replaced with a randomly chosen neuron Z (including sensory and motor neurons) that is not in the core. The red dot shows the H-score of the original connectome.
(p < 10 −3 ), suggesting that the hourglass effect we observe in the C. elegans connectome is not a statistical artifact.
Is the hourglass effect a consequence of the dense connectivity between core neurons? The latter is the defining characteristic of rich-club neurons. Would we still observe the hourglass effect if the core neurons were not so densely interconnected with each other, forming a rich-club?
To answer this question, we perform a second randomization experiment in which every connection between two core neurons X and Y is rewired so that X connects instead to a randomly chosen neuron Z that is not in the set of core neurons. We experimented with two variations of this method: one in which Z is an interneuron and another in which Z can be any neuron, including sensory and motor neurons.
Both approaches fail to destroy the hourglass property. As shown in Figure 10, the H-score distribution of the randomized networks (100 instances) includes the H-score of the original network (0.87). This means that the hourglass property is not due to the dense connectivity between core neurons. When we remove the connections between core neurons, we reduce the number of core nodes that a typical sensory-to-motor path traverses -but it is still the case that almost all such paths traverse at least one core node, and this is what creates the hourglass property.

Hourglass Organization based on Location Metric
The location metric associates each neuron v with a value between 0 and 1, depending on the number of paths from sensory neurons to v and from v to motor neurons.

C. elegans as an Encoder-Decoder Architecture
We can think of C. elegans as an information processing system that transforms input information, collected and encoded by sensory neurons, to output information that is represented by the activity of motor neurons. The analysis of the previous sections has identified a number of core neurons that most of the sensory-to-motor neural pathways go through. The exact number of core neurons depends on the fraction τ of all sensory-to-motor paths covered by the core.
Suppose that a given set of core neurons forms the intermediate set Z, defined in Section "Encoder-Decoder Architecture". We can then compute the number of paths P S (Z) from the set S of all sensory neurons to the neurons in Z as a proxy for the information processing cost of an encoding operation that transforms S to Z. Similarly, the number of paths P S (Z) from the neurons in Z to the set T of all motor neurons can be thought of as a proxy for the information Figure 12: The encoder-decoder gain ratio Φ Z as the number of core neurons in the encoding set Z increases (yellow curve). The maximum value of Φ Z is about 8.2 when Z includes the first 16 core neurons. Based on the cost framework of Section "Encoder-Decoder Architecture", this means that the hourglass organization of the C. elegans connectome reduces the sensory-to-motor information processing cost eight-fold. The figure also shows the three relevant cost terms: cost of encoding the information provided by sensory neuron using neurons in Z (magenta), cost of decoding that information to drive all motor neurons (green), and cost of processing pathways that bypass the core (blue).
processing cost of a decoding operation that transforms Z to T . We also need to consider any sensory-to-motor paths P S,b (T ) that bypass the core neurons in Z -this is a proxy for the cost of any additional information processing that is specific to each motor neuron and that is not provided by the encoding-decoding function of Z.
These three cost terms are shown in Figure 12 as we increase the number of core neurons included in Z (i.e., as we increase the threshold τ ). The bypass-Z cost is the dominant cost term until we include about 15 neurons in Z. This suggests that the information provided by sensory neurons cannot be captured well with fewer neurons. On the other hand, the costs of the encoding and decoding operations (P S (Z) and P S (Z), respectively) increase with the number of neurons in Z, as expected.
The encoder-decoder gain ratio Φ Z (see Equation 6) shows that the maximum cost reduction takes place when we consider the first 16 core neurons (corresponds to τ =95% for the SP +2 set of paths). In that case, the encoder-decoder architecture achieves an eight-fold decrease (Φ Z =8.2) in terms of information processing cost relative to a hypothetical architecture in which the information processing cost of each motor neuron is computed separately, based on the number of paths from sensory neurons to that motor neuron.
An important question is whether the hourglass architecture achieves this cost reduction by increasing the path length between sensory and motor neurons (in terms of the number of neurons in each path). This trade-off between network efficiency (associated with the distribution of path lengths in a network) and network cost has received significant attention in network neuroscience [48,57,49]. Networks that minimize the length of every processing path connect every source to every target with a direct link -a costly design approach. On the other hand, networks that attempt to reduce the number of intermediate links typically need longer source-to-target paths (for the same reason that flying between two cities often requires one or more intermediate stops).
Here, we examine whether the hourglass architecture introduces a significant increase in the average path length from sensory to motor neurons relative to the ensemble of randomized networks.
Recall that those networks do not follow the hourglass architecture (see Figure 9) but they maintain the in-degree of each neuron and the hierarchical ordering between neurons. Given that each neuron selects randomly its inputs from any neuron that is "lower" in the hierarchy (closer to the sensory neurons), we expect that such randomized non-hourglass networks will be more efficient (i.e., they will have shorter paths). In the extreme case that every motor neuron receives connections only from sensory neurons, the average path length will be minimized.    Table 3: The identified 12 core neurons in the complete network. The 10 neurons shown in italic were also the core of the synaptic network. Figure 14(a) shows the cumulative path coverage as a function of the number of nodes in the core. Figure 14(b) examines the effect of the path coverage threshold τ on the resulting H-score.
Both curves are quite similar to the corresponding results for the synaptic network.
With τ =90%, the resulting core nodes are shown in Table 3. The H-score for the complete network is 0.83 (compared to 0.87 for the synaptic network).
The two additional core neurons that appear in the hourglass waist of the complete network but not in the synaptic network are: • AIBR: related to locomotion, food and odor evoked behaviors, local search, lifespan and starvation response.
The encoder-decoder gain analysis for the complete network appears in Figure S4. Qualitatively the encoder-decoder gain ratio follows the same trend with the network of only chemical synapses (see Figure 12) but the maximum value of Φ Z is slightly less (7.4 instead of 8.2).

Discussion
In this Section, we discuss in more detail prior studies that relate to the hourglass effect in C.
elegans or more broadly in neuroscience. Varshney et al. [43] analyzed the structural properties of the C. elegans connectome and found that several central neurons (based on closeness centrality) play a key role in information processing. Among them are command inter-neurons such as AVA, AVB, AVE that are responsible for locomotion control. On the other hand, neurons such as DVA or ADE have high out-closeness centrality and a good position to propagate a signal to the rest of the network. Most of the "central" neurons in that study are also included in the hourglass core.
The modular organization of the C. elegans connectome has been discovered by Sohn et al. [58] through cluster analysis. Their analysis showed that communities correspond well to known functional circuits and it helped uncover the role of a few previously unknown neurons. They also identified a hierarchical organization among five key clusters that form a backbone for higher-order complex behaviors.
The fact that the rich-club interneurons are almost identical with the hourglass core, even though these two network properties are qualitatively different, suggests that these 10-15 neurons form a information processing bottleneck that does not simply compress but also integrates the information from different sensory modalities, before driving any higher-level neural circuits.
This hypothesis is also supported by the analysis of functional modules in the C. elegans connectome, by Pan et al. [59], which showed that neurons in the same module are located close and contribute in the same task. That study identified 23 connector hub neurons, i.e., highconnectivity neurons that connect to most or all functional modules. The eleven core neurons that we identified with the SP +2 paths also belong in that set of connector hubs. The fact that all hourglass core neurons are also connector hubs between functional modules supports the idea that these neurons integrate multimodal information, rather than simply compress the sensory information in a segregated manner. Note that the distinction between connector hubs, non-hub connectors, etc, depends on certain thresholds and so it is not surprising that some connector hubs such as AVKL or SMBVL do not appear in the hourglass core. The posterior nervous system of the male C. elegans connectome was analyzed by Jarrell et al. [60] (recall that we analyze the hermaphrodite C. elegans connectome). One of their conclusions was that the nervous system has a mostly feedforward architecture that runs from sensory to motor neurons via interneurons. There is also some feedback circuitry in the nervous system and the actual physical output of the worm (i.e. motion etc.) feeds back to sensory neurons to allow closed-loop control. There are however many more feedforward loops (termed lateral connections in our analysis) that provide localized coordination most notably visible within interneurons. More recently, the same research group has mapped the complete connectome of the male nematode, focusing on its differences with the hermaphrodite [61].
Yan et al. have applied a controllability framework to analyze the C. elegans connectome, aiming to identify essential neurons for locomotion [62]. Some of those neurons also appear in the hourglass core (AVAL/R, AVBL/R, AVDL/R, PVCL/R) -but there are also several neurons (such as the six neurons of the DD class) that do not stand out in the hourglass analysis. This is not surprising given that the two studies ask very different questions: Yan et al. ask which neurons are essential to control every motor neuron or muscle, while we ask which neurons form a bottleneck in the feedforward flow of information from sensory to motor neurons.
The physical placement of neurons in C. elegans has been thought to be not exclusively optimized for global minimum wiring but rather for a variety of other factors of which the minimization of pair-wise processing steps is important. For example, Kaiser and Hilgetag [49] showed that the total wiring length can be reduced by 48% by optimally placing the neurons. However that would significantly increase the number of processing nodes along shortest paths between components as well. Similar findings were also revealed by Chen et al. [57], concluding that the placement of neurons does not globally minimize wiring length. These studies emphasize the notion of choosing shorter communication paths between neuron pairs and supports our approach of choosing paths that are shortest, or close to shortest, in terms of processing steps.
Analysis by Csoma et al. [63] challenged the well rooted notion of shortest path based communication routing in the human brain network. They collected empirical data through diffusion MRI and concluded that although a large number of paths conform to the shortest path assumption, a significant fraction (20-40%) are inflated up to 4-5 hops.
Research by Avena-Koenigsberger et al. [47,64] analyzed in depth the communication strategies in the human brain and also challenged the shortest path assumption. They discussed how the computation of shortest path routing is not feasible in the brain circuitry, and the shortest path routes would leave out around 80% of neural connections. They examined the spectrum of routing strategies hinging upon the amount of global information and communication required. At one end of the spectrum, there are random-walk routing mechanisms that are wasteful and often fail to achieve efficient routes but require no knowledge. On the other end there is shortest-path routing requiring global wiring knowledge at each neuron. As a more realistic choice, they studied the kshortest path based approach (with k being 100). Their findings show that this strategy increases the utilization of connections. We have used a more relaxed constraint to choose paths between any two nodes by allowing all possible paths that are up to 2 hops longer than the shortest path between the corresponding pair. Markov et al. have shown that the macaque cortical network includes a highly interconnected "bow-tie core" [42]. At first, this may seem relevant to the hourglass effect. We should note however that the network of Markov et al. considers 29 cortical regions and 17 of them are in the bow-tie core. On the contrary, a defining characteristic of the hourglass effect is that the number of core nodes at the waist is a small fraction of the total network size.
In some earlier studies, the hourglass effect is defined for layered networks, based on on the number of nodes at each layer. A network is referred to as an hourglass if the width of the intermediate layers is much smaller relative to the width of the input and output layers [24,35,65].
In this work, we generalize the definition of the hourglass effect to include networks that do not have clearly defined layers and that include feedback or lateral connections.
What is the biological significance of the hourglass architecture in the C. elegans connectome?
Is it just an interesting graph-theoretic property or does this architecture provide an adaptive advantage that could be selected by evolution?
First, it is important to set appropriate expectations for any study that analyzes the connectome attempting to learn something valuable about the underlying biology. It has been argued by several authors, including C. Bargmann and E. Marder [66], that mechanisms such as neuromodulators, parallel and antagonistic pathways and circuits, and complex neuronal dynamics can completely change the function of a given neural circuit. We believe that a connectome should be viewed as an architectural constraint that limits the scope of possible functions that a neural circuit can perform -rather than as the unique determinant of those functions.
The earlier C. elegans literature has attributed specific functions to the "command interneurons" or it has associated those interneurons with one or more functional circuits (for instance, see [67,68]). The main contribution of our study is to propose a different way to think about the role of those interneurons in the C. elegans connectome: the interneurons between sensory and motor neurons can be thought of as forming an encoder-decoder network. This network reduces the intrinsic dimensionality of the low-level sensory information, and then integrates the compressed information from different sensory modalities to compute few intermediate-level sub-functions.
The latter are then combined and re-used in higher-level behavioral circuits and tasks. Those few sub-functions are encoded in the activity of 10-15 core interneurons in the hourglass waist.
So, instead of trying to identify the function of each neuron in the connectome, or instead of focusing on individual functional circuits ignoring all others behaviors and circuits, we can focus on that smaller set of 10-15 core interneurons and attempt, through a combination of experiments and modeling, to reverse engineer the sub-functions they "compute." These sub-functions will probably be much simpler than the observable behaviors of the organism (e.g., escape response or social feeding) -they can be viewed as re-usable functional modules. Then, for each of the observable behaviors of the organism, we can try to find out how that task is accomplished by combining in different ways those functional modules. We firmly believe that such a research agenda will be more tractable because it depends on a smaller number of components (10-15) that need to be "reverse engineered", compared to the number of all neurons in C. elegans.
The core neurons at the hourglass waist create a "bottleneck" in the flow of information from sensory to motor neurons. Such bottleneck effects have been studied in the literature under different names. The most relevant such framework is the information bottleneck method developed based on information theory results: given a joint probability distribution between an input vector X and an output vector Y , the goal of that method is to compute an optimal intermediate-level representation T that is both compact (i.e., a highly compressed version of X) and able to predict Y accurately [69,70]. It appears that the C. elegans connectome has evolved to "compute" such a      [71] Touch sensitivity [72] Mechanosensation [73] -avoidance, foraging, -light-harsh touch, tap [74] Locomotion [75] Repulsive motion [76] Social feeding [77] Navigation [67] Muscle contraction, Locomotion modulation [78] Escape response [79] Proprioception [80,81] Table S2: Functional circuits associated with core neurons based on the C. elegans literature. The core neurons appear in several circuits, mostly related to spontaneous or planned movement. Many of the adaptive behaviors of the organism such as feeding, egg-laying, escape and navigation require a common set of underlying simpler tasks. Some of the circuits shown (e.g. thermotaxis, chemosensation, olfactory behavior) perform tasks that start with activity in some sensory neurons, followed by a locomotory response that is modulated by certain core interneurons. Figure S4: The encoder-decoder gain ratio Φ Z for the combined network containing both chemical synapses and gap junctions (contrast with Figure 12). The maximum value of Φ Z is 7.4 when Z includes the first 20 core neurons. Recall that the maximum value of Φ Z in the network of chemical synapses is 8.2. .