Locality Sensitive Distributed Computing Exercise Set 2 David Peleg Weizmann Institute.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Locality Sensitive Distributed Computing David Peleg Weizmann Institute.
Chapter 4 Downcasts and Upcasts. 4.1 Downcasts At first we assume the case where the root has m distinct items A = {  1, …,  m }, each destined to one.
Greedy Algorithms Greed is good. (Some of the time)
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Graph Searching (Graph Traversal) Algorithm Design and Analysis Week 8 Bibliography: [CLRS] – chap 22.2 –
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
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.
Minimum Spanning Trees
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
1 Complexity of Network Synchronization Raeda Naamnieh.
Graph & BFS.
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Graph & BFS Lecture 22 COMP171 Fall Graph & BFS / Slide 2 Graphs * Extremely useful tool in modeling problems * Consist of: n Vertices n Edges D.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
A Distributed Algorithm for Minimum-Weight Spanning Trees by R. G. Gallager, P.A. Humblet, and P. M. Spira ACM, Transactions on Programming Language and.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Tirgul 7 Review of graphs Graph algorithms: – BFS (next tirgul) – DFS – Properties of DFS – Topological sort.
Raeda Naamnieh 1. The Partition Algorithm Intuitively, the idea of the following algorithm is to choose each cluster as a maximal subset of nodes whose.
Lecture 13 CSE 331 Oct 2, Announcements Mid term in < 2 weeks Graded HW2 at the END of the class.
Constant Factor Approximation of Vertex Cuts in Planar Graphs Eyal Amir, Robert Krauthgamer, Satish Rao Presented by Elif Kolotoglu.
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Broadcast & Convergecast Downcast & Upcast
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
COSC 2007 Data Structures II Chapter 14 Graphs III.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
© 2015 JW Ryder CSCI 203 Data Structures1. © 2015 JW Ryder CSCI 203 Data Structures2.
Graphs. What is a graph? A data structure that consists of a set of nodes (vertices) and a set of edges that relate the nodes to each other The set of.
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.
All-Pairs Shortest Paths & Essential Subgraph 01/25/2005 Jinil Han.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
1 Subgraphs A subgraph S of a graph G is a graph such that The vertices of S are a subset of the vertices of G The edges of S are a subset of the edges.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 20.
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 2: Basic Graph Algorithms 1.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Graphs Slide credits:  K. Wayne, Princeton U.  C. E. Leiserson and E. Demaine, MIT  K. Birman, Cornell U.
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Spanning Tree Definition:A tree T is a spanning tree of a graph G if T is a subgraph of G that contains all of the vertices of G. A graph may have more.
Introduction Wireless Ad-Hoc Network  Set of transceivers communicating by radio.
Chapter 11. Chapter Summary Introduction to Trees Applications of Trees (not currently included in overheads) Tree Traversal Spanning Trees Minimum Spanning.
Distributed Algorithms for Network Diameter David Peleg, Liam Roditty and Elad Tal.
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.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Khaled M. Alzoubi, Peng-Jun Wan, Ophir Frieder
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Graph Algorithms Using Depth First Search
CSE 421: Introduction to Algorithms
Tree Construction (BFS, DFS, MST) Chapter 5
Graphs Chapter 11 Objectives Upon completion you will be able to:
CSE 373 Data Structures and Algorithms
Introduction Wireless Ad-Hoc Network
Graphs Part 2 Adjacency Matrix
CSE 373: Data Structures and Algorithms
Elementary Graph Algorithms
CSC 325: Algorithms Graph Algorithms David Luebke /24/2019.
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 .
Presentation transcript:

Locality Sensitive Distributed Computing Exercise Set 2 David Peleg Weizmann Institute

Basic partition construction algorithm Simple distributed implementation for Algorithm BasicPart Single “thread” of computation (single locus of activity at any given moment)

Basic partition construction algorithm Components ClusterCons : Procedure for constructing a cluster around a chosen center v NextCtr : Procedure for selecting the next center v around which to grow a cluster RepEdge : Procedure for selecting a representative inter- cluster edge between any two adjacent clusters

Cluster construction procedure ClusterCons Goal: Invoked at center v, construct cluster and BFS tree (rooted at v) spanning it Tool: Variant of Dijkstra's algorithm.

Recall: Dijkstra’s BFS algorithm phase p+1:

Main changes to Algorithm DistDijk 1. Ignoring covered vertices: Global BFS algorithm sends exploration msgs to all neighbors save those known to be in tree New variant ignores also vertices known to belong to previously constructed clusters 2. Bounding depth: BFS tree grown to limited depth, adding new layers tentatively, based on halting condition (|  (S)| < |S|·n 1/k )

Distributed Implementation Before deciding to expand tree T by adding newly discovered layer L: Count # vertices in L by convergecast process: Leaf w  T: set Z w = # new children in L Internal vertex: add and upcast counts.

Distributed Implementation Root: compare final count Z v to total # vertices in T (known from previous phase). -If ratio ≥ n 1/k, then broadcast next Pulse msg (confirm new layer and start next phase) -Otherwise, broadcast message Reject (reject new layer, complete current cluster) Final broadcast step has 2 more goals: -mark cluster by unique name (e.g., ID of root), -inform all vertices of new cluster name

Distributed Implementation (cont) This information is used to define cluster borders. I.e., once cluster is complete, each vertex in it informs all neighbors of its new residence.  nodes of cluster under construction know which neighbors already belong to existing clusters.

Center selection procedure NextCtr Fact: Algorithm's “center of activity” always located at currently constructed cluster C. Idea: Select as center for next cluster some vertex v adjacent to C (= v from rejected layer) Implementation: Via convergecast process. (leaf: pick arbitrary neighbor from rejected layer, upcast to parent internal node: upcast arbitrary candidate)

Center selection procedure (NextCtr) Problem: What if rejected layer is empty? (It might still be that the entire process is not yet complete: there may be some yet unclustered nodes elsewhere in G)  r0r0 ??

Center selection procedure (NextCtr) Solution: Traverse the graph (using cluster construction procedure within a global search procedure)  r0r0

Distributed Implementation Use DFS algorithm for traversing the tree of constructed cluster. Start at originator vertex r 0, invoke ClusterCons to construct the first cluster. Whenever the rejected layer is nonempty, choose one rejected vertex as next cluster center Each cluster center marks a parent cluster in the cluster DFS tree, namely, the cluster from which it was selected

Distributed Implementation (cont) DFS algorithm (cont): Once the search cannot progress forward (rejected layer is empty) : the DFS backtracks to previous cluster and looks for new center among neighboring nodes If no neighbors are available, the DFS process continues backtracking on the cluster DFS tree

Inter-cluster edge selection RepEdge Goal: Select one representative inter-cluster edge between every two adjacent clusters C and C' r0r0 E(C,C') = edges connecting C and C' (known to endpoints in C, as C vertices know the cluster- residence of each neighbor)

Inter-cluster edge selection RepEdge  Representative edge can be selected by convergecast process on all edges of E(C,C'). Requirement: C and C' must select same edge Solution: Using unique ordering of edges - pick minimum E(C,C') edge. Q: Define unique edge order by unique ID's?

Inter-cluster edge selection (RepEdge) E.g., Define ID-weight of edge e=(v,w), where ID(v) < ID(w), as pair h ID(v),ID(w) i, and order ID-weights lexicographically; This ensures distinct weights and allows consistent selection of inter-cluster edges

Inter-cluster edge selection (RepEdge) Problem: Cluster C must carry selection process for every adjacent cluster C' individually Solution: Inform each C vertex of identities of all clusters adjacent to C by convergecast + broadcast Pipeline individual selection processes

Analysis (C 1,C 2,...,C p ) = clusters constructed by algorithm For cluster C i : E i = edges with at least one endpoint in C i n i = |C i |, m i = |E i |, r i =Rad(C i )

Analysis (cont) ClusterCons: Depth-bounded Dijkstra procedure constructs C i and BFS tree in: O(r i 2 ) time and O(n i r i + m i ) messages Q: Prove O(n) bound  Time(ClusterCons) = ∑ i O(r i 2 ) ≤ ∑ i O(r i k) ≤ k ∑ i O(n i ) = O(kn)

Analysis (cont) C i and BFS tree cost: O(r i 2 ) time and O(n i r i + m i ) messages  Comm(ClusterCons) = ∑ i O(n i r i + m i ) Each edge occurs in ≤ 2 distinct sets E i, hence Comm(ClusterCons) = O(nk + |E|)

Analysis (NextCtr) DFS process on the cluster tree is more expensive than plain DFS: visiting cluster C i and deciding the next step requires O(r i ) time and O(n i ) comm. DFS step Deciding next step

Analysis (NextCtr) DFS visits clusters in cluster tree O(p) times Entire DFS process (not counting Procedure ClusterCons invocations) requires: Time(NextCtr) = O(pk) = O(nk) Comm(NextCtr) = O(pn) = O(n 2 )

Analysis (RepEdge) s i = # neighboring clusters surrounding C i Convergecasting ID of neighboring cluster C' in C i costs O(r i ) time and O(n i ) messages For all s i neighboring clusters: O(s i +r i ) time (pipelining) O(s i n i ) messages

Analysis (RepEdge) Pipelined inter-cluster edge selection – similar. As s i ≤ n, we get Time(RepEdge) = max i O(s i + r i ) = O(n) Comm(RepEdge) = ∑ i O(s i n i ) = O(n 2 )

Analysis Thm: Distributed Algorithm BasicPart requires Time = O(nk) Comm = O(n 2 )

Sparse spanners Example - m-dimensional hypercube: H m =(V m,E m ), V m ={0,1} m, E m = {(x,y) | x and y differ in exactly one bit} |V m |=2 m, |E m |=m 2 m-1, diameter m Ex: Prove that for every m ≥ 0, the m-cube has a 3-spanner with # edges ≤ 7·2 m

Regional Matchings Locality sensitive tool for distributed match-making

Distributed match making Paradigm for establishing client-server connection in a distributed system (via specified rendezvous locations in the network) Ads of server v: written in locations Write(v) v client u: reads ads in locations Read(u) u

Regional Matchings Requirement: “read” and “write” sets must intersect: for every v,u  V, Write(v) Å Read(u) ≠  v u Write(v) Read(u) Client u must find an ad of server v

Regional Matchings (cont) Distance considerations taken into account: Client u must find an ad of server v only if they are sufficiently close -regional matching: “read” and “write” sets  = { Read(v), Write(v) | v  V } s.t. for every v,u  V, dist(u,v) ≤  Write(v) Å Read(u) ≠ 

Regional Matchings (cont) Degree parameters:  write (  ) = max v  V |Write(v)|  read (  ) = max v  V |Read(v)|

Regional Matchings (cont) Radius parameters: Str write (  ) = max u,v  V { dist(u,v) | u  Write(v) } / Str read (  ) = max u,v  V { dist(u,v) | u  Read(v)} /

Regional matching construction [Given graph G, k, ≥ 1, construct regional matching ,k ] 1.Set    s (V) ( -neighborhood cover)

Regional matching construction 2.Build coarsening cover  as in Max-Deg-Cover Thm

Regional matching construction 3.Select a center vertex r 0 (T) in each cluster T  

Regional matching construction 4.Select for every v a cluster T v   s.t.  (v)  T v v  (v) T v =T 1

Regional matching construction 5.Set Read(v) = {r 0 (T) | v  T} Write(v) = {r 0 (T v )} v  (v) T1T1 Read(v) = {r 1,r 2,r 3 } Write(v) = {r 1 } r1r1 T2T2 T3T3 r2r2 r3r3

Analysis Claim: Resulting ,k is an -regional matching. Proof: Consider u,v such that dist(u,v) ≤ Let T v be cluster s.t. Write(v) = {r 0 (T v )}

Analysis (cont) By definition, u   (v). Also  (v)  T v  u  T v  r 0 (T v )  Read(u)  Read(u) Å Write(v) ≠ 

Analysis (cont) Thm: For every graph G(V,E, w ),,k≥1, there is an -regional matching ,k with  read ( ,k ) ≤ 2k n 1/k  write ( ,k ) = 1 Str read ( ,k ) ≤ 2k+1 Str write ( ,k ) ≤ 2k+1

Analysis (cont) Taking k=log n we get Corollary: For every graph G(V,E, w ), ≥1, there is an -regional matching  with  read (  ) = O(log n)  write (  ) = 1 Str read (  ) = O(log n) Str write (  ) = O(log n)