Computing Connected Components on Parallel Computers

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science for Some.
Advertisements

Epp, section 10.? CS 202 Aaron Bloomfield
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Bayesian Networks, Winter Yoav Haimovitch & Ariel Raviv 1.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Representing Relations Using Matrices
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Discussion #36 Spanning Trees
DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
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.
GRAPH Learning Outcomes Students should be able to:
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
Approximating the Minimum Degree Spanning Tree to within One from the Optimal Degree R 陳建霖 R 宋彥朋 B 楊鈞羽 R 郭慶徵 R
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.
5.2 Trees  A tree is a connected graph without any cycles.
Data Structures & Algorithms Graphs
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 & Algorithms Graphs Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
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.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
SPARSE CERTIFICATES AND SCAN-FIRST SEARCH FOR K-VERTEX CONNECTIVITY
Great Theoretical Ideas in Computer Science for Some.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
1 Closures of Relations Based on Aaron Bloomfield Modified by Longin Jan Latecki Rosen, Section 8.4.
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.
CSC317 1 At the same time: Breadth-first search tree: If node v is discovered after u then edge uv is added to the tree. We say that u is a predecessor.
Trees.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
The NP class. NP-completeness
All-pairs Shortest paths Transitive Closure
Aaron Bloomfield CS 202 Rosen, section 7.4
Main algorithm with recursion: We’ll have a function DFS that initializes, and then calls DFS-Visit, which is a recursive function and does the depth first.
CONNECTED-COMPONENTS ALGORITHMS FOR MESH-CONNECTED PARALLEL COMPUTERS
Introduction to Algorithms
Csc 2720 Instructor: Zhuojun Duan
Eulerian tours Miles Jones MTThF 8:30-9:50am CSE 4140 August 15, 2016.
Lecture 12 Algorithm Analysis
Introduction to Graphs
Parallel Graph Algorithms
Chapter 5. Optimal Matchings
CS 3343: Analysis of Algorithms
Graph Operations And Representation
Planarity Testing.
CSE 421: Introduction to Algorithms
ICS 353: Design and Analysis of Algorithms
Tree Construction (BFS, DFS, MST) Chapter 5
Lectures on Graph Algorithms: searching, testing and sorting
Basic Graph Algorithms
Graph Operations And Representation
Lecture 12 Algorithm Analysis
Depth-First Search Graph Traversals Depth-First Search DFS.
Richard Anderson Autumn 2016 Lecture 5
CS 584 Project Write up Poster session for final Due on day of final
Text Book: Introduction to algorithms By C L R S
Discrete Mathematics for Computer Science
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Lecture 12 Algorithm Analysis
Parallel Graph Algorithms
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Elementary Graph Algorithms
Closures of Relations Epp, section 10.1,10.2 CS 202.
Constructing a m-connected k-Dominating Set in Unit Disc Graphs
Locality In Distributed Graph Algorithms
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Minimum Spanning Trees
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

Computing Connected Components on Parallel Computers D.S. Hirschberg and A.K. Chandra Presented BY Baha’ Alsaify

Contributions This paper presents a way to compute the connected components in an undirected graph using n2 processors and with O(log2n) time complexity. This paper also shows that the same time complexity can be achieved if Processors are used. It also shows that the algorithm can be modified to compute a graph transitive closure with the same number of processors and with the same time complexity.

Definitions, Terminology and Assumptions Connected Component: is a maximal subgraph of G (where G = (V,E)) such that there exist a path between every pair of vertices in the subgraph. A vertex belongs to exactly one connected component. Vector D: this is the identity vector. D(i) holds the identity of the connected component that i belongs to.

Definitions, Terminology and Assumptions (cont.) D(i) is defined as the follows: if Gc=(Vc,Ec) is any connected component, then for all i Vc, D(i) equals the least element of Vc. Adjacency Matrix (A): is a nxn symmetric Boolean matrix where A(i,j) = 1 if (i,j) E. K-tree-Loop: is a directed graph in which each vertex has an out degree one (only one edge leaves each vertex), and in which there is exactly one cycle, and the length of that cycle is equal to k+1.

Example of a 2-tree-loop The above graph shows a k-tree-loop with k = 2 Deleting any edge of the cycle will create a rooted tree with the root being the node with no edges leaving it. A k-tree-loop has k+1 edges in the cycle and at least k+1 elements Root

Definitions, Terminology and Assumptions (cont.) C(i): defines the 1-tree-loop node i is part of. Clubs: a 0-tree-loop in which all the edges enter the root. In the CONNECT algorithm, the root of the tree will be the node with the minimum value (i.e. the connected component will be identified by the node with the minimal value in that connected component)

CONNECT Algorithm

Example 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) D(i)

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) D(i)

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) D(i) 1 2 3 4 5 6

Example (Cont.) 3 2 1 5 7 6 Step 1 will be executed once. All of the other steps will be executed for log(n) times 4 8 1 2 3 4 5 6 7 8 C(i) D(i) 1 2 3 4 5 6 7 8

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) D(i) 1 2 3 4 5 6

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 2 1 5 4 7 D(i) 3

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 2 1 5 4 7 D(i) 3

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 2 1 5 4 7 D(i) 3

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 2 1 5 4 7 D(i) 3

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 2 1 5 4 7 D(i)

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 2 1 5 4 7 D(i)

Example (Cont.) 3 2 1 5 7 6 4 First Iteration 8 1 2 3 4 5 6 7 8 C(i) 1 D(i) 7

Example (Cont.) 3 2 1 5 7 6 4 Second Iteration 8 1 2 3 4 5 6 7 8 C(i)

Example (Cont.) 3 2 1 5 7 6 4 Third Iteration 8 1 2 3 4 5 6 7 8 C(i) 1

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 1 2 4 5 D(i) 7

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 1 2 4 5 D(i)

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 1 2 4 5 D(i)

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 1 4 D(i)

Example (Cont.) 3 2 1 5 7 6 4 8 1 2 3 4 5 6 7 8 C(i) 1 4 D(i)

Example (Cont.) No matter how many iterations will follow, no change will happen on the graph since we have already defined the connected components in the graph.

Algorithm Explanation – First Iteration During steps (2 & 3), the edges connecting each vertices are examined. During steps (4 – 6), the set of the vertices that are known to be connected are identified. After the end of each iteration, each set of vertices that are known to be connected are merged together into one Supervertices.

Algorithm Explanation – Next iteration During steps (2&3), the connected supervertices are identified and during steps (4-6), these supervertices are merged together. The process continue until all the vertices in a connected component are joined together into one gigantic supervertices.

Theorems and Lemmas

LEMMA 1

LEMMA 1 - Explanation LEMMA 1 shows that C function will generate a set of 1-tree-loops. The paper proofs this LEMMA by a contradiction. To have a k-tree-loop, the paper defines a function C(Vi) = Vi+1 & C(Vk) = C(V0). V0 and V2 are neighbors for V1. C(V1) = V2, that contradict the definition of C in the LEMMA, and the only way for that to be true if we have a 1-tree-loops. So C defines a set of 1-tree-loops.

LEMMA 2

LEMMA 2 - Explanation To understand this LEMMA, we need to keep in mind that the output of the function C is a 1-tree-loop. CN(V) = C(CN-1(V)) & C1(V) = C(V).

Theorem 1

Theorem 1 - Proof If the graph is composed of a set of a disjoint vertices, then step 1 will define the connected components in that graph. After step 1, G(D) (a directed graph defined by D) satisfies the following: G(D) is a set of clubs. The root of each club is the smallest-numbered vertex in the club. The vertex set of any club is a subset of some connected component.

Theorem 1 – Proof (Cont.) After the execution of steps (2-6), G(D) will still satisfies properties (1&3). (That because C will only be working on vertices that have an edge between them (steps 2&3), and D will be computed based on C (steps 4&6)). In the next iterations the same thing will be done except that the algorithm will now deal with supervertices, where each vertex in the supervertex has the same value of D.

Theorem 1 – Proof (Cont.) The algorithm shows that each iteration decreases the number of supervertices by 2. That shows that the number of iteration required to identify the connected component will be equal to log(n).

Time and Processor Bounds The main loop of the algorithm is executed in log(n) times, while the inner steps are also executed in log(n) times, so the final time bound of the algorithm is log2(n). The paper supposed that we are using n2 processors. Steps (1, 4 and 6) requires O(1) time bound. Step 5 requires log(n) time bound. Step(2&3) can also be programmed to run using O(log(n)) steps.

Time and Processor Bounds (Cont.)* Since we have n2 processors, steps 2(a) & 2(c) can be done in O(1) time, and step 2(b) can be executed in O(log(n)) time. That means that step 2 can be executed in O(log(n)) time complexity.

Reducing the number of processors Preparata and Probert found through extensive observations that the same time complexity can be achieved using processors. The main step behind achieving this is dividing the vertices into groups, where each group has log(n) elements. The idea behind the new algorithm is to compute the array Temp in O(log(n)) time. The algorithm works by first computing the smallest value of j in each one of the groups (requires O(log(n)) via sequential search). Then the smallest j in all the groups is computed. The time complexity for the previous operations is O(log(n) – log(log(n))).

Preparata and Probert Algorithm