ECS231: Spectral Partitioning. Based on Berkeley s CS267 lecture on graph partition

Similar documents
Markov Chains and Spectral Clustering

Networks and Their Spectra

On the Maximal Error of Spectral Approximation of Graph Bisection

Partitioning Networks by Eigenvectors

Space-Variant Computer Vision: A Graph Theoretic Approach

CS168: The Modern Algorithmic Toolbox Lectures #11 and #12: Spectral Graph Theory

MATH 567: Mathematical Techniques in Data Science Clustering II

Spectral Clustering. Spectral Clustering? Two Moons Data. Spectral Clustering Algorithm: Bipartioning. Spectral methods

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix

Spectral clustering. Two ideal clusters, with two points each. Spectral clustering algorithms

Spectral Clustering on Handwritten Digits Database Mid-Year Pr

Spectral Generative Models for Graphs

Summary: A Random Walks View of Spectral Segmentation, by Marina Meila (University of Washington) and Jianbo Shi (Carnegie Mellon University)

Chapter 11. Matrix Algorithms and Graph Partitioning. M. E. J. Newman. June 10, M. E. J. Newman Chapter 11 June 10, / 43

1 Matrix notation and preliminaries from spectral graph theory

Data Analysis and Manifold Learning Lecture 7: Spectral Clustering

MATH 3511 Lecture 1. Solving Linear Systems 1

CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University

Numerical Linear Algebra

Lecture 12 : Graph Laplacians and Cheeger s Inequality

Spectral Graph Theory and its Applications. Daniel A. Spielman Dept. of Computer Science Program in Applied Mathematics Yale Unviersity

Eigenvalue Problems Computation and Applications

arxiv: v1 [math.co] 1 Mar 2017

Spectral Clustering. Zitao Liu

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

1 Matrix notation and preliminaries from spectral graph theory

Block Lanczos Tridiagonalization of Complex Symmetric Matrices

Review of Linear Algebra

COMPSCI 514: Algorithms for Data Science

STA141C: Big Data & High Performance Statistical Computing

CS 664 Segmentation (2) Daniel Huttenlocher

An Introduction to Spectral Graph Theory

CS 246 Review of Linear Algebra 01/17/19

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Data Analysis and Manifold Learning Lecture 3: Graphs, Graph Matrices, and Graph Embeddings

Graphs in Machine Learning

Clustering. SVD and NMF

A lower bound for the Laplacian eigenvalues of a graph proof of a conjecture by Guo

Machine Learning for Data Science (CS4786) Lecture 11

Matrices, Moments and Quadrature, cont d

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

Quantum Annealing Approaches to Graph Partitioning on the D-Wave System

Spectral Clustering on Handwritten Digits Database

Linear Algebra Background

GRAPH PARTITIONING WITH MATRIX COEFFICIENTS FOR SYMMETRIC POSITIVE DEFINITE LINEAR SYSTEMS

MATH 567: Mathematical Techniques in Data Science Clustering II

CSE 291. Assignment Spectral clustering versus k-means. Out: Wed May 23 Due: Wed Jun 13

CS 556: Computer Vision. Lecture 13

CS168: The Modern Algorithmic Toolbox Lecture #8: How PCA Works

4.8 Arnoldi Iteration, Krylov Subspaces and GMRES

Dissertation Defense

An indicator for the number of clusters using a linear map to simplex structure

Linear Algebra Methods for Data Mining

18.312: Algebraic Combinatorics Lionel Levine. Lecture 19

Last Time. Social Network Graphs Betweenness. Graph Laplacian. Girvan-Newman Algorithm. Spectral Bisection

Spectral Techniques for Clustering

j=1 u 1jv 1j. 1/ 2 Lemma 1. An orthogonal set of vectors must be linearly independent.

Spectral Graph Theory

MATH 304 Linear Algebra Lecture 20: The Gram-Schmidt process (continued). Eigenvalues and eigenvectors.

Part I: Preliminary Results. Pak K. Chan, Martine Schlag and Jason Zien. Computer Engineering Board of Studies. University of California, Santa Cruz

MATH 829: Introduction to Data Mining and Analysis Clustering II

Communities, Spectral Clustering, and Random Walks

OPTIMAL SCALING FOR P -NORMS AND COMPONENTWISE DISTANCE TO SINGULARITY

Matrices and Vectors. Definition of Matrix. An MxN matrix A is a two-dimensional array of numbers A =

Estimating the Largest Elements of a Matrix

Power Grid Partitioning: Static and Dynamic Approaches

Memory-Efficient Low Rank Approximation of Massive Graphs

Exponentials of Symmetric Matrices through Tridiagonal Reductions

SVD, Power method, and Planted Graph problems (+ eigenvalues of random matrices)

Spectral Graph Theory and You: Matrix Tree Theorem and Centrality Metrics

MATRICES. a m,1 a m,n A =

L-RCM: a method to detect connected components in undirected graphs by using the Laplacian matrix and the RCM algorithm

AM205: Assignment 2. i=1

Solving Constrained Rayleigh Quotient Optimization Problem by Projected QEP Method

Markov Chains, Random Walks on Graphs, and the Laplacian

Linear Algebra Practice Problems

Convex Optimization of Graph Laplacian Eigenvalues

ON THE QUALITY OF SPECTRAL SEPARATORS

Background Mathematics (2/2) 1. David Barber

Applied Linear Algebra in Geoscience Using MATLAB

Lecture 9: Low Rank Approximation

Communities, Spectral Clustering, and Random Walks

ORIE 6334 Spectral Graph Theory October 13, Lecture 15

Lecture 14: SVD, Power method, and Planted Graph problems (+ eigenvalues of random matrices) Lecturer: Sanjeev Arora

An Introduction to Algebraic Multigrid (AMG) Algorithms Derrick Cerwinsky and Craig C. Douglas 1/84

Graph Partitioning Using Random Walks

ANONSINGULAR tridiagonal linear system of the form

Review of Basic Concepts in Linear Algebra

Fast Linear Iterations for Distributed Averaging 1

Math 471 (Numerical methods) Chapter 3 (second half). System of equations

Elementary maths for GMT

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

5.1 Banded Storage. u = temperature. The five-point difference operator. uh (x, y + h) 2u h (x, y)+u h (x, y h) uh (x + h, y) 2u h (x, y)+u h (x h, y)

Data Mining Techniques

Solving Symmetric Indefinite Systems with Symmetric Positive Definite Preconditioners

Robust Motion Segmentation by Spectral Clustering

Graph fundamentals. Matrices associated with a graph

Laplacian Matrices of Graphs: Spectral and Electrical Theory

Computational math: Assignment 1

Transcription:

ECS231: Spectral Partitioning Based on Berkeley s CS267 lecture on graph partition 1

Definition of graph partitioning Given a graph G = (N, E, W N, W E ) N = nodes (or vertices), E = edges W N = node weights W E = edge weights Ex: N = {tasks}, W N = {task costs}, E = {edge (j,k): task j sends W E (j,k) words to task k} Graph partitioning: 2 (2) 1 3 (1) 4 1 (2) 2 4 (3) 2 3 1 2 5 (1) 8 (1) 5 1 6 6 (2) 7 (3) choose a partition N = N 1 U N 2 U U N P such that The sum of the node weights in each N j is about the same The sum of all edge weights of edges connecting all different pairs N j and N k is minimized Ex: balance the work load, while minimizing communication Special case of N = N 1 U N 2 : graph bisection 2

Applications Telephone network design Original application, algorithm due to Kernighan VLSI layout N = {units on chip}, E = {wires}, W E (j,k) = wire length Data mining and clustering Physical mapping of DNA 3

High-performance computing Load balancing while minimizing communication in HPC: Sparse matrix-vector multiplication N = {1,2,,n}, (j,k) in E if A(j,k) nonzero, W E (j,k) = 1 W N (j) = # nonzeros in row j Sparse Gaussian elimination Used to reorder rows and columns to increase parallelism, decrease fill-ins 4

Sparse matrix partition: 5

Cost of graph partitioning Many possible partitionings to search: n choose n/2 ~ sqrt(2n/pi)*2 n bisection possibilities Choosing optimal partitioning is NP-complete Only known exact algorithms have cost = exponential(n) Need good heuristics 6

First heuristic: repeated graph bisection To partition N into 2 k parts bisect graph recursively k times Henceforth discuss mostly graph bisection Tapir 7

Coordinate-free partitioning Popular techniques for partitioning Breadth-First Search simple, but not great partition Kernighan-Lin good corrector given reasonable partition Spectral Method good partitions, but may be slow Multilevel methods Used to speed up problems that are too large/slow Coarsen, partition, expand, improve Can be used with K-L and Spectral methods and others Speed/quality For load balancing of grids, multi-level K-L probably best For other partitioning problems (vision, clustering, etc.), spectral may be better Good software available: meshpart, metis, chaco, 8

Coordinate-free: spectral bisection Definitions Basic spectral bisection algorithm Fiedler s theorem Implementation via the Lanczos algorithm Reference: Fiedler (1970s): basic theory, Pothen, Simon and Liou (1990): one of first ``modern treatments 9

Basic definitions Definition: The incidence matrix In(G) of a graph G(N,E) is an N by E matrix, with one row for each node and one column for each edge. If edge e=(i,j) then column e of In(G) is zero except for the i-th and j-th entries, which are +1 and -1, respectively. Slightly ambiguous definition because multiplying column e of In(G) by -1 still satisfies the definition, but this won t matter... Definition: The Laplacian matrix L(G) of a graph G(N,E) is an N by N symmetric matrix, with one row and column for each node. It is defined by L(G) (i,i) = degree of node I (number of incident edges) L(G) (i,j) = -1 if i!= j and there is an edge (i,j) L(G) (i,j) = 0 otherwise 10

Example of In(G) and L(G) 11

Properties of incidence and Laplacian matrices 1. In(G) * (In(G)) T = L(G). This is independent of the signs chosen for each column of In(G). 2. L(G) is symmetric. (This means the eigenvalues of L(G) are real and its eigenvectors are real and orthogonal.) 3. Let e = [1,,1] T, i.e. the column vector of all ones. Then L(G)*e=0. 4. Suppose L(G)*v = λ*v, so that v is an eigenvector and λ an eigenvalue of L(G). Then λ = In(G) T * v 2 / v 2 x 2 = Σ k x 2 k = Σ { (v(i)-v(j)) 2 for all edges e=(i,j) } / Σ i v(i) 2 5. The eigenvalues of L(G) are nonnegative: 0 = λ 1 <= λ 2 <= <= λ n 6. The number of connected components of G is equal to the number of λ i equal to 0. In particular, λ 2!= 0 if and only if G is connected. Definition: λ 2 (L(G)) is the algebraic connectivity of G 12

Basic spectral bisection algorithm Compute eigenvector v 2 corresponding to λ 2 (L(G)) For each node j of G if v 2 (j) < 0 put node j in partition N- else put node j in partition N+ 13

Spectral bisection algorithm (cont d) Why does this make sense? Fiedler s theorem: 1. Let G be connected, and N- and N+ defined as above. Then N- is connected. If no v 2 (j) = 0, then N+ is also connected. 2. Let G 1 (N,E 1 ) be a subgraph of G(N,E), so that G 1 is less connected than G. Then λ 2 (L(G 1 )) <= λ 2 (L(G)), i.e. the algebraic connectivity of G 1 is less than or equal to the algebraic connectivity of G. 14

Computing v 2 and λ 2 of L(G) using Lanczos Given any n-by-n symmetric matrix A (such as L(G)). Lanczos computes a k-by-k approximation T by doing k matrix-vector products, k << n Choose an arbitrary starting vector r b(0) = r j=0 repeat j=j+1 q(j) = r/b(j-1) scale a vector r = A*q(j) matrix vector multiplication, the most expensive step r = r - b(j-1)*v(j-1) saxpy, or scalar*vector + vector a(j) = v(j) T * r dot product r = r - a(j)*v(j) saxpy b(j) = r compute vector norm until convergence details omitted T = a(1) b(1) b(1) a(2) b(2) b(2) a(3) b(3) b(k-2) a(k-1) b(k-1) b(k-1) a(k) Approximate A s eigenvalues/vectors using T s 15

Summary Laplacian matrix represents graph connectivity Second eigenvector gives a graph bisection Roughly equal weights in two parts Weak connection in the graph will be separator Implementation via the Lanczos algorithm 16

First references M. Fiedler, Algebraic connectivity of graphs, Czech Math. J., Vol.23, pp.298-305, 1973 and Vol.25, pp.619-637, 1975 A. Pothen, H. Simon and K.-P. Liou, ``Partitioning sparse matrices with eigenvectors of graphs, SIAM J. Mat. Anal. Appl., 11:430-452,1990 J. Shi and J. Malik, Normalized cuts and image segmentation. IEEE Trans. On Pattern Analysis and Machine Intelligence, 22:888-908,2000. 17

Meshpart toolbox Meshpart: Matlab mesh partitioning and graph separator toolbox by J. Gilbert and S. Teng http://www.cerfacs.fr/algor/softs/meshpart Demo: Load Graphpartdata.mat Gplot(Tapir,Txy) [part1,part2]=specpart(tapir,txy); Main files: specpart.m, fiedler.m 18