CS 5220: Parallel Graph Algorithms. David Bindel

Similar documents
Introduction to Parallel & Distributed Computing Parallel Graph Algorithms

Julienne: A Framework for Parallel Graph Algorithms using Work-efficient Bucketing

Randomized Algorithms

CSE 100: GRAPH ALGORITHMS

Lecture 6 Basic Graph Algorithms

CS 3410 Ch 14 Graphs and Paths

Chapter 9 Graph Algorithms

Graph Algorithms. Parallel and Distributed Computing. Department of Computer Science and Engineering (DEI) Instituto Superior Técnico.

CS61BL. Lecture 5: Graphs Sorting

Lesson 2 7 Graph Partitioning

Graphs & Digraphs Tuesday, November 06, 2007

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

Parallel Graph Algorithms

Lecture 4: Graph Algorithms

Graphs. Part II: SP and MST. Laura Toma Algorithms (csci2200), Bowdoin College

COMP 251 Winter 2017 Online quizzes with answers

Last week: Breadth-First Search

CS521 \ Notes for the Final Exam

TI2736-B Big Data Processing. Claudia Hauff

Link Analysis in the Cloud

CS 310 Advanced Data Structures and Algorithms

Tutorial. Question There are no forward edges. 4. For each back edge u, v, we have 0 d[v] d[u].

CSE 100 Minimum Spanning Trees Prim s and Kruskal

from notes written mostly by Dr. Carla Savage: All Rights Reserved

2. True or false: even though BFS and DFS have the same space complexity, they do not always have the same worst case asymptotic time complexity.

Graph Partitioning for Scalable Distributed Graph Computations

Minimum Spanning Trees

Weighted Graph Algorithms Presented by Jason Yuan

CSE 373 NOVEMBER 20 TH TOPOLOGICAL SORT

Big Data Management and NoSQL Databases

Lecture 19: Graph Partitioning

( ) n 3. n 2 ( ) D. Ο

Lecture 15: More Iterative Ideas

Algorithms: Design & Practice

A Framework for Processing Large Graphs in Shared Memory

Single Source Shortest Path (SSSP) Problem

Graph Algorithms. Chapter 22. CPTR 430 Algorithms Graph Algorithms 1

Direct Addressing Hash table: Collision resolution how handle collisions Hash Functions:

CS200: Graphs. Prichard Ch. 14 Rosen Ch. 10. CS200 - Graphs 1

Graph Theory. Many problems are mapped to graphs. Problems. traffic VLSI circuits social network communication networks web pages relationship

CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review

Jordan Boyd-Graber University of Maryland. Thursday, March 3, 2011

Figure 1: A directed graph.

A New Parallel Algorithm for Connected Components in Dynamic Graphs. Robert McColl Oded Green David Bader

Parallel Graph Algorithms

CS 220: Discrete Structures and their Applications. graphs zybooks chapter 10

Lecture 18. What we ve done and what s to come

TIE Graph algorithms

Graphs. Graph G = (V, E) Types of graphs E = O( V 2 ) V = set of vertices E = set of edges (V V)

Data-Intensive Computing with MapReduce

Chapter 9 Graph Algorithms

Problem Score Maximum MC 34 (25/17) = 50 Total 100

DESIGN AND ANALYSIS OF ALGORITHMS GREEDY METHOD

Shortest Path Problem

Algorithm Design and Analysis

Non Overlapping Communities

Konigsberg Bridge Problem

( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο

Graph traversal and BFS

Problem 1. Which of the following is true of functions =100 +log and = + log? Problem 2. Which of the following is true of functions = 2 and =3?

Lecture 11: Analysis of Algorithms (CS ) 1

CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014

High-Performance Graph Primitives on the GPU: Design and Implementation of Gunrock

Artificial Intelligence

Lecture Summary CSC 263H. August 5, 2016

Shortest Paths. Nishant Mehta Lectures 10 and 11

Chapter 9 Graph Algorithms

- Logic and Algorithms - Graph Algorithms

Graphs. Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale Room - Faner 3131

Graph Data Management

Mining Social Network Graphs

Virtual University of Pakistan

Shortest Paths. Nishant Mehta Lectures 10 and 11

Announcements Problem Set 4 is out!

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

CSE 100: GRAPH ALGORITHMS

Algorithm Design and Analysis

Graph Data Processing with MapReduce

CS 125 Section #6 Graph Traversal and Linear Programs 10/13/14

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019

Lecture 9 Graph Traversal

Multidimensional Arrays & Graphs. CMSC 420: Lecture 3

Graph Search. Adnan Aziz

Prelim 2. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer


Lecture 18. What we ve done and what s to come

n 2 ( ) ( ) + n is in Θ n logn

Nikos Anastopoulos, Konstantinos Nikas, Georgios Goumas and Nectarios Koziris

CS350: Data Structures Dijkstra s Shortest Path Alg.

Dijkstra s Algorithm Last time we saw two methods to solve the all-pairs shortest path problem: Min-plus matrix powering in O(n 3 log n) time and the

n 2 C. Θ n ( ) Ο f ( n) B. n 2 Ω( n logn)

Graph Algorithms. Definition

modern database systems lecture 10 : large-scale graph processing

Theory of Computing. Lecture 7 MAS 714 Hartmut Klauck

Graphs. Data Structures and Algorithms CSE 373 SU 18 BEN JONES 1

Scribes: Romil Verma, Juliana Cook (2015), Virginia Williams, Date: May 1, 2017 and Seth Hildick-Smith (2016), G. Valiant (2017), M.

Info 2950, Lecture 16

Unit 2: Algorithmic Graph Theory

Algorithm Design (8) Graph Algorithms 1/2

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI. Department of Computer Science and Engineering CS6301 PROGRAMMING DATA STRUCTURES II

Transcription:

CS 5220: Parallel Graph Algorithms David Bindel 2017-11-14 1

Graphs Mathematically: G = (V, E) where E V V Convention: V = n and E = m May be directed or undirected May have weights w V : V R or w E : E : R May have other node or edge attributes as well Path is [ (u i, u i+1 ) ] l i=1 E, sum of weights is length Diameter is max shortest path length between any s, t V Generalizations: Hypergraph (edges in V d ) Multigraph (multiple copies of edges) 2

Types of graphs 3

Types of graphs 4

Types of graphs 5

Types of graphs 6

Types of graphs 7

Types of graphs 8

Types of graphs Many possible structures: Lines and trees Completely regular grids Planar graphs (no edges need cross) Low-dimensional Euclidean Power law graphs... Algorithms are not one-size-fits-all! 9

Ends of a spectrum Planar Power law Vertex degree Uniformly small P(deg = k) k γ Radius Ω( n) Small Edge separators O( n) nothing small Linear solve Direct OK Iterative Prototypical apps PDEs Social networks Calls for different methods! 10

Applications: Routing and shortest paths 11/13/2017 Ithaca, New York to New York - Google Maps Ithaca, New York to New York Drive 230 miles, 4 h Map data 2017 Google via I-81 S and I-80 E Fastest route now due to tra c conditions This route has tolls. 20 mi 4h 230 miles via NY-17 E 4 h 14 min via I-81 S and I-78 E 4 h 17 min 234 miles 247 miles https://www.google.com/maps/dir/ithaca,+new+york/new+york/@41.532125,-76.369989,8z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x89d08182e0af88f7:0xae52 1/1 11

Applications: Traversal, ranking, clustering Unweighted Node weighted Edge weighted Web crawl / traversal PageRank, HITS Clustering similar documents 12

Applications: Sparse solvers Ordering for sparse factorization Partitioning Graph coarsening for AMG Other preconditioning ops... 13

Applications: Dimensionality reduction 14

Common building blocks Traversals Shortest paths Spanning tree Flow computations Topological sort Coloring...... and most of sparse linear algebra. 15

Over-simple models 0 1 1 2 2 2 2 3 3 Let t p = idealized time on p processors t 1 = work t = span (or depth, or critical path length) 16

One implication Don t bother with parallel DFS! Span is Ω(n). Let s spend a few minutes on more productive algorithms... 17

Parallel BFS Simple idea: parallelize across frontiers Pro: Simple to think about Pro: Lots of parallelism with small radius? Con: What if frontiers are small? 18

Parallel BFS: Ullman-Yannakakis Assuming a high-diameter graph: Form set S with start + random nodes, S = Θ( n log n) long shortest paths must go through S with high prob Take n steps of BFS from each seed in S Form aux weighted graph for distances between seeds Run all-pairs shortest path on aux graph OK, but what if diameter is not large? 19

LA take Indicate frontier at each stage by x x = A T x (multiply=select, add=min) 20

Parallel BFS: LA perspective Key ideas: At some point, switch from top-down expanding frontier ( are you my child? ) to bottom-up checking for parents ( are you my parent? ) Use 2D blocking of adjacency Temporally partition work: vertex processed by at most one processor at a time, cycle processors ( systolic rotation ) Together gives state-of-art performance. But... 21

Single-source shortest path Classic algorithm: Dijkstra Dequeue closest point from frontier and expand frontier Update priority queue of distances (can be done in parallel) Repeat Or run serial Dijkstra from different sources for APSP. 22

Alternate idea: label correcting Initialize d[u] with distance over-estimates to source d[s] = 0 Repeatedly relax d[u] := min (v,u) E d[v] + w(v, u) Converges (eventually) as long as all nodes visited repeatedly, updates are atomic. If serial sweep in a consistent order, call it Bellman-Ford. 23

Single-source shortest path: -stepping Alternate approach: hybrid algorithm Process a bucket at a time Relax light edges (weight < ) which might add to current bucket When bucket empties, relax heavy edges a la Dijkstra 24

Maximal independent sets S V independent if none are neighbors. Maximal if no others can be added and remain independent. Maximum if no other maximal independent set is bigger. Maximum is NP-hard; maximal is easy in one processor 25

Simple greedy MIS 3 4 5 2 9 7 11 8 10 1 6 Start with S empty For each v V sequentially, add v to S if possible. 26

Luby s algorithm Init S := Init candidates C := V While C Label each v with a random r(v) For each v C in parallel, if r(v) < min N (v) r(u) Move v from C to S Remove neighbors from v to C Very probably finishes in O(log n) rounds. 27

Luby s algorithm (round 1) 4.29 4.04 6.64 3.89 4.77 0.54 7.15 7.69 2.27 7.89 0.77 28

Luby s algorithm (round 1) 4.00 5.59 8.29 4.37 6.13 4.97 8.41 5.32 3.46 7.02 5.41 29

A fundamental problem Many graph ops are Computationally cheap (per node or edge) Bad for locality Memory bandwidth as a limiting factor. 30

Big data? Consider: 323 million in US (fits in 32-bit int) About 350 Facebook friends each Compressed sparse row: about 450 GB Topology (no metadata) on one big cloud node... 31

Graph representation: Adjacency matrix Pro: efficient for dense graphs Con: wasteful for sparse case... 32

Graph representation: Coordinate Tuples: (i, j, w ij ) Pro: Easy to update Con: Slow for multiply 33

Graph representation: Adj list Linked lists of adjacent nodes Pro: Still easy to update Con: May cost more to store than coord? 34

Graph representations: CSR 1 4 2 5 3 6 4 5 1 6 * 1 3 5 7 8 9 11 Adata col ptr Pro: traversal? Con: updates 35

Graph representations: implicit Idea: Never materialize a graph data structure Key: Provide traversal primitives Pro: Explicit rep n sometimes overkill for one-off graphs? Con: Hard to use canned software (except NLA?) 36

Graph algorithms and linear algebra Looks like LA Floyd-Warshall Breadth-first search? Really is standard LA Spectral partitioning and clustering PageRank and some other centralities Laplacian Paradigm (Spielman, Teng, others...) 37

Graph algorithms and linear algebra Semirings have and s.t. Addition is commutative+associative with an identity 0 Multiplication is associative with identity 1 Both are distributive a 0 = 0 a = 0 But no subtraction or division Technically have modules (vs vector spaces) over semirings 38

Graph algorithms and linear algebra Example: min-plus = min and additive identity 0 = + and multiplicative identity 1 0 Useful for breadth-first search (on board) 39

Graph BLAS http://www.graphblas.org/ Provisional API as of late May 2017 (Opaque) internal sparse matrix data structure Allows operations over misc semirings 40

Graph frameworks Several to choose from! Pregel, Apache Giraph, Stanford GPS,... GraphLab family GraphLab: Original distributed memory PowerGraph: Tuned toward natural (power law) networks GraphChi: Chihuahua shared memory vs distributed Outperformed by Galois, Ligra, BlockGRACE, others But... programming model was easy 41

Graph frameworks Think as a vertex Each vertex updates locally Exchanges messages with neighbors Runtime actually schedules updates/messages Message sent at super-step S arrives at S + 1 Looks like BSP 42

At what COST? Scalability! But at what COST? McSherry, Isard, Murray HotOS 15 You can have a second computer once you ve shown you know how to use the first one. Paul Barham (quoted in intro to HotOS15 paper) COST = Configuration that Outperforms a Single Thread Observation: many systems have unbounded COST! 43