{'fraction_non_alphanumeric': 0.037232352754304594, 'fraction_numerical': 0.0048923057373403646, 'mean_word_length': 4.143790849673203, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Isospectral Reductions of Dynamical Networks

We present a general and flexible procedure which allows for the reduction (or expansion) of any dynamical network while preserving the spectrum of the network's adjacency matrix. Computationally, this process is simple and easily implemented for the analysis of any network. Moreover, it is possible to isospectrally reduce a network with respect to any network characteristic including centrality, betweenness, etc. This procedure also establishes new equivalence relations which partition all dynamical networks into spectrally equivalent classes. Here, we present general facts regarding isospectral network transformations which we then demonstrate in simple examples. Overall, our procedure introduces new possibilities for the analysis of networks in ways that are easily visualized.

Many, if not the majority of networks that occur in nature are very large in the sense that they contain many nodes and many edges [1][2][3]. A considerable number of these networks (neural networks, metabolic networks, power stations, etc.) are also dynamic, i.e. each node has an associated state that changes in time according to its intrinsic evolution and interactions with other nodes.
Because of the complex structure of most real-world networks there is a strong motivation for developing methods that simplify the topology of a network while maintaining some of the network's basic characteristics. In this regard, perhaps, the most fundamental characteristic of a dynamical network is the spectrum of its adjacency matrix [4,5]. In a dynamical network each edge of the graph of interactions (topology of a network) can be assigned a weight related to the strength of the corresponding interaction. In practice, such edge weights typically represent the linearization of the associated interaction. These weights make up network's weighted adjacency matrix which forms the backbone of any dynamical network. An important question then is how and to what extent can a network be simplified (reduced in number of nodes and edges) while preserving the spectrum (eigenvalues) of its adjacency matrix.
At first it may seem that both simplifying (i.e. reducing) a network and maintaining its spectrum is not possible. One obvious issue is dimensionality. Indeed, a network with n nodes has an n × n adjacency matrix so reducing a network to m < n nodes would seem to necessarily reduce the number of eigenvalues associated with the network. However, despite this and other possible complications we will demonstrate that it is in fact possible to do just this.
The process of isospectral reduction, which we propose, moreover allows for the introduction of new equivalence relations between dynamical networks where two networks are equivalent if they can be isospectrally reduced to the same network. This procedure is also quite flexible as it is possible to reduce a network to a smaller network on any nonempty subset of its original set of nodes. Our procedure, therefore, allows one to reduce a network with regard to characteristics such as centrality, betweenness, clustering, etc. [3] e.g. over nodes with maximal centrality. In this respect, the method of isospectral reductions allows experts (e.g. physicists, biologists, chemists, engineers, etc.) to reduce (simplify) the dynamical networks with which they are concerned relative to any network characteristic they find interesting while preserving the network's major dynamical characteristics.
Additionally, this approach to network analysis is visually informative as one can directly see and compare various reductions of the same network or reductions of different networks. Also, if one wishes to reduce edges instead of nodes one need only interchange nodes and edges and perform the same operation.
As a dual procedure we similarly demonstrate that one can enlarge (rather than reduce) a dynamical network, thereby making it more sparse, while again maintaining its spectrum up to a set known in advance. Here, as in the case of isospectral reductions, this collection of eigenvalues is immediately known from the topology and weights of the network.
Our results on isospectral transformations are characterized by two important features. First, these results can be rigorously proven (see [6]). Therefore, we refer to them here as Facts. Second, our procedure is algorithmic and importantly easy to implement. Therefore, the major goal of this paper is to present the network community with a new and flexible tool for the analysis of dynamical networks which could be immediately put to use in the study of real networks. The only information needed to carry out this procedure is the topology of a specific network.
In this paper, every network is described by its set of nodes (vertices) V , directed edges E, and weights ω(e) of the edges e. Thus, a dynamical network is identified with a weighted and directed graph G = (V, E, ω). An edge from vertex v i to v j is denoted by e ij . The weighted adjacency matrix of G is given entrywise by M (G) ij = ω(e ij ). The spectum σ(G), or the collection of eigenvalues Our procedure allows edge weights of a network to be maintained under reduction if all are equal to 1 (i.e. if a network is unweighted) or weights to be positive numbers, etc. However, in the most general case edge weights are allowed to be functions of the spectral parameter λ in equation (1). Various examples will be presented below.
Of primary importance is the fact that a typical network G cannot be reduced over an arbitrary subset of its vertices by means of a single reduction. Instead, a network G can be reduced over any arbitrary subset of its vertices via a sequence of isospectral reductions where each reduction is achieved by reducing over a particular subset of the network's vertices. Such subsets are called structural sets and are described as follows.
First, we remove all loops (closed paths containing a single vertex) from G and denote the remaining graph by (G). A subset S ⊆ V is a structural set of G if there are no closed paths in (G) onS = V − S and ω(e ii ) = λ for each v i ∈S. For example, in Fig. 1 the vertex sets S = {v 1 , v 2 } and T = {v 3 , v 4 } are structural sets of G whereas {v 1 , v 3 } is not. From a computational point of view it is straightforward to determine, for a given network, which subsets of its vertices are structural sets and which are not. The formal procedure (algorithm) for isospectrally reducing a graph is as follows.
A path in a graph G = (V, E, ω) is an ordered sequence of distinct vertices v 1 , . . . , v m such that e i,i+1 are edges in E for each 1 ≤ i ≤ m − 1. The interior vertices of a path are the path's vertices except the first and last. For a structural set S = {v 1 , . . . , v n } let B ij (G; S) be the collection of all paths from v i to v j for 1 ≤ i, j ≤ n which contain no interior vertices in S. Now consider the union of such paths over all pairs v i and v j given by An isospectral reduction of G = (V, E, ω) over the struc- If e ij ∈ E then e ij has weight equal to where the sum is taken over all paths β = v 1 , . . . , v m .

Fact 1 (Preservation of Spectral Information)
The spectrum of a network G = (V, E, ω) is preserved when G is reduced over the structural set S up to the set σ(G, S) which is the collection of weights of loops of the vertices inS. Therefore, this set is known in advance and can be directly read from the initial network (see theorem 3.4 in [6]).
With the concept of an isospectral reduction in place it is natural to define an isospectral expansion of a graph G as a graph H where R T (H) = G for some structural set T of H. Such expansions can be carried out by expanding edges into paths or multiple paths with the correct product and sum given in (3).
Importantly, as a reduced network R S (G) will have its own structural sets, it possible to sequentially reduce a network. However, given that different sequences of reductions seemingly lead to different reductions, a natural question then is whether one can have some sort of control of the resulting reduced network in this huge variety of possible reductions. That is, by which sequence of reductions should one reduce a network to a smaller network on a particular vertex set that one finds interesting? As it happens, sequences of reductions have the following remarkable property which resolves this key issue. final subset of vertices over which the network is reduced (see theorem 3.5 in [6]).
More formally this fact could be expressed in the following way. Let the sets S m ⊂ S m−1 ⊂ · · · ⊂ S 1 ⊂ V be structural sets in a sequence of reductions on the graph G = (V, E, ω). Then R(G; S 1 , . . . , S m ) = R Sm (G). That is, regardless of the specific sequence of reductions over which the graph G is reduced to a graph on the vertices S m the result is always the same.
Besides allowing one to simplify (reduce) a network, our procedure can also be used to establish new equivalence relations between different networks. Namely, we say two networks are spectrally equivalent if they can be isospectrally reduced to the same network. As an example, in Fig. 2 we show the two spectrally equivalent networks H and H . However, note that even in this relatively simple example it is rather improbable that one would recognize this fact if it were not pointed out. As real-world networks are much more complicated the following fact is quite remarkable and instructive on how to deal with networks of any type.
Fact 3 (Network Equivalence) Choose a rule τ that uniquely selects a subset of nodes τ (G) ⊆ V of any network G = (V, E, ω). Then the rule τ induces an equivalence relation on the space of all networks in the sense that two networks G and H belong to the same equivalence class if they are spectrally equivalent under τ i.e. R τ (G) (G) = R τ (H) (H) (see theorem 3.9 in [6]).
For instance, the choice of all vertices of a network with minimal out degree is a rule that selects a unique subset of nodes of any network. Conversely, the choice of an arbitrary vertex of a network is not. Here, it is again the role of the expert to choose a specific rule for analysis and comparison of concrete networks observing that the flexibility of our procedure allows for many such rules. For a natural starting point one could use well known network characteristics (e.g. degree, centrality, betweenness) to develop such rules. The only requirement is that such rules must single out a unique subset of nodes.
So far in this paper we have considered network transformations in which the network's edge weights become more complicated as the network is reduced. It could be argued from this point of view that our procedure simply trades network complexity for the complexity of these edge weights. However, this is not the case. The procedure for reducing a network G = (V, E, ω) over a fixed weight set is as follows. First, let S = {v 1 , . . . , v n } be a structural set of G with the restriction that each vertex ofS has no loop.
Step 1: For each path P = v 1 , . . . , v m in B S (G) let π(P ) be the product of the edge weights along this path. Then reweight the edges of this path by giving the first edge of P weight π(P ) and the last m − 2 edges weight 1. Denote the set of reweighted paths terminating at the vertex v j by where πB ij (G; S) are the reweighted paths from v i to v j .
Step 2: For 1 ≤ j ≤ n, combine the last interior vertex of each path in πB j (G; S) to a single vertex leaving a single edge between this vertex and v j of weight 1. Similarly, combine the second to last interior vertex of each path in this manner and so on until all interior vertices of paths in πB j (G; S) have been combined in this way.
Step 3: If the paths P 1 , . . . , P k of πB ij (G; S) are of the same length then in this construction there will be multiple edges between v i and these path's first interior vertices. In this case reduce these multiple edges to a single edge of weight k i=1 π(P i ). The resulting graph is L S (G). We note that the spectra σ(G) and σ(L S (G)) are the same aside from a number of zeros. Now, suppose U is a so called unital ring [7], i.e. U is a collection of numbers that contain all products of these numbers and sums of these products as well as the number (unit) 1. If U is a unital ring containing all edge weights of G then each edge weight of L S (G) is in U . In this case we say L S (G) is a reduction of G over the weight set U if L S (G) contains fewer vertices than G. As an example consider the graphs J and L S (J) in Fig. 4.
For applications, the most important reductions over fixed weight sets are the cases in which U is the ring of all positive numbers or the trivial ring consisting of the weight 1. When only the topology of a network is known but not the weights, it is natural to assign each edge the weight 1. In this case, a reduced network is again unweighted as each edge will have weight 1 (see Fig. 3 where K is the reduction of X S (K) over U = {1}).
Isospectral expansion over fixed weight sets always exist if a network is not too simple (see Fact 5). This allows one to make the network sparser while maintaining the network's spectrum up to a known set.
Fact 5 (Sparsification of Dynamical Networks) If a network has two cycles (closed paths) which are not loops but intersect in at least one vertex then such networks can be made (sequentially) more sparse. This is done via an isospectral expansion that exactly maintains the network's set of edge weights and preserves the network's spectrum up to a set of eigenvalues known in advance (see theorem 4.2 in [6]).
This process is described as follows. For two paths β and γ in B S (G) we say these paths are independent if they share no interior vertices. An isospectral expansion of a graph G over its weight set is the graph X S (G) in which any two paths of B S (G) have been made independent. That is, to each path in B ij (G; S) there is a corresponding path in B ij (X S (G); S) of the same length and edge weights.
To describe the extent to which the eigenvalues of a graph differ from its expansion let n i be the number of paths in B S (G) containing v i . Then σ(G) and σ(X S (G)) differ by n i −1 eigenvalues of the form ω(e ii ) for all v i ∈S.
As an example, in Fig. 3 we show an isospectral expansion X S (K) of the graph K over its weight set {1}. Here, each additional vertex in the expansion X S (G) corresponds to an extra 0 in its spectrum. Because X S (G) is far more sparse than K we refer to X S (G) as a sparsification of K. It is well known that there are various methods to analyze sparse networks. Our procedure allows us to make any network sparse.
In conclusion, we have presented a rigorous procedure which allows one to transform a network to a simpler one with fewer nodes and edges while preserving the network's collection of eigenvalues (spectrum). Such reductions can be used to establish spectral equivalence between networks and can be carried out according to any criterion related to any network characteristic (degree, betweenness, etc.). This allows one to compare the reductions of different networks and find similarities in their structure related to the chosen characteristics. This analysis is moreover facilitated by the fact that isospectral reductions visually simplify networks. These results can be readily applied to any real network. Additionally, this procedure can be used on dynamical networks to obtain improved stability results (see theorem 6.8 in [6]).
The authors would like to thank M. Porter, C. Kirst, and M. Timme for useful suggestions. This work was partially supported by the NSF grant DMS-0900945 and the Humboldt Foundation.