CONNECTED-COMPONENTS ALGORITHMS FOR MESH-CONNECTED PARALLEL COMPUTERS

Slides:



Advertisements
Similar presentations
Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
Advertisements

Graph Algorithms Carl Tropper Department of Computer Science McGill University.
Bayesian Networks, Winter Yoav Haimovitch & Ariel Raviv 1.
Lecture 3: Parallel Algorithm Design
Greedy Algorithms Greed is good. (Some of the time)
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Lectures on Network Flows
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Discussion #36 Spanning Trees
1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.
Graphs and Trees This handout: Trees Minimum Spanning Tree Problem.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
1 Parallel Algorithms III Topics: graph and sort algorithms.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
External Memory Algorithms Kamesh Munagala. External Memory Model Aggrawal and Vitter, 1988.
Minimum Spanning Trees
Chapter 9: Graphs Spanning Trees Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Randomized Algorithms - Treaps
Design and Analysis of Computer Algorithm September 10, Design and Analysis of Computer Algorithm Lecture 5-2 Pradondet Nilagupta Department of Computer.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Primal-Dual Meets Local Search: Approximating MST’s with Non-uniform Degree Bounds Author: Jochen Könemann R. Ravi From CMU CS 3150 Presentation by Dan.
A Shortest Path Algorithm. Motivation Given a connected, positive weighted graph Find the length of a shortest path from vertex a to vertex z.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
CS 3343: Analysis of Algorithms Lecture 21: Introduction to Graphs.
Distributed Coloring Discrete Mathematics and Algorithms Seminar Melih Onus November
Graph Dr. Bernard Chen Ph.D. University of Central Arkansas.
Fundamental Data Structures and Algorithms (Spring ’05) Recitation Notes: Graphs Slides prepared by Uri Dekel, Based on recitation.
Lectures on Greedy Algorithms and Dynamic Programming
Introduction to Graphs And Breadth First Search. Graphs: what are they? Representations of pairwise relationships Collections of objects under some specified.
Data Structures and Algorithms in Parallel Computing Lecture 3.
Minimum Spanning Trees CSE 373 Data Structures Lecture 21.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
SPARSE CERTIFICATES AND SCAN-FIRST SEARCH FOR K-VERTEX CONNECTIVITY
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
Algorithm Design and Analysis June 11, Algorithm Design and Analysis Pradondet Nilagupta Department of Computer Engineering This lecture note.
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
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 – Part III CS 367 – Introduction to Data Structures.
Trees.
Data Structures and Algorithm Analysis Lecture 5
Lecture 3: Parallel Algorithm Design
Lecture 11 Graph Algorithms
Computing Connected Components on Parallel Computers
CSC317 Graph algorithms Why bother?
Lectures on Network Flows
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
CS 3343: Analysis of Algorithms
Parallel Graph Algorithms
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
CS 3343: Analysis of Algorithms
Graph Algorithms Using Depth First Search
Enumerating Distances Using Spanners of Bounded Degree
Elementary graph algorithms Chapter 22
Carlos Ordonez, Predrag T. Tosic
Lectures on Graph Algorithms: searching, testing and sorting
Basic Graph Algorithms
Outline This topic covers Prim’s algorithm:
CSE 373 Data Structures and Algorithms
Elementary graph algorithms Chapter 22
Important Problem Types and Fundamental Data Structures
Parallel Graph Algorithms
Lecture 10 Graph Algorithms
Directed Graphs (Part II)
Chapter 9: Graphs Spanning Trees
Presentation transcript:

CONNECTED-COMPONENTS ALGORITHMS FOR MESH-CONNECTED PARALLEL COMPUTERS S. Kumar, S. M. Goddard and J. F. Prins Presenter: Ze Li CSCE 5013 Parallel Algorithms University of Arkansas

Outline Reviews Introductions Main Algorithms for connected components Mesh- based Algorithm for connected components Evaluations Conclusions

Reviews Connected component: A maximum connected sub-graph of G. Pram: Common MEM Pointer Jumping: Tree Hanging.

Conceptual Idea 21 22 4 11 45 16 24 8 12 14 6 19 10 7 2 28 1 15 13 35 Every node locally make decision to choose a smaller node and converge to

Conceptual Idea 21 22 4 11 45 16 24 8 12 14 6 19 10 7 2 28 1 15 13 35

Conceptual Idea 21 22 4 11 45 16 24 8 12 14 6 19 10 7 2 28 1 15 13 35 Local jump linking

Conceptual Idea 21 22 4 11 45 16 24 8 12 14 6 19 10 7 2 28 1 15 13 35 Local jump linking

Conceptual Idea 2 4 1 6 Local jump linking

Conceptual Idea 2 1 4 6 Every node locally make decision to choose a smaller node and converge to

Conceptual Idea 1 4

Conceptual Idea

Common Characters PRAM Similar ideas Point Jumping (shortcutting) Tree Hanging (tree hooking) Different Implementations algorithms: Wes: (1)shortcutting and two kind of hooking (work O(mlogn)) (2) shortcutting and one hooking ((work O(mlogn)) (3) random mateCluster ((work O(mlogn)) Baha: Circle tree. Time O((log2n)2) n2 or n2/logn processors Jeremy: Use flag to reduce the node involved in iteration O((log2n)2) n2/logn

Introduction and Motivation PRAM: Simplified structure, the assumption of the operation cost is unrealistic Arbitrary reading memory= Arbitrary routing in the networks. Possible collisions Advantages: Provide several algorithms that can be modified and applied to other topologies.

Mesh-based Connected Component Computing Start with a Pram based algorithm Modify it for the mesh to minimize the communication time For dense graph, used Modified algorithm based on the adjacency matrix representation. Time complexity O(log2n) Work load O(n2logn) For sparse graph, only distributed the edges present in the matrix across processors. Work load O(mlogn)

Main Algorithem A graph G(V,E). V is the vertices sets. E is edge the sets Start from Parent function P: V->V, such that P(v)=v for all v in V. P is modified until P(v) =P(w) iff v and w belong to the same component. In each step, a vertex is connected to the parent of its lowest numbered neighbor. A vertex is its own neighbor

Main Algorithm 4 3 7 1 6 5 2 9 8 First iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ P(i):=r=min{ P{j}|OldP(j)=i } /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) P(i):=P(min{P(j)|node j is adjacent to node i in G}) 6 7 5 2 4 3 9 oldP(i) Physical link P(i) Check if its physically closed node pointing to a smaller node. If Yes, point to that

Main Algorithm 4 3 7 1 6 5 2 9 8 First iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ P(i):=r=min{ P{j}|OldP(j)=i } /*Tree hanging */ Until P stops changing. P(i):= i; 5 8 6 2 4 3 7 1 9 OldP(i):=P(i) P(i):=P(min{P(j)|node j is adjacent to node i in G}) oldP(i) Physical link P(i)

Main Algorithm 4 3 7 1 6 5 2 9 8 First iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) P(i):=P(min{P(j)|node j is adjacent to node i in G}) 6 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i) The root node check if there are any leaves currently pointing to a smaller node

Main Algorithm 4 3 7 1 6 5 2 9 8 second iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i)

Main Algorithm 4 3 7 1 6 5 2 9 8 second iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i)

Main Algorithm 4 3 7 1 6 5 2 9 8 second iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i) Check if its physically closed node pointing to a smaller node. If Yes, point to that

Algorithm Examples 4 3 7 1 6 5 2 9 8 second iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i)

Algorithm Examples 4 3 7 1 6 5 2 9 8 second iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i) The root node check if there are any leaves currently pointing to a smaller node

Algorithm Examples 4 3 7 1 6 5 2 9 8 second iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i)

Algorithm Examples 4 3 7 1 6 5 2 9 8 Third iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i)

Algorithm Examples 4 3 7 1 6 5 2 9 8 Third iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i) Check if its physically closed node pointing to a smaller node. If Yes, point to that

Algorithm Examples 4 3 7 1 6 5 2 9 8 Third iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ Until P stops changing. P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 3 9 oldP(i) Physical link P(i)

OVER!!!! Algorithm Examples 4 3 7 1 6 5 2 9 8 Third iteration FOREACH node i IN G REPEAT /* One Pointer jumping step*/ /*Tree hanging */ P(i):= i; 1 8 OldP(i):=P(i) 6 P(i):=P(min{P(j)|node j is adjacent to node i in G}) 7 5 P(i):=r=min{ P{j}|OldP(j)=i } 2 4 P stops changing 3 OVER!!!! 9 oldP(i) Physical link P(i) The root node check if there are any leaves currently pointing to a smaller node

Correctness Claim 1: If P(i)=P(j), i and j belong to the same connected component. Proof: (by induction) Starts: P(i)=i. i and P(i) in same component. Assume: The claim is true after k iterations Derivation: At the k+1 iteration. P(i) is changed to P(r). Since r is adjacent to i, r is in the same component as P(r), therefore P(i), P(r) in the same component

Correctness Claim 2: If i and j belong to the same connected component. P(i)=P(j). Proof: (by contradiction). Suppose, i and j in the same component and P(i)!=P(j). Since there is a path from i to j. There must exist two consecutive nodes m and n on the path such that the edge (m,n) in the G, and P(m)!=P(n). Since (m,n) are neighbor node, the algorithm can not terminate.

Compexity Define a chain as follows: i and P(i) lie on a chain. Succ(i) =P(i) and Pred (P(i))=i. If P(i) and j lie on the chain C, so does i. The edges on this chain are directed and are called P-edges.

Theorem The algorithm makes no more than O(logn) iterations Proof If no node in the chain change its chance. Logn If node I change the chain to the k chain. In the k chain , it still take logn times to reach the root. Therefore O(logn) j i k

Implementation on a Mesh They define the following matrix M for a graph G with n vertices. The size of M is n*n 5 8 6 2 4 3 7 1 9 M(u,v)= (u,v) is an edge in G? min(u,v)|∞; n/n 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 1. Find the minimum P values of all neighbors 5 8 6 2 4 3 7 1 9 Suppose each vertex is maintained by the row n/n 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 1. Find the minimum P values of all neighbors FOREACH j IN [1..n] LET r=min {M(i,j) | i IN [1..n] } 1 8 j/i 1 2 3 4 5 6 7 8 9 6 7 5 2 4 3 9

The Basic Operation of the Algorithm 2. Do a Pointer jumping step. M(M(j, j), j) := M(r, j) 1 8 j/i 1 2 3 4 5 6 7 8 9 6 7 5 2 4 3 9

The Basic Operation of the Algorithm 3. Do Tree hanging M(j, j) := M(r, j) 1 8 j/i 1 2 3 4 5 6 7 8 9 6 7 5 2 4 3 9

The Basic Operation of the Algorithm 4. Spread the new names for each vertex in its row FOREACH i in [i..n] LET r=min{M(i,j) | j IN [1..n]} IN FOREACH j IN [1..n] M(i,j) :=r. 1 8 j/i 1 2 3 4 5 6 7 8 9 j/i 1 2 3 4 5 6 7 8 9 6 7 5 2 4 3 9

The Basic Operation of the Algorithm 1. Find the minimum P values of all neighbors FOREACH j IN [1..n] LET r=min {M(i,j) | i IN [1..n] } 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 2. Do a Pointer jumping step. M(M(j, j), j) := M(r, j) 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 3. Do Tree hanging M(j, j) := M(r, j) 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 4. Spread the new names for each vertex in its row FOREACH i in [i..n] LET r=min{M(i,j) | j IN [1..n]} IN FOREACH j IN [1..n] M(i,j) :=r. 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 1. Find the minimum P values of all neighbors FOREACH j IN [1..n] LET r=min {M(i,j) | i IN [1..n] } 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 2. Do a Pointer jumping step. M(M(j, j), j) := M(r, j) 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 3. Do Tree hanging M(j, j) := M(r, j) 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9

The Basic Operation of the Algorithm 4. Spread the new names for each vertex in its row FOREACH i in [i..n] LET r=min{M(i,j) | j IN [1..n]} IN FOREACH j IN [1..n] M(i,j) :=r. 5 8 6 2 4 3 7 1 9 j/i 1 2 3 4 5 6 7 8 9 stop

Two Representations Matrix Representation: M(i,j) is mapped to PE(i mod p, j mod p) Working complexity: n2logn. Each PE does O(n/p) work per iteration. There are O(n/p) elements per PE. The min operations take O(n/p+logp) steps Adjacency List Representation. Distributed edges to the PE Work complexity O(n2logn). Consider load balance O(n)

Adjacency List Representation

Improvements Load balancing: Distributed load evenly to achieve a complexity as O(mlogn). A fast graph pre-conditioner that will determine load balance and sparsity of the graph before it is distributed. Creating a new edge in underloaded PE. for each edge (u, v) in G, there exists either (u1, v) in G1 or (u2, v) in G2. In addition the edge (u1, u2) is created. Type of Graph: Identify the best possible algorithm for a given classes of graphs and given a graph.

Questions ?