Election in the Complete Graph

Slides:



Advertisements
Similar presentations
YO-YO Leader Election Lijie Wang
Advertisements

Chapter 13 Leader Election. Breaking the symmetry in system Similar to distributed mutual exclusion problems, the first process to enter the CS can be.
Leader Election Breaking the symmetry in a system.
Distributed Leader Election Algorithms in Synchronous Ring Networks
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.
Distributed Computing 2. Leader Election – ring network Shmuel Zaks ©
Consensus Hao Li.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 7 Instructor: Haifeng YU.
The Out of Kilter Algorithm in Introduction The out of kilter algorithm is an example of a primal-dual algorithm. It works on both the primal.
Termination Detection Part 1. Goal Study the development of a protocol for termination detection with the help of invariants.
Mobile and Wireless Computing Institute for Computer Science, University of Freiburg Western Australian Interactive Virtual Environments Centre (IVEC)
CPSC 668Set 5: Synchronous LE in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 4: Asynchronous Lower Bound for LE in Rings1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Leader in a clique in O(nlog(n)) messages By Pierre A. Humblet and the help of Miki Asa.
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Termination Detection Presented by: Yonni Edelist.
A (nlog(n)) lower bound for leader election in a clique.
Leader Election in Rings
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.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
Maximal Independent Set Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
Introduction to computer networking Distributed Algorithms Class Recitation.
Composition Model and its code. bound:=bound+1.
Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 10 Instructor: Haifeng YU.
Centralized mutual exclusion Problem : What if the coordinator fails? Solution : Elect a new one.
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
1 Maximal Independent Set. 2 Independent Set (IS): In a graph G=(V,E), |V|=n, |E|=m, any set of nodes that are not adjacent.
1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process.
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
Leader Election (if we ignore the failure detection part)
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 2: Basic Graph Algorithms 1.
1 Selecting leader in a clique in O (n log n) By Pierre A.Humblet Presented by: Anat Berkman, Distributed Algorithms, Technion.
Hwajung Lee. 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 ::
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
7 Finding Bridge in a Graph. What is a bridge ? A C D B F G E.
CIS 825 Lecture 9. Minimum Spanning tree construction Each node is a subtree/fragment by itself. Select the minimum outgoing edge of the fragment Send.
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
Paola Flocchini Election in Arbitrary Networks Mega-Merger Yo-Yo Some Considerations.
Distributed Systems 31. Theoretical Foundations of Distributed Systems - Coordination Simon Razniewski Faculty of Computer Science Free University of Bozen-Bolzano.
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 ::
Leftist Trees Linked binary tree.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CS 347: Parallel and Distributed Data Management Notes07: Data Replication Hector Garcia-Molina CS 347 Notes07.
Randomized Min-Cut Algorithm
Leader Election Chapter 3 Observations Election in the Ring
Election algorithm Who wins? God knows.
The Model & Basic Computations
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Multi-Node Broadcasting in Hypercube and Star Graphs
CS60002: Distributed Systems
Leader Election (if we ignore the failure detection part)
MST GALLAGER HUMBLET SPIRA ALGORITHM
Distributed Consensus
Distributed Systems, Consensus and Replicated State Machines
EEC 688/788 Secure and Dependable Computing
Deterministic Distributed Resource Discovery
EEC 688/788 Secure and Dependable Computing
MST GALLAGER HUMBLET SPIRA ALGORITHM
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Routing Chapter 4 Shortest path routing Gossip
EEC 688/788 Secure and Dependable Computing
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
EEC 688/788 Secure and Dependable Computing
Leader Election Ch. 3, 4.1, 15.1, 15.2 Chien-Liang Fok 4/29/2019
Implementing Consistency -- Paxos
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Election in the Complete Graph Paola Flocchini Election in the Complete Graph 3 6 8 2 1 5 7 4 Paola Flocchini

Ask neighbours one at a time Paola Flocchini Trivial Algorithm. Ask neighbours one at a time 3 2 I am 1 You win 5 1 7 6 Paola Flocchini

Ask neighbours one at a time Paola Flocchini Trivial Algorithm. Ask neighbours one at a time 3 2 5 1 7 6 Paola Flocchini

Paola Flocchini Message Complexity O(n2) Paola Flocchini

- Territory acquisition (capture neighbours) Paola Flocchini Better Algorithm Ideas: - In stages - Territory acquisition (capture neighbours) ensuring that a node is captured by at most one candidate in the same stage - Disjoint territories Paola Flocchini

A node attacks another node, if successful Paola Flocchini A node attacks another node, if successful it captures the node increasing the size of its territory (= stage number) Defeated nodes become captured (belonging to a owner) and stop attacking CANDIDATE: still playing trying to increase the territory PASSIVE: transitional phase, will not attack anymore, will eventually become captured CAPTURED: belong to a territory, owned by a candidate An attack could reach candidate passive captured Paola Flocchini

Paola Flocchini 4 3 8 territories Paola Flocchini

Bigger territories win over smaller ones (i.e. higher stages) Paola Flocchini The Attack Bigger territories win over smaller ones (i.e. higher stages) In case of tie, smaller Ids win 3 8 8 4 Paola Flocchini

Bigger territories win over smaller ones (i.e. higher stages) Paola Flocchini The Attack Bigger territories win over smaller ones (i.e. higher stages) In case of tie, smaller Ids win 3 8 8 4 Paola Flocchini

Send capture message to one neighbour Paola Flocchini Attacking a candidate Send capture message to one neighbour (stage,Id:3) 3 8 captured 8 3 Increase territory and stage (+1) (stage,Id:3) 3 reject 8 8 3 Paola Flocchini If still candidate, 3 becomes passive

Paola Flocchini Attacking a passive 3 8 Paola Flocchini

Increase territory and stage (+1) Paola Flocchini Attacking a passive captured 3 8 Increase territory and stage (+1) Paola Flocchini

3 becomes passive, if still candidate Paola Flocchini Attacking a captured 3 8 no If I know I belong to a bigger territory (stage,Id:3) 8 3 3 becomes passive, if still candidate 3 8 Not sure, ask my owner (stage,Id:3) 8 3 Paola Flocchini

Increase territory and stage (+1) Paola Flocchini Attacking a captured If I know I belong to a bigger territory (stage,Id:3) 8 3 8 no 3 Not sure, ask my owner yes (stage,Id:3) 8 8 3 3 Paola Flocchini Increase territory and stage (+1)

3 becomes passive, if still candidate Paola Flocchini Attacking a captured If I know I belong to a bigger territory (stage,Id:3) 8 3 8 no 3 Not sure, ask my owner no (stage,Id:3) 8 8 3 3 3 Paola Flocchini 3 becomes passive, if still candidate

Paola Flocchini passive candidate captured Paola Flocchini

When does a candidate become a leader ? Paola Flocchini When to terminate ? When does a candidate become a leader ? When it captures more than n/2 nodes If a candidate has captured more than n/2 nodes nobody else can become leader Paola Flocchini

The territories of any two candidates are disjoint Paola Flocchini Important The territories of any two candidates are disjoint Because at any time, any node has only ONE owner. 3 Each territory is rooted in its owner 6 8 2 1 5 7 Paola Flocchini 4

Paola Flocchini Paola Flocchini

We need: number of stages and messages per stage Paola Flocchini We need: number of stages and messages per stage Paola Flocchini

candidate --- candidate 2 msgs Paola Flocchini Messages per attack candidate --- candidate 2 msgs 2 msgs candidate --- passive candidate --- captured 4 msgs At most 4 messages per attack Paola Flocchini

A candidate with n/2 +1 captured nodes becomes leader and notify Paola Flocchini Number of stages A candidate with n/2 +1 captured nodes becomes leader and notify n/2 +1 stages Paola Flocchini

How many candidates in each stage ? Paola Flocchini How many candidates in each stage ? i Stage i ---> territory of size i i i i i With disjoint territories There cannot be more than n/i candidates in stage i ni  n/i Paola Flocchini

 4 n/i O( ) O( ) Message Complexity At most 4 messages per attack Paola Flocchini Message Complexity At most 4 messages per attack ni  n/i Messages in stage i  4 n/i Harmonic number Hn/2 = O(log n)  4 n/i 1 n/2 O( ) n/2 O( 4 n  1/i ) = 1 M(completeElect) = O(n log n) Paola Flocchini

Election in a Complete Graph with Chordal Sense of Direction Paola Flocchini Election in a Complete Graph with Chordal Sense of Direction 5 1 4 1 2 5 3 3 2 4 5 4 1 2 3 3 2 4 5 1 4 3 3 2 5 1 2 4 1 5 Any ring algorithm IDEA: Put information in messages. At the next step, use a smaller ring. Paola Flocchini

(Id:3, originLink: 1) 8-1=7. the message was originated from Paola Flocchini (Id:3, originLink: 1) 1 7 3 8-1=7. the message was originated from my neighbour 6 2 1 7 5 6 4 3 6 5 8 2 4 7 3 3 1 5 4 2 6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

(Id:3, originLink: 1) (Id:3, originLink: 2) 3 6 8 2 1 5 7 4 Paola Flocchini (Id:3, originLink: 1) 3 1 7 6 2 1 7 (Id:3, originLink: 2) 5 4 3 6 6 8 2 5 4 3 1 7 3 2 5 4 6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

Modulo 8 (Id:3, originLink: 2) Which means my link 8-2=6 3 6 8 2 1 5 7 Paola Flocchini Modulo 8 3 1 7 6 2 1 7 (Id:3, originLink: 2) 5 4 3 6 6 8 2 5 4 3 1 7 3 2 5 4 6 Which means my link 8-2=6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

Similarly for the other candidates Paola Flocchini Similarly for the other candidates Modulo 8 3 1 7 (Id:2, originLink: 6) 6 2 1 7 5 4 3 6 6 8 2 5 4 3 1 7 3 2 5 4 6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

Similarly for the other candidates Paola Flocchini Similarly for the other candidates Modulo 8 (Id:2, originLink: 6+6=4) 3 1 7 6 2 1 7 5 4 3 6 6 8 2 5 4 3 1 7 3 (Id:2, originLink: 6) 2 5 4 6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

Similarly for the other candidates Paola Flocchini Similarly for the other candidates Modulo 8 3 1 7 6 2 1 7 5 4 3 6 6 8 2 5 Which means my 8-4=4 4 3 1 7 3 2 5 4 6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

Similarly for the other candidates Paola Flocchini Similarly for the other candidates Modulo 8 3 1 7 6 2 1 7 5 4 3 6 6 8 2 5 4 3 1 7 3 2 5 4 6 7 6 1 2 3 5 2 4 1 4 3 5 2 1 6 7 3 4 6 2 5 1 5 4 7 3 5 6 2 7 4 7 3 5 6 1 2 1 7 4 Paola Flocchini

Message Complexity Planar graph - 2 messages per edge Paola Flocchini Message Complexity Planar graph - 2 messages per edge O(n) [because a planar graph has O(n) edges] Paola Flocchini