cs240a-graphs

# cs240a-graphs - CS240A Computation on Graphs Graphs and...

This preview shows pages 1–14. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the 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 self-loops or vertex weights • Nnz per row (off diagonal) is vertex out-degree • Full storage: • 2-dimensional 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 1-dimensional 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 1-dimensional 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 Row-wise 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: Breadth-first search in a large power-law graph 1 2 3 4 7 6 5 Floating-Point 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 Node-to-node 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 breadth-first search example slides Breadth-first search • BFS example slides • BFS sequential code example • BFS Cilk slides Social Network Analysis in Matlab: 1993 Co-author 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.

### Page1 / 46

cs240a-graphs - CS240A Computation on Graphs Graphs and...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online