Graph Sparsification by Effective Resistances
Daniel A. Spielman, Nikhil Srivastava
Introduction
The goal of sparsification is to approximate a given graph by a sparse graph on the same set of vertices. If is close to in some appropriate metric, then can be used as a proxy for in computations without introducing too much error. At the same time, since has very few edges, computation with and storage of should be cheaper.
We study the notion of spectral sparsification introduced by Spielman and Teng . Spectral sparsification was inspired by the notion of cut sparisification introduced by Benczúr and Karger to accelerate cut algorithms whose running time depends on the number of edges. They gave a nearly-linear time procedure which takes a graph on vertices with edges and a parameter , and outputs a weighted subgraph with edges such that the weight of every cut in is within a factor of of its weight in . This was used to turn Goldberg and Tarjan’s max-flow algorithm into an algorithm for approximate -mincut, and appeared more recently as the first step of an -time approximation algorithm for sparsest cut .
In this work, we construct sparsifiers that achieve the same guarantee as Spielman and Teng’s but with edges, thus improving on both and . Our sparsifiers are subgraphs of the original graph and can be computed in time by random sampling, where the sampling probabilities are given by the effective resistances of the edges. While this is conceptually much simpler than the recursive partitioning approach of , we need to solve linear systems to compute the effective resistances quickly, and we do this using Spielman and Teng’s linear equation solver.
Our main idea is to include each edge of in the sparsifier with probability proportional to its effective resistance. The effective resistance of an edge is known to be equal to the probability that the edge appears in a random spanning tree of (see, e.g., or ), and was proven in to be proportional to the commute time between the endpoints of the edge. We show how to approximate the effective resistances of edges in quickly and prove that sampling according to these approximate values yields a good sparsifier.
To define effective resistance, identify with an electrical network on nodes in which each edge corresponds to a link of conductance (i.e., a resistor of resistance ). Then the effective resistance across an edge is the potential difference induced across it when a unit current is injected at one end of and extracted at the other end of . Our algorithm can now be stated as follows.
Sparsifiers that satisfy this condition preserve many properties of the graph. The Courant-Fischer Theorem tells us that
and the eigenspaces spanned by corresponding eigenvalues are related. As the eigenvalues of the normalized Laplacian are given by
and are the same as the eigenvalues of the walk matrix , we obtain the same relationship between the eigenvalues of the walk matrix of the original graph and its sparsifier. Many properties of graphs and random walks are known to be revealed by their spectra (see for example ). The existence of sparse subgraphs which retain these properties is interesting its own right; indeed, expander graphs can be viewed as constant degree sparsifiers for the complete graph.
We remark that the condition (2) also implies
where is the pseudoinverse of . Thus sparsifiers also approximately preserve the effective resistances between vertices, since for vertices and , the effective resistance between them is given by the formula , where is the elementary unit vector with a coordinate 1 in position .
We prove Theorem 1 in Section 3. At the end of Section 3, we prove that the spectral guarantee (2) of Theorem 1 is not harmed too much if use approximate effective resistances for sampling instead of exact ones(Corollary 6).
In Section 4, we show how to compute approximate effective resistances in nearly-linear time, which is essentially optimal. The tools we use to do this are Spielman and Teng’s nearly-linear time solver and the Johnson-Lindenstrauss Lemma . Specifically, we prove the following theorem, in which denotes the effective resistance between vertices and .
There is an time algorithm which on input and with computes a matrix such that with probability at least
Since is simply the difference of the corresponding two columns of , we can query the approximate effective resistance between any pair of vertices in time , and for all the edges in time . By Corollary 6, this yields an time for sparsifying graphs, as advertised.
In Section 5, we show that can be made close to in some additional ways which make it more useful for preconditioning systems of linear equations.
2 Related Work
Batson, Spielman, and Srivastava have given a deterministic algorithm that constructs sparsifiers of size in time. While this is too slow to be useful in applications, it is optimal in terms of the tradeoff between sparsity and quality of approximation and can be viewed as generalizing expander graphs. Their construction parallels ours in that it reduces the task of spectral sparsification to approximating the matrix defined in Section 3; however, their method for selecting edges is iterative and more delicate than the random sampling described in this paper.
The use of effective resistance as a distance in graphs has recently gained attention as it is often more useful than the ordinary geodesic distance in a graph. For example, in small-world graphs, all vertices will be close to one another, but those with a smaller effective resistance distance are connected by more short paths. See, for instance , which use effective resistance/commute time as a distance measure in social network graphs.
Preliminaries
Let be a connected weighted undirected graph with vertices and edges and edge weights . If we orient the edges of arbitrarily, we can write its Laplacian as , where is the signed edge-vertex incidence matrix, given by
It is immediate that is positive semidefinite since
We also have , since
2 The Pseudoinverse
Since is symmetric we can diagonalize it and write
where are the nonzero eigenvalues of and are a corresponding set of orthonormal eigenvectors. The Moore-Penrose Pseudoinverse of is then defined as
Notice that and that
3 Electrical Flows
Begin by arbitrarily orienting the edges of as in Section 2.1. We will use the same notation as to describe electrical flows on graphs: for a vector of currents injected at the vertices, let be the currents induced in the edges (in the direction of orientation) and the potentials induced at the vertices. By Kirchoff’s current law, the sum of the currents entering a vertex is equal to the amount injected at the vertex:
By Ohm’s law, the current flow in an edge is equal to the potential difference across its ends times its conductance:
by the definition of in Section 2.2.
Recall that the effective resistance between two vertices and is defined as the potential difference induced between them when a unit current is injected at one and extracted at the other. We will derive an algebraic expression for the effective resistance in terms of . To inject and extract a unit current across the endpoints of an edge , we set , which is clearly orthogonal to . The potentials induced by at the vertices are given by ; to measure the potential difference across , we simply multiply by on the left:
It follows that the effective resistance across is given by and that the matrix has as its diagonal entries .
The Main Result
We will prove Theorem 1. Consider the matrix . Since we know , the diagonal entries of are . has some notable properties.
(iv) follows from , since is symmetric. ∎
We may describe the outcome of by the following random matrix:
Suppose is a nonnegative diagonal matrix such that
To show that is likely to be small we use the following concentration result, which is a sort of law of large numbers for symmetric rank 1 matrices. It was first proven by Rudelson in , but the version we state here appears in the more recent paper by Rudelson and Vershynin.
We can now finish the proof of Theorem 1.
samples edges from independently with replacement, with probabilities proportional to . Since by Lemma 3.(iii), the actual probability distribution over is given by . Sampling edges from corresponds to sampling columns from , so we can write
for vectors drawn independently with replacement from the distribution
We can now apply Lemma 5. The expectation of is given by
Taking gives:
for sufficiently large, as is assumed to be at least .
with probability at least . By Lemma 4, this completes the proof of the theorem. ∎
We now show that using approximate resistances for sampling does not damage the sparsifier very much.
Suppose are numbers satisfying and for some . If we sample as in but take each edge with probability instead of , then satisfies:
and proceed as in the proof of Theorem 1. The norm of the random vector is now bounded by:
which introduces a factor of into the final bound on the expectation, but changes nothing else.∎
Computing Approximate Resistances Quickly
It is not clear how to compute all the effective resistances exactly and efficiently. In this section, we show that one can compute constant factor approximations to all the in time . In fact, we do something stronger: we build a matrix from which the effective resistance between any two vertices (including vertices not connected by an edge) can be computed in time.
If and are vertices in , then the effective resistance between and can be written as:
Thus effective resistances are just pairwise distances between vectors in . By the Johnson-Lindenstrauss Lemma, these distances are preserved if we project the vectors onto a subspace spanned by random vectors. For concreteness, we use the following version of the Johnson-Lindenstrauss Lemma due to Achlioptas .
Our goal is now to compute the projections . We will exploit the linear system solver of Spielman and Teng , which we recall satisfies:
There is an algorithm which takes a Laplacian matrix , a column vector , and an error parameter , and returns a column vector satisfying
where . The algorithm runs in expected time , where is the number of non-zero entries in .
Let be a random matrix of dimension where .
Compute . Note that this takes time since has entries and is diagonal.
We now prove that, for our purposes, it suffices to call STSolve with
for every pair . If for all ,
Consider an arbitrary pair of vertices , . It suffices to show that
As is connected, there is a simple path connecting to . Applying the triangle inequality twice, we obtain
We will upper bound this later term by considering its square:
by Proposition 10. Combining these bounds, we have
If is a connected graph, then for all ,
By Rayleigh’s monotonicity law (see ), each resistance in is at least the corresponding resistance in (the complete graph with all edge weights ) since is obtained by increasing weights (i.e., conductances) of edges in . But by symmetry each resistance in is exactly
Thus for all . ∎
Thus the construction of takes time. We can then find the approximate resistance for any in time simply by subtracting two columns of and computing the norm of their difference. ∎
Using the above procedure, we can compute arbitrarily good approximations to the effective resistances which we need for sampling in nearly-linear time. By Corollary 6, any constant factor approximation yields a sparsifier, so we are done.
An Additional Property
Corollary 6 suggests that is quite robust with respect to changes in the sampling probabilities , and that we may be able to prove additional guarantees on by tweaking them. In this section, we prove one such claim.
The following property is desirable for using to solve linear systems (specifically, for the construction of ultrasparsifiers , which we will not define here):
This says, roughly, that not too many of the edges incident to any given vertex get blown up too much by sampling and rescaling. We show how to incorporate this property into our sparsifiers.
Suppose we sample edges of as in with probabilities that satisfy
for some constant . Then with probability at least ,
For a vertex , define i.i.d. random variables by:
so that is set to with probability for each edge attached to . Let
We want to show that with high probability, for all vertices . We begin by bounding the expectation and variance of each :
Since the are independent, the variance of is just
We now apply Bennett’s inequality for sums of i.i.d. variables (see, e.g., ), which says
Taking a union bound over all gives the desired result.∎
satisfies the requirements of both Corollary 6 (with ) and Lemma 11 (with ) and yields a sparsifier with the desired property.