Exploiting symmetry in network analysis

Virtually all network analyses involve structural measures between pairs of vertices, or of the vertices themselves, and the large amount of symmetry present in real-world complex networks is inherited by such measures. This has practical consequences that have not yet been explored in full generality, nor systematically exploited by network practitioners. Here we study the effect of network symmetry on arbitrary network measures, and show how this can be exploited in practice in a number of ways, from redundancy compression, to computational reduction. We also uncover the spectral signatures of symmetry for an arbitrary network measure such as the graph Laplacian. Computing network symmetries is very efficient in practice, and we test real-world examples up to several million nodes. Since network models are ubiquitous in the Applied Sciences, and typically contain a large degree of structural redundancy, our results are not only significant, but widely applicable. Many real-world networks present structural symmetries that, while typically increasing robustness, deeply influence structural and dynamical properties. Here, the author studies the effect of symmetries on network measures and how they can be exploited to increase computational efficiency.

the adjacency matrix of the network.If a network (mathematically, a finite simple graph) G has n vertices, labelled 1 to n, its adjacency matrix A = (a ij ) is an n × n matrix with (i, j)-entry a ij = 1 if there is an edge between nodes i and j, and zero otherwise.A graph automorphism σ is then a permutation, or relabelling, of the vertices v ↦ σ(v) such that (σ(i), σ(j)) is an edge only if (i, j) is an edge, or, equivalently, a ij = a σ(i)σ(j) for all i, j.In matrix terms, this can be written as where P is the permutation matrix corresponding to σ, that is, the matrix with (i, j)-entry 1 if σ(i) = j, and 0 otherwise.The automorphisms of a graph form a mathematical structure called a group, the automorphism group of G.In principle, any (finite) group G is the automorphism group of some graph G 32 , but, in practice, real-world networks exhibit very specific types of symmetries generated at some small subgraphs called symmetric motifs 11 .Namely, we can partition the vertex set V into the asymmetric core of fixed points V 0 (an automorphism σ moves a vertex i ∈ V if σ(i) ≠ i, and fixes it otherwise), and the vertex sets M i of the symmetric motifs, as shown in Fig. 1a for a toy example.Equation ( 2) is called the geometric decomposition of the network 11 .
Real-world networks typically exhibit a core of fixed points (asymmetric core), and a large number of relatively small symmetric motifs, where all the network symmetry is generated, and hence the size of the automorphism group is often extremely large, in stark contrast to random graphs, typically asymmetric 38 .Fig. 1 Toy example of a symmetric network.a Decomposition into asymmetric core (white nodes) and seven symmetric motifs M 1 to M 7 .Each motif can be decomposed into one or more orbits (shown by colour) of structurally indistinguishable nodes.Motifs M 1 to M 6 are basic: one or more orbits of the same size, and every permutation of the vertices in an orbit can be extended to a network automorphism.Motif M 7 , a tree, is not basic: in the orbit of yellow vertices, labelled 1 to 4 (top to bottom), the permutation sending 1 to 3 must move 2 to 4 (as 1 and 2 share a common neighbour).A vertex measure (here subgraph centrality 36 shown on M 1 ) is constant on orbits.Inset: a pairwise measure (here communicability 37 shown near M 1 ) inherits all the network symmetries.b Quotient network (no loops, edge directions, or weights shown) consisting on one vertex per fixed point (white node) and per orbit (coloured node).
However, each symmetry is the product (composition) of automorphisms permuting a very small number of vertices within a symmetric motif.For example, the toy graph in Fig. 1a has 2 7 × 3! × 4! = 18, 432 symmetries (size of the automorphism group) but they generated by (all combinations of) just ten permutations, each permuting a few vertices within a symmetric motif (one permutation per motif except two for M 4 , M 5 , and M 7 ).
Each symmetric motif can be further subdivided into orbits of structurally indistinguishable nodes (shown by colour in Fig. 1a), which play the same structural role in the network and, therefore, contribute to network redundancy and thus to the robustness of the underlying system.Our notion of structurally indistinguishable nodes (nodes in the same orbit of the automorphism group) extends the notion of structurally equivalent nodes found in the social sciences 39 , that is, nodes with the same set of neighbours.It is not equivalent: nodes in the same orbit may not have the same neighbours (e.g., M 1 , M 6 , or M 7 in Fig. 1a).
Network symmetries of (possibly very large) real-world networks can be effectively computed, stored and manipulated (see "Methods").For instance, we computed generators of the automorphism group, and the subsequent geometric decomposition, for real-world networks up to several million nodes and edges in a few seconds (see t 1 and t 2 in Table 1).
Most symmetric motifs in real-world networks (typically over 90%, see the bsm column in Table 1) are of a very specific type, called basic 11 : they are made of one or more orbits of the same size, and every permutation of the vertices in each orbit is realisable, that is, can be extended to a network automorphism (see Fig. 1a).Basic symmetric motifs (BSMs) have a very constrained structure 13 , which we will generalise to arbitrary network measures and exploit throughout this article.Non-basic symmetric motifs (typically branched trees, as M 7 in Fig. 1a) are called complex; they are rare and can either be studied on a caseby-case basis, or removed from the symmetry computation altogether (by ignoring the symmetries generated by them).
The definition of network automorphism Eq. ( 1) carries to an arbitrary n × n real matrix A = (a ij ).Any such matrix can be seen as the adjacency matrix of a network with n vertices labelled 1 to n, and an edge (link) from node i to node j with weight a ij if a ij ≠ 0, and no such edge if a ij = 0.This means that an automorphism does not only preserve edges, but also their weights and directions.This may not be a realistic assumption for realworld weighted networks, where the weights often come from observational or experimental data, but it applies to the matrix representing a network structural measure, as we illustrate in Fig. 2 and explain next.
Structural network measures.A (pairwise) structural network measure is a function F(i, j) on pairs of vertices which satisfies FðσðiÞ; σðjÞÞ ¼ Fði; jÞ for all i; j 2 V ð3Þ for all automorphisms σ 2 Aut ðGÞ.Since automorphisms identify structurally indistinguishable vertices (i and σ(i)) and, similarly, edges ((i, j) and (σ(i), σ(j))), structural network measures are (edge) functions that depend on the network structure alone, and not, for example, on node or edge labels, or other meta-data.Most network measures are structural, including graph metrics (e.g., shortest path), and matrices algebraically derived from the adjacency matrix (e.g., Laplacian matrix).(We identify matrices M with pairwise measures via F(i, j) = [M] ij .)In particular, structural measures are independent of the ordering or labelling of the vertices.In contrast, functions depending, explicitly or implicitly, on some vertex ordering or labelling, are not structural, for example the shortest path length through a given node.We can encode a structural measure F as a network with adjacency matrix [F(A)] ij = F(i, j) (see Fig. 2a for the adjacency matrix and Fig. 2b, c for two examples of structural measures), and write (3) in matrix form as FðAÞ P ¼ P FðAÞ; ð4Þ ), all for the largest connected component.The proportion of vertices in the basic quotient (e n Q basic , not shown) is within 1% of e n G except for HumanDisease (e n Q basic ¼ 52:2%), OpenFlights (79.7%),USPowerGrid (91.6%) and WordNet (79.2%), and similar results hold for e m Q basic .Data sets available at ref. 40 , except HumanDisease 41 , Yeast 42 , and HumanPPI 43 .Computations on a desktop computer (3.2 GHz Intel Core i5 processor, 16 GB 1.6 GHz DDR3 memory).All networks are symmetric, although the amount of symmetry (as measured by mv or e n Q ) ranges from several networks with 50% quotient reduction, to CalifornialRoads with only 4% of vertices participating in any symmetry.However, the effect of compression and computational reduction multiplies as, e.g., c full ¼ e n where P is the permutation matrix corresponding to σ.
Comparing this to Eq. ( 1), we see that the network representation of F, FðGÞ, with adjacency matrix F(A), inherits all the symmetries of G.In particular, the network FðGÞ has the same decomposition into symmetric motifs Eq. ( 2), and orbits, as G.
The BSMs in FðGÞ must occur on the same vertices M i , although they are now all-to-all weighted subgraphs in general (Fig. 2b).Nevertheless, they have a very constrained structure: the intra and inter orbit connectivity depends on two parameters only.Namely, each orbit in a BSM is uniquely determined by β = F(v i , v i ) (the connectivity of a vertex with itself) and α = F(v i , v j ), i ≠ j (the connectivity of a vertex with every other vertex in the orbit), for all v i , v j in the orbit.Similarly, the connectivity between two orbits Δ 1 and Δ 2 in the same BSM also depends on two parameters: after a suitable reordering Δ 1 = {v 1 , …, v n } and Δ 2 = {w 1 , …, w n }, we have δ = F(v i , w i ) and γ = F(v i , w j ) for all 1 ≤ i, j ≤ n. (For a proof, see Theorem 1 in "Methods.")This can be observed in Fig. 2c and is represented schematically in Fig. 3a, b.In particular, each BSM takes a very constrained form in the quotient, as shown schematically in Fig. 3c, d.The results in this article apply to arbitrary structural measures, although the two most common cases in practice are the following.We call F full if F(i, j) ≠ 0 for all i ≠ j ∈ V (e.g., a graph metric), and sparse if F(i, j) = 0 if a ij = 0, for all i ≠ j ∈ V (e.g., the graph Laplacian).The graph representation of FðGÞ is an all-toall weighted graph if F is full, and has a sparsity similar to G if F is sparse (cf.Fig. 2c).
From now on, we will assume that G is undirected and F is symmetric, F(i, j) = F(j, i), which may not be the case even if G is undirected (e.g., the transition probability of a random walker Fði; jÞ ¼ a ij deg ðiÞ ), and discuss directed networks and asymmetric measures in the "Methods" section.
Quotient network.The formal procedure to quantify and eliminate structural redundancies in a network is via its quotient network.This is the graph with one vertex per orbit or fixed point (see Fig. 1b) and edges representing average connectivity.Formally, if A is the n × n adjacency matrix of a graph G, the quotient network with respect to a partition of the vertex set the average connectivity from a vertex in V k to all vertices in V l .
There is an explicit matrix equation for the quotient.Consider the n × m characteristic matrix S of the partition, that is, [S] ik = 1 if i ∈ V k , and zero otherwise, and the diagonal matrix The quotient network is a directed and weighted network in general.An alternative is to use the symmetric quotient, with adjacency matrix Q sym (A) = Λ −1/2 S T A SΛ −1/2 , which is weighted but undirected.Note that Q(A) and Q sym (A) are spectrally equivalent matrices: they have the same eigenvalues, with eigenvectors related by the transformation v ↦ Λ 1/2 w.
In the context of symmetries, we will always refer to the quotient with respect to the partition of the vertex set into orbits.This quotient removes all the original symmetries from the network: if σ(v i ) = v j , then v i and v j are in the same orbit and hence represented by the same vertex in the quotient network, which is then fixed by σ.We can, therefore, infer and quantify properties arising from redundancy alone by comparing a network to its quotient.The quotients of real-world networks are often significantly smaller (in vertex and edge size) than the original networks 11,12 (see e n Q and e m Q in Table 1), and this reduction quantifies the structural redundancy present in an empirical network.Not every real-world network is equally symmetric, and, in our test networks, we give examples of network quotient reductions ranging from about 50% to just 2%.Computing the network quotient involves multiplication by very sparse matrices (Λ is diagonal and S has one non-zero element per row) and hence is computationally efficient (a few seconds in all our test networks).1) and its adjacency matrix.Network and matrix representation of two structural (full, respectively sparse) network measures, b the exponential matrix (a measure of vertex communicability 37 ), and c the graph Laplacian.In each case, the vertices are numbered 1 to 5 and coloured by orbit, and a non-zero (i, j)-entry in the matrix corresponds to the edge weight between vertices i and j.Note that the network automorphism swapping vertices 1 and 2, and 3 and 4, preserves the network and matrix structure in all three cases.In general, any symmetry of a network is also a symmetry of the network representation of any structural network measure.Fig. 3 Structure of a basic symmetry motif (BSM) for an arbitrary network measure F. a Every orbit in a BSM is an (α, β)-uniform graphK α;β n , the graph with n vertices and adjacency matrix A = (a ij ) with a ij = α = F(i, j) if i ≠ j and a ii = β = F(i, i) for some constants α and β.Here, we show an example of one orbit with four nodes and edges labelled by their weights.b The connectivity between two orbits Δ 1 and Δ 2 in the same BSM (after a suitable relabelling ) is given by γ = F (v i , w j ) for i ≠ j, and δ = F(v i , w i ), the (δ, γ)-uniform join of the two orbits.Here we show an example of two orbits (shown by colour) with three vertices each and edges labelled by their weights.c In the quotient, the BSM orbit becomes a single vertex with a self-loop weighted by (n − 1)α + β, and d the two orbits are joined by an edge weighted by (n − 1)γ + δ.Here, we show the quotients (c) and d of the previous BSMs (a) and b, respectively.Note that, by annotating each orbit in the quotient by n and α (or β), and each intra-motif edge by γ (or δ), we can recover each BSM from such annotated quotient.
Redundancy in network measures.The amount structural redundancy on a network (measured by e n Q ¼ n G =n Q ) is amplified in the computation of a typical (full) network measure (see Eq. ( 7) below).It is therefore natural to ask how to quantify, and eliminate, the symmetry-induced redundancy.If a network has n G vertices and n Q orbits, there are n 2 G pairs of vertices but only n 2 Q pairs of orbits, achieving a reduction, or compression ratio, of for a full network measure, typically much smaller than the ratio e n Q ¼ n G =n Q .On the other hand, for a sparse network measure, we only need to consider edge values, hence the reduction is the ratio between the number of edges in the graph and in its quotient For an arbitrary network measure, its compression ratio, which measures the redundancy present (zero values excluded), will range between c full and c sparse .The compression ratios c full and c sparse ¼ e m Q are shown on Table 1 for our test networks.We found a remarkable amount of redundancy (up to 70%) due to symmetry alone (Fig. 4).

Symmetry compression.
A natural question, with practical consequences for network analysis, is whether we can easily "eliminate" the symmetry-induced redundancies.This means storing only one value of a network function for each orbit of structurally indistinguishable nodes or edges, all sharing the same such value.Although this has been explored in particular cases, such as shortest path distances 27 , here we present a general treatment.A simple method is to use the quotient matrix which is easier to store than Λ −1 S T AS.This matrix achieves a compression ratio between c full and c sparse (by using a sparse representation of B), as explained before.From this matrix, we can recover all but the internal connectivity inside a symmetric motif, which is replaced by the average connectivity.Namely, let us define where n i , respectively, n j , is the size of the orbit containing v i , respectively, v j (note that these orbit sizes can be obtained as the row sums of the characteristic matrix S).Then one can show ("Methods", Theorem 2) that a ij ¼ a ij if v i and v j are external; a kl if v i and v j are internal; (
The vast majority of edges in the network representation of a network measure are external (at least 99.999% for a full measure in our test networks, see int f in Table 1), and hence the information loss by using A avg instead of A is minimal.We can nevertheless enforce lossless compression, by storing the intramotif connectivity separately.Indeed, we can exploit the fact that most symmetric motifs in empirical networks are basic, and hence each orbit, or pair of orbits, is uniquely determined by two parameters (Fig. 3).If we disregard the symmetries generated at non-basic symmetric motifs, the corresponding quotient, called basic quotient, written Q basic , leaves non-basic motifs unchanged and retains most of the symmetry in a typical real-world network.
Fig. 4 Redundancy in some real-world networks.Amount of symmetry present on a typical (full) network measure for our test networks (Table 1).The predicted values, c full ¼ n G =n Q À Á 2 coincide (up to 0.01%) with the compression ratio (shown as "actual") obtained by our lossless compression algorithm for the shortest path distance, and communicability (exponential matrix), for our smallest seven networks (memory limit in our computer).After decompression, we recover the original matrix exactly for the shortest path distance, and up to a small numerical error (1.16 × 10 −4 mean relative error) for communicability.
By annotating this quotient, we can recover the original network representation of the network measure exactly.We have implemented lossless compression and decompression algorithms ("Methods", Algorithms 6 and 7), and evaluated them in our test networks (Fig. 4).
Computational reduction.Network symmetries can also reduce the computational time of evaluating an arbitrary network measure F. By Eq. ( 3), we only need to evaluate F on orbits, resulting in a computational reduction ratio of between e m Q and e n 2 Q (Table 1) for sparse, respectively full, network measures.Of course, this assumes that the computation on each pair of vertices F(i, j) is independent of one another, which is often not the case.Moreover, the calculation of F(i, j) is still performed on the whole network G.
A more substantial computational reduction can be obtained by evaluating F on the (often much smaller) quotient network instead.We call F quotient recoverable if it can be applied to the quotient network Q, and FðGÞ can be recovered from FðQÞ, for all networks G.Note that this may involve, beyond evaluating FðQÞ, an independent (hence parallelizable) computation on each symmetric motif (typically a very small graph).By evaluating F in the quotient network, we can obtain very substantial computational time savings, depending on the amount of symmetry present and the computational complexity of F. Depending on the network measure, it may not be possible to recover FðGÞ exactly from FðQÞ, but only partially.We call a network measure F partially quotient recoverable if it can be applied to a quotient network Q of a network G, and all the external edges of FðGÞ can be recovered from FðQÞ, for all networks G. Since the quotient averages the network connectivity, we can often recover the average values of F within symmetric motifs.We call F average quotient recoverable if, in addition to external edges, the average intra-motif edges can be recovered from FðQÞ.A typical situation is when FðQÞ equals the quotient of F, that is, in symbols, In the "Applications" section, we will show that communicability is average quotient recoverable, and shortest path distance is partially, but not average, quotient recoverable.Not every measure can be (partially) recovered from the quotient, for example the number of distinct paths between two vertices, as the internal connectivity within each symmetric motif is lost, and replaced by its average connectivity, in the quotient.Note that the word "partially" can be misleading: typically almost all edges are external (see ext s and int f in Table 1).
The resulting computational time reduction obtained by evaluating F in the quotient can be very substantial, as illustrated by several popular network measures in our test networks (Fig. 5).
Spectral signatures of symmetry.The spectrum of the network's adjacency matrix relates to a multitude of structural and dynamical properties 1 .The presence of symmetries is reflected in the spectrum of the network 13 , and indeed in the spectrum of any network measure.Symmetries give rise to high-multiplicity eigenvalues (shown as "peaks" in the spectral density) and, in fact, we can explain and predict most of the discrete part of the spectrum of an arbitrary network measure on a typical real-world network.
Let A be the n × n adjacency matrix of a (possibly weighted) network (such as the network representation of a network measure).First, note that symmetry naturally produces highmultiplicity eigenvalues, since Fig. 5 Quotient computational reduction.Computational time reduction of several structural measures in some of our test networks (Table 1) obtained by performing the calculation in the quotient network versus the original network.The computations are: spectral decomposition of the adjacency matrix A (spectral), exponential matrix exp(A) (commun), pseudoinverse of the Laplacian matrix (laplacian), shortest path distance (distance), closeness centrality (closeness), betweenness centrality (btwness) and eigenvector centrality (eigc), using MATLAB R2018a built-in functions.For spectral, we also show (left column) the reduction, including the (sequential) symmetric motif calculation.In each case, median computational reduction over at least ten iterations shown., and c Laplacian L, represented as weighted networks with weights shown as edge labels (as in Fig. 2).Eigenvector coordinates are separated by orbit, for convenience.In all three cases, there are two redundant, and three non-redundant, eigenpairs (separated here by a horizontal line), whose eigenvectors add up to zero, respectively are constant, on each orbit.Redundant eigenvectors are localised (zero outside the motif) and "survive" in any network where this graph is a symmetric motif.The redundant eigenvalues and eigenvectors agree with those predicted by the formulae in Table 2. Here, where (λ, v) is an eigenpair of A and P the permutation matrix of a network automorphism (Eq.( 1)).This gives another eigenpair (λ, v) whenever v and Pv are linearly independent (obviously not always the case).Let B = Q(A) be the m × m quotient of A (Eq. ( 6)) with respect to the partition of the vertex set into orbits.This partition satisfies a regularity condition called equitability 35 , which can be written in matrix form as AS = SB, where S is the characteristic matrix of the partition.In particular, if (λ, v) is a quotient eigenpair, then (λ, Sv) is a parent eigenpair, In fact, one can show ("Methods", Theorem 3) that A has an eigenbasis of the form where {v 1 , …, v m } is any eigenbasis of B, and S T w j = 0 for all j.We can think of a vector v 2 R m , respectively w 2 R n , as a vector on (the vertices of) the quotient, respectively the parent, network.Then, each vector Sv i equals the vector v i lifted to the parent network by repeating the value on each orbit.Similarly, S T w j = 0 means that the sum of the entries of w j on each orbit is 0. All in all, we can always find an eigenbasis of A consisting of nonredundant eigenvectors {Sv 1 , …, Sv m } arising from a quotient eigenbasis by repeating values on each orbit, and redundant eigenvectors {w 1 , …, w n−m } arising from the network symmetries, which add up to zero on each orbit (hence "dissappering" in the quotient).Similarly, we call their respective eigenvalues redundant and non-redundant.
Analogous to the way that symmetry is generated at symmetric motifs, the redundant eigenvectors and eigenvalues arise directly from certain eigenvectors and eigenvalues of the symmetric motifs, considered as networks on their own (Fig. 6).In fact, each symmetric motif M contributes the same (called redundant) eigenpairs to any network containing M as a symmetric motif: One can show ("Methods", Theorem 4) that if M is a symmetric motif of a network G and (λ, w) is a redundant eigenpair of M (that is, the values of w add up to zero on each orbit of M), then ðλ; e wÞ is an eigenpair of G, where e w is equal to w on (the vertices of) M, and zero elsewhere.We call such a vector e wlocalised on the motif M 13 , as it is zero outside the motif.Moreover, if M has n vertices and k orbits, then it has an eigenbasis consisting of n − k redundant eigenpairs, which are inherited by any network containing M as a symmetric motif (Fig. 6, Theorem 4 in "Methods").
Furthermore, since most symmetric motifs in real-world networks are basic, thus have a very constrained structure (Fig. 3), we can in fact determine the redundant spectrum of BSMs with up to a few orbits, that is, we can predict where the most significant "peaks" in the spectral density of an arbitrary network function will occur.The formulae for the redundant spectra for BSMs of one or two orbits (which covers most BSMs, up to 99% of them in our test networks) is given on Table 2.
We now give more details of the computation of the redundant spectrum of BSMs up to two orbits (Table 2), with full details in the "Methods" section.A BSM with one orbit is an (α, β)-uniform graph K α;β n with adjacency matrix A α;β n ¼ ða ij Þ given by a ij = α and a ii = β for all i ≠ j.Then K α;β n has eigenvalues (n − 1)α + β (non-redundant), with multiplicity 1, and − α + β (redundant), with multiplicity n − 1.The corresponding eigenvectors are 1, the constant vector 1 (non-redundant), and e i , the vectors with nonzero entries 1 at position 1, and − 1 at position i, 2 ≤ i ≤ n (redundant).For unweighted graphs without loops (β = 0, α ∈ {0, 1}), we recover the redundant eigenvalues 0 and − 1 predicted in ref. 13 .
A BSM with two orbits must be a uniform join of the form (Fig. 3).Let κ 1 and κ 2 be the two solutions of the quadratic equation cκ Then, the redundant eigenvalues of this BSM are ("Methods", Theorem 5) each with multiplicity n − 1, with eigenvectors (κ 1 e i |e i ) and (κ 2 e i |e i ), respectively, 2 ≤ i ≤ n.For unweighted graphs without loops, we recover the redundant eigenvalues predicted in ref. 13 , that is, À2; Àφ; À1; 0; φ À 1 and 1; ð18Þ where φ ¼ 1þ ffiffi 5 p 2 , the golden ratio.
Eigendecomposition algorithm.Decoupling the contribution to the network spectrum from the symmetric motifs and from the quotient network, as explained above, naturally leads to an eigendecomposition algorithm that exploits the presence of symmetries: the spectrum and eigenbasis of an undirected network (equivalently, a diagonalisation of its adjacency matrix A = UDU T ) can be obtained from those of the quotient, and of the symmetric motifs, reducing the computational time (cubic on the number of vertices) to up to a third in our test networks (Fig. 5, left column of the spectral case), in line with our predictions (sp ¼ n 3 Q in Table 1).The algorithm is shown and explained below.A MATLAB implementation is available at a public repository 26 .
Our eigendecomposition algorithm (Algorithm 3) applies to any undirected matrix with symmetries (identifying a matrix with the network it represents).It first computes the eigendecomposition of the quotient matrix, then, for each motif, the redundant eigenpairs.Namely, it first computes the spectral decomposition eig of the symmetric quotient B sym = Λ −1/2 S T ASΛ −1/2 , where Λ is the diagonal matrix of the orbit sizes (which can be obtained as the column sums of S).This matrix is symmetric and has the same eigenvalues as the left quotient.Moreover, if B sym ¼ U q D q U À1 q then the left quotient eigenvectors are the columns of ΛU q .These Table 2 Redundant spectra of basic symmetric motifs (BSMs) with one or two orbits.A BSM with one orbit is a uniform graph K α;β n with n vertices and adjacency matrix A α;β n ¼ ða ij Þ, where a ij = α if i ≠ j and a ii = β, for all i, j and some constants α and β.A BSM with two orbits consists of the (γ, δ)-uniform join of two uniform graphs K , that is, the graph with 2n vertices and block adjacency matrix (after a suitable labelling of the vertices) and C ¼ A γ;δ n , each defined as above.We write e i for the vector with non-zero entries 1 at position 1, and − 1 at position i (2 ≤ i ≤ n), κ 1 and κ 2 for the two solutions of the quadratic equation become, in turn, eigenvectors of A by repeating their values on each orbit, and can be obtained mathematically by left multiplying by the characteristic matrix S.Then, for each motif, we compute the redundant eigenpairs using a null space matrix (explained below), storing eigenvalues and localised (zero outside the motif) eigenvectors.
Only redundant eigenvectors of a symmetric motif (that is, those which add up to zero on each orbit) become eigenvectors of A by extending them as zero outside the symmetric motif.Therefore, we need to construct redundant eigenvectors from the ouput of eig on each motif (the spectral decomposition of the corresponding submatrix).If Þ are λ-eigenvectors of a symmetric motif with characteristic matrix of the orbit partition S sm , we need to find linear combinations such that Therefore, if the matrix Z ≠ 0 represents the null space of S T sm U λ , that is, S T sm U λ Z ¼ 0 and Z T Z = 0, then the columns of U λ Z are precisely the redundant eigenvectors.This is implemented in Algorithm 3 within the innermost for loop.
Vertex measures.We have so far considered network measures of the form F(i, j), where i and j are vertices.However, many important network measurements are vertex based, that is, of the form G(i) for each vertex i.We say that a vertex measure G is structural if it only depends on the network structure and, therefore, satisfies for each automorphism σ 2 Aut ðGÞ, that is, it is constant on orbits (Fig. 1).
Although for vertex measures we do not have a network representation, we can still exploit the network symmetries.First, G needs only to be computed/stored once per orbit, resulting on a reduction/compression ratio of e n Q ¼ n Q =n G (Table 1).
Secondly, when quotient recovery holds (that is, we can recover G from its values on the quotient and symmetry information alone), it amounts to a further computational reduction (Fig. 5), depending on the computational complexity of G. Finally, many vertex measures arise nevertheless from a pairwise function, such as G(i) = F(i, i) (subgraph centrality from communicability), or GðiÞ ¼ 1 n P j Fði; jÞ (closeness centrality from shortest path distance), allowing the symmetry-induced results on F to carry over to G.
Applications.We illustrate our methods on several popular pairwise and vertex-based network measures.Although novel and of independent interest, these are example applications: Our methods are general and the reader should be able to adapt our results to the network measure of their interest.
Adjacency matrix: the methods in this paper can be applied to the network itself, that is, to its adjacency matrix.We recover the structural and spectral results in refs. 11,13, and the quotient compression ratio reported in ref. 12 , here c sparse ¼ e m Q in Table 1.The network (adjacency) eigendecomposition can be significantly sped up by exploiting symmetries (Fig. 5).
Communicability: communicability is a very general choice of structural measure, consisting on any analytical function f(x) = ∑a n x n applied to the adjacency matrix, f ðAÞ ¼ P 1 n¼0 a n A n ; and it is a natural measure of network connectivity, since the matrix power A k counts walks of length k 37 .The most common choice of coefficients is a n ¼ 1 n! , which gives the exponential matrix Communicability is a structural network measure and its network representation, the graph f ðGÞ with adjacency matrix f(A), inherits all the symmetries of G and thus it has the same symmetric motifs and orbits.The BSMs are uniform joins of orbits, and each orbit is a uniform graph (Figs. 3 and 2b) characterised by the communicability of a vertex to itself (a natural measure of centrality 36 ), and the communicability between distinct vertices.As a full network measure, the compression ratio c full applies (Table 1), indicating the fraction of storage needed by using the quotient to eliminate redundancies (Fig. 4).Moreover, average quotient recovery holds for communicability since f(Q(A)) = Q(f(A)) (Methods, Theorem 6).Alternatively, we can use the spectral decomposition algorithm on the adjacency matrix (A = UDU T implies f(A) = Uf(D)U T ) reducing the computation, typically cubic on the number of vertices, by sp ¼ e n 3 Q (Table 1 and Fig. 5).For the spectral results, note that f (A) = Uf(D)U T has eigenvalues f(λ), and same eigenvectors, as A. Thus, f ðÀ2Þ; f ðÀφÞ; f ðÀ1Þ; f ð0Þ; f ðφ À 1Þ; and f ð1Þ ð21Þ account for most of the discrete part of the spectrum f(A), for the adjacency matrix A of a typical (undirected, unweighted) realworld network (Eq.( 18)).Shortest path distance: this is the simplest metric on a (connected) network, namely the length of a shortest path between vertices.A path of length n is a sequence (v 1 , v 2 , …, v n+1 ) of distinct vertices, except possibly v 1 = v n+1 , such that v i is connected to v i+1 for all 1 ≤ i ≤ n − 1.The shortest path distance d G ðu; vÞ is the length of the shortest (minimal length) path from , also a path since σ is a bijection.One can show that (i) automorphisms preserve shortest paths and their lengths; (ii) shortest paths between vertices in different symmetric motifs do not contain intra-orbit edges; and (iii) shortest path distance is a partially quotient recoverable structural measure ("Methods", Theorem 7).In particular, automorphisms σ preserve the shortest path metric, dði; jÞ ¼ d σðiÞ; σðjÞ ð Þ , and we can compute shortest distances from the quotient, whenever V i and V j are orbits in different symmetric motifs.This accounts for all but the (small) intra-motif distances and reduces the computation as shown in Fig. 5. Distances between points within the same motif cannot in general be directly recovered from the quotient, not even for BSMs.(Consider for instance the double star, motif M 1 , in Fig. 1: The distance from the top red to the bottom blue vertex is three, while in the quotient is one.)In general, therefore, the shortest path distance is partially, but not average, quotient recoverable.Intra-motif distances, if needed, could still be recovered one motif at a time.
Note that these results can be exploited for other graph-theoretic notions defined in terms of distance, for example eccentricity (and thus radius or diameter), which only depends on maximal distances and thus it can be computed directly in the quotient.
In terms of symmetry compression, the compression ratio c full applies, accounting for the amount of structural redundancy due solely to symmetries.The spectral results, although perhaps less relevant, still apply for dðGÞ, the graph encoding pairwise shortest path distances.The adjacency matrix dðAÞ ¼ ðd G ði; jÞÞ is nonzero outside the diagonal, hence dðGÞ is a all-to-all weighted network without self-loops and integer weights, and so is each symmetric motif.Using the formula in Table 2, we can easily compute values of the most significant part of the discrete spectrum (redundant eigenvalues) of d(A), namely −3, −2, −1, .Laplacian matrix: the Laplacian matrix of a network L = D − A, where D is the diagonal matrix of vertex degrees, is a (sparse) network measure and therefore inherits all the symmetries of the network.The matrix L can be seen as the adjacency matrix of a network L with identical symmetric motifs, except that all edges are weighted by −1 and all vertices have self-loops weighted by their degrees in G (Fig. 2c).In particular, the motif structure (namely, the self-loop weights) depends on the how the motif is embedded in the network G.
Quotient compression and computational reduction are less useful in this case, however the spectral results are more interesting.The spectral decomposition applies, and we can compute redundant Laplacian eigenvalues directly from Table 2, for instance positive integers for BSMs with one orbit ("Methods", Corollary 2).This explains and predicts most of the "peaks" (high-multiplicity eigenvalues) in the Laplacian spectral density, confirmed on our test networks (Fig. 7).Using the formula in Table 2, one can similarly compute the redundant spectrum for 2-orbit BSMs, and for other versions of the Laplacian (e.g., normalised, vertex weighted).Finally, observe that the spectral decomposition applies, thus Algorithm 3 provides an efficient way of computing the Laplacian eigendecomposition with an expected sp ¼ ñ3 Q (see Table 1) computational time reduction.
Commute distance and matrix inversion: the commute distance is the expected time for a random walker to travel between two vertices and back 44 .In contrast to the shortest path distance, it is a global metric, which takes into account all possible paths between two vertices.The commute distance is equal up to a constant (the volume of the network) to the resistance metric r 45 , which can be expressed in terms of L y ¼ ðl y ij Þ, the pseudoinverse (or Moore-Penrose inverse) of the Laplacian, as rði; jÞ ¼ l y ii þ l y jj À 2l y ij .The commute (or resistance) distance is a (full) structural measure, and all our structural and spectral results apply.Crucially, we can use eigendecomposition algorithm to obtain L = UDU T (and hence L † = UD † U T , and r) from the quotient and symmetric motifs, resulting in significant computational gains (Fig. 5).More generally, if M F is the matrix representation of a network measure, its pseudoinverse M y F is also a network measure, and the comments above apply.Note that M y F is generally a full measure even if M F is sparse (the inverse of a sparse matrix is not generally sparse).
Vertex symmetry compression: as a vertex measure G is constant on orbits, we only need to store one value per orbit.Let S be the characteristic matrix of the partition of the vertex set into orbits, and Λ the diagonal matrix of orbit sizes (column sums of S).If G is represented by a vector v = (G(i)) of length n G , we can store one value per orbit by taking w = Λ −1 S T v, a vector of length n Q , and recover v = S T w ("Methods", Theorem 9).
Degree centrality: the degree of a node (in-or out-degree if the network is directed) is a natural measure of vertex centrality.As expected, the degree is preserved by any automorphism σ, which can also be checked directly, as automorphisms permute orbits (so j ∈ V and σ(j) ∈ V are the same elements but in a different order).In particular, the degree is constants on orbits.We recover the degree centrality from the quotient as the out-degree ("Methods", Proposition 2).Closeness centrality: the closeness centrality of a node i in a graph G, cc G ðiÞ, is the average shortest path length to every node in the graph.As symmetries preserve distance, they also preserve closeness centrality, explicitly, and centrality is constant on each orbit, as expected.Moreover, closeness centrality can be recovered from the quotient (shortest Fig. 7 Spectral signatures of network symmetry.Laplacian spectrum of six test networks (blue) and of their quotient (red), given as relative probability of eigenvalue count, with multiplicity, in bins of size 0.1.Only the most significant part of the spectrum is shown.Most of the "peaks" observed in the spectral density occur at positive integers, as predicted.(Insets) Percentage of the high-multiplicity spectrum explained by the symmetry, as the ratio of P m λ > 1 m λ for the quotient eigenvalues, and for the Laplacian eigenvalues, where m λ is the multiplicity of an eigenvalue λ rounded to 8 decimal places.
paths does not contain intra-orbit edges, except between vertices in the same symmetric motif, see above), as if i belongs to the orbit V k and d k is the average intra-motif distance, that is, the average distances of a vertex in V k to any vertex in M, the motif containing V k .By annotating each orbit by d k , we can recover betweenness centrality exactly.Alternatively, as d k ≪ n (note that d k ≤ m if M has m orbits), we can approximate cc G ðiÞ by the first summand, or simply by the quotient centrality cc Q ðαÞ, in most practical situations.Betweenness centrality: this is the sum of proportions of shortest paths between pairs of vertices containing a given vertex.It can be computed from shortest path distances and number of shortest paths 46 , both pairwise structural measures, reducing the computation of a naive O(n 3 ) time, O(n 2 ) space implementation by e n 3 Q and e n 2 Q .It would be interesting to adapt a faster algorithm, e.g., ref. 46 to exploit symmetries, but this is beyond our scope.
Eigenvector centrality: eigenvector centrality is obtained from a Perron-Frobenius eigenvector (i.e., of the largest eigenvalue) of the adjacency matrix of a connected graph 1 .Since this eigenvalue must be simple, it cannot be a redundant eigenvalue.Hence it is a quotient eigenvalue, and, as those are a subset of the parent eigenvalues, it must still be the largest (hence the Perron-Frobenius) eigenvalue of the quotient.Its eigenvector can then be lifted to the parent network, by repeating entries on orbits.That is, if (λ, v) is the Perron-Frobenius eigenpair of the quotient, then (λ, Sv) is the Perron-Frobenius eigenpair of the parent network.In practice, we use the symmetric quotient B sym = Λ −1/2 S T ASΛ −1/2 for numerical reasons (Algorithm 4).Hence the computation (quadratic time by power iteration) can be reduced by e n 2 Q (Fig. 5).

Algorithm 4.
Eigenvector centrality from the quotient network.

Discussion
We presented a general theory to describe and quantify the effects of network symmetry on arbitrary network measures, and explained how this can be exploited in practice in a number of ways.Network symmetry of the large but sparse graphs typically found in applications can be effectively computed and manipulated, making it an inexpensive pre-processing step.We showed that the amount of symmetry is amplified in a pairwise network measure but can be easily discounted using the quotient network.We can for instance eliminate the symmetry-induced redundancies, or use them to simplify the calculation by avoiding unnecessary computations.Symmetry has also a profound effect on the spectrum, explaining the characteristic "peaks" observed in the spectral densities of empirical networks, and occurring at values we are able to predict.
Our framework is very general and apply to any pairwise or vertex-based network measure beyond the ones we discuss as examples.We emphasised practical and algorithmic aspects throughout, and provide pseudocode and full implementations 26 .Since real-world network models and data are very common, and typically contain a large degree of structural redundancy, our results should be relevant to any network practitioner.

Methods
Geometric decomposition and symmetric motifs.We write Aut ðGÞ for the automorphism group of an (unweighted, undirected, possibly very large) network G ¼ ðV; EÞ (see below for a discussion of directed and weighted networks).Each automorphism (symmetry) σ 2 Aut ðGÞ is a permutation of the vertices and its support is the set of vertices moved by σ, Two automorphisms σ and τ are support-disjoint if the intersection of their supports is empty, supp ðσÞ \ supp ðτÞ ¼ ;.The orbit of a vertex i is the set of vertices to which i can be moved to by an automorphism, that is, One can show 11 that there is a partition a set X of generators of Aut ðGÞ into its finest support-disjoint classes X = X 1 ∪ … ∪ X m , which is unique up to permutation of the sets X i .The vertex sets M i ¼ ∪ σ2X i supp ðσÞ give the geometric decomposition Eq. ( 2), and the subgraphs induced by them are, by definition, the symmetric motifs of G. (The next section explains how to compute the geometric decomposition in practice.)Since support-disjoint automorphisms must commute (the order in which they are composed is irrelevant), the subgroups of Aut ðGÞ generated by X 1 to X m , call them H 1 to H m , give a direct product decomposition Aut ðGÞ ¼ H 1 H m .The geometric decomposition is defined from the finest support-disjoint partition of a special set of generators (called essential), as explained in ref. 11 .However, the results in this article are valid for any supportdisjoint decomposition of any set of generators (essential or not) of Aut ðGÞ.
If all the orbits of a symmetric motif have the same size k and every permutation of the vertices in each orbit can be extended to a network automorphism supported on the motif, we call the symmetric motif basic (or BSM) of type k.(In particular, the corresponding subgroup H i must be Sym(k), the symmetric group of all permutations of k elements.)If a symmetric motif is not basic, we call it complex or of type 0.
Network symmetry computation.First, we compute a list of generators of the automorphism group from an edge list (we use saucy3 47 , which is extremely fast for the large but sparse networks typically found in applications).Then, we partition the set of generators X into support-disjoint classes X = X 1 ∪ … ∪ X m , that is, σ and τ are support-disjoint whenever σ ∈ X i , τ ∈ X j and i ≠ j.To find the finest such partition, we use a bipartite graph representation of vertices V and generators X. Namely, let B be the graph with vertex set V ∪ X and edges between i and σ whenever i ∈ supp(σ).Then X 1 , …, X m are the connected components of B (as vertex sets intersected with X).Each X i corresponds to the vertex set M i of a symmetric motif M i , as M i ¼ S σ2X i supp ðσÞ: Finally, we use GAP 48 to compute the orbits and type of each symmetric motif (Algorithm 5).Full implementations of all the procedures outlined above are available at a public repository 26 .

Algorithm 5.
Orbits and type of a symmetric motif.
Structural network measures.We prove below the structural result for BSMs for arbitrary graphs and network measures.The proof is a generalisation of the argument on ref. 49 (p. 48) to weighted directed graphs with symmetries.
Theorem 1 Let M be the vertex set of a BSM of a network G, and F a structural network measure.Then the graph induced by M in FðGÞ is a BSM of FðGÞ, and satisfies: (i) for each orbit Δ = {v 1 , …,v n }, there are constants α and β such that the orbit internal connectivity is given by α = F(v i ,v j ) for all i ≠ j and β = F(v i , v i ) for all i; (ii) for every pair of orbits Δ 1 and Δ 2 , there is a labelling , and δ 2 = F(w i , v i ), for all i ≠ j; (iii) every vertex v not in the BSM is joined uniformly to all the vertices in each orbit for all i, j.Moreover, property (iii) holds in general for any symmetric motif.If G is undirected and F is symmetric, γ 1 = γ 2 and δ 1 = δ 2 and each orbit is a (α, β)-uniform graph K α;β n and each pair of orbits form a (γ, δ)-uniform join, explaining Fig. 3a, b.
Proof As FðGÞ inherits all the symmetries of G, M has the same orbit decomposition and the symmetric group S n acts in the same way, hence M induces a BSM in FðGÞ too.For the internal connectivity, note that every permutation of the vertices v i is realisable.Thus, given arbitrary 1 ≤ i, j, k, l ≤ n, we can find σ 2 AutðGÞ such that σ(v k ) = v i and, if j ≠ i and l ≠ k, additionally satisfies σ(v l ) = v j .This gives For the orbit connectivity result (ii), we generalise the argument in ref. 49 (p.48) to weighted directed graphs with symmetries, particularly (FG).We assume some basic knowledge and terminology about group actions 50 and symmetric groups S n .Given two orbits the vertices in Δ 2 joined to v i in FðGÞ.If a finite group G acts on a set X, the stabiliser of a point equals to the size of the orbit of x.Hence, the stabilisers G v i or G w j are subgroups of S n of index n, for all i, j.The group S n has a unique, up to conjugation, subgroup of index n if n ≠ 6.In this case, Similarly, we can relabel the remaining vertices in Δ 2 so that noticing there cannot be repetitions as The stabiliser G v i fixes v i but it may permute vertices in Δ 2 .In fact, the set Γ i above must be a union of orbits of G v i on Δ j : if w ∈ Γ i and σ 2 G v i then 0 ≠ F(v i , w) = F (σv i , σw) = F(v i , σw) so σw also belongs to Γ i .The orbits of G v i ¼ G w i in Δ 2 are {w i } and Δ 2 ⧹{w i }, as G w i fixes w i and freely permutes all other vertices in Δ 2 .The case n = 6 is similar, except that S 6 has two conjugacy classes of subgroups of index 6, one as above, and the other a subgroup acting transitively on the 6 vertices, which gives a unique orbit Δ 2 .In all cases, the set Δ 2 ⧹{w i } is part of an G v i -orbit, which gives the connectivity result, as follows.Fix 1 ≤ i ≤ n.For 1 ≤ j, k ≤ n different from i, the vertices w j and w k are in the same G v i -orbit so there is σ 2 G v i with σw j = w k and, therefore, F(v i , w j ) = F(σv i , σw j ) = F(v i , w k ).The argument is general, so we have shown a i = F(v i , w j ) is constant for all j ≠ i.It is enough to show a i = a 1 for all i.Choose j ≠ i, then ) is also a constant, call it δ 1 , for all i.The cases γ 2 = F (w j , v i ) and δ 2 = F(w i , v i ) are identical, reversing the roles of Δ 1 and Δ 2 .
Property (iii) holds for any symmetric motif, not necessarily basic, as follows.By the definition of orbit, for each pair i, j we can find an automorphism σ in the geometric factor such that σ(v j ) = v i .Since v is not in the support of that geometric factor, it is fixed by σ, that is, Average compression.Theorem 2 Let A = (a ij ) be the n × n adjacency matrix of a network with vertex set V. Let S be the n × m characteristic matrix of the partition of V into orbits of the automorphism group, and Λ the diagonal matrix of column sums of S. Define B = S T AS and (ii) if i, j ∈ V belong to orbits i ∈ Δ 1 and j ∈ Δ 2 in the same symmetric motif, Before proving this statement, we make a few observations.The column sums of S equal the sizes of the vertex partition sets, hence Λ is the same as in the definition of quotient matrix (6), and can be obtained easily from S. The matrix S is very sparse (each row has a unique non-zero entry) and can be stored very efficiently.Case (i) covers the vast majority of vertex pairs (external edges) for a network measure (see ext s and int f in Table 1).In (ii), the case Δ 1 = Δ 2 is allowed.The matrix B = S T AS is symmetric with integer entries if A is too, hence generally easier to store than Q(A) = Λ −1 S T AS.
Proof Let V = Δ 1 ∪ … ∪ Δ m be the partition into orbits, and write n k = |Δ k |.Clearly, the row sums of S equals n 1 , …, n m .Writing [M] ij for the (i, j)-entry of a matrix M, matrix multiplication gives 0 otherwise: ( Similarly, assuming i ∈ Δ k and j ∈ Δ l , we have This expression reduces to a ij if the orbits belong to different symmetric motifs, since in this case all the summands in P u2Δ k ;v2Δ l a uv are equal to one another.Indeed, given i 1 , i 2 ∈ Δ k , and j 1 , j 2 ∈ Δ l , we can find, by the definition of orbit and symmetric motif, automorphisms σ and τ such that σ(i 1 ) = i 2 while fixing j 1 , and τ (j 1 ) = j 2 while fixing i 1 .This gives A similar proof shows that we can recover exact inter-motif connectivity (external edges), and average intra-motif connectivity (average internal edges) from the quotient network, as follows.
Corollary 1 Let A = (a ij ) be the n × n adjacency matrix of a network and Q (A) = (b kl ) its quotient with respect to the partition into orbits of the automorphism group V = Δ 1 ∪ … ∪ Δ m .Suppose that i ∈ Δ k , j ∈ Δ l .Then, (i) if the orbits Δ k and Δ l belong to different symmetric motifs, b kl = a ij ; (ii) if the orbits Δ k and Δ l belong to the same symmetric motif, Lossless compression.We can achieve lossless compression by exploiting the structure of BSMs, which account for most of the symmetry in real-world networks.If the motif is basic, we can preserve the exact parent network connectivity in an annotated quotient, as follows.Each orbit in a BSM is a uniform graph K α;β n , which appears in the quotient as a single vertex with a self-loop weighted by (n − 1)α + β (Fig. 3c).Hence, if we annotate this vertex in the quotient by not only n but also α, or β, we can recover the internal connectivity.Similarly, the connectivity between two orbits in the same symmetric motif is given by two parameters γ, δ, and appears in the quotient as an edge weighted (n − 1)γ + δ (Fig. 3d) and thus can also be recovered from a quotient with edges annotated by γ, or δ.
Since there is no general formula for an arbitrary non-basic symmetric motif, we can work with the basic quotient Q basic instead, that is, the quotient with respect to the partition of the vertex set into orbits in BSMs only (vertices in non-basic symmetric motifs become fixed points hence part of the asymmetric core).The annotated (as above) basic quotient achieves most of the symmetry reduction in a typical empirical network (ñ basic Q % ñQ , m basic Q % mQ , (see Table 1, caption).To maintain the same vertex labelling as in the parent network, we record, for each pairs of orbits in the same symmetric motif, the corresponding permutation of the second orbit (else we recover the adjacency matrix only up to permutations of the orbits).
Algorithms for lossless compression and recovery based on the basic quotient are shown below (Algorithms 6 and 7), and MATLAB implementations for BSMs up to two orbits are available at a public repository 26 .The results reported in Fig. 4 are with respect to these implementations, and the actual compression ratios reported include the size of the annotation data for lossless compression with vertex identity (a very small fraction of the size of the quotient in practice, adding at most 0.02% to the basic full compression ratio in all our test cases).

Lossless symmetry decompression.
Spectral signatures of symmetry.The partition into orbits satisfy the following regularity condition 34,35 .A partition of the vertex set …V m be a partition of the vertex set of a graph with adjacency matrix A = (a ij ), and let S be the characteristic matrix of the partition.Write Q(A) for the quotient with respect to the partition.
(i) The partition is equitable if and only if AS = SQ(A); (ii) The partition into orbits of the automorphism group is equitable.
Proof (i) Fix 1 ≤ i ≤ n and 1 ≤ k ≤ m, and suppose i ∈ V l .Then and, using the equitable condition, For the converse, note that [AS] il does not depend on i but on the orbit of i.
(ii) Given i 1 and i 2 in the same orbit Δ k , choose an automorphism σ such that σ(i 1 ) = i 2 .Then, since automorphisms respect the adjacency matrix, a ij = a σ(i)σ(j) for all i, j, we have X where the last equality follows from the fact that an element in a group permutes orbits, in this case, {j : j ∈ Δ l } = {σ(j) : j ∈ Δ l }.Hence, the partition into orbits is equitable.□ It follows immediately that the quotient eigenvalues are a subset of the eigenvalues of the parent network, ) That is, the spectrum of the quotient is a subset of the spectrum of the graph, with eigenvectors lifted from the quotient by repeating entries on orbits.Moreover, we can complete an eigenbasis with eigenvectors orthogonal to the partition (adding up to zero on each orbit).Theorem 3 Suppose that A is an n × n real symmetric matrix and B the m × m quotient matrix with respect to an equitable partition V 1 ∪ … ∪ V m of the set {1, 2, …, n}.Let S be the characteristic matrix of the partition.Then A has an eigenbasis of the form Sv 1 ; ; Sv m ; w 1 ; ; w nÀm f g ; where {v 1 , …, v m } is any eigenbasis of B, and S T w i = 0 for all i.
Proof Recall that Sv ≠ 0 if v ≠ 0 (S lifts the vector v from the quotient by repeating entries on each orbit) so the linear map R m !R n ; v7 !Sv has trivial kernel and hence it is an isomorphism onto its image.In particular, B ¼ fSv 1 ; ; Sv m g is also a linearly independent set, and they are all eigenvectors of A, since AS = SB as the partition is equitable.To finish the proof we need to complete B to a basis Sv 1 ; ; Sv m ; w 1 ; ; w nÀm f g such that each w j is an Aeigenvector orthogonal to all Sv i .As B is a basis of Im(S), this would imply w i ∈ Im (S) ⊥ = Ker(S T ), giving S T w i = 0 for all i, as desired.Since A is diagonalisable, R n decomposes as an orthogonal direct sum of eigenspaces, R n ¼ L λ E λ .In each E λ , we can find vectors w j such that they complete V λ ¼ fSv i 2 B j v i λÀeigenvector g to a basis of E λ and that are orthogonal to all vectors in V λ (consider the orthogonal complement of the subspace generated by V λ in E λ ).Repeating this procedure on each E λ , we find vectors {w 1 , …, w n−m } as needed.□ The statement and proof above holds for arbitrary matrices A by replacing "eigenbasis" by "maximal linearly independent set" and removing the condition S T w i = 0.It would be interesting to know whether the condition S T w i = 0 holds for motif eigenvectors in the directed case as well (the proof above is no longer valid).
Theorem 4 Let M be a symmetric motif of a (possibly weighted) undirected graph G.If (λ, w) is a redundant eigenpair of M then ðλ; e wÞ is a eigenpair of G, where e w is equal to w on (the vertices of) M, and zero elsewhere.
where A M is the adjacency matrix of M. We can decompose M into orbits, and, by the spectral decomposition theorem above applied to M, w is orthogonal to each orbit, that is, We need to show that ðλ; e wÞ is a G-eigenpair.Let us write A for the adjacency matrix of G (recall M is a subgraph so A restricts to A M on M).We need to show as before, and then we use the decomposition of M into orbits, Here, we have used that the vertex i, outside the motif, connects uniformly to each orbit, that is, A ij 1 ¼ A ij 2 for all j 1 , j 2 ∈ V k , and we call this quantity α k .Finally, recall that w is orthogonal to each orbit, to conclude Therefore, the redundant spectrum of G is the union of the redundant eigenvalues of the symmetric motifs, together with their redundant eigenvectors localised on them.Since most symmetric motifs in real-world networks are basic, most symmetric motifs in the network representation of a network measure will be basic too.Given their constrained structure, one can in fact determine the redundant spectrum of BSMs with up to few orbits, for arbitrary undirected networks with symmetry.
Redundant spectrum of a 1-orbit BSM: A BSM with one orbit is an (α, β)uniform graph K α;β n with adjacency matrix A α;β n ¼ ða ij Þ given by a ij = α and a ii = β for all i ≠ j.Then K α;β n has eigenvalues (n − 1)α + β (non-redundant), with multiplicity 1, and − α + β (redundant), with multiplicity n − 1.The corresponding eigenvectors are 1, the constant vector 1 (non-redundant), and e i , the vectors with non-zero entries 1 at position 1, and − 1 at position i, 2 ≤ i ≤ n (redundant).This can be shown directly by computing A α;β n 1 and A α;β n e i , and noting that 1, e 2 , …, e n are linearly independent (although not orthogonal), and thus form an eigenbasis.Indeed, A α;β n 1 is the vector of column sums of the matrix A α;β n , which are constant (n − 1)α + β, and A α;β n e i is the constant 0 vector, except possibly at positions 1, which equals β − α, and i, which equals α − β.
Redundant spectrum of a 2-orbit BSM: A BSM with two orbits is a uniform join of the form and note that c ≠ 0: otherwise γ = δ and we can freely permute one orbit while fixing the other, that is, this would not be a BSM with two orbits but rather two BSMs with one orbit each.As above, let e i be the vector with non-zero entries 1 at position 1, and −1 at position i, for any 2 ≤ i ≤ n.Lemma 1 The following set of vectors is linearly independent {(κ 1 e i | e i ), (κ where 1 is a constant 1 column vector, and Id n−1 the identity matrix of size n − 1.The set of vectors in the statement can be arranged in block matrix form as This matrix has a minor of order Next, we derive conditions for a vector v i = (κe i |e i ) to be an eigenvector of the uniform join (32), that is, Av i = λv i , for some λ 2 R, where A is the (symmetric) adjacency matrix of the uniform join, The jth entry of the vector Av is Comparing these with the entries of the vector λv i , we obtain The two equations on the right-hand side are satisfied if and only if λ = − κc − b and κ is a solution of the quadratic equation since c ≠ 0, as explained above.Altogether with the lemma, we have shown the following.
Theorem 5 The redundant spectrum of a symmetric motif with two orbits K is given by the eigenvalues ; and ; each with multiplicity n − 1, and eigenvectors (κ 1 e i |e i ) and (κ 2 e i |e i ), respectively, where κ 1 and κ 2 are the two solutions of the quadratic equation cκ For unweighted graphs without loops, we recover the redundant eigenvalues for BSMs with two orbits predicted in ref. 13 , as follows.We have  13 .
We omit the calculation of the redundant spectrum of BSMs with three (or more) orbits, as it becomes much more elaborate, and its relevance in real-world networks is less justified (for example, <1% of BSMs in each of our test networks, Table 1, has three or more orbits).
Applications.Theorem 6 (Communicability) Let Q(A) be the quotient of the adjacency matrix A of a network with respect to the partition into orbits of the automorphism group.Let f(x) = ∑a n x n be an analytic function.Then f(Q Proof Call B = Q(A) and recall that AS = SB by Proposition 1(i), where S is the characteristic matrix of the partition.Therefore, A n S = SB n for all n ≥ 0 and since Λ −1 S T S is the identity matrix.□ Theorem 7 (Shortest path distance) Let A = (a ij ) be as above.Then ) is a shortest path from v 1 to v n , and v 1 and v n belong to different symmetric motifs, then v i and v i+1 belong to different orbits, for all 1 ≤ i ≤ n − 1; (iii) if u and v belong to orbits U, respectively V, in different symmetric motifs, then the distance from u to v in G equals the distance from U to V in the unweighted (or skeleton) quotient Q. Proof (i) Since automorphisms are bijections and preserve adjacency, (σ(v 1 ), σ (v 2 ), …, σ(v n )) is a path from σ(u) to σ(v) of the same length.If there were a shorter path (σ(u) = w 1 , w 2 , …, σ(v) = w m ), m < n, the same argument applied to σ −1 gives a shorter path (u = σ −1 (w 1 ), σ −1 (w 2 ), …, v = σ −1 (w m )) from u to v, a contradiction.(ii) Any subpath of a minimal length path is also of minimal length between its endpoints.Arguing by contradiction, there exists a subpath p = (w 1 , w 2 , …, w n ) (or p = (w n , w n−1 , …, w 1 )), such that w 1 and w 2 belong to the same orbit, and w n belongs to a different symmetric motif.Hence, we can find σ 2 Aut ðGÞ with σ(w 2 ) = w 1 and fixing w n .This implies σ(p) = (σ(w 1 ), σ(w 2 ) = w 1 , σ (w 3 ), …, σ(w n ) = w n ), a shortest path by (i), of length n − 1.The subpath (w 1 , σ (w 3 ), …, w n ) has length n − 2, contradicting p being a minimal length path from w 1 to w n .(The case p = (w n , w n−1 , …, w 1 ) is analogous.)(iii) Let p = (u = v 1 , v 2 , …, v n +1 = v) be a shortest path from u to v, so that d G ðu; vÞ ¼ n.Let V k be the orbit containing v k , for all k.By (ii), V k ≠ V k+1 for all 1 ≤ k ≤ n thus q = (U = V 1 , V 2 , …, V n+1 = V) is a path in Q and d Q ðU; VÞ ≤ n.By contradiction, assume there is a shorter path in Q from U to V, that is, (U = W 1 , W 2 , …, W m+1 = V) with m < n.The we can construct a path in G from u to v of length m (a contradiction), as follows.For each 1 ≤ i ≤ m, W i is connected to W i+1 in Q, hence there is a vertex in W i connected to at least one vertex in W i+1 .Since vertices in an orbit are structurally indistinguishable, any vertex in W i is then connected to at least one vertex in W i+1 (formally, if w ∈ W i is connected to w 0 2 W iþ1 then σ(w) ∈ W i is connected to σðw 0 Þ 2 W iþ1 ).This allows us to construct a path in G from u to v of length m < n, a contradiction.□ Let us call the external degree of a vertex as the number of adjacent vertices outside the motif it belongs to.The proof of the following is straightforward from the definitions.
Theorem 8 (Symmetric motif Laplacian) A symmetric motif M in G induces a symmetric motif in L with adjacency matrix where L M is the ordinary Laplacian matrix of M considered as a graph on its own, and Weighted and directed networks.The adjacency matrix of a network can encode arbitrary weights and directions, making a general n × n real matrix A the adjacency matrix of some (weighted, directed) network.The definition of automorphism group, geometric decomposition, symmetric motif, and orbit, and their properties, as they are defined only in terms of A, carry verbatim to arbitrarily weighted and directed networks.In this setting, a symmetry (automorphism), respects not only adjacency, but weights and directions.In particular, the automorphism group is smaller than (a subgroup of) the automorphism group of the underlying undirected, unweighted network.By introducing edge weights or directions, some symmetries will disappear, removing (and occasionally subdividing) symmetric motifs and orbits, as the next results shows.Theorem 10 Let A w = (w ij ) be the adjacency matrix of an arbitrarily weighted and directed network G w , and A = (a ij ) the adjacency matrix of the underlying undirected and unweighted network G, that is, a ij = sgn(|w ij | + |w ji |).Consider the symmetric motifs of G, respectively G w , with vertex sets M 1 , …, M m , respectively M 0 1 , …, M 0 m 0 .Then for every 1 ≤ i ≤ m 0 there is a unique 1 ≤ j ≤ m such that M 0 M j .Similarly, each vertex orbit in G w is a subset of a vertex orbit in G.
Let us choose essential 11 sets of generators S, respectively S 0 , of Aut ðGÞ, respectively Aut ðG w Þ, with support-disjoint partitions X ¼ X 1 ∪ ∪ X m ; respectively X 0 ¼ X 0 1 ∪ ∪ X 0 m 0 : It is enough to prove the statement for these sets: given i, there is unique j such that X 0 i X j .Let x 0 2 X 0 i Aut ðG w Þ Aut ðGÞ thus we can write x 0 ¼ h 1 Á Á h m with h k ∈ H k = 〈X k 〉.Since X 0 is an essential set of generators, there is an index j such that h k = 1 (the identity, or trivial permutation) for all k ≠ j, so that x 0 ¼ h j .Given any other y 0 2 X 0 i , the same argument gives y 0 ¼ h l for some 1 ≤ l ≤ m.We claim j = l, as follows.The partition of X, respectively X 0 , above are the equivalence classes of the equivalence relation generated by σ ~τ if σ and τ are not supportdisjoint permutations.Since x 0 ; y 0 are in the same equivalence class, so are h j and h l and thus j = l.□ The same result applies to networks with other additional structure, not necessarily expressed in terms of the adjacency matrix, such as arbitrary vertex or edge labels, by restricting to automorphisms preserving the additional structure.We obtain fewer symmetries, and a refinement of the geometric decomposition, symmetric motifs, and orbits as above.The results in this paper, although applicable in theory, become less useful in practice as further restrictions are imposed, reducing the number of available network symmetries.
Asymmetric measures.In the case of an asymmetric network measure (F(i, j) ≠ F(j, i)), its network representation FðGÞ is directed even if G is not.However, FðGÞ still inherits all the symmetries of G, that is, every automorphism of G respects weights and edge directions in FðGÞ.Therefore, FðGÞ has the same symmetric motifs (as vertex sets) and orbits as G, and the structural results in this paper apply verbatim.

Fig. 2
Fig.2Structural network measures.a Neighbourhood of motif M 1 (Fig.1) and its adjacency matrix.Network and matrix representation of two structural (full, respectively sparse) network measures, b the exponential matrix (a measure of vertex communicability37 ), and c the graph Laplacian.In each case, the vertices are numbered 1 to 5 and coloured by orbit, and a non-zero (i, j)-entry in the matrix corresponds to the edge weight between vertices i and j.Note that the network automorphism swapping vertices 1 and 2, and 3 and 4, preserves the network and matrix structure in all three cases.In general, any symmetry of a network is also a symmetry of the network representation of any structural network measure.

d 1 ,
…, d k are the external degrees of the k orbits of M of sizes m 1 , …, m k .(Here, I n is the identity matrix of size n and we use ⊕ to construct a block diagonal matrix).Recall that each orbit in a BSM (in an undirected, unweighted graph) is either a complete or an empty graph.Corollary 2 (Redundant Laplacian eigenvalues) Let G be an undirected, unweighted network.If M is a 1-orbit BSM with m vertices of external degree d, then the redundant Laplacian eigenvalue induced by M is d if M is an empty graph, and d + m if M is a complete graph, in both cases with multiplicity m − 1.Proof By Theorem 8, the Laplacian of the motif in L is L M þ dI m .The redundant eigenvalues of this matrix are the redundant eigenvalues of L M (0 if M is empty and m if M is a complete graph, in both cases with multiplicity m − 1) plus d.All in all, the redundant eigenvalues for 1-orbit BSMs occur a the positive integersZ þ .□ Theorem 9 (Vertex compression) If v is a vector of length n G that is constant on orbits, then SΛ −1 S T v = v.Proof First, note that S T S = Λ (this holds for any partition of the vertex set).½ST S αβ ¼ X i ½S T αi ½S iβ ¼ X i ½S iα ½S iβ ¼ 0 if α ≠ β; jV α j if α ¼ β: & As v is constanton orbits, it is already of the form v = Sw for some w.Therefore SΛ −1 S T v = SΛ −1 S T Sw = Sw = v. □ Proposition 2 (Degree centrality) Let B = (b αβ ) be the adjacency matrix of the quotient, and V = V 1 ∪ … ∪ V m the partition of the vertex set into orbits.If i ∈ V α , then d G i ¼ d Q; out α .Proof

Table 1
Symmetry in some real-world networks.For each test network, we show the number of vertices (n G ), edges (m G ), number of generators (gen) of the automorphism group (sizes, 10 153 to 10 197,552 , not shown), computing times of generators (t 1 ) and geometric decomposition (t 2 ), in seconds, number of symmetric motifs (sm) and proportion of basic symmetric motifs (bsm), proportion of vertices moved by an automorphism (mv), proportion of vertices (e n Q ¼ n Q =n G ) and edges (e m Q ¼ m Q =m G ) in the quotient, proportion of external edges in the sparse case (ext s , in percentage), and of internal edges in the full case (int f , closest power of 10), full compression ratio (c full ¼ e n 2Q ), and spectral computational reduction (sp ¼ e n 3 Q We have included simple average symmetry compression and decompression algorithms (Algs. 1 and 2), where A avg is the matrix with entries a ij .The original n G n G matrix A is stored using the n Q n Q quotient matrix B plus a very sparse (n non-zero elements) characteristic matrix S.
Average symmetry compression.
and use (v|w) to represent the concatenation of two vectors.
Ae w ¼ λe w.Given i 2 VðGÞ, we have two cases.First, if i 2 VðMÞ, X½A ij w j ¼ λw i ¼ λe w i ;since e w equals w on M, and is zero outside M. The second case, when i 2 VðGÞnVðMÞ, gives X