This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS240A: Computation on Graphs Graphs and Sparse Matrices 1 1 1 2 1 1 1 3 1 1 1 4 1 1 5 1 1 6 1 1 1 2 3 4 5 6 3 6 2 1 5 4 • Sparse matrix is a representation of a (sparse) graph • Matrix entries can be just 1’s, or edge weights • Diagonal can represent selfloops or vertex weights • Nnz per row (off diagonal) is vertex outdegree • Full storage: • 2dimensional array of real or complex numbers • (nrows*ncols) memory 31 53 59 41 26 31 53 59 41 26 1 3 2 1 2 • Sparse storage: • compressed storage by rows (CSR) • three 1dimensional arrays • (2*nzs + ncols + 1) memory • similarly, CSC 1 3 4 6 value: col: rowstart: Sparse matrix data structure (stored by rows, CSR) 1 2 2 3 3 2 CSR graph storage: • three 1dimensional arrays • digraph: ne + nv + 1 memory • undirected graph: 2*ne + nv + 1 memory; edge {v,w} appears once for v, once for w • firstnbr[0] = 0; for a digraph, firstnbr[nv] = ne 2 5 6 7 nbr: firstnbr: Compressed graph data structure (CSR) Like matrix CSR, but indices & vertex numbers start at 0 2 1 3 P P 1 P 2 P n 59 41 53 26 31 2 3 1 3 1 Rowwise decomposition Each processor stores: • # of local edges (nonzeros) • range of local vertices (rows) • edges (nonzeros) in CSR form Alternative: 2D decomposition Graph (or sparse matrix) in distributed memory, CSR Large graphs are everywhere… WWW snapshot, courtesy Y. Hyun Yeast protein interaction network, courtesy H. Jeong Internet structure Social interactions Scientific datasets: biological, chemical, cosmological, ecological, … Top 500 List (November 2010) = x P A L U Top500 Benchmark: Solve a large system of linear equations by Gaussian elimination Graph 500 List (November 2010) Graph500 Benchmark: Breadthfirst search in a large powerlaw graph 1 2 3 4 7 6 5 FloatingPoint vs. Graphs = x P A L U 1 2 3 4 7 6 5 2.5 Peta / 6.6 Giga is about 380,000! 2.5 Petaflops 6.6 Gigateps Nodetonode searches in graphs … • Who are my friends’ friends? • How many hops from A to B? (six degrees of Kevin Bacon) • What’s the shortest route to Las Vegas? • Am I related to Abraham Lincoln? • Who likes the same movies I do, and what other movies do they like? • . . . • See breadthfirst search example slides Breadthfirst search • BFS example slides • BFS sequential code example • BFS Cilk slides Social Network Analysis in Matlab: 1993 Coauthor graph from 1993 Householder symposium Social network analysis Betweenness Centrality (BC) CB(v): Among all the shortest paths, what fraction of them pass...
View
Full
Document
This note was uploaded on 12/27/2011 for the course CMPSC 240A taught by Professor Gilbert during the Fall '09 term at UCSB.
 Fall '09
 GILBERT

Click to edit the document details