Shape and connectivity of groups and clusters: Impact of dynamical state and accretion history

Matter distribution around clusters is highly anisotropic from their being the nodes of the cosmic web. Clusters' shape and the number of filaments they are connected to, i.e., their connectivity, should reflect their level of anisotropic matter distribution and must be, in principle, related to their physical properties. We investigate the influence of the dynamical state and the formation history on both the morphology and local connectivity of about 2400 groups and clusters of galaxies from the large hydrodynamical simulation IllustrisTNG at z=0. We find that the mass of groups and clusters mainly influences the geometry of the matter distribution: massive halos are significantly more elliptical, and more connected to the cosmic web than low-mass ones. Beyond the mass-driven effect, ellipticity and connectivity are correlated and are imprints of the growth rate of groups and clusters. Both anisotropy measures appear to trace different dynamical states, such that unrelaxed groups and clusters are more elliptical and more connected than relaxed ones. This relation between matter anisotropies and dynamical state is the sign of different accretion histories. Relaxed groups and clusters are mostly formed long time ago, and slowly accreting matter at the present time. They are rather spherical and weakly connected to their environment, mostly because they had enough time to relax and, hence, lost the connection with their preferential directions of accretion and merging. In contrast, late-formed unrelaxed objects are highly anisotropic with large connectivities and ellipticities. These groups and clusters are in formation phase and must be strongly affected by the infalling of materials from filaments.


Introduction
Clusters of galaxies are not isolated structures, but rather the nodes of the large-scale cosmic web to which they are connected. Their birth and growth are intimately linked with the anisotropic nature of the gravitational collapse. Starting from nonspherical density peaks in the primordial density field (Doroshkevich 1970; Bardeen et al. 1986), their asymmetries have been amplified by gravitation. Following the standard model of structure formation, clusters are also assumed to continuously grow by successive mergers and accretion along filamentary structures in the cosmic web (Zel'Dovich 1970). The nonspherical shape of groups and clusters can therefore be used to test and validate the structure formation scenario (Sereno et al. 2018) and the nature of dark matter (DM, Yoshida et al. 2000;Spergel & Steinhardt 2000;Davé et al. 2001;Peter et al. 2013).
On the one hand, the evidence of the nonsphericity of halos has been well established using cosmological N-body simulations (see, e.g., Jing & Suto 2002). The elliptical shape of DM halos is expected to depend on their mass and redshift, as discussed in Allgood et al. (2006); Despali et al. (2014); Suto et al. (2016); Vega-Ferrero et al. (2017), high-mass halos tend to be less spherical than low-mass objects. This mass-ellipticity correlation can be attributed to the formation time (Despali et al. 2014) and the formation history (Chen et al. 2019;Lau et al. 2021) of halos. Following the hierarchical formation scenario, E-mail: celine.gouin@ias.u-psud.fr more massive structures formed more recently and are thus expected to be more widely disturbed because they did not have enough time to relax. Investigating the link between the nonsphericity and the properties of groups and clusters is therefore an essential question for improving our understanding on the formation and growth of structures. These investigations are also crucial to reduce uncertainties on the cosmological constraints. Any departure from spherical symmetry in the matter distribution can bias the cluster mass estimation (see, e.g., Lee et al. 2018), which in turn affects the cosmological constraints inferred from, for instance, the concentration mass relation (see, e.g., Macciò et al. 2007).
On the other hand, the large-scale environment of clusters is expected to affect their internal properties and their density profile (see, e.g., Contigiani et al. 2020). Much effort has recently been expended to probe relations between the brightest central galaxy (BCG) of groups and clusters with their local environment in the cosmic web (Kuutma et al. 2020). For example, Poudel et al. (2017) have probed the effect of cosmic web filaments on the properties of groups and their central galaxies. In addition, Darragh-Ford et al. (2019) have also investigated the relation of the number of filaments that are connected to groups and their BCG. The authors suggested that groups with high connectivity are more likely to have grown through a recent major merger, which tends to reduce the star-formation activity of the BCG. In general, the effect of cosmic web connectivity on the Article number, page 1 of 13 arXiv:2101.04686v2 [astro-ph.CO] 30 Apr 2021 A&A proofs: manuscript no. 40327corr physical properties of galaxies has recently been investigated by Kraljic et al. (2020) and Lee et al. (2019).
Moreover, the local topology and geometry of the density field next to massive halos can be probed statistically through the connectivity, that is, the number of filaments branching out from a halo. The statistics of halo connectivity is expected to depend on the growth factor, and thus can constitute an new topological constraint on dark energy (Codis et al. 2018) because the connectivity of halos must decrease with cosmic time due to the accelerated expansion of the Universe that disconnects cosmic nodes from the network of filaments (Pichon et al. 2010). More generally, the anisotropic environment of the cosmic web affects the assembly bias of halos, as was theoretically explored by Musso et al. (2018), who found that early-formed low-mass halos preferentially lie along filaments, while massive young halos are closer to the nodes (see also Shim et al. 2020;Cadiou et al. 2020). Cosmic web anisotropy is thus expected to be an indicator of halo assembly bias and is therefore strongly correlated with halo properties (as discussed in Paranjape et al. 2018;Ramakrishnan et al. 2019).
In this context, galaxy clusters and groups are ideal places to describe the anisotropic level of matter distribution: from their nonspherical shape to the filaments that channel in-falling matter to clusters. Recently, Gouin et al. (2020) have shown that the angular symmetries in the matter distribution increase with the distance from the cluster center. While matter inside clusters is well described by an ellipsoid (traced by quadrupolar moment), the filamentary pattern outside clusters show a complex azimuthal signature. Both anisotropy signatures, traced by either the ellipticity or the connectivity, constitute probes for the structure formation scenario and cosmology. It is therefore of interest to understand the link between the mass assembly of clusters and the geometrical properties of their mass distribution. In this study, we focus in particular on the three main questions: • Does the anisotropic environment of groups and clusters influence their halo shape? • Is the dynamical state of groups and clusters impacted by their anisotropic environment? • Are the ellipticity and connectivity distributions resulting from different mass assembly histories?
To address these questions, we explore the shape of groups and clusters of galaxies and the large-scale filamentary structure that surrounds them using a large sample from the current cosmological hydrodynamical IllustrisTNG simulation (Nelson et al. 2019). The paper is organized as follows. In Sect. 2 we define the sample of simulated groups and clusters and the quantities we used to describe the dynamical state and mass-assembly history of the halo. In Sect. 3 we explain how we estimated the shape and the connectivity of groups and clusters. The statistics of ellipticity and connectivity are presented in Sect 4., where we explore possible correlations with the dynamical state and accretion history of the halo. In Sect. 5 we discuss our findings in the context of recent studies of cluster evolution. Finally, Sect. 6 summarizes our main results.

Groups and clusters from IllustrisTNG
The hydrodynamical cosmological simulation IllustrisTNG (Nelson et al. 2019) follows the evolution of dark matter, gas, stars, and black holes on a moving mesh (code Arepo, Springel 2010) from redshift z = 127 to z = 0. The input cosmology of the simulation is consistent with Planck 2015 results (Planck Collaboration et al. 2016), such that Ω Λ,0 = 0.6911, Ω m,0 = 0.3089, Ω b,0 = 0.0486, σ 8 = 0.8159, n s = 0.9667, and h = 0.6774. We focus on the largest simulation box IllustrisTNG300-1 with a size length of 302.6 Mpc and with the highest mass resolution of m DM = 4.0 × 10 7 M /h (2500 3 DM particles). We chose to use this high-resolution and large simulation box to accurately describe the shape and dynamical state of the massive halos. For each snapshot, the IllustrisTNG simulation provides a halo catalog, identified with a standard friends-of-friends (FoF) algorithm with linking length b = 0.2 (Davis et al. 1985), and a subhalo sample derived with the Subfind algorithm to detect substructures inside host halos (Springel et al. 2001). Based on the FoF group sample from IllustrisTNG, we selected 2522 halos representing galaxy groups and clusters with masses M 200 ≥ 1 × 10 13 M /h at z = 0. We defined M 200 and R 200 as the radius of the group. R 200 is the radius enclosing M 200 with a mean overdensity of 200 times the critical background density. We discarded 79 halos that are closer than 3 R 200 from the simulation box edges to focus our exploration on the large-scale halo environments.

Dynamical state of groups and clusters
In order to identify whether the anisotropies in matter distribution are correlated to the dynamical state, we categorized the groups and clusters by their level of relaxedness. The equilibrium state of each halo was assessed by computing three different parameters (as defined in detail, e.g., by Cui et al. 2017). First, we quantified the center-of-mass offset, which measures the distance between the center of mass r cm and the density peak of the halo r c , normalized by the virial radius (∆ r = |r cm − r c |/R vir ). We considered r c to be the position at which the potential energy is minimum inside the halo, and r cm was computed as the sum of the mass-weighted relative coordinates of all particles and cells in the FoF halo. Secondly, we determined the subhalo mass fraction which estimates the level of substructure in the halo. It is defined as f sub = M sub /M tot , where M sub is the mass of each subhalo without taking the mass of the main subhalo (i.e., the most massive subhalo) into account, and M tot is the total mass of the halo. Thirdly, we computed the virial ratio of groups and clusters. It represents the level of halo virialization and is defined as η = 2T/|W|, where T and W are the kinetic energy and the gravitational potential energy, respectively. It is computed from all particles and cells in the FoF halo. A cluster can thus be considered as relaxed when it has a low subhalo mass fraction ( f sub < 0.1), a low center-of-mass offset (∆ r < 0.07), and is close to virial equilibrium (|η − 1| < 0.15). Halos that do not satisfy these three criteria can be classified as unrelaxed (similarly to Neto et al. 2007;Power et al. 2012). In addition, we combined these three parameters to obtain a continuous measure of the level of the so-called relaxedness χ DS , as introduced by Haggar et al. (2020), Groups and clusters with χ DS ≥ 1 were considered as dynamically relaxed (see, e.g., Kuchner et al. 2020).

Mass accretion history and formation time
In order to probe the accretion history of groups and clusters, we estimated the instantaneous halo growth rate dM/dt z∼0 , the re-cent continuous mass accretion rate Γ 200m (z = 0.5), and the formation time z form of our sample. To do so, we used the merger tree of subhalos computed using the SubLink algorithm (see Rodriguez-Gomez et al. 2015, for details of the subhalo and merger tree computation in the Illustris simulation). For each group, we focused on the merger tree of its main subhalo. Following the principal branch of the main subhalo merger tree, we extracted the mass (M 200c and M 200m ) of their associated halo at each time step. We hence assume that the main subhalo progenitor is associated with the main halo progenitor. This is almost always true, except in the occasional case of subhalo switching when a large number of particles from a given subhalo switch to a another subhalo between two consecutive snapshots (this particular numerical case is fully described in Poole et al. 2017). By computing the mass growth of halos over cosmic time, we can calculate different proxies of their mass-assembly history. Following Cole & Lacey (1996), we defined the formation redshift z form as the redshift at which the mass of the halo main progenitor M 200 (z) is equal to half its mass at z = 0, such that The halo mass accretion controls the rate at which mass is deposited into halos. Previous works presented a large variety of definitions of the halo mass accretion rate. We focus on two of them. First, several studies describe the instantaneous mass accretion rate (see, e.g., van den Bosch 2002; Rodríguez-Puebla et al. 2016) as Because we are interested in quantifying the accretion of halo at the present time, we computed dM/dt z=0.05 by performing a linear regression on M 200m (t) over ten snapshots from z = 0 to z = 0.11. We note that 57 low-mass halos have a negative recent growth dM/dt z∼0 < 0, probably due to particle switching (Poole et al. 2017). We discarded them for the specific investigations of the halo growth at z ∼ 0. Secondly, the logarithmic slope of the mass evolution d log M/d log a is a natural description of the mass growth, following the parametric form of halo mass evolution over time M(a) ∝ exp(−αz), where α is related to the formation epoch of the redshift, and a is the scale factor (see, e.g., Wechsler et al. 2002). This estimator of the continuous mass accretion history is defined as The halo mass changes through the physical accretion and the changes in the halo radius that are defined by the reference density. This definition of mass accretion rate Γ thus accounts for the real physical accretion rate and has the advantage of isolating effects of pseudo-evolution in the cluster mass (Diemer et al. 2013). Computing the accretion rate Γ allows us to determine the accretion phase of halos between two times, from z = 0 to z ∼ 0.5. The redshift interval of ∆z = 0.5 corresponds reasonably well to the expected relaxation timescales of halos (Power et al. 2012;Diemer & Kravtsov 2014;More et al. 2015;Chen et al. 2019). By using the masses of halos at z = 0 and their main progenitor at z = 0.5, we thus computed the continuous accretion rate Γ 200m (z = 0.5) for each halo. Four halos do not have a main progenitor at z = 0.5 and were therefore discarded from the analyses for which the accretion history was used.

Probing the anisotropy of matter distribution
We aim to probe the anisotropic level of the density field in environments of massive objects. The anisotropy of matter distribution was estimated at two different radial scales: inside groups and clusters, and in their environments. Gouin et al. (2017Gouin et al. ( , 2020 have recently reported that deviations from spherical symmetry increase from the cluster centers to their external regions with two distinct regimes: inside halos, and outside the virial radius. Inside clusters, the matter distribution is highly quadrupolar, reflecting the ellipsoidal shape of the halos. In cluster outskirts, from 1 × R vir to 4 × R vir , the matter distribution describes more complex angular symmetries up to high harmonic orders. These high levels of angular harmonics are induced by the filamentary pattern around clusters and increase for clusters that connected to a large number of filaments (Gouin et al. 2020). Following these previous investigations, we quantified the anisotropy inside groups and clusters by estimating their ellipticity, such that elongated shapes are defined as more anisotropic than spherical shapes. The anisotropy of the large-scale environment of groups and clusters was also estimated by counting the number of filaments that are connected to them. By extracting the cosmic filamentary structure, we considered as highly anisotropic environments those halo outskirts that are connected to a large number of preferentially accreting directions.

Ellipticity measurement
The anisotropy of the matter distribution in halos was estimated by modeling the halo shape as an ellipsoid and by computing its ellipticity. The ellipticity is commonly defined as in Jing & Suto (2002), where λ [1,2,3] are the axes of the ellipsoid with λ 1 ≥ λ 2 ≥ λ 3 , and τ = λ 1 + λ 2 + λ 3 . For each group of clusters, we determined the major, intermediate, and minor axis vectors of the ellipsoid (a > b > c) by diagonalizing their mass tensor, where x (i) α (α = 1, 2, 3) is the coordinate of the ith DM particle along the three axes. Following Suto et al. (2016), we used all the DM particles including all substructures and non-FOF members. Starting from the sphere centered on the center of mass, we computed the eigenvalues of the mass tensor and fixed the size of the ellipsoid such that the total mass enclosed in the ellipsoid equaled M ellipsoid = M 200 . We then repeated the procedure until all the eigenvalues converged to within 1%. The axes of the ellipsoid were defined by the square roots of the tensor eigenvalues. The ellipsoidal shapes of halos for different values of the ellipticity are shown in Fig. 3. Figure 1 displays the cumulative distribution function of the ellipticity for several mass bins. We confirm the results from previous theoretical studies that were also based on numerical simulations (see, e.g., Allgood et al. 2006;Despali et al. 2014;Bonamigo et al. 2015;Vega-Ferrero et al. 2017;Despali et al. 2017) and show that massive groups and clusters on average have a more elliptical and thus a more anisotropic matter distribution. This ellipticity-mass dependence can be attributed to the hierarchical formation scenario that implies that massive structures Article number, page 3 of 13 A&A proofs: manuscript no. 40327corr are formed more recently and thus have not had time to relax (Despali et al. 2014).

Connectivity measurement
The anisotropy in the large-scale environment of groups and clusters is quantified by the local number of filaments that are connected to them, the so-called connectivity κ. This proxy is a powerful tool for understanding the geometry of the underlying density field, as discussed in Codis et al. (2018). Different methods are proposed in the literature to extract the skeleton of the cosmic web (for a review of recent methods, see Libeskind et al. 2017). We used the recently developed cosmic web detection algorithm T-ReX (Bonnaire et al. 2020), which builds an estimate of the filamentary pattern based on a graph modeling of the subhalo distribution. T-ReX extracts a smooth version of the minimum spanning tree using a Gaussian mixture model to describe the spatial distribution of tracers. Two main parameters are used in the algorithm: one controls the smoothness of the graph, λ, and one governs the level of the denoising pre-procedure, l. We considered here λ = 1 and l = 5 to capture the large-scale cosmic filaments and smaller bridges of matter.
Following Galárraga-Espinosa et al. (2020a,b), we applied the cosmic web detection algorithm on subhalos from the Illus-trisTNG simulation selected according to their stellar masses, M * [M ] ≥ 10 9 . From the output graph, we associated the closest node of the graph with each group and cluster, and the local connectivity κ is the number of intersecting filaments in a sphere of 1.5 R 200 radius around the graph node (similarly to Darragh-Ford et al. 2019;Sarron et al. 2019). We discarded 24 low-mass groups that were considered too distant from the graph (> 1 Mpc/h). These objects are located in low-dense environments, and are thus not connected to the overall cosmic web. As a result, our final sample of groups and clusters consisted of 2419 halos, for which we estimated the ellipticity and connectivity in order to probe the anisotropy inside and around halos.
The cluster connectivity is illustrated in Fig. 3. The T-ReX filamentary structure (computed from the galaxy distribution) clearly traces the DM distribution around halos well. In addition, Fig. 2 shows the probability distribution function of the connectivity for four mass bins. The histogram of the clusters (M 200 > 1 × 10 14 M /h) peaks around 3-4 (i.e., clusters are connected to three to four filaments) and is spread over high κ values (up to κ = 6). In contrast, the connectivity statistics of the lowest-mass groups (1 × 10 13 < M 200 [M /h] < 2 × 10 13 ) strongly peaks at κ = 2, suggesting that low-mass groups are preferentially located inside filaments, whereas massive clusters are more likely located at the nodes of the cosmic web. We thus confirm that massive structures have a higher connectivity than low-mass structures (as was also found by (see, e.g., Aragón-Calvo et al. 2010;Codis et al. 2018;Darragh-Ford et al. 2019;Sarron et al. 2019;Malavasi et al. 2020)). In addition to the massconnectivity relation, we explored any possible correlation between anisotropic environments (via the connectivity) and the properties of the groups and clusters.

Results
In this section, we assess the effect of the dynamical state and mass-accretion history on the anisotropies of the matter density field around simulated groups and clusters as traced by the ellipticity in their inner parts and the connectivity at larger scales where the groups and clusters are connected to the cosmic web. Both anisotropy proxies depend on the mass: Massive structures are more elliptical and more strongly connected to the cosmic web than low-mass structures (see Figs. 1 and 2). Our purpose is to determine whether there are any other correlations between the anisotropy and the halo properties beyond the mass-driven trend. Therefore we adopted the strategy of exploring the relations of the physical halo properties and halo anisotropy proxies for different mass bins. For all figures, we display the mean quantity together with their associated error bars derived from bootstrap re-sampling. To further assess the correlation between a set of parameters representing either the physical properties or the anisotropy proxies, we list the Spearman rank correlation coefficient ρ sp and the associated p-value in Table 1.

Effect of cosmic filament accretion on shapes
The effect of the anisotropic large-scale environment on the shape of groups and clusters is investigated first. Given the known correlations of mass and connectivity, and mass and ellipticity, we aim at investigating whether connectivity and ellipticity are correlated beyond the mass effect. Therefore Fig. 4 displays the mean halo ellipticity as a function of mass for three different connectivity bins. We separately consider weakly connected (κ = {1, 2}), medium connected (κ = 3), and highly con- nected (κ > 3) groups and clusters. At fixed mass, there is a trend for weakly connected objects to be more spherical than highly connected objects. In contrast, structures with a high connectivity (κ > 3) are on average more elliptical than the other structures. This trend between connectivity and ellipticity is more significant for masses higher than 10 13.5 M /h, probably because the range of connectivities is wider for these mass bins. The connec-tivity of low-mass groups (10 13 < M 200 < 10 13.5 M /h) is low, with about 80% with κ ∈ {1, 2}, suggesting that they are preferentially located inside filaments (as shown by Cautun et al. 2014;Hellwing et al. 2020  more, as Table 1 shows, the correlation coefficient between ellipticity and connectivity increases for high-mass halos and reaches ρ sp ∼ 0.24 for M 200 ≥ 1 × 10 14 M /h. This correlation remains significant for masses M 200 > 5×10 13 M /h when the partial correlation coefficient is computed, where the effect of mass dependence is corrected for using the fitting formulae of (M 200 ) and κ(M 200 ). We conclude that for masses higher than 10 13.5 M /h, the higher the connectivity, the more elliptical the cluster on average.
To understand this anisotropic environmental effect on the shape, we probed the possible relations between the accretion of infalling matter at the present time and the halo anisotropy proxies (both ellipticity and connectivity). In addition to the overall picture that groups and clusters are preferentially aligned with their main connected filaments as supported by previous theoretical (Gouin et al. 2017;Okabe et al. 2020a;Kuchner et al. 2020) and observational Okabe et al. 2020b;Gouin et al. 2020) studies, Morinaga & Ishiyama (2020) have recently shown that ellipticity is correlated with the filamentary accretion.
The accretion of groups at z = 0 can be quantified by the instantaneous mass accretion rate dM/dt z∼0 (a proxy for the growth rate), as described in Sect. 2.3. Fig. 5 shows the mean instantaneous accretion rate of groups and clusters as a function of their masses. As expected following the hierarchical structure formation scenario, massive halos grow more rapidly on average than low-mass halos. In addition to the mass-driven effect, the left panel of Fig. 5 shows the instantaneous accretion rate for three bins of ellipticity: an almost spherical ( < 0.05), a quasi-elliptical (0.05 < < 0.1), and a strongly elliptical shape ( > 0.1). This demonstrates that elliptical groups and clusters grow faster on average than spherical ones. The Spearman rank correlation coefficient for the ellipticity and instantaneous mass accretion rate, which is about 0.3 (see Table 1), confirms the strong correlation between ellipticity and accretion rate (also recently shown by Lau et al. 2021). This relation of ellipticity and accretion is significant for all masses ranging between 10 13 and 10 15 M /h and suggests that high-accretion flows strongly disturb the shapes of groups and clusters (as discussed in Morinaga & Ishiyama 2020).
The right panel of Fig. 5 displays the evolution of the mass accretion rate as a function of mass, considering the three bins of connectivity defined above (little, medium, or highly connected halos). It shows for each mass bin that highly connected clusters tend to grow faster at the present time than other groups and clusters. The high value of the correlation coefficient for connectivity and the instantaneous mass accretion rate (see Table 1) also demonstrates that the accretion rate scales with connectivity. We may assume that more mass is infalling because of the large number of filaments to which the halo is connected. Moreover, in concordance with the theoretical investigations of Musso et al. (2018), our result suggests that at fixed mass, halos in the nodes (with κ > 3) have higher accretion rates than halos in filaments (with κ < 3).
From these results, we conclude that the anisotropy of the halo environment affects their shapes: the larger the number of filaments to which a group or cluster is connected, the more elongated its shape on average. For the first time, we highlight the correlation between ellipticity and connectivity and show that this is not only driven by the mass. Moreover, our results suggest that this link between anisotropic environment and halo shape can be due to their current growth. Regardless of their mass, connectivity and ellipticity are strongly correlated to the accretion of groups and clusters at the present time. Our results reveal that clusters that are highly connected to the cosmic web tend to grow faster, and these fast accretion flows must disturb their mass distribution, hence increase their ellipticity.

Effect of the dynamical state on group anisotropies
To proceed in probing possible correlations between properties of groups and clusters and their environment, we investigated the effect of the dynamical state at z = 0. The dynamical state is quantified by the relaxation level, relaxedness, using the three proxies defined in Sect. 2.2: the center offset, the virial ratio, and the fraction of substructure. Figure 6 shows the mean relaxedness χ DS as a function of mass for three different ellipticity bins (right panel) and three different connectivity bins (left panel). The relation between relaxation and mass is displayed in the left panel of Fig. 6 for all objects (independently of their ellipticity and connectivity). As expected, the level of relaxation decreases with mass, such that massive structures are less relaxed on average than low-mass structures (see also Kuchner et al. 2020). The fact that the halo mass drives the dynamical state is indeed rather well established in theory based on large N-body simulation (see, e.g., Power et al. 2012). This can be explained by the fact that high-mass halos tend to form later and are still in formation phases (Giocoli et al. 2012). In our study, we focus on a correlation in addition to the mass-driven effect.
In addition to this mass-relaxedness relation, we found that the large scatter in relaxedness can be attributed to the different shapes and connectivities that characterize groups and clusters. The left panel of Fig. 6 shows that elliptical structures are less relaxed than spherical structures in all mass bins. Table 1 shows that the high value of the correlation coefficient between ellipticity and relaxedness confirms that the shape is a good tracer of the dynamical state of clusters.
The right panel of Fig. 6 displays the relaxedness-mass relation for different connectivity values. The correlation coefficient ρ sp (κ, χ DS ) = 0.13 indicates a weak anticorrelation between relaxedness and connectivity. This value tends to increase when low-mass halos are excluded (see Table 1). At fixed mass, the right panel of Fig. 6 shows that weakly connected groups and clusters are on average more relaxed than highly connected groups and clusters in all mass bins. This result argues in fa- vor of a large-scale environmental dependence on the dynamical properties of groups and clusters. Another way to explore the link between the dynamical state and anisotropy proxies is to separately consider the ellipticityand connectivity-mass relations for relaxed and unrelaxed clusters, as presented in the panels of Fig. 7. As discussed in Sect 2.2, groups and clusters are considered as relaxed if the relaxnedness condition χ DS ≥ 1 is fulfilled. The left panel of Fig. 7 shows that relaxed structures are more spherical on average than unrelaxed structurse in each mass bin. This agrees with the result of Suto et al. (2016), who found that halos populated by massive substructures are systematically less spherical than single halos. The right panel of Fig. 7 highlights the fact that unrelaxed groups and clusters are also more strongly connected to the cosmic web (i.e., with a higher value of connectivity) than relaxed groups and clusters. This result is significant for each mass bin. It consequently shows that regardless of the mass, the connectivity and ellipticity tend to trace different dynamical states of groups and clusters.
Finally, we conclude that in addition to the mass effect on halo relaxation, internal and external indicators of anisotropy trace the dynamical state. Regardless of the mass, dynamically unrelaxed groups and clusters are more strongly connected to the cosmic web on average and are more elliptical than the relaxed groups and clusters. This second result, in addition to our previous finding on the effect of cosmic filament accretion on shapes, suggests that highly connected systems are strongly accreting matter, which in turn perturbs their matter distribution, and thus affects both their dynamical state and shape.

Effect of mass growth history on anisotropy
We found that both ellipticity and connectivity trace the dynamical state and the recent growth of groups and clusters. We now explore further whether these relations of anisotropy proxies and halo dynamics are the result of different growth histories. Previous studies have postulated that dynamical states of halos can be attributed to their mass-assembly history (MAH) (see, e.g., Power et al. 2012;Mostoghiu et al. 2019). Therefore we expect that the MAH also affects the anisotropy of the density field at z = 0. We considered two quantities to describe the MAH of groups and clusters: the continuous mass accretion rate Γ 200m (z = 0.5), and the formation redshift z form , as defined in Sect. 2.3.
In Fig. 8 we plot the probability distribution function of the mass accretion rate Γ 200m (z = 0.5) (left panel) and the formation redshift z form (right panel) for relaxed and unrelaxed groups and clusters separately. We clearly observe that relaxed and unrelaxed structures are two different populations with different distributions of formation time and accretion rate. In agreement with Power et al. (2012), we find that young objects are more likely to be dynamically unrelaxed than their older counterparts (in the right panel). Moreover, the left panel illustrates the fact that relaxed structures are on average in a slower accretion phase than unrelaxed structures.
In order to select groups and clusters according to their MAH, we display in Fig. 9 the distribution of formation redshift as a function of the continuous mass accretion rate for unrelaxed (left panel) and relaxed structures (right panel). Regardless of the dynamical state, we observe that z form and Γ 200m are strongly correlated: Recently formed groups and clusters are in a faster accretion phase than early formed groups and structures. This relation of the formation time and accretion rate is caused by their definition; both are computed from the halo mass growth M 200m (t) as defined in Sect 2.3. These two MAH proxies are in principle related through the functional form proposed in Wechsler et al. (2002) such that M 200 (z) = M 200 (z = 0) exp(−αz) with α parametrizing the mass accretion rate of the halo. Our two MAH proxies, formation time and accretion rate, are assumed to account for only ∼ 70% of the scatter in mass accretion histories because of the stochastic effect of major mergers (as discussed by Wong & Taylor 2012;Chen et al. 2020). This explains the degeneracy in the formation time -accretion rate relation that is plotted in Fig. 9.  main evolutionary-dynamical populations. We highlight these populations by considering cuts in the tails of mass accretion and formation time distributions, as illustrated in Fig. 10. Relaxed objects are formed long time ago and they are slowly accreting matter in their recent history. We also show unrelaxed halos that are also early-formed and low-accreting. The third population is constituted of late-formed unrelaxed halos that are in fast accretion phase. A small number of relaxed structures are formed late and accrete fast, but because they are rare, we did not consider them here.
Focusing on these three evolutionary-dynamical populations of groups and clusters, we explore their anisotropy proxies in Fig. 10. These populations are characterized by different anisotropies, that is, ellipticity and connectivity of groups and clusters, regardless of their mass. First, old and relaxed halos are rather spherical and weakly connected to their environment. These groups might have formed early enough to relax and thus lose memory of the directions of the accretion and mergers they experienced. Second, the population of the early-formed but still unrelaxed groups and clusters at the present time is characterized by intermediate connectivity and ellipticity values. This old unrelaxed sample of groups might be still in a transition phase, that is, the halos did not have enough time to relax. They could be post-merger, that is, the result of merging systems that have not completely achieved their merger at the present time. Finally, the late-formed unrelaxed sample of clusters has significantly more anisotropic shapes, with a higher ellipticity value, and is highly connected to the large-scale cosmic web. These groups and clusters must typically be in formation phase and be strongly affected by the infalling material through connected filaments. These young unrelaxed structures might be merging or recent post-merging systems. Fast mass growth is dominated by major mergers (as detailed in (Vallés-Pérez et al. 2020)). Moreover, as suggested by Darragh-Ford et al. (2019), groups with the highest connectivities have encountered a major merger more recently than structures with lower connectivity. In agreement with these interpretations, previous studies have shown that unrelaxed halos tend to be the result of one or more recent significant mergers (see, e.g., Hetznecker & Burkert 2006;D'Onghia & Navarro 2007;Power et al. 2012;Klypin et al. 2016). We conclude that regardless of the mass, systems still in formation phase (recently formed and in a high-accretion phase) are significantly more strongly connected to the cosmic web and have more disturbed and elliptical shapes on average than early-formed relaxed systems.

Discussion
Halo growth is commonly explored through the evolution of the halo density profile. Recently, Mostoghiu et al. (2019) have studied the density profiles of simulated clusters as a function of their mass-assembly history. They found that early-formed relaxed clusters have entered a slow-accretion phase, therefore their mass growth mostly occurs in their outskirts. In contrast, the authors showed that late-formed unrelaxed clusters are in their fast-accretion phase and their central regions are still growing. These results complement our analysis of the overall picture of cluster evolution well and show that young unrelaxed clusters are still growing in their center and thus appear nonspherical in our study, whereas old relaxed clusters are more spherical because their centers no longer grow.
In addition, it is important to recall that both the evolutionary and the dynamical states of groups and clusters are most of all driven by their masses. The fraction of objects that are recently formed and/or are unrelaxed increases drastically with mass. This is the direct consequence of the hierarchical structure formation scenario in which most of the massive systems are still in formation phase because of their high accretion and recent merger activities (as detailed in Power et al. 2012;Giocoli et al. 2012, e.g.). Therefore this hierarchical mass assembly model explains the main effect of the mass in shaping the density field of group and cluster environments. We found that the ellipticity and connectivity are higher for massive halos because they are mostly recently formed systems (also discussed in Despali et al. 2014, for the ellipticity). Thus, our work tends to indicate that the mass assembly bias is indeed directly related to the intrinsic anisotropic nature of the density field imposed by the cosmic web. In agreement with Musso et al. (2018), our results suggest that older halos with lower mass preferentially lie inside filaments or low-connected structures, while more massive and younger halos are located in the highly connected nodes. In addition to the trend governed by the mass assembly, we showed the additional contribution of the halo accretion history to the halo anisotropies.
Finally, it is important to keep in mind that our results and discussions of the shape and connectivity of groups and clusters are theoretical predictions based on cosmological simulations. In observations, the measurement of group and cluster ellipticities remains uncertain given observational limitations (projection effects, resolution, signal-to-noise ratio, etc.). It is hence difficult to compare measured morphological indicators from different observables (X-ray, Sunyaev-Zeldovich effect, galaxy distribution, or lensing) with each other and with theoretical predictions. Gravitational lensing provides a unique technique for constraining the ellipticity of the total matter distribution that is directly comparable with theoretical predictions. Measuring the mean projected halo ellipticity from two-dimensional lensing shear maps, Oguri et al. (2010) reported the measurement of the ellipticity of ∼ 20 clusters and found an excellent agreement with theoretical predictions (see also Evans & Bridle 2009;Clampitt & Jain 2016, and citations within). Recently, Gonzalez et al. (2021) measured the shape of the projected surface mass density distribution of redMaPPer galaxy clusters (Rykoff et al. 2016) using a weak-lensing stacking technique, but did not find the expected mass-ellipticity relation from simulations. The authors discussed the possibility that the effects introduced by the contribution of the surrounding halos on the line of sight might induce an underestimation of the ellipticity, which mainly affects the high-mass halos. To the best of our knowledge, other cluster ellipticity measurements based on observations, such as using galaxy members (Shin et al. 2018), do not succeed in finding significant observational evidence that more massive clusters are more elliptical at the present time.
Regarding the relation between the dynamical state and the shape of clusters, Bartalucci et al. (2019) used the sparsity as a morphology proxy to recently highlight evidence that the shape of the total mass profile in massive clusters is governed by their dynamical state. In addition, Yuan & Han (2020) probed the dynamical state for 964 galaxy clusters from Chandra X-ray images and reported strong correlations of the X-ray morphology index and optical dynamical relaxation factor (see also Rossetti et al. 2016). Nevertheless, it is important to note that the observational results based on both X-ray and Sunyaev-Zeldovich effect (SZ) only probe the intracluster medium of groups and clusters and mainly focus on the cluster core (< R 500 ). Moreover, given the collisional nature of the gaseous component of clusters, the gas mass distribution (and hence its X-ray surface brightness and the Compton y-parameter) is significantly more circular than the stellar and dark matter counterparts (as predicted by Okabe et al. 2018;Harvey et al. 2021, using hydrodynamical simulations). Moreover, simulations show that the shapes of different cluster-component distributions (stars, gas, and dark matter) qualitatively follow similar trends with halo mass, radius, and redshift (Velliscig et al. 2015;Okabe et al. 2018). Donahue et al. (2016) have confirmed this strong correlation of the morphological properties measured from X-ray (for the gas) and lensing maps (for the total mass) for ∼ 20 CLASH galaxy clusters. In order to reach consensus about the classification of clusters in simulations and observations, De Luca et al. (2020) explored the correlations of morphology indicators and dynamical state proxies extracted from both simulated clusters and their X-ray and Compton y-parameter mock images. The authors concluded that the offset parameters based on the centroids of X-ray and SZ maps are more sensitive to the dynamical state than to peak position offsets.
By exploring the connection of clusters and their large-scale environment in observations, the theoretical expectation that     more massive halos are more strongly connected to the cosmic web has been confirmed from large galaxy surveys (see, e.g., Darragh-Ford et al. 2019;Kraljic et al. 2020). Concerning the relation of halo environments and their dynamical state, no observational studies have statistically explored the relation of the cluster dynamical state and their connectivity so far. Only two peculiar galaxy clusters for which the connectivity and dynamical state have been individually estimated from observations can be used to illustrate our findings. First, Einasto et al. (2015Einasto et al. ( , 2018bEinasto et al. ( ,a, 2020 showed that the A2142 cluster is dynamically unrelaxed with many massive substructures that are highly connected to its large-scale environment and with an elongated shape (see also Rossetti et al. 2013, for the perturbed dynamics of A2142). The mass of the A2142 cluster is estimated to be M 200 = 1.3 × 10 15 M (Munari et al. 2014) and is connected to approximately six or seven filaments . Second, the well-studied Coma cluster (see Biviano 1998, for a review) is weakly connected to other structures in the field (Mahajan et al. 2018) with a connectivity estimated between 3 and 4, as measured by Malavasi et al. (2020). The Coma cluster seems to be in a low-accretion phase at the present time, with a mass growth of around 1/5 since z ∼ 0.2 − 0.3 (Adami et al. 2005). However, the dynamical state of the Coma cluster is not completely established. While initially, it was classified as a relaxed system (Kent & Gunn 1982) with a very high concentration parameter suggesting a compact and old object (Łokas & Mamon 2003), other observational evidence has argued in favor of a dynamically unrelaxed state: two BCGs (Fitchett & Webster 1987), no cool core (Neumann et al. 2003), and its radio halo emission (Thierbach et al. 2003). In addition, Gavazzi et al. (2009) estimated that the mass of the Coma cluster is equal to M 200 = 5.3 × 10 14 M . The two observational measurements of the connectivity κ and mass of A2142 and the Coma cluster are plotted in Fig. 11. Even though we did not statistically probe this very high mass range, the Coma cluster shows the connectivitymass relation of an early-formed halo well (both relaxed and unrelaxed), while the A2142 cluster appears to follow the relation of late-formed unrelaxed halos that are still in the formation phase.

Conclusion
It is crucial to study the anisotropic matter distribution inside and around density peaks to understand the formation and growth of massive structures. We have studied two proxies of the anisotropic matter distribution around halos: the shape (through the ellipticity), and the filamentary structure around them (through the connectivity). We probed these anisotropies for a large sample of galaxy groups and clusters with masses > 1 × 10 13 M /h in the IllustrisTNG hydrodynamical simulation at z = 0 (Nelson et al. 2019). The halo shape was approximated by a triaxial ellipsoid that encloses M 200 and was quantified by the ellipticity parameter, following the definition of Suto et al. (2016).
In the outskirts of groups and clusters, the anisotropic matter distribution was estimated by quantifying the number of cosmic filaments connected to halos, that is, the local connectivity. The filamentary structure detection algorithm T-ReX (Bonnaire et al. 2020) was used to trace the cosmic web skeleton from the galaxy distribution in the simulation box. We then computed the connectivity by counting the number of filaments that are connected to a given halo within a sphere of 1.5 × R 200 .
We confirm that the halo mass is strongly related to the anisotropies in the density field. Namely, massive groups and clusters are on average significantly more elliptical (Allgood et al. 2006) and more strongly connected to the cosmic web (Codis et al. 2018) than low-mass groups and clusters. In additiont to the mass-driven effect, we explored additional correlations between connectivity and ellipticity, and the dynamical state and assembly history of groups and clusters of galaxies. Our major findings are summarized below.
(1) In addition to the mass-driven effect, ellipticity and connectivity are correlated, such that highly connected groups and clusters tend to be more elliptical than weakly connected groups and clusters.
(2) The growth rate of groups and clusters is strongly correlated with the ellipticity and connectivity: Fast-accreting objects are on average more elliptical and more strongly connected to the cosmic web than low-accreting objects. This indicates that strongly connected objects are more elliptical because they accrete matter more rapidly, which in turn must disturb the associated matter distribution. Our results also indicate that the accretion rate scales with the connectivity such that at fixed mass, halos in nodes have a higher accretion rate than halos in filaments (in agreement with the theoretical investigations of Musso et al. 2018). (3) Both anisotropy proxies trace the dynamical state of halos: Quasi-spherical and weakly connected groups and clusters are strongly relaxed. In contrast, groups and clusters that are dynamically unrelaxed are on average significantly more elliptical and more connected. This trend holds for all mass bins. The large scatter in the well-known relaxedness-mass relation can indeed be attributed to the different anisotropic level in the density field around groups and clusters. (4) We postulate that the relation between dynamical state and anisotropy proxies can be attributed to the different massassembly histories of halos. Relaxed and unrelaxed groups and clusters are two distinct populations. The dynamically unrelaxed gropus and clusters formed more recently on avearage and are in a faster accreting phase than relaxed ha-los. Our comprehensive analysis of the halo accretion history and dynamical state showed that there are mainly two distinct populations: the early-formed slowly accreting relaxed halo sample, and the late-formed fast-accreting unrelaxed halos. These two types of evolutionary-dynamical states of halos present different anisotropies in their density field. Old relaxed groups and clusters acrrete matter slowly, are almost spherical, and have a weak connection to their environment. They should have lost their connection with their preferential directions of accretion and merging. In contrast, young fast-accreting and unrelaxed groups and clusters are much more elliptical and strongly connected to the overall cosmic web. This population must be in formation phase and strongly affected by the environment that feeds them abundantly. The two populations defined according to their evolutionary-dnymical state are significantly different in all mass bins, even if the fraction of recently formed objects increases with mass, in agreement with the hierarchical structure formation scenario.
With this first comprehensive analysis, we open new ways for relating the growth, dynamical state, and the shape of groups and clusters with their connection to the large-scale structure. Our results show that different recent accretion histories lead to different anisotropies in the matter distribution (with both distinct ellipticity and connectivity) as a second driving effect after the well-known mass effect. Our analyses show that the correlation between connectivity and halo properties is more significant for higher-mass clusters, given that low-mass groups are mainly located inside cosmic filaments (Cautun et al. 2014). We conclude that to significantly detect correlations of halo connectivity and halo properties, we need to focus on clusters with masses M 200 > 10 13.5 M /h. By probing a larger sample of simulated clusters (M 200 > 10 14 M /h), which are ideal structures for probing a wider range of connectivities, we intend to further explore the cosmic time evolution in the relations of the large-scale environment and cluster properties in a future work.
From the observational point of view, the A2142 and Coma clusters both provide illustrations of two distinct cluster connectivities that might be the result of different mass-assembly histories. The new generation of large galaxy and cluster surveys, such as Euclid and Dark Energy Survey, will enable us to probe many massive clusters and to investigate the effect of large-scale structure connections on the dynamical properties of the halos. In addition, upcoming accurate multiwavelength observations of galaxy clusters such as the Cluster HEritage project (The CHEX-MATE Collaboration et al. 2020) will allow us to probe the dynamical properties of clusters and their matter distributions from their central regions to their outskirts. They wil thus be used to test our theoretical predictions.