ALGOREP : Leader Election
Les slides du cours
Leader Election in a Synchronous Ring
Problem statement
- The netwok digraph is a ring with nodes
- All processes are identical
- Each process can only communicate with clockwise neighbors and counterclockwise neighbors
One process outputs "I'm the leader" while the other process output "I'm note the leader"
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Si tu prend 2 robots identiques, ils divergent lors de la connexion au reseau
Impossibility Result for Identical Processes
Theorem
Let be a system of processes, , arranged in a bidirectionnal ring. If all the processes are identical then does not solve the leader-election problem.
Sketch of proof
- Suppose there is a system that solves this problem
- Without loss of generality, we can assume that each process of have a unique initial state.
- By induction on the number of rounds, all the processes are in identical states immediately after rounds.
- Then if a process reaches a state where it considers to be the leader, all the other processes do so.
- But this violates the uniqueness requirement
Problem Statement
- The network digraph is a ring with nodes
- All processes are identical
- Each process can only communicate with clockwise neighbour and counterclockwise neighbour
Propositions:
- Envoyer un message disant "Je suis peut-etre leader"
- Mais beaucoup de messages
- Anneau unidirectionnel
LCR Algorithm
- Chaque processus envoie son UID
- Quand il recoit un UID, il le compare avec le sien
- Si l'UID est plus grand, il l'envoie a son voisin
- Sinon discard
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Complexity
- Meilleur cas: messages
- Pire cas: messages
Quand un noeud est elu, rounds et messages sont necessaires
HS Algorithm (comparison-based)
- Bidirectionnal Ring
- The size of the ring is unknown
- Comparison-based algo
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Algorithm
- On a des phases de process
- Dans chaque phase
- Process send out tokens containings its in both directions
- Tokens travel distance and return to their origin
- When a process receive a token containing
- if then the token is discarded
- if then the process relays the token
- if then the process is the leader
- If both tokens come back safely, process starts a new phase
- Otherwise the process considers itself as a non-leader
Communication Complexity
- Phase 0: tout le monde envoie un message a gauche et a droite et recoit un message des 2 cotes
- On envoit 4 messages par noeud: messages
- Phase : On a survecu a la phase , il y a qui sont morts autour de moi, il y a process qui envoient un messgae a cette phase. Le nombre de message est
How many phases are executed before a leader is elected ?
The number of messages is at most
Time Complexity
- The time complexity for phase is
- In the final phase takes since tokens only travels outbound
- The final complexity is at most (if is power of ) otherwise.
Summary
TimeSlice Algorithm
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Lower Bounds
Comparison-based
The best case is messages.
Non-Comparison-based
messages can be reached but only at the cost of large time complexity (Ramsey Theorem).
Leader Election in other
Flooding Algorithm
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Breadth-First Search
We want to build the directed spanning tree for the network
Example
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Children pointers
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Leader Election
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Minimum Spanning Trees
Comment est-ce qu'on construit un arbre courant en sequentiel ?
"On enfile des noeuds" (mais c'est un BFS ca)
Problem Statement
How to find the minimum/maximum spanning tree ?
A minimum-weight spanning tree minimizes the total cost for any source process to communicate with all the other process in the network
Est-ce qu'on a besoin d'un leader ?
Minorite de oui: on aurait besoin de quelqu'un qui synchro tou, mais c'est trop sequentiel
Majorite de non
On peut synchroniser avec les process avec les rounds
Imaginons que Mael est un process, qu'il a un lien avec Etienne et tout le monde
Imaginons qu'on peut ponderer les liens (EtienneMael fibre, les autres wifi)
Imaginons que quelqu'un a une connexion encore plus rapide avec Mael
Comment est-ce qu'on se met d'accord ?
suggestion: tableau de booleens pour savoir qui se co a qui Mais qui stock le tableau ?
suggestion: tout le monde a le tableau de boolens infernal de synchro tout le monde
Reprenons naivement:
2 process s'envoient des messages mutuellement, le composant est cree
Maintenant il faut elire un chef
Si tous les process sont synchro par 2, maintenant on peut synchroniser 2 paires
On continue jusqu'a synchro tous les composants
Avec cette strategie, on aura un temps de propagation plus long pour un message (2 messages au lieu de 1)
2 interets:
- Le BFS est complique a faire, on lancais BFS
- Beaucoup de messages sequentiels en parallele
- Maximiser le fait qu'on soit en distribue
Qu'est-ce qu'on va faire apparaitre avec cette methode ?
Du car on divise par 2 a chaque fois
Comment faire pour savoir les liens d'un composant avec le reste du monde ?
Quand on creer une paire, les process peuvent echanger leurs listes de voisins
On peut faire une phase de flooding dans le composant
Comment ca genere un arbre courant ?
2 process creent un arbre courant entre eux
On rajoute une paire, on a un arbre courant a 4
etc.
Ou est-ce que l'arbre courant va etre stocke ?
Chacun va avoir une vision locale
Si jamais un composant a 2 voisins avec le meme degre minimal, comment faire ?
Si ce composant ne repond pas a un des 2 voisins dans le temps imparti, c'est qu'il s'est mis avec l'autre
Avec cette methode, on perd les performance de notre systeme
On a un composant qui peut faire des aggregations simultanees pour avoir des performances resonnables
Complexity
Non-unique edge weight
We can define a lexicographic order using UID of processes
Leader election
When building the MST a leader is elected naturally !