{'fraction_non_alphanumeric': 0.03235313818742046, 'fraction_numerical': 0.0074017013865630655, 'mean_word_length': 4.174870017331022, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Spectral centrality measures in complex networks

Complex networks are characterized by heterogeneous distributions of the degree of nodes, which produce a large diversification of the roles of the nodes within the network. Several centrality measures have been introduced to rank nodes based on their topological importance within a graph. Here we review and compare centrality measures based on spectral properties of graph matrices. We shall focus on PageRank, eigenvector centrality and the hub/authority scores of HITS. We derive simple relations between the measures and the (in)degree of the nodes, in some limits. We also compare the rankings obtained with different centrality measures.


I. INTRODUCTION
Complex systems can be represented as networks, where the main units of the system become nodes and interacting units are connected by edges. The last years have witnessed an intense research activity on networks by the scientific community, after the discovery that many systems in nature, society and technology, turn into graphs with peculiar properties [1,2]. In particular, many networks are characterized by a heterogeneous distribution of the number of neighbors of a node, or degree, where nodes with low degree coexist with nodes with large degree (hubs). Such heterogeneity is responsible for a number of remarkable features of real networks, such as resilience to random failures/attacks [3], and the absence of a threshold for percolation [4] and epidemic spreading [5]. The presence of nodes with different degrees means that there is a broad diversification of their roles within the graph. Centrality measures are designed to rank graph nodes based on their topological importance [6,7]. Among the most popular centrality measures we mention degree itself, but also measures depending on shortest paths between nodes' pairs, like node betweenness and closeness. There are as well centrality measures that depend on spectral properties of graph matrices. These measures are important because they are usually associated to simple dynamic processes taking place on graphs, like diffusion. In particular, the PageRank algorithm, proposed by the Google founders Brin and Page [8], managed to turn Google into the leading interface between users and the World Wide Web. In recent work spectral properties of graph matrices have also been used to characterize the participation of nodes in network subgraphs (subgraph centrality) [9,10] and to estimate the bipartitivity of graphs [11].
However, spectral centrality measures have not been much investigated in the physics literature. We shall introduce and review four centrality measures: PageRank, eigenvector centrality [12] and the hub/authority scores introduced by Kleinberg for his HITS algorithm [13]. These measures are usually adopted on directed graphs, we shall as well discuss extensions to the undirected case, where applicable.
In Section II we present the measures and describe them in some detail. Analytical and numerical results on particular graphs will be shown in Section III, whereas in Section IV we shall compare the rankings of nodes of real graphs for different centrality measures. Conclusions will be reported in Section V.

II. CENTRALITY MEASURES
The basic matrix of a graph is the adjacency matrix A, where the element A ij equals 1, if nodes i and j are connected by a link, 0 if they are not. If the network is directed, the adjacency matrix is not symmetric. In this case, it is necessary to distinguish between two types of links adjacent to a node, i. e. links pointing to the node (incoming) and links pointing outside (outgoing). Therefore, there are two types of degree: indegree, i.e. the number of incoming links; outdegree, i.e. the number of outgoing links. Likewise, one distinguishes between the in-neighbors of a node, i.e. the nodes pointing at the node, and the out-neighbors, i.e. the nodes pointed at by the node. The directedness of the links has a number of important implications, involving both some basic structural concepts, like connectivity, and processes taking place on the network. For instance, a random walk is a stationary process on any undirected graph, but it is not in general on a directed graph, due to the possible presence of dangling ends, i.e. nodes with zero outdegree, that act as sinks for the process. On the other hand, diffusion leads to a natural definition of centrality, based on the frequency that a walker stops by a node during the process. In order to make a diffusive process stationary on a directed graph, one needs to give the walker the opportunity to leave from a dangling end. PageRank offers a simple solution, which we describe below.

A. PageRank
PageRank (PR) is the prestige measure used by Google to rank Web pages. It is supposed to simulate the behavior of a user browsing the Web. Most of the times, the user visits pages just by surfing, i.e. by clicking on hyperlinks of the page he is on; otherwise, the user will jump to another page by typing its URL on the browser, or going to a bookmark, etc.. On a graph, this process can be modelled by a simple combination of a random walk with occasional jumps towards randomly selected nodes. This can be described by the simple set of implicit relations Here, n is the number of nodes of the graph, p(i) is the PR-value of node i, k out (j) the outdegree of node j and the sum runs over the nodes pointing towards i. The damping factor q is a probability, that weighs the mixture between random walk and random jump. On practical applications it is usually set to small values (typically 0.15). For any q > 0 the process reaches stationarity, as a walker has a finite (no matter how small) probability to escape from a dangling end, whenever it lands there. When q = 0, the process may not be stationary and PR is ill defined. When q = 1, instead, the jumping process dominates and all nodes have the same PR-value 1/n. PR goes beyond indegree: in order to have a large PRvalue for a node it is important to have many neighbors pointing at a node, i.e. large indegree, but it is also important that the neighbors have large PR-values. So, if two nodes have equal indegree, the node with more "important" neighbors will have larger PR. Solving the set of equations (1) is equivalent to solving the eigenvalue problem for the transition matrix M, whose element M ij is given by the following expression: PR is just the principal eigenvector of M, and is usually determined with the power method, i.e. by repeatedly multiplying the matrix M by an arbitrary vector until all the entries of the resulting vector are stable. This is also the procedure we adopted to compute the eigenvectors corresponding to all centrality measures we studied. The literature on PR is very large, because of its huge impact on Web search. In one of the first theoretical studies [14], the dependence of PR on the damping factor was investigated. In general, the attention has been mostly focused on the graph of the World Wide Web, where Web pages are nodes and the hyperlinks their connections. Comparatively little has been done to study the measure on more general classes of networks. A recent mean field study [15] has shown that the average PR value of nodes with the same indegree is a linear function of indegree in the absence of degree-degree correlations. In another study, some analytical results were found on PR distributions on special classes of graphs [16]. In Section III A we shall briefly resume the results of [16] and build up on them.

B. Eigenvector centrality
The eigenvector centrality (EV) is also based on the principle that the importance of a node depends on the importance of its neighbors. In this case the relationship is more straightforward than for PR: the prestige x i of node i is just proportional to the sum of the prestiges of the neighboring nodes pointing to it From Eq. (3) we see that x i is just the i-component of the eigenvector of the transpose of the adjacency matrix with eigenvalue λ. We notice that the trivial eigenvector with all components equal to zero is always a solution of Eq. (3). The true EV is then associated to the existence of non-trivial solutions of the eigenvalue problem of Eq. (3). From Eq. (3) we see that nodes with indegree zero also have zero centrality: in general, nodes pointed at by nodes with zero centrality also have zero centrality and this effect will propagate to other nodes, so that in many cases EV would not give any information about a big number of nodes. To avoid this, it is useful to make the following modification: to each node we assign a prestige ǫ, which is independent of its relationships with the other nodes. Eq. (3) is then modified as follows: The role of the parameter ǫ reminds that of the damping factor q in PR. The parameter α weighs the relative importance of the contribution of the peers versus that of the node itself. The new measure is called α-centrality (αEV) [12] and is the one we shall investigate in this paper. We remark that, in contrast to PR, here the solutions do not have a natural interpretation in terms of probability, so the sum of the α-centralities need not be 1. However we shall normalize the final values by dividing them by their sum, so to make them add up to 1, for practical purposes.

C. HITS scores
Google's PR was not the first prestige measure for Web pages based on the Web's graph representation. Shortly before the seminal paper by Brin and Page, Jon Kleinberg [13] had proposed another solution to the problem of ranking Web sites based on their importance for the users. This solution was the HITS algorithm, which distinguishes two types of Web pages: hubs and authorities. Let us suppose that a user submits a query through a search engine. If a page is very relevant for this query, one can reasonably expect that it will be pointed at by many other pages. However, the simple indegree would not allow to discriminate the relevant pages from other pages with similar (large) indegree. An important difference is that pages pointing to a relevant page are likely to point as well to other relevant pages, so to create a sort of bipartite structure where relevant pages (authorities) are cited by special pages/indices (hubs). Such bipartite structures allow to identify the relevant pages for the user query. Therefore one assigns two scores to a page i of the Web: the hub score x i and the authority score y i . Pages with high authority scores are pointed at by pages with high hub scores. In turn, a good hub points at (very) authoritative pages. This mutually reinforcing mechanism is described by the coupled relations which can be rewritten in the form of simple eigenvalue equations for both x and y by substitution From Eqs. (7) and (8) we see that the hub and authority scores are just eigenvectors of the matrices AA t and A t A. We stress that both AA t and A t A are symmetric, whether A is symmetric or not. The scores x and y correspond to the principal eigenvectors of these matrices.

A. PageRank
In [16] the two main limits of the PR measure, corresponding to q → 0 and q → 1, were investigated. Analytical results can be derived for special graphs, such as graphs grown with popular mechanisms, like preferential attachment [17]. For our proofs we shall focus on the model by Dorogovtsev, Mendes and Samukhin (DMS) [18], which generates graphs with power-law degree distributions with any exponent larger than 2. In this model, at each time step a new node is added to the graph and m links are set from the new node to preexisting ones. The probability that a new node i gets attached to a node j (with indegree k j ) is where a is a positive constant. When a = m one recovers the recipe of the original preferential attachment formulation of Barabási and Albert [17]. In general, the exponent of the indegree distribution γ = 2 + a/m. For simplicity, we shall study the special case in which m = 1, i.e. each node has outdegree 1 and the network is a tree. The results are however independent of m.

The limit q → 0
We assume that q is very small. To the first order in q, and remembering that each node has outdegree 1 by construction, Eq. (1) takes the following form which looks particularly simple, though not generally solvable. From Eq. (10) we see that the PR of a node equals a constant plus the PR of its in-neighbors. This recipe enables to calculate PR recursively on simple trees, as shown in Fig. 1, where we focus on a subgraph of a tree. Node A is the root of the subgraph as every walk starting on any of the nodes will reach A at some stage. We call any node with this property a predecessor of A.
The PR value of any node of the graph is determined only by its predecessors. In the case illustrated, the calculation is particularly simple: we start from the leaves of the subgraph (empty circles) whose PR is just q/n because they have no incoming links, and move towards A. For each node, we apply the relation (10). The final values are reported next to the nodes. From this example we can deduce a number of general properties: • all PR values are multiples of the elementary unit q/n; • PR increases if one moves from a node to another by following a link; • the PR of each node i, in units of q/n, equals the number of its predecessors.
Since PR takes only discrete values, in the following we shall measure it in units of q/n. We thus indicate the distribution with P P R (l), with l = 1, 2, ..., n.
In a dynamic process like network growth, it is crucial to see what happens to the PR values/distribution when a new node comes into the picture. This is shown in Fig. 2, where a new node N is added to the network of Fig. 1. We see that only the nodes encountered along the path from N to A, including A, are affected, while the others retain their PR values. In particular the presence of the node N determines an increase by q/n in the PR values of the affected nodes. Now we are ready to build a master equation for the PR distribution P P R (l) on a DMS graph. At time n, the graph has n nodes and n − 1 links (the root does not generate links); the PR distribution is P P R n (l). If we add node n + 1 we get a new distribution P P R n+1 (l). As we have seen above, the new node will contribute an additional q/n to the PR of the nodes in the path from n + 1 to the root of the graph. We need to compute the balance between the nodes passing from PR l − 1 to l and those passing from l to l + 1. The probability Π n i that the PR of node i, initially equal to l, will be changed by the new node equals the probability that the link set by the new node gets attached to one of the predecessors of i (including i) and equals where j => i means that j is a predecessor of i. None of the predecessors of i, other than i can reach PR l + 1 because of the new node, as their initial values are necessarily smaller than l. The number of predecessors of i (including i) is l and the total number of adjacent links to the predecessors is l−1 (one for each predecessor, except i). So, The number of nodes with PR l that are affected by the presence of the new node and its link is then Π n (l) = nP n P R (l)Π n i = (a + 1)l − 1 (a + 1) − 1/n P n P R (l). (13) and the master equation reads (14) Eq. (14) holds for l > 1. For l = 1 a modification is necessary, as there cannot be nodes with zero PR, so the term Π n (0) is not defined. However, since the new node has no incoming links, the number of nodes with PR 1 increases by 1 because of the new node, so we can write The stationarity condition of Eqs. (14) and (15), in the limit of large n leads to the relations which has the solution We see that the PR distribution in the limit q → 0 on a DMS tree is a power law with exponent 2, for any value of the parameter a, including the limit case a → ∞, when the indegree distribution becomes exponential. This result is confirmed by numerical simulations (Fig. 3), which also show that the hypothesis of the tree is not necessary, as long as each node has the same outdegree m.
In [16] the same result was found for other models of network growth, like Barabási-Albert preferential attachment [17] and the Copying Model [19]. It is possible that this property holds for general graphs where the flows converge towards a central root (sink). Indeed, our finding agrees with the more general result on the size distribution of supercritical trees [20]. Moreover, numerical studies have shown that the same behavior holds for the graph of Internet, when one considers the distribution of the size of the basin connected to a given point [21]. Indeed, our calculation follows the same procedure usually adopted for the calculation of the area of basins in river networks.

The limit q → 1
The case q = 1 is well defined, but trivial, as all nodes end up having the same PR-value 1/n. We ask how this limit is reached. If q ∼ 1, the contribution to PR given by the in-neighbors of a node is very small compared to the constant term, which is close to 1/n. In order to study the behavior of this term, we define the reduced PageRank p r (i) of a node i as p r (i) = p(i) − q n i = 1, 2, . . . , n. We assume that all nodes have the same outdegree m.
In this case, to leading order in the infinitesimal 1 − q Eq. (1) can be rewritten as where k in (i) is the indegree of i. We conclude that on any graph, the reduced PR of a node in the limit q → 1 is proportional to the indegree of the node, if all nodes have the same outdegree. This result has been derived independently in [22]. As a consequence of Eq. (19), the distribution of the reduced PR for q → 1 has the same trend as that of indegree, which can be easily verified numerically (Fig.4).

Extension to undirected graphs
PR can be easily extended to undirected graphs as well. The corresponding equation reads where now k j is the degree of node j. For the purposes of a random walk, undirected links can be crossed in both directions, so a pure random walk now always reaches stationarity due to the absence of dangling ends. In fact, the stationary probability of a random walk on a node of any undirected graph is simply proportional to the degree of the node [23]. However, in Eq. (20) we have still the contribution of random jumping, and it turns out that the mixed process is still hard to solve. We are not aware of a general solution in this case. In the limit q → 0 PR is now well behaved, and its distribution coincides with the degree distribution of the graph. In Fig. 5 we show the distributions of reduced PR for different values of q on a DMS graph with a power law degree distribution and exponent γ = 3. The reduced PR expresses the contribution to PR given by the random walk. We see that the curves follow the decay of the degree distribution for any value of q. We have computed the reduced PR distribution on many other graphs and in all cases we found that they follow the same trend as the degree distribution. For example, in Fig. 6 we show the comparison between reduced PR and degree for a sample of the Web link graph. Here the nodes are Web pages of the domain .gov and two pages are connected if there is a hyperlink from one to the other. There are 794, 184 nodes and 6, 460, 903 links. The graph is directed but PR was calculated by neglecting the directedness of the links. As we can see, the decay of the distributions of reduced PR resembles that of the degree distribution. The graph at hand is not simple like the DMS networks, as it presents a large number of loops and community structure. Therefore the result is likely to be general. We can show this with a simple argument. The general equation for reduced PR on undirected graphs is: that we can solve formally by successive iteration, obtaining the general form where i s indicates the neighbors of the s-shell of the node i; so, i 1 indicates the nearest neighbors of i, i 2 the nextto-nearest neighbors, and so on. The last sum in the first line of Eq. (22) is, for a given node i s−1 , a sum over its neighbors i s . This sum, that we call T is , contains k is terms, k is being the degree of node i s . The sum T is can be approximated as the product k is 1/k N N , where 1/k N N is the expected value of the average of 1/k over the neighbors of a node of the network. In general, T is = k is 1/k N N + η is , where η is is a random variable with mean zero. In this way, it is easy to see from Eq. (22) that, for any value of s, the product of sums reduces to k i 1/k N N plus the sum of many random variables like η is . Due to the Central Limit Theorem, the latter sum, if it includes a large number of terms, yields a very small value with large probability. We can then conclude that, for k i sufficiently large, each term of the series in Eq. (22) is proportional to k i with good approximation, therefore p r (i) is also proportional to k i , for any value of the damping factor q. We have verified numerically that this assertion is true for many graphs and degree distributions, without finding exceptions.  B. Eigenvector centrality

Directed graphs
The defining Eq. (4) is formally analogous to Eq. (10). The only difference is that the eigenvalue α is not 1 as for PR. However, the results of Section III A 1 hold as well when the outdegree m is greater than 1 (as long as it is the same for all nodes), and in this case the sum of Eq. (10) would include a multiplicative factor 1/m, which makes it identical to Eq. (4). We then deduce that all results found for PR in the limit q → 0 hold for αEV. Here the results are more general, because we did not need to make any approximation to get to Eq. (4) as we instead needed to derive Eq. (10). In particular, it is not necessary that ǫ be very small and the nodes need not have the same outdegree, although this is the case for the graphs we considered. We conclude that the distribution of αEV on DMS graphs has a power law tail with exponent 2 (Fig. 7). The same holds for graphs built using preferential attachment and the Copying Model, just as it happens for PR in the limit q → 0.

Extension to undirected graphs
On undirected graphs, Eq. (4) becomes since A t = A. So, the αEV of a node is proportional to the sum of the αEV of its neighbors, modulo an additive constant ǫ. As we have done for PR, we define the reduced α-centrality as So, we can rewrite Eq. (24) as where k i is again the degree of node i. We can apply a similar argument as in Section III A 3. The sum over the k i neighbors of i can be approximated as k i x r , where x r is the average of the reduced αEV over the whole graph. The approximation is the more valid, the larger the number k i of summands. In this way, from Eq. (25) we see that the reduced αEV of a node is proportional to its degree, if the latter is large enough. This result is independent of the specific graph we consider, and we have verified it numerically for many types of networks.
In Fig. 8 we show the distribution of reduced αEV for different choices of the parameter ǫ/α for the sample of the Web graph we analyzed in Fig. 6. The curves closely follow the decay of the degree distribution.

C. HITS scores
The meaning of the eigenvalue equations (7) and (8) is quite simple. The hub score of a node is the sum of the hub scores of the in-neighbors of the out-neighbors of the node. The authority score of a node is the sum of the authority scores of the out-neighbors of the in-neighbors of the node (Fig. 9). Let us suppose that the nodes have the same outdegree m. The authority score of a node i is given by the sum of mk in (i) terms, where k in (i) is the indegree of i. In fact, node i has k in (i) in-neighbors, each of them having m out-neighbors. If k in (i) is large, the number of summands is very large, and can be approximated by the average value of the authority score over the whole graph, times mk in (i). This approximation is the more valid, the larger m and k in (i). We conclude that on a directed graph with constant outdegree the distribution of the authority scores will have the same tail as the indegree distribution. This is clearly illustrated in Fig. 10. For the hub scores it is not possible to make predictions; the sum that delivers the hub score of a node cannot be approximated through other graph variables in most cases. The extension of the HITS scores to the case of undirected graphs is not interesting. In this case A t = A, so A t A = AA t = A 2 and the hub and authority scores are identical. Moreover, they coincide with EV, as the matrices A and A 2 have the same eigenvectors.

IV. RANKINGS
In the previous sections we have investigated the distributions of spectral centrality measures and their similarities. As we have mentioned in the Introduction, centrality measures are used to rank nodes. In this section we shall compare the rankings obtained with different centrality measures. In order to compare two rankings we adopt Kendall's τ [24], a widely used index in this type of analysis. Kendall's τ ranges from 1 (perfect correlation) to −1 (perfect anticorrelation). In Table I we show the cross-comparisons between all centrality measures we discuss in this work, for a DMS directed graph. For completeness we have included the outdegree as well. As we can see, PR, αEV and the authority scores are well correlated with indegree and with each other, whereas the other coefficients are small or negative; αEV has a strong correlation with outdegree as well.
DMS graphs have a fairly regular structure; we have seen that in this case the behavior of centrality measures is quite regular, and that there are simple relations between their distributions, which may be determined by simple relations between a measure and indegree at the level of the single node. Therefore, we cannot deduce  general conclusions from Table I and we repeated the analysis for two real world networks: a network of political blogs and the subset of the Web link graph corresponding to the URLs of the domain .gov, that we have studied in the previous sections. The first network is a citation network consisting of 1490 blogs; 758 are democratic and 732 republican. It was first studied by Adamic and Glance [25], who focused on the community structure of the graph, which matches that determined by the two political areas. The

V. CONCLUSIONS
Centrality measures are very important to understand the properties of the nodes of complex networks and their topological roles. We have studied the most important centrality measures based on properties of graph matrices: PageRank, Eigenvector centrality, and the hub and authority scores of HITS. All these measures deduce the importance of a node in a self-consistent way from the importance of its nearest neighbors and, in the case of the HITS scores, of its next-to-nearest neighbors. We have resumed some recent results on PageRank distributions on particular types of tree-like graphs. On those graphs, the distribution of PageRank in the limit q → 0 decays as a power law with exponent 2. The same is true for αcentrality, because its defining equation is formally equivalent to the equation for PageRank in the limit q → 0. These results on centrality distributions are likely to be true for an extended class of graphs, where there is a flow from the outermost nodes (leaves) to a sink. We have also seen that, on any graph, in the limit q → 1, the reduced PageRank of a node, i.e. the contribution of the random walk process to the measure, is simply proportional to the indegree of the node, if the nodes have (about) the same outdegree. We have studied for the first time the extension of PageRank to the case of undirected networks, finding that the reduced PageRank of a node is proportional to its degree, for large degrees, for any graph and value of q. We proposed a simple explanation of this effect based on the Central Limit Theorem, and verified numerically in several cases that the argument holds. Similarly, the reduced α-centrality of a node is also proportional to its degree, for large degrees, on any graph. With the same type of argument it is possible to show that the authority score of a node is proportional to its indegree, for large indegrees, when the outdegrees of all nodes are (approximately) the same.
We conclude that there are often strong relations between our centrality measured and (in)degree: some relations hold on particular graphs and/or limits, others are more general. These findings imply that the measures are often strongly correlated with each other. We have indeed seen that the rankings of nodes according to the centrality measures we have considered are quite close to each other for indegree, PageRank, Eigenvector centrality and authority score on graphs built with the prescription of Dorogovtsev, Mendes and Samukhin. We have shown in the paper that these graphs have special properties, and that some measures may be correlated to each other. Instead, on real graphs, like the networks of political blogs and the sample of the Web graph we have considered, the structure is less regular and the measures are far less correlated to each other, as confirmed by the small values of the Kendall's τ for each pair of centrality measures. This means that, for practical purposes, and in spite of their similarities, spectral centrality measures look at nodes from different perspectives, and allow to diversify their roles within the network, obtaining in this way more information about the importance of nodes. The scores computed from spectral centrality measures can complement the information about node's centrality derived from more traditional measures like node betweenness [26]. This is especially important for directed graphs, where node betweenness, as well as other measures based on geodesic paths, like closeness [27], are not well defined.