Data Structures and Algorithms in Parallel Computing Lecture 3.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Graph Searching CSE 373 Data Structures Lecture 20.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 27 Graph Applications.
Data Structures Using C++
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
Data Structure and Algorithms (BCS 1223) GRAPH. Introduction of Graph A graph G consists of two things: 1.A set V of elements called nodes(or points or.
1 CSE 326: Data Structures: Graphs Lecture 19: Monday, Feb 24, 2003.
Graph.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Data Structures & Algorithms Graph Search Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
Graphs CS-240/341. Graphs Used for representing many-to-many relationships –can take two forms directed (digraph) - a finite set of elements called vertices.
Graph Traversals Reading Material: Chapter 9. Graph Traversals Some applications require visiting every vertex in the graph exactly once. The application.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Graphs CS-240/341. Uses for Graphs computer networks and routing airline flights geographic maps course prerequisite structures tasks for completing a.
Connected Components, Directed Graphs, Topological Sort COMP171.
Graphs. Graphs Many interesting situations can be modeled by a graph. Many interesting situations can be modeled by a graph. Ex. Mass transportation system,
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
Review of Graphs A graph is composed of edges E and vertices V that link the nodes together. A graph G is often denoted G=(V,E) where V is the set of vertices.
Important Problem Types and Fundamental Data Structures
Social Media Mining Graph Essentials.
Data Structures Using C++ 2E
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
MapReduce and Graph Data Chapter 5 Based on slides from Jimmy Lin’s lecture slides ( (licensed.
Algorithm Course Dr. Aref Rashad February Algorithms Course..... Dr. Aref Rashad Part: 5 Graph Algorithms.
Graph Algorithms. Definitions and Representation An undirected graph G is a pair (V,E), where V is a finite set of points called vertices and E is a finite.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
1 Applications of BFS and DFS CSE 2011 Winter May 2016.
Elementary Graph Algorithms CLRS Chapter 22. Graph A graph is a structure that consists of a set of vertices and a set of edges between pairs of vertices.
Most of contents are provided by the website Graph Essentials TJTSD66: Advanced Topics in Social Media.
Graph Introduction, Searching Graph Theory Basics - Anil Kishore.
Data Structures and Algorithms in Parallel Computing Lecture 2.
CSC212 Data Structure - Section AB
Graphs A graphs is an abstract representation of a set of objects, called vertices or nodes, where some pairs of the objects are connected by links, called.
Data Structures and Algorithms in Parallel Computing Lecture 7.
1 Directed Graphs Chapter 8. 2 Objectives You will be able to: Say what a directed graph is. Describe two ways to represent a directed graph: Adjacency.
Graphs Slide credits:  K. Wayne, Princeton U.  C. E. Leiserson and E. Demaine, MIT  K. Birman, Cornell U.
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
Graphs 2015, Fall Pusan National University Ki-Joune Li.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Chapter 05 Introduction to Graph And Search Algorithms.
Graph Representations And Traversals. Graphs Graph : – Set of Vertices (Nodes) – Set of Edges connecting vertices (u, v) : edge connecting Origin: u Destination:
Graph Searching CSIT 402 Data Structures II. 2 Graph Searching Methodology Depth-First Search (DFS) Depth-First Search (DFS) ›Searches down one path as.
Graphs David Kauchak cs302 Spring Admin HW 12 and 13 (and likely 14) You can submit revised solutions to any problem you missed Also submit your.
Lecture 20. Graphs and network models 1. Recap Binary search tree is a special binary tree which is designed to make the search of elements or keys in.
Graphs ORD SFO LAX DFW Graphs 1 Graphs Graphs
CS 201: Design and Analysis of Algorithms
Graphs Chapter 20.
Lecture 11 Graph Algorithms
CC 215 Data Structures Graph Searching
Depth-First Search.
Data Structures and Algorithms in Parallel Computing
CS120 Graphs.
Refresh and Get Ready for More
Connected Components Minimum Spanning Tree
Graphs Chapter 15 explain graph-based algorithms Graph definitions
Chapter 11 Graphs.
Lecture 13 CSE 331 Sep 27, 2017.
CSE 373 Data Structures Lecture 16
Subgraphs, Connected Components, Spanning Trees
Graphs Chapter 7 Visit for more Learning Resources.
Graphs G = (V, E) V are the vertices; E are the edges.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Important Problem Types and Fundamental Data Structures
Lecture 10 Graph Algorithms
Presentation transcript:

Data Structures and Algorithms in Parallel Computing Lecture 3

Graphs G=(V,E) where V is the set of vertices and E the set of edges Weighted graph – edges have weights w(e) Sparse graph – m=|E| << n=|V| Diameter of a graph D(G) the maximum, over all pairs of vertices (u, v), of the minimum number of edges that must be traversed to get from u to v

Examples Twitter graph – Vertices are users – Mentions or retweets are edges – Fast changing topology 5,700 tweets/second Highest peak: 143,199 tweets/second (August 3, 2013)

Examples Romanian road network – Vertices are cities – Edges are main national roads – Slow changing topology

Big Data Large volume > 2 B internet users 1 > 1 B active Facebook users 1 > 2.5 M daily active Twitter users 2 High velocity >7.5 K Tweets/second 1 >1.5 K Skype calls/second 1 >2000k s/second Kat Wiki Pam John … Twitter Interactions

Applications Community detection – Detect communities in graphs Users which interact a lot Graph dynamics – Spread of viral infections – Viral marketing Shortest drive path given real traffic data …

Limitations Memory – Too large to fit in memory – Requires large shared memory architectures or distributed systems Compute – Size and speed of change puts a lower limit on the processing speed

Parallel graph processing Sequential techniques are often hard to parallelize Easy – Minimum spanning tree – Biconnected components Hard – Single source shortest path Efficiency depends also on the type of graph – Sparse, dense, power law

Graph representations – Edge lists List of edges Each edge is a vertex pair – Adjacency lists Array of lists G[i] Each element corresponds to a vertex and contains the set of vertex neighbors Convert to edge list: – Adjacency matrices Binary matrix where A ij =1 iff (i,j) in E Used only for sparse graphs as it requires O(n 2 ) space

Graph representations For parallel algorithms – Replace linked lists with arrays – Makes it easer to process each array in parallel

Some examples Breadth first search Connected components Minimum spanning tree

Breadth first search Traverse a tree or graph from the root by visiting neigbours first, before moving to the next level Keep a queue of not visited vertices

Parallel BFS Graph is given as adjacency array Visit vertices in each level in parallel No need for a queue Keep a set of frontier vertices generated at each step by collecting the neighbors of current frontier set Initial frontier set is the single source vertex (root for trees) Due to parallelism same new frontier vertex may be collected by more vertices – Requires an extra step to clean duplicates – New frontier vertex linked randomly with only one parent Work is O(m+n) Concurrent write model ensures a total depth of O(D)

Example

Algorithm

Connected components Label 2 vertices with same label iff there is a path between the two Sequentially it can be achieved by depth first or breadth first search

Parallel CC Use parallel BFS? – Inneficient due to its O(D) depth – Good only for small diameter graphs Solution – Use graph contraction – Start with set of vertices Contract neighborhood to a single vertex recursively O(log n) steps for each component to contract

Random mate graph contraction

Algorithm

Deterministic graph contraction Create disjoint trees by assigning decremental labels to each child and only linking a vertex if its label is smaller than that of the last child

Algorithm No relabeling required

Worse case scenario Star graph with root in the middle

Spanning trees CC can be extended to finding – the spanning of a graph tree – minimum spanning tree of a weighted graph

Minimum spanning tree All weights are distinct – There exists a unique minimum spanning tree Based on random mate CC technique – Instead of randomly picking a parent, pick edge with minimum weight and hook to vertex if it is a parent – Keep track of the edges used for hooking

Example

What’s next? BSP model – SSSP, connected components, pagerank Vertex centric vs. subgraph centric Load balancing – Importance of partitioning and graph type...