Lecture 8: Synchronous Network Algorithms

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Leader Election Breaking the symmetry in a system.
Distributed Leader Election Algorithms in Synchronous Ring Networks
Lecture 8: Asynchronous Network Algorithms
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Chapter 15 Basic Asynchronous Network Algorithms
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty.
Lecture 7: Synchronous Network Algorithms
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
Minimum Spanning Trees
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
Lectures on Network Flows
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
Università degli Studi dell’Aquila Academic Year 2009/2010 Course: Algorithms for Distributed Systems Instructor: Prof. Guido Proietti Time: Monday:
Tirgul 12 Algorithm for Single-Source-Shortest-Paths (s-s-s-p) Problem Application of s-s-s-p for Solving a System of Difference Constraints.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
1 Fault-Tolerant Consensus. 2 Failures in Distributed Systems Link failure: A link fails and remains inactive; the network may get partitioned Crash:
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
1 Brief Announcement: Distributed Broadcasting and Mapping Protocols in Directed Anonymous Networks Michael Langberg: Open University of Israel Moshe Schwartz:
Leader Election in Rings
Tirgul 13. Unweighted Graphs Wishful Thinking – you decide to go to work on your sun-tan in ‘ Hatzuk ’ beach in Tel-Aviv. Therefore, you take your swimming.
Complexity of Bellman-Ford Theorem. The message complexity of Bellman-Ford algorithm is exponential. Proof outline. Consider a topology with an even number.
Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)
Broadcast & Convergecast Downcast & Upcast
Distributed Computing 5. Synchronization Shmuel Zaks ©
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 10 Instructor: Haifeng YU.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
Shortest Paths CSE 2320 – Algorithms and Data Structures Vassilis Athitsos University of Texas at Arlington 1.
A correction The definition of knot in page 147 is not correct. The correct definition is: A knot in a directed graph is a subgraph with the property that.
10 Copyright © William C. Cheng Data Structures - CSCI 102 Graph Terminology A graph consists of a set of Vertices and a set of Edges C A B D a c b d e.
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
Lecture #14 Distributed Algorithms (II) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
Data Structures and Algorithm Analysis Graph Algorithms Lecturer: Jing Liu Homepage:
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
CSE 373: Data Structures and Algorithms Lecture 21: Graphs V 1.
Distributed Leader Election Krishnendu Mukhopadhyaya Indian Statistical Institute, Kolkata.
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty ::
New Characterizations in Turnstile Streams with Applications
Single-Source Shortest Paths
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Michael Langberg: Open University of Israel
Lectures on Network Flows
COMP 6/4030 ALGORITHMS Prim’s Theorem 10/26/2000.
Lecture 9: Asynchronous Network Algorithms
Leader Election (if we ignore the failure detection part)
Parallel and Distributed Algorithms
Tree Construction (BFS, DFS, MST) Chapter 5
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Chapter 22: Elementary Graph Algorithms I
Outline This topic covers Prim’s algorithm:
Shortest Path Algorithms
Introduction Wireless Ad-Hoc Network
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Text Book: Introduction to algorithms By C L R S
Advanced Algorithms Analysis and Design
CSE 417: Algorithms and Computational Complexity
Graphs.
Graphs.
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Graphs.
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Graphs.
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Lecture 8: Synchronous Network Algorithms Basic technology of distributed algorithms (1) Correctness of algorithms (2) Efficiency of algorithms (3) Fault-tolerance

Complexity of distributed algorithms Communication complexity: (1) the number of messages transmitted in whole system, (2) the number of message bits transmitted in whole system Memory complexity: (1) the amount of memory used in whole system, (2) the amount of memory used in one process. Computation complexity: (1) processing time in processes, (2) upper bound of transmission delay in communication links.

Problems 1 Leader Election in A synchronous Ring Assumption of the network Network graph G=(V,E) is a ring, where node set V={1,2,…,n} and edge set E={(i,i+1), where i=1,2,…,n and i is counted mod n}. Each process has a unique distinct identifier (UID). Each node uses only unidirectional communication and its UID (it does not know the size of the ring, its own index and anything of its neighbors). Only the leader performs an output. LCR algorithm (informal) (1) Each process sends its identifier around the ring. (2) When a process receives an incoming identifier, it compares that identifier to its own. If the incoming identifier is greater than its own, it keeps passing the identifier; if it is less than its own, it discards the incoming identifier; if it is equal to its own, the process declares itself the leader.

LCR algorithm (formal) Suppose that each node i has A UID u, initially i’s UID, send, a UID or null, initially i’s UID, A status with value in {unknown, leader}, initially unknown. Algorithm Send the current value of send to clockwise neighbor send := null if the incoming message is v, a UID, than case v>u: send :=v v=u: status := leader v<u: do nothing endcase Theorem LCR solves the leader-election problem in a synchronous ring. Proof: exact one process outputs the value leader.

Analysis of the Complexity of LCR Algorithm Time complexity: n rounds until a leader is announced. Communication complexity: Remark 1: If it is required that all the nodes halt, the time complexity is 2n and the communication complexity is still Remark 2: If it is required that the leader and nonleaders all provide output and all processes halt, the extra cost of obtaining the extra outputs and the halting is only n rounds and n messages.

Improved Leader-Election Algorithm In the following algorithm, the communication is supposed to be bidirectional. HS algorithm (informal) Each process i operates in phases 0,1,2,…. In each phase l, process i send out “tokens” consists of UID in both directions. These are intended to travel distance then return to their original i. If both tokens make it back safely, process i continues with the following phase. However, the tokens might not make it back safely. While a token is proceeding in the outbound direction, each other process j on path compares with its own UID . If then j simply discards the token, whereas if , then j relays . If , then it means that process j has received its own UID before the token has turned around, so process j elects itself as the leader. All processes always relay all tokens in the inbound direction.

Analysis of the Complexity of HS Algorithm find leader relay Analysis of the Complexity of HS Algorithm Time complexity: O(n) rounds (the time for each phase is ). Communication complexity: O(n log n) (at most processes altogether initiate tokens at phase l. Therefore, the total messages sent out at phase l is bounded by ).

Problem2 Leader Election in a General Network Assumption of the network An strongly connected network digraph G=(V,E) having n nodes. Processes do not know their indices, nor those of their neighbors, but refer to their neighbors by local names. If a process i has the same process j for both incoming and outgoing neighbor, then i knows that the two processes are the same. FloodMax algorithm (informal) Suppose that each process has a unique distinct UID and it knows diam, the diameter of network. Each process maintains a record of the maximum UID it has seen so far (initially its own). At each round, each process propagates its maximum on all of its outgoing edges. After diam rounds, if the maximum value seen is the process’s own UID, the process elects itself the leader; otherwise, it is a non-leader.

Theorem FloodMax algorithm solves the leader-election problem in a synchronous general network. Proof: exact one process outputs the value leader. Analysis of the Complexity of FloodMax Algorithm Time complexity: (The time until the leader is elected and all other processes know that they are not the leader is diam rounds.) Communication complexity: (The number of messages is , where |E| is the number of directed edges in the digraph, because a message is sent on every directed edge for each of the first diam rounds.)

Problem 3 Breadth-First Search Bread-First Search Given a graph G=(V,E) and a distinguished source vertex i, breadth-first search explores the edges of G to discover every vertex that is reachable from s. It provides the distance from i to all such reachable vertices. It also provide a breadth-first tree with root i that contains all such reachable vertices. s Bread-First Search in an undirected graph s Bread-First Search in a directed graph Spanning Tree A spanning tree of graph G=(V,E) is a rooted tree which contains all vertices of V and the path from the root to any vertex. A breadth-firs tree is a spanning tree.

Assumption of the network An strongly connected network digraph G=(V,E) having n nodes and a distinguished source note s. Output is the structure of a breadth-first search tree of the network graph with root s in a distributed fashion: each process other than s should have a parent component that gets set to indicate the node that is its parent in the tree. Processes know their neighbors’ indices. They have no knowledge of the size or diameter of the network. UIDs are not needed. SynchBFS algorithms At any point during execution, there is some set of processes that is “marked”, initially just s. Process s sends out a search message at round 1, to all of its outgoing neighbors. At any round, if an unmarked process receives a search message, it marks itself and chooses one of the processes from which the search has arrived as its parent, then it sends a search message to all of its outgoing neighbors.

Theorem SynchBFS algorithm solves the Breadth-First Search problem. Analysis of the complexity of SynchBFS algorithm Time complexity: At most diam rounds Communication complexity: |E| Application to Message Broadcast Problem SynchBFS algorithm can be used to Message Broadcast problem: piggyback the message m in the Breadth-First Search.

Problem 4 Shortest Path Problem Shortest Path Problem Consider a strong directed graph G=(V,E), where ach edge e=(i,j) in E has a nonnegative real-value weight w(i,j). The problem is to find a shortest path form a distinguished node s to each other node in G. s 2 1 4 3 Shortest paths from s s 2 1 4 3

BellmanFord algorithm Assumption of network Each process initially knows its neighbors’ indices and the weight of all its incident edges. Each process knows the number n of nodes in the network. Output: each process knows its parent in the shortest path tree, and its distance from s. BellmanFord algorithm Each process i keeps track of parent and dist, the shortest distance from s to i it knows so far. Initially, dist(s)=0, dist(i)= for and the parent components are not defined. At each round process i sends its dist(i) to all its outgoing neighbors. Then each process i updates its dist(i) to be If dist(i) is updated, the parent is also updated accordingly. After n-1 rounds, dist contains the shortest distance, and parent contains the parent in the shortest tree.

Analysis of the complexity of BellFord algorithm Time complexity: n-1 2 1 4 3 s 2 1 4 3 s 2 1 4 3 s 2 1 4 3 s 2 1 4 3 s 2 1 4 3 Analysis of the complexity of BellFord algorithm Time complexity: n-1 Communication complexity: (n-1)|E|

Assignment Improve algorithm FloodMax to reduce the communication complexity. Describe an algorithm that extends SynchBFS to allow the source process s to broadcast a message to all other processes and obtain an acknowledge that all processes have received it. Your algorithm should use O(|E|) messages and O(diam) time. You may assume that the network graph is undireted.