Spatial structure and information transfer in visual networks

In human and animal groups, social interactions often rely on the transmission of information via visual observation of the behavior of others. These visual interactions are governed by the laws of physics and sensory limits. Individuals appear smaller when far away and thus become harder to detect visually, while close by neighbors tend to occlude large areas of the visual field and block out interactions with individuals behind them. Here, we systematically study the effect of a group's spatial structure, its density as well as polarization and aspect ratio of the physical bodies, on the properties of the visual interaction network. In such a network individuals are connected if they can see each other as opposed to other interaction models such as metric or topological networks that omit these limitations due to the individual's physical bodies. We study the effect that spatial configuration has on the static properties of these networks as well as its influence on the transmission of information or behaviors which we investigate via two generic models of social contagion. We expect our work to have implications for the study of animal groups, where it could inform the study of functional benefits of different macroscopic states. It may also be applicable to the construction of robotic swarms communicating via vision or for understanding the spread of panics in human crowds.

In human and animal groups, social interactions often rely on the transmission of information via visual observation of the behavior of others. These visual interactions are governed by the laws of physics and sensory limits. Individuals appear smaller when far away and thus become harder to detect visually, while close by neighbors tend to occlude large areas of the visual field and block out interactions with individuals behind them. Here, we systematically study the effect of a group's spatial structure, its density as well as polarization and aspect ratio of the physical bodies, on the properties of the visual interaction network. In such a network individuals are connected if they can see each other as opposed to other interaction models such as metric or topological networks that omit these limitations due to the individual's physical bodies. We study the effect that spatial configuration has on the static properties of these networks as well as its influence on the transmission of information or behaviors which we investigate via two generic models of social contagion. We expect our work to have implications for the study of animal groups, where it could inform the study of functional benefits of different macroscopic states. It may also be applicable to the construction of robotic swarms communicating via vision or for understanding the spread of panics in human crowds.

I. INTRODUCTION
The emergent collective behavior of animal groups, or more generally multi-agent systems, is decisively shaped by the structural properties of the underlying networks of social interactions [1][2][3]. These networks may strongly differ in in their spatio-temporal embedding depending on the type of interaction or the behavior of interest. For example in humans, online social networks have no, or only very weak, relation to physical space and interactions typically do not depend on instantaneous communication [4,5]. On the other hand, contact networks governing the (direct) spread of pathogens between individuals [6,7] or interaction networks governing the collective movement of human crowds [8][9][10], represent examples of spatial networks with a tight correlation between physical distance of individuals and the probability (or strength) of corresponding interaction links. In non-human animals a similar variety of networks can be observed ranging from mating and hierarchy networks [11] to strongly spatio-temporally constrained interaction networks underlying the collective movement of fish schools [2,12], bird flocks [1,13] or insect swarms and colonies [14,15]. Especially in large animal collectives many inter-individual interactions forming the basis for coordinated collective movements [16], collective decision making [17], or spread of information [12] are directly governed by spatial proximity.
Typically, spatially embedded interaction networks between biological agents are modelled either via metric network models [17], where the probability of a link (or * winnie.poel@gmail.com † pawel.romanczuk@hu-berlin.de its strength) depends only on the inter-individual distance, or by topological models [3] where a focal agent is connected to a set of spatial neighbors with a high closeness rank but where the actual link probability (or strength) does not dependent on the actual physical distance as e.g. in the k-nearest neighbor network model [1,3]. In the past, most agent-based models assumed metric interaction networks, but after evidence for topological interaction in starling flocks has been presented by [1], corresponding topological interaction networks have received increased attention in the context of collective animal behavior.
However, the discussion of these two idealized models of interaction networks largely ignores the constraints set by different sensory and cognitive mechanisms underlying social interactions [see e.g . 18]. Vision mediated interactions play an important role for a wide range of social phenomena [2,8,19,20]. In particular, visual interaction networks accounting for visual occlusions have been shown to outperform both metric and topological interaction networks in describing collective behavior of fish [2]. Acoustic communication, on the other hand, which shapes social behavior of many animals [21,22], is not affected by the same constraints as vision (e.g occlusion at high densities) but depends mainly on sensory limits and properties of the medium. Here, metric interaction networks may provide a simple model for acoustic social interactions. Finally, topological interaction networks with a limited number of nearest neighbors have been recently discussed in the context of cognitive constraints regarding the number of neighbors (or objects) a focal individual can pay attention to [3].
Although the importance of visual interactions has been highlighted in recent research [2,12], there is a lack of systematic investigations of the structure of vi-sual networks, in particular with respect to their ability to transmit information and behavior. Here, we address this gap by comparing visual networks with the established metric and topological models which, as discussed above, may represent different sensory and/or cognitive constraints.
Comparing different types of networks quantitatively is challenging and even more so when networks represent social interactions based on different sensory limits which will be unique for a given biological agent and environment and can not generally be related to each other (i.e. some species may be able to hear further than they can see while for others the opposite may be true). While a common approach is to quantitatively compare networks of similar average degree (i.e. average number of interaction partners per individual) this may not yield the most relevant insights into biological systems where sensory limits may be fixed and tuning them to achieve a certain number of interactions may not be possible. It is known though that animal groups can quickly modify their spatial density of individuals in response to changes in the environment, e.g. related to predation risk [19,23] which in turn influences network structure. Thus besides the common approach of quantitatively comparing networks of similar degree, we also especially focus on a qualitative comparison of the networks' dependence on the spatial density of individuals.
First, we study structural differences between the three network types using static network measures that have been used to classify and compare different types of networks [24,25]. We then move beyond pure structural network analysis and compare the dynamics of a simple and a complex contagion process on visual and metric networks. While simple contagion may be viewed as a minimal model for information diffusion in animal interaction networks, complex contagion describes the spread of behaviors or emotions where simultaneous, non-linear reinforcement by multiple neighbors is at play.
Our work demonstrate the fundamental difference of visual networks in terms of structural parameters in comparison to metric and topological interaction networks. In particular, visual networks exhibit qualitatively different behavior in response to density modulation. Second, we demonstrate that these structural differences result in characteristic deviations in the dynamics of the two contagion processes on visual and metric networks.

II. METHODS
In order to investigate and compare the influence of spatial structure on properties of and dynamics on visual networks we will construct visual, metric and topological networks in two dimensional space. Here, we first discuss how we generate and characterize the spatial distribution of individuals, i.e. the network nodes. We then move on to explain the construction of the different spatiallyembedded networks and the network measures we will use to characterize them, before introducing the two contagion models that we use to investigate the transfer of information or behaviors on these networks.

A. Network construction: Spatial distribution and shape of nodes
We initially place N = n 2 nodes on an n by n two dimensional square grid with distance g between nearest neighbors. This setup creates a homogeneous density controlled via the parameter g. To yield more realistic distributions we add positional noise, η x , η y ∼ U(−η pos , η pos ), drawn from the uniform random distribution between ±η pos which we also scale by a factor g. Thus, node positions are given by where n x , n y ∈ (0, 1, . . . , n − 1) with i = nn x + n y . Here, we only consider values of η pos up to 0.5 to ensure that the density stays relatively homogeneous which allows us to systematically study its effect on the networks by varying g. Note that in the limit of large noise η pos , the random placement of agents will correspond to the simple two-dimensional spatial Poisson process. Throughout this work we mainly characterize spatial distribution of nodes by density and polarization. We estimate spatial density, ρ, via the average third nearest neighbor distance,r 3nnd , a measure which describes the average radius of a disk containing four individuals (the focal individual and its three nearest neighbors, for a sketch see appendix). An estimate of the local density which is relatively robust with respect to positional noise is thus given by Inspired by the elongated body shape of fish, single agents are represented by identical ellipses of length 1 and width w with orientations φ i that are drawn from a von Mises distribution where µ = 0 is the average, I 0 (κ) is the modified Bessel function of order 0 and κ a parameter that defines the width of the distribution (here we use κ = 0.1, 1.7, 31.6). Note that because ellipses are of length one, all units can be understood as measured in body length (BL). We characterize the group's polarization (degree of orientational order) by the absolute value of the normalized sum of all orientation unit vectors φ i = (cos(φ i ), sin(φ i )) To eliminate overlap of the ellipses (to keep the group strictly two dimensional) we use simulations of ellipse shaped particles based on the code provided by [26]. These particles repel each other with a force proportional to their overlap area and we let them settle into a nonoverlapping configuration (see appendix). Thus there is a upper limit to density given by the physical bodies of the nodes. An example of a spatial configuration generated using g = 1.4, η pos = 0.5, N = 36, κ = 0.9, w = 0.3 is shown in Figure 1B.

B. Network construction: Edges
The three network types considered in this work are distinguished exclusively via the rules for the construction of links based on spatial positions of the ellipse shaped bodies, i.e. the network nodes. We limit ourselves to binary networks with the adjacency matrix given by The decision rule determining if a link from i to j exists depends on the type of network and is explained in the following paragraphs. An illustration of the connection rules can be seen in Figure 1A. Figure 1 provides an example of each network type for N = 36, where the same positions and orientations of ellipses are underlying each network and respective thresholds are chosen such that the total number of links is identical between networks.

Visual networks
In a visual network a link from node i to node j exists if i is visible to j. For simplicity, we assume each ellipse has 360 • vision from a single eye located at the center of the ellipse. We determine the angle, α ij of an ellipse i in the visual field of j through a combination of analytical calculation of the (unobstructed) visual angle, α max ij ≥ α ij , with a numerical casting of rays at angles specified by the analytics to determine occlusions (for details refer to the appendix and [27]). We will further refer to this visual angle as the angular area of ellipse i for the focal individual j. Figure 1A illustrates the visual field of a central ellipse as shaded areas. To account for sensory and/or cognitive limitations an individual i must haven an angular area above a certain threshold, θ visual , in order to be visible to j. This threshold parameterizes our visual network model In Figure 1A angular areas larger than the visual threshold, θ visual = 0.29, are indicated by dark grey areas while those smaller than the visual threshold are shaded light grey. Correspondingly, it can be seen that the central individual only has incoming links from those individuals with α ij ≥ θ visual . Because visibility is not necessarily reciprocal, visual networks are generally directed.

Metric networks
In a metric network two nodes are connected if their Euclidian distance, r ij = | r i − r j |, is smaller than the metric threshold, θ metric [28] A metric This rule is illustrated in Figure 1A, where a focal individual (white) has incoming links from all individuals within a radius of θ metric (marked by a shaded circle). Because r ij = r ji metric networks are undirected. Note that, when not considering occlusion, visual networks can also be understood as having a metric interaction range because the visual threshold sets an upper limit for the interaction distance. The exact distance at which the angular area of an ellipse drops below the visual threshold, will of course depend on its orientation and width (see appendix). When needing to construct the visual threshold resulting in an equivalent effective cutoff distance for visual networks as in a certain metric network, we therefore averaged over all possible relative orientations for a specific value of w (see appendix).

Topological networks
In a topological network node i has incoming links from its θ topo nearest neighbors, chosen successively by increasing Euclidian distance. If we assign each individual j a closeness rank, k ij , with respect to individual i as k ij = {m|r im < r ij } + 1 where || denotes the set's cardinality (number of elements in the set) we can write the construction rule as The connection rule is illustrated in Figure 1A, where individuals close to a focal individual (white) are labeled according to their closeness rank and the focal individual has incoming links from those with a closeness-rank up to θ topo = 2. Because closeness rank is not necessarily reciprocal, topological networks are generally directed as can been seen in the example in Figure 1B.

C. Network measures
To assess and compare the structural properties of the different networks we use three well-established measures, the average in-degree, the average clustering coefficient and average shortest path length. These measures have been used widely to classify and compare different types of networks (see e.g [24,28]). We calculate the latter two quantities using the methods implemented in Python's networkx library [29].

In-degree and Out-degree
The in-degree d in i of a node i is defined as the number of its incoming links, The average in-degree is given byd in = 1 The out-degree is analogously defined as .

Clustering coefficient
In an undirected, unweighted network the clustering coefficient of node i describes the probability that two neighbors, j and k of node i are also linked among each other. This is calculated by dividing the number t i of all triangles formed by i by the number T i of all possible triangles that could be formed by i. Here, we use the following simple extension of this measure to directed graphs from [30] (11) The average clustering coefficient of a network is then given by 1

Average shortest path length
The average shortest path length describes the average minimum number of steps on the network needed to get from a node i to a node j. It is defined as where d(i, j) is the length of the shortest path between nodes i and j. We use networkx's implemented algorithm average shortest path length to determine the value for a where possible (networks need to be weakly connected).

Relative link length
While the shortest path measures the topological distance between nodes in spatial networks the link length, l ij = r ij if A ij = 1, measures the Euclidean distance between two connected agents. In order to make link length comparable across densities, we measure link length in units of the longest possible link, l max , in the group. For the grid configuration used in this paper this relative link length is given by

D. Contagion models
We investigate two models, one of simple and one of complex contagion, to demonstrate the differential impact of the network topology on these processes. In simple contagion, the probability of an infection in a time interval ∆t can be decomposed into the superposition of independent pair-wise interactions between a non-infected (susceptible) individual and its infected (network) neighbors. In complex contagion such a decomposition is not possible as the infection probability is a non-linear function of the number or fraction of infected neighbors. We emphasize that 'infection' does not refer here to disease spread, but to spreading of information or behavior. Thus, throughout this work, becoming infected refers to an individual becoming informed or activated [see e.g. 19]. Both types of contagion models are studied via discrete time approximation of the continuous time stochastic infection and recovery processes using a (small) numerical time step ∆t = 0.05. In what follows we describe the respective processes.

Simple contagion model
Each agent within the network can be in one of three states: susceptible S, infected I or recovered R. A susceptible agent in contact with a single infected neighbor can become infected with a constant probability rate β. Thus, the infection probability for such a pair-wise contact during a short time interval ∆t is p ∆t = β∆t. The total infection probability of a susceptible individual connected to n inf neighbors during the small time interval ∆t for such a simple contagion can be calculated to: Infected individuals transition to the recovered state with a finite, constant recovery rate γ. Thus, the average infection duration is τ inf = γ −1 . For simplicity, we assume that the recovered state is an absorbing state, i.e. once recovered an agent does not change its state anymore. Starting from an initial state of mostly susceptible agents and a small number of infected the epidemic spread will terminate once there are no more infected agents in the network.

Complex contagion model
The complex contagion model is analogous to the simple contagion model described above, with exception of the infection probability. Here, we assume a complex contagion process with an overall infection rate of a susceptible individual β cc given by a sigmoidal function S(r inf ) of the fraction of its infected network neighbors For σ = 0, the infection rate becomes independent on r inf with β c = β max /2. The overall probability of an susceptible agent to get infected in a short time interval ∆t is thus simply: As the infection probability depends on the fraction of infected individuals and not on the absolute number of infected neighbors, this model describes a fractional, complex contagion process.

III. RESULTS
In a first step we study how different network properties such as average in-degree, clustering coefficient, shortest path length and the distribution of link length depend on network density. In the case of visual networks we find that all these measures exhibit an interesting non-monotonic relationship with density. The choice of density as an independent parameter is reasonable when studying social behavior because while animals might not be able to change individual perceptual thresholds they can usually adapt their distance to neighboring individuals. For example fish schools have been shown to move closer together under the threat of predation [19].
Given that the average in-degree is modified by network density and the in-degree in turn affects both the clustering coefficient and the average shortest path length we then explicitly investigate the relationship between indegree and clustering coefficient as well as shortest path length. Here we still find that visual networks differ qualitatively from both metric and topological networks.
In a second step we study how these static properties affect information propagation by comparing the speed and reach of simple and complex contagion processes through visual and metric networks. Finally, we use the contagion processes to show examples of anisotropy in contagious spreading that can be observed in visual networks for certain combinations of density and sensory limits and are absent in metric networks.
A. Density dependence of network properties 1. In-degree Figure 1C shows the average in-degree as a function of spatial density of individuals for all three network types and various sensory thresholds. In the case of topological networks the in-degree is not affected by density due to the constraint that an individual can only interact with a fixed number of neighbors independent of their distance. For metric networks average in-degree increases with density. This is explained by the networks' construction where every individual is connect to all other individuals within a fixed range and naturally, the number of individuals within this fixed interaction radius increases with density.
Visual networks, on the other hand, exhibit a different relationship between density and average in-degree: depending on the visual threshold the average in-degree either monotonously decreases with density (very small visual thresholds) or exhibits a maximum at intermediate densities (higher visual thresholds), the exact position of which depends on the value of the visual threshold. The decrease at high densities is due to occlusions in the visual field that become more prominent at high packing fractions and constrain visual interactions. The decrease at low densities is the result of the non-zero visual threshold. Individuals need to occupy a certain angular area in the visual field of a focal individual before they become connected and this requires them to be within a certain distance to it. This behavior is similar to that of the metric network with the maximal interaction radius being determined by the visual threshold and the projected body size of the individual. Since this projected body size heavily depends on the ellipses' aspect ratio, Figure 1D takes a closer look at the variation of average in-degree with aspect ratio, which is 10 3 ≈ 3.3 in Figure  1A to C and throughout the rest of this paper.
In topological and metric networks the average indegree does generally not depend on the ellipse shape. An exception is the case of metric networks at high density, where for elongated ellipses (high aspect ratio) the average in-degree increases because ellipses can move closer together with a high aspect ratio and thus slightly increases the average in-degree by increasing the number of individuals that can fit within a fixed interaction radius. (D) Influence of ellipses' aspect ratio on avg. in-degree for different density regimes indicated by line color for fixed thresholds, θ visual = 0.05, θmetric = 8, θtopo = 5. At low density circles (aspect 1) are visible over larger distances leading to an increase in average in-degree. At high densities, elongated ellipses (high aspect ratio) cause fewer occlusions which in turn increases the average in-degree.
For visual networks one observes a strong dependence of in-degree on aspect ratio at all ranges of density. For high densities elongated ellipses (high aspect ratio) lead to less occlusions and thus a higher average in-degree. For low densities, circles (aspect ratio 1) remain visible best at large distances, leading to a higher average in-degree for small aspect ratio. At intermediate densities these two opposing effects can lead to a maximum of the average in-degree at intermediate aspect ratios.

Other network measures
We study the effect of network density on the average clustering coefficient, the average shortest path length and the distribution of relative link lengths, measures that have proven useful in characterizing types of spatial networks [25] and thus allow us to contextualize visual networks in the broader landscape of spatial networks.  shortest path is unaffected by network density. In metric networks the average length of the shortest path decreases monotonically with increasing density, which can be explained by the simultaneous increase in in-degree (see Figure 1C). In visual networks the average shortest path can exhibit a minimum, the position of which depends on the visual threshold and roughly matches with the maximum in the average in-degree (Fig. 1C). Figure 2B shows the effect of density on the average clustering coefficient. For topological networks the clustering coefficient depends only on the threshold, θ topo , and shows no density dependence. For metric networks the clustering coefficient increases monotonically with density. This can again be explained by network construction: since every node is connected to all nodes within a radius prescribed by the threshold, two neighbors of the same node are also likely to be close to each other and thus share a connection. In the case of visual networks, the clustering coefficient exhibits a nonmonotonic relationship with density. In particular, for some threshold values we find a maximum at low densities followed by a (threshold independent) minimum at intermediate density values.
Average relative link length, depicted in Figure 2C, varies with density similarly to the average in-degree, shown in Figure 1C. Qualitative differences between the link length distributions of the different network types, which are not adequately captured by the average, can be seen in an example in Figure 3C and the appendix.

B. Quantitative comparison of network types
While we have observed a variety of changes in networks measures with density, we have also found that they can to a large degree be explained by changes in the average in-degree. It is thus important to discern how much of this difference between network types persists when the average in-degree is kept fixed. The results, shown in Figure 3, represent averages over all densities. Figure 3A depicts the average shortest path, which decreases as networks become more densely connected with little difference between metric and topological networks. In visual networks, however, shortest paths tend to be shorter, especially at low to intermediate in-degrees. This decreased average shortest path length can most likely be explained by the presence of long links allowing shortcuts between spatially distant nodes (see Figure 3C). Figure 3B shows that for all three network types the average clustering coefficient increases with the number of incoming links per node. Again, there is little difference between metric and topological networks, whereas over a wide range of in-degrees the clustering of visual networks is substantially lower. This phenomenon can be partly explained by the presence of long-range connections breaking local clusters [c.f. 31]. Additionally, local clustering structure is disrupted by the visual blocking of neighbors on either side of an individual. At very high average in-degree, when the networks become essentially all-to-all connected, clustering approaches one. Visual networks however, do not reach such high degrees due to occlusions.
Finally, Figure 3C, shows the average relative link length of the different network types. While visual networks have a slightly higher average relative link length, the difference between the networks becomes more apparent when looking at the full distributions, shown as an inset for an average in-degree of 50. to a certain length and then show a fast decay in the distribution. The distribution of visual networks shows a much slower decay for higher link length, confirming the existence of substantially longer links in visual networks and underpinning our attribution of differences in the other two network measures to a difference in link length and shortcuts via a few very long links.

C. Density dependence of contagion processes
In section III A we showed that the density dependence of the visual networks' structural properties is very distinct from that of the other two network types. In order to understand their implications for dynamic processes, we compare the evolution of simple and complex contagion dynamics on visual to that on metric networks. We omit topological networks because of the independence of their topological properties from density and their similarity to metric networks in their dependence on average in-degree (see Figures 2, 3).

Simple Contagion
For a connected network and a sufficiently low recovery rate a simple contagion process will always spread through the entire network activating all nodes eventually. In order to compare the two network types we study the speed of the spread measured by the inverse of the time it takes for the activation to spread from a single individual to 75 % of the network, 1/t 75 . The probability of a node becoming infected is proportional to its number of infected neighbors (see eq. (14)). Therefore we can expect the infection to spread faster in networks with high average in-degree. Figures 4A and B show examples of the time course of infection for low and high densities respectively (for parameter sets refer to the figure caption). For the parameters used, at low densities (A) the infection spreads faster on visual networks, at high densities (B) the metric networks have a speed advantage. The solid lines in Figure 4C summarize the effect of density on speed for both network types and confirms the observation that for lower densities a simple contagion process will spread substantially faster through a visual than through a metric network while at higher densities this effect is reversed. The speed maximum of visual networks in the low to mid density regime correlates nicely with the shortest path length as shown in Figure 2 (for the threshold value 0.05) and can be explained by the presence of long-range connections.
However, the above examples are for one specific choice of metric and visual thresholds, θ metric = 5 BL and θ visual = 0.05 rad. As illustrated in Figure 4G, this choice allows visual links of (on average) up to 13 BL and thus longer-ranged visual than metric interactions (5 BL). For a full picture of the possible quantitative differences between the two network types, we include two more parameter values of the metric network. For θ metric = 13 BL the maximal link length of metric and visual networks is similar (dashed line) and the two networks have a comparable contagion speed at low density, only diverging at higher densities when occlusions in the visual network lead to a decrease in average in-degree compared to the metric networks. For θ metric = 25 BL metric interactions can be longer than visual ones (dotted line) and the simple contagion process spreads faster on the metric networks at all densities because of their higher average in-degree.
Considering metric networks as a simple model of acoustic interactions, the different choices of thresholds could describe animals that can see further/equally far/shorter than they can hear which will strongly depend on the animals physiology but also on the properties of the surrounding medium. While in those cases where metric interactions can be longer than visual ones acoustic interactions can be understood to provide a faster transfer of information across the group at all densities (dotted line), for the opposite case (solid line), the fastest mode of information transfer strongly depends on density.

Complex Contagion
In the complex contagion model considered here, the probability of getting infected is a sigmoidal function of the fraction of infected neighbors. Thus individuals only have a high infection probability if their fraction of infected neighbors, r inf , exceeds the threshold r 0 . A fractional contagion process is not guaranteed to spread through the entire network. If no node has a fraction of infected neighbors ≥ r 0 , the remaining infection rates of the individuals may drop far below the recovery rate and the process can come to a halt. To account for the possibility of incomplete spread we compare the network types w.r.t. the fraction of the network that gets infected before the process stops, instead of the contagion speed for the complex contagion. We refer to this as the reach of the contagion.
Where in the case of simple contagion having a high in-degree increases a node's rate of infection, because it increases its probability to have infected neighbors, the contrary is true for fractional contagion in the case of a low overall prevalence of the 'infected' state. Assuming a fixed number of infected neighbors (as we use to initiate the processes in Figure 4D to F), an increase in in-degree will only lower a node's fraction of infected neighbors and thus decrease infection probability. Figure 4D and E show the time course of infection for the same density regimes as in A and B. Compared to the simple contagion process the roles of the networks appear reversed: at low densities the fractional contagion process spreads faster and further in metric than in vi-sual networks, while at high densities visual networks are faster and become infected to a larger fraction. It is also clear, that most networks do not get fully infected for this choice of parameters. Figure 4F compares the fraction of infected nodes in both network types as a function of density for the same set of thresholds as in Figure 4C. The effect of density is clearly reversed between the complex and the simple contagion process which can be attributed to the opposing effect of an increase in in-degree on the infection probability of a node as discussed above.
Coming back to the interpretation of the two network types as based on two different senses (vision and hearing), we can now see that in addition to the group density the optimal mode of transmission (acoustic or visual) does also depend on the type of contagion process. A combination of both interaction types may allow robust communication independent of group density.
Another notable feature that distinguishes visual from metric networks here is their consistency and robustness over a wide range of densities. While contagion speed for metric networks quickly increases with density (for all threshold values), visual networks provide comparable speeds at high and low densities. Similarly, for each metric threshold there is an upper density limit for the transmission of a complex contagion, but we can find visual thresholds that allow a complex contagion to (partially) pass at all densities.

D. Quantitative comparison of contagion processes on visual and metric networks
In section III B a degree-controlled comparison of the different network types revealed that for intermediate average in-degrees visual networks on average have a lower shortest path length, a lower average clustering coefficient and links that span larger distances than their metric and topological counterparts (Figure 3). In order to illustrate the effect that these differences can have on dynamic processes, we again compare the evolution of simple and complex contagion dynamics on visual to that on metric networks for an exemplary set of parameters, see caption of Figure 5. Figure 5A depicts the spreading speed of a simple contagion on visual networks in units of the spreading speed on degree-matched metric networks, t metr 75 /t vis 75 , as a function of average in-degree (black dots). Spreading on visual networks is faster (indicated by values larger than 1) for a wide range of intermediate average in-degrees. The ratio of average shortest path lengths, a metric /a visual , (grey dots) mirrors the qualitative shape of the speed ratio indicating that the increased speed of the simple contagion process on visual networks can be attributed to their shorter average shortest paths (compare Figure  3A). Figure 5B and C illustrate the effect of the lower clustering coefficient of visual networks on the reach of the complex fractional contagion. As already discussed in section III C in the context of Figure 4F, as long as the number of infected individuals in the network is low and infections are randomly distributed (illustrated in the inset of Figure 5B), each additional link is most likely decreasing the focal node's infection probability in the fractional contagion process (because it is more likely to a susceptible than to an infected individual). This is the case in Figure 5B for both network types and explains the decrease of the average reach with increasing average indegree. A spatial clustering of infections (as in the initial conditions of Figure 5C, illustrated in the inset) increases the fraction of infected individuals in the neighborhood of nodes with a high local clustering and close to the 'wave front' of the infection (the border between susceptible and infected individuals). Therefore, the average reach of the fractional contagion remains substantially larger on metric than on visual networks with increasing average in-degree for a spatially correlated initial activation ( Figure 5C).
Put differently, visual networks have a longer average link length for a comparable average in-degree, which results in a lower clustering and in nodes receiving inputs from many, possibly far away and not spatially correlated neighbors. This makes it difficult for any node to reach the required fraction of infected neighbors in case of a very spatially confined spreading (i.e. a single wave front passing throught the group). The long range connections lead to a diffusion of information and an overall decrease in the local fraction of infections. Thus the same mechanisms that have proven helpful in the case of simple contagion (i.e. the long links, providing short cuts), hinder the spread of information for complex contagion. The hampering effect of long range connections has also been described in the sociological literature where its is known as the "weakness of long ties" [32].

E. Polarization
While so far we have studied the effect of density and degree on the structural properties of and contagion processes on the different network types, we have not considered the influence of the group's polarization which we have kept between 0 and 0.3. While under natural conditions polarization may correlate with density and thus indirectly influence network structure, for our grid-like positioning of ellipses, metric and topological network links are not influenced by the orientation of individuals because of their sole dependence on the Euclidean distance between individuals. For visual networks, however, the orientation of an ellipse may crucially influence its visibility and thus its social interactions. A high polarization may therefore lead to an anisotropy in spreading only on visual networks, i.e. a difference in speed of propagation in direction of the polarization to that perpendicular to it. Figure 6 illustrates this effect with two examples of a combination of group density and visual threshold that leads to an anisotropy at high polarization, which is no-   Figure 6A and B depict the average propagation of a simple contagion process through a group of 400 individuals in a square 20x20 grid with average distance of 1.5 BL and 5.0 BL respectively between grid neighbors (g = 1.5 and g = 5.0). The contagion process is initiated by one individual in the lower left corner at t = 0 for high (Φ ∈ For the low visual threshold and high density used in C, at high polarization links can span longer distances and are more numerous in direction of the polarization as occlusions are less prominent in this direction because of the smaller visual angles. For the high visual threshold and low density used in D, at high polarization links are more likely to exist perpendicular to the polarization because of the larger angular areas of ellipses when seen from the side. These unevenly distributed links increase spreading speed in the direction of higher link density and length. In Panel E and F we summarize the above results by averaging over the outer three rows of individuals in x (solid lines) and y (dashed lines) direction for high (purple) and low (grey) polarization. For low polarization perpendicular and parallel propagation times are similar, while for high polarization propagation time is reduced either parallel (E) or perpendicular (F) to the polarization. Metric networks with a threshold of θ metric = 6 BL (illustrated by orange circle in C) and θ metric = 7, BL (D) show no difference in propagation times for high and low polarization (E,F). Metric threshold values were chosen to yield similar contagion speeds as the visual counterparts.

IV. DISCUSSION
Animal groups represent examples of spatiallyembedded interaction networks, where the spatial density of individuals does not only vary due to external factors but can be actively modulated by the group members based on environmental context [19]. We have shown, that when describing such systems with highly variable density by considering fixed interaction thresholds, potentially related to sensory or cognitive limitations, the fundamental properties of the resulting interaction network, their qualitative dependence on density and their emergent collective dynamics will crucially depend on the type of the network used. In particular, each network type shows a characteristic qualitative dependence of the average degree on density, which influences the density dependence of other network measures as well as the speed and reach of two classes of contagion processes (Figures 1, 2 and 4). We characterized visual networks as a distinct class of interaction networks and highlighted the often neglected dependence of collective behavior on density and network type.
When modelling the collective behavior of animal groups with variable densities and fixed thresholds, intermediate-threshold visual networks display several key advantages. In contrast to metric networks, the average degree does not monotonically increase with density and thus avoids unrealistically high values at high densities. In contrast to topological networks they show a non-trivial dependence of the (in-)degree on density, and more crucially the finite visual threshold introduces a maximal interaction distance, which makes their behavior more realistic at low densities. In addition, they exhibit a maximum in the average (in-)degree at intermediate spatial densities of individuals which could explain preferred group densities.
Our results further demonstrate that for wide ranges of group densities visual networks are characterized by the existence of long-ranged links, absent in metric or topological interaction networks with comparable in-degrees which are accompanied by a lower average shortest path and clustering coefficient (Figure 3). The role of such long-range links in facilitating simple contagion processes such as information diffusion, has been studied extensively in network science and is known as the "strength of weak ties" or the "small-world" phenomenon [33,34].
Here we observe their influence in an increased spreading speed of the simple contagion on visual networks as compared to metric ones of similar degree ( Figure 5). On the other hand, visual networks have in general smaller clustering coefficients in comparison to metric and topological networks, which is disadvantageous for the spread of fractional, complex contagion processes, assumed to be involved in spreading of behaviors [12] and known as the "weakness of long ties" [32]. We can observe this effect in our simulations of a complex fractional contagion process on visual and metric networks of the same degree. Here, the contagion process spreads to a larger fraction of the metric than the visual network and this effect becomes even more apparent when the initial activation is spatially correlated ( Figure 5).
In summary, how fast and how far a behavior or information will spread, is dependent upon the network density, the agent's sensory limits and the type of contagion process. The use of multiple types of interactions (like visual or acoustic) may enable organisms to compensate the shortcomings of one type of sensory interaction and thus enable reliable collective response across a range of densities or sensory limits varying under changing environmental conditions.
Finally, we show that only visual networks have a strong dependence on the aspect ratio and orientation of individuals. More specifically, the breaking of a group's orientational symmetry due to alignment of individuals induces a symmetry breaking in the interaction network and consequently spatial anisotropy of social interactions. For two exemplary combinations of density and visual threshold we found anisotropy in the spreading of a simple contagion process on visual networks of polarized groups. More detailed studies of this dependence could reveal advantages or disadvantages of different spatial configurations of animal collectives observed in nature, especially when studied together with their visual detection ability [35].
Overall, our work provides compelling arguments for the consideration of visual networks in the study of social behavior. Nevertheless, it marks only a first step towards a full understanding of their role in collective animal behavior. While our results for artificially generated, static networks based on a square grid allow us to systematically study the effect of density, they do not capture the temporal nature and full range of structures observed in animal groups. Luckily, recent improvements in tracking software promise faster and more convenient access to realistic animal network data, including visual networks [36]. Using networks constructed from animal tracking would provide information about naturally occurring group sizes, densities and polarization as well as spatio-temporal fluctuations within these measures and thus allow to study their effects within a naturally occurring parameter range. Additional knowledge about the sensory limits specific to the studied organism (including the addition of a visual blind angle) will further improve the interaction networks and may enable a direct comparison between networks based on different senses like sound perception and vision.
A next step could then be to move on to non-static networks and to study the effect of different macroscopic states such as milling or swarming on network structure and spreading dynamics. Such an approach could also take into account the interactions of a group with the environment, asking, for example, how the detection of visual cues and the trade-off between private (external) and social information depends on group structure. It has been shown that predator detection based on sensory limits is dependent on density and group size and varies between different macroscopic states of fish schools [35] whereas interactions with the environment may induce density fluctuations. We hypothesize that visual networks are more robust to such spatial perturbations (i.e. a local increase or decrease in density).
Finally, let us note that, by starting with the most basic approach and considering binary connections (1 or 0 for presence or absence of links), we laid out the fundamental effects of the different networks' dependency on density and threshold. A natural extension to weighted networks in the visual model would be to use relative angular area (angular area divided by the total field of view) as a link weight. Such an approach would entail an additional dependence of average link strength on density, which would in turn affect the weighted counterparts of the network measures. For the purpose of this paper, i.e. to establish visual networks as fundamentally different from other spatial networks by making direct comparisons between network types, the introduction of link weights would have been impractical as it would have introduced additional and arbitrary dependencies on density by the choice of link weights for each network type. Observed differences between the weighted networks would be heavily influenced by the choice of link weights and could therefore be less clearly attributed to sensory limits and the different rules establishing links. A comparisons between weighted networks will thus be most informative when studying a specific biological system which justifies the choice of link weights. Nevertheless, we expect essential features of the visual network, i.e. the existence of an upper bound on the degree at high densities, a lower clustering, the existence of longer links and the anisotropy of visual interaction networks due to orientational symmetry breaking, to also hold for weighted networks.
In conclusion, our work proposes experimentally testable hypothesis, e.g. in the context of behavioral contagion in animal groups [12,37], as well as a theoretical foundation for future investigation on how collective information processing could be dynamically tuned by individual-level behavioral adaptations affecting local density [19]. We highlighted several important qualities of visual networks, including their unique dependence on density and polarization, which encourages further research in this area. Overall, visual networks provide a promising and necessary addition to the established toolkit for the study of social interactions and collective behaviour and emphasize the need to include systemspecific sensory limits.

DATA AVAILABILITY STATEMENT
The code used to generate networks and simulate contagion dynamics on them can be found on GitHub and was archived via Zenodo, [38].

ACKNOWLEDGMENTS
We acknowledge the support by Luke Longreen with exploratory simulations of visual networks as part of his lab rotation.
For an illustration of the density estimation refer to Figure 7.

Appendix B: Elimination of overlaps
To ensure 2 dimensional groups without overlaps we use a particle simulation based on the code provided within [26]. Ellipses start at their noisy grid positions (see main text) with velocities v i (t = 0) = 0. These velocities v i (t) evolve based on the positions x i (t) = (x i (t), y i (t)) T as follows (B1) Here A ij (t) denotes the area where ellipse i and ellipse j overlap at time t, α is the damping parameter, λ a constant model parameter and m i = m = 1 is the mass of an ellipse (here: α = 0.2, λ = 0.05). The simulation ends when all overlaps are removed. We used a second larger ellipse (factor 1.1) to determine the repulsion area A ij to speed up the relaxation into a non-overlapping state and stopped when the original size ellipses were no longer overlapping, see Fig. 8.

Appendix C: Analytical calculation of visual field of ellipse
To construct the visual networks, we assume an ellipse at relative position (x 0 , y 0 ) = r(cos θ, sin θ), with major axis of length 1 rotated by φ from the x-axis and minor axis of length w and calculate the angular area that it occupies in the visual field of an observer with 360 • vision. The observed ellipse is given by: We calculate the gradient of the observed ellipse as dy dx = sin φ sin ψ + w cos φ cos ψ cos φ sin ψ − w sin φ cos ψ .
A tangent line to the ellipse is given by where (x s , y s ) is the tangent point on the ellipse (see Fig.  9). Since we place our observer at the origin, the tangents (dashed lines in Figure 9) we need in order to determine the visual field have to pass through this point and thus it needs to hold that 0 = − dy dx s x s + y s 0 = −(dy/dψ)| s x s + (dx/dψ)| s y s .
Occlusions of individual j in the visual field of i by all other individuals k = j are then determined by an algorithm using intersections of rays originating from the eye of the focal individual i and going through the tangent points (as perceived by i) on j with the outlines of ellipses k. To determine if j or k is visible to i in the occluded area, intersection of ellipse outlines with the angle bisectors of the rays described above are also considered.  The effect of density and network thresholds on the distribution of relative link lengths for low (bottom two rows, g = 3.0) and high (top two rows, g = 0.5) density. The distributions of link length (colored according to threshold, legend as in (A) to (C)) shows a distinct shape for each network type. Of all the links in an all-to-all connected network (grey) only a certain part is present for the different network types depending on the threshold value. The fraction of realized links is the ratio of links of a certain length found in each network type and all possible links of this length in a fully connected network. All subfigures were created using networks of N=225 and threshold values as in Figure 1 of the main text.