Approaching optimality for solving SDD systems
Ioannis Koutis, Gary L. Miller, Richard Peng
Introduction
Fast algorithms for solving linear systems and the related problem of finding a few fundamental eigenvectors is possibly one of the most important problems in algorithm design. It has motivated work on fast matrix multiplication methods, graph separators, and more recently graph sparsifiers. For most applications the matrix is sparse, and thus one would like algorithms whose run time is efficient in terms of the number of non-zero entries of the matrix. Little is known about how to efficiently solve general sparse systems, . But substantial progress has been made in the case of symmetric and diagonally dominant (SDD) systems, where . In a seminal work, Spielman and Teng showed that SDD systems can be solved in nearly-linear time [ST04, EEST05, ST06].
Recent research, largely motivated by the Spielman and Teng solver (ST-solver), demonstrates the power of SDD solvers as an algorithmic primitive. The ST-solver is the key subroutine of the fastest known algorithms for a multitude of problems that include: (i) Computing the first non-trivial (Fiedler) eigenvector of the graph, or more generally the first few eigenvectors, with well known applications to the sparsest-cut problem [Fie73, ST96, Chu97]; (ii) Generating spectral sparsifiers that also act as cut-preserving sparsifiers [SS08]; (iii) Solving linear systems derived from elliptic finite elements discretizations of a significant class of partial differential equations [BHV04]. (iv) Generalized lossy flow problems [SD08]; (v) Generating random spanning trees [KM09]; and (vi) Several optimization problems in computer vision [KMT09, KMST09b] and graphics [MP08, JMD+07]; A more thorough discussion of applications of the solver can be found in [Spi10, Ten10].
The ST-solver is an iterative algorithm that produces a sequence of approximate solutions converging to the actual solution of the input system . The performance of iterative methods is commonly measured in terms of the time required to reduce an appropriately defined approximation error by a constant factor. Even including recent improvements on some of its components, the time complexity of the ST-solver is at least . The large exponent in the logarithm is indicative of the fact that the algorithm is quite complicated and lacks practicality. The design of a faster and simpler solver is a challenging open question.
Preliminaries
In this Section we briefly recall background facts about Laplacians of weighted graphs. For more details, we refer the reader to [RG97] and [BH03]. Throughout the paper, we discuss connected graphs with positive edge weights. We use and to denote and .
A symmetric matrix is positive semi-definite if for any vector , . For such semi-definite matrices , we can also define the -norm of a vector by
Fix an arbitrary numbering of the vertices and edges of a graph . Let denote the weight of the edge . The Laplacian of is the matrix defined by: (i) , (ii) . For any vector , one can check that
It follows that is positive semi-definite and -norm is a valid norm.
We also define a partial order on symmetric semi-definite matrices, where if is positive semi-definite. This definition is equivalent to for all . We say that a graph -approximates a graph if
By the definition of from above, this relationship is equivalent to for all vectors . This implies that the condition number of the pair is upper bounded by . The condition number is an algebraically motivated notion; upper bounds on it are used to predict the convergence rate of iterative numerical algorithms.
Prior work on SDD solvers and related graph theoretic problems
Symmetric diagonally dominant systems are linear-time reducible to linear systems whose matrix is the Laplacian of a weighted graph via a construction known as double cover that only doubles the number of non-zero entries in the system [GMZ95, Gre96]. The one-to-one correspondence between graphs and their Laplacians allows us to focus on weighted graphs, and interchangeably use the words graph and Laplacian.
In a ground-breaking approach, Vaidya [Vai91] proposed the use of spectral graph-theoretic properties for the design of provably good graph preconditioners, i.e. graphs that -in some sense- approximate the input graph, but yet are somehow easier to solve. Many authors built upon the ideas of Vaidya, to develop combinatorial preconditioning, an area on the border of numerical linear algebra and spectral graph theory [BGH+05]. The work in the present paper as well as the Spielman and Teng solver is based on this approach. It is worth noting that combinatorial preconditioning is only one of the rich connections between combinatorics and linear algebra [Chu97, RG97].
Vaidya originally proposed the construction of a preconditioner for a given graph, based on a maximum weight spanning tree of the graph and its subsequent augmentation with graph edges. This yielded the first non-trivial results, an time algorithm for maximum degree graphs, and an algorithm for maximum degree planar graphs [Jos97].
Later, Boman and Hendrickson [BH03] made the crucial observation that the notion of stretch (see Section 6 for a definition) is crucial for the construction of a good spanning tree preconditioner; they showed that if the non-tree edges have average stretch over a spanning tree, the spanning tree is an -approximation of the graph. Armed with this observation and the low-stretch tree of Alon et al. [AKPW95], Spielman and Teng [ST03] presented a solver running in time .
The major new notion introduced by Spielman and Teng [ST04] in their nearly-linear time algorithm was that of a spectral sparsifier, i.e. a graph with a nearly-linear number of edges that -approximates a given graph for a constant . Before the introduction of spectral sparsifiers, Benczúr and Karger [BK96] had presented an algorithm for the construction of a cut-preserving sparsifier with edges. A good spectral sparsifier is a also a good cut-preserving sparsifier, but the opposite is not necessarily true.
The ST-solver [ST04] consists of a number of major algorithmic components. The base routine is a local partitioning algorithm which is the main subroutine of a global nearly-linear time partitioning algorithm. The partitioning algorithm is used as a subroutine in the construction of the spectral sparsifier. Finally, the spectral sparsifier is combined with the total stretch spanning trees of [EEST05] to produce a ultrasparsifier, i.e. a graph with edges which -approximates the given graph, for some . The bottleneck in the complexity of the ST-solver lies in the running time of the ultra-sparsification algorithm and the approximation quality of the ultrasparsifier.
Our contribution
In an effort to design a faster sparsification algorithm, we ask: when and why the much simpler faster cut-preserving sparsifier of [BK96] fails to work as a spectral sparsifier? Perhaps the essential example is that of the cycle and the line graph; while the two graphs have roughly the same cuts, their condition number is . The missing edge has a stretch of through the rest of the graph, and thus it has high effective resistance; the effective resistance-based algorithm of Spielman and Srivastava would have kept this edge. It is then natural to try to design a sparsification algorithm that avoids precisely to generate a graph whose “missing” edges have a high stretch over the rest of the original graph.
As we explain in Section 7 the incremental sparsifier is all we need to design a solver that runs in the claimed time. Precisely, we prove the following.
Sparsification by Oversampling
In this section we revisit a sampling scheme proposed by Spielman and Srivastava for sparsifying a graph [SS08]. Consider the following general sampling scheme:
Spielman and Srivastava pick where is the effective resistance of in , if is viewed as an electrical network with resistances . This choice returns a spectral sparsifier. A key to bounding the number of required samples is the identity . Calculating good approximations to the effective resistances seems to be at least as hard as solving a system, but as we will see in Section 6, it is easier to compute numbers , while still controlling the size of . The following Theorem considers a sampling scheme based on ’s with this property.
(Oversampling) Let be a graph. Assuming that for each edge , and , the graph satisfies
The proof follows closely that Spielman and Srivastava [SS08], with only a minor difference in one calculation. Let us first review some necessary lemmas.
If we assign arbitrary orientations on the edges, then we can define the incidence matrix as follows:
If we let be the diagonal matrix containing edge weights, then is a real positive diagonal matrix as well since all edge weights are positive. The Laplacian can be written in terms of and as
Algorithm Sample forms a new graph by multiplying each edge by a nonnegative number . If is the diagonal matrix with , the Laplacian of the new graph can be seen to be equal to
Let denote the Moore-Penrose of , i.e. the unique matrix sharing with its null space, and acting as the inverse of in its range. The key to the proofs of [SS08] is the matrix
for which the following lemmas are proved.
(Lemma 3i in [SS08]) is a projection matrix, i.e. .
We also use Lemma 5.4 below, which is Theorem 3.1 from Rudelson and Vershynin [RV07]. The first part of the Lemma was also used as Lemma 5 in [SS08] in a similar way.
Proof (of Theorem 5.1) Following the pseudocode of Sample, let and . It can be seen that
where the are drawn from the distribution
For the distribution we have . Since is a projection matrix, we have . So, the condition imposed by Lemma 5.4 on the distribution holds for . The fact that is a projection matrix also gives
The last inequality follows from the assumption about the . Recall now that we have by assumption, by construction, and by Lemma 3 in [SS08]. Combining these facts and setting for a proper constant , part 1 of Lemma 5.4 gives
Now substituting into part 2 of Lemma 5.4, we get
It follows that with probability at least we have
which implies . The theorem then follows by Lemma 5.3.
Note. The upper bound for in inequality 5.1 is in fact the only place where our proof differs from that of [SS08]. In their case the last inequality is replaced by an exact inequality, which is possible because the exact values for are used. In our case, by using inexact values we get a weaker upper bound which reflects in the density (depending on , not ) of the incremental sparsifier. It is however enough for the solver.
Incremental Sparsifier
Consider a spanning tree of . Let . If the unique path connecting the endpoints of consists of edges , the stretch of by is defined to be
Let denote the effective resistance of in and denote the effective resistance of in . We have . Thus . By Rayleigh’s monotonicity law [DS00], we have , so . As the numbers satisfy the condition of Theorem 5.1, we can use them for oversampling. But at the same time we want to control the total stretch, as it will directly affect the total number of samples required in SAMPLE. This leads to taking to be a low-stretch tree, with the guarantees provided by the following result of Abraham, Bartal, and Neiman [ABN08].
(Corollary 6 in [ABN08]) Given a graph , LowStretchTree(G) in time , outputs a spanning tree of satisfying
Our key idea is to scale up the low-stretch tree by a factor of , incurring a condition number of but allowing us to sample the non-tree edges aggressively using the upper bounds on their effective resistances given by the tree. The details are given in algorithm IncrementalSparsify.
Given a graph with vertices, edges and any values , , IncrementalSparsify computes a graph such that:
Proof We first bound the condition number. Since the weight of an edge is increased by at most a factor of , we have . Furthermore, the effective resistance along the tree of each non-tree edge decreases by a factor of . Thus IncrementalSparsify sets if and otherwise, and invokes Sample to compute a graph such that with probability at least , we get
A standard form of Chernoff’s inequality is:
Letting , and using the assumption , we get for any constant . Hence, the probability that IncrementalSparsify succeeds, with respect to both the number of non-tree edges and the condition number, is at least .
Solving using Incremental Sparsifiers
The solver of Spielman and Teng [ST06] consists of two phases. The preconditioning phase builds a chain of progressively smaller graphs starting with . The process for building alternates between calls to a sparsification routine UltraSparsify which constructs from and a routine GreedyElimination (following below) which constructs from . The preconditioning phase is independent from the -side of the system .
The solve phase passes , and a number of iterations (depending on a desired error ) to the recursive preconditioning algorithm R-P-Chebyshev, described in Section 9. The time complexity of the solve phase depends on , but more crucially on the quality of , which is a function of the sparsifier quality.
Let be a monotonically non-decreasing function of . Let be a chain of graphs, and denote by and the numbers of nodes and edges of respectively. We say that is -good for , if:
.
.
, for some constant .
Spielman and Teng analyzed a recursive preconditioned Chebyshev iteration and showed that a -good chain for can be used to solve a system on . This is captured by the following Lemma, adapted from Theorem 5.5 in [ST06].
Given a -good chain for , a vector such that can be computed in expected time.
For our solver, we follow the approach of Spielman and Teng. The main difference is that we replace their routine UltraSparsify with our routine IncrementalSparsify, which is not only faster but also constructs a better chain which translates into a faster solve phase. We are now ready to state our algorithm for building the chain. In what follows we write to mean ‘ for some explicitly known function ’.
Proof Assume that has edges. A key property of GreedyElimination is that if is a graph with edges, GreedyElimination has at most vertices and edges [ST06]. Hence has at most edges. It follows that . Then, in order to satisfy the second requirement, we must have , for some sufficiently small constant .
The probability that has the above properties is by construction at least if and otherwise. The probability that the requirements hold for all is then at least
Combining Lemmas 7.2 and 7.3 proves our main Theorem.
Comments / Extensions
Unraveling the analysis of our bound for the condition number of the incremental sparsifier, it can been that one factor is due to the number of samples required by the Rudelson and Vershynin theorem. The second factor is due to the average stretch of the low-stretch tree.
It is quite possible that the low-stretch construction and perhaps the associated lower bound can be bypassed -at least for some graphs- by a simpler approach similar to that of [KM07]. Consider for example the case of unweighted graphs. With a simple ball-growing procedure we can concede in our incremental sparsifier a fraction of the edges, while keeping within clusters of diameters the rest of the edges. The design of low-stretch trees may be simplified within the small diameter clusters. This diameter-restricted local sparsification is a natural idea to pursue, at least in an actual implementation of the algorithm.
References
Appendix: The Complete Solver
The purpose of this section is to provide a few more algebraic details about the chain of preconditioners, and the recursive preconditioned Chebyshev method which consists the solve phase of the solver. The material is not new and we include it only for completeness. We focus on pseudocode. We refer the reader to [ST06] for a more detailed exposition along with proofs.
Direct methods - Cholesky factorization. If is a symmetric and positive definite (SPD) matrix, it can be written in the form , a product known as the Cholesky factorization of . This extends to Laplacians, with some care for the null space. The Cholesky factorization can be computed via a symmetric version of Gaussian elimination. Given the decomposition, solving the systems and yields the solution to the system ; the key here is that solving with and can be done easily via forward and back substitution. A partial Cholesky factorization with respect to the first variables of , puts it into the form
where denotes the identity matrix, and is known as the Schur complement of with respect to the elimination of the first variables. The matrix is the Schur complement of with respect the the elimination of its first variable.
Given a matrix , the graph of is defined by identifying the vertices of with the rows and columns of and letting the edges of encode the non-zero structure of in the obvious way.
It is instructive to take a graph-theoretic look at the partial Cholesky factorization when . In this case, the graph contains a clique on the neighbors of the first node in . In addition, the first column of is non-zero on the corresponding coordinates. This problem is known as fill. It then becomes obvious that the complexity of computing the Cholesky factorization depends crucially on the ordering of . Roughly speaking, a good ordering has the property that the degrees of the top nodes of are as small as possible. The best known algorithm for positive definite systems of planar structure runs in time and it is based on the computation of good orderings via nested dissection [Geo73, LRT79, AY].
There are two fairly simple but important facts considering the partial Cholesky factorization of equality 9.2 [ST06]. First, if the top nodes of have degrees or , then back-substitution with requires only time. Second, if is a Laplacian, then is a Laplacian. Such an ordering and the corresponding Laplacian can be found in linear time via GreedyElimination, described in Section 7. The corresponding factor can also be computed easily.
Iterative methods. Unless the system matrix is very special, direct methods do not yield nearly-linear time algorithms. For example, the nested dissection algorithm is known to be asymptotically optimal for the class of planar SPD systems, within the envelope of direct methods. Iterative methods work around the fill problem by producing a sequence of approximate solutions using only matrix-vector multiplications and simple vector-vector operations. For example Richardson’s iteration generates an approximate solution from , by letting
The solver in this paper, as well as the Spielman and Teng solver [ST06], are based on the very well studied Chebyshev iteration [Axe94]. The preconditioned Chebyshev iteration (P-Chebyshev) is the Chebyshev iteration applied to the system , where are SPD matrices, and is known as the preconditioner. The preconditioner needs not be explicitly known. The iteration requires matrix-vector products with and . A product of the form is equivalent to solving the system . Therefore (P-Chebyshev) requires access to only a function returning . In addition it requires a lower bound on the minimum eigenvalue of and an upper bound on the maximum generalized eigenvalue of .
A well known fact about the Chebyshev method is that after iterations the return vector satisfies [Axe94].
Hybrid methods. One of the key ideas in Vaidya’s approach was to combine direct and iterative methods into a hybrid method by exploiting properties of Laplacians. [Vai91]. For the rest of this section we will identify graphs and their Laplacians, using their natural 1-1 correspondence.
Let be a Laplacian. The incremental sparsifier of is a natural choice as preconditioner. With proper input parameters, IncrementalSparsify returns a that contains enough degree and nodes, so that GreedyElimination can make enough progress reducing to a matrix of the form
where is the output of algorithm GreedyElimination. Let denote the identity of dimension and
Recall that P-Chebyshev requires the solution of , which is given by
The two matrix-vector products with can be computed in time via forward and back substitution. Therefore, we can solve a system in by solving a linear system in and performing additional work. Naturally, in order to solve systems on we can recursively apply preconditioned Chebyshev iterations on it, with a new preconditioner . This defines a preconditioning chain that consists of progressively smaller graphs , along with the corresponding matrices for . So, to be more precise than in Section 7, routine BuildChain has the following specifications.
We are now ready to give pseudocode for the recursive preconditioned Chebyshev iteration.
The complete solver. Finally, the pseudocode for the complete solver is as follows.