Spectral Graph Theory (Basics)

Slides:



Advertisements
Similar presentations
Leting Wu Xiaowei Ying, Xintao Wu Aidong Lu and Zhi-Hua Zhou PAKDD 2011 Spectral Analysis of k-balanced Signed Graphs 1.
Advertisements

CHARALAMPOS E. TSOURAKAKIS SCHOOL OF COMPUTER SCIENCE CARNEGIE MELLON UNIVERSITY Fast counting of triangles in large networks without counting: Algorithms.
Modularity and community structure in networks
Information Networks Graph Clustering Lecture 14.
Online Social Networks and Media. Graph partitioning The general problem – Input: a graph G=(V,E) edge (u,v) denotes similarity between u and v weighted.
Clustering II CMPUT 466/551 Nilanjan Ray. Mean-shift Clustering Will show slides from:
10/11/2001Random walks and spectral segmentation1 CSE 291 Fall 2001 Marina Meila and Jianbo Shi: Learning Segmentation by Random Walks/A Random Walks View.
1 Representing Graphs. 2 Adjacency Matrix Suppose we have a graph G with n nodes. The adjacency matrix is the n x n matrix A=[a ij ] with: a ij = 1 if.
Graph Clustering. Why graph clustering is useful? Distance matrices are graphs  as useful as any other clustering Identification of communities in social.
Graph Clustering. Why graph clustering is useful? Distance matrices are graphs  as useful as any other clustering Identification of communities in social.
Lecture 21: Spectral Clustering
Spectral Clustering Scatter plot of a 2D data set K-means ClusteringSpectral Clustering U. von Luxburg. A tutorial on spectral clustering. Technical report,
Spectral Clustering 指導教授 : 王聖智 S. J. Wang 學生 : 羅介暐 Jie-Wei Luo.
3D Geometry for Computer Graphics
Undirected ST-Connectivity 2 DL Omer Reingold, STOC 2005: Presented by: Fenghui Zhang CPSC 637 – paper presentation.
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Three Algorithms for Nonlinear Dimensionality Reduction Haixuan Yang Group Meeting Jan. 011, 2005.
Multigrid Eigensolvers for Image Segmentation Andrew Knyazev Supported by NSF DMS This presentation is at
CSE 321 Discrete Structures Winter 2008 Lecture 25 Graph Theory.
3D Geometry for Computer Graphics
Expanders Eliyahu Kiperwasser. What is it? Expanders are graphs with no small cuts. The later gives several unique traits to such graph, such as: – High.
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Fall 2014 Doug James Lecture 17: Graphs.
Undirected ST-Connectivity In Log Space
Undirected ST-Connectivity In Log Space Omer Reingold Slides by Sharon Bruckner.
CS8803-NS Network Science Fall 2013
Network Measures Social Media Mining. 2 Measures and Metrics 2 Social Media Mining Network Measures Klout.
CMU SCS Large Graph Mining: Power Tools and a Practitioner’s Guide Christos Faloutsos Gary Miller Charalampos (Babis) Tsourakakis CMU.
Eigenvalue Problems Solving linear systems Ax = b is one part of numerical linear algebra, and involves manipulating the rows of a matrix. The second main.
Wei Wang Xi’an Jiaotong University Generalized Spectral Characterization of Graphs: Revisited Shanghai Conference on Algebraic Combinatorics (SCAC), Shanghai,
Institute for Advanced Study, April Sushant Sachdeva Princeton University Joint work with Lorenzo Orecchia, Nisheeth K. Vishnoi Linear Time Graph.
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
1 CS104 : Discrete Structures Chapter V Graph Theory.
Spectral Analysis based on the Adjacency Matrix of Network Data Leting Wu Fall 2009.
Markov Chains and Random Walks. Def: A stochastic process X={X(t),t ∈ T} is a collection of random variables. If T is a countable set, say T={0,1,2, …
Most of contents are provided by the website Graph Essentials TJTSD66: Advanced Topics in Social Media.
Domain decomposition in parallel computing Ashok Srinivasan Florida State University.
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graph Partitioning using Single Commodity Flows
Spectral Graph Theory and the Inverse Eigenvalue Problem of a Graph Leslie Hogben Department of Mathematics, Iowa State University, Ames, IA 50011
Graphs, Vectors, and Matrices Daniel A. Spielman Yale University AMS Josiah Willard Gibbs Lecture January 6, 2016.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
 In the previews parts we have seen some kind of segmentation method.  In this lecture we will see graph cut, which is a another segmentation method.
Network Theory: Community Detection Dr. Henry Hexmoor Department of Computer Science Southern Illinois University Carbondale.
Steffen Staab 1WeST Web Science & Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction.
Presented by Alon Levin
Spectral Clustering Shannon Quinn (with thanks to William Cohen of Carnegie Mellon University, and J. Leskovec, A. Rajaraman, and J. Ullman of Stanford.
A Tutorial on Spectral Clustering Ulrike von Luxburg Max Planck Institute for Biological Cybernetics Statistics and Computing, Dec. 2007, Vol. 17, No.
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
Laplacian Matrices of Graphs: Algorithms and Applications ICML, June 21, 2016 Daniel A. Spielman.
CS 140: Sparse Matrix-Vector Multiplication and Graph Partitioning
Laplacian Matrices of Graphs: Algorithms and Applications ICML, June 21, 2016 Daniel A. Spielman.
Great Theoretical Ideas In Computer Science
DOULION: Counting Triangles in Massive Graphs with a Coin
School of Computing Clemson University Fall, 2012
Combinatorial Spectral Theory of Nonnegative Matrices
Markov Chains Mixing Times Lecture 5
GRAPHS Lecture 16 CS2110 Fall 2017.
Network analysis.
Structural Properties of Low Threshold Rank Graphs
Degree and Eigenvector Centrality
Ilan Ben-Bassat Omri Weinstein
Spectral Clustering Eric Xing Lecture 8, August 13, 2010
3.3 Network-Centric Community Detection
Undirected ST-Connectivity In Log Space
Great Theoretical Ideas In Computer Science
Text Book: Introduction to algorithms By C L R S
Adjacency Matrices and PageRank
GRAPHS Lecture 17 CS2110 Spring 2018.
Richard Anderson Lecture 5 Graph Theory
Richard Anderson Winter 2019 Lecture 5
Presentation transcript:

Spectral Graph Theory (Basics) Charalampos (Babis) Tsourakakis CMU Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Matrix Representations of G(V,E) Faloutsos, Tong Matrix Representations of G(V,E) Associate a matrix to a graph: Adjacency matrix Laplacian Normalized Laplacian Main focus Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Matrix as an operator The image of the unit circle (sphere) under any mxn matrix is an ellipse (hyperellipse). e.g., Charalampos E. Tsourakakis

More Reminders Let M be a symmetric nxn matrix. Faloutsos, Tong More Reminders Let M be a symmetric nxn matrix. λ eigenvalue x eigenvector Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong More Reminders 1-Dimensional Invariant Subspaces Diagonal: No rotation y x (λ,u) Ax Ay Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Keep in mind! For the rest of slides we are talking for square nxn matrices and unless noticed symmetric ones, i.e, Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Cheeger Inequality and Sparsest Cut: Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Adjacency matrix Undirected 4 1 A= 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Adjacency matrix Undirected Weighted 4 10 1 4 0.3 A= 2 3 2 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Adjacency matrix Directed 4 1 Observation If G is undirected, A = AT 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Spectral Theorem Theorem [Spectral Theorem] If M=MT, then where Reminder 2: xi i-th principal axis λi length of i-th principal axis Reminder 1: xi,xj orthogonal λi λj xi xj Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Faloutsos, Tong Bipartite Graphs Any graph with no cycles of odd length is bipartite e.g., all trees are bipartite K3,3 1 4 2 5 Can we check if a graph is bipartite via its spectrum? Can we get the partition of the vertices in the two sets of nodes? 3 6 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Bipartite Graphs Adjacency matrix K3,3 1 4 where 2 5 3 6 Why λ1=-λ2=3? Recall: Ax=λx, (λ,x) eigenvalue-eigenvector Eigenvalues: Λ=[3,-3,0,0,0,0] Charalampos E. Tsourakakis

Faloutsos, Tong Bipartite Graphs 1 1 3=3x1 2 1 3 1 1 4 1 4 1 1 1 2 5 5 1 1 1 3 6 6 Repeat same argument for the other nodes Charalampos E. Tsourakakis

Bipartite Graphs 1 -1 -3=(-3)x1 -2 -1 -3 -1 1 -1 -1 1 -1 -1 1 4 1 4 2 Faloutsos, Tong Bipartite Graphs 1 -1 -3=(-3)x1 -2 -1 -3 -1 1 4 1 4 1 -1 -1 2 5 5 1 -1 -1 3 6 6 Repeat same argument for the other nodes Charalampos E. Tsourakakis

Faloutsos, Tong Bipartite Graphs Observation u2 gives the partition of the nodes in the two sets S, V-S! S V-S Question: Were we just “lucky”? Answer: No Theorem: λ2=-λ1 iff G bipartite. u2 gives the partition. Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Walks A walk of length r in a directed graph: where a node can be used more than once. Closed walk when: 4 4 1 1 Closed walk of length 3 2-1-3-2 Walk of length 2 2-1-4 2 2 3 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Walks Theorem G(V,E) directed graph, adjacency matrix A. The number of walks from node u to node v in G with length r is (Ar)uv Proof Induction on k. See Doyle-Snell, p.165 (i,j) (i, i1),(i1,j) (i,i1),..,(ir-1,j) Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Walks 4 1 2 3 4 i=3, j=3 i=2, j=4 4 1 1 2 3 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Walks 4 1 2 3 Always 0, node 4 is a sink 4 1 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Walks Corollary A adjacency matrix of undirected G(V,E) (no self loops), e edges and t triangles. Then the following hold: a) trace(A) = 0 b) trace(A2) = 2e c) trace(A3) = 6t 1 Computing Ar is a bad idea: High memory requirements, expensive! 1 2 1 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Why is Triangle Counting important? From the Graph Mining Perspective Clustering coefficient Transitivity ratio Social Network Analysis fact: “Friends of friends are friends” A C B Other applications include: Hidden Thematic Structure of the Web Motif Detection, e.g., biological networks Web Spam Detection Charalampos E. Tsourakakis

Theorem [EigenTriangle] Theorem δ(G) = # triangles in graph G(V,E) = eigenvalues of adjacency matrix A Charalampos E. Tsourakakis

Theorem[EigenTriangleLocal] δ(i) = #Δs vertex i participates at. = i-th eigenvector = j-th entry of Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Algorithm’s idea Almost symmetric around 0! Political Blogs Omit! Keep only 3! 3 Charalampos E. Tsourakakis

Results: Edges vs. Speedup Observe the trend Charalampos E. Tsourakakis

Charalampos E. Tsourakakis #Eigenvalues vs. ϱ 2-3 eigenvalues almost ideal results! Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Laplacian 4 1 L= D-A= 2 3 Diagonal matrix, dii=di Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Weighted Laplacian 4 10 1 4 0.3 2 3 2 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Connected Components Lemma Let G be a graph with n vertices and c connected components. If L is the Laplacian of G, then rank(L)=n-c. Proof see p.279, Godsil-Royle Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Connected Components G(V,E) 1 2 3 L= 4 6 #zeros = #components 7 5 eig(L)= Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Connected Components G(V,E) 1 2 3 L= 0.01 4 6 #zeros = #components Indicates a “good cut” 7 5 eig(L)= Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Adjacency vs. Laplacian Intuition Faloutsos, Tong Adjacency vs. Laplacian Intuition V-S Let x be an indicator vector: S Consider now y=Lx k-th coordinate Charalampos E. Tsourakakis

Adjacency vs. Laplacian Intuition Faloutsos, Tong Adjacency vs. Laplacian Intuition G30,0.5 S Consider now y=Lx k Charalampos E. Tsourakakis

Adjacency vs. Laplacian Intuition Faloutsos, Tong Adjacency vs. Laplacian Intuition G30,0.5 S Consider now y=Lx k Charalampos E. Tsourakakis

Adjacency vs. Laplacian Intuition Faloutsos, Tong Adjacency vs. Laplacian Intuition G30,0.5 S Consider now y=Lx k k Laplacian: connectivity, Adjacency: #paths Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why Sparse Cuts? Clustering, Community Detection And more: Telephone Network Design, VLSI layout, Sparse Gaussian Elimination, Parallel Computation cut 4 8 1 5 9 2 3 6 7 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Quality of a Cut Edge expansion/Isoperimetric number φ 4 1 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Quality of a Cut Edge expansion/Isoperimetric number φ 4 1 and thus 2 3 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why λ2? V-S Characteristic Vector x S Edges across cut Then: Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why λ2? S V-S cut 4 8 1 5 9 2 3 6 7 x=[1,1,1,1,0,0,0,0,0]T xTLx=2 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why λ2? Ratio cut Sparsest ratio cut NP-hard Relax the constraint: ? Normalize: Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why λ2? Sparsest ratio cut NP-hard Relax the constraint: λ2 Normalize: because of the Courant-Fisher theorem (applied to L) Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why λ2? OSCILLATE x1 xn Each ball 1 unit of mass Node id Eigenvector value Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Why λ2? Fundamental mode of vibration: “along” the separator Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Cheeger Inequality Step 1: Sort vertices in non-decreasing order according to their assigned by the second eigenvector value. Step 2: Decide where to cut. Bisection Best ratio cut Two common heuristics Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Example: Spectral Partitioning Faloutsos, Tong Example: Spectral Partitioning K500 K500 dumbbell graph A = zeros(1000); A(1:500,1:500)=ones(500)-eye(500); A(501:1000,501:1000)= ones(500)-eye(500); myrandperm = randperm(1000); B = A(myrandperm,myrandperm); In social network analysis, such clusters are called communities Charalampos E. Tsourakakis

Example: Spectral Partitioning Faloutsos, Tong Example: Spectral Partitioning This is how adjacency matrix of B looks spy(B) Charalampos E. Tsourakakis

Example: Spectral Partitioning Faloutsos, Tong Example: Spectral Partitioning This is how the 2nd eigenvector of B looks like. L = diag(sum(B))-B; [u v] = eigs(L,2,'SM'); plot(u(:,1),’x’) Not so much information yet… Charalampos E. Tsourakakis

Example: Spectral Partitioning Faloutsos, Tong Example: Spectral Partitioning This is how the 2nd eigenvector looks if we sort it. [ign ind] = sort(u(:,1)); plot(u(ind),'x') But now we see the two communities! Charalampos E. Tsourakakis

Example: Spectral Partitioning Faloutsos, Tong Example: Spectral Partitioning This is how adjacency matrix of B looks now spy(B(ind,ind)) Community 1 Cut here! Observation: Both heuristics are equivalent for the dumbell Community 2 Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Outline Reminders Adjacency matrix Intuition behind eigenvectors: Bipartite Graphs Walks of length k Case Study: Triangles Laplacian Connected Components Intuition: Adjacency vs. Laplacian Sparsest Cut and Cheeger Inequality : Derivation, intuition Example Normalized Laplacian Charalampos E. Tsourakakis

Where does it go from here? Faloutsos, Tong Where does it go from here? Normalized Laplacian Ng, Jordan, Weiss Spectral Clustering Laplacian Eigenmaps for Manifold Learning Computer Vision and many more applications… Standard reference: Spectral Graph Theory Monograph by Fan Chung Graham Charalampos E. Tsourakakis

Why Normalized Laplacian Faloutsos, Tong Why Normalized Laplacian K500 K500 The only weighted edge! Cut here Cut here φ= φ= > So, φ is not good here… Charalampos E. Tsourakakis

Why Normalized Laplacian Faloutsos, Tong Why Normalized Laplacian K500 K500 The only weighted edge! Cut here Cut here Optimize Cheeger constant h(G), balanced cuts φ= φ= > where Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Conclusions Spectrum tells us a lot about the graph. What to remember What is an eigenvector (f:Nodes Reals) Adjacency: #Paths Laplacian: Sparsest Cut and Intuition Normalized Laplacian: Normalized cuts, tend to avoid unbalanced cuts Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong References A list of references is on my web site, in the KDD tutorial web page www.cs.cmu.edu/~ctsourak/ Charalampos E. Tsourakakis

Charalampos E. Tsourakakis Faloutsos, Tong Thank you! Charalampos E. Tsourakakis