Broadcast: Befo re 1

Similar documents
GIAN Course on Distributed Network Algorithms. Spanning Tree Constructions

GIAN Course on Distributed Network Algorithms. Spanning Tree Constructions

A synchronizer generates sequences of clock pulses at each node of the network satisfying the condition given by the following definition.

Distributed Algorithms 6.046J, Spring, Nancy Lynch

Distributed Algorithms 6.046J, Spring, 2015 Part 2. Nancy Lynch

Algorithm Design and Analysis

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Lecture 3: Graphs and flows

6.852 Lecture 10. Minimum spanning tree. Reading: Chapter 15.5, Gallager-Humblet-Spira paper. Gallager-Humblet-Spira algorithm

Assignment # 4 Selected Solutions

Algorithm Design and Analysis

21. Distributed Algorithms

THE FIRST APPROXIMATED DISTRIBUTED ALGORITHM FOR THE MINIMUM DEGREE SPANNING TREE PROBLEM ON GENERAL GRAPHS. and

CS781 Lecture 2 January 13, Graph Traversals, Search, and Ordering

COL351: Analysis and Design of Algorithms (CSE, IITD, Semester-I ) Name: Entry number:

Lecture 10 Graph algorithms: testing graph properties

GraphTheory Models & Complexity BFS Trees DFS Trees Min Spanning Trees. Tree Constructions. Martin Biely

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions.

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

Verteilte Systeme/Distributed Systems Ch. 5: Various distributed algorithms

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Copyright 2000, Kevin Wayne 1

CSE 331: Introduction to Algorithm Analysis and Design Graphs

T Seminar on Theoretical Computer Science Spring 2007 Distributed Computation. Constructing a spanning tree Toni Kylmälä

Graph Algorithms Using Depth First Search

Info 2950, Lecture 16

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

A family of optimal termination detection algorithms

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

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

12/5/17. trees. CS 220: Discrete Structures and their Applications. Trees Chapter 11 in zybooks. rooted trees. rooted trees

Clearly there is a close relation between the radius R and the diameter D of a graph, such as R D 2R.

Master Thesis: Animations and Analysis of Distributed Algorithms. Boris Koldehofe

CSE 417: Algorithms and Computational Complexity. 3.1 Basic Definitions and Applications. Goals. Chapter 3. Winter 2012 Graphs and Graph Algorithms

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:

Λέων-Χαράλαμπος Σταματάρης

Parallel Breadth First Search

Matching Theory. Figure 1: Is this graph bipartite?

3.1 Basic Definitions and Applications. Chapter 3. Graphs. Undirected Graphs. Some Graph Applications

Elementary Graph Algorithms. Ref: Chapter 22 of the text by Cormen et al. Representing a graph:

Trees. Arash Rafiey. 20 October, 2015

Dijkstra s algorithm for shortest paths when no edges have negative weight.

CS261: Problem Set #1

Lower Bound on Comparison-based Sorting

Goals! CSE 417: Algorithms and Computational Complexity!

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

Distributed Computing over Communication Networks: Leader Election

implementing the breadth-first search algorithm implementing the depth-first search algorithm

W4231: Analysis of Algorithms

Leader Election in Rings

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Depth-First Search Depth-first search (DFS) is another way to traverse the graph.

Notes for Recitation 8

Introduction to Graphs. CS2110, Spring 2011 Cornell University

Lecture 8: PATHS, CYCLES AND CONNECTEDNESS

CS 512: Comments on Graph Search 16:198:512 Instructor: Wes Cowan

Tree Construction (BFS, DFS, MST) Chapter 5. Breadth-First Spanning Tree (BFS)

Jana Kosecka. Red-Black Trees Graph Algorithms. Many slides here are based on E. Demaine, D. Luebke slides

Reference Sheet for CO142.2 Discrete Mathematics II

Graphs. Part I: Basic algorithms. Laura Toma Algorithms (csci2200), Bowdoin College

MITOCW watch?v=w_-sx4vr53m

MAL 376: Graph Algorithms I Semester Lecture 1: July 24

Distributed Systems. Basic Algorithms. Rik Sarkar. University of Edinburgh 2015/2016

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.

Distributed Systems. Basic Algorithms. Rik Sarkar. University of Edinburgh 2016/2017

1 i n (p i + r n i ) (Note that by allowing i to be n, we handle the case where the rod is not cut at all.)

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

Exercises: Disjoint Sets/ Union-find [updated Feb. 3]

Strongly connected: A directed graph is strongly connected if every pair of vertices are reachable from each other.

Solutions to relevant spring 2000 exam problems

Graph Algorithms. Andreas Klappenecker. [based on slides by Prof. Welch]

CSc Leader Election

Solutions. (a) Claim: A d-ary tree of height h has at most 1 + d +...

Copyright 2000, Kevin Wayne 1

Distributed minimum spanning tree problem

3.1 Basic Definitions and Applications

Algorithms for COOPERATIVE DS: Leader Election in the MPS model

Theory of Computing. Lecture 4/5 MAS 714 Hartmut Klauck

1 Minimum Cut Problem

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

Minimum Spanning Trees

Problem Set 2 Solutions

A distributed algorithm for minimum weight spanning trees

Chapter 3 Trees. Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.

Exercise 1 : B-Trees [ =17pts]

CS521 \ Notes for the Final Exam

CSI 604 Elementary Graph Algorithms

INDIAN STATISTICAL INSTITUTE

Algorithms: Lecture 10. Chalmers University of Technology

Chapter 3. Graphs. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Algorithm 23 works. Instead of a spanning tree, one can use routing.

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

CSE 417: Algorithms and Computational Complexity

Fundamental Graph Algorithms Part Four

Discrete mathematics

Graph traversal is a generalization of tree traversal except we have to keep track of the visited vertices.

Cut vertices, Cut Edges and Biconnected components. MTL776 Graph algorithms

Homework 6 Solutions CS330 Discrete Structures, Fall 2017

Graph definitions. There are two kinds of graphs: directed graphs (sometimes called digraphs) and undirected graphs. An undirected graph

Transcription:

Broadcast: Before 1

After 2

Spanning Tree ffl assume fixed spanning tree ffl asynchronous model 3

Processor State parent terminated children 4

Broadcast: Step One parent terminated children 5

Broadcast:Step Two parent terminated children 6

Correctness Question: Is this algorithm correct for ffl synchronous networks? ffl asynchronous networks? Question: If so, what is the message complexity? 7

Proof Claim: This algorithm has time complexity d, where d is the depth of the spanning tree. Proof: by induction parent terminated children Basis: t =1 ffl each child of pr receives M 8

Proof parent terminated children Induction step: ffl assume p i at distance t 1 receives M at round t 1. ffl by algorithm, each child of p i receives M in next round. 9

Correctness Claim This algorithm is correct in the synchronous model too. ffl argue by induction ffl basis: time at most 1 ffl induction step: time at most d 10

Convergecast: Before x 0 x 4 x 1 x 3 x 2 11

After max(x,..., x ) 0 4 12

Convergecast: Step One parent terminated children 13

Convergecast: Step Two parent terminated children 14

Theorem There is an asynchronous convergecast algorithm with ffl message complexity n 1, and ffl time complexity d, in the synchronous and asynchronous model, when a spanning tree of depth d is known in advance. Proof left as an exercise. 15

Flooding ffl no spanning tree ffl root sends to all neighbors 16

Flooding already seen ffl first time we've seen this message? 17

Flooding already seen ffl Send it out on all other links. 18

Flooding already seen ffl If you see the message again, ignore it. 19

Complexity ffl no node sends a message on a link more than once ffl no link transmit more than two copies ffl (can a link transmit two copies?) Max number of messages: why? 2m (n 1) Worst-case: n(n 1) 2 20

Spamming Trees Actually, flooding creates a spanning tree. ffl root at pr, the root node. ffl if p j receives M from p i for the first time, then p i is parent of p j. 21

Spanning Tree Algorithm already seen Dad! ffl when message received for the first time ffl set parent variable ffl respond with parent message 22

Spanning Tree Algorithm already seen ffl when message received subsequent times time ffl respond with reject message 23

Spanning Tree Algorithm ffl send messages to all other neighbors 24

Spanning Tree Algorithm ffl collect responses 25

Spanning Tree Algorithm ffl end up with spanning tree ffl each node has parent and children variables 26

Spanning Tree How do we know it works? ffl once a processor sets its parent variable, it never changes ffl set of children never decreases ffl eventually graph induced by parent and children stops changing ffl variables are consistent: if p i 's parent is p j, then p j 's children include p i. ffl still need to show that we have a tree rooted at pr. 27

Reachability ffl suppose some node not reachable from pr ffl network is connected ffl there exist p i and p j such that ffl p i and p j are linked by a channel ffl p i is reachable, and p j is not. ffl p j never set its parent variable. ffl but p i must have sent a message to p j ffl p j must have received the message and set its parent variable ffl contradiction 28

Acyclicity ffl suppose the graph contains a cycle ffl p i 1 ;p i2 ;:::;p i ;p k i 1 ffl if p i is a child of p j, ffl then p i received its message for the first time after p j does ffl so then p i received its message for the first time 1 after p does i 1 ffl contradiction 29

Theorem There is an asynchronous algorithm to find a spanning tree of a network with m edges and diameter D, given a distinguished node, in message complexity O(m) and time complexity O(d). The diameter of a graph is the longest shortest path between two nodes. Same claim holds for synchronous model. 30

Synchronous Tree Breadth-first search tree. 31

Asynchronous Tree No guarantees on tree structure. 32

Depth-First Search Tree unexplored unexplored ffl neighbors unexplored ffl receive request from neighbor 33

Depth-First Search Tree unexplored ffl set parent variable ffl remove parent from unexplored set ffl pick unexplored neighbor ffl remove from unexplored set ffl forward message 34

Depth-First Search Tree ffl reject subsequent requests 35

Depth-First Search Tree unexplored ffl when neighbor responds ffl move on to next unexplored neighbors 36

Depth-First Search Tree ffl when all neighbors explored ffl report to parent 37

Analysis ffl each processor sends M message once on each edge ffl each processor replies at most once ffl at most 4m messages sent ffl prove it! 38

Roots Algorithm depends on fixed root node to start out. How can we design a DFS tree that does not have a distinguished root? Hint ffl assume nodes have unique ids ffl assume ids are ordered 39

Roots Revisited ffl Everybody wakes up and tries to be the root. ffl send leader id as part of the message ffl if you get a message from a leader with a lower id, abandon earlier trees and join this one. ffl ignore messages from leaders with higher ids ffl eventually, the one true leader will take over ffl she will recognize when her tree is complete how? ffl no other node's tree will complete why? ffl message complexity O(mn). ffl time complexity O(m). 40