Convex Optimization of Graph Laplacian Eigenvalues Stephen Boyd∗ Abstract. We consider the problem of choosing the edge weights of an undirected graph so as to maximize or minimize some function of the eigenvalues of the associated Laplacian matrix, subject to some constraints on the weights, such as nonnegativity, or a given total value. In many interesting cases this problem is convex, i.e., it involves minimizing a convex function (or maximizing a concave function) over a convex set. This allows us to give simple necessary and sufficient optimality conditions, derive interesting dual problems, find analytical solutions in some cases, and efficiently compute numerical solutions in all cases. In this overview we briefly describe some more specific cases of this general problem, which have been addressed in a series of recent papers. • Fastest mixing Markov chain. Find edge transition probabilities that give the fastest mixing (symmetric, discrete-time) Markov chain on the graph. • Fastest mixing Markov process. Find the edge transition rates that give the fastest mixing (symmetric, continuous-time) Markov process on the graph. • Absolute algebraic connectivity. Find edge weights that maximize the algebraic connectivity of the graph (i.e., the smallest positive eigenvalue of its Laplacian matrix). The optimal value is called the absolute algebraic connectivity by Fielder. • Minimum total effective resistance. Find edge weights that minimize the total effective resistance of the graph. This is same as minimizing the average commute time from any node to any other, in the associated Markov chain. • Fastest linear averaging. Find weights in a distributed averaging network that yield fastest convergence. • Least steady-state mean-square deviation. Find weights in a distributed averaging network, driven by random noise, that minimizes the steady-state mean-square deviation of the node values. Mathematics Subject Classification (2000). Primary 05C35; Secondary 90C25. Keywords. Graph theory, Laplacian matrix, Convex optimization, Semidefinite programming, Markov chain, Distributed averaging, Effective resistance. ∗ Supported in part by the MARCO Focus Center for Circuit and System Solutions (C2S2, www.c2s2.org) under contract 2003-CT-888, by AFOSR grant AF F49620-01-1-0365, by NSF grant ECS-0423905, and by DARPA/MIT grant 5710001848. This paper reports work with coauthors Persi Diaconis, Arpita Ghosh, Seung-Jean Kim, Sanjay Lall, Pablo Parrilo, Amin Saberi. Jun Sun, and Lin Xiao. 2 Stephen Boyd 1. Introduction Let G = (V, E) be an undirected graph with n = |V | nodes and m = |E| edges, with weights w1 , . . . , wm ∈ R on the edges. Suppose edge l connects vertices (or nodes) i and j. We define al ∈ Rn as (al )i = 1, (al )j = −1, with other entries 0. The weighted Laplacian (matrix) is the n × n matrix defined as L= m X wl al aTl = A diag(w)AT , l=1 where diag(w) ∈ Rm×m is the diagonal matrix formed from w = (w1 , . . . , wm ) ∈ Rm , and A ∈ Rn×m is the incidence matrix of the graph, A = [a1 · · · am ]. We assume that the weights are such that L is positive semidefinite, which we write as L 0. This is always the case when the weights are nonnegative. Since L1 = 0, where 1 is the vector with all components one, L has smallest eigenvalue 0, corresponding to the eigenvector 1. We denote the eigenvalues of the Laplacian matrix L as 0 = λ 1 ≤ λ2 ≤ · · · ≤ λ n . Let φ be a symmetric closed convex function defined on a convex subset of Rn−1 . Then ψ(w) = φ(λ2 , . . . , λn ) (1) is a convex function of w [2, §5.2]. Thus, a symmetric convex function of the positive Laplacian eigenvalues yields a convexPfunction of the edge weights. As a n−1 simple example, consider φ(u1 , . . . , un−1 ) = i=1 ui , i.e., the sum. In this case we have n n X X λi = Tr L = 21T w, λi = ψ(w) = i=2 i=1 twice the sum of the edge weights, which is linear and therefore also convex. As n−1 another example, the function φ(u1 , . . . , un−1 ) = maxi=1 ui (which is convex and symmetric) yields the function ψ(w) = λn , the largest eigenvalue (or spectral radius) of the Laplacian matrix (and a convex function of the edge weights). We consider optimization problems with the general form minimize subject to ψ(w) w ∈ W, (2) where W is a closed convex set, and the optimization variable here is w ∈ R m . The problem (2) is to choose edge weights on a graph, subject to some constraints, in order to minimize a convex function of the positive eigenvalues of the associated Laplacian matrix. We can also handle the case of maximizing a concave function φ of the positive Laplacian eigenvalues, by minimizing −ψ over w ∈ W. The problem (2) is a convex optimization problem. Roughly speaking, this means that the analysis of the problem is fairly straightforward, and that the problem is easily solved numerically; see, e.g., [6]. In the cases we will consider, 3 Convex Optimization of Graph Laplacian Eigenvalues the problem (2) can be formulated even more specifically as a semidefinite program (SDP), which has the form minimize subject to T cP x n i=1 xi Ai B. (3) Here x ∈ Rn is the variable, and the problem data are c ∈ Rn and the symmetric matrices A1 , . . . , An , B ∈ Rk×k . The inequality symbol between symmetric matrices refers to inequality Pn with respect to the cone of positive semidefinite matrices. The constraint i=1 xi Ai B is called a linear matrix inequality (LMI). The SDP (3) can be thought of as a generalization of a linear program (LP), minimize subject to T cP x n i=1 xi ai ≤ b, where here, a1 , . . . , an , b are vectors, and the inequality symbol between vectors means componentwise. Many results for LPs have analogs for SDPs; moreover, in the last 15 years or so, effective algorithms for numerically solving SDPs have been developed, and are now widely used in many application areas. 2. Fastest mixing Markov chain In this section we briefly describe the problem of finding the fastest mixing symmetric Markov chain on a given graph. Many more details (and additional references) can be found in [4, 5]. We consider a symmetric Markov chain on the graph G, with transition matrix P ∈ Rn×n , where Pij = Pji is the probability of a transition from vertex i to vertex j. Since P is symmetric, the uniform distribution πunif = (1/n)1T is an equilibrium distribution. The rate of convergence of the distribution π(t) to uniform is governed by µ(P ), the second largest eigenvalue magnitude (SLEM) of P , with smaller µ(P ) meaning faster asymptotic convergence. To find the fastest mixing symmetric Markov chain on the graph, we must choose the transition matrix P to minimize µ(P ), subject to the following conditions: P = PT, P 1 = 1, Pij ≥ 0, i, j = 1, . . . , n, Pij = 0 for (i, j) 6∈ E. The first three conditions state that P is a symmetric stochastic matrix; the last states that transitions can only occur over the graph edges. Identifying the graph edge weights with edge transition probabilities, we find that P can be expressed as P = I − L. The conditions above are equivalent to the conditions w ≥ 0, diag(L) ≤ 1 imposed on the edge weight vector w. (Here diag(L) is the vector consisting of the diagonal entries of L, and both inequalities above are vector inequalities, i.e., componentwise.) 4 Stephen Boyd The eigenvalues of P are 1 − λ1 , . . . , 1 − λn . Since 1 − λ1 = 1, and |1 − λi | ≤ 1 (since P is stochastic), its SLEM is given by µ(P ) = max{|1 − λ2 |, . . . , |1 − λn |} = max{1 − λ2 , λn − 1}. (4) n−1 This has the general form (1), with φ(u1 , . . . , un−1 ) = maxi=1 |1 − ui |. In particular, the SLEM µ(P ) is a convex function of the edge transition probabilities. Thus, the fastest mixing symmetric Markov chain problem can be expressed as our general problem (2), with W = {w | w ≥ 0, diag(L) ≤ 1}, a polyhedron. The semidefinite programming formulation of the problem is minimize subject to γ −γI I − L − (1/n)11T γI, w ≥ 0, diag(L) ≤ 1, with variables w ∈ Rm and γ ∈ R. Since the fastest mixing symmetric Markov chain problem is convex, indeed, equivalent to an SDP, it can be solved effectively. Generic methods can be used for problems with only a few thousand edges; far larger problems, with millions of edges, can be solved using subgradient optimization techniques, exploiting Lanczos methods to efficiently compute a few extreme eigenvalues and eigenvectors of I − L − (1/n)11T ; see [5]. The optimal transition probabilities can be quite interesting; for example, a graph can have many edges with optimal transition probability zero. This means (roughly) that those edges are not needed to achieve fastest mixing on the given graph. We also note that the optimal transition probabilities can yield a mixing rate that is unboundedly better than some simple standard schemes for assigning transition probabilities for fast mixing, such as the maximum-degree method, or the Metropolis-Hastings method [5]. Standard methods can be used to construct various dual problems for the fastest mixing symmetric Markov chain problem. One such dual is 1T z Y 1 = 0, Y = Y T , kY k∗ ≤ 1 (5) (zi + zj )/2 ≤ Yij , (i, j) ∈ E, Pn with variables z ∈ Rn and Y ∈ Rn×n . Here kY k∗ = i=1 |λi (Y )|, the sum of the singular values of Y , which is the dual norm of the spectral norm. This dual problem is convex, since the objective, which is maximized, is linear, hence concave, and the constraints are all convex. We have the following: maximize subject to • Weak duality. If Y , z are feasible for the dual problem (5), then we have 1T z ≤ µ? , where µ? is the optimal value of the fastest mixing symmetric Markov chain problem. • Strong duality. There exist Y ? , z ? that are optimal for the dual problem, and satisfy 1T z ? = µ? . This means that optimal values of the primal and dual problems are the same, and that the dual problem yields a sharp lower bound on the optimal SLEM. Convex Optimization of Graph Laplacian Eigenvalues 5 Both of these conclusions follow from general results for convex optimization problems (see, e.g., [10, 1, 6]). We can conclude strong duality using (a refined form of) Slater’s condition (see, e.g., [1, §3.3] and [6, §5.2]), since the constraints are all linear equalities and inequalities. 3. Fastest mixing Markov process Here we briefly describe the problem of finding the fastest mixing continuous-time symmetric Markov process on a given graph [11]. Consider a continuous-time Markov process on the graph G, with transition rate (or intensity) wl across edge l. The probability density π(t) ∈ R1×n at time t ≥ 0 is given by π(t) = π(0)e−tL . It follows that the asymptotic rate of convergence to the uniform distribution is governed by λ2 , the smallest positive eigenvalue of the Laplacian matrix. The deviation from uniform distribution decays, in the worst case, as e−λ2 t . We can express λ2 as λ2 = min{λ2 , . . . , λn }, n−1 which has the standard form (1), with φ(u1 , . . . , un−1 ) = mini=1 ui . Since the minimum function is concave, we see that λ2 is a concave function of the edge weights w. It is evidently homogeneous in w, so to get a sensible problem we must normalize the weights in some way, for example, as 1T w = 1. To find the transition rates that give fastest convergence (among weights that sum to one), we pose the problem maximize subject to λ2 w ≥ 0, 1T w = 1, with variable w ∈ Rm . This is a convex optimization problem, which can be formulated as the SDP maximize γ subject to γI L + β11T , w ≥ 0, 1T w = 1, with variables γ, β ∈ R, w ∈ Rm . The same problem, allocating a fixed total edge weight across the graph edges so as to maximize the smallest positive Laplacian eigenvalue, arises in other areas. For example, λ2 arises in graph theory, and is called the algebraic connectivity of the graph. Fiedler refers to the maximum value of λ2 that can be obtained by allocating a fixed total weight to the edges of a graph, as its absolute algebraic connectivity [7]. The dual of the fastest mixing Markov process problem can be given a very interesting interpretation. It is equivalent to the following problem. We are given some distances d1 , . . . , dm on the graph edges. The goal is find a configuration of points x1 , . . . , xn ∈ Rn that satisfy kxi − xj k2 ≤ dl , whenever edgeP l connects vertices i and j, and in addition maximizes the total variance, given by i6=j kxi − xj k2 . This problem was recently formulated in the machine learning literature as a method for identifying low dimensional structure in data; see, e.g., [12]. 6 Stephen Boyd 4. Minimum total effective resistance Here we describe the problem of choosing the edge weights to minimize the total effective resistance of a graph, subject to some given total weight [8]. We consider the graph as an electrical circuit or network, with the edge weight representing the conductance (inverse of resistance) of the associated electrical branch. We define Rij as the resistance in the network seen between nodes i and j. The total effective P resistance is defined as R = i<j Rij . The total effective resistance comes up in several applications beyond circuit theory. For example, it is proportional to the average commute time, over all pairs of vertices, in the random walk on the graph defined by the weights wl [8]. (The probability of a transition from vertex i to vertex j is wl , the associated edge weight, divided by the total weight of all edges adjacent to vertex i.) It can be shown that n 1X 1/λi , R= n i=2 i.e., it is proportional to the sum of the inverses of the positive P Laplacian eigenn−1 values. This follows our general form (1), with φ(u1 , . . . , un−1 ) = i=1 1/ui , with n−1 domain R++ . (R++ is the set of positive reals.) In particular, the total effective resistance is a convex function of the weight vector w. Minimizing total effective resistance, subject to w ≥ 0 and 1T w = 1, is thus a convex optimization problem. The problem can be formulated as the SDP minimize subject to n Tr Y 1T w = 1, w ≥ 0, L + (1/n)11T I 0, I Y with variables w ∈ Rm and the (slack) matrix Y = Y T ∈ Rn×n (see [8]). 5. Fast averaging Here we describe the problem of choosing edge weights that give fastest averaging, using a classical linear iteration [13]. The nodes start with value x(0) ∈ R n , and at each iteration we update the node values as x(t + 1) = (I − L)x(t). The goal is to choose the edge weights so that xi (t) converges, as rapidly as possible, to the average value, i.e., x(t) → (1/n)11T x(0). This iteration can be given a very simple interpretation. At each step, we replace each node value with a weighted average of its previous value and its neighbors’ previous values. The weights used to form the average are taken from the graph edge weights, with the self-weight chosen so that the sum of the adjacent edge weights, plus the self-weight, equals one. The weights used to carry out this local averaging sum to one at each node, but can be negative. Convex Optimization of Graph Laplacian Eigenvalues 7 When the weights are symmetric (which we assume here), the convergence rate of this averaging process is determined by the SLEM of I − L, i.e., (4), exactly as in the Markov chain problem. The difference here is that the weights can be negative; in the Markov chain, of course, the weights (transition probabilities) must be nonnegative. The optimal weights can be found by solving the unconstrained problem minimize maxni=2 |1 − λi |, which evidently is a convex optimization problem. It can be posed as the SDP minimize subject to γ −γI L − (1/n)11T γI, with variables γ ∈ R, w ∈ Rm . Without loss of generality, we can assume that L 0. The problem is the same as the fastest mixing symmetric Markov chain problem, but without the nonnegativity requirement on w. It often happens that some of the optimal weights are negative [13]. 6. Minimum RMS consensus error Here we describe a variation on the fastest linear averaging problem described above, in which an additive random noise perturbs the node values [15]. The iteration is x(t + 1) = (I − L)x(t) + v(t), where v(t) ∈ Rn are uncorrelated zero mean unit variance random variables, i.e., E v(t) = 0, E v(t)v(t)T = I, E v(t)v(s)T = 0, t 6= s. This iteration arises in noisy averaging, distributed data fusion, and load balancing applications; see the references in [15]. We can measure the effectiveness of the averaging iteration at countering the effects of the additive noises by the steady-state mean-square deviation, defined as X 1 (xi (t) − xj (t))2 . δss = lim E t→∞ n i<j The steady-state mean-square deviation can be expressed as δss = n X i=2 1 , λi (2 − λi ) provided 0 < λi < 2 for i = 2, . . . , n, and is infinite otherwise. (The condition 0 < λi < 2 for i = 2, . . . , n is the same as max{1 − λ2 , λn − 1} < 1, which is the condition that the linear iteration for averaging, without the additive noise, converges.) Once again, this has the standard form (1), with φ(u1 , . . . , un−1 ) = Pn−1 n−1 . In particular, we see that δss is a i=1 1/(ui (2 − ui )), with domain (0, 2) convex function of the edge weights. To find the weights that yield the smallest steady-state mean-square deviation, we simply minimize the convex function δ ss over w ∈ Rm . 8 Stephen Boyd 7. Methods All the problems described above can be effectively solved numerically, by a variety of standard methods for convex optimization, including interior-point methods for modest sized problems (with a few thousand weights) and subgradient-based methods for larger problems. We can exploit structure in the problems (such as sparsity of the underlying graph) to increase the efficiency of these methods. We can also exploit symmetry in solving the problems. Two edges are symmetric if there exists an automorphism of the graph that maps one edge to the other. Whenever two edges are symmetric, we can assume without loss of generality that the corresponding edge weights are equal. (This follows from a basic result in convex optimization: there is always a solution that is invariant under the group of permutations that leave the objective function and constraint set fixed.) If the symmetry group of the graph is large, this can considerably reduce the size of the optimization problem that needs to be solved. As an extreme example, consider an edge-transitive graph, i.e., one in which any two edges are symmetric. For such a graph, we can assume that all edge weights are equal, i.e., there is only one common edge weight to be determined. This reduces the problem to one with at most one scalar variable (the common edge weight); if there is an equality constraint, such as 1T w = 1, we conclude that an optimal solution is given by uniform edge weights, w = (1/m)1 [3]. This idea is used in [9] to reduce some specific weight optimization problems to ones with a handful of variables, which can be solved analytically. References [1] D. P. Bertsekas. Nonlinear Programming. Athena Scientific, second edition, 1999. [2] J. Borwein and A. Lewis. Convex Analysis and Nonlinear Optimization, Theory and Examples. Canadian Mathematical Society Books in Mathematics. Springer-Verlag, New York, 2000. [3] S. Boyd, P. Diaconis, P. Parrilo, and L. Xiao. Symmetry analysis of reversible Markov chains. Internet Mathematics, 2(1):31–71, 2005. [4] S. Boyd, P. Diaconis, J. Sun, and L. Xiao. Fastest mixing Markov chain on a path. American Mathematical Monthly, January 2006. To appear. [5] S. Boyd, P. Diaconis, and L. Xiao. Fastest mixing Markov chain on a graph. SIAM Review, 46(4):667–689, 2004. [6] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [7] M. Fiedler. Absolute algebraic connectivity of trees. Linear and Multilinear Algebra, 26:85–106, 1990. [8] A. Ghosh and S. Boyd. Minimizing effective resistance of a graph. Submitted to SIAM Review, 2005. Available at www.stanford.edu/~boyd/eff_res. Convex Optimization of Graph Laplacian Eigenvalues 9 [9] A. Ghosh and S. Boyd. Upper bounds on algebraic connectivity via convex optimization. Submitted to Linear Algebra Appl., October 2005. Available at www.stanford.edu/~boyd/eigbounds_laplacian. [10] R. T. Rockafellar. Convex Analysis. Princeton University Press, Princeton, New Jersey, 1970. [11] J. Sun, S. Boyd, L. Xiao, and P. Diaconis. The fastest mixing Markov process on a graph and a connection to a maximum variance unfolding problem. SIAM Review, 2006. To appear. Available at www/~boyd/fmmp. [12] K. Weinberger and L. Saul. Unsupervised learning of image manifolds by semidefinite programming. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR-04), Washington D.C., 2004. [13] L. Xiao and S. Boyd. Fast linear iterations for distributed averaging. Systems and Control Letters, 53:65–78, 2004. [14] L. Xiao and S. Boyd. Optimal scaling of a gradient method for distributed resource allocation. Journal of Optimization Theory and Applications, 129(3), 2006. To appear. [15] L. Xiao, S. Boyd, and S.-J. Kim. Distributed average consensus with least-meansquare deviation. Submitted to Journal of Parallel and Distributed Computing, May 2005. Available at www/~boyd/lms_consensus. Electrical Engineering Department Stanford University E-mail: boyd@stanford.edu