Introduction

Random walks, as a fundamental tool, have been widely used in the fields of economics, computer science and natural sciences. Based on quantum mechanics, quantum walks are proposed as the quantum analog of classical random walks1,2,3,4. Both discrete-time1,3,4 and continuous-time2 versions are introduced corresponding to their classical counterpart. Benefited from the superposition of quantum systems, quantum walks have fundamentally different behavior compared to classical random walks, and become an essential tool in quantum computation and quantum algorithms. Childs proves that universal computation can be implemented by continuous-time quantum walks (CTQWs)5, and Lovett et al. present a version on discrete-time quantum walks (DTQWs)6. Moreover, quantum walks provide efficient quantum algorithms in a variety of scientific disciplines, such as search algorithm7,8,9, element distinctness10,11 and graph isomorphism12,13.

Vertex centrality ranking algorithm is another promising application of quantum walks. Vertex centrality is an integral tool in graph theory and network analysis, quantifying the importance of each node. The higher of the centrality measures, the more important of the corresponding nodes in the network. Centrality analysis has been widely used in ranking the webpages on the Internet14,15, identifying the most influential people in social networks16, finding out critical infrastructure nodes in urban networks17, and searching for super spreaders of infectious diseases18. There are several classical centrality measures including degree centrality, closeness centrality, betweenness centrality, eigenvector centrality and PageRank centrality. In general, distinct centrality measures underline different characteristics of the network, and are used in different scenarios.

As quantum walk outperforms its classical counterpart in many algorithmic applications19,20, various centrality algorithms based on quantum walks have been proposed. Quantum PageRank algorithm is proposed by Paparo and Martin-Delgado using Szegedy's quantum walks (SQWs)21. Compared to the classical algorithm, the quantum PageRank algorithm is more sensitive, i.e., capable to highlight the secondary hubs and resolve the degeneracy of low lying nodes22. The SQW allows unitary evolution on directed and weighted graphs, but the Hilbert space required is \(N^2\)-dimension for a graph with N nodes. To physically implement quantum centrality in a smaller state space, Izaac et al. propose a quantum centrality measure based on CTQW. This CTQW-based centrality measure using a significantly smaller Hilbert space compared with the quantum PageRank algorithm, while taking advantage of the quantum speedup compared with the continuous-time random walk23. The CTQW-based centrality is limited to undirected network structures in the original study. The following works extend the CTQW-based centrality to directed networks24 and experimentally demonstrate the quantum centrality ranking on directed graphs25,26.

Except for the direction of connections in networks, the weight of connections is also an essential factor in real-world networks. For instance, Radicchi et al. define the weighted citation network between authors, and use it to analyze the scientific impact of physicists27. Another example is to identify the super spreaders in an outbreak of infectious disease18. The close contacts and accidental meetings usually face different infection risks, and should be marked differently in contact tracing to better control the spread of the virus. These two examples can be abstracted to centrality ranking problem, where the prominent physicists in citation networks and the super spreaders of infectious diseases are denoted by higher centrality measure. The weight or the number of connections between two nodes effect the centrality ranking in these cases.

In this work, we extend the CTQW-based centrality measure to the weighted graph for the first time. We test an ensemble of weighted graphs with various topologies to validate the feasibility and reliability of this quantum centrality. The correlation coefficients between the rankings given by CTQW-based centrality and eigenvector centrality are pretty high for all the tested graphs, and intuitive consistency of the top-ranked vertices given by this quantum centrality measure and classical centrality measures is also demonstrated on large-scale weighted graphs. What's more, we also find the advantage of the CTQW-based centrality in distinguishing the important vertices from the ones with less importance.

Results

The time evolution of the CTQW is described by the time-independent Hamiltonian, which is determined by the underlying network structure. Specifically for an undirected graph G with n vertices, a quantum walker evolves in the walking space spanned by \(\{|1\rangle ,|2\rangle , \ldots ,|n\rangle \}\), which is an orthogonal basis corresponding to n vertices. The Schrödinger equation governs the evolution of CTQW on graph G 2,22:

$$\begin{aligned} i\hbar \frac{d}{dt}|\psi (t)\rangle =H|\psi (t)\rangle , \end{aligned}$$

(1)

where the Hamiltonian is the adjacent matrix (\(H=A\)) and

$$\begin{aligned} A_{ij}= {\left\{ \begin{array}{ll} w_{ij}&{} \mathrm{\ for\ node}\ i\ \mathrm{and}\ j\ \mathrm{\ connected\ with\ weight\ }w_{ij},\\ 0&{} \mathrm{\ for\ node}\ i\ \mathrm{and}\ j\ \mathrm{\ not\ connected}. \end{array}\right. } \end{aligned}$$

(2)

To extend the CTQW-based centrality measure to weighted graphs, it should be noted that the elements in the adjacent matrix A denote the weight of each edge. Solving the Schrödinger equation with \(\hbar =1\), we get the state of the quantum walker at time t:

$$\begin{aligned} |\psi (t)\rangle&= e^{-i H t}|\psi (0)\rangle =\sum _{i=1}^{n} \alpha _{i}(t)|i\rangle . \end{aligned}$$

(3)

\(|\psi (t)\rangle\) is a superposition state in the walking space, where the probability amplitude on node i at time t is \(\alpha _{i}(t)=\langle {i|\psi (t)}\rangle\). The probability of the walker at node i is \(P_{i}(t)=\left| \alpha _{i}(t)\right| ^{2}\).

For the centrality measure based on CTQWs, the evolution starts from the initial state \(|\psi (0)\rangle =\frac{1}{\sqrt{n}} \sum _{i=1}^{n} |i\rangle\). The quantum walker propagates on graph G following Eq. (3). The CTQW-based centrality is calculated by the long-time average of the walker located at each vertex22:

$$\begin{aligned} c_i^{(CTQW)}=\bar{P_{i}}=\lim _{t \rightarrow \infty } \frac{1}{t} \int _{0}^{t} \left| \langle {i|\psi (t)}\rangle \right| ^{2} d t. \end{aligned}$$

(4)

In Fig. 1, we use a simple example to demonstrate the numerical simulation of the CTQW-based centrality on a weighted graph. Figure 1a gives a typical 5-node network, and the weights are marked on each edge. The probability on each vertex as a function of evolution time is shown in Fig. 1b. The dotted line denotes the average probability and is the CTQW-based centrality of each vertex. According to these centrality values, the ranks of node 1 to node 5 are 2, 3, 3, 3, 1 respectively, which are the same as the order given by eigenvector centrality. The previous works show that the CTQW-based centrality correlates well with the eigenvector centrality, and works excellently as a centrality measure on unweighted graphs23,24. The simple example in Fig. 1 shows the possibility that the CTQW-based centrality may still work on weighted graphs. We now generalize the CTQW-based centrality to the weighted graphs and study the performance of this quantum centrality measure.

Figure 1
figure 1

(a) A typical 5-node network. (b) Probability distribution on each vertex i along the evolution time t, where the three red vertices show identical behaviours. The dotted line denotes the average probability, thus the CTQW-based centrality of each vertex \(c^{(CTQW)}_i\).

Full size image

Table 1 The average correlation coefficients for graphs with different topologies.

Full size table

To validate our proposal's feasibility, we conduct statistical analysis over an ensemble of randomly generated weighted graphs, including connected, planar, Eulerian, vertex critical, edge critical, self-complementary, cubic planar, hypo-Hamiltonian, Erdős-Rényi and scale-free graphs, 41,675 graphs in total. The original graphs are undirected and unweighted. So we add a weight \(w=2\) on a randomly chosen edge to all graphs in each group. The tested graphs are listed in Table 1. Figure 2 intuitively shows the correlation of the eigenvector and CTQW-based centralities in the ranking problem. Referring to the time analysis of the centrality based on DTQWs28, all the CTQW-based centralities of weighted graphs in this paper are calculated over the same timescale, i.e., \(t=20\pi\) instead of \(t \rightarrow \infty\). To quantitatively evaluate the agreement between the rankings by eigenvector and CTQW-based centralities, we employ Kendall's \(\tau\) correlation coefficient29 (see "Methods" for the calculation of \(\tau _{Kendall}\)). \(\tau _{Kendall}\) takes values from \(-1\) to 1, wherein \(\tau _{Kendall} = 1\) denotes the same ranking orders by different centrality measures. Two rankings with \(\tau _{Kendall}\) at or above 0.9 are considered effectively equivalent30,31, at least empirically32,33. It can be seen that among all generated weighted graphs listed in Table 1, the \(\tau ^{w=2}_{Kendall}\) between the eigenvector and the CTQW-based centrality measures are pretty high except for the cubic planar and scale-free graphs.

Figure 2
figure 2

(a) A randomly generated Erdős-Rényi graph ER(10, 0.3) with an additional weight \(w=2\) added on a random edge. (b) The eigenvector centralities (dotted red line) and CTQW-based centralities (solid blue line) for vertices of the graph in (a).

Full size image

To find the reason causing the imperfect correlation, the eigenvector and the CTQW-based centralities of the cubic planar graph and the scale-free graph with the minimum \(\tau _{Kendall}\) are shown in Fig. 3. We can see that the correlation is lowered by the discordances in low-lying vertex centralities while the important vertices with large centralies ranked the same by the eigenvector and the CTQW-based centrality measures. However, the low-lying centrality usually give little information and we care more about the top-ranked vertexes in most cases. The calculation of \(\tau _{Kendall}\) does not make any distinctions and equally penalizes discordances both at high and low rankings. There have been many researches to cover this flaw of \(\tau _{Kendall}\) in certain applications31,34,35,36,37,38, and we further employ a weighted variant of Kendall's correlation coefficient introduced by Vigna38, \(\tau _{Vigna}\), to evaluate the agreement between the rankings by eigenvector and CTQW-based centralities. The Vigna's rank correlation coefficient gives more weight to the discordances at high rankings, whose usefulness has been validate on social networks and web graphs38. The average \(\tau _{Vigna}\) for each graph set is listed in Table 1. The correlation coefficient values increase especially for the cubic planar and scale-free graphs as expected. The average \(\tau _{Vigna}\) of all the tested 41,675 graphs is 0.963, which indicates a consistent ranking order with eigenvector centrality achieved on large-scale test. Hence, it is reasonable to utilize our CTQW-based centrality measure to solve the centrality problem on weighted graphs.

Figure 3
figure 3

(a) The cubic planar graph with the minimal \(\tau ^{w=2}_{Kendall}\) of all the tested cubic planar graphs. (b) The eigenvector centralities (dotted red line) and CTQW-based centralities (solid blue line) for vertices of the graph in (a). (c) The ranking orders for the vertices of the graph in (a) by the eigenvector centrality measure and CTQW-based centrality measure. (d) The scale-free network SF(100, 2) with the minimal \(\tau ^{w=2}_{Kendall}\) of all the tested SF(100, 2) with only one edge weighted 2. (e) The eigenvector centralities (dotted red line) and CTQW-based centralities (solid blue line) for vertices of the graph in (d).

Full size image

The above analysis based on correlation coefficients has shown the excellent consistency of the rankings by CTQW-based centrality and eigenvector centrality. However, from the correlation coefficients we are still not sure if the top-ranked vertices hold the exactly same ranking order. So it is proper to give an intuitive demonstration of the consistence details. As most cases especially concern the top ranks, we pay more attention to the top-ranked vertices. Figure 4 intuitively demonstrates the consistence of rankings by PageRank, eigenvector and CTQW-based centralities on ensembles of the large-scale weighted graphs. Concretely, we consider two of the most paradigmatic network topologies: Erdős-Rényi graphs39 and scale-free networks40. An Erdős-Rényi graph denoted by ER(n,p) is comprised of n vertices with edges randomly distributed following the Bernoulli distribution with probability p. For such a network, the vertex degree distribution P(k) (the fraction of vertices with degree k) follows binomial form, i.e., most vertices have a degree close to the mean number of connections, \(n\cdot p\). A scale-free network SF(n,m) is generated by Barabási-Albert algorithm41 with n vertices and the probability of k-degree vertex \(p(k) \propto \frac{1}{k^m}\). In a scale-free network, most vertices have only a few connections with others, and a few vertices are connected with a large number of other vertices, which are called hub vertices. We take the eigenvector centrality measure as the benchmark and sort the vertices by the eigenvector centrality values. The average CTQW-based centrality, eigenvector centrality and PageRank centrality of each vertices over the ensemble of ER(100, 0.3) and the ensemble of SF(100, 2) are shown in Fig. 4a,b respectively. The 100 vertices are ranked by their eigenvector centralities, so the eigenvector centrality (grey dotted line) decreases monotonically. It is obvious that the vertices with the top 10 eigenvector centralities are also top of the CTQW-based and PageRank centrality rankings, and the Pagerank (blue triangle) and the CTQW-based (red circle) centrality values also present monotone decreasing tendency, which means that the ranking orders are the same as the eigenvector centrality. Moreover, Fig. 4a,b show distinctive centrality distributions corresponding to the topological features of Erdős-Rényi and scale-free networks. The centrality values of the most important vertices in scale-free networks are almost one order of magnitude higher than those in Erdős-Rényi graphs, i.e. the few hub vertices in scale-free network show a more dominant role in the whole network. These features indicate the reliability of the CTQW-based centrality on weighted graphs in ranking the top-ranked vertices.

Figure 4
figure 4

The average CTQW-based, eigenvector and PageRank centralities for vertices over an ensemble of 200 Erdős-Rényi graphs ER(100, 0.3) with only one weighted edge \(w=2\) (a), scale-free networks SF(100, 2) with only one weighted edge \(w=2\) (b), ER(100, 0.3) with all edges weighed in [1, 10] (c), and SF(100, 2) with all edges weighed in [1, 10] (d), The vertices are sorted by the eigenvector centrality measure and the shaded areas represent one standard deviation from the average centralities among 200 graphs. It is obvious that the range of CTQW-based centrality measure \(R_{CTQW}\) is much bigger than other measures.

Full size image

It is worth noting that the range of the CTQW-based centrality is larger than the eigenvector centrality and PageRank centrality, which means the better distinction of the vertex centrality ranks. We use the range \(R=c_{max}-c_{min}\) to evaluate the distribution of the centrality values. \(R_{CTQW}\) for CTQW-based centrality measure is almost twice the \(R_{EV}\) and \(R_{PR}\) for eigenvector and Pagerank centrality measures on the randomly generated Erdős-Rényi and scale-free graphs. It is reasonable to utilize the distinguishing ability of CTQW-based centrality measure to pick the important vertices from the ones with less importance.

Figure 5
figure 5

(a) CTQW-based centralities on an ER(100, 0.3) by traversing weight of an edge from 1 to 10. The randomly chosen edge connects vertex 12 and 69. The inset graphs show details of centrality changes near vertex 12 and 69. (b) More weighted edges on Erdős-Rényi graphs ER(100, 0.3). The number of weighted edges, m, ranges from 1 to 5, and the weight \(w=2\) is added to the edge (4, 7), (26, 37), (41, 48), (66, 79) and (89, 99) in succession. The vertical dotted lines show the endpoint vertices of edges with additional weights. The inset graphs give details of centrality changes near these endpoint vertices.

Full size image

It has been shown that the CTQW-based centrality measure works well on weighted graphs with \(w=2\) added on one randomly-chosen edge. The weighted graphs must be more complicated in the real world, so we further investigate the CTQW-based centrality by varying weight and choosing more weighted edges. First, we generate an Erdős-Rényi graph ER(100, 0.3) and assign different weights from 1 to 10 to the edge connecting vertex 12 and 69. Then we conduct the numerical simulations to observe the changes of CTQW-based centrality values for each vertex. The results are shown in Fig. 5a, where different weight cases correspond to lines of different colors. It can be seen that there is little influences on vertices other than the endpoint vertex 12 and 69 of the randomly chosen edge with additional weights. From the insets of Fig. 5a, it is clear that the centrality values rise up as the weight increasing. Besides varying the weight of a certain edge, we also considering the case of multiple weighted edges. For the ER(100, 0.3), we randomly choose 5 edges and add the weight \(w=2\) to these edges in succession. The calculated CTQW-based centralities are shown in Fig. 5b, which also indicates that the weight mainly influence the centralities of the corresponding endpoints. This conclusion is in line with the intuitive cognition.

Based on the above analysis, we finally test an ensemble of graphs whose each edge is given a random weight \(w \in [1,10]\). The original graphs are the same as those listed in Table 1, but the weight of each edge is newly generated. Numerical analysis based on \(\tau _{Kendall}\) and \(\tau _{Vigna}\) is conducted on these new weighted graphs, and the results are shown in Table 1. It is clear that the correlation coefficients are still reasonably high with \({\bar{\tau }}^{w_{(i,j)}\in [1,10]}_{Vigna}=0.967\), which indicates the excellent consistency of the rankings by CTQW-based centrality and eigenvector centrality. Figure 4c,d further intuitively demonstrate the rankings by PageRank, eigenvector and CTQW-based centralities on the new weighted ER(100, 0.3) and SF(100, 2) graphs respectively. The reliability in ranking the top-ranked vertices and the distinguishing ability of CTQW-based centrality still holds in these large-scale graphs with all random-weighted edges. In conclusion, it is reasonable to extend the CTQW-based centrality to the weighted graphs.

Discussion

In summary, we extend the CTQW-based centrality to weighted graphs for the first time, which expands the use of CTQW-based centrality measure to more realistic applications. Based on the numerical analysis on various weighted graphs, we testify the feasibility and reliability of this quantum centrality. The correlation coefficients between the rankings by CTQW-based centrality and eigenvector centrality are pretty high, and the ranks of top-ranked vertices given by this quantum centrality and the classical centralities consist well according to the intuitive demonstrations. Furthermore, we find that the CTQW-based centrality measure show better distinguishing ability to pick the important vertices from the ones with less importance. All the excellent results are obtained using an instance simulation time for CTQW-based centralities. For the precise analysis of this quantum centrality efficiency, further investigation is needed to compare with the classical algorithms.

Methods

Kendall's \(\tau\) correlation

Suppose \(X = \langle x_{1}, x_{2}, \ldots , x_{n} \rangle\) are eigenvector centralities of vertices in graph G, and \(Y = \langle y_{1}, y_{2}, \ldots , y_{n} \rangle\) are CTQW-based centralities. The subscript from 1 to n identifies the vertex. The Kendall's \(\tau\) coefficient is used to measure the agreement between the rankings given by these centrality measures, i.e.,

$$\begin{aligned} \tau _{Kendall}&=\frac{\sum _{i<j} sgn\left( x_i-x_j\right) sgn\left( y_i-y_j\right) }{\sqrt{\sum _{i<j} sgn\left( x_i-x_j\right) sgn\left( x_i-x_j\right) }\sqrt{\sum _{i<j} sgn\left( y_i-y_j\right) sgn\left( y_i-y_j\right) }}\nonumber \\ &=\frac{\sum _{i<j} sgn\left( x_i-x_j\right) sgn\left( y_i-y_j\right) }{\sqrt{n(n-1)/2-t_X}\sqrt{n(n-1)/2-t_Y}}, \end{aligned}$$

(5)

$$\begin{aligned} sgn\left( r\right)&= \left\{ \begin{array}{ccc} 1 &{} \text{ if } r>0 \\ 0 &{} \text{ if } r=0 \\ -1 &{} \text{ if } r<0 \end{array}\right. , \end{aligned}$$

(6)

where \(n(n-1)/2\) is the total number of pairs (i,j) with \(i<j\) and \(t_X\ (t_Y)\) is the number of tied pairs in the ranking \(X\ (Y)\). For arbitrary pair of vertices \(\left( i, j\right)\), the two centrality measures are said to be concordant if \(sgn\left( x_{i}-x_{j}\right) sgn\left( y_{i}-y_{j}\right) >0\), and discordant if \(sgn\left( x_{i}-x_{j}\right) sgn\left( y_{i}-y_{j}\right) <0\). A tie reflects the inability of the centrality measure to decide which item should be ranked first, and the tied pair with \(\left( x_{i}-x_{j}\right) =0\) or \(\left( y_{i}-y_{j}\right) =0\) can be considered neither concordant nor discordant. The coefficient \(\tau _{Kendall} = 1\) if and only if there is a perfect correspondence between the rankings of vertices in G with reference to the different centrality measures, and \(\tau _{Kendall} = -1\) indicates that the rankings are exactly inverted. Therefore, the coefficient \(\tau _{Kendall}\) closer to 1 means that the CTQW-based centrality is more consistent with eigenvector centrality measure, and is feasible as a evaluation criterion.

The weighted correlation index

\(\tau _{Vigna}\). Vigna's Correlation index \(\tau _{Vigna}\) for rankings extends Kendall's definition taking into account weights of concordances and discordances between vertices with different ranks in the presence of ties. The weight function used in this paper is

$$\begin{aligned} w(i,j)=\frac{1}{\rho (i)}+\frac{1}{\rho (j)}. \end{aligned}$$

(7)

\(\rho (i)\) is the ranking function associating each vertex with a rank. In this paper, \(\rho _{X,Y}(i)\) and \(\rho _{Y,X}(i)\) give a unique rank to each vertex. We denote different ranking functions by distinct subscripts. \(\rho _{X,Y}(i)\) is defined by ranking vertices in descending order with respect to X and then Y. For the vertices tied both in X and Y, they can be placed in any order. The function \(\rho _{Y, X}(i)\) is defined analogously. The weighted correlation index is calculated by

$$\begin{aligned} \begin{aligned} \tau _{Vigna} & = \frac{1}{2} \left(\frac{\sum _{i<j} sgn\left( x_i-x_j\right) sgn\left( y_i-y_j\right) w_{X, Y}(i,j)}{\sqrt{\sum _{i<j} sgn\left( x_i-x_j\right) w_{X, Y}(i,j)}\sqrt{\sum _{i<j} sgn\left( y_i-y_j\right) w_{X, Y}(i,j)}} \right. \\ & \quad \left. +\frac{\sum _{i<j} sgn\left( x_i-x_j\right) sgn\left( y_i-y_j\right) w_{Y, X}(i,j)}{\sqrt{\sum _{i<j} sgn\left( x_i-x_j\right) w_{Y, X}(i,j)}\sqrt{\sum _{i<j} sgn\left( y_i-y_j\right) w_{Y, X}(i,j)}}\right). \end{aligned} \end{aligned}$$

(8)

The Kendall's \(\tau\) coefficient is lowered by the discordances of the vertices with large ranks comparing to Vigna's weighted correlation index.