We present a nearly linear time algorithm that produces high-quality spectral sparsifiers of weighted graphs. Given as input a weighted graph $G=(V,E,w)$ and a parameter $\epsilon>0$, we produce a weighted subgraph $H=(V,\tilde{E},\tilde{w})$ of G such that $|\tilde{E}|=O(n\log n/\epsilon^2)$ and all $x\in\mathbb{R}^V$ satisfy $(1-\epsilon)\sum_{uv\in E}\,(x(u)-x(v))^2w_{uv}\leq\sum_{uv\in\tilde{E}}\,(x(u)-x(v))^2\tilde{w}_{uv}\leq(1+\epsilon)\sum_{uv\in E}\,(x(u)-x(v))^2w_{uv}$. This improves upon the spectral sparsifiers constructed by Spielman and Teng, which had $O(n\log^{c}n)$ edges for some large constant c, and upon the cut sparsifiers of Benczúr and Karger, which only satisfied these inequalities for $x\in\{0,1\}^V$. A key ingredient in our algorithm is a subroutine of independent interest: a nearly linear time algorithm that builds a data structure from which we can query the approximate effective resistance between any two vertices in a graph in $O(\log n)$ time.

MSC codes

  1. 05C50
  2. 15B52
  3. 68R10


  1. spectral graph theory
  2. electrical flows
  3. sparsification

Get full access to this article

View all available purchase options and get full access to this article.


D. Achlioptas, Database-friendly random projections: Johnson-Lindenstrauss with binary coins, J. Comput. System Sci., 66 (2003), pp. 671–687.
D. Achlioptas and F. McSherry, Fast computation of low-rank matrix approximations, J. ACM, 54 (2007), article 9.
S. Arora, E. Hazan, and S. Kale, A fast random sampling algorithm for sparsifying matrices, in APPROX-RANDOM '06, Lecture Notes in Comput. Sci. 4110, Springer, Berlin, New York, 2006, pp. 272–279.
J. D. Batson, D. A. Spielman, and N. Srivastava, Twice-Ramanujan sparsifiers, in Proceedings of the 41st Annual ACM Symposium on Theory of Computing (STOC '09), ACM, New York, 2009, pp. 255–262.
A. A. Benczúr and D. R. Karger, Approximating s-t minimum cuts in $\tilde{O}(n^2)$ time, in Proceedings of the 28th Annual ACM Symposium on Theory of Computing (STOC '96), 1996, pp. 47–55.
B. Bollobas, Modern Graph Theory, Springer, Berlin, New York, 1998.
A. K. Chandra, P. Raghavan, W. L. Ruzzo, and R. Smolensky, The electrical resistance of a graph captures its commute and cover times, Comput. Complexity, 6 (1996), pp. 312–340.
F. R. K. Chung, Spectral Graph Theory, CBMS Regional Conf. Ser. in Math. 92, AMS, Providence, RI, 1997.
P. Doyle and J. Snell, Random Walks and Electric Networks, Math. Assoc. America, Washington, DC, 1984.
P. Drineas and R. Kannan, Pass efficient algorithms for approximating large matrices, in Proceedings of the 14th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA '03), ACM, New York, SIAM, Philadelphia, 2003, pp. 223–232.
P. Drineas, R. Kannan, and M. W. Mahoney, Fast Monte Carlo algorithms for matrices II: Computing a low-rank approximation to a matrix, SIAM J. Comput., 36 (2006), pp. 158–183.
A. Firat, S. Chatterjee, and M. Yilmaz, Genetic clustering of social networks using random walks, Comput. Statist. Data Anal., 51 (2007), pp. 6285–6294.
F. Fouss, A. Pirotte, J.-M. Renders, and M. Saerens, Random-walk computation of similarities between nodes of a graph with application to collaborative recommendation, IEEE Trans. Knowledge Data Eng., 19 (2007), pp. 355–369.
A. Frieze, R. Kannan, and S. Vempala, Fast Monte-Carlo algorithms for finding low-rank approximations, J. ACM, 51 (2004), pp. 1025–1041.
C. Godsil and G. Royle, Algebraic Graph Theory, Grad. Texts in Math., Springer, Berlin, New York, 2001.
A. V. Goldberg and R. E. Tarjan, A new approach to the maximum flow problem, J. ACM, 35 (1988), pp. 921–940.
S. Guattery and G. L. Miller, Graph embeddings and Laplacian eigenvalues, SIAM J. Matrix Anal. Appl., 21 (2000), pp. 703–723.
W. Johnson and J. Lindenstrauss, Extensions of Lipschitz mappings into a Hilbert space, in Modern Analysis and Probability, Contemp. Math. 26, AMS, Providence, RI, 1984, pp. 189–206.
R. Khandekar, S. Rao, and U. Vazirani, Graph partitioning using single commodity flows, J. ACM, 56 (2009), article 19.
G. Lugosi, Concentration-of-Measure Inequalities, 2003. Available online at http://www.econ. upf.edu/$\!_{^{\sim}}\!$lugosi/anu.ps.
M. Rudelson, Random vectors in the isotropic position, J. Funct. Anal., 163 (1999), pp. 60–72.
M. Rudelson and R. Vershynin, Sampling from large matrices: An approach through geometric functional analysis, J. ACM, 54 (2007), article 21.
D. A. Spielman and S.-H. Teng, Nearly-linear time algorithms for graph partitioning, graph sparsification, and solving linear systems, in Proceedings of the 36th Annual ACM Symposium on Theory of Computing (STOC '04), 2004, pp. 81–90. Full version available online at http:// arxiv.org/abs/cs.DS/0310051.
D. A. Spielman and S.-H. Teng, Nearly-Linear Time Algorithms for Preconditioning and Solving Symmetric, Diagonally Dominant Linear Systems, preprint, 2006. Available online at http://www.arxiv.org/abs/cs.NA/0607105.
D. A. Spielman and S.-H. Teng, Spectral Sparsification of Graphs, preprint, 2008. Available online at http://arxiv.org/abs/0808.4134.

Information & Authors


Published In

cover image SIAM Journal on Computing
SIAM Journal on Computing
Pages: 1913 - 1926
ISSN (online): 1095-7111


Submitted: 2 September 2008
Accepted: 30 November 2009
Published online: 22 December 2011

MSC codes

  1. 05C50
  2. 15B52
  3. 68R10


  1. spectral graph theory
  2. electrical flows
  3. sparsification



Metrics & Citations



If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

Cited By

View Options

View options


View PDF







Copy the content Link

Share with email

Email a colleague

Share on social media