In this paper, we explore experimentally the use of the commute time of the continuous-time quantum walk for graph drawing. For the classical random walk, the.
Graph Drawing using Quantum Commute Time David Emms, Edwin Hancock and Richard Wilson Department of Computer Science, University of York, York YO10 5DD, UK. Abstract In this paper, we explore experimentally the use of the commute time of the continuous-time quantum walk for graph drawing. For the classical random walk, the commute time has been shown to be robust to errors in edge weight structure and to lead to spectral clustering algorithms with improved performance. We analyse the quantum commute times with reference to their classical counterpart. Specifically, we explore the graph embeddings that preserve commute-time.
1. Introduction Random walks have been used to formulate a number of powerful algorithms for the analysis of graph structure, and these have found applications in areas such as network analysis, circuit design, pattern recognition and machine learning. One of the attractive features of classical random walks, is that they can be conveniently analysed using graph-spectral methods. For instance, the steady state random walk on a graph is determined by the leading eigenvector of the weighted adjacency matrix or equivalently the Fiedler vector of the Laplacian matrix [5]. In addition, local properties of the random walk such as hitting and commute times can also be conveniently computed using the Laplacian spectrum [2]. Commute time has been used to develop graph-spectral clustering algorithms based on embedding that are robust to modifications in local edge structure due to noise [6]. Recently, with the growing interest in quantum computation, quantum walks have been investigated as alternatives to classical walks. The quantum walk differs from the classical walk in that its state vector is complex-valued rather than real-valued and its evolution is described by unitary rather than stochastic matrices. This allows different paths in the walk to interfere, producing remarkably different probability distributions on the vertices of the graph. Exponential speedups have also been observed in the hitting times of particular vertices in some graphs. In a recent paper we have extended the concept of commute time from clas-
978-1-4244-2175-6/08/$25.00 ©2008 IEEE
sical random walks to continuous time quantum walks [3]. The quantum commute-time de-emphasises the effect of distance corresponding to long paths between nodes. This has been shown to offer advantages when applied to the problem of graph-clustering. The aim in this paper is to further analyse quantum commute time, and to explore its potential for the purposes of graph drawing. This is a challenging problem that has been approached using a number of techniques including minimum distortion embeddings and spectral graph theory. An empirical study shows not only that the method advantages over the classical commute in terms of the quality of the embeddings of graphs in the 2D plane, but can also be used to detect symmetries in graphs.
2. Classical Commute Time In this section, we briefly review some of the properties of the classical random walk on a graph, and the relationship between the commute time and the Laplacian spectrum. To commence, consider the graph G = (V, E) where V is the set of nodes, E ⊆ V × V is the set of edges. The adjacency matrix of the graph has elements ½ A(u, v) =
1 0
if (u, v) ∈ E otherwise
Further, let D = diag(degu ; u ∈ V) be diagonal Pthe n degree matrix with elements degu = v=1 A(u, v), where n = |V| is the number of vertixes in the graph. The Laplacian matrix is given by L = D − A. The spectral decomposition of the Laplacian is L = ΦΛΦT , where Λ = diag(λ1 , λ2 , ..., λn ) is the diagonal matrix with the ordered eigenvalues as elements satisfying the condition 0 = λ1 ≤ λ2 . . . ≤ λn and Φ = (φ1 |φ2 |....|φn ) is the matrix with the ordered eigenvectors as columns. The commute time C(u, v) is the expected time for a random walk to travel from node u to reach node v and then return. It can be shown that the commute time is
determined by the Laplacian spectrum and that C(u, v) =
n X 1 2 (φj (u) − φj (v)) λ j j=2
(1)
Let Y be an embedding matrix with the node coordinates as columms. The embedding that preseves commute time is Y = Λ−1/2 ΦT .
entrance
exit
PSfrag replacements
Figure 1. Graph formed by randomly connecting a pair of 5-level binary trees at the ‘leaves’.
−3
Quantum 150
4
Classical
x 10
3 100
2 1
50 0 −1 0 −2 −3
−50
−4 −100 −100
−50
0
50
100
150
200
250
−5 −3
−2
−1
0
1
2
3
4
5
6 −3
x 10
Figure 2. Quantum and classical commute time embeddings of the pair of 5-level binary trees joined at the the ‘leaves’. The structure of the graph can be seen in Figure 1. The vertices of the one graph are plotted as circles, those of the other as stars. Vertices at different levels of the trees are different colours.
If the walk is at vertex u, the componenets of the state vector corresponding to vertices adjacnet to u change 1 . The basis states for the at a rate proportional to d(u) continuous-time quantum walk are vectors corresponding to particular vertices, as is the case for the classical random walk. The basis state corresponding to the walk being at u ∈ V is written, in Dirac notation, as |ui. A general state of the walk is a complex-linear combination of these basis states and so the state of the walk at |V| time t is given by a vector, |ψ Pt i ∈ C , which we write componentwise as |ψt i = u∈V αu (t)|ui.. Thus, the amplitudes αu (t) ∈ C. The probability of the walk being in a particular state is given by the square of the amplitude of that state. Let Xt be the random variable giving the location of the walk at time t. The probability of being at u ∈ V at time t is given by Pr(X t = u) = αu αu∗ , where αu∗ is the complex conjugate of αu . As the total probability must sum to unity, we have P that |αu (t)| ∈ [0, 1] for all u ∈ V, t ∈ R+ , and u∈V αu (t)αu∗ (t) = 1 for all t ∈ R+ . The evolution of the state vector is d given by dt |ψt i = −iL|ψt i.. Since the evolution of the probability vector of the walk at time t depends on the state vector of the walk (not merely the probability vector), we note that, unlike the classical walk, the quantum walk is not a Markov chain. Given an initial state for the walk, |ψ0 i, Equation 3 can be solved to give |ψt i = e−iLt |ψ0 i.. Thus, given the initial state, we can calculate the state of the walk at an time, t. Let H(u, v) be the random variable giving the first hitting time of the vertex v. That is, H(u, v) = t min{t|X(u) = v}. We note that, due to the symmetry of the Laplacian matrix, L, the first hitting times are also symmetric, that is, H(u, v) = H(v, u). The commute time, C(u, v), between a pair of vertices is defined as the expected time for the walk to travel from the vertex u to v and back to u again and is given by Z ∞ ¡ ¢ C(u, v) = 2 Pr H(u, v) = t t dt (2) 0
3. The Continuous-time Quantum Walk Like the classical random walk on a graph, the statespace of the continuous-time quantum walk is the set of vertices of the graph. However, the probability of being at a certain state is given by the square of the amplitude of that state, rather then just the amplitude of the state (as is the case classically). This allows destructive as well as constructive interference to take place. The state space for the continuous-time quantum walk on a graph, G = (V, E), is the set of vertices, V, as is the case for the classical random walk. In addition, transitions only occur between adjacent vertices.
t Pr(X(u)
where = v) = |hv|e−iLt |ui|2 . In order to calculate this numerically we use Gauss-Laguerre quadrature.
4. Quantum and Classical Embeddings We now give some example embeddings, using both the classical and quantum commute times. In the case of the classical commute time the matrix of embedding co-ordinates is given by Y = Λ−1/2 ΦT . The vectors of embedding co-ordinates for the nodes of a graph are the columns of the matrix Y . We confine or attention to embeddings on the plane, and so we use just the first two rows of Y to give us the 2D embedding co-ordinates.
The quantum commute time, on the other hand, is evaluated numerically. To perform the embedding, we therefore use multidimensional scaling (MDS) which is a procedure which allows data specified in terms of a matrix of pairwise distances to be embedded in a Euclidean space. Let n be the number of nodes in the graph under consideration. The first step of MDS is to calculate a similarity matrix, F , whose element with row r and column c is ˆ .) − C(., ˆ c) + given by F (r, c) = − 12 {C(r, c) − C(r, P n 1 ˆ .)}, where C(r, ˆ .) = C(., c=1 C(r, c) is the avern th ˆ c) is the average commute-tiem for the r row, C(., th ˆ .) = ageP commute-time over the c column and C(., Pn n 1 r=1 c=1 C(r, c) is the average commute-time n2 over all rows and columns. We perform the eigendecomposition F = ΨEΨT on the disimilarity matrix, where E is the diagonal matrix with the ordered eigenvalues along the diagonal, and Ψ is the matrix with the correspondingly ordered eigenvectors as columns. If the rank of F is k, where k < n, then we will have k non-zero eigenvalues. The matrix with the vectors of embedding coordinates for the nodes as columns is √ Y = EΨT . We again take the first two rows of Y to give us a 2D visualisation of the graph. We turn our attention to graphs which possess some form of symmetry. If the graph on which the walk takes place has some kind of symmetry, certain paths can cancel each other out while others reinforce each other. It is also on graphs with symmetries that exponentially faster hitting times have been observed and so we would expect the quantum and classical embeddings for such graphs to be different. Two graphs on which this has been observed are the hypercube [4] and the graph obtained by randomly connecting a pair of n-level binary trees at the nodes [1]. In Figure 1 we show a graph formed by randomly
connecting a pair of 5-level binary trees at the ‘leaves’. Figure 2 gives the classical and quantum commute time embeddings for this graph. We can see that whereas the classical commute time embedding does not reveal the structure of the graph, the quantum commute time embedding does. Furthermore, the level of a vertex in one of the two trees is given by the first component of the embedding, and different vertices at each level are separated by the second component of the embedding. However, the graph appears as though it has been folded in half. For example, the commute times from one of the root vertices to all other vertices in the graph is very similar to the commute times to those vertices from the other root vertex. This is regardless in which of the two original trees the vertices lie. Consequently, the two root vertices are almost exactly coincident in the quantum commute time embedding (the red circle and red star in Figure 2). Figure 3 shows the commutes time from one of the root vertices to all the other vertices. This figure shows that the commute time from the root vertex to a vertex in the nth level of the same tree as itself is almost exactly the same as the commute time to a vertex in the nth level of the other tree. Figure 4 shows the embeddings of the 3 by 3 grid. The classical commute time embedding of the graph clearly shows the structure of the graph. However, as we saw for the joined binary trees, a number of vertices in the quantum commute time embedding are coincident. For the grid, the corner vertices are coincident with each other, the opposite sides of the grid are each coincident, and the central vertex is plotted singularly. This again reveals the symmetries in the quantum commute times. Quantum
Classical
10 8
0.05 9
2, 8
0.04
6
0.03
4
0.02
2
8
6
0.01 5
0
0
5
7
3
1, 3, 7, 9 −2
−0.01
−4
−0.02
−6
140
−8 −10 −8
4
2
−0.03 −0.04
4, 6
1 −6
−4
−2
0
2
4
6
8
−0.05 −0.05
0
0.05
120
Figure 4. Quantum and classical commute time embeddings of the 3 by 3 grid with the vertices labelled.
Commute Time
100
80
60
40
20
0
12 3
4
5
5 Tree level
4
3
21
Figure 3. The quantum commute time from one root vertex to all the other vertices in the graph.
We can consider the pattern of quantum commute times on a graph in terms of which dimension of an MDS embedding would separate which vertices. Figure 5 shows this for the 3 by 3 grid. We see that different dimensions of the embedding identify different symmetries of the graph by plotting different vertices as coincident points. Although opposite corners of the grid are coincident in the 2D embedding, the commute
times from these vertices to each of the other vertices in the grid are not identical, and consequently the 5th dimension of the embedding separates them.
d=1, Number of Coincident sets=7 15
5
1
2
3
10
0
2
5
5
1
6 2 7
3
3
3
3.5
−5
2
5
5 4 3 2 1 2
1
3 4
2 3
5 4
4 3
5
5
1
0
4
2
6
4
−10
0
−10
6
3
−15
3
3
−5
6
−15
2
5 4
5 1
d=2, Number of Coincident sets=3 4
10
3
6
−10
d=1, Number of Coincident sets=3
1
4
3
7
5
2 3
4
6
−5
4
d=2, Number of Coincident sets=5 15
3
6 6
4
−15 10
15
−15
−10
3
−5
2
2
1
0
5
10
15
3.5 d=3, Number of Coincident sets=9
3
1
2
1
2
3
2
3
1
2
1
3
1
3
15 2.5
8
9
8
7
15
6
7
2.5
d=4, Number of Coincident sets=7
2
1.5 1
1
2
1
1
1
2
0
1
0.5
0.5
−5
0
0
−10
0
0.5
1
1.5
2
2.5
3
3.5
4
0
0.5
1
1.5
2
2.5
3
3.5
4
4
2 1
2
2
1
3 4
2 3
5 4
3.5
−10
0
−5
7
8
5
4 3 2 1 7
1 −5
6 5
2 1
3 4
15
4 3 5
−15 10
1
1
8
9
0
5
7
−10
6 6
−15
6
6
7
5 −15 4
7
1 5
5
3
d=4, Number of Coincident sets=3
d=3, Number of Coincident sets=3 4
1
4 10
3
5 4
5
1.5
2 3
5
6 10 2
−15
−10
−5
6
7 0
2
1 5
10
15
3.5
3
3
2
1
2
2
2
3
2.5
1
2
1
2
3
2
1
2
1
Figure 7. Coincident vertices in the dth dimension of the quantum commute time embedding of the 32 vertex ‘wheel’ with 4 ‘spokes’. Coincident vertices are labelled with the same colour and number.
2.5
2
2
1.5
1.5 1
1
2
3
1
0.5
0.5
0
0
0
0.5
1
1.5
2
2.5
3
3.5
4
0
0.5
1
1.5
2
2.5
3
3.5
4
d=5, Number of Coincident sets=9 4 3.5 3
7
8
9
4
5
6
1
2
3
2.5 2 1.5 1
5. Conclusions
0.5 0
0
0.5
1
1.5
2
2.5
3
3.5
4
Figure 5. Coincident vertices in the dth dimension of the quantum commute time embedding of the 3 × 3 grid. Coincident vertices are labelled with the same colour and number.
Quantun 20
5, 21 4, 6, 20, 22
11, 15, 27, 31
3, 7, 19, 23
0.04 0.03
19
11
0.02
0
10 17
24
0
2, 8, 18, 24
16
18
23 0.01
10, 16, 26, 32
9
25
−20
8
1
−0.01 −30
14 13 12
15
21 20 22
−10
26
−0.02
7
2
32 27
−40
−50 −40
−0.03
1, 9, 17, 25
−30
−20
−10
0
References
classical
13, 29 12, 14, 28, 30
10
10
20
30
40
−0.04 −0.04
28 29 30 −0.03
We have shown how the commute time between a pair of vertices in a graph can be used for the purposes of graph drawing. We analyse how the quantum commute time compares with the classical commute time. Quantum commute time embeddings make full use of both dimensions of the 2D embedding space rather than restricting the graph to a submanifold, as can occur with classical commute time embeddings.
−0.02
3 4
31
−0.01
0
0.01
0.02
0.03
6 5
0.04
Figure 6. Quantum and classical commute time embeddings of the 32 vertex ‘wheel’ with 4 ‘spokes’.
We now consider the graph obtained by making connections between the vertices in a cycle. We connect 2 pairs of vertices from the cycle with 32 vertices to give a graph we refer to as a ‘wheel’ with 4 ‘spokes’. The commute time embeddings are shown in Figure 6. In the two dimensional quantum embedding the vertices connected to the spokes are all coincident and a fourfold symmetry has been identified. The symmetries of the first four dimensions of the embedding are shown in Figure 7. The third dimension of the embedding, for example, identifies a different four-fold symmetry.
[1] A. M. Childs, R. Cleve, E. Deotto, E. Farhi, S. Gutmann, and D. A. Spielman. Exponential algorithmic speedup by a quantum walk. In STOC ’03: Proc. 35th ACM symposium on TOC, pages 59–68, New York, NY, USA, 2003. ACM Press. [2] F. Chung and S.-T. Yau. Discrete green’s functions. J. Comb. Theory Ser. A, 91(1-2):191–214, 2000. [3] D. Emms, R. C. Wilson, and E. R. Hancock. Graph embedding using quantum commute times. pages 371–382, 2007. [4] J. Kempe. Quantum random walks hit exponentially faster. In Proc. of 7th Intern. Workshop on Randomization and Approximation Techniques in Comp. Sc. (RANDOM’03), pages 354–69, 2003. [5] L. Lov´asz. Combinatorics, Paul Erd¨os is Eighty, volume 2, chapter Random Walks on Graphs: A Survey, pages 353–398. J´anos Bolyai Mathematical Society, Budapest, 1996. [6] H. Qiu and E. Hancock. Clustering and embedding using commute times. IEEE Trans. PAMI, page To appear, 2007.