Nesrine Ouled Abdallah

Keywords: Tiny objects, Population protocols, Computing models, Probabilistic scheduler, Randomized handshakes, Fairness

Computing Models for Networks of Tiny Objects iii respect to these protocols when the interaction graph is complete, however computations under the HS Scheduler stabilize faster when the interaction graph is random. We then introduce the Protocol Aware HS Scheduler, a slightly modified version of the HS Scheduler that takes into account the states of the agents and allows termination in some protocols. We also prove that this scheduler is fair with probability 1. We present analyses of the time complexity of some protocols running under the scheduling of the Protocol Aware HS Scheduler and over different structures of the interaction graph. We implement the different scenarios in ViSiDiA, and validate through simulations our theoretical results.

Titre Modèles de calcul pour les réseaux d'objets à capacité restreinte

Résumé Dans cette thèse, nous nous intéressons aux modèles de calcul dans les réseaux d'objets à capacité restreinte, tels que les réseaux de capteurs sans fil. Nous nous focalisons sur les protocoles de population proposés par Angluin et al. Dans ce modèle, les objets sont représentés par des agents à états finis, passivement mobiles, communiquant entre paires et formant un réseau asynchrone et anonyme. Nous présentons deux études comparatives qui nous permettent par la suite de proposer une approche établissant le lien des protocoles de population avec deux autres modèles : le modèle des tâches avec les systèmes de réécritures de graphes, et le modèle asynchrone et anonyme d'échange de messages. Nous passons ensuite au problème d'ordonnancement dans les protocoles de population. Nous proposons un nouvel ordonnanceur probabiliste, 1-central, basé sur les rendez-vous randomisés et appelé HS Scheduler. Contrairement aux autres ordonnanceurs, il est permet à plus d'une paire de communiquer à la fois. Nous prouvons qu'il est équitable avec probabilité 1. Nous analysons par la suite les temps de stabilisation de certains protocoles s'exécutant sous le Random Scheduler ou le HS Scheduler et sur différentes topologies du graphe d'interaction. Nous prouvons que le HS Scheduler est équivalent en temps au Random Scheduler quand le graphe d'interaction est complet mais qu'il permet une stabilisation plus rapide quand le graphe est aléatoire. Par la suite, nous proposons un autre ordonnanceur qui prend en considération les états des agents et permet d'introduire la terminaison à certains protocoles : le Prorotol Aware HS Scheduler. Nous prouvons qu'il est équitable avec probabilité 1. Nous faisons l'analyse des temps de stabilisation de certains protocoles s'exécutant sous cet ordonnanceur en considérant différentes topologies du graphe d'interaction. Finalement, nous implémentons et simulons sur ViSiDiA l'ensemble des scénarios étudiés et validons nos résultats théoriques.

Mots-clés Objet à capacité restreinte, Protocoles de populations, Modèles de calcul, Ordonnanceur probabiliste, Rendez-vous randomisés, Équité.

Title Computing Models for Networks of Tiny Objects

Abstract In this work, we consider computing models for networks of tiny objects such as wireless sensor networks. We focus on the population protocols, a pairwise computational model introduced by Angluin et al. where the tiny objects are represented by anonymous, passively mobile, finite state agents forming asynchronous networks. We establish two comparative studies between the population protocol model (and its extensions) and the two following ones: tasks with graph relabeling systems, and anonymous asynchronous message passing. These studies aim to establish possible mappings between the population protocols and these two models. We then focus on the scheduling of the pairwise interactions in population protocols. We propose the HS Scheduler, a new probabilistic 1-central scheduler based on randomized handshakes. Compared to the existing schedulers, this scheduler allows to more than one pair of agents to communicate simultaneously. We prove that this scheduler is fair with probability 1. We thereafter present analyses of the complexity of the stabilization time of some protocols running under the scheduling of the Random Scheduler and the HS Scheduler, and over different topologies of the interaction graph. We prove that these two schedulers are time equivalent with

Résumé étendu

Les réseaux d'objets à capacités restreintes, tels que les réseaux de capteurs sans fil, sont des systèmes distribués asynchrones formés de petites entités (aussi appelés objets, agents, ou équipement) dont les ressources : énergie, mémoire et puissance de calcul sont limitées. Ces entités sont capables de communiquer via des liens sans fil. Elles peuvent aussi être passivement mobiles n'ayant aucun contrôle de leurs mouvements (attachées à des objets mobiles par exemple). A cause de la contrainte sur l'espace mémoire, ces entités sont souvent supposées comme étant anonymes. Une fois le réseau est déployé, ces objets vont devoir communiquer et coopérer pour atteindre un objectif global. Cependant, comment arriver à faire les calculs nécessaires pour atteindre cet objectif malgré les ressources limitées du réseau?

Dans le cadre de ce travail, nous nous sommes intéressés aux protocoles de populations [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. C'est un modèle de calcul entre paires proposé par Angluin et al. pour de tels réseaux. Dans ce modèle, les agents formant le réseau sont considérés comme des automates finis sans identifiants uniques. Ils sont identiquement programmés et forment ainsi une population de taille finie mais non bornée. Un protocole de population calcule un prédicat ou une fonction des entrées distribuées que ces agents ont reçu de leur environnement. Par exemple, un protocole de population s'exécutant dans une population d'oiseaux pourrait être conçu de telle manière qu'il soit capable de décider si le nombre d'oiseaux qui sont malades atteint un certain seuil. Les calculs dans ce modèle sont basés sur des interactions entre paires. Deux agents seront capables de communiquer chaque fois qu'ils seront à proximité l'un de l'autre et partageront ainsi un lien de communication. Lors de cette communication, un agent jouera le rôle d'initiateur tandis que le deuxième jouera celui du receveur. Ces deux agents échangeront leurs états actuels. Par la suite, chacun mettra à jour son état selon son rôle, son état actuel, l'état reçu, et les règles de transition du protocole. Toutes les interactions possibles entre paires d'agent sont représentées par les arêtes dirigées du graphe d'interactions dont les noeuds représentent les agents de la population.

Les protocoles de population ne s'arrêtent pas mais plutôt se stabilisent. Cette stabilisation a lieu lorsque les sorties des agents convergent, après un temps fini de calcul, vers le résultat correct. Cette stabilisation est une propriété globale du système que les agents ne détectent souvent pas. En effet, la connaissance d'un agent est limitée à son état local. Par conséquent, même si le protocole se stabilise, les agents continuent à interagir.

La puissance de calcul du modèle de protocole de populations a été caractérisée comme étant exactement l'arithmétique de Presburger [START_REF] Angluin | Stably computable predicates are semilinear[END_REF][START_REF] Angluin | The computational power of population protocols[END_REF]. La plupart des travaux qui se sont intéressés à ce modèle ont essayé d'améliorer sa puissance de calcul. Par exemple, Chatzi-giannakis et al. ont proposé le modèle des mediated protocoles de population qui permet d'attribuer des états non seulement aux agents de la population mais aussi aux liens de communications qui les relient [START_REF] Chatzigiannakis | Mediated population protocols[END_REF]. Un autre exemple d'extension des protocoles de population est le modèle PALOMA qui permet aux agents d'avoir, au lieu d'une mémoire constante, un espace mémoire plus important [START_REF] Chatzigiannakis | Passively mobile communicating machines that use restricted space[END_REF]. Contrairement à tous ces travaux, nous nous intéressons à un aspect autre que la puissance de calcul, qui est le modèle d'interaction dans les protocoles de population.

En effet, une interaction entre paire d'agents consiste en un échange abstrait, simultané et bidirectionnel des états de cette paire communicantes. Un concept similaire de communication abstraite est utilisé dans le modèle de tâche avec les systèmes de réécritures de graphes [START_REF] Litovsky | Checking global graph properties by means of local computations: the majority problem[END_REF][START_REF] Litovsky | On the recognition of families of graphs with local computations[END_REF]. Dans ce modèle, un système distribué est représenté par un graphe étiqueté, et un algorithme distribué s'exécutant sur ce système est codé par une séquence de réétiquetages du graphe correspondant. Ce modèle est un modèle de calculs locaux, tout comme les protocoles de population. Nous proposons donc d'explorer dans cette thèse les correspondances qui existent entre ces deux modèles ainsi que la possibilité de plonger chaque modèle dans l'autre.

Les protocoles de population ont été conçus pour des réseaux tels que les réseaux de capteurs sans fil, donc adopter l'hypothèse de communication abstraite est une hypothèse assez forte. Ainsi, décrire cet échange bidirectionnel entre paire à travers un modèle de communication moins théorique, basé sur un minimum d'hypothèses supplémentaires, serait assez intéressant. Par conséquent, représenter une population par un système distribué anonyme et asynchrone basé sur échange de messages avec numérotation de ports s'avère une bonne alternative. Un protocole de population pourrait ainsi être décrit par un algorithme distribué basé sur échange de messages et tournant sur ce système.

Dans un autre volet de ce travail, nous nous intéressons à l'ordonnancement des interactions dans les protocoles de population. L'ordonnanceur est l'entité responsable du choix des paires d'agents communicantes : il choisit des paires d'agents adjacents dans le graphe d'interaction. Pour garantir une exécution équitable des protocoles, un ordonnanceur doit satisfaire une propriété d'équité. Un ordonnanceur conçu pour les protocoles de population doit être aussi probabiliste pour décrire l'imprédictibilité des interactions causée par la mobilité et l'asynchronisme des agents. Tous les ordonnanceurs déjà proposés pour les protocoles de population sont des ordonnanceurs centraux (aussi appelés séquentiels) : à chaque étape de calcul du protocole, l'ordonnanceur n'autorise qu'à une seule paire d'agents de communiquer. Les populations d'agents sont des systèmes distribués où il n'y a aucun contrôle centralisé. Ainsi, un ordonnanceur distribué serait plus adéquat dans ce contexte vu qu'il arrive à capturer l'aspect concurrent des interactions : il peut permettre à plus d'une paire d'agents de communiquer simultanément. Nous proposons donc un nouvel ordonnanceur pour les protocoles de population, qui est probabiliste, équitable et distribué. L'équité des ordonnanceurs ne garantit pas leurs équivalences [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF]. Nous proposons donc d'explorer l'équivalence en temps de l'ordonnanceur que nous proposons avec le Random Scheduler, lordonnanceur proposé par Angluin et al. [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. Nous pensons aussi que permettre à cet ordonnanceur distribué proposé de prendre en compte les états des agents Résumé étendu permettrait d'introduire la notion de terminaison aux protocoles de population. Nous pensons même que ceci pourrait permettre une stabilisation plus rapide des protocoles : les agents ayant atteints un certain état ne seront plus sélectionnés par l'ordonnanceur.

Contributions

Nous présentons dans ce qui suit un résumé des principales contributions de ce travail.

1. Plongement du modèle des protocoles de populations dans le modèle de tâches avec les systèmes de réécritures de graphes et vice versa. Nous présentons une étude comparative des (mediated) protocoles de populations et les tâches avec les systèmes de réécritures de graphes. Étant donné que ces deux modèles utilisent des communications abstraites entre paires, nous étudions les similarités, ainsi que les différences qui existent entre eux. Basé sur cette étude comparative, nous proposons une approche qui permet le plongement d'un modèle dans l'autre. Nous prouvons que le calcul d'un (mediated) protocole de population peut toujours être exprimé comme la réalisation d'une tâche avec un système de réécriture de graphe. Par contre, l'autre sens n'est pas toujours vrai. En effet, seule la réalisation d'une tâche dont les règles de réécritures sont limitées à des règles LC0 sans contextes interdits ou priorités et dont les étiquettes sont de taille constante peut être décrite comme le calcul d'un (mediated) protocole de population. [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. Le Handshake Scheduler.

Nous présentons un nouvel ordonnanceur probabiliste basé sur les rendez-vous randomisés. Nous l'appelons le Handshake Scheduler et le notons le HS Scheduler. Contrairement aux ordonnanceurs déjà proposés pour les protocoles de population, ce dernier n'est pas séquentiel mais plutôt 1-central. Par conséquent, il peut permettre à plus d'une paire d'agents d'interagir en même temps tant qu'elles sont disjointes. Inspirés des algorithmes de rendez-vous randomisés qui existent dans la littérature, nous proposons un algorithme pour le HS Scheduler. Nous faisons l'analyse de cet algorithme. Cette analyse nous sert par la suite à prouver que le HS Scheduler est un ordonnanceur probabiliste, consistent et équitable avec probabilité 1. Cette contribuant a fait l'objet d'un papier [START_REF] Ouled Abdallah | A totally distributed fair scheduler for population protocols by randomized handshakes[END_REF].

Résumé étendu

Organization du manuscrit

Nous commençons ce travail par un chapitre préliminaire (Chapitre 1) pour introduire quelques concepts et outils de base reliés aux systèmes et algorithmes distribués, à la théorie des graphes, à la théorie de la probabilité, et aux mathématiques. Ce chapitre facilitera ainsi la compréhension de ce qui suivra dans ce travail.

Par la suite, dans le Chapitre 2, nous introduisons le modèle des protocoles de population proposé par Angluin et al. Nous présentons une définition formelle de ce modèle ainsi que les résultats obtenus par Angluin et al. concernant sa puissance de calcul. Nous donnons ensuite un aperçu des variantes de ce modèle tel que le One Way protocoles de population qui restreint l'échange bidirectionnel entre les paires d'agents en un échange unidirectionnel. Nous présentons aussi les modèles qui ont étendu les protocoles de population en attribuant des états aux arêtes, ou en allouant plus de mémoire aux agents, etc.

Le Chapitre 3 est constitué de deux parties. Dans la première, nous présentons le modèle des tâches avec les systèmes de réécritures de graphes. Ce modèle, tout comme les protocoles de population, est un modèle de calculs locaux basé sur des communications abstraites. Nous établissons par la suite une étude comparative qui nous permet de définir une approche décrivant la possibilité du plongement du modèle des protocoles de population dans le modèle des tâches avec les systèmes de réécritures de graphes et vice versa.

Dans la deuxième partie de ce chapitre, nous présentons le modèle anonyme et asynchrone d'échange de messages. Nous détaillons les méthodes de numérotation de ports qui existent dans la littérature. Par la suite, nous établissons une étude comparative grâce à laquelle nous proposons une approche permettant d'exprimer un protocole de population comme étant un algorithme distribué s'exécutant dans un système anonyme et asynchrone basé sur échange de messages avec numérotation de ports.

Nous concluons ce chapitre en établissant une passerelle entre les trois modèles suivants : protocoles de population, tâches avec systèmes de réécritures de graphes, et échange de messages anonyme et asynchrone.

Dans le Chapitre 4, nous nous intéressons à l'ordonnancement des interactions dans les systèmes distribués, et plus précisément dans les protocoles de population. Nous présentons un aperçu des ordonnanceurs qui ont déjà été proposés ainsi que les différentes définitions de la notion d'équité. Nous proposons un algorithme pour l'ordonnanceur Random Scheduler. Par la suite, nous introduisons le HS Scheduler. Étant donné qu'il est basé sur les rendez-vous randomisés, nous étudions les algorithmes de rendez-vous randomisés de la littérature. Inspirés de ces algorithmes, nous présentons un algorithme qui encode le HS Scheduler dont nous faisons l'analyse pour prouver l'équité de cet ordonnanceur.

Nous comparons l'ordonnanceur que nous proposons avec le Random Scheduler. Tous deux sont équitables, cependant sont-ils équivalents en temps? Nous explorons cette équivalence dans le Chapitre 5 par rapport à trois protocoles différents s'exécutant sous ces ordonnanceurs en considérant différentes topologies du graphe d'interaction. Les résultats établis sont comme décrit dans la contribution 5. Nous clôturons ce chapitre avec un tableau représentant les résultats de l'analyse du temps de stabilisation de chaque protocole pour chacun des scénarios d'ordonnancement.

Dans le Chapitre 6, nous présentons le modèle des halting protocoles de population proposé par Michail et al [START_REF] Michail | Terminating Population Protocols via Some Minimal Global Knowledge Assumptions[END_REF]. Nous nous focalisons sur le protocole Élection d'un Leader avec détecteur d'absence. Nous étudions le temps de sa stabilisation quand son calcul est effectué sous l'ordonnancement du Random Scheduler, et puis sous l'ordonnancement du HS Scheduler.

Nous proposons ensuite une extension d'une sous classe des protocoles de population (et les modèles qui les étendent) avec une détection de la terminaison locale qui permet à chaque agent de détecter s'il a atteint un état final. Un état final est un état irréversible qui n'apparaît pas dans les règles de transition effectives. Nous présentons par la suite notre contribution 6 relié au Protocol Aware HS Scheduler. Nous clôturons ce chapitre avec un tableau représentant les résultats obtenus concernant les temps de stabilisation des protocoles étudiés pour les différents scénarios d'ordonnancement.

Dans le Chapitre 7, nous présentons la plate-forme ViSiDiA implémentée en Java et conçue pour implémenter, simuler et visualiser des algorithmes distribués. Nous avons enrichi cette plate-forme en ajoutant un module qui permet la génération automatique de différents types de graphes. Grâce à ViSiDiA, nous illustrons les différentes approches de mapping que nous avons établies dans le Chapitre 3. Nous implémentons sous cette plate-forme tous les ordonnanceurs proposés ainsi que tous les protocoles étudiés. Puis, nous procédons la simulations de tous les scénarios étudiés. Ceci nous permet de valider tous les résultats théoriques obtenus tout au long de ce travail.

Finalement, nous clôturons ce travail avec une conclusion et quelques perspectives.

Introduction

Networks of tiny objects, such as sensor networks, are asynchronous distributed systems formed by small agents (also called objects, entities or devices) with limited resources, memory and computational power and that are able to establish wireless communications. Due to the constrained memory space, agents are usually supposed to be anonymous. They can also be passively mobile having no control of their movement. Once the network is deployed, these objects should communicate and cooperate to reach a global goal. Yet, how to compute in such networks with restricted resources and capacities ?

In this work, we focus on the population protocols, a pairwise computational model introduced by Angluin et al. and designed for such networks [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. In this model, the agents of the network are considered as finite automata with no unique identifiers. They are identically programmed and form a population of a finite but unbounded size. A population protocol computes a given function or predicate of the distributed inputs of the agents, received from their environment. For example, a population protocol running in a population of birds can decide if a given threshold related to the number of sick birds is reached. Computations in this model are based on pairwise interactions. Two agents are able to communicate whenever they come sufficiently close to each other and share a communication link. A communicating pair of agents consists of an initiator and a responder which breaks the symmetry. The two agents exchange their respective current states. Then, each agent updates its state accordingly and with respect to its role and to the transition rules of the protocol. All possible interactions between pair of agents are represented by the directed edges of the interaction graph whose vertices are the agents forming the population.

Population protocols do not halt but only stabilize. Stabilization is reached when the outputs of the agents converge after some finite time to a correct value. Stabilization is a global property of the population that agents usually do not detect. In fact, the only knowledge that an agent may have is a local one consisting of its own state. Consequently, even when the protocol stabilizes, the pairwise interactions do not stop. The computational power of the population protocol model was characterized to be exactly the Presburger arithmetic [START_REF] Angluin | Stably computable predicates are semilinear[END_REF][START_REF] Angluin | The computational power of population protocols[END_REF]. Most of the studies that were interested in this model dealt with the enhancement of its computational power. They proposed to extend this model either by adding states to the communication links which is the case of the mediated population protocols [START_REF] Chatzigiannakis | Mediated population protocols[END_REF], or by allowing more memory to the agents such as the PALOMA model [START_REF] Chatzigiannakis | Passively mobile communicating machines that use restricted space[END_REF], etc, in order to obtain more powerful models. However, in this work, we focus on another aspect of this model: the interaction model of the population protocols.

A pairwise interaction in a population protocol is represented as an abstract simultane-ous bidirectional exchange between the communicating pair of agents. A similar concept of abstract pairwise communication is used in the model of tasks with graph relabeling systems [START_REF] Litovsky | Checking global graph properties by means of local computations: the majority problem[END_REF][START_REF] Litovsky | On the recognition of families of graphs with local computations[END_REF]. This model represents a distributed system as a labeled graph, and a distributed algorithm executed in this system as a sequence of relabellings of the corresponding graph. This model belongs, as the population protocols, to local computations systems. In this thesis, we propose to investigate the correspondences between these models and the possibility of establishing a bridge between both of them.

Assuming abstract communication in a computational model designed for networks such as sensor network is a theoretical hypothesis. Thus, it becomes interesting to describe the pairwise bidirectional exchange through a less theoretical communication model using only minimalistic assumptions. Consequently, representing a population as an anonymous asynchronous system based on message passing and with port numbering is a suitable choice. A population protocol corresponds consequently to a distributed algorithm based on message passing running in this system.

We also focus on another aspect of the execution of a population protocol which is the scheduling. A scheduler is the entity responsible for the choice of the interacting pairs: it picks pair of agents that are adjacent in the interaction graph. A scheduler should satisfy the fairness property to guarantee a fair execution of the protocols. A scheduler designed for population protocols should also be probabilistic to describe the unpredictable interaction pattern in the population caused by the mobility and the asynchrony of the agents. All the schedulers proposed for the population protocols are probabilistic central (also called sequential) schedulers: at each computation step of a protocol, they allow to only one pair of agents to communicate. As populations are distributed systems, where there is no centralized control, a distributed scheduler is more fitted to capture the concurrent interactions as it is able to pick more than one interacting pair at each computation step. We thus propose to introduce a new probabilistic fair scheduler for population protocols which is distributed.

The fairness of the schedulers does not guarantee their equivalence [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF]. Hence, we propose to investigate how the proposed distributed scheduler affects the stabilization time of some protocols compared to the Random Scheduler of Angluin et al. [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. We also consider that enabling the proposed scheduler to take into account the states of the agents may allow introducing termination in population protocols. We even think that this may lead to faster computations of some protocols as agents that reach some specific states are not picked any more for interactions. Introduction existing differences, between these two models. Based on this comparative study, we propose a mapping approach. We prove that the computation of a (mediated) population protocols can always be mapped to a realization of a task with a graph relabeling system. However, the reverse is not true. In fact, only a realization of a task with a graph relabeling system whose relabeling rules are limited to LC0 computations with no forbidden contexts or priorities and whose labellings are of constant size can be mapped to a computation of (mediated) population protocols.

Mapping Population Protocols to Distributed Algorithms in Anonymous

Asynchronous Systems based on Message Passing. We establish a comparative study of the population protocol model (that holds for any model extending as long as it preserves the pairwise interaction concept) and the anonymous asynchronous message passing model. In fact, we consider that using an abstract communication model for such networks of tiny objects is a theoretical assumption. Accordingly, we propose a mapping approach that describes the computation of a population protocol as a distributed algorithm based on message passing in an anonymous asynchronous system with port numbering. Port numbering is the minimalistic knowledge that we should afford to go from abstract communication to explicit one. The bidirectional and simultaneous pairwise interaction in the protocol is described by two phases in the corresponding algorithm: a synchronization phase, then a simultaneous send and receive phase.

By combining these two mapping approaches with some existing works, we establish a bridge between these three models that offers the possibility of describing each model with another.

3. The Random Scheduler Algorithm. Based on the previous contribution, we propose an anonymous distributed algorithm with message passing that encodes the Random Scheduler. This algorithm is designed to run in complete interaction graphs. This contribution is an enhancement of a result that we published in [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF].

4. The Handshake Scheduler. We introduce a new probabilistic scheduler based on randomized handshakes. We call it the Handshake Scheduler and also denote it the HS Scheduler. Unlike the proposed schedulers for population protocols that are sequential, this scheduler is 1-central. Consequently, it allows to more than only one interaction to take place at a computation step as long as the interacting pairs of agents are disjoint. Inspired from the existing randomized rendezvous algorithms, we propose an algorithm for this HS Scheduler. We present the analysis of this algorithm based on which we prove that the HS Scheduler is a probabilistic consistent fair scheduler with probability 1. This contribution appeared in [START_REF] Ouled Abdallah | A totally distributed fair scheduler for population protocols by randomized handshakes[END_REF].

Time Equivalence:

The Random Scheduler and the HS Scheduler. We investigate the time equivalence of the Random Scheduler and the HS Scheduler with respect to three protocols: the OR population protocol, the Leader Election and the Maximal Matching. We present theoretical analyses of the stabilization time of these protocols when assuming two scenarios of scheduling: the first under the Random Scheduler, and the second under the HS Scheduler. We also consider different topologies of the interaction graph: either a complete graph, or a random graph. We prove that the Random Scheduler and the HS Scheduler are time equivalent with respect to these three protocols when running over a complete interaction graph. However, in a random interaction graph, we prove that each of these protocols stabilizes faster when running under the HS Scheduler.

6. The Protocol Aware HS Scheduler. We propose the model of population protocols with some local termination detection. This model extends a subclass of the populations protocols (and of the models extending them) with a local termination detection function enabling an agent to detect that its state is final. We then propose a new probabilistic distributed scheduler which is protocol aware: the Protocol Aware HS Scheduler. This is a slightly modified version of the HS Scheduler that allows agents with final states to stop participating in the protocol's computation and terminate. Consequently, the tiny agents avoid consuming their limited resources in ineffective interactions. We prove that this scheduler is fair with probability 1.

We also present some upper bounds of the stabilization time of the Leader Election and the Maximal Matching protocols running under this scheduler. We prove that the computations of these protocols under this scheduler stabilize faster compared to a scheduling under the Random Scheduler or the HS Scheduler. A part of this contribution appeared in [START_REF] Ouled Abdallah | A totally distributed fair scheduler for population protocols by randomized handshakes[END_REF].

Some of these results were submitted to the journal of Mathematical Structures in Computer Science and are still under review.

Organization of the Document

We start this dissertation by a preliminary section (Chapter 1) presenting some basic tools and concepts related to: distributed systems and algorithms, graph theory, mathematics and probability theory, that the reader may need to better understand what will follow in this work.

Then, in Chapter 2, we introduce the population protocol model as proposed by Angluin et al. We give the formal definition of this model and present the result of Angluin et al. related to its computational power. We then give an overview of the existing variants of this model , such as the One Way population protocols that restrict the bidirectional pairwise interactions to unidirectional ones. We also present the models that extend the population protocols, by assigning states to the edge, or by allowing more memory space for the agents, etc.

Chapter 3 consists of two parts. In the first part, we present the model of tasks with graph relabeling systems which, as the population protocols, belongs to local computation systems and uses abstract communications. We then establish the comparative study and the mapping approach of population protocols to tasks with graph relabeling systems and vice versa. It describes the possibility, or not, of representing each of these two models with one another.

Then, in the second part of this chapter, we present the anonymous asynchronous message passing model. We describe the existing methods of port numbering in literature. Then we introduce the comparative study and the mapping approach of a population protocol to a distributed algorithm running in an anonymous asynchronous system based Introduction on message passing with port numbering.

We conclude this chapter by establishing a bridge between these three models: population protocols, tasks with graph relabeling systems and anonymous asynchronous message passing.

In Chapter 4, we focus on the scheduling of the interactions in distributed systems, and more precisely in population protocols. We give an overview of the existing schedulers as well as the fairness conditions presented in this context of population protocols. We propose an algorithm that encodes the Random Scheduler in a complete graph. We then introduce the HS Scheduler. As it is based on randomized handshakes, we give an overview of the existing randomized handshake algorithms. We then propose the HS Scheduler algorithm that we analyze to prove the fairness of this scheduler.

We compare our proposed scheduler with the Random Scheduler. Both are protocol oblivious fair schedulers. However, are they time equivalent? We investigate this equivalence in Chapter 5 with respect to three different protocols running under these two schedulers over different interaction graph structures. The established results are as described in contribution 5. We conclude this chapter with a table representing the result of the analysis of the stabilization time of each protocol for each scheduling scenario.

In Chapter 6, we present the model of halting population protocols introduced by Michail et al [START_REF] Michail | Terminating Population Protocols via Some Minimal Global Knowledge Assumptions[END_REF]. We focus on the halting Leader Election protocol with absence detector. We study its stabilization time when its computation takes place under the Random Scheduler, and then under the HS Scheduler.

We then propose to extend a subclass of population protocols (and the models extending it), with a local termination detection that enables each agent to detect if it reached a final state. A final state is an irreversible state that does not appear in effective transition rules. We then introduce contribution 6 related to the Protocol Aware HS Scheduler. We conclude this chapter with a table representing the established results concerning the stabilization time of the studied protocols in different scheduling scenarios.

We present in Chapter 7 the ViSiDiA platform which is a Java framework designed to implement, simulate and visualize distributed algorithms. We enhanced this platform by adding the possibility of automatically generating graphs. Thanks to this platform, we illustrate the mapping approaches we established in Chapter 3. We implement all the proposed schedulers and the studied protocols in this platform. We proceed on simulating all the studied scenarios. This enables us to validate all the theoretical results obtained during this work through simulations.

Finally, we conclude this dissertation and present some directions for possible future works.

Chapter 1 Preliminaries

Distributed Systems and Algorithms

This chapter is an introduction to some basic concepts useful for a better understanding of what is going to be introduced later in this document. In fact, our focus will basically be on population protocols which can be considered as distributed algorithms that run over distributed systems. We hence give an overview of such distributed systems and algorithms. As distributed systems are usually represented by graphs, we introduce some basic concepts of graph theory. We will also proceed all along this work, on analyzing some protocols under different probabilistic scheduling. We do thus need some mathematical and probability theory tools that we also define in this chapter.

Distributed Systems and Algorithms

Distributed Systems

According to Leslie Lamport quotes, "a distributed system is one in which the failure of a computer you did not even know existed can render your own computer unusable". More formally, according to Tel in [START_REF] Tel | Introduction to Distributed Algorithms[END_REF], a distributed system can be described as follows: Definition 1.1. (Distributed System) A distributed system is an interconnected collection of autonomous computers, processes, or processors. These computers, processes, or processors are also called the nodes of the distributed system. Tel considers as autonomous nodes those that have their own private control [START_REF] Tel | Introduction to Distributed Algorithms[END_REF]. In other words, each process should have its own local memory, local program, and local time (no shared global time). To be interconnected, nodes must be able to communicate and exchange information.

There are three basic communication models for distributed systems: the shared memory, the message passing and the local computations. Further details concerning these two latter models will be provided later in this work.

Each process in the distributed system has a set of variables that forms its state, also called local state. Whatever the chosen communication model is, an action is the result of an interaction between processes leading to a modification of at least one of their states and consequently influencing the global state of the system which can be defined as follows:

Definition 1.2. (Configuration (System's Global State))
The set of local states of all the processes of the system forms its global state. A global state of a system is also called a configuration.

A distributed system can be either synchronous or asynchronous. Definition 1.3. (Synchronous vs Asynchronous Systems) In the synchronous model, the processors of the distributed system execute in lockstep: the execution is partitioned into rounds.

However, in case of asynchronous systems, there in no upper bound of the time separating two consecutive computation steps of a processor. Processors run with different speeds.

A distributed system can be anonymous, which is:

1. Preliminaries Definition 1.4. (Anonymous Distributed System) An anonymous system is a system where no unique identities are available to distinguish the different processes.

Anonymity in distributed systems implies symmetry. In fact, processors may play the same role and become identical: there is no way to distinguish them [START_REF] Lavault | Evaluation des algorithmes distribués -Analyse, complexité, méthodes. collection Informatique[END_REF].

Algorithms

Distributed Algorithms Definition 1.5. (Local Algorithm) A local algorithm of a process is an algorithm that runs independently of the number of nodes in the network and whose output is a function of the input of the process as well as the input available within a constant-radius of its neighborhood [START_REF] Suomela | Survey of local algorithms[END_REF][START_REF] Schmid | Algorithmic models for sensor networks[END_REF]. Definition 1.6. (Distributed Algorithm) A distributed algorithm of a collection P = {p 1 , . . . , p n } of processes is a collection of local algorithms, one for each process in P [START_REF] Tel | Introduction to Distributed Algorithms[END_REF].

Definition 1.7. (Deterministic vs Non Deterministic Algorithms) An algorithm is deterministic, if starting from a given input, it always produces the same output. This is not the case for a non deterministic algorithm which, for a given input, may have more than one possible output.

Randomized Algorithms

Lynch [START_REF] Lynch | A hundred impossibility proofs for distributed computing[END_REF] as well as Fisher and Jiang [START_REF] Fich | Hundreds of impossibility results for distributed computing[END_REF] provided some impossibility results in distributed computing that can be caused by the determinism of the solutions, the symmetry of the processes, etc. However, introducing randomization to the solutions and breaking the symmetry can make these distributed problems solvable [START_REF] Lynch | Distributed Algorithms[END_REF].

According to Motwani et al [START_REF] Motwani | Randomized Algorithms[END_REF], a randomized algorithm can be defined as follows:

Definition 1.8. (Randomized Algorithm) A randomized algorithm is an algorithm that uses random numbers to influence the choices it makes during its computation. Thus, its behavior varies from one execution to another even with a fixed input.

Tel also defines a randomized algorithm as a probabilistic (randomized) process that can be modeled by a process that flips a coin at each step it executes [START_REF] Tel | Introduction to Distributed Algorithms[END_REF]. Thus the possible next steps depend on the state of the process as well as on the outcome of the coin flip. Definition 1.9. (Randomized Distributed Algorithm) A randomized distributed algorithm is a collection of probabilistic processes.

Randomized algorithms are non deterministic while non probabilistic algorithms are usually referred to as deterministic ones. However, using non probabilistic algorithms does not guarantee a deterministic behavior of a system. We can consider the case of a distributed non probabilistic algorithm running over an asynchronous system. The order of the events (as the order of the receipt of messages) can vary from one execution to another due to the asynchronism of the system. This can lead to an outcome of the system that differs from one execution to another.

Distributed Systems and Algorithms

Complexity

Analyzing an algorithm consists on defining theoretical estimates for the resources needed by this algorithm to resolve a given computational problem [START_REF] Lavault | Evaluation des algorithmes distribués -Analyse, complexité, méthodes. collection Informatique[END_REF] Definition 1.10. (Time Complexity) The time complexity is the maximal time required by this algorithm for any execution.

If the algorithm is synchronous, the time complexity is the number of rounds needed for the execution of this algorithm.

If the algorithm is asynchronous, this complexity corresponds to the maximal number of unit of times needed in the worst case in a synchronous execution of this algorithm. Definition 1.11. (Message Complexity) In a system based on message passing, the message complexity is measured by the total number of messages exchanged during the execution of an algorithm. Definition 1.12. (Bit Complexity) The total number of bits in the messages of an algorithm is counted by the bit complexity.

In the analysis of a randomized algorithm, which is rather established is bounds on the expected value of a given performance measure [START_REF] Motwani | Randomized algorithms[END_REF]. In [START_REF] Motwani | Randomized Algorithms[END_REF][START_REF] Gupta | On randomization in sequential and distributed algorithms[END_REF][START_REF] Kemény | Finite markov chains[END_REF], some techniques for the design and for the analysis of randomized distributed are presented. One concept that may be encountered in the context of the analysis of such algorithms is: with high probability (w.h.p). Definition 1.13. (With High Probability) An event occurs with high probability if, for any α ≥ 1, the event occurs with probability at least 1 -cα n α , where c α depends only on α.

Since we can choose α , we can make the probability arbitrarily low, at a cost of time and/or space.

In the sequel, with high probability will mean with probability (1 -o( 1 n )), where n represents the size of the network where the distributed algorithm runs.

Termination and Termination Detection

A distributed algorithm designed to compute a given function can implicitly or explicitly terminate. With an implicit termination, an algorithm has a finite execution and reaches a last configuration where each node of the system has the correct output. However, the nodes do not know that they reached the last states of the execution of this algorithm. This not the case when the distributed algorithm explicitly terminates. In fact, the nodes become aware of the termination that can be local or global [START_REF] Godard | Termination detection of local computations[END_REF]. Accordingly, a local detection of a local termination consists on the fact that a node knows that it has locally terminated. While, a local detection of a global termination allows a node with its local knowledge to be aware that all the system terminated.

Designing distributed algorithms with termination detection is still one of the basic issues especially in case of anonymous distributed systems.

Preliminaries

Graph Theory

A graph is a set V of vertices and a set E of edges (V and E are finite sets unless declared otherwise) such that all the endpoints of the edges in E are contained in V [START_REF] Kenneth | Handbook of discrete and combinatorial mathematics[END_REF]. This graph is often denoted

G = (V, E), or (V G , E G ), or (V (G), E(G)).
The topology of a distributed system is usually represented by a graph [START_REF] Tel | Introduction to Distributed Algorithms[END_REF][START_REF] Attiya | Distributed Computing: Fundamentals, Simulations and Advanced Topics[END_REF] where: the set of vertices represents the set of the processes of the system, and the set of edges represent the communication links between the processes. We therefore introduce some notions and terminologies of graph theory that are useful for the study of distributed systems and algorithms. The definitions are basically taken from [START_REF] Kenneth | Handbook of discrete and combinatorial mathematics[END_REF][START_REF] Berge | Graphs and Hypergraphs[END_REF][START_REF] Tel | Introduction to Distributed Algorithms[END_REF][START_REF] Boldi | Fibrations of graphs[END_REF].

We would mention that in the sequel we can use node as a synonym for a vertex and which refers to whatever is modeled by a vertex in a graph model.

Undirected Graphs

Definition 1.14. (Undirected Graphs) An undirected graph G consists of a set of vertices V and a set of edges E such that E is a collection of unordered pairs of nodes from V . Then, for any u and

v from V , (u, v) ∈ E is equivalent to (v, u) ∈ E.
The size of a graph is the cardinality of its set of vertices. In the sequel, it will be denoted n. And the cardinality of the set of its edges will be denoted m. Definition 1.15. (Graphs with no self-loops) A loop or a self-loop is an edge whose both endpoints are the same vertex.

A graph G is with no self-loop if ∀e ∈ E, the extremities of e are two distinct elements of V . Definition 1.16. (Simple Graphs) A simple graph is a graph with no self-loops and where each two vertices are connected by at most one edge.

Definition 1.17. (Subgraph) A subgraph of a graph G = (V G , E G ) is a graph H = (V H , E H )
whose vertex set and edge set are subsets of V G and E G , respectively, such that for each edge e ∈ E H , the endpoints of e (as they occur in G) are in V H .

H is called a spanning subgraph of G if V H = V G . Definition 1.18. (Adjacency)
• An edge e is adjacent with a vertex v if v is an endpoint of e.

• Vertices u and v are adjacent if there is an edge whose endpoints are u and v.

• Two edges are adjacent if they have a common endpoint.

Graph Theory

Definition 1.21. (Path) A path of length k between two vertices v 0 and v k is a sequence P = (v 0 , . . . , v k ) of nodes such that: ∀ i < k, (v i , v i+1 ) ∈ E. v 0 is the begin node in this path, and v k the end node.

A cycle is a path whose end node is the begin node.

G = (V, E) be an undirected graph. M is a matching of G if M = {e ∈ E | ∀e 1 , e 2 ∈ M, if e 1 = (u 1 , v 1 ) and e 2 = (u 2 , v 2 ) then u 1 = u 2 , u 1 = v 2 , v 1 = u 2 and v 1 = v 2 }.
In words, a matching M of G is a set of edges from E such that each two edges from M do not share any vertex. The matching represented in Figure 1.1 is maximal.

Directed Graphs

Definition 1.27. (Directed Graph) A directed graph G (or digraph) is defined by a set V of nodes and a set E (sometimes also denoted A) of arcs, or directed edges, and by two functions s; t : E → V that specify the source and the target of each arc.

We rewrite some of the definitions presented above adapted to the context of directed graphs.

Definition 1.28. (Neighborhood) In a digraph G = (V, E), an arc (u, v) from E is called an outgoing edge of u and an incoming edge of v. u is called an out-neighbor of v and v is an in-neighbor of u.

Preliminaries

Definition 1.29. (Degree)

• The in-degree of a node v, denoted d -(v), is the number of its incoming edges.

• The out-degree of a node v, denoted d + (v), is the number of its outgoing edges.

• The degree d of a node equals the sum of its in-degree and out-degree.

Definition 1.30. (Connectivity)

• A directed graph G is strongly connected if ∀u, v ∈ V , there is a path between u and v in G.

• A directed graph is weakly connected if, by replacing all of its directed edges with undirected edges, we obtain a connected undirected graph.

Definition 1.31. (Symmetric Graphs) A symmetric directed graph (V, A, s, t) is a digraph endowed with a symmetry, that is, an involution Sym : A → A such that ∀a ∈ A, we have: Different random graph models produce different probability distributions on graphs. We focus on a commonly studied one: the Erdős-Rényi G n,p model. Definition 1.39. (G n,p Graph) A G n,p graph is a random graph of n vertices that includes each possible edge independently with probability p (and so, the edge is not included with probability q = 1 -p).

s(a) = t(Sym(a)). v 1 v 4 v 2 v 3
((v 1 , v 2 )) = (v 4 , v 1 ), Sym((v 2 , v 3 )) = (v 1 , v 2 ), Sym((v 3 , v 4 )) = (v 2 , v 3 ) and Sym((v 4 , v 1 )) = (v 3 , v 4 ).

Graphs Topologies

Probability Theory

We recall in this section some concepts related to the probability theory and that are going to be useful later for algorithms analysis. These definitions are basically taken from [START_REF] Kenneth | Handbook of discrete and combinatorial mathematics[END_REF] and [START_REF] Motwani | Randomized Algorithms[END_REF]. The events E 1 , E 2 , E 3 , . . . are pairwise disjoint if every pair E i , E j of distinct events are disjoint. Definition 1.47. (σ-Field) Let Ω be a sample space. A σ-field (or σ-algebra) F of Ω consists of a collection of subsets of Ω satisfying the following conditions:

1. ∅ ∈ F. 2. If E ∈ F, then E ∈ F. 3. If E 1 , E 2 , . . . ∈ F, then E 1 ∪ E 2 , ∪ . . . ∈ F.
(Ω, F) is called a measurable space.

Preliminaries

Definition 1.48. (Probability Measure) Given a measurable space (Ω, F), a probability measure Pr: F → [0, 1] is a function that satisfies the following conditions:

1. Pr(Ω) = 1.

Pr(

∞ i=1 E i ) = ∞ i=1
Pr(E i ), if the events {E i } are pairwise disjoint. Definition 1.49. (Probability Space) A probability space (Ω, F, Pr) consists of a measurable space (Ω, F) with a probability measure Pr defined on it.

Proposition 1.1. Let E be an event, then

Pr(E) = 1 -Pr(E).
Proposition 1.2. (Principle of inclusion-exclusion: the simple form) For any events E and F ,

Pr(E ∪ F ) = Pr(E) + Pr(F ) -Pr(E ∩ F ). Proposition 1.3. (Booles inequality) If E 1 , E 2 , . . . , E n are events, then Pr n i=1 E i ≤ n i=1
Pr(E i ).

Dependence and Independence

Definition 1.50. (Independence) Two events E and F are independent if:

Pr(E ∩ F ) = Pr(E) Pr(F ).
The n events E 1 , E 2 , . . . , E n are independent if: ∀ k such that 2 ≤ k ≤ n, and for j 1 , j 2 , . . . , j k with 1 ≤ j 1 < j 2 < . . . < j k ≤ n, we have:

Pr(E j 1 ∩ E j 2 ∩ . . . ∩ E j k ) = Pr(E j 1 ) Pr(E j 2 ) . . . Pr(E j k ).
Definition 1.51. (Conditional Probability) Given two events E and F with Pr(F ) > 0, the conditional probability of E given F is defined as,

Pr(E|F ) = Pr(E ∩ F ) Pr(F )
.

Proposition 1.5. (Law of total probabilities) For any event E and any partition of

Ω into events F 1 , F 2 , . . . , F n , Pr(E) = n i=1 Pr(E ∩ F i ) = n i=1
Pr(E|F i ) Pr(F i ).

Probability Theory

Proposition 1.6. (Chain Rule) For any events E 1 , E 2 , . . . , E n satisfying:

Pr( n-1 i=1 E i ) > 0,
we have:

Pr(E 1 ∩ E 2 ∩ E 3 . . . ∩ E n ) = Pr(E 1 ) Pr(E 2 |E 1 ) Pr(E 3 |E 2 ∩ E 1 ) . . . Pr(E n | n-1 i=1 E i ).
F X (x) = Pr(X ≤ x).
Definition 1.54. (Density Function) The density function of a random variable X is

p X (x) = Pr(X = x). Definition 1.55. (Expected Value) The expected value (mean) E of a discrete random variable X is given by E(X) = x x Pr(X = k)
, where the summation is over the range of X.

Proposition 1.7. (Linearity of the Expectation) Let X 1 , X 2 , . . . , X n be random variables, and a 1 , a 2 , . . . , a n reals. Then,

E(a 1 X 1 + a 2 X 2 + . . . + a n X n ) = a 1 E(X 1 ) + a 2 E(X 2 ) + . . . + a n E(X n ).
Proposition 1.8. (Iterated Expectation) Let X and Y be two random variables, then:

E(X) = E(E(X|Y )).

Probability Distributions

We now introduce some distributions that we are going to use later and describe their corresponding properties [START_REF] Motwani | Randomized Algorithms[END_REF].

Bernoulli Distribution

We suppose that we flip a coin for which p is the probability of obtaining heads. Let X be the random variable whose value is 1 if the result is heads, and 0 otherwise. Then, X has the Bernoulli distribution with the parameter p.

Definition 1.56. (Bernoulli Distribution) A Bernoulli trial with parameter p, with 0 ≤ p ≤ 1, is a random experiment with exactly two possible outcomes: either success whose probability is p, or failure whose probability is q = 1 -p.

Proposition 1.9. If the random variable X has the Bernoulli distribution with the parameter p, then E(X) = p.

Preliminaries

Binomial Distribution

We consider n independently and identically distributed random variables X 1 , X 2 , . . . , X n whose common distribution is the Bernoulli distribution with parameter p. Let X = X 1 + X 2 + . . . + X n be the random variable denoting the number of heads in a sequence of n coin flips. Then, X has a binomial distribution with parameter n and p, abbreviated B(n, p).

Definition 1.57. (Binomial Distribution) Let X denotes the number of successes of a Bernoulli trial, with parameter p, repeated n times. The Binomial distribution B(n, p) corresponds to the distribution of X.

Proposition 1.10. Let k be an an integer with 0 ≤ k ≤ n, then the random variable X with the binomial distribution B(n, p) has the following density function:

Pr(X = k) = n k p k q n-k .
Also, the expected value of the number of successes is:

E(X) = np.

Geometric Distribution

We repeat now the experiment of flipping a coin until head appears for the first time. We assume that each coin toss has the Bernoulli distribution with parameter p. Let X be the random variable that denotes the total number of coin flips. Then, X has the geometric distribution with parameter p.

Definition 1.58. (Geometric Distribution) Let consider a Bernoulli trial repeated until the first success is obtained. Let X denotes thus the number of trials. Then, X has the geometric distribution.

Proposition 1.11. The probability of having k failures before the first success is

Pr(X = k) = (1 -p) k p.
And, the expected value of X is

E(X) = 1 p .

Mathematical Tools

We provide in this section some elementary mathematical materials such as the asymptotic notation, approximations for binomial coefficients,. . . whose definitions are basically from [START_REF] Motwani | Randomized Algorithms[END_REF]. These tools are required later especially for the analyses of randomized protocols.

1.4. Mathematical Tools

Notation for Asymptotics

Definition 1.59. For any two functions f and g: R → R + , we say that:

• f (n) = O(g(n)
), and say that f is asymptotically at most g, if there exist positive numbers c and N such that, ∀n ≥ N, f (n) ≤ c g(n).

• f (n) = Ω(g(n)), and say that f is asymptotically at least g, if there exist positive numbers c and N such that,

∀n ≥ N , f (n) ≥ c g(n). Thus, f (n) = Ω(g(n)) if g(n) = O(f (n)). • f (n) = Θ(g(n)
), and say that f is asymptotically the same as g, if

f (n) = O(g(n)) and f (n) = Ω(g(n)). • f (n) = o(g(n)) if lim n→∞ f (n)/g(n) = 0.
We say that f is asymptotically strictly smaller than g.

• f (n) ∼ g(n) if lim n→∞ f (n)/g(n) = 1.

Combinatorial Inequalities

We start by defining the binomial coefficients as follows:

Definition 1.60. (Binomial Coefficients) Let n ≥ k ≥ 0, then n k = n n -k = n! k!(n -k)! .
If k > n > 0, then n k = 0. The binomial coefficients owe their name to their appearance in the binomial expansion:

(p + q) n = n k=0 n k p k q n-k .
We now introduce the following power series expansions.

Proposition 1.12. ∀x,

e x = 1 + x + x 2 2! + x 3 3! + . . . Proposition 1.13. ∀x, ln(1 + x) = x - x 2 2 + x 3 3 - x 4 4 . . .
∀ n ∈ N, the nth Harmonic number H n is defined as follows :

Definition 1.61. (Harmonic Number) ∀ n ∈ N, the Harmonic number is:

H n = 1 + 1 2 + 1 3 + . . . + + 1 n .

Preliminaries

Proposition 1.14. For any n ∈ N, the nth Harmonic number is

H n = ln(n) + Θ(1).
We also consider the inequality involving the harmonic, geometric and arithmetic means: Proposition 1.15. Let n ≥ 1, and let (x 1 , x 2 , . . . , x n ) positive real numbers. Then we have:

n n k=1 1 x k ≤ n k=1 x k 1 n ≤ 1 n n k=1
x k .

Markov Chains

We introduce concepts related to the Markov chains, based on studies in [START_REF] Motwani | Randomized Algorithms[END_REF][START_REF] Kemény | Finite markov chains[END_REF][START_REF] Williams | Probability with Martingales[END_REF].

Definition 1.62. (Stochastic Process) A stochastic process is simply a collection of random variables indexed by time.

Definition 1.63. (Filtration) Let F be a σ-field. A filtration (F n ) n≥0 is an increasing family of sub-σ-algebras of F such that:

F 0 ⊆ F 1 ⊆ F 2 . . . ⊆ F.
Definition 1.64. (Adapted Process) A process X = (X n ) n≥0 is called adapted to the filtration (F n ) if, for each n, X n is F n -measurable.

Definition 1.65. (Markov Property) Let (Ω, F, Pr) be a probability space with a filtration (F s , s ∈ I) for some (totally ordered) index set I, and let (S, S) be a measurable space. A (S, S)-valued stochastic process X = (X t , t ∈ I) adapted to the filtration is said to possess the Markov property if, for each A ∈ S and each s, t ∈ I with s < t Pr(X t ∈ A|F s ) = Pr(X t ∈ A|X s ).

In the case where S is a discrete set with the discrete σ-algebra and I = N, this can be reformulated as follows:

Pr(X n = x n |X n-1 = x n-1 , . . . , X 0 = x 0 ) = Pr(X n = x n |X n-1 = x n-1 ), ∀n ∈ N.
Definition 1.66. (Discrete-time Markov Chain) A discrete-time Markov chain is a sequence of random variables X 1 , X 2 , X 3 , ... with the Markov property, that is:

Pr(X n = x n |X n-1 = x n-1 , . . . , X 0 = x 0 ) = Pr(X n = x n |X n-1 = x n-1 ), ∀n ∈ N.
A Markov chain M is thus a discrete-time stochastic process defined over a set of states S, which is the possible values of X i with of a matrix P of transition probabilities. The transition probability matrix P has one row and one column for each state in S. The

Conclusion

Markov chain is in one state at any time, making state-transitions at discrete time-steps t = 1, 2, . . ..

The probability that the next reached state is j, knowing that the current one is i, is P ij in the transition probability matrix. Accordingly, ∀ i, j ∈ S, we have 0 < P ij < 1, and j P ij = 1.

Satisfying the Markov property implies the memorylessness of a Markov chain. In fact, only the current state of a Markov chain, and not how it reached it, influences its future behavior.

Martingales

We here introduce the martingales, super-martingales and sub-martingales. The following definitions are basically taken from [START_REF] Williams | Probability with Martingales[END_REF].

Definition 1.67. (Martingale, Super-martingale and Sub-martingale) A process X is called a martingale (relative to (F n , Pr)) if:

1. X is adapted. 2. ∀n, E(|X n |) < ∞. 3. E(X n |F n-1 ) = X n-1 , with n ≥ 1.
A super-martingale satisfies the same conditions except the third one, which replaced by the following:

E(X n |F n-1 ) ≤ X n-1 , with n ≥ 1.
Also, a sub-martingale is defined similarly by maintaining the first and second conditions and replacing the last one by:

E(X n |F n-1 ) ≥ X n-1 , with n ≥ 1.

Chernoff Bound

In the following definition, we present one of the possible forms of the Chernoff Bound usually useful in establishing upper bounds of randomized algorithms with high probability [START_REF] Kemény | Finite markov chains[END_REF].

Definition 1.68. (Chernoff Bound) Let X be the sum of n independent random variables each of which is 1 with probability p and 0 with probability 1 -p. Hence, X has a binomial distribution B(n, p) and E(X) = np. Then:

∀ 0 < a < np, Pr(|X -E(X)| > a) ≤ 2e -a 2 /3np .

Conclusion

We introduced in this chapter some basic concepts related to: distributed systems and algorithms, graph theory, mathematical and probability theory. These concepts are going to be used in the study and the analyses of the population protocols that can be considered as distributed algorithms running under probabilistic schedulers. This model of population protocols is going to be introduced in the chapter that follows.

Chapter 2

The Population Protocols

The Population Protocols

We are interested in the population protocol model, a computational one introduced by Angluin et al. in [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. This model was designed for networks of tiny artifacts, such as sensor networks, that are passively mobile finite state machines. With no control of their movement, and with limited memory resources, these artifacts cooperate by establishing pairwise interactions to compute some function of their distributed entries.

We present in this chapter the formal definition of this model and the characterization of its computational power. We then give an overview of its variants: the one way population protocols that restrict the interactions to one way [START_REF] Angluin | On the power of anonymous one-way communication[END_REF], the network graphs protocols that are designed to study graph properties of the network formed by these artifacts [START_REF] Angluin | Stably computable properties of network graphs[END_REF], and the fast population protocol that assume the existence of an already elected leader in the population where the protocol runs [START_REF] Angluin | Fast computation by population protocols with a leader[END_REF].

We also present models that extend the population protocols. The extension can consist on assigning states to the communication links which corresponds to the mediated population protocols [START_REF] Chatzigiannakis | Mediated population protocols[END_REF]. Or, it can consist on attributing more memory space to the agents as it is the case for the passively mobile machines protocols [START_REF] Chatzigiannakis | Passively mobile communicating machines that use restricted space[END_REF]. The community protocols also extend the population protocols by attributing a distinguished identity to each artifact [START_REF] Guerraoui | Names trump malice: Tiny mobile agents can tolerate byzantine failures[END_REF].

The Population Protocols

Angluin et al. introduced the population protocol model in 2004 [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. It is a pairwise computational model designed for anonymous, passively mobile, finite state agents forming populations of finite but unbounded sizes. A population protocol executed in a population can compute a function or a predicate of distributed entries gathered from the environment of this population. Each agent of this population considers its entry as an input which is then mapped to a state according to an input function. Thereafter, interactions between pairs of agents can take place. Any two interacting agents communicate to each other their respective states and update them according to a defined transition function of the protocol. These pairwise interactions never stop, but the result of the computation of the population protocol can be retrieved from the outputs of the agents once this protocol stabilizes.

A more formal description of this model as well as a characterization of its computational are presented in this section.

The Population Protocol Model

Angluin et al. define a population P as a finite set of n agents (with n ≥ 2) that can establish pairwise communications [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. Two agents are able to interact if they share a communication link. An interaction graph G = (A, E), also called communication graph, is associated to the population P, with E ⊆ A × A the set of directed edges representing all permissible interactions between pairs of agents. The interaction graph G can not contain self-loops or multi-edges.

Formally, a population protocol that can run in a population P is described as follows [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]:

The Population Protocols

Definition 2.1. (Population Protocol) A population protocol A consists of a 6-tuple (X, Y, Q, I, O, δ), where:

• X: a finite input alphabet,

• Y : a finite output alphabet,

• Q: a finite set of states,

• I: X → Q: an input function mapping inputs to states,

• O: Q → Y : an output function mapping states to outputs,

• δ: Q × Q → Q × Q: a transition
function defined on pairs of states as a set of transition rules. If δ(q u , q v ) = (q u , q v ), then: (q u , q v ) → (q u , q v ) is called a transition, and δ 1 (q u , q v ) = q u , and δ 2 (q u , q v ) = q v are defined.

The transition function δ is not symmetric. Consequently, δ(q u , q v ) is not necessarily equal to δ(q v , q u ). This is due to the fact that, for an interacting ordered pair of agents (u, v) with states (q u , q v ), each agent plays a distinguished role: u is the initiator, while v is the responder (or also called receiver). This is a fundamental assumption for asymmetry for the population protocol model. Such possible interaction is represented by the directed edge (u, v) in the set of edges E of the interaction graph. Now, let A=(X, Y, Q, I, O, δ) be a population protocol. Let P be a population consisting of the finite set A of agents and whose interaction graph is G = (A, E). Running the protocol A in the population P can be described as follows according to Angluin et al. [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]: Initially, all agents receive their inputs from their environment. In case of sensor networks, these inputs represent the sensed values of a fixed parameter such as: temperature, humidity, etc. The inputs are described by the alphabet X. This initialization corresponds to the input assignment x which is a function such that: x : A → X.

Thereafter, all inputs are mapped to states from Q according to the input function I. The set of resulting states forms the initial configuration C 0 of the population P. As introduced in [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF], a population configuration is a snapshot of the states of the agents forming the population. A more formal definition can be as follows: Definition 2.2. (Population Configuration) A configuration of the population P where the protocol A runs, is a mapping C: A → Q that specifies the corresponding state of each agent of this population.

Once states are attributed, interactions between pairs of agents can take place. If two agents are able to interact, they establish a two-way communication. They hence exchange their respective states and update them according to the transition function δ. If this update leads to a modification of at least one of the two states, then the population transitions from the current configuration to a new one. Definition 2.3. (Transition) Let C and C be population configurations, and let u and v be distinct agents. We say that C goes to C via an encounter e = (u, v) ∈ E, denoted C e → C , if:

2.1. The Population Protocols -C (u) = δ 1 (C(u), C(v)), -C (v) = δ 2 (C(u), C(v)) and, -C (w) = C(w) for all w ∈ A {u, v} .
C is the configuration resulting from the interaction between the pair of agents u and v on the configuration C.

We say that C goes to C in one step, denoted

C → C , if C e → C for some encounter e ∈ E. C → C is called a transition.
Starting from a configuration C, the configurations that can be reached by the population P after some (one or more) transitions are called reachable configurations.

: C 0 , C 1 , . . ., C i , . . ., such that: ∀i, C i → C i+1 .
An infinite execution is fair if for every possible transition C → C , if C occurs infinitely often in the execution, then C also occurs infinitely often.

A computation is an infinite fair execution.

We can deduce from the definition of a computation that a population protocol does not halt and that the pairwise interactions never stop. Nevertheless, a population protocol can stabilize (converge). Stabilization is reached once the outputs stop changing: this is called output stabilization. Definition 2.6. (Output Stabilization) A population protocol A reaches outputstabilization when its computation leads to a configuration C such that, for any

C reachable from C, O(C) = O(C ) and consequently, ∀ u ∈ A, O(C(u)) = O(C (u)).
The output assignment of a configuration C is a function y

C : A → Y defined as y C (u) = O(C(u)), ∀ u ∈ A.
In other words, a population protocol reaches outputstabilization if, it reaches a configuration C such that: for any configuration C reachable from C, C and C have the same output assignment. The configuration C is called an output-stable configuration.

Stabilization is a global property of the population that agents, based on their limited knowledge (which consists of their own states), can not detect. Hence, they continue interacting. However, whatever the interactions that take place are, the outputs do not change.

If the computation of the protocol does not converge, the output of this computation is said undefined.

There is a particular case of output stabilization, which is state stabilization [START_REF] Michail | New Models for Population Protocols[END_REF].

The Population Protocols

Definition 2.7. (State Stabilization) A population protocol A state-stabilizes, or has stabilizing states, if any computation of A eventually reaches a configuration C such that: for every configuration C reachable from C, C = C. The configuration C is a state-stable configuration.

State stabilization is a stronger requirement compared to output stabilization. Any protocol that state-stabilizes also output-stabilizes, however the inverse is not always true. We would also mention that eventually means in a finite number of steps , that depend on the choice of the encounters during transitions. We will explore this in details in Chapter 5.

Angluin et al. focused on always-convergent population protocols only. A protocol

A is always-convergent if every computation on every input assignment x converges.

Let X = X A denote the set of all input assignments of the population protocol A. And, let Y = Y A denote the set of all its output assignments.

Let R A be a relation. ∀x ∈ X , ∀y ∈ Y, R A (x, y) holds iff there is a computation of A beginning in configuration C x , where C x (w) = I(x(w)) for all agent w ∈ A, that stabilizes to output y. We say that the population protocol A running in the population P stably computes the input-output relation R A . Now, if the relation R A is a single-valued relation, and more specifically a predicate, then a definition of its stable computation can be as follows:

Definition 2.8. (Stably Computable Predicate) Let p : X → {0, 1} be a predicate over X . p is said to be stably computable by the population protocol model A if for any input assignment x ∈ X , any computation of A starting from I(x) eventually reaches an output stable configuration C where, for all agents w, O(C(w)) = p(x).

That is, when a population protocol A stably computes a predicate p, it stabilizes to an output stable configuration in which all agents agree about a correct answer which is the output of p(x), consequently 0 or 1.

According to the description of the population protocol model, we can notice that these protocols have two main characteristics that are:

-Anonymity: The design of a population protocol does not depend on the identities of the agents. In fact, these agents are supposed to be equipped with a constant memory space. Consequently, they do not have enough memory space to store identities: they are hence anonymous.

-Uniformity: The design of a population protocol does not depend on the population size.

To better illustrate the computation of a population protocol, we consider now as an example the scenario of the flock of birds. This scenario was introduced by Angluin et al. in [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF].

Example 2.1. The Threshold Protocol. We consider a population of birds where each one is equipped with a sensor to measure its temperature. A bird is supposed to have an elevated temperature if this last is higher than a defined constant c. The sensors are also equipped with wireless media that enable them to form an ad-hoc network. They 2.1. The Population Protocols communicate and exchange data to provide the monitor of this flock of birds with some information about the global state of this flock. Let us consider the following question: are there at least five birds with elevated temperatures? If yes, an alert of a possible epidemic should be launched. Thus, let N SB denote the size of the set of sick birds (those having elevated temperatures). The question can then be reformulated to the following predicate: N SB ≥ 5.

The authors proposed the population protocol T hreshold, that once run in the monitored population, provides the answer to this question. This protocol is described by the 6-tuple (X, Y, Q, I, O, δ) with:

• X = Y = {0, 1},
• Q = {q 0 , q 1 , q 2 , q 3 , q 4 , q 5 },

• I(i) = q i , • O(q i ) = 0, if 0 ≤ i ≤ 4 1, otherwise.
• δ(q i , q j ) = (q i+j , q 0 ), if 0 ≤ i + j < 5 (q 5 , q 5 ), otherwise.

The computation of this protocol begins at a global start signal. Each sensor measures the temperature of the bird carrying it. The result of this measurement is described with the input alphabet and should consequently be as follows: 1 if the temperature is elevated, and 0 otherwise. Each agent (sensor) maps its input according to the input function I such that: I(1) = q 1 and I(0) = q 0 . Pairwise interaction can then take place. Each two communicating sensors exchange their states and update them according to δ. If the sum of both states is less than 5, then the state of the initiator is updated to this sum, while the state of the responder is reinitialized to q 0 . Otherwise, they both become with state q 5 . This protocol stabilizes if we wait a sufficient interval after the global signal start. If there are at least five birds with elevated temperatures, the state q 5 will appear and will be spread among the whole population. Hence, all the agents, being with state q 5 , will output 1 which corresponds to a "yes" answer to the asked question (and to "true" as a value of the threshold predicate). However, if the number of birds with elevated temperatures is less than 5, the state q 5 will never appear and all the agents will output 0 which corresponds to a "no"answer (or "false" as a value of the predicate). The correct answer can be retrieved from any sensor of the population.

Computational Power

The computational power of the population protocols was characterized in [START_REF] Angluin | Stably computable predicates are semilinear[END_REF][START_REF] Angluin | The computational power of population protocols[END_REF] to be exactly the Presburger Arithmetic. The Presburger arithmetic, also defined as semi-linear predicates, is the first-order theory of natural numbers with addition and no multiplication [START_REF] Presburger | Über die vollständigkeit eines gewissen systems der arithmetik ganzer zahlen, in welchem die addition als einzige operation hervortritt[END_REF]. It is a restriction of Peano's arithmetic where all the axioms for multiplication are removed.

According to [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF], a Presburger formula can be expressed as a Boolean formula over predicates that can be described by one of the following three forms:

Restricted Communication Graph

Angluin et al. initially supposed that population protocols run in populations of agents that are passively mobile and that, consequently, each pair of agents will eventually meet and interact. Thus, they assumed that the interaction graphs are complete so that all pairs interactions are permissible. Hence, the computational power of population protocols was characterized for those running over complete interaction graphs. Yet, the authors proved in [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF] that, as long as the interaction graph is still connected, restricting the interactions does not affect the computational power of the population protocols. In fact, any predicate that is stably computable in a complete interaction graph is also stably computable in any weakly-connected interaction graph.

Variants of the Population Protocol Model

In the sequel, we are going to present three variants of the population protocol model also proposed by Angluin et al. The first restricts the bidirectional communication to unidirectional ones. The second, is a slightly modification of the original model that focuses on network graphs properties. The last one supposes the existence of an already elected leader in the population.

We should mention that for these variants the condition of stable computation does not require anymore that all agents output 0 or 1. It suffices that the output satisfies some specified requirement that depends on the protocol and that can be for example: only one agent outputs 1, while all the rest output 0.

One Way Population Protocols

The population protocol model supposes that the communication between a pair of interacting agents is bidirectional and simultaneous. This model may sometimes be unrealistic for some networks with radio communications.

Thus, Angluin et al. proposed in [START_REF] Angluin | On the power of anonymous one-way communication[END_REF] the one way population protocols. They are a modified version of the population protocols where the communications are not bidirectional anymore but only one way. An interaction is hence split into separate send and receive events, and the transition function is also restricted. In fact, given an interacting pair, the responder changes its state according to the received state of the initiator. However the state of the initiator, if it is updated, will not depend on that of its responder as it does not know it.

There are different versions of the one way population protocols model. An initiator may be able to detect that it has sent a message and accordingly changes its state. This

Variants of the Population Protocol Model

is called the transmission model. However, in the observation model, the sender is not able to detect this event and then becomes unable to change its state. In this case, the sender is passively observed by the receiver.

Also, in the one way population protocol model, the delivery can be immediate so that the send and receive events happen simultaneously, as it can be delayed (or queued) where the send and receive may imply delayed messages.

An example of a one way population protocol follows.

Example 2.2. The 3-States Approximate Majority Protocol. Suppose that in a given population P there are two candidates, x and y, for some election. Some agents of the population may decide to vote for x, others may choose y, while the rest of the population may be undecided and can choose to vote blank. We should mention that the number of agents choosing x, and also those choosing y, should be > 0.

To decide what the majority voted for, Angluin et al. proposed the following 3-State Approximate Majority protocol [START_REF] Angluin | A simple population protocol for fast robust approximate majority[END_REF]. It is a one way population protocol consisting of the 6-tuple (X AM , Y AM , Q AM , I AM , O AM , δ AM ) where:

• X AM = Q AM = {x, y, b} where b denotes the blank vote,

• Y AM = {x, y}, • I AM (x) = x, I AM (y) = y, I AM (b) = b, • O AM (x) = x and O AM (y) = y, • δ AM (x, b) = (x, x), δ AM (x, y) = (x, b), δ AM (y, b) = (y, y), and δ AM (y, x) = (y, b).
The input of each agent in this population corresponds its choice for this vote. The inputs are themselves the states of the agents as the input function I AM is the identity function. Then pairwise interactions start. When an initiator is with state x or y, it attempts to convert any responder that it meets to adopt its state. It can succeed to immediately convert an undecided responder. However, it can only reduce an opposing responder to undecided status.

The protocol stabilizes when a consensus on one of the values x and y is reached. Then, all the agents output x or y. If initially the number of agents with state x exceeded the number of agents with state y, the consensus will be on x and vice versa.

Network Graphs Protocols

When the finite state agents of a population communicate, they form a network represented by the interaction graph supposed to be at least weakly connected. Angluin et al. proposed to study graph properties of these networks. They defined a graph property as a function p from a graph G to the set {0, 1} where p(G) = 1 if and only if G has the corresponding property. They then introduced protocols designed to study such graph properties: the network graphs protocols [START_REF] Angluin | Stably computable properties of network graphs[END_REF].

A network graph protocol is a population protocol where all the agents start with the same initial state. A graph property is stably computable if all the agents eventually converge to the correct output. The authors described some stably computable properties i.e: whether the communication graph is a directed star, or it contains a directed cycle, or it has degree bounded by some constant, etc.

The Population Protocols

Example 2.3. The In-Degree Protocol. We here present the example of the network graph protocol that can decide whether a graph G has a vertex of in-degree greater than 1. This protocol was introduced by Angluin et al. in [START_REF] Angluin | Stably computable properties of network graphs[END_REF].We call this protocol the In-Degree protocol and it consists of (X, Y, Q, I, O, δ) where:

• X = {-}, • Y = {0, 1}, • Q = {-, I, R, T }, • ∀x ∈ Q, O(x) = 1 if x = T ,
and 0 otherwise,

• δ :                (-, -) → (I, R), (I, R) → (-, -), (-, R) → (T, T ), (T, x) → (T, T ), ∀x ∈ Q, (x, T ) → (T, T ), ∀x ∈ Q.
All the vertices (agents) start with state -. If every vertex in the graph has in-degree at most 1 then only the first two transitions rules occur. Consequently, the protocol will stabilize to a configuration where all agents output 0. However, if there is some vertex with in-degree at least 2, then the state T appears and will be spread. In such case, when the protocol stabilizes, all the agents output 1.

Angluin et al. also proposed two models that are slight modifications of the network graphs protocols: the network graphs protocols with stabilizing inputs, and the non deterministic population protocols [START_REF] Angluin | Stably computable properties of network graphs[END_REF].

Network Graphs Protocols with Stabilizing Inputs

In this variant of network graphs protocols, the inputs of the agents of the population are not initially fixed. They vary for a while and then finish by stabilizing. The only modification regarding the original model concerns the transition function that becomes as follows:

δ

: (Q × X) × (Q × X) → (Q × Q)
Thanks to this variant, the composition of protocols becomes possible. Indeed, let A and B be two protocols such that: A is a network graph protocol whose outputs are from a finite alphabet X, and B is a network graph protocol with stabilizing inputs that are also from X. Then, when composing A with B, the stabilizing outputs of A will be the stabilizing inputs of B.

Non Deterministic Population Protocols

In non deterministic population protocols, the transition function δ is non deterministic. It describes more than one possible transition for a given pair of states as it is shown in the example below.

Variants of the Population Protocol Model

Example 2.4. The d-Coloring Protocol. Coloring a graph consists on attributing colors to its vertices. A graph is d-colorable if each of its nodes can be colored with one of the d colors such that no two neighbor nodes have the same color.

The following non deterministic protocol stabilizes to a correct d-coloring if the network graph is d-colorable. Otherwise, if the network graph is not d-colorable, this protocol will never stabilize and the nodes will never stop changing their colors.

• X = {0}, • Y = Q = {0, 1, ..., d -1}, • I(x) = x and O(x) = x, ∀x ∈ {0, 1, ..., d -1},
• δ(i, i) = (j, k) where j and k are randomly chosen from the set {0, 1, ..., d -1}.

The authors of [START_REF] Angluin | Stably computable properties of network graphs[END_REF] stated that the nondeterminism of the transition function does not increase the class of stably computable predicates.

Fast Population Protocols with a Leader

Fast population protocols are population protocols where initially there is a leader supposed to be already elected in the population [START_REF] Angluin | Fast computation by population protocols with a leader[END_REF]. To be able to design a fast population protocol, a leader should first be designated.

We recall that leader election consists on designating a unique process as a leader. It is a fundamental problem not only in population protocols, but in distributed systems in general. The population protocol, called Leader Election protocol, that elects only one leader in a population was introduced by Angluin et al. in [START_REF] Angluin | Stably computable properties of network graphs[END_REF]. It consists of the following 6-tuple (X LE , Y LE , Q LE , I LE , O LE , δ LE ):

• X LE = {L}, • Y LE = {L, F }, • Q LE = {L, F }, • I LE (x) = x and O LE (x) = x, ∀x ∈ {L, F }, • δ LE (L, L) = (L, F ), δ LE (L, F ) = (F, L) and δ LE (F, L) = (L, F ).
In the classical leader election algorithms in distributed computing, all the processes of the distributed system initially start with the same state which is "simple candidate". Then, they become either "elected (L)" or "failed (F)". Also, once a node updates its state to "elected", it never changes anymore.

Nevertheless, this population protocol presents a different approach as initially all agents start by being "leader". Furthermore, when this protocol stabilizes with only one "leader" state in the whole population, this state can be a swapping one.

During a pairwise computation, if both agents are with state L, the initiator preserves its state while the responder becomes F . Otherwise, if one agent is with state L and the other F , they just interchange their states.

The Population Protocols

When the protocol stabilizes, it guarantees that there is only one agent with the state L. However, this leader state may jump from one agent to another from one computation step to another.

This population protocol works in any weakly connected interaction graph. Yet, if we suppose that this last one is complete, we can restrict δ LE to only one transition rule which is δ LE (L, L) = (L, F ). We can thus guarantee that the leader state will not be a moving one. Now, once a leader is appointed, it can proceed in coordinating the agents of the population to compute a new protocol. This represents the fundamental assumption of the fast population protocols. In fact, such coordination may lead to a faster stabilization of some population protocols: that is less computation steps are needed to reach a protocol's stabilization. This was proved by Angluin et al. [START_REF] Angluin | Fast computation by population protocols with a leader[END_REF].

Models Extending the Population Protocols

Once the population protocol model was introduced and its computational power exactly characterized, some new open questions arised. How some modifications such as: according a state to the edge linking the interacting pair, according more memory space to the agents, or giving identities to the agents of the population, ... may affect the original model as well as its computational power. We here present some models that extend the population protocol model and that also provide some answers to these questions.

The Mediated Population Protocols

The mediated population protocols extend the basic population protocols by adding states to the edges of the interaction graph which is translated into equipping each communication link with a buffer of constant storage capacity. This model preserves the anonymity and the uniformity of the original population protocol model.

A more formal and detailed description of the mediated population protocol model follows [START_REF] Chatzigiannakis | Mediated population protocols[END_REF]. Definition 2.9. (Mediated Population Protocol) A mediated population protocol consists of (X, Y, Q, S, I, O, δ, ι, ω) where:

• X: a finite input alphabet,
• Y : a finite output alphabet,

• Q: a finite set of agent states,

• S: a finite set of edge states,

• I: X → Q: an agent input function mapping inputs to agents states,

• O: Q → Y : an agent output function mapping agents states to outputs,

• δ: Q × Q × S → Q × Q × S: a transition function,
• ι: X → S: an edge input function mapping inputs to edge states,

Models Extending the Population Protocols

• ω: S → Y : an edge output function mapping edge states to outputs.

A possible additional component, but which is not mandatory, of a mediated population protocol is an output instruction r. This output instruction specifies how the output of this protocol should be interpreted.

As an example of the mediated population protocols, we present the VarProduct protocol [START_REF] Chatzigiannakis | Mediated population protocols[END_REF].

Example 2.5. The VarProduct Protocol. Let P be a population whose interaction graph is complete and where each agent can have as initial input: a, b, or c. Let N i denote the size of the set of agents with state i. We consider the following predicate:

N c = N a × N b .
As already mentioned in a previous section (see Section 2.1.2), the Presburger arithmetic does not include multiplication. As a consequence, there is no population protocol that can stably computable this predicate.

Chatzigiannakis et al. introduced then the following VarProduct mediated population protocol (X, Y, Q, S, I, O, δ, ι, ω) that can stably compute this predicate:

• X = {a, b, c}, Y = {0, 1}, • Q = {a, ā, b, c, c}, • S = {0, 1}, • I(x) = x, ∀x ∈ X, • O(a) = O(b) = O(c) = 1 and O(c) = O(ā) = 0, • ι(x) = 0, ∀x ∈ X, • ω(x) = x, ∀x ∈ S,
• δ(a, b, 0) = (ā, b, 1), δ(c,ā, 0) = (c, a, 0), and δ(ā, c, 0) = (a,c, 0).

The output instruction r of this protocol can be: "If there is at least one agent with output 0, then reject, else accept."

As the interaction graph is complete, N a × N b equals the number of edges leading from agents in state a to agents in state b. Thanks to edge states, an agent with state a can remember an agent with state b that it has already met: the edge linking them is marked with state 1 instead of 0. For each agent b that it has met, an agent with state a, and that becomes ā, tries to erase an agent with state c. Consequently, if initially N c > N a × N b , then the protocol stabilizes to a configuration where there is at least one agent with state c that remains and whose output is 0. Otherwise, if N c < N a × N b , then the protocol stabilizes with at least one agent with state ā in the configuration and whose output is also 0. Then, N c = N a × N b is true only if there no agent with state c or ā that remains, so that all agents output 1.

Chatzigiannakis et al. hence proved that the model of mediated population protocols has a stronger computational power compared to the population protocol model. The model of mediated population protocols was also extended, like the population protocols, to study graph properties. In this context, the graph decision mediated population protocols (GDMPP) and the mediated graph protocols (MGP) were designed [START_REF] Chatzigiannakis | The computational power of simple protocols for self-awareness on graphs[END_REF].

The Population Protocols

The Passively Mobile Machines Protocols

The constant memory of an agent in population protocols is a constraining characteristic of this model. A new model relaxing this constraint was introduced in [START_REF] Chatzigiannakis | Passively mobile communicating machines that use restricted space[END_REF]: the passively mobile machines protocols. This model extends the population protocols by allowing the agents to have greater memory space. An agent is not an automaton anymore, but a Turing machine.

We provide a formal description of this new model.

Definition 2.10. (Passively Mobile Machines Protocol) A passively mobile machines protocol is a 6-tuple (X, Γ, Q, δ, γ, q 0 ) where:

• X is the finite input alphabet, where B / ∈ X (B is the blank symbol),

• Γ is the finite tape alphabet, where B ∈ Γ and X ⊂ Γ,

• Q is the finite set of states,

• δ : Q × Γ 4 -→ Q × Γ 4 × {L, R} 4 × {0, 1} is the internal transition function, • γ : Q × Q -→ Q × Q is the external transition function, and
• q 0 ∈ Q is the initial state.
In the passively mobile machines protocol model, each agent is supposed to be equipped with:

• A sensor to sense a specified parameter from the environment. The sensed value will be considered as the input of the agent.

• Four read/write tapes which are: the incoming message tape, the outgoing message tape, the working tape, and the output tape. These tapes are assumed to be unbounded only to the right.

• A control unit where the state of the agent is stored. This unit applies the transition functions.

• Four heads, one for each tape. A head is able to read from and write to the cells of the tape. It is also able to remain stationary or to move either to the left or to the right.

• A binary working flag that can be set to 0 when the agent is ready for interaction or to 1 when this last is working internally.

All agents start with the state q 0 , with a working flag set to 1 and with tapes containing only the blank symbol. Then, they all get their inputs from their environment described with symbols from the alphabet X. This input symbol will be written in the working tape of the agent. As the working flag is set to 1, the control unit can apply the internal transition function. This unit reads its own state as well as the symbols under the heads of the four tapes. Then, after updating all of them, moves to left/right or keeps stationary each head of the tapes, and finally sets the working flag to 0 or 1.

Models Extending the Population Protocols

The pairwise interactions in this model depends on the working flag of the agents. In fact, two agents can interact only if their respective working flags are set to 0. When an interaction between two agents takes place, the external transition function is applied to update the states of these interacting pair. The outgoing message of each of these two agents is copied in the incoming message tape of the other (replacing, thus, the previous content of this tape). Then, the working flags of this pair of agents are set to 1 as the internal transition function should be applied.

PALOMA

One particular case of the passively mobile machines protocols is the model of passively mobile logarithmic machines (PALOMA) [START_REF] Chatzigiannakis | Passively Mobile Communicating Logarithmic Space Machines[END_REF]. In this model, each agent is equipped with O(log(n)) memory space, where n is the size of the population. Chatzigiannakis et al. proved that there is a PALOMA protocol that stably computes the predicate N c = N a ×N b . Also, assigning unique identities, from the set {0, 1, . . . , n-1}, to the agents of the population is also possible with this model. In the corresponding protocol, the agents start with the identity 0. When an interaction takes place, the initiator compares its id with the responder id. If they are equal, the initiator increments its id. As the interaction graph is supposed to be complete in this model, all agents will eventually meet. And thanks to the fairness of the execution of the protocols, each agents will finally have a unique id from {0, 1, . . . , n -1}.

The Community Protocols

In a community, each individual has a distinguished name or identity. This inspired Guerraoui et al. in their work in [START_REF] Guerraoui | Names trump malice: Tiny mobile agents can tolerate byzantine failures[END_REF] where they proposed a new model extending the population protocols called the model of community protocols. In this model, an agent can store, in addition to O(1) bits of states, a unique identifier, and O(1) other agents identifiers. These identifiers are in a read only mode. They are used only for comparison and thus never modified.

Let U be an infinite ordered set containing all possible identifiers and let ⊥ be the null identifier. Then, a community protocol can formally be described as follows [START_REF] Guerraoui | Names trump malice: Tiny mobile agents can tolerate byzantine failures[END_REF]: Y,B,d,I,O,Q,δ), where:

Definition 2.11. (Community Protocol) A community protocol consists of an 8-tuple (X,
• X is the finite input alphabet,
• Y is the finite output alphabet,

• B is the finite set of basic states,

• d is a non negative integer representing the number of identifiers that can be recorded by an agent,

• I : X -→ B is the input function mapping input symbols to basic states,

• O : B -→ Y is the output function mapping the basic states to output symbols,

The Population Protocols

• Q = B × (U {⊥}) d is the set of agent states, and

• δ : Q × Q -→ Q × Q is the transition function.
The initial state of each agent in a population running a community protocol is of the form (b i , id i , ⊥, ⊥, . . . , ⊥). b i ∈ B is the initial basic state of this agent and it equals I(x i ) with x i the input of this agent. id i is the unique identifier of this agent. Then, the remaining components of this state are d -1 repetitions of the symbol ⊥.

Community protocols preserve the uniformity property as their design do not depend on the size of the population. However, they are clearly not anonymous.

Guerraoui et al. proved that their model has a stronger computational power than the population protocols. They also proved that it is robust and can tolerate the presence of a constant number of agents with Byzantine failures. An agent that has a Byzantine failure is an agent that can behave arbitrarily. It can pretend being in any state when interacting with other agents.

Conclusion

We presented in this chapter the computational model of population protocols. Run in a population of anonymous agents with finite set of states, a population protocol computes a predicate of the distributed inputs of these agents, gathered from their environment. Interactions between pairs of agents allow them to exchange their states and to update them according to some given rules. The result of the computation can be extracted from the outputs of the agents of the population when the protocol stabilizes. Population protocols have two basic properties: uniformity and anonymity. We gave an overview of the variants of this model, as well as models that enhance it, that all preserve the uniformity property but not the anonymity. These models also, except the one way population protocols, are all based on pairwise interactions like the population protocols.

In the next chapter, we are going to compare the population protocol model (and some of its extensions) with two other models and establish a bridge that allows us to describe it with each one of them. The first one is a model that also uses abstract communications. However, the second one is a model with explicit communications. The population protocols, as they are based on local interactions and computations, belong to local computation systems. In this chapter, we introduce another model of local computation systems, and more specifically of local computations in graphs, which is tasks with graph relabeling systems [START_REF] Litovsky | Checking global graph properties by means of local computations: the majority problem[END_REF][START_REF] Litovsky | On the recognition of families of graphs with local computations[END_REF]. Population protocols, as well as tasks with graph relabeling systems, are models using abstract communications. We present in this chapter a comparative study between these two models and establish some analogy between them. This allows us to prove the possibility of mapping the execution of a (mediated) population protocol to a realization of a task according to a graph relabeling system. However, we prove that the reverse is possible only under some conditions.

On the other hand, population protocols were designed for networks of tiny objects such as sensor networks. Hence, we think that supposing abstract communications is too theoretical for such networks. We thus propose to describe the computation of a population protocol in a population of anonymous agents, as a distributed algorithm running in an anonymous asynchronous system based on message passing.

From Population Protocols to Tasks with Graph

Relabeling Systems

A distributed system is a collection of interacting processes that collaborate to reach a global result. These interactions can be based on a shared memory model where the processes perform read/write primitives on shared registers. Another interaction model, is the message passing model where the processes exchange messages, through the communication links, using send/receive primitives. A third basic interaction model, is the local computations model on which are based the local computations systems [START_REF] Chalopin | Proceedings, chapter A Bridge Between the Asynchronous Message Passing Model and Local Computations in Graphs[END_REF]. We will focus, in this section, on this last model, and more specifically on the local computations in graphs with tasks and graph relabeling systems. This model present, in fact, some similarities with the (mediated) population protocols that we found interesting to investigate.

Local Computations Systems

Local computations systems are described as networks of processors that have only access to local resources. The local resources consist of the state of the process, the states of its neighbors and those of the links between them. They are the result of the restricted local interactions of each process with its direct neighbors. In a local computation system, all processors execute the same program.

Accordingly, the population protocol model, as well as the models extending it, belongs to this class of systems that have been the object of different studies. Von Neumann introduced in [START_REF] Neumann | Theory of self-reproducing automata[END_REF] the cellular automata model where the computations are made by a collection of synchronously communicating finite automata forming a network, such as a grid, which is highly symmetric and regular (no mobility). According to the states of its neighbors, an agent can update its state. A similar model, that does not require the regular structure of the network, is proposed by Rosenstiehl et al. in [START_REF] Rosenstiehl | Intelligent graphs: Networks of finite automata capable of solving graph problems[END_REF]. A computation step also consists on computing the next state of each process according to its current state and those of its neighbors. Litovsky, Métivier, Sopena and Zielonka [START_REF] Litovsky | Checking global graph properties by means of local computations: the majority problem[END_REF][START_REF] Litovsky | On the recognition of families of graphs with local computations[END_REF] proposed

A Bridge between Population Protocols and Other Interaction Models

a model based on graph relabeling (rewriting) systems where a distributed computation is described as a transformation of the graph representing the distributed system.

We focus on this last model which is a tool for coding distributed algorithms [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF] and proving their correctness [START_REF] Bauderon | Graph relabelling systems: A tool for encoding, proving, studying and visualizing distributed algorithms[END_REF], used even to recognize some graph properties and families of graphs [START_REF] Godard | Characterizations of classes of graphs recognizable by local computations[END_REF]. This model presents some correspondences with the population protocols model that we would later explore.

Local Computations in Graphs with Graph Relabeling Systems

In the model of Litovsky et al., a network is represented as a finite connected graph with some level of abstraction of the distributed system model. The processes are represented by the set of vertices and the direct communication links are represented by the set of edges. The local state of each process (respectively communication link) is denoted by a label assigned to the corresponding vertex (respectively edge). These local states associated to each vertex and edge describe the global state of the network, denoted labeling of the graph. Accordingly, a labeled graph can formally be described as follows [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF]:

Definition 3.1.
(L-labeled graph) A L-labeled graph (or a graph labeled over L) is a graph where the vertices and the edges have labels from a possible infinite alphabet L.

It is denoted by (G, σ) where G = (V, E) is a graph and σ : V ∪ E → L is the labeling function. G is called the underlying graph of (G, σ) and σ is a labeling of G.
A state transformation of a network represented by a graph G corresponds to a relabeling on this graph: it is any pair of global states ((G, σ), (G, σ )) of labeled graphs over the same underlying graph G. A relabeling relation on G is a set of relabellings on G.

Based on these concepts, Litovsky et al. introduced the graph relabeling systems to describe local computations in graphs.

Graph Relabeling Systems

Local interactions in a local computation system can be traduced by graph relabeling rules. A graph relabeling rule illustrates the possible modification of the labels attached to the vertices and edges of a graph if they satisfy a given description. Formally, it is defined as follows [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF] :

Definition 3.2. (Graph Relabeling Rule) A graph relabeling rule is a triple R = (G R , σ R , σ R ) such that (G R , σ R ) and (G R , σ R ) are two labeled graphs. The labeled graph (G R , σ R ) is the left-hand side of R and (G R , σ R ) is the right-hand side.
An algorithm can be encoded by means of local relabellings. These relabellings are according to the graph relabeling rules of the graph relabeling system associated to this algorithm. A graph relabeling system can be formally described as follows [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF]: Definition 3.3. (Graph Relabeling System) A graph relabeling system is a triple R = (L, I, P) where L is a set of labels, I a subset of L called the set of initial labels and P a finite set of relabeling rules.

From Population Protocols to Tasks with Graph Relabeling Systems

A computation step, resulting from a local interaction, corresponds to a relabeling step having the following definition [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF]: Definition 3.4. (Relabeling Step) Let R = (L, I, P) be a graph relabeling system. A R-relabeling step is a 5-tuple (G, σ, R, ϕ, σ ) such that: R = (G R , σ R , σ R ) is a relabeling rule in P, and ϕ is both an occurrence of (G R , σ R ) in (G, σ) and an occurrence of (G R , σ R ) in (G, σ ).

In other words, a relabeling step consists on applying the relabeling rule R that modifies the labels of the elements of ϕ(G R , σ R ) according to σ R . Consequently, the graph G has a new labeling σ , obtained from σ.

A computation (or an execution) corresponds to a relabeling sequence. A computation stops when no relabeling rule of the graph relabeling system is applicable anymore [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF]:

Definition 3.5. (R-irreducible) A labeled graph (G, σ) is R-irreducible if there is no occurrence of (G R , σ R ) in (G, σ) for every relabeling rule R in P.

Characteristics of Local Computations with Graph Relabeling Systems

Computations with graph relabeling systems, as they belong to local computations in graphs, satisfy the following conditions [START_REF] Bauderon | Graph relabelling systems: A tool for encoding, proving, studying and visualizing distributed algorithms[END_REF]: 1. They do not affect the structure of the underlying graph, but only the labeling of its vertices and edges.

2. The locality of these interactions implies that each relabeling step can only change the labellings of a connected subgraph with a fixed size in the underlying graph.

3. The local context of the relabeled graph determines if a relabeling rule is applicable or not, which means that these computations are locally generated.

Local Interaction Rules and Local Synchronizations

A local interaction in a local computation system may involve a process with only one of its direct neighbors, or with all its direct neighborhood. Any local computation step needs a local synchronization between the interacting entities. And as a relabeling rule in a graph relabeling system stands for a local interaction, a local synchronization is needed to synchronize the components of the subgraph of the underlying labeled graph where this relabeling rule will be performed. The model of Litovsky et al. present three types of local computations (LC) that need three different types of local synchronizations [START_REF] Bauderon | Graph relabelling systems: A tool for encoding, proving, studying and visualizing distributed algorithms[END_REF]:

• LC0 This local computation is a relabeling step according to a relabeling rule that involves a node with one of its neighbors and the edge linking them. Consequently, at least one of the labels of these elements will be modified. This local computation needs the synchronization of this node with its neighbors.

• LC1 A LC1 computation is a relabeling step that involves a star formed by a center node and all its direct neighbors. The label of this center node as well as the labels of the edges of this star can be modified. However, the labels of the leaves of this star remain unchanged. A LC1 synchronizes a ball of radius 1, that is a center node and all its neighbors at distance 1. • LC2 This local computation needs to synchronize a ball of radius 2: a center node and all its neighbors at distance at most 2. The application of the relabeling rule of this local computation can update the state of the center node, the states of its direct neighbors and also the states of the edges linking the center node to these neighbors.

A Bridge between Population Protocols and Other Interaction Models

s 1 s 1 v u v u
s 1 s 2 s 3 u v w x s 1 s 2 s 3 u v w x

Local Control Mechanisms on Graph Relabeling Systems

Local control mechanisms can be introduced to graph relabeling systems in order to restrict the applicability of the relabeling rules [START_REF] Litovsky | Different local controls for graph relabeling systems[END_REF]. As a control mechanism, some priority relation on the set of relabeling rules can be defined in graph relabeling systems with priorities [START_REF] Billaud | Graph rewriting systems with priorities[END_REF].

From Population Protocols to Tasks with Graph Relabeling Systems

Also, some forbidden contexts can be specified on relabeling rules. A rule with forbidden context can not be applicable on some occurrence if and only if this latter is included on an occurrence of the forbidden context. This is the case of graph relabeling systems with forbidden contexts [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF]. Example 3.1. Distributed Computation of a Spanning Tree with a Graph Relabeling System. We consider the example of a graph relabeling system, introduced in [START_REF] Litovsky | Graph relabelling systems and distributed algorithms[END_REF], encoding a distributed algorithm that computes a spanning tree on a graph. We denote this graph relabeling system by R ST = (L ST , I ST , P ST ) defined by L ST = (A, N, 0, 1), I ST = (A, N, 0), and P ST = {R ST } with R the relabeling rule described in Figure (3.4).

1 0 A A N A R ST :
N N 0 0 0 N A 0 N A 0 0 1 N N 0 0 0 A A 1 N A 0 0 1 N N 0 0 0 A A 1 N A 0 0 1 A N 0 1 0 A A 1 N A 0 0 1 A A 1 1 0 A A 1 A A 0 1 1 A A 1 1 0 Figure 3.5: A distributed computation of a spanning tree with R ST
Initially, all the nodes are labeled N , except one node which is labeled A, and all the edges are labeled 0. An elementary computation step consists of an application of the rule R ST . It rewrites a label of a node labeled N , linked to a node labeled A by an edge labeled 0, to a label A. The label of the involved edge is also modified, it becomes 1. Parallel computation steps can take place simultaneously as long as the interacting pairs are disjoint. We can take the example of the 5th relabeling step and the 6th relabeling step in Figure 3.5 that can be executed concurrently. When the relabeling rule R ST is not applicable anymore, the final result is obtained. It is the spanning tree formed by the edges labeled 1 and whose root is the initial node labeled A.

A Bridge between Population Protocols and Other Interaction Models

Tasks with Graph Relabeling Systems

A distributed task consists of a specification and a domain [START_REF] Godard | Termination detection of local computations[END_REF]. The specification is a description of what should be computed. It is a graph relabeling relation. The domain is a family of labeled graphs over which the local computations should lead to a correct result with respect to the specification.

A formal definition of a task corresponds to what follows [START_REF] Castéran | Tasks, types and tactics for local computation systems[END_REF]:

Definition 3.6. (Task) Let L G represent the type of L-labellings on a graph G. Let L i (respectively L o ) be a type for input (respectively output) labels. A task T is a function that associates to any graph G a relation

T G between L i G and Lo G . The domain of T is the set of L i labeled graphs (G, σ i ) such that ((G, σ i ), (G, σ o ))∈ T G for some σ o .

Realization of a Task

Given a distributed algorithm, a task can describe the problem this algorithm should solve. On the other hand, and as we mentioned in a previous section, a graph relabeling system can encode this distributed algorithm by means of local relabeling. A realization of a task is the link established between the task and the graph relabeling system associated to this distributed algorithm.

Let T be a task with labellings types L i and L o . Let (G, σ i ) be any labeled graph in the domain of T , and let R be a graph relabeling system over the labeling type L.

A computation that realizes T on (G, σ i ) according to R consists on the following three successive phases:

1. Initialization Every vertex and edge receives its initial state according to the input σ i and to the local initialization function λ : L i → L.

2.

Relabellings Relabellings are made according to the relabeling rules of R. They stop when the labeled graph becomes R-irreducible. Let G be any network graph whose structure is a tree and where the processes initially know their degrees: each vertex of the tree is labeled with its degree. We consider a realization of a task that aims to elect a single vertex to be the leader in this network [START_REF] Castéran | Tasks, types and tactics for local computation systems[END_REF]. Therefore, let R ET = (L ET , I ET , P ET ) be a graph relabeling system where:

Extraction

• L ET = {N one} ∪ {Some (i)| i ∈ N}, • I ET = {Some (i)| i ∈ N},
• P ET = {R ET }, with R ET the relabeling rule illustrated in Figure 3.6.

From Population Protocols to Tasks with Graph Relabeling Systems

N one Some (i) Some (1) Some (i + 1) R ET : Figure 3.6: The LC0 rule R ET for election in a tree with initial knowledge of vertices degrees Let T election be a task, whose realization according to R ET over the labeling type L ET , consists on electing a leader vertex in the graph G. The realization of T election can be described as follows:

• The labeling types are fixed as follows: the input labeling type is L i = N representing the possible values of the initial degrees of the vertices, and the output labeling type is L o = {B, E}.

• The initialization phase takes place according to the following input function:

λ : L i → L ET i → Some (i)
• The relabellings are made according to the relabeling rule R ET .

• The extraction phase depends on the following extraction function π: π(N one) = B and π(Some (0)) = E.

Figure 3.7 represents an example of a realization of this task in a tree whose vertices are initially labeled with their degrees. Based on these initial labels, and according to the input function λ, new labels from the labeling type L ET are attributed to the vertices. Then, relabeling steps take place according to the relabeling rule R ET . The vertices that were involved in a relabeling step, as well as the edge linking them, are represented in red in this figure. The relabellings stop when the relabeling rule is not applicable anymore. If so, all the vertices are thus labeled N one, except one which is labeled Some(0). This latter becomes labeled E according to the extraction function π: this is the elected vertex. However, the extraction function π attributes the label B to all the remaining vertices labeled N one. They are consequently considered as defeated.

From a Computation of a Population Protocol to a Realization of a Task

We propose in this section to establish a bridge between the population protocol model and tasks with graph relabeling systems. In fact, we noticed some similarities between these two models as they are both local computation models with abstract communication. They also, both, consider the model of pairwise interactions. We thus want to investigate these similarities and present a comparison study that may allow us to establish a link between these two models. We would mention that the approach presented all along this section applies, not only for the population protocol model, but also for the models extending it. However, in the 3. A Bridge between Population Protocols and Other Interaction Models

2 3 1 1 1 λ Some (2) Some (3) Some (1)
Some (1) Some ( 1)

Some (1) Some (3) N one Some (1) Some (1)
N one Some (2) N one Some (1) Some (1) sequel, we will focus only on the cases of the populations protocols and the mediated population protocols. Compared to the population protocols, the mediated population protocols assign states, not only to the agents of the population, but also to the communication links. Therefore, additional details are going to be needed for this model. They will be denoted afterward between () or [ ].

N one Some (1) N one N one Some (1)

The Population Protocol Model as Local Computations in Graphs

We aim to prove, in this section, that the computation of a (mediated) population protocol can be considered as local computations in graphs. We thus first start by representing 3.1. From Population Protocols to Tasks with Graph Relabeling Systems the interaction graph, over which the protocol runs, as a labeled graph. We then describe the effective pairwise interactions as local relabellings on this graph. Finally, we ensure that the execution of this (mediated) population protocol satisfy the properties of local computations in graphs.

Let A = (X, Y, Q[, S], I, O, δ[, ι, ω]
) be a (mediated) population protocol running in a population P. We recall that a computation of a (mediated) population protocol takes three basic phases:

1. Initialization The inputs are mapped to states according to the agent input function I: X → Q (and to the edge input function ι: X → S).

Pairwise Interactions

Interactions between pairs of agents take place and can lead to the modification of their states according to the transition function δ: Let G = (V, E) be the communication graph over which A runs. V is the set of vertices representing the set of agents of the population P. E denotes the set of the edges representing all the permissible communication links between the pairs of agents from P. This graph is a representation of the network formed by the agents of the population P with an abstraction over its characteristics.

Q × Q [×S] → Q × Q [×S].
We propose to represent this communication graph as a labeled graph. Therefore, we add labels to its vertices (and respectively to its edges) that describe the states of the agents (respectively the states of the communication links) of the population P. The labeling type will depend on the phase of the execution of the protocol A. Also, the labeling of this graph can be updated after a computation step.

Initially, the labels attributed to the nodes (and to the edges) of the interaction graph G are the inputs of the agents (and the inputs of the communication links) of P. The graph G becomes thus X-labeled, and denoted by (G, σ X ) with σ X : V

[∪E] → X.
Then, once the initialization phase has taken place, this labeled graph becomes (G,

σ Q ) with σ Q : V [∪E] → Q[∪S].
Any interaction happening during this second phase, may only lead to an update of the states of the interacting agents (and the communication link connecting them). This is traduced by an update of the labels of the corresponding nodes (and the edge linking them) in the graph. This update will associate to the communication graph a new labeling function over

Q[∪S].
Finally, when the protocol A reaches stabilization and during the outputs extraction phase, the labeled interaction graph can be considered as an

Y -labeled graph (G, σ Y ) with σ Y : V [∪E] → Y .
Let u, v, u and v be any agent states from Q (and let s and s be any edge states). Any transition rule (u, v [, s]) → (u , v [, s ]) from δ executed over the Q[∪S]-labeled communication graph can be translated to a relabeling rule R uv = (G uv , σ uv , σ uv ) where:

• G uv is a restriction of the Q[∪S]-labeled interaction graph to the interacting pair of nodes, with respective states u and v, and the edge linking them.

A Bridge between Population Protocols and Other Interaction Models

• σ uv , respectively σ uv , is the restriction of the labeling function σ :

V [∪E] → Q[∪S], respectively σ : V [∪E] → Q[∪S],
to the labellings of the nodes that initially were with states u and v (and the edge linking them).

Figure 3.8 illustrates the relabeling rule R uv . Note that, while labeling the interaction graph, the direction of its edges were left untouched to preserve symmetry breaking. Hence, a transition rule applied for the ordered pair of agents (u, v) can be expressed as a relabeling rule over the directed edge (u, v) in G. We define a function φ that associates to each transition rule from the transition function δ of the protocol A a corresponding relabeling rule. This function φ is described as follows:

φ : δ → P ((u, v [, s]), (u , v [, s ])) → R uv = (G uv , σ uv , σ uv )
with P a set of relabeling rules. The (mediated) population protocol model is based on pairwise interactions. Therefore, any computation step in such protocol involves only the interacting pair of agents (and the communication link connecting them). Accordingly, any transition rule from δ can be traduced by a LC0 interaction.

We can notice that, any computation step in the execution of the protocol A has the following characteristics:

• It does not affect the structure of the communication graph.

• It can only lead to some changes of the states of the interacting pair of agents (and the communication link between them), and consequently lead to the modification of the labellings of the pair of vertices representing these two agents (and the edge linking them) in the underlying labeled interaction graph.

• It is locally generated as only the current states of the interacting pair of agents (and the communication link connecting them) determine if a transition rule is applicable or not.

We can hence deduce that the computation of any (mediated) population protocol respects the three characteristics of local computations in graphs (see Section 3.1.2). And accordingly, a (mediated) population protocol model can be described as local computations in graphs.

From Population Protocols to Tasks with Graph Relabeling Systems

Mapping an Execution of a Population Protocol to a Realization of a Task

We now focus on how an execution of a (mediated) population protocol over an interaction graph can correspond to a realization of a task on a labeled graph according to some graph relabeling system.

We recall that the computation of a (mediated) population protocol consists on three phases: initialization, pairwise interactions, and outputs extraction. As already mentioned, if we describe this computation as local computations in graphs, we can consider that the pairwise interactions phase is a relabellings phase. These phases present a great degree of similarity with those needed for a realization of a task, and that are: initialization, relabellings and extraction. In fact, the computation of a (mediated) population protocol, as well as the realization of a task, needs an initialization phase to map the inputs to states. Then, a relabeling phase where interactions lead to the application of some rules. These rules may result in an update of the states and, consequently, in an update of the labels of the graph over which the computations take place. And, a last phase, where outputs can be extracted from the states.

Given this analogy, and the approach we presented in the previous section of representing a (mediated) population protocol as local computations in graphs, we propose to describe the computation a (mediated) population protocol over an interaction graph as a realization of a task with a graph relabeling system on this graph.

Accordingly, let A = (X, Y, Q[, S], I, O, δ[, ι, ω]) be a (mediated) population protocol running in a population P with an interaction graph G = (V, E). Let T be a task with input labeling type X, and output labeling type Y . Let (G, σ X ) be a labeled graph, whose underlying graph G is the interaction graph of A, and whose labeling function is σ X : V [∪E] → X. The labeled graph (G, σ X ) is in the domain of T . Finally, let R = (Q, Q i , P ) be a graph relabeling system over the labeling type Q with:

Q i = I(X)[∪ ι(X)] ⊂ Q, and P = φ(δ).
The execution of the protocol A over the interaction graph G of the population P can be mapped to a realization of the task T , on the labeled graph (G, σ X ), according to the relabeling system R. This realization is as follows:

• The initialization phase is done according to the initial input σ X and to the local initialization function λ :

X → Q [∪S], with: ∀x ∈ X, λ(x) = I(x), if x is the input of an agent, ι(x), if
x is the input of an edge.

• The relabellings are then made according to the relabeling rules P of R.

• When the protocol stabilizes, the outputs can be extracted over the labeling type Y according to the local extraction function π :

Q [∪S] → Y , with: ∀q ∈ Q [∪S], π(q) = O(q), if q ∈ Q, ω (q)
, otherwise.

Table 3.1 summarizes this approach by attributing to each element of the execution of a (mediated) population protocol, its correspondence in the realization of the associated Let P be a population whose interaction graph is G = (V, E). We suppose that the agents of P are executing the population protocol T hreshold = (X, Y, Q, I, O, δ), that we presented in the previous chapter (see Section 2.1).

δ : Q × Q(×S) → Q × Q(×S)
Let T T h be a task with input, and respectively output, labeling type L i and L o such that:

• L i = X = {0, 1}. • L o = Y = {0, 1}.
We consider the labeling function σ X : V → X which is applied to the graph G to obtain the X-labeled graph (G, σ X ) in the domain of T T h .

We also consider the graph relabeling system

R T h = (Q, Q i , P ) with: Q i = I(X) = {q 0 , q 1 } ⊂ Q, and P = φ(δ) = {R 1 , R 2 }.
The rules R 1 and R 2 are illustrated in Figure 3.9, and represent the only two effective transitions of the protocol T hreshold. q 0 q i+j q j q i R 1 :

, 0 ≤ i + j < 5 q 5 q 5 q j q i R 2 :

, i + j ≥ 5

Figure 3.9: The relabeling rules of the relabeling system R T h

The execution of the population protocol T hreshold can be mapped to the realization of the task T T h over the labeled graph (G, σ X ) according to the graph relabeling system R T h , where:

• The initialization is done according to σ X and to the local input function λ with λ = I,

• Relabellings are done according to the relabeling rules R 1 and R 2 of R T h , and

• The outputs extraction is made according to the local output function π = O. Now, as an example, we suppose that the population P consists of 8 agents, and that its interaction graph G = (V, E) is a complete graph. Let the input assignment of this population be described by the vector (1, 0, 1, 1, 1, 1, 0, 1). We illustrate a computation of the T hreshold protocol in this population, as a realization of the task T T h , in Figure 3.10.

Initially, the interaction graph G is labeled with the input alphabet X, according to the input assignment of this computation, so it becomes in the domain of the task T T h . Consequently, each vertex is either labeled 0 or 1. Then, applying the input function λ associates to each vertex a new label. If the vertex was labeled 0, then the new label is q 0 . Otherwise, the new label is q 1 . The relabellings phase starts then, standing for the pairwise interactions in the computation of the protocol. The first relabeling step, illustrated in Figure 3.10, is applied over the directed edge colored red, and whose both 3. A Bridge between Population Protocols and Other Interaction Models extremities are labeled q 1 . The relabeling rule R 1 is applied, updating the label of the source of the directed edge to q 2 and the label of its target to q0. Relabeling steps continue, according to the relabeling rule R 1 , until the label q 5 appears. There, all the relabeling steps that take place are according to the relabeling rule R 2 , so all the vertices become labeled q 5 . The output extraction can thus be done: all the vertices labels are 1. The output assignment of the computation of the protocol T hreshold can consequently be deduced from this output extraction. The value of the predicate N SB ≥ 5 is 1 (indeed, we can notice that in the input assignment, we have 6 agents with inputs 1, that is 6 agents that are sick).

From a Realization of a Task to a Computation of a Population Protocol

We proved that a mapping of a computation of a (mediated) population protocol to a realization of a realization of a task with a graph relabeling system is possible. Now, we are going to investigate whether the reverse is also possible.

Tasks with Graph Relabeling Systems versus Population Protocols: the Key Differences

The mapping of a computation of a (mediated) population protocol to a realization of a task, introduced above, is an analogy based on the similarities and correspondences that exist between these two models. However, this does not exclude the fact that there are some differences that distinguish one model from the other, and that will particularly make the mapping of a realization of task with a graph relabeling system to a computation of a (mediated) population protocol not always possible. A realization of a task with a graph relabeling system versus a computation of a (mediated) population protocol: Key differences.

• Memory constraint In the population protocol model, and all its extensions, the memory space accorded to the agents (and also to the edges) is specified varying 3.1. From Population Protocols to Tasks with Graph Relabeling Systems

1 0 1 1 1 1 0 1 λ q 1 q 0 q 1 q 1 q 1 q 1 q 0 q 1 q 2 q 0 q 1 q 1 q 1 q 0 q 0 q 1 q 2 q 0 q 1 q 1 q 1 q 0 q 0 q 1 q 2 q 0 q 1 q 2 q 1
q 0 q 0 q 0 q 0 q 3 q 0 q 0 q 2 q 0 q 0 q 0 * q 5 q 5 q 5 q 5 q 5 q 5 q 5 q 5 * from O(1) to an unlimited space. This constraint is one of the basic elements that may influence the computational powers of these models. However, no constraint is specified concerning the memory space accorded to the nodes or edges in the case of tasks with graph relabeling systems, which implies that there is no restriction on this space.

• Asymmetry A pair of interacting agents, in a (mediated) population protocol, consists of one agent playing the role of the initiator, and a second one playing the role of the responder. This distinction breaks the symmetry between these two anonymous entities. Such asymmetry is not specified when applying a relabeling rule of a graph relabeling system.

• Restriction of the interacting entities The (mediated) population protocols are based on pairwise interactions. Therefore, the transition rules of these protocols are described by the pair of states of the two interacting agents (and the state of the edge linking them). We established, in the previous section, that these transition rules can be represented by LC0 relabeling rules in graph relabeling systems. However, relabeling rules in graph relabeling systems are not restricted to LC0. They cover more interaction models that allow a node to interact with all its direct neighborhood. These interactions are described by LC1 or LC2 (see Section 3.1.2) rules.

• Stabilization versus termination Population protocols do not halt but they stabilize. Even when stabilization is reached, the agents of the population continue interacting without changing their outputs (or even their states in case of state stabilization). We can consider the case of the T hreshold population protocol with X ≥ 5. This protocol stabilizes to a configuration where all the agents are with state q 5 . And, no matter the interactions that later take place, these states do not change. However, agents can not detect that they terminate and continue interacting. This corresponds to an implicit termination in distributed systems. On the other hand, a task with graph relabeling system R terminates if R is noetherian: that is there is no more applicable relabeling rule and the graph becomes R-irreducible. Graph relabeling system can even be designed to be able to detect this termination with: local detection of local termination, local detection of global termination, etc.

• Control mechanisms on the interactions Graph relabeling systems offer some control mechanisms on the interactions by describing relabeling rules with priorities or with forbidden contexts. The application of a relabeling rule, in a relabeling system with priorities, depends on some global knowledge about the network. This knowledge concerns the existence or not, in the labeled graph, of an occurrence of another relabeling rule that has the priority. Also, the application of a rule with a forbidden context, requires some awareness about the states of the neighbors of the nodes involved in this relabeling rule. This is possible thanks to the interactions such as LC1 and LC2 that allows a node to communicate with all its neighborhood. Unlike the graph relabeling systems, the (mediated) population protocol model does not define such control mechanisms in its transition rules. This is due to the fact that, each entity in this model, only knows its current state and the state of the agent it communicates with (and the state of the edge linking them). It has no 3.1. From Population Protocols to Tasks with Graph Relabeling Systems idea about the states of the rest of the population, not even those of its closest neighbors. Consequently, there is no possibility to check if a given priority or a forbidden context is respected while a pairwise interaction takes place.

Using these control mechanisms is one of the elements that make possible the design of graph relabeling systems with termination detection. We are going to illustrate this through the example of a leader election over a complete graph realized with the two models: a task with a graph relabeling system, and a population protocol.

For this computation with the first model, we start by considering the following graph relabeling system R EC = (L EC , I EC , P EC ) with: L EC = {N, F, E}, I EC = {N } and

P EC = {R 1 , R 2 } [14]
. The rules of P EC are as illustrated in Figure 3.11. We consider a task T EC with an input labeling L i = I EC and an output labeling L o = {F, E}. Both, the initialization function and the output extraction function of T EC are the identity function. Let K n be a L i -labeled complete graph in the domain of T EC . A realization of T EC over K n with respect to the graph relabeling system R EC leads to the election of a unique vertex. Thanks to the forbidden context, the last vertex labeled N knows that it is the only remaining N in the graph and becomes E. The relabeling phase thus terminates and this elected vertex E can locally detect the global termination of the computation. Now, we focus on this computation with the second model. We therefore consider the Leader Election population protocol presented in the previous chapter (see Section 2.2.3) running over a complete graph. When the protocol stabilizes, the elected agent is also the only remaining agent with state L. However, as no knowledge about the direct neighborhood is allowed, this agent is not able to detect that it is the only remaining L in the population. Consequently, it is enable to locally detect any termination.

F N N N R 1 : E N R 2 : N N ,
We can thus notice, how the possibility, or not, of using control mechanisms has an effect on the termination detection.

Mapping a Realization of a Task with a Graph Relabeling System to a Computation of a Population Protocol

In spite of the differences between these two models presented in the previous section, the mapping approach of a (mediated) population protocol to a task with graph relabeling system established above, is still valid.

A Bridge between Population Protocols and Other Interaction Models

In fact, any (mediated) population protocol can be translated to a task with a graph relabeling system with only LC0 relabeling rules and with no priorities or forbidden context. The graph relabeling system will be noetherian only if the population protocol has a state-stabilization. By preserving the direction of the edges of the interaction graph, we preserve the order of the pair of interacting nodes at each computation step. Consequently, symmetry breaking is not altered. In fact, in a directed edge of a LC0 relabeling rule, the source represents the initiator and the target represents the responder.

However, this comparative study implies that the mapping of a realization of a task with a graph relabeling system to a computation od a (mediated) population protocol is not always possible. As a matter of fact, a task with a graph relabeling system can be mapped to a (mediated) population protocol, only if the following conditions are respected:

1. The graph relabeling rules of the graph relabeling system should be described as LC0 rules only (no LC1, or LC2, or single node relabeling rules) with no forbidden contexts or priorities. If the LC0 relabeling rule is described over an undirected edge, the left hand side endpoint will stand for the initiator, and the other for the responder.

2. The labellings of the vertices (and those of the edges) described by the input and output labeling type of the task, and by the set of labels of the graph relabeling system, should be of constant size.

Accordingly, let T be a task with input, respectively output, labeling types L i and L o (including labels of constant size only). Let (G, σ L i ), with G = (V, E), be a L i -labeled graph in the domain of T where σ L i : V ∪E → L i . Let R = (L, I, P ) be a graph relabeling system such that: the elements of L are of constant size, and the relabeling rules forming P are LC0 rules with no forbidden contexts or priorities.

We consider the realization of the task T , on the labeled graph (G, σ L i ), with respect to the relabeling system R. This realization can be mapped to a mediated population protocol if labels are attributed to the edges in the initial labeled graph, or in the relabeling rules. Otherwise, it is mapped to a population protocol. This mapping associates to, each element of this realization, its correspondence in the execution of a (mediated) population protocol A = (X,Y,Q[,S],I,O,δ[,ι,ω]). These correspondences are as described in Table 3

.1.
Hence, a realization of the task T , on the labeled graph (G, σ L i ) with respect to R, can be described by a computation of the protocol A in a population whose interaction graph is G (the underlying graph of the labeled graph (G, σ L i )) and with:

• X = L i , Y = L o , • Q = L v , S = L e ,
with L v the labels from L assigned to the vertices in the labeled graph, L e the labels from L assigned to the edges in the labeled graph and L = L v ∪ L e ,

• I :

L i → L v , such that: ∀ x ∈ L i , I(x) = λ(x),
• ι :

L i → L e , such that: ∀ x ∈ L i , ι(x) = λ(x),
Computing Models for Networks of Tiny Objects

From Population Protocols to Anonymous Asynchronous Message Passing

• δ = φ -1 (P ),

• O : L v → L o , such that: ∀ y ∈ L v , O(y) = π(y), and
• ω : L e → L o , such that: ∀ y ∈ L e , ω(y) = π(y).
We can consequently conclude that representing a realization of a task with a graph relabeling system as a computation of a (mediated) population protocol is possible under some conditions. Whereas, representing the execution of a (mediated) population protocol as a realization of a task with a graph relabeling system is unconditioned.

From Population Protocols to Anonymous Asynchronous Message Passing

Angluin et al. [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF][START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF] do not specify, while describing the pairwise interactions in their model, how the communicating pairs are synchronized to simultaneously and instantaneously exchange their respective states, how the states are actually exchanged, etc. Tasks with graph relabeling systems are like the population protocols in the sense that they also make abstraction about this aspect of the communication between the processes. However, works in [START_REF] Bauderon | From local computations to asynchronous message passing systems[END_REF][START_REF] Bauderon | Graph relabelling systems: A tool for encoding, proving, studying and visualizing distributed algorithms[END_REF][START_REF] Métivier | Synchronizers for Local Computations[END_REF] established a bridge from graph relabeling systems to asynchronous message passing. They describe each synchronization needed for the application of a relabeling rule (LC0, LC1 or LC2) as a procedure based on message passing. We proceed with a similar reasoning. Indeed, as population protocols were designed for networks such as sensor networks, we suggest to describe them through another model that is less theoretical and abstracted and that is more "natural" and suitable for such networks, with only some minimalistic hypotheses. This model consists on anonymous asynchronous message passing in networks with port numbering.

The Message Passing Model

A distributed system is formed by a collection of processes and a communication subsystem [START_REF] Tel | Introduction to Distributed Algorithms[END_REF]. In case of message passing model, the communication subsystem consists on exchanging messages between the processes via the communication links. The processes use therefore specific primitives: send and receive. The send primitive enables a process to send a given message to a destination and the receive primitive allows a process to receive a message from a source. The sources and destinations of the messages can be named directly using names (or identities) of the processes, this is called direct naming. They can also be indirectly named using channels and ports numbers. A direct (respectively indirect) naming can be symmetrical where both the sender and receiver specifies the corresponding process (respectively channel), or asymmetrical where the receiver is able to receive messages from any process (respectively channel).

There are two types of message passing systems: synchronous and asynchronous [START_REF] Attiya | Distributed Computing: Fundamentals, Simulations and Advanced Topics[END_REF]. When it is synchronous, the execution is partitioned into rounds. In each round, messages are sent and received by the corresponding processes and according to the received messages, each process executes a corresponding computation step. However, if the system is 3. A Bridge between Population Protocols and Other Interaction Models asynchronous, then there is no fixed upper bound of the delivery time of messages, and also of the time separating two consecutive computation steps of a process.

A distributed system based on message passing is usually represented by a simple connected graph where an undirected edge represents a bidirectional communication link while a directed edge represents a unidirectional link. Now, if we detail a bidirectional link existing between any two processes u and v, in case of asynchronous message passing, then it will be as depicted in the following picture (Figure 3.12):

u v u v outbuf uv (m uv ) inbuf vu (m uv ) inbuf uv (m vu ) outbuf vu (m vu ) send(m uv ) transmission receive(m uv ) send(m vu ) transmission receive(m vu )
Figure 3.12: Zoom on a bidirectional communication link in asynchronous message passing system A bidirectional link, between two processes u and v, allows u (respectively v) to send messages to v (respectively u) and receive messages from it.

When u sends a message m uv to the node v, this message is placed in the out-buffer outbuf uv of the process u. The out-buffer outbuf uv contains the messages sent by u to v and that are still not delivered yet. Once, the message delivered to v, it is placed on the in-buffer inbuf vu that contains the messages coming from u and not yet processed by v. When v receives the message m uv , by dequeuing it from inbuf vu , it executes the corresponding computation step. The buffers are supposed to behave as FIFO queues.

In synchronous systems, we will suppose that the buffers are not needed anymore. We suppose that the transmission is instantaneous and that each sent message is supposed to be received and processed in the same round.

Anonymous Message Passing with Port Numbering

In anonymous networks, processes do not have unique identifiers and thus become indistinguishable. Consequently, in an anonymous network based on message passing, a process can not address a message to a specific neighbor based on its id. There are some studies that proposed an approach to break this symmetry by according names to the ports of each process. Accordingly, a process can address a message to a given neighbor by specifying, not its corresponding id, but the port's name associated to the link connecting them.

Port Numbering of Graphs

We here consider two existing works from literature. Each depends on the graph that models the network.

From Population Protocols to Anonymous Asynchronous Message Passing

Port Numbering of Undirected Graphs In [START_REF] Yamashita | Computing on anonymous networks. i. characterizing the solvable cases[END_REF], Yamashita et al. consider anonymous networks represented by undirected, simple, connected graphs. They propose to attribute names to the ports of these networks according to a local edge labeling described as follows: Definition 3.7. (Local Edge Labeling) Let G = (V, E) be a simple, connected, undirected graph. Let v be any vertex in V and let f v be a bijection from the set of edges, incident to v, to the set of positive integers {1, 2, . . . , d(v)}. Accordingly, f u (u, v) = x implies that x is the name of the port of u that corresponds to the link (u, v). A local edge labeling, or port numbering, of G is the set of functions f = {f v | v ∈ V }. This labeling may assign two different numbers to the two endpoints of a given link (u, v) ∈ E, which corresponds to • the graph representing the network is symmetric,

f u (u, v) = f v (u, v).
• the processors have both input, and output, port awareness, and

A Bridge between Population Protocols and Other Interaction Models

V , f u (u, v) = x, with x ∈ {1, 2, . . . , d(u)}, implies that f out(u) (u, v) = f in(u) (v, u) = x.

The Population Protocol Model versus the Anonymous Asynchronous Message Passing Model

We should mention that, in the sequel and in the context of population protocols, a sender can stand for the initiator of an interaction, as well as for the responder. The same holds for a receiver. Indeed, the initiator and the responder, both, play these two roles at the same time as, when exchanging their states, each sends its state and receives the state of the other agent. In this same context, messages stand for the exchanged states. In the population protocol model, as well as in the anonymous asynchronous message passing model, the agents and the processes do not have unique identifiers. However, in the anonymous asynchronous message passing model, in spite of the anonymity of the processes, a node can distinguish its neighbors thanks to port numbering. Consequently, a node can address a message to a specific neighbor. This is not the case of the population protocol model. In fact, with respect to this aspect of interaction, the population protocol model is weaker compared to the anonymous asynchronous message passing model. It supposes that a sender is not able to direct a message to a specific receiver, and the receiver also has no idea about the source (the sender) of the message it receives.

On the other hand, regarding another aspect of the communication, the population protocol model is stronger as it supposes that the interaction between the communicating pair of agents is instantaneous and bidirectional, in a population that communicates asynchronously.

When Angluin et al. [START_REF] Angluin | On the power of anonymous one-way communication[END_REF] introduced the one way population protocols model (see Section 2.2.1), they presented it as being the compromise between these two models. The one way population protocol model is a restriction of the pairwise interactions of the population protocols to one way communication. As a result, an initiator becomes unable to update its state according to the state of its responder. This model is also an adaptation of the anonymous asynchronous message passing model where processes have no control to choose the destination of their sent messages. Angluin et al. also supposed that, in this model, the initiator corresponds to the sender of a message and the responder stands for the receiver.

From a Computation of a Population Protocol to an Anonymous Asynchronous Distributed Algorithm based on Message Passing

In this section, we propose another solution which is also a compromise between the population protocol model and the anonymous asynchronous message passing. However, unlike the one way population protocols, it preserves the concept of bidirectional and simultaneous pairwise exchange of the population protocol. We mentioned above that Angluin et al. suppose that neither the initiator, nor the responder, has a control to direct its state to a specific neighbor. This reflects which is described in [START_REF] Angluin | On the power of anonymous one-way communication[END_REF], and implicitly adopted in the structure of the population protocols: the strongly anonymous message passing. Though, these two interacting agents are supposed to mutually exchange their corresponding states. However, this is still a too theoretical assumption. Such mutual

A Bridge between Population Protocols and Other Interaction Models

bidirectional exchange requires a minimum knowledge, that allows a pair of agents to distinguish each other, during their interaction, and to direct their respective states to each other. We thus think about port awareness as being this required knowledge.

In the sequel, we propose to simulate the population protocols over an anonymous asynchronous system based on message passing with port awareness. First, we start by associating to any interaction graph of a population that runs a population protocol the corresponding communication graph that describes the information (messages) flow. Then, we describe the computation of a population protocol as an execution of an anonymous asynchronous distributed algorithm based on message passing over this obtained graph.

It is important to mention that the approach we present in this section holds, not only for the population protocol model, but also for all its extensions that preserve the pairwise interactions. We just need, in this case, to add some additional details that depend on the model.

The Network Communication Graph Associated to the Interaction Graph

Let P be a population that executes a population protocol A over a communication graph G = (V, E). A possible interaction, between an initiator agent u and a responder agent v, is represented by the directed edge (u, v) in G. Yet, an interaction between this pair of agents implies that they both exchange their respective states. This supposes that information flows in both directions. Hence, the direction attributed to the edge (u, v) does not imply that the link is unidirectional, but is only required to break the symmetry between the interacting agents.

We propose now to represent the interaction graph as a graph that describes the messages flow in the network formed by the population. This graph will respect the convention introduced in Section 3.2.1 of the representation of networks based on message massing where: a directed edge represents a unidirectional communication link, while an undirected edge represents a bidirectional one. We call this graph: the network communication graph.

Consequently, we associate to any interaction graph G = (V, E) the corresponding network communication graph G = (V , E ). G is a simple undirected graph where: V = V , and for each arc (u, v) ∈ E, we associate the undirected edge (u, v) in E .

As a result, any directed edge, linking an initiator to a responder in the graph G, is represented by an undirected edge in G as depicted in Figure 3.17

From Population Protocols to Anonymous Asynchronous Message Passing

For this purpose, we propose to assign labels to the ports of G . We thus define, SB (SB standing for symmetry breaking) which is a local edge labeling of G such that: for any vertex v from V , for any link incident to v, SB v indicates the role associated to v if an interaction takes places over this link. The existence of an arc (u, v) in E implies that, if u interacts with v then, u will play the role of the initiator and v the responder. Accordingly, ∀ u, v ∈ V , the labellings SB u and SB v of the incident edges of u and v in the graph G are as follows:

• If (u, v) ∈ E and (v, u) /
∈ E then: SB u (u, v) = i, and SB v (u, v) = r. In Figure 3.18, we consider an arc (u, v) from G fulfilling this previous condition, and we illustrate its corresponding representation in the network communication graph G with SB u and SB v labellings.

u v u SB u (u, v) v SB v (u, v) u i v r Figure 3.18: Representation of (u, v) from G in G with SB u and SB v labellings • Otherwise, if (u, v) ∈ E and (v, u) ∈ E then: SB u (u, v) = SB v (u, v) = * .
The labeling * implies that the vertex u, when interacting with v, can play either the role of the initiator or the responder. The same holds for v.

We show, in Port Numbering of the Network Communication Graph As we mentioned above, a less abstracted and more realistic execution of population protocols requires a minimum knowledge that enables an agent to distinguish the neighbor it will interact with. Hence, in addition to the SB labellings, we propose to assign numbers to the ports of the graph G with a local edge labeling as described by Yamashita et al in [START_REF] Yamashita | Computing on anonymous networks. i. characterizing the solvable cases[END_REF].

Accordingly, ∀ v ∈ V , we define a local input labeling f v that assigns, to each incident link of v, a distinct number from the set {1, 2, . . . , d(v)}.

A Bridge between Population Protocols and Other Interaction Models

As a final result, the ports in G are going to have both SB labellings and port numbering. Therefore, ∀u ∈ V , ∀v ∈ N G (u), we associate to each port of u the following labeling (f u (u, v), SB u (u, v)).

We continue now with the example presented in Figure 3.19, and assign, in addition to the roles labellings of the ports, port numbering. The obtained result is depicted in Figure 3 We would mention that the graph G can also be represented as a symmetric digraph where: V = V , and for each arc (u, v) ∈ E, we associate two arcs (u, v) and (v, u) in E , such that s(u, v) = u and t(u, v) = v, and s(v, u) = v and t(v, u) = u. Assigning numbers to its ports will be according to the to complete port awareness model of Boldi et al. [START_REF] Boldi | Symmetry breaking in anonymous networks: Characterizations[END_REF].

.20. * r * i i r r r i i (2, * ) (1, r) (1, * ) (2, i) (1, i) (3, r) (1, r) (2, r) (1, i) (1, i)

Simulating the Pairwise Interactions

We now propose to map the computation of a population protocol to the execution of a distributed algorithm in an anonymous asynchronous system based on message passing.

Let A = (X, Y, Q, I, O, δ) be any population protocol, and let P be any population executing A over an interaction graph G = (V, E). If we proceed as described in the previous section, we can obtain the network communication graph G = (V , E ), associated to the interaction graph G, and labeled with SB and port numbers. The graph G is, in fact, the representation of the anonymous asynchronous system over which the distributed algorithm simulating A is going to run. This distributed algorithm is a collection of identical local algorithms that we denote by Algo.

The agents running the protocol A are the processes forming G and executing the Algo algorithms. And, the messages that are going to be transmitted over G are the states exchanged in A. A local algorithm Algo should preserve the bidirectional and simultaneous exchange of these states in spite of the asynchrony of the network.

To be able to communicate simultaneously, the pair of interacting agents should be synchronized. In literature, there are procedures designed to synchronize processes in anonymous asynchronous systems based on message passing with port awareness. Further details about such procedures are going to be provided in the next chapter. But 3.2. From Population Protocols to Anonymous Asynchronous Message Passing meanwhile, we make an abstraction about the implementation details of these procedures. We just suppose that an algorithm Algo, run by an agent u, requires a synchronization procedure that we denote T rySynchronization(u).

This function returns for each agent u two parameters. These parameters are different from 0, only if the agent u succeeds in having a synchronization with one of its neighbors. Let c(u) denote the neighbor with which u is synchronized. The first output of T rySynchronization(u) corresponds to f u (u, c(u)), which is the port number associated to the edge linking this agent u with its neighbor c(u). The second parameter corresponds to SB u (u, c(u)), which is the role associated to the agent u during this interaction. Now, once the pair of interacting agents is synchronized, roles are attributed according to the labeling SB. Both agents will play the role of a sender and of a receiver at the same time. The initiator and the responder will send their respective states to each other at the same time, and each of them will consequently receive the state of the other. Each of these processes will update its state according to the transition function and with respect to its role. Once the update is done, the current synchronization is ended and a trial for a new one is initiated.

Accordingly, the computation of a protocol A = (X, Y, Q, I, O, δ) in a population P whose interaction graph is G, corresponds to the execution of the following local algorithm Algo (Algorithm 1) by each process u in the network communication graph G associated to G. ∀u ∈ V , state u denotes the state of the process u, standing for agent u, in this algorithm. The value of this state is initialized according to the input of the agent u in the population P, and to the input function I of the protocol A.

We can notice that, once the initialization is done, the remaining code in Algorithm 1 belongs to an infinite loop. In fact, an agent executing a population protocol does not halt, so the process representing it will infinitely execute this code. (port, role) ← T rySynchronization(u);

6:
if (port = 0) then 7:

Send(state u , port);

8:
Receive(state c(u) , port);

9:

Apply a transition rule (if applicable) of the transition function of A with respect to the attributed role role.

A Bridge between Population Protocols and Other Interaction Models

System based on Message Passing. We propose to map the computation of the population protocol T hreshold (see Section 2.1) to the execution of a distributed algorithm in an asynchronous anonymous system based on message passing with complete port awareness. This distributed algorithm, corresponding to this protocol, consists on a set of local algorithm Algo, described by Algorithm 2, and that are run by each process u in this system. A process u, as we mentioned above, stands for agent u in the population. (port, role) ← T rySynchronization(u);

6:
if (port = 0) then 7:

Send(state u , port);

8:
Receive(state c(u) , port);

9:
if (role = i) then end if 23: end loop

We would just mention that, for a sake of clarity and for a simpler representation, we replaced the set of states Q of the T hreshold population protocol, by Q = {0, 1, 2, 3, 4, 5} where: the state 0 stands for the state q 0 , 1 for q 1 , etc.

Initially, a process u receives its state according to the input of agent u and to the input function I. This state can be either 0 or 1. Then, once the loop is initiated, the attributes port and role of the process u are initialized to 0. The function T rySynchronisation(u) is executed. If the value of the parameter port returned by this function is different from 0, then role will also be different from 0. This implies that u is synchronized with a neighbor c(v) with which is can interact via the link whose number is port and according to role. The process u sends its state state u via the link labeled port, and receives the state of its neighbor state c(v) via the same link. The process u, according to its role, checks if there is a transition rule, according to the transition function δ of the T hreshold protocol, that should be applied. If the process u is the initiator in this interaction, and if the sum of the states is less than 5, its state receives the sum of these states, else its state becomes 3.3. Conclusion: Bridges between Models 5. However, if the process u is the responder in this interaction, and if the sum is less than 5, its state is reinitialized to 0, else it is updated to 5. This loop will be repeated infinitely. When the computation stabilizes, if there is at least 5 processes that started with state 1 (that is there at least 5 sick agents initially), the state 5 will be spread in the whole network. Otherwise, the state that represent the sum of the "ill" processes (which is for sure less than 5 in this case) will be a swapping state over the network.

Conclusion: Bridges between Models

Thanks to the comparative studies and mapping approaches presented in this chapter, we established some links between three different models that are: the (mediated) population protocols, tasks with graph relabeling systems and the anonymous asynchronous message passing. We summarize the result in Figure 3 Indeed, in one hand, Bauderon et al. [START_REF] Bauderon | From local computations to asynchronous message passing systems[END_REF] have defined the link between the second and the third one by expressing distributed algorithms defined by graph relabeling systems with those based on anonymous asynchronous message passing.

On the other hand, Chalopin et al. [START_REF] Chalopin | Proceedings, chapter A Bridge Between the Asynchronous Message Passing Model and Local Computations in Graphs[END_REF] worked on expressing distributed anonymous For our part, we first designed a mapping approach between the first and the second model. These two models, both, use abstract communication models. The red arc, linking the first model to the second one, traduces the possibility of mapping the computation of a (mediated) population protocol to a realization of a task with a graph relabeling system. Whereas, the reverse is not always possible, and we represent it in the figure by a dashed red arc. In fact, we proved that mapping a realization of a task to the computation of a (mediated) population protocol is only possible under some conditions.

Then, we established a bridge (represented by a red arrow) between the first and the third model that uses explicit communications. This allows us to represent the computation of a (mediated) population protocol as a distributed algorithm, based on message passing, and running in an anonymous asynchronous system. Hence, the possibility of a more realistic execution of such protocols can be illustrated. Concerning the mapping of a distributed asynchronous anonymous algorithm, based on message passing, to a computation of a (mediated) population protocol, we think it is possible under some specific conditions. However, we do not explore them in this work.

In the following chapter, we are going to take advantage from these established links between models, and more specifically, from the bridge between the (mediated) population protocols and the anonymous asynchronous message passing. In fact, we are going to propose some scheduling procedure designed for populations protocols and described through anonymous asynchronous distributed algorithms based on message passing.

Schedulers in Distributed Systems

A scheduler in a distributed system is a theoretical entity that simulates the environment and orchestrates the actions of the processes in the system. Likely, a scheduler in the context of population protocols decides which pair of agents is going to communicate at each step of the computation of the protocol.

Based on the mapping approach that we established in the previous chapter, we propose an implementation based on message passing of the Random Scheduler, a scheduler proposed by Angluin et al. for the population protocol model.

We also introduce, in this chapter, a new fair probabilistic scheduler designed for the population protocol model, and also for any other model extending it, as long as it preserves the pairwise interactions concept. We call this scheduler the Handshake Scheduler, and denote it by the HS Scheduler. It is based on randomized handshakes. Thus, unlike the already proposed schedulers, the HS Scheduler can allow, at each step of the computation, to more than only one pair of agents to communicate. In fact, it synchronizes pairs of agents forming matchings over the interaction graph of the population.

We start thus by giving an overview of the existing schedulers and fairness conditions in distributed systems, and especially in the context of population protocols. We focus on the Random Scheduler for which we propose an implementation based on message passing. We then give a definition of the model of the new scheduler, that we introduce, as well as its implementation. This implementation is based on a randomized handshake algorithm. We finally prove, through an analysis study, that this scheduler is fair with probability 1. These results appeared in [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF] and in [START_REF] Ouled Abdallah | A totally distributed fair scheduler for population protocols by randomized handshakes[END_REF].

Schedulers in Distributed Systems

The execution of a distributed computing system may be influenced by many facts: the asynchrony of the processes, their mobilities, their energies, ... in short the environment as a whole. In fact, the environment has an impact on the selection of the processes that can be activated, on the order of their activation and also on the interactions that can take place between these different processes. In literature, these facts, as well as their caused nondeterminism, are captured by an abstraction which is the scheduler. The scheduler can also be called the demon, or the adversary, when it refers to a hostile environment.

A possible definition of a scheduler can be the following:

Definition 4.1. (Scheduler) Given a protocol that runs over a distributed system, a scheduler can be considered as a function that assigns to this protocol a subset of all its possible executions.

The scheduler orchestrates tasks and actions in a distributed system by determining, at each step of the computation, which enabled processes are going to be executed. A process is considered as enabled if, given its state, and sometimes the states of its neighbors, it is able to make a computation step (an action): it is ready to be activated.

Basically, there are two main types of schedulers for distributed systems [START_REF] Ghosh | Distributed systems : an algorithmic approach[END_REF]:

• Central (or Sequential) Schedulers A central scheduler allows to only one enabled process to perform a computation step and wait until it finishes before proceeding in choosing and activating another enabled process [START_REF] Edsger | Self-stabilizing systems in spite of distributed control[END_REF].

A central scheduler serializes a distributed computation.

A Distributed Fair Scheduler by Randomized Handshakes

• Distributed Schedulers A distributed scheduler can pick any subset of the enabled processes to be privileged to make a computation step concurrently.

While presenting a taxonomy of the existing types of schedulers in [START_REF] Dubois | A taxonomy of daemons in self-stabilization[END_REF], the authors introduced the following concept of k-centrality, that allows a more specified classification: Definition 4.2. (k-centrality) A scheduler is k-central if it allows only the processes separated by at least k hops to be simultaneously scheduled.

Consequently, with respect to this definition, a 0-central scheduler corresponds to the distributed scheduler as, whenever is the distance separating the enabled processes, they can be allowed to be executed simultaneously. Whereas, the diam(G)-central, where diam(G) denotes the diameter of the graph G representing the distributed system, is the central (or the sequential) scheduler.

In addition to this classification, schedulers can also be characterized differently. The distributed scheduler that picks all the enabled processes at each step is called the synchronous scheduler [START_REF] Neggazi | Stabilization, Safety, and Security of Distributed Systems[END_REF].

When the scheduler assigns, to each enabled process, a probability p to be chosen, it is called a probabilistic scheduler [START_REF] Beauquier | Proceedings 8th International Symposium: Stabilization, Safety, and Security of Distributed Systems, chapter All k-Bounded Policies Are Equivalent for Self-stabilization[END_REF].

Fairness

The correctness of a distributed algorithm, running over a distributed system, usually depends on the presumed scheduler. To guarantee the success of the task of the distributed system, the scheduler should be computation-friendly: it should not avoid any possible step forever. Therefore, the scheduler should satisfy a fairness property [START_REF] Ghosh | Distributed systems : an algorithmic approach[END_REF].

The population protocols are distributed algorithms running over distributed systems (the populations). Hence, their executions should also satisfy some fairness condition. In this context, Angluin et al. [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF], Fisher et al. [START_REF] Fischer | Self-stabilizing leader election in networks of finite-state anonymous agents[END_REF], and Chatzigiannakis et al. [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF] gave formal definitions of the different possible fairness conditions.

Fairness Condition According to Angluin et al.

When they introduced the population protocol model, Angluin et al. assumed a fairness condition that guarantees that any possible execution may occur. Consequently, any live-lock that can be caused by looped executions is avoided.

More formally, this fairness is characterized by the following condition [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]:

Definition 4.3. (Fairness) Let EX = C 0 , C 1 , . . . , C i , .
. . be an infinite execution such that for each i, C i → C i+1 . EX is fair if for every possible transition C → C , if C occurs infinitely often in this execution, then C occurs infinitely often.

Fairness Condition According to Fisher and Jiang

Fisher and Jiang presented in [START_REF] Fischer | Self-stabilizing leader election in networks of finite-state anonymous agents[END_REF] more detailed definitions of the different possible fairness conditions for scheduling in population protocols. They based their approach on extended definitions of some basic elements in a population protocol.

Fairness

First, the transition function is supposed to be as the one defined for population protocols with stabilizing inputs (see Section 2.2.2), and which is :

δ : (Q, X) × (Q, X) → (Q, Q).
An input assignment is defined as being the mapping from V to X. An action is a pair (r, e) where: r is a transition from the transition function δ, and e is an edge from the interaction graph over which the protocol runs. Now, let C and C be two configurations. Let α be an input assignment, and let e = (u, v) be an edge from the interaction graph. Let σ = (r, e) be an action with r = ((p, x), (q, y)) → (p , q ) and e = (u, v).

We can say that σ is enabled in (C, α) if:

C(u) = p, α(u) = x, C(v) = q, and α(v) = y. (C, α) goes to C via σ, denoted (C, α) σ → C , if: σ is enabled in (C, α), C (u) = p , C (v) = q and C (w) = w, ∀ w ∈ V -{u, v}.
If for some action σ, we have (C, α) σ → C , then we can say that: (C, α) goes to C in one step, and that σ is a taken action.

According to these definitions, the authors presented, formally, the following fairness conditions of different strengths, with respect to an execution EX = (C 0 , α 0 ), (C 1 , α 1 ), . . . , (C i , α i ), . . .: In other words, this means that the step (C, α) → C is taken infinitely many times in EX. Definition 4.5. (Strong Local Fairness) For every action σ, if σ is enabled in (C i , α i ) for infinitely many i, then (C i , α i ) σ → C i+1 for infinitely many i. This means that σ is taken infinitely many times in EX.

The fairness condition can be local or global. The fairness condition is local if, it asserts that each action that can be taken infinitely often is actually taken infinitely often. However, it is global if it asserts that each step that transitions the system from a configuration C to another configuration C , and that can be taken infinitely often, will actually be taken infinitely often.

The authors stated that global fairness implies local fairness [START_REF] Fischer | Self-stabilizing leader election in networks of finite-state anonymous agents[END_REF].

In addition to strong fairness, there are also weak forms of fairness:

A Distributed Fair Scheduler by Randomized Handshakes

We can notice that, unlike the strong fairness that requires that particular steps should occur infinitely often in the execution, the weak fairness only insists that the resulting configurations from these steps occur infinitely often.

According to these definitions, the fairness condition introduced by Angluin et al. can be classified as being a weak global fairness. Indeed, Angluin et al. assume that local fair scheduling rarely exists in real distributed systems, and that global fairness traduces better realistic scheduling for such systems [START_REF] Angluin | Self-stabilizing population protocols[END_REF].

Fairness Condition According to Chatzigiannakis et al.

Unlike the two previous works, Chatzigiannakis et al. focused, not on the fairness of an execution of a population protocol, but on the properties that a probabilistic scheduler for population protocols should satisfy to be fair with probability 1 [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF].

Therefore, they started by introducing a formal definition of a probabilistic scheduler with respect to (w.r.t) a transition graph. We should mention that a transition graph can be described as follows: In other words, for each configuration C from the transition graph, for any t ≥ 1, if C is encountered for the t th time, then there is a probability distribution d C t over Γ + (C) that specifies with which probability C will go to any configuration C such that C is reachable from C in one step.

Then, Chatzigiannakis et al. [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF] introduced the consistency property of a probabilistic scheduler w.r.t. a transition graph and that can be defined this way: Given this definition, we can consider that a consistent probabilistic scheduler w.r.t T (A, G) assigns a label to each directed edge of T . Each edge label is the probability to go 4.3. Existing Schedulers for Population Protocols from the configuration representing the source of this directed edge to the configuration corresponding to the target of this edge.

More formally, this labeling can be a mapping P from E(T ) to [0, 1], such that for any configuration C i ∈ V (T ), C j ∈Γ + (C i ) P (C i ,C j ) = 1, where P (C i ,C j ) is the probability to go from the configuration C i to C j . These probabilities do not depend neither on time nor on the number of times a configuration is encountered.

Introducing these definitions allowed the authors to present the following theorem. This theorem states the conditions that should be satisfied by a probabilistic consistent scheduler to be fair with probability 1 [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF].

Theorem 4.1. (Fair Scheduler with Probability 1) Any consistent scheduler, for which it holds that P (C i ,C j ) > 0, for any protocol A, any communication graph G, and all configurations C i , C j ∈ V (T (A, G)) where C i → C j and C i = C j , is fair with probability 1.

In this work, we will rather focus on this last definition of fairness that concerns probabilistic schedulers.

Existing Schedulers for Population Protocols

The population protocol model is based on pairwise interactions. Scheduling will therefore consist on deciding which pairs of agents will communicate, and in what order. In this context, the enabled processes are not any more single processes, as it is usually presumed on distributed systems, but ordered pairs of processes able to communicate. Choosing an ordered pair of agents from a population, corresponds to choosing an ordered pair of neighbor nodes from the interaction graph (or in other words enabled edges from the interaction graph). Thus, an enabled process that could be picked by the scheduler in population protocols can also be described as being a directed edge from the interaction graph.

Different schedulers were proposed for population protocols (and that are also valid for any variant or extension of this model as long as it preserves the pairwise interactions concept). There are schedulers that act without having any knowledge of the protocol. Whereas, there are those that do know the protocol and take this knowledge into account. Definition 4.11. (Protocol Oblivious vs Protocol Aware Scheduler) A scheduler is called protocol oblivious (or agnostic) if it constructs the interaction pattern without any knowledge on the executed protocol, and protocol-aware if it takes into account the information concerning the underlying protocol.

According to this classification, we list below the existing schedulers designed for population protocols.

Protocol Oblivious Schedulers

In [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF], Angluin et al. presented the probabilistic population protocol model. This model corresponds to the population protocol model where interactions are scheduled by a probabilistic scheduler called the Random Scheduler.

A Distributed Fair Scheduler by Randomized Handshakes

The Random Scheduler

The Random Scheduler is protocol oblivious. Whatever the protocol run by the population is, this scheduler always acts similarly. All the pairs of agents have the same probability to interact.

At each step, the scheduler chooses independently, randomly and uniformly only one edge from the interaction graph, which is one ordered pair of agents. Once two agents are picked by the scheduler, they are allowed to interact. They communicate their corresponding states to each other, and then update them according to the transition function of the protocol.

Given this random, uniform and independent choice, Angluin et al. stated that the Random Scheduler is fair with probability 1 [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. Also, Spirakis et al. proved that this scheduler is fair with probability 1 with respect to their fairness condition [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF].

Protocol Aware Schedulers

Chatzigiannakis et al. proposed, in [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF], three probabilistic schedulers that are, unlike the Random Scheduler, protocol aware. Yet, each has its own way of taking into account the population protocol that will be run over the population.

We suppose, in what follows, that G = (V, E) represents the interaction graph over which the population protocol runs.

The State Scheduler

The State Scheduler proceeds as follows at each step of the computation of the protocol. It first chooses independently and uniformly at random an ordered pair of states (q 1 , q 2 ) from all the interaction candidates of the current configuration. An ordered pair of states (q 1 , q 2 ) is an interaction candidate under a configuration C if: ∃ (u, v) ∈ E such that C(u) = q 1 and C(v) = q 2 . Then, the scheduler chooses, independently and uniformly at random, only one ordered pair of nodes related by an edge in E, and whose states are (q 1 , q 2 ). These chosen nodes can thus communicate and update their states according to the transition function.

Chatzigiannakis et al. proved that this scheduler is fair with probability 1 [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF]. Now, let consider the execution of the population protocol 3-States Approximate Majority (see Section 2.2) under the scheduling of the State Scheduler. We recall that the set of states of this protocol is Q AM = {x, y, b}. Then, for any configuration C, the set of states that can be interaction candidates under C should be a subset of the following set {(x, x), (x, y), (x, b), (y, y), (y, x), (y, b), (b, b), (b, x), (b, y)}. The State Scheduler chooses independently and uniformly at random an ordered pair which is an interaction candidate under the current configuration. Let suppose that the chosen one is the pair (x, y). Now, from all the edges in the interaction graph whose extremities are nodes representing agents with states (x, y), the scheduler should pick uniformly at random only one of them. Then, the pairwise interaction can take place, and the states can be updated.

According to [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF], the processing of this scheduler permits, more often, the choice of meaningful transitions that lead to the protocol's progress.

Existing Schedulers for Population Protocols

The Transition Function Scheduler

The protocol awareness of this scheduler is shown through the choices it makes concerning the communicating pairs. These choices are based on the transition function rules of the protocol. The scheduler chooses pairs that, when they communicate, will lead to the protocol progress: that is at least the state one of the initiator or the responder will modify its state, and it ignores all the transitions where no state changes.

To reach a configuration C from a configuration C, the scheduler proceeds as follows. First, it picks independently and uniformly at random a pair ((q 1 , q 2 ), (q 1 , q 2 )) where (q 1 , q 2 ) is an interaction candidate under C and δ(q 1 , q 2 ) = (q 1 , q 2 ). Then, it chooses independently and uniformly at random an ordered pair of nodes (u, v) ∈ E, whose states correspond to (q 1 , q 2 ) under C. Then, to obtain C , the transition function is applied to (q 1 , q 2 ) to update their states.

In case the Transition Function Scheduler can not find any pair able to lead to the protocol progress, it works like the Random Scheduler. Let us take the example of the One Way Epidemic population protocol consisting of:

• X OW = Y OW = {1, 0} with 1: the input (respectively output) of an infected agent and 0: the input (respectively output) of a non infected agent,

• Q OW = {q 0 , q 1 },

• I OW : 0 → q 0 , 1 → q 1 ,
• O OW : q 0 → 0, q 1 → 1, and

• δ OW (q 1 , q 0 ) = (q 1 , q 1 ).

Usually non described transitions in a population protocol are those that are non effective (also called identity transitions ). They are those that leave both the state of the initiator and that of the responder unchanged. For this protocol, they consist on: δ OW (q 0 ; q 0 ) = (q 0 ; q 0 ), δ OW (q 0 ; q 1 ) = (q 0 ; q 1 ) and δ OW (q 1 ; q 1 ) = (q 1 ; q 1 ).

We consider now the execution of this protocol under the Transition Function Scheduler. The only effective transition rule in this protocol concerns the pair of states (q 1 , q 0 ). Thus, at each step of the computation, the Transition Function Scheduler checks if, among the pairs of states that are interaction candidates under the current configuration, there exist pairs (q 1 , q 0 ). If it is the case, the scheduler picks independently and uniformly at random an ordered pair of nodes from all the pairs (u, v) ∈ E such that, the state of u is q 1 and the state of v is q 0 . Hence, the effective transition rule can be applied, and consequently the protocol progresses. Otherwise, the Transition Function Scheduler acts as the Random Scheduler by choosing independently and uniformly at random a pair of ordered neighbor nodes from G.

Chatzigiannakis et al. proved in [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF] that this scheduler is fair with probability 1.

A Distributed Fair Scheduler by Randomized Handshakes

The Modified Scheduler

The Modified Scheduler is a slightly modified version of the State Scheduler. It distinguishes two classes of transition rules: a class of non effective transition rules and a class composed of the remaining rules. It selects, with a probability 1-ε, rules from the class of identity rules and with probability 0 ≤ ε ≤ 1 rules from the other class. The probability of each class is evenly divided between its members.

The knowledge that both the State Scheduler and the Transition Function Scheduler have concerning the transition function of the protocol is used so that the protocol progresses easier and faster. The strategy is to try to avoid spending steps in non effective transitions. However, in the case of the Modified scheduler, the strategy can be totally the opposite. In fact, this scheduler can lead the protocol to its worst case scenario by choosing a very small ε, and consequently by choosing with a high probability the identity transition rules.

In spite of this possible behavior, Chatzigiannakis et al. [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF] proved that the Modified scheduler is fair with probability 1.

Equivalence between Schedulers

As shown in the previous section, there are different fair probabilistic schedulers that are designed for population protocols. The authors of [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF] proposed to introduce two metrics to compare these fair schedulers with each other. These two metrics are: time equivalence and computational equivalence. They allow to check if two schedulers affect similarly the performance, and respectively the correctness, of a protocol.

Time Equivalence

Two probabilistic schedulers are time equivalent if they satisfy the following characterization [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF]: Definition 4.12. (Time Equivalence) Two fair probabilistic schedulers S 1 and S 2 are called time equivalent with respect to a protocol A iff all computations of A under S 1 and under S 2 , beginning from the same initial configuration, take asymptotically the same expected time (number of steps) to converge. [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF], that the State Scheduler and the Transition Function Scheduler are time equivalent with respect to the One way Epidemic protocol (see Section 4.3.2). In fact, the computation of this protocol under the scheduling of the State Scheduler or the Transition Function Scheduler requires in both cases O(n) interactions to reach the protocol's stabilization. However, with respect to the same protocol, the Random Scheduler is not time equivalent to them, as any computation under its scheduling requires Θ(n log n) interactions [START_REF] Angluin | Fast computation by population protocols with a leader[END_REF].

Chatzigiannakis et al. proved, in

Computational Equivalence

The second metric proposed by Chatzigiannakis et al. to establish a comparison between probabilistic schedulers is the computational equivalence described as follows [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF]: 4.5. The Random Scheduler Procedures Definition 4.13. (Computational Equivalence) Two fair probabilistic schedulers S 1 and S 2 are called computationally equivalent with respect to a protocol A iff for all computations of A under S 1 and under S 2 , beginning from the same initial configuration, A stabilizes to the same output assignment with high probability.

Lemma 1, from [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF], states that the 3-States Approximate Majority (see Section 2.2) errs under the Transition Function Scheduler with a constant probability, when the initial number of agents with state x, N x , is a Θ(N y ) (with N y the initial number of agents with state y). This implies that a computation of this protocol under the Transition Function Scheduler, starting with a majority of x and with N x is Θ(N y ), can stabilize to a configuration where the minority y wins. However, this can never happen if this protocol runs under the scheduling of the Random Scheduler. We can therefore establish that the Transition Function Scheduler is not computationally equivalent to the Random Scheduler w.r.t the 3-States Approximate Majority protocol.

We can consequently conclude that probabilistic schedulers, even if they satisfy the same fairness condition, are not necessarily equivalent.

The Random Scheduler Procedures

When authors introduced schedulers for the population protocol model, they just described how these schedulers proceed to choose an ordered pair of agents to interact.

In this section, we consider the possible implementations of such theoretical entities, and more specifically the implementation of the Random Scheduler. We present a procedure proposed by Becchetti et al. [START_REF] Becchetti | First Experiences with the Implementation and Evaluation of Population Protocols on Physical Devices[END_REF]. Then, we propose our solution that, unlike the previous one, preserves the anonymity of the agents [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF]. It is also designed according to the mapping model between population protocols and anonymous asynchronous message passing (see Section 3.2.4), and stands for the procedure T rySynchronization() in this context.

Random Scheduler Procedure: Becchetti et al.

Experiments of population protocols in a sensor network are presented in [START_REF] Becchetti | First Experiences with the Implementation and Evaluation of Population Protocols on Physical Devices[END_REF]. Becchetti et al. considered a population of agents, each equipped with a sensor. These sensors are able to communicate via a wireless media. The agents are placed in the same room, therefore the interaction graph is supposed to be complete. Also, each agent u has a unique identifier Id u .

Becchetti et al. supposed that the population protocols running in this population are scheduled by the Random Scheduler. They therefore proposed an algorithm that simulates the processing of this scheduler, described by Algorithm 3.

This algorithm consists on two phases: a setup phase, and a neighborhood discovery and leader election phase. The basic idea is to elect a leader in this population, that is going to play the role of the initiator. Then, this leader chooses one of its neighbors to be a responder.

First, each agent u generates a random number Rd u which is a combination of its identifier and its local time. m(Id v , Rd v ) ← the message received from a neighbor v;

8: if (Id v / ∈ N eighborsList) then 9:
Add Id v to N eighborsList; Randomly select a responder v from N eighborsList;

17:

end if 18: end loop Then, it starts discovering its neighborhood. Concurrently, a leader election process is initiated to nominate the initiator of the interaction in the network. Each agent initially has an initiator flag set to true and an empty list of neighbors. It starts by periodically broadcasting a message containing (Id u , RD u ). Respectively, it receives messages from its neighborhood.

When an agent i receives a message from its neighbor j, the agent i checks its neighbors list. If Id j does not appear there, i adds it. Then, i compares its Rd i to Rd j . If Rd i > Rd j , agent i maintains its initiator flag to true and considers that it still has the chance to be chosen as initiator. If Rd i < Rd j , i sets its initiator flag to false. Otherwise, if Rd i = Rd j , then the identifiers are compared, and if i has the highest Id it maintains its initiator flag to true.

As the interaction graph is complete, each agent is going to discover all the other agents of the population as neighbors, and eventually only one agent will maintain an initiator flag set to true. This initiator chooses randomly one neighbor (that will be the responder) to interact with.

When the initiator and the responder are both designated, the communication can take place. Once the interaction ends, the agents restarts all the procedure so that a new pair will be chosen to communicate. This procedure permits in fact a central scheduling where only one ordered pair of agents is chosen and enabled to communicate at each step of the computation. Using the message passing as a communication model for such networks is a suitable choice. Yet, in this scheduling procedure, the agents are not anonymous, which does not respect the anonymity hypothesis of the population protocols.

The Random Scheduler Procedures

Random Scheduler Procedure: Our Proposition

We propose an algorithm describing the Random Scheduler running in complete interaction graphs, and which is an enhancement of a result that we presented in [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF].

We consider the mapping of populations protocols to distributed algorithms running over anonymous asynchronous systems based on message passing (see Section 3.2.4). Accordingly, the procedure we propose, described by Algorithm 4, is based on message passing. It preserves the anonymity of the agents as no identities are assigned to the agents, but we suppose that each agent is able to differentiate its different ports thanks to port numbering. This procedure is executed by each agent in the population. Initially, each agent u starts by initiating its attribute GlobalM in to true. Then, it generates, for each of its incident links, a random number nbre. The minimum number that was generated is attributed to LocalM in, and the edge label of the link over which this minimum was generated is associated to LocalM inP ort.

Then, agent u broadcasts its LocalM in, and receives those of its neighbors. If the agent u concludes that it has generated the minimum number in the whole population, it becomes the initiator of the interaction that is going to take place. Consequently, it informs its neighbor, which is linked to it via M inP ort, that it has to be the responder. Otherwise, if the agent is aware that it has not generated the minimum number, it checks if it is requested to be a responder. If it is not the case, it becomes aware that it does not belong to the chosen pair in this computation step. This implementation guarantees that, at each step of the computation of the protocol, there is only one ordered pair of agents that are chosen to communicate. Hence, it satisfies the description of the Random Scheduler.

The procedure described by Algorithm 4 can also stand for the T rySynchronization(u) procedure, with u the process representing the agent u in the population. It picks, at each computation step, only one ordered pair of agents to communicate. For each agent of this chosen pair, this procedure assigns non zero values to the parameters role and port. For the remaining agents, these parameters maintain their initial values, that equal 0. Hence, by introducing this procedure to the local algorithm Algo (see Algorithm 1), we obtain a description of the pairwise interaction process in a population protocol: the scheduler synchronizing a pair of agents, then the bidirectional and simultaneous communication. This latter was not explored in [START_REF] Becchetti | First Experiences with the Implementation and Evaluation of Population Protocols on Physical Devices[END_REF]. Remark 4.1. We would mention that the implementation described by Algorithm 4, as well as the one described by Algorithm 3, totally corresponds to the processing of the Random Scheduler. They are both randomized procedures whose results are the random choice of only one ordered pair of agents to communicate. Each ordered pair is chosen with the same probability, which is 1 n(n-1) . Therefore, we do not have to investigate their fairness as the Random Scheduler was already proved to be a probabilistic fair scheduler with probability 1. GlobalM in ← true 3:

for i from 1 to d(u) do

4:

Generate a random number nbre;

5:

if (i = 1) then 6:

4.6. The Handshake Scheduler

The Handshake Scheduler

According to the definition of the k-centrality (Definition 4.2), all the schedulers presented above are diam(G)-central, also called sequential schedulers, where diam(G) is the diameter of the interaction graph G over which a protocol runs. They allow only one enabled pair of agents to communicate at each step of the computation of a protocol.

In this section, we introduce the Handshake Scheduler (also denoted the HS Scheduler ) which is a new probabilistic fair scheduler based on randomized handshakes. Unlike the existing schedulers, the Handshake Scheduler is 1-central. It allows more than only one interaction to take place concurrently, as long as the picked pairs of nodes are disjoint. This scheduler can also be described as a distributed algorithm based on message passing that can be used in simulations and experiences of population protocols in real-world networks of sensors (or any tiny objects) without any need of identifiers. Compared to the implementations presented in the previous section of the Random Scheduler, the implementation of our proposed scheduler needs only one phase and does not require the completeness of the interaction graph.

Description of the Handshake Scheduler

Angluin et al. designed the population protocols as a computational model for networks of tiny artifacts where interactions take place between pairs of agents. By assuming that these protocols run under the Random Scheduler, they supposed that, at each step of a protocol's computation, only one ordered pair of agents is allowed to communicate. The same assumption was considered for the schedulers proposed by Chatzigiannakis et al.

Yet, these networks represent distributed systems where there is no centralized coordination. Consequently, more than one pairwise interaction can take place simultaneously. A distributed scheduler can capture these concurrent interactions as it is able to select, at each step of the computation, a set of enabled pairs of processes. However, to be quite suitable for the context of population protocols, this distributed scheduler has to satisfy the two following properties:

• 1-central scheduler The scheduler should take into account that an agent in a population protocol can not participate in two communications at the same time. And, once it is involved in an interaction, it should finish communicating and updating its state according to the ongoing interaction before starting a new one.

Otherwise, this can lead to erroneous states.

To illustrate this, we take the example of the following scenario. Let a 1 , a 2 and a 3 be three agents with respective states: q 1 , q 2 and q 3 . These agents belong to a given population P. Let A be any population protocol running over the population P. We suppose that among the transition rules of the transition function δ of the protocol A, there are these two following rules: δ (q 1 , q 2 ) = (q 1 , q 2 ) and δ (q 3 , q 1 ) = (q 3 , q 1 ) .

Suppose that a 1 initiates an interaction with a 2 . They both exchange their corresponding states. Based on the state q 1 of the initiator, the receiver a 2 changes its state to q 2 . Likewise, a 1 has to change its state to q 1 . However, suppose that in 4. A Distributed Fair Scheduler by Randomized Handshakes meanwhile, a 1 is involved as a receiver in an interaction with a 3 that should normally update its state to q 1. Now, which of the two states q 1 and q 1 , the agent a 1 will adopt? Whatever a 1 's chosen state is, one of the agents a 2 or a 3 would have changed its state based on an invalid state of a 1 . Thus, concurrent interactions between joint pairs of agents cause inconsistent configurations of the whole network.

Therefore, if a distributed scheduler is designed for population protocols, it should choose, at each step of the computation, a set of disjoint ordered pairs of enabled agents to ensure that each agent is involved in only one interaction. According to the definition of the k-centrality, this scheduler has to be 1-central: among the enabled pairs of agents, those chosen by the scheduler should be separated by at least one edge.

• Probabilistic scheduler To better reflect the randomness (non determinism) of the order in which the agents interact during a protocol's computation, caused by the asynchrony of the population and the passive mobility of the agents, the distributed scheduler should be probabilistic. It attributes to each enabled pair a probability to be picked. If this scheduler is protocol oblivious, the probability distribution as well as the choice of the communicating edges, will not be based on any knowledge of the protocol run by the population. Otherwise, these probabilities will depend on the protocol.

Given these constraints, we propose a scheduler based on the randomized handshake model, also called the randomized rendezvous model. A handshake is an agreement between two nodes to communicate together in an exclusive mode [START_REF] Zemmari | On handshakes in random graphs[END_REF]. Hence, the pairs of agents that will be chosen by the scheduler at each step will be those that are going to succeed on reaching an agreement about a handshake. Simultaneous random choices of different communicating pairs from the interaction graph are possible and the handshake guarantees that these pairs are disjoint. The probability for each pair of agents (or an edge) to be chosen by the scheduler is the probability that these two agents agree about a handshake.

We call this scheduler the Handshake Scheduler and denote it the HS Scheduler. We can represent this scheduler as a labeling HS over the edges of the interaction graph. A more formal definition can be as follows: Definition 4.14. (The Handshake Scheduler) For any population P with an interaction graph G = (V, E), for any population protocol A running in P, a scheduling of the protocol A under the Handshake Scheduler corresponds to the following mapping:

HS : E → [0, 1] e → Pr (HS(e))
with Pr (HS(e)) the probability that a handshake takes place over the edge e. Now, if we consider the computation of a population protocol under the HS Scheduler, the main basic concepts that were already presented in Chapter 2, remain the same excepting the definition of a transition.

In fact, this definition should now take into account the possible choice of, not only one, but multiple edges to go from one configuration to another. With respect to this description, we give the new definition of a transition. -∀ i ∈ {1, 2, . . . , k}, e i ∈ E, -∀ l, l ∈ {1, 2, . . . , k}, such that l = l , if e l = (u, v) and e l = (u , v ) then:

u = u , u = v , v = u and v = v .
We say that C goes to C via the set of encounters Enc, denoted C Enc --→ C , if:

-

∀ e i = (u i , v i ) ∈ Enc, C (u i ) = δ 1 (C(u i ), C(v i )) and C (v i ) = δ 2 (C(u i ), C(v i )),
-C (w) = C(w) for any node w which is not an extremity of an edge from Enc.

We say that C can go in one step to

C , denoted C → C , if C Enc --→ C
for some set of encounters Enc ⊂ E (Enc should fulfill the conditions we specified above, that is it should be a set of disjoint edges from E). C → C is called a transition.

A configuration can also be reachable from another one with more than one computation step, and thus via a sequence of configurations. As we already mentioned above, the proposed scheduler is based on the handshake model. In what follows, we give more details about this model.

The Handshake Model

In some communication models, both the sender and the receiver need to be ready to exchange information. They need to have an agreement to communicate: it is called the handshake model. This model is useful in radio networks, where if a node is called simultaneously by more than one neighbor, the received messages can be in collision. The rendezvous model is also useful in case a physical meeting is needed between the entities to communicate such as in robots networks. Moreover, in anonymous asynchronous networks, based on point-to-point communication via synchronous message passing, such an agreement is needed so that the sender and the receiver can exchange messages [START_REF] Duchon | Broadcast in the rendezvous model[END_REF].

Randomized Handshake Algorithms

Different works proposed handshakes algorithms that depend on the assumptions made on the system. We focus on the case of anonymous asynchronous networks that are based on point-to-point communication via synchronous message passing.

Angluin stated in [START_REF] Angluin | Local and global properties in networks of processors[END_REF] that there is no deterministic algorithm to implement synchronous message passing in an anonymous network that passes messages asynchronously. Therefore, if such algorithm exists, it should be a randomized algorithm.

A Distributed Fair Scheduler by Randomized Handshakes

A Synchronous Randomized Handshake Algorithm Métivier et al. proposed a randomized distributed handshake algorithm that uses a simple bit to encode messages [START_REF] Métivier | Randomized Rendezvous[END_REF][START_REF] Métivier | Analysis of a randomized rendezvous algorithm[END_REF]. In this algorithm, each node v in the network runs Algorithm 5. We would mention that we present this algorithm as it was introduced by the authors. Consequently we should outline that choosing a neighbor by a process v, in this context of anonymous processes, corresponds more precisely to choosing a port, and the neighbor c(v) is the neighbor with which v can communicate via the chosen port.

Algorithm 5

The Randomized Handshake Algorithm

1: loop 2:
Choose independently and uniformly at random a neighbor c(v); Receive messages from all the neighbors; 6: r c(v) ← the number received from c(v);

7: if (r c(v) = 0) then 8:
There is no rendezvous;

9:

else 10:

There is a rendezvous with c(v);

11:

end if 12: end loop Each node v chooses independently and uniformly at random a node c(v) (or more exactly a port number) from its neighborhood. The node v sends 1 to c(v), and 0 to the rest of its neighbors. This implies that v would like to synchronize with node c(v). There is a rendezvous between v and c(v) if they mutually choose each other by sending 1 to each other. Hence, a computation step related to the asynchronous algorithm that uses this rendezvous algorithm for synchronization can take place.

Locally, when a node v has more than one neighbor, Algorithm 5 defines how v chooses only one of them to synchronize with. This guarantees that each node in the network will be able to participate to at most one rendezvous at a given time. This handshake algorithm is hence a local mechanism that automatically and randomly performs a temporary and exclusive synchronization between two neighbors in an asynchronous environment and whose global result of is a set of disjoint pairs of synchronized nodes (matchings).

We mentioned in Chapter 3 (see Section 3.1) that, in graph relabeling systems, different relabeling rules can be applied simultaneously as long as the set of interacting nodes are disjoint. Accordingly, to encode the synchronization needed for LC0 interactions in asynchronous message passing systems, Bauderon et al. [START_REF] Bauderon | From local computations to asynchronous message passing systems[END_REF] opted for this handshake algorithm.

An Asynchronous Randomized Handshake Algorithm The randomized rendezvous algorithm proposed by Métivier et al. is a synchronous algorithm that uses an important number of messages. Indeed, each process sends a message via each of its ports.

The Handshake Scheduler

Fontaine et al. proposed, in [START_REF] Fontaine | A fault-tolerant handshake algorithm for local computations[END_REF], an asynchronous version of this algorithm that also reduces the number of messages sent over the network. In this algorithm, each process in the network proceeds as described in Algorithm 6.

Algorithm 6

The Asynchronous Randomized Handshake Algorithm

1: loop 2:
Choose independently and uniformly at random a neighbor c(v); Receive a message m from a neighbor w; There is a rendezvous between v and c(v); end if 16: end loop Each process v chooses uniformly at random a neighbor c(v), and sends it 1. Then, it remains henceforth waiting for a message from this neighbor. Consequently, there are three possible scenarios:

1. If the process v receives a message 1 from its chosen neighbor c(v), then there is a rendezvous. The processes v and c(v) are hence synchronized and a computation step (related to the asynchronous algorithm using the rendezvous algorithm for pairwise synchronization) can take place. Then, process v executes once again the algorithm.

2. If v receives a message from c(v), but whose value is 0, it concludes that c(v) has chosen another neighbor to synchronize with. There is hence no rendezvous. Consequently, process v moves to step 2 to try a new synchronization.

3. If process v still did not received a message from c(v), and in meanwhile, it receives a message 1 from a neighbor different from c(v), it sends 0 to it. The process v returns afterwards to step 4 to continue waiting for a response from c(v).

Fontaine et al. stated that this randomized asynchronous handshake algorithm is also fault tolerant, that is even if there are some faulty nodes, the algorithm is able to continue running correctly [START_REF] Fontaine | A fault-tolerant handshake algorithm for local computations[END_REF].

The Randomized Algorithm of the Handshake Scheduler

We provided in a previous section a description of the Handshake Scheduler we introduced, that shows its specificities compared to the already existing schedulers. We aim now to propose a suitable algorithm to describe the processing of this scheduler.

A Distributed Fair Scheduler by Randomized Handshakes

This Handshake Scheduler is based on randomized handshakes. Thus, we think that its corresponding algorithm can be inspired from the randomized rendezvous algorithms we presented above. As the synchronous handshake algorithm (Algorithm 5) was used for synchronization in LC0 computations, and as we already established some correspondence between the pairwise interactions in populations protocols and LC0 interactions, we opt for adopting this algorithm as a Handshake Scheduler algorithm. This proposition is applied in the context of a scheduling of the OR population protocol whose transition function is symmetric.

We then deduce that, both the synchronous and asynchronous versions of the handshake algorithm can be used to describe the Handshake Scheduler provided that symmetry breaking is added to them.

The Randomized Handshake Algorithm as a Scheduler for Population Protocols

We studied, in [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF], the broadcast in anonymous asynchronous mobile wireless sensor networks. Starting from only one informed node, the information should reach every node in the network at the end. This broadcasting process can be simulated by the OR predicate which corresponds to a logical OR over the inputs of the sensors. This predicate is stably computable by the population protocols, and more specifically by the following one that we call the OR protocol.

The OR protocol can be described by the 6-tuple (X OR , Y OR , Q OR , I OR , O OR , δ OR ) with:

• X OR = Y OR = {1, 0} with 1: the input (respectively output) of an informed agent and 0: the input (respectively output) of a non informed agent,

• Q OR = {q 0 , q 1 },

• I OR (0) = q 0 , I OR (1) = q 1 ,

• O OR (q 0 ) = 0, O OR (q 1 ) = 1, and

• δ OR : δ OR ( * , q 1 ) = δ OR (q 1 , * ) = (q 1 , q 1 ), ∀ * ∈ Q OR .
Thus, we proposed a randomized distributed algorithm based on the OR population protocol to avoid collision and information duplication problems. We represented the sensor network as an anonymous asynchronous system based on message passing, and with port numbering. Consequently, we needed to proceed according to the mapping of the computation of a population protocol to a distributed anonymous asynchronous algorithm with message passing, that we defined in Chapter 3 (see Section 3.2.4).

We proposed to use Algorithm 5 to stand for the T rySynchronization procedure and to obtain pairwise synchronizations. The synchronized pairs of agents are those that succeeded in obtaining a rendezvous.

Once two agents are synchronized, they communicate their respective states to each other. This bidirectional communication is as described in the Algo algorithm (Algorithm 1): each agent v of the synchronized pair sends its state via the port c(v), and 4.6. The Handshake Scheduler receives the state of the synchronized neighbor also via this port. If one of them is informed, and thus in state q 1 , and the second is not, the informed node forwards the information to the non informed one. The non informed node then becomes informed and updates its state from q 0 to q 1 . Otherwise, the information is not sent.

Using the randomized rendezvous algorithm ensures that, once a node is involved in a communication, it will communicate in an exclusive mode. Thus, if it receives the information, it will be from only one neighbor at a given time, which avoids collision problems. Also, communicating the respective states between two synchronized nodes, before the informed node sends the information, avoids the nodes receiving more than one copy of the information. Furthermore, as the OR predicate is stably computable by population protocols, it guarantees that the broadcast algorithm eventually stabilizes to a configuration where all the nodes receive the information.

Although the randomized rendezvous provides only the port number via which an agent v is synchronized, and not the role of v, it can stand for the T rySynchronization procedure needed by the Algo algorithm describing the OR protocol. In fact, the transition function of this protocol is symmetric. It consists of only one effective transition rule which is symmetric: δ(q 1 , q 0 ) = δ(q 0 , q 1 ) = (q 1 , q 1 ) .

Hence, the application of a transition rule in not conditioned by the role of the agent in this case as the transition function affects similarly the initiator and a responder in an interaction.

Accordingly, the randomized rendezvous can be considered, in this case, as an implementation of a distributed scheduler based on handshakes.

The Handshake Scheduler Algorithm: an Enhancement of the Randomized Handshake Algorithm

The synchronous randomized handshake algorithm, as it was used in the previous section, allows the synchronization of multiple disjoint pairs of agents in some iterations of the broadcast algorithm. This randomized handshake algorithm decides which pairs of agents will interact and in what order. However, these synchronized pairs are not ordered, which means that the initiator and the responder are not distinguished. By analogy, we can also say that using the asynchronous version of this algorithm will lead to the same result.

Not breaking the symmetry between the two synchronized agents has no consequence in the context of the protocol OR protocol or any population protocol whose transition function is symmetric. However, not all the population protocols have symmetric transition rules. Also, breaking the symmetry is a fundamental assumption in the population protocol model. Therefore, to be a suitable distributed scheduler for population protocols, each of these two randomized rendezvous should be adjusted to consider symmetry breaking.

In order to fit this requirement, we propose that instead of sending 1 when inviting the chosen neighbor c(v), each agent v generates independently and uniformly at random a value r v ∈ {1, 2, . . . , N } where N is a constant such that N ≥ 2, and sends it to c(v). A handshake takes place, if two nodes mutually choose each other and generate two different 4. A Distributed Fair Scheduler by Randomized Handshakes non zero values. The role of the initiator is be attributed to the node that generated the higher value. We also recall that population protocols were designed for asynchronous networks of agents that have constraints on memory, computational power and energy. Thus, we opt for an adjustment of the asynchronous randomized handshake algorithm (Algorithm 6) to describe the distributed handshake scheduler. In fact, on the one hand, this version of the handshake algorithm takes into account the asynchrony of the communications in the population. And, on the other hand, as it uses less messages (the 0 messages) compared to the synchronous version, it respects the constraint related to the energy of the agents.

The result of these modifications is the randomized algorithm described in Algorithm 7.

Algorithm 7

The Randomized Handshake Scheduler Algorithm

1: loop 2:
Choose independently and uniformly at random a port port c(v) ;

3:

Choose independently and uniformly at random a number r v ∈ {1, 2, . . . , N };

4:

Send (r v , port c(v) );

5:

Receive (r w , port w );

6: if (port w = port c(v) ) and (r v = r w ) then 7: if (r v > r w ) then 8:
role ← i; Return to step 2; Return to step 2; // There is no rendezvous with c(v) The randomized distributed algorithm, consisting of a collection of Algorithm 7 run by the agents of the population, plays the role of the Handshake Scheduler for a population protocol. Also, Algorithm 7 stands for the T rysynchronization procedure in the Algo algorithm according to the mapping of a population protocol to a distributed algorithm based on message passing in an anonymous asynchronous system. Once a synchronization (or a handshake) is established between two nodes, they exchange their states. If there is a transition rule involving these states, they will apply it with respect to their roles.

The Handshake Scheduler

Analysis of the Randomized Handshake Scheduler Algorithm

For the analysis of the distributed algorithm corresponding to the Handshake Scheduler, we consider a synchronous execution of Algorithm 7 (see [START_REF] Lavault | Evaluation des algorithmes distribués -Analyse, complexité, méthodes. collection Informatique[END_REF]).

Probability of at least a Handshake

Let A be a population protocol running over an interaction graph G = (V, E). We suppose that the pairwise interactions are handled by the Handshake Scheduler. We thus recall that, at each computation, this scheduler picks for interaction the ordered pairs of agents that succeeded in a handshake.

For any pair e = (u, v), such that the edge e exists in the interaction graph G, there is a handshake between agents u and v, denoted HS(e) if, and only if, c(u) = v, c(v) = u and r u = r v . Lemma 4.2. Let A be a population protocol running under the HS Scheduler in a population whose interaction graph is G = (V, E), then:

∀e = (u, v) ∈ E, Pr (HS(e)) = β d(u)d(v) , with β = 1 - 1 N .
Proof. We first note that the probability that c(u) = v is:

Pr(c(u) = v) = 1 d(u)
, where d(u) is the degree of the node u.

We also note that the probability that u and v generate two different non zero values is:

Pr(r u = r v ) = N i=1 1 N N -1 N = 1 - 1 N = β . (4.2)
Then, we obtain:

Pr (HS(e)) = Pr(c(u) = v) × Pr(c(v) = u) × Pr(r u = r v ) = β d(u)d(v) . (4.3)
In the sequel, we denote {e 1 , . . . , e m } the set of edges in the interaction graph. We also denote by HS G the event: There is at least a handshake in the graph G. The HS G and HS(e) are respectively the complement events of HS G and HS(e). Then, as described in [START_REF] Métivier | Analysis of a randomized rendezvous algorithm[END_REF], we have:

Pr HS G = Pr ∧ m
i=1 HS(e i ) Applying Proposition 1.6 gives:

Pr HS G = m i=1 Pr HS(e i ) | ∧ i-1 j=1 HS(e j ) = m i=1
1 -Pr HS(e i ) | ∧ i-1 j=1 HS(e j ) . (4.4)

A Distributed Fair Scheduler by Randomized Handshakes

Let g be any subset of E. Let ξ g (respectively ξ g ) denote the event of obtaining a handshake for at least one edge (respectively no edge) in g. Then, according to a Lemma from [START_REF] Duchon | Broadcast in the rendezvous model[END_REF] (we will give more details about this Lemma in the following chapter), we can state that:

∀ e ∈ E, Pr HS(e)|ξ g ≥ Pr(HS(e)).

This yields:

∀ 1 ≤ i ≤ m, Pr HS(e i ) | ∧ i-1 j=1
HS(e j ) ≥ Pr (HS(e i )) . Consequently, (4.4) becomes:

Pr HS G ≤ m i=1
(1 -Pr (HS(e i ))) .

(4.5)

Based on Proposition 1.15, we can write:

∀ (x i ) 1≤i≤m such that: ∀ i, 0 ≤ x i ≤ 1, we have m i=1 (1 -x i ) ≤ 1 - m i=1 x i m m .
Then, the inequality (4.5) becomes:

Pr HS G ≤ 1 - m i=1 Pr (HS(e i )) m m . (4.6)
On the other hand, we have:

m i=1 Pr (HS(e i )) = {u,v}∈E β d(u)d(v) ≥ m   {u,v}∈E β d(u)d(v)   1 m ≥ m β 1 m {u,v}∈E d(u)d(v) ≥ m β 1 m {u,v}∈E (n -1) 2 ≥ β n (n -1) 2(n -1) 2 ≥ β 2 . (4.7)
Thus, (4.6) becomes:

Pr HS G ≤ 1 - β 2m m ∼ e -β 2 . (4.8)
This yields:

Pr (HS G ) ≥ 1 -e -β
2 . (4.9)

Consequently, given the inequality 4.9, we can state the following Lemma:

4.6. The Handshake Scheduler Lemma 4.3. Let A be a population protocol running on the communication graph G = (V, E) under the HS Scheduler. Then, the probability that the HS Scheduler picks at least one ordered pair of nodes at the end of Algorithm 7 is lower bounded by 1 -e -β

2 .

The Number of Simultaneous Handshakes

Let G = (V, E) be the communication graph of a population protocol A. Let X be the random variable (r.v) which counts the number of simultaneous handshakes that can take place at the same step, and that corresponds to the number of concurrent pairwise interactions that can take place. Using the linearity of the expectation, we can obtain the expected number of X:

E (X) = (u,v)∈E β d(u)d(v) . (4.10)

Analysis of the Handshake Scheduler Algorithm in particular cases of graph structures

We consider the following particular cases of graph structures that can represent the interaction graph of a population and compute the corresponding probabilities of a handshake over an edge as well as the number of possible simultaneous handshakes.

Case of a Complete Graph Let the interaction graph G = (V, E) be a complete graph of size n ≥ 2. Then, for any e = (u, v) ∈ E, the probability of a handshake over this edge is

Pr (HS(e)) = β (n -1) 2 .
(4.11)

Accordingly, the expected number of simultaneous handshakes becomes:

E (X) = (u,v)∈E β (n -1) 2 = n(n -1) 2
β (n -1) 2 = β n 2 (n -1) . (4.12)
Case of a Random Graph G n,p In this section, we consider that the communication graph G = (V, E) is a random graph G n,p with p > 0. It is straightforward that we have some edges. The probability of a handshake over an edge e = (u, v), with e ∈ E is as described by the following Lemma. Lemma 4.4. Let G n,p = (V, E) be a random graph, and let e = (u, v) ∈ E. Then,

Pr (HS(e)|e ∈ E) = β (1 -q n-1 ) 2 (n -1) 2 p 2 . ( 4

.13)

A Distributed Fair Scheduler by Randomized Handshakes

Proof. We assume that G n,p = (V, E) is a random graph and e = (u, v) ∈ E. We study the probability of having a handshake on e conditioned on the event e ∈ E.

Pr(HS(e)| e ∈ E) = n-1 k 1 =1 n-1 k 2 =1 Pr(HS(e)| e ∈ E ∧ d(u) = k 1 ∧ d(v) = k 2 ) × Pr(d(u) = k 1 ∧ d(v) = k 2 | e ∈ E).
We already have,

Pr(HS(e)| e ∈ E ∧ d(u) = k 1 ∧ d(v) = k 2 ) = β k 1 k 2 .
Also,

Pr(d(u) = k 1 ∧ d(v) = k 2 | e ∈ E) = Pr(d(u) = k 1 | e ∈ E) × Pr(d(v) = k 2 | e ∈ E) (4.14)
On the other hand, the degree distribution of any vertex x in a random graph G n,p is binomial such as:

Pr(d(x) = w) = n -1 w p w (1 -p) n-1-w .
Thus,

Pr(d(u) = k| e ∈ E) = n -2 k -1 p k-1 (1 -p) n-1-k .
Then, from 4.14, we obtain:

Pr(d(u) = k 1 ∧ d(v) = k 2 | e ∈ E) = n -2 k 1 -1 n -2 k 2 -1 p k 1 +k 2 -2 (1 -p) 2n-2-k 1 -k 2 .
This yields

Pr(HS(e)| e ∈ E) = β n-1 k=1 1 k n -2 k -1 p k-1 (1 -p) n-1-k 2 . (4.15)
Now, we focus on:

n-1 k=1 1 k n -2 k -1 p k-1 (1 -p) n-1-k = n-1 k=1 1 k (n -2)! (k -1)!(n -1 -k)! p k-1 (1 -p) n-1-k = 1 n -1 n-1 k=1 (n -2)! k!(n -1 -k)! p k-1 (1 -p) n-1-k = 1 p (n -1) n-1 k=0 n -1 k p k (1 -p) n-1-k -q n-1 = (1 -q n-1 ) p (n -1) . (4.16)
Consequently, integrating (4.16) in (4.15) gives:

Pr(HS(e)| e ∈ E) = β (1 -q n-1 ) 2 p 2 (n -1) 2 .

The Handshake Scheduler

Note that this proof is an adaptation of the analysis already presented in [START_REF] Zemmari | On handshakes in random graphs[END_REF] to our handshake procedure, however we gave here further details of the computation.

Corollary 4.5. Let G n,p = (V, E) be a random graph, and let u and v be two vertices from V . Then,

Pr(HS(e)) = β (1 -q n-1 ) 2 (n -1) 2 p . (4.17)
Proof. Let G n,p = (V, E) be a random graph. Let u and v be two vertices from V such that u = v. The probability of a handshake between u and v can be expressed this way: There is no handshake between u and v if they are not linked by an edge from E. This yields:

Pr
Pr(HS(e)|e / ∈ E) = 0 .

Then, (4.18) becomes:

Pr(HS(e)) = Pr(HS(e)|e ∈ E) × Pr(e ∈ E) = β (1 -q n-1 ) 2 p 2 (n -1) 2 × p = β (1 -q n-1 ) 2 p (n -1) 2 . (4.19)
As a consequence of Corollary (4.5), if X n,p is the number of simultaneous handshakes in a G n,p graph and E (X n,p ) is its expected value, then:

E (X n,p ) = β n 2 (n -1) p 1 -q n-1 2 . (4.20)
We note that the expression (4.20) can be simplified for some particular values of p:

• If p is a constant, then (1 -q n-1 ) 2 → 1 as n → ∞. Hence, E (X n,p ) ∼ β 2p
as n → ∞.

• If p = α log n n , with α > 1 then:

E(X n,p ) ∼ β n 2α log n , as n → ∞. (4.21)
The most interesting case is the last one where p = α log n n for α > 1. Indeed, this value is the connectivity threshold for a G n,p [START_REF] Erdős | On random graphs i[END_REF][START_REF] Erdős | On the evolution of random graphs[END_REF][START_REF] Bollobas | Random graphs[END_REF].

A Distributed Fair Scheduler by Randomized Handshakes

The Fairness of the Handshake Scheduler

We introduced the HS Scheduler and proposed a randomized procedure to implement it. Now, we aim to prove that this scheduler satisfy a basic property which is fairness.

Based on the analysis results presented in the previous section, we first prove that the HS Scheduler is a probabilistic consistent scheduler. Then, we conclude that it is fair with probability 1.

The Handshake Scheduler: a Probabilistic Consistent Scheduler

We recall that a transition graph T = (V (T ), E(T )) of a protocol A running on G, also denoted T (A, G), is the directed graph whose nodes are all possible population configurations and edges are all possible one-step transitions, and that may contain self-loops.

Theorem 4.6. The HS Scheduler is a probabilistic consistent scheduler.

Proof. Let A be any population protocol running over an interaction graph G = (V, E) under the HS Scheduler. Let T (A, G) = (V (T ), E(T )) be its transition graph, and C i be any configuration in V (T ). Let C j be any configuration in V (T ) reachable in one step from C i .

We define

Enc C i C j = {Enc | Enc ⊂ E(G) and C i Enc --→ C j }.
Then, for each element Enc from Enc C i C j , we define the set E of the edges of the interaction graph G, as the union of three disjoint subsets: Enc, F 1 and F 2 . F 1 represents the set of edges that are joint to Enc. F 2 represents the set of edges that are disjoint to Enc.

More formally, ∀ Enc ⊂ Enc C i C j , we rewrite the set E as following:

E = Enc F 1 F 2 .
with:

• F 1 = {f ∈ E | if f = (u, v) then ∃ e ∈ Enc such that e = (u, v ) or e = (u , v)}, • F 2 = {f ∈ E | if f = (u, v) then ∀ e ∈ Enc, if e = (u , v ) then u = u , u = v , v = u and v = v }.
Any time C i is encountered, C j is selected with the following probability

Pr C i C j = Enc⊂Enc C i C j
Pr (HS(Enc)) Pr HS(F 2 ) .

Consequently, with respect to the transition graph T and according to Definition 4.9, we can state that the HS Scheduler is probabilistic.

The probability of handshakes on any set of edges depends on the probability of a handshake on each of its edges. We already proved in the previous section (see Lemma 4.2) that for any edge e = (u, v) ∈ E, we have:

Pr (HS(e)) = β d(u)d(v) .
This probability does not depend on time. Therefore, the value of the probability Pr C i C j will be independent of the number of times C i has been encountered. This leads us to conclude that the HS Scheduler is also consistent.

Conclusion

The Handshake Scheduler: a Fair Scheduler with Probability 1 Theorem 4.7. The HS Scheduler is fair with probability 1.

Proof. Let A be any population protocol whose interaction graph is G = (V, E) and that runs under the scheduling of the HS Scheduler. Let T (A, G) be its transition graph and C i , C j be any configurations in V (T ) such that C i → C j and C i = C j .

In Theorem 4.6, we already proved that the HS Scheduler is a probabilistic consistent scheduler. Now, to prove that this scheduler is fair with probability 1, according to Theorem 4.1, we still have to prove that Pr C i C j > 0.

Based on Definition 4.15 of a transition in a computation of a protocol under the HS Scheduler, we have

C i → C j implies that: ∃ Enc ⊂ E such that C i Enc --→ C j . This means that Pr C i C j > 0.
Hence, by applying Theorem 4.1, we conclude that the HS Scheduler is fair with probability 1.

Conclusion

We were interested, in this chapter, in scheduling in population protocols. We gave an overview of the existing schedulers in literature, and that are all central. We focused on the Random scheduler and proposed its implementation as a distributed algorithm based on message passing. We then introduced the HS Scheduler, a new probabilistic scheduler for population protocols which is, unlike the existing ones, distributed. We also proposed an algorithm describing this scheduler and which based on the randomized handshake algorithms this scheduler. We presented an analysis of this Handshake Scheduler algorithm that enabled us to prove that this scheduler is a probabilistic consistent fair scheduler with probability 1.

The Random scheduler and the HS Scheduler are both protocol oblivious schedulers that are fair with probability 1. We would investigate now if they are also time equivalent with respect to some protocols.

Basic Notations and Statements

We introduced in the previous chapter the HS Scheduler as a new probabilistic scheduler for populations protocols. This scheduler is protocol oblivious and fair with probability 1 like the Random Scheduler introduced by Angluin et al. However, satisfying the fairness property does not imply the equivalence of the schedulers [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF].

We propose to investigate, in this chapter, the time equivalence of these two schedulers with respect to three protocols: the OR population protocol (see Section 4.6.3), the Leader Election population protocol (see Section 2.2.3) and the Maximal Matching mediated population protocol. We therefore study the complexity of the stabilization time of these protocols by considering two scheduling scenario: either under the Random Scheduler or under the HS Scheduler. We also consider different structures of interaction graphs.

We prove that the two schedulers are time equivalent with respect to these three protocols when running in complete interaction graphs. Yet, the HS Scheduler performs better in case of random interaction graphs.

It is important to note that the stabilization time corresponds to the number of steps or rounds needed for the protocol to stabilize. In the case of protocols running under the Random Scheduler, the time complexity can also be considered as being the number of interactions needed until the protocol stabilizes as there is only one interaction at each step of the computation. However, it is not the case when the assumed scheduler is the HS Scheduler as more than one interaction can take place in a round.

Basic Notations and Statements

We introduce in this section some basic notations and statements that are useful for the study we are going to establish in this chapter.

Let P be any population of n agents with n ≥ 2 running a (mediated) population protocol. Let G = (V, E) be the interaction graph of this population, and let e = (u, v) be any edge from E.

We recall that HS(e) denotes the event of having a handshake over the edge e at a given round, and Pr(HS(e)) is the probability of this event.

For any set of edges g ⊂ E, we define: ξ g (respectively ξ g ) the event of obtaining a handshake for at least one edge (respectively no edge) in g, Pr(ξ g ) the probability of this event, and π(g) = e∈g Pr(HS(e)) (note that π(g) is not a necessarily a probability since it may be > 1).

We also recall the following lemmas and corollary stated in [START_REF] Duchon | Broadcast in the rendezvous model[END_REF]: Lemma 5.1. Let g be any subset of E. For any e ∈ E, we have:

Pr HS(e)|ξ g ≥ Pr(HS(e)).

Lemma 5.2. For any g ⊂ E, we have: Pr(ξ g ) ≥ λ min(1, π(g)), with λ = 1 -e -1 where e = exp(1).

Time Complexity

Analyses of some Protocols under the Random/HS Scheduler Corollary 5.3. For any g ⊂ E, we have:

1 Pr(ξ g ) ≤ e e -1 max(1, 1 π(ξ g ) ) ≤ e e -1 (1 + 1 π(ξ g )
).

In [START_REF] Duchon | Broadcast in the rendezvous model[END_REF], the supposed handshake model is the one introduced in [START_REF] Métivier | Analysis of a randomized rendezvous algorithm[END_REF] where the probability of a handshake is different from our model. However, in the respective proofs of these lemmas and corollary, the value of this probability was not involved. Consequently, they remain valid and suitable for our case too.

The OR Population Protocol

In this section, we study the time equivalence of the Random Scheduler and the HS Scheduler with respect to the OR population protocol (see Section 4.6.3). This protocol computes a logical OR over the inputs of the agents in a population. Initially, there is only one agent in state q 1 and the rest of the population is in state q 0 . Stabilization happens when all the agents become with state q 1 .

As presented in the previous chapter, this protocol can describe an information broadcast that starts from one agent to reach all the members of the population. It can also describe the propagation of an epidemic in a population: starting from only one infected node, the protocol stabilizes when the whole population becomes infected.

The OR Population Protocol over a Complete Graph

We now study the complexity of the stabilization time of the OR population protocol running in a population whose interaction graph is complete. The first scenario supposes that the computation of this protocol is under the Random Scheduler. The second one supposes that this computation is under the HS Scheduler.

The OR Population Protocol over a Complete Graph with the Random Scheduler

Let P be a population with a complete interaction graph K n = (V, E). We suppose that an epidemic protocol, represented by the OR population protocol, is running in this population under the Random Scheduler. Let T Kn be the expected number of interactions before this epidemic protocol, starting from one infected agent, infects all the other ones. We established, in [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF], a characterization of the time T Kn described by the following theorem.

Theorem 5.4. Let T Kn be the time needed by the OR population protocol, running in a complete interaction graph and scheduled by the Random Scheduler, to stabilize. Let E(T Kn ) be the expected value of T Kn . Then:

E(T Kn ) ∼ O(n log(n)), as n → ∞ .
Proof. The computation process of the OR protocol, where the interactions are scheduled by the probabilistic Random Scheduler, can be modeled by a Markov chain.

The OR Population Protocol

For any t ≥ 0, we denote by X t the set of agents that are infected. We also define the random variable (r.v for short) x t as the size of the set X t , for any t ≥ 0. The behavior of this r.v. can be modeled by an homogeneous increasing Markov chain whose set of vertices is {1, 2, • • • , n} and whose transitions are as depicted in Figure 5 The Random Scheduler is sequential, it chooses only one ordered pair of agents to interact at each step. Thus, the number of infected agents can increase by at most 1 at each computation step. In fact, the size of the set X t increases only when the Random scheduler picks from the interaction graph an edge that has one endpoint with state q 1 , and thus is in X t , and the other endpoint with state q 0 , and consequently belongs to V \ X t .

.1. 1 1 -2 n 2 1 -4(n-2) n(n-1) 2 n i 1 -2i(n-i) n(n-1) i + 1 2i(n-i) n(n-1)
Indeed, as the interaction graph is complete and consequently |E| = n(n-1)

2

, for any t ≥ 0, the transition probabilities are given by:

Pr (x t+1 = i | x t = j) =      2(i-1)(n-i+1) n(n-1) , if j = i -1 ≥ 1 1 -2(i-1)(n-i+1) n(n-1)
, if j = i ≥ 1 0 otherwise.

For any i ≥ 1, let T i denote the time complexity of the Markov process starting at state x t = i to reach the absorbing state x t = n, and let E i = E(T i ) denote its expected value. Then, the time complexity of the epidemic process starting from only one infected agent corresponds to T 1 , and to compute its expected value E 1 , we can solve the following system:

E 1 = 1 + 1 - 2 n E 1 + 2 n E 2 .
(5.1)

∀ 1 ≤ k ≤ n -1,
we have:

E k = 1 + 1 - 2k(n -k) n(n -1) E k + 2k(n -k) n(n -1) E k+1 . (5.2)
From (5.2), we obtain:

2k(n -k) n(n -1) E k = 1 + 2k(n -k) n(n -1) E k+1 .
Yielding:

E k = n(n -1) 2k(n -k) + E k+1 .
5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler Hence:

E 1 = n-2 i=1 n(n -1) 2i(n -i) + E n-1 .
We already have:

E n-1 = 1 Pr(x t+1 = n|x t = n -1) = n 2 .
Thus:

E 1 = n-2 i=1 n(n -1) 2i(n -i) + n 2 = n(n -1) 2 n-2 i=1 1 i(n -i) + n 2 . (5.3)
On the other hand, we have:

1 i(n -i) = 1 n i + 1 n n -i . (5.4)
We finally obtain:

E 1 = n(n -1) 2 1 n n-2 i=1 1 i + 1 n n-2 i=1 1 n -i + n 2 = n(n -1) 2 1 n H n-2 + 1 n 2 i=n-1 1 i + n 2 . (5.5)
Thus, with i = n -i, we get:

E 1 = (n -1) 2 [H n-2 + H n-1 -1] + n 2 = (n -1) 2 2H n-1 - 1 n -1 -1 + n 2 = (n -1)H n-1 - 1 2 - n -1 2 + n 2 = (n -1)H n-1 .
(

Knowing that

H n = n i=1 1 i ∼ log(n)
, and as T Kn corresponds to T 1 , we obtain:

E(T Kn ) ∼ n log(n), as n → ∞ . (5.7)
The OR Population Protocol over a Complete Graph with the HS Scheduler

We investigate the time needed for an epidemic protocol to stabilize if it runs in a population whose interaction graph is the complete graph K n = (V, E), and under the distributed HS Scheduler. The result is represented by the theorem that follows.

The OR Population Protocol

Theorem 5.5. Let T Kn be the time needed by the OR protocol to stabilize when running in a complete interaction graph K n under the HS Scheduler. Let E(T Kn ) be the expected value of T Kn . Then:

E(T Kn ) ∼ O(n log(n)), as n → ∞ .
Proof. This proof is based on the computation of the upper bound of the stabilization time T Kn . We consider a pessimistic epidemic process where at most one new agent is infected at each computation step. The stabilization time of the epidemic protocol will be bounded by the sum of the expected time to increase the number of infected agents by one:

E(T Kn ) ≤ n-1 k=1 1 Pr(ξ G k )
, with G k the set of edges linking the set of k agents with state q 1 to the (n -k) agents with state q 0 . We have:

π(G k ) = a=(u,v) ∈ G k
Pr(HS(a)).

As the interaction graph is a complete graph, and according to (4.11), we can write:

π(G k ) = a=(u,v) ∈ G k β (n -1) 2 = β (n -1) 2 k (n -k) ≤ 1.
(5.8) Given (5.8) and Lemma 5.2, we get:

E(T Kn ) ≤ n-1 k=1 1 λ π(G k ) ≤ n-1 k=1 (n -1) 2 λ β k (n -k) ≤ (n -1) 2 λ β n-1 k=1 1 k (n -k) .
Applying (5.4) gives:

E(T Kn ) ≤ (n -1) 2 λ β 2 n H n-1 . (5.9)
This yields:

E(T Kn ) ∼ O(n log n), as n → ∞ .
(5.10)

5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler

Comparison

Thanks to the analyses we presented in the two previous sections, we can state the following result:

Corollary 5.6. The Random Scheduler and the HS Scheduler are time equivalent with respect to the OR population protocol running in a population P whose interaction graph is complete.

Proof. According to Theorem 5.4 and Theorem 5.5, the OR population protocol needs O(n log(n)) computation steps when it is run over a complete graph under the Random Scheduler, and likewise under the Handshake Scheduler. Consequently, according to Definition 4.12, these two schedulers are time equivalent with respect to this population protocol running in a complete interaction graph.

The OR Population Protocol over a Random Graph

Let P be a population whose interaction graph G = (V, E) is a random graph G n,p . To guarantee that this graph is connected with high probability, we suppose that p = α log n n with α > 1 [START_REF] Bollobas | Random graphs[END_REF]. We study then the stabilization time of the OR population protocol running in the population P, first when being scheduled by the Random Scheduler, and then when scheduled by the HS Scheduler.

The OR Population Protocol over a Random Graph with the Random Scheduler

The stabilization time of the OR population protocol running in a G n,p graph, when the interactions are scheduled by the Random scheduler, is characterized as follows [START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF]:

Theorem 5.7. Let T Gn,p denote the time needed by the OR protocol to stabilize when running over the random graph G n,p under the Random Scheduler and let E(T Gn,p ) denote its expected value. Then:

E(T Gn,p ) ∼ O(n 2 ), as n → ∞ .
Proof. Let G n,p = (V, E) be a random graph. Using the same notation as for the case G = K n , we can see that the size of the set X t will increase if, and only if, the peer of vertices which is chosen to communicate has one end-point in X t and the other one in V \ X t . We also need to ensure that this peer exists. Thus, ∀ 1 ≤ k ≤ n -1, we have:

Pr (x t+1 = k + 1 | x t = k) = 2k(n -k) n(n -1) × p. (5.11)
Hence, as for the complete graph, if we denote by T k the time complexity of the Markov process starting at x t = k to reach the absorbing state x t = n, and with E k = E (T k ) then:

∀1 ≤ k ≤ n -1, E k = 1 + 1 - 2k(n -k) n(n -1) p E k + 2k(n -k) n(n -1) p E k+1
(5.12)

The OR Population Protocol

A straightforward computation yields:

E 1 = n-1 k=1 n(n -1) 2k(n -k)p = n(n -1) 2p n-1 k=1 1 k(n -k) = n(n -1) 2p 2 n H n-1 = n -1 p H n-1 . (5.13)
As p = α log n n , we get:

E(T Gn,p ) = n(n -1) α log n H n-1 ∼ n(n -1) α (5.14)
Hence,

E(T Gn,p ) ∼ O(n 2 ), as n → ∞ . (5.15)
The OR Population Protocol over a Random Graph with the Handshake Scheduler

We consider now the computation of the OR population protocol by a population whose interaction graph is a G n,p = (V, E), and where interactions are orchestrated by the HS Scheduler. The expected value of the time needed for this computation to stabilize is provided by the following theorem.

Theorem 5.8. Let T Gn,p denote the time needed by the OR protocol to stabilize when running over the random graph G n,p under the HS Scheduler and let E(T Gn,p ) denote its expected value. Then:

E(T Gn,p ) ∼ O(n log 2 (n)), as n → ∞ .
Proof. This proof consists on characterizing the upper bound of T Gn,p . Thus, we consider the same pessimistic epidemic process as in the proof of Theorem 5.5, where at most one new agent is infected. The stabilization time of the epidemic protocol will be bounded by the sum of the expected time to increase the number of infected agents by one:

E(T Gn,p ) ≤ n-1 k=1 1 Pr(ξ G k )
, where G k denotes the set of edges existing between the k agents with state q 1 and the (n -k) agents with state q 0 (G k ⊂ E).

Time Complexity Analyses of some Protocols under the Random/HS Scheduler

We define:

π(G k ) = a∈G k
Pr(HS(a))

We are assuming that a ∈ G k . As G k ⊂ E, we guarantee that: a ∈ E. Thus, applying Lemma 4.4 gives:

Pr(HS(a)) = β (1 -q n-1 ) 2 (n -1) 2 p 2 .

This yields

π(G k ) = (u,v)∈G k β (1 -q n-1 ) 2 (n -1) 2 p 2 = β (1 -q n-1 ) 2 (n -1) 2 p 2 |G k |,
with |G k | denoting the size of the set of edges G k .

According to Corollary 5.3, we have:

1

Pr(ξ G k ) ≤ e e -1 1 + 1 π(G k ) .
This yields,

E(T Gn,p ) ≤ n-1 k=1 e e -1 1 + 1 π(G k ) ≤ e e -1 n-1 k=1 1 + n-1 k=1 1 π(G k ) ≤ e e -1 (n -1) + n-1 k=1 p 2 (n -1) 2 β (1 -q n-1 ) 2 |G k | ≤ e e -1 (n -1) + p 2 (n -1) 2 β (1 -q n-1 ) 2 n-1 k=1 1 |G k | Given that, ∀ 1 ≤ k ≤ n -1, we have: 1 ≤ |G k | ≤ k(n -k)
We can write:

E(T Gn,p ) ≤ e e -1 (n -1) + p 2 (n -1) 3 β (1 -q n-1 ) 2 .
Knowing that: ∀ m ≥ 0, ∀ 0 ≤ x ≤ 1, we have:

1 -mx ≤ (1 -x) m ≤ e -mx .
(5.16)

The OR Population Protocol

We get:

1 -2q n-1 ≤ (1 -q n-1 ) 2 ≤ e -2q n-1 (5.17)

Which gives:

1 (1 -q n-1 ) 2 ≤ 1 1 -2q n-1 ≤ 1 1 -2(1 -p) n-1
(5.18)

Using (5.16) again, we obtain:

1 -(n -1)p ≤ (1 -p) n-1 ≤ e -(n-1)p
This yields:

1 1 -2(1 -p) n-1 ≤ 1 1 -2 e -(n-1)p (5.19) Inequalities (5.18) and (5.19) give: 1
(1 -q n-1 ) 2 ≤ 1 1 -2 e -(n-1)p .
(

Given that p = α log n n with α > 1, (5.20) becomes:

1 (1 -q n-1 ) 2 ≤ 1 1 -2 e -(n-1) α log n n 1 1 -2 e -α log n ≤ 1 1 -2 n -α p 2 (1 -q n-1 ) 2 ≤ α 2 log 2 n n 2 (1 -2 n -α ) ≤ α 2 n α log 2 n n 2 (n α -2) α 2 log 2 n n 2 .
This gives:

E(T Gn,p ) ≤ e e -1 (n -1) + α 2 log 2 n β n 2 (n -1) 3
Accordingly, we have:

E(T Gn,p ) ∼ O(n log 2 n), as n → ∞ . (5.21)
5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler

Comparison

We presented above results concerning the stabilization time of the OR population protocol running in a population whose interaction graph is the random graph G n,p . The first result concerned a scheduling under the Random Scheduler. The second one concerned a scheduling under the HS Scheduler.

We deduced from these results the following corollary:

Corollary 5.9. The Random Scheduler and the Handshake Scheduler are not time equivalent with respect to the OR population protocol running over the random communication graph G n,p .

Proof. According to Theorem 5.7 and Theorem 5.8, the population protocol Leader Election that runs over the random communication graph G n,p stabilizes faster when it is under the Handshake scheduler, compared to the case where it is under the Random Scheduler.

The Leader Election Population Protocol

We study, in this section, the stabilization time of the population protocol Leader Election that we already introduced in a previous chapter (see Section 2.2.3). Initially, all the agents start with the state L. Hence, what is the time needed by the protocol to reach a configuration where only one L remains?

The Leader Election over a Complete Graph

Let P be a population with a complete interaction graph K n = (V, E) and whose agents are executing the Leader Election protocol. Let T Kn be the stabilization time to get a single leader in the population P and let E(T Kn ) denote the expected value of T Kn .

The Leader Election over a Complete Graph under the Random Scheduler

We have from [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF] the following characterization of the stabilization time of the Leader Election protocol running in a complete graph under the Random Scheduler.

Theorem 5.10. Let T Kn be the time needed by the Leader Election protocol to stabilize when running over a complete interaction graph K n under the Random Scheduler. Let E(T Kn ) be the expected value of T Kn . Then:

E(T Kn ) ∼ O(n 2 ), as n → ∞ .
Proof. In [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF], the authors considered the time T Kn as being equal to the sum of all the times until two leaders among the n meet, then two leaders among the (n -1) agents with state L meet ,... until finally the two last leaders L meet. We here give further details for this proof. Let X t denote the set of agents in state L at time t, for any t ≥ 0, and x t be the random variable that denotes the size of X t . Initially x 0 = n, then it decreases until reaching, at some t, the absorbing state x t = 1.

The Leader Election Population Protocol

The size of the set X t decreases by at most 1 at each computation step. This happens only if the Random Scheduler picks, for the interaction, an ordered pair of agents that are both with state L. The probability of this event corresponds to:

∀ 2 ≤ k ≤ n, Pr(x t+1 = k -1|x t = k) = k 2 n 2 = k(k -1) n(n -1) .
Then, E(T Kn ) can be described as:

E(T Kn ) = n k=2 1 P (x t+1 = k -1|x t = k) = n k=2 n(n -1) k(k -1) = n(n -1) n k=2 1 k(k -1) . (5.22)
On the other hand, we can write:

n k=2 1 k(k -1) = n k=2 ( 1 k -1 - 1 k ) = n-1 k =1 1 k - n k=2 1 k = 1 - 1 n . (5.23)
Hence, given (5.23), (5.22) becomes:

E(T Kn ) = n(n -1)(1 - 1 n ) = (n -1) 2 . (5.24)
Thus:

E(T Kn ) ∼ O(n 2 ), as n → ∞ . (5.25)
The Leader Election over a Complete Graph under the Handshake Scheduler By analyzing the stabilizing time of the Leader Election protocol running in the population P that has a complete interaction graph, and where interactions are orchestrated by the HS Scheduler, we obtained the following theorem.

Theorem 5.11. Let T Kn be the stabilization time of the Leader Election that runs over a complete interaction graph K n under the HS Scheduler and let E(T Kn ) be its expected value. Then:

E(T Kn ) ∼ O(n 2 ), as n → ∞ .
5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler Proof. We bound the expected time to have only one leader in the whole population, by allowing at most one new defeated agent per computation step. In this pessimistic process, we sum up the expected time to decrease the number of leaders agents by one.

We consequently obtain:

E(T Kn ) ≤ n k=2 1
Pr(ξ G k )
where G k denotes the graph formed by the k agents with state L (it is a complete graph), and ξ G k is the event of obtaining at least one handshake in a round for at least one edge in G k .

On one hand, according to Lemma 5.2, we have:

Pr(ξ G k ) ≥ λ min(1, π(G k )). (5.26)
On the other hand, we have:

π(G k ) = a∈G k Pr(HS(a)) = (u,v)∈G k β d(u)d(v) = β (n -1) 2 k(k -1) 2 ≤ 1.
(

E(T Kn ) ≤ n k=2 1 λ π(G k ) ≤ n k=2 2(n -1) 2 λ β k(k -1) ≤ 2(n -1) 2 λ β n k=2 1 k(k -1) ≤ 2(n -1) 2 λ β (1 - 1 n ). 5.27) Inequalities (5.26) and (5.27) yield:
(5.28)

From the expression (5.28), we conclude that:

E(T Kn ) ∼ O(n 2 ), as n → ∞ . (5.29)

Comparison

According to Theorem 5.10, the expected value of the time that the Leader Election protocol needs to stabilize when running in the population P under the Random Scheduler is O(n 2 ). This is the same expected value of the time that this protocol needs when running in the population P under the HS Scheduler, according to Theorem 5.11. We consequently obtain the following corollary:

The Leader Election Population Protocol

Corollary 5.12. The Random Scheduler and the HS Scheduler are time equivalent with respect the Leader Election population protocol running over a complete interaction graph.

The Leader Election over a Random Graph

In this section, we suppose that the interaction graph of the population P where the Leader Election protocol runs, is the random graph G n,p . To guarantee that this random graph is connected with high probability, we suppose that p = α log n n with α > 1. We study then the complexity of the stabilization time of the Leader Election protocol in this case.

The Leader Election over a Random Graph Scheduled by the Random Scheduler

We focus, in this section, on the scenario where the interactions in the population P are handled by the Random Scheduler. The expected value of the stabilization time of the Leader Election protocol in this case is defined by the following theorem. Theorem 5.13. Let T Gn,p denote the time needed by the Leader Election population protocol to stabilize when executed over the random graph G n,p under the Random Scheduler. Let E(T Gn,p ) denote the expected value of T Gn,p . Then:

E(T Gn,p ) ∼ O( n 3 log n ), as n → ∞ .
Proof. Let X t denote the set of agents in state L at time t for any t ≥ 0, and x t be the random variable that denotes the size of X t . Initially x 0 = n, then it can decrease until reaching, at some t, the absorbing state x t = 1. The size of the set X t decreases if the interaction happens between a pair of agents that are both in state L and that are necessarily linked by an edge from the interaction graph. The probability of such event corresponds to:

Pr(x t+1 = k -1|x t = k) = k 2 n 2 × p = k(k -1) n(n -1) × p. E(T Gn,p ) = k=n k=2 1
Pr(x t+1 = k -1|x t = k) = k=n k=2 n(n -1) p k(k -1) = n(n -1) p k=n k=2 1 k(k -1) = n(n -1) p (1 - 1 n ) = (n -1) 2 p (5.30)
5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler As p = α log n n , (5.30) becomes:

E(T Gn,p ) = n(n -1) 2 α log n ∼ O( n 3 log n ), as n → ∞ . (5.31)
The Leader Election over a Random Graph Scheduled by the Handshake Scheduler

We focus on the computation of the Leader Election protocol, under the HS Scheduler, by the population P whose interaction graph is a G n,p . We consider a pessimistic scenario where at each computation step there is at most one defeated leader. If we define X t the set of agents in state L at time t, for any t ≥ 0, and x t the random variable that denotes the size of X t . Then, we have initially x 0 = n. The size of the set X t decreases until reaching, at some t, the absorbing state x t = 1.

At a computation step, the size of X t can decrease by at most 1. This happens when there is a rendezvous over an edge of the random interaction graph whose both endpoints are with state L. We define the probability of this event as:

Pr(x t+1 = k -1|x t = k) = β (1 -q n-1 ) 2 p 2 (n -1) 2 .
We can consequently write:

E(T Gn,p ) ≤ k=n k=2 1 Pr(x t+1 = k -1|x t = k) ≤ k=n k=2 p 2 (n -1) 2 β (1 -q n-1 ) 2 ≤ p 2 (n -1) 3 β (1 -q n-1 ) 2 . (5.32)
As p = α log n n , (5.32) becomes:

E(T Gn,p ) ≤ (n -1) α 2 log 2 (n) β (1 -q n-1 ) 2 ∼ O(n log 2 (n)), as n → ∞ . (5.33)
Given (5.33), we can state the following theorem:

Theorem 5.14. Let T Gn,p denote the time needed by the Leader Election population protocol to stabilize when executed over the random graph G n,p under the Handshake Scheduler.

Let E(T Gn,p ) denote the expected value of T Gn,p . Then:

E(T Gn,p ) ∼ O(n log 2 (n)), as n → ∞ .

The Maximal Matching Mediated Population Protocol

Comparison Given Theorem 5.13 and Theorem 5.14, we can conclude that the computation of the Leader Election protocol by the agents of the population P stabilizes faster when it is scheduled by the HS Scheduler, compared to a scheduling under the Random Scheduler.

We consequently obtain this corollary:

Corollary 5.15. The Random Scheduler and the HS Scheduler are not time equivalent with respect to the Leader Election protocol running in a population whose interaction graph is a random graph G n,p .

The Maximal Matching Mediated Population Protocol

We recall that, according to Definition 1.25, a matching M of a graph G = (V, E) is a set of edges from E such that each two edges from M do not share any vertex. This matching is maximal if by adding any edge to it, it will not be a matching any more (see Definition 1.26).

The mediated population protocol that computes a Maximal Matching in a graph G was introduced in [START_REF] Chatzigiannakis | Mediated population protocols[END_REF] and can be described by

(X M , Y M , Q M , S M , I M , O M , δ M , ι M , ω M , r M ) with: • X M = {0}, Y M = {0, 1}, • Q M = {q 0 , q 1 }, S M = {0, 1},
• I M (0) = q 0 , O M (q 0 ) = 0 and O M (q 1 ) = 1,

• ι M (0) = 0, ω M (0) = 0 and ω M (1) = 1,

• δ M (q 0 , q 0 , 0) = (q 1 , q 1 , 1).

• r M : Get each edge e ∈ E such that ω M (s e ) = 1 where s e is the state of the edge e.

Initially, all the agents start with state q 0 and all the edges with state 0. If an interaction happens between two agents q 0 linked by an edge with state 0, both agents update their states to q 1 and the edge linking them becomes with state 1. The protocol stabilizes when the matching formed by the edges with state 1 is maximal, that is there no more pairs of nodes with state q 0 linked by an edge with state 0.

The Maximal Matching over a Complete Graph

Let P be a population whose interaction graph G = (V, E) is thereafter supposed to be the complete graph of n nodes K n . A computation of the time needed for the Maximal Matching to stabilize, when running in this population, is established through the following analyses for two scenarios: the scheduler is a Random Scheduler, or the scheduler is the HS Scheduler.

Time Complexity Analyses of some Protocols under the Random/HS Scheduler

The Maximal Matching over a Complete Graph with the Random Scheduler By analyzing the computation process of the Maximal Matching protocol in the population P where the interactions are under the control of the sequential Random Scheduler, we obtained the following theorem:

Theorem 5.16. Let T Kn be the stabilization time of the Maximal Matching mediated population protocol that runs over a complete interaction graph K n under the Random Scheduler. Let E(T Kn ) be its expected value. Then:

E(T Kn ) ∼ O(n 2 ), as n → ∞ .
Proof. The process of selecting the edges of the Maximal Matching can be modeled by a Markov chain. For any t ≥ 0, we denote by X t , the set of nodes with state q 0 . We also define the random variable x t as the size of the set X t , for any t ≥ 0. Initially, we have x 0 = n. Then, the size of the set X t decreases by 2 only if the picked edge by the Random Scheduler has both extremities with state q 0 , that is both extremities belong to X t . We would mention that, ∀t ≥ 0, the graph formed by the set of nodes of X t and the edges existing between them, is a complete graph.

Accordingly, the behavior of the random variable x t can be modeled by an homogeneous Markov chain whose set of vertices is {n, n -2, n -4, ..., n -2 n 2 } and whose transitions are given by:

Pr(x t+1 = j|x t = i) =      i(i-1) n(n-1) if j = i -2 1 -i(i-1) n(n-1) if j = i ≥ 0 0 otherwise.
For any i ≥ 0, let T i denote the time complexity of the Markov process x t≥0 starting at state x t = i to reach the absorbing state x t ≤ 1, and let E i = E(T i ) denote its expected value. Thus, the time complexity of the computation of the mediated population protocol Maximal Matching is T n , and E n its expected value.

For any 0 ≤ i ≤ n 2 -1, we have:

E n-2i = 1 + (1 - (n -2i)(n -2i -1) n(n -1) )E n-2i + (n -2i)(n -2i -1) n(n -1) E n-2(i+1) .
This gives,

E n-2i = n(n -1) (n -2i)(n -2i -1) + E n-2(i+1) .

The Maximal Matching Mediated Population Protocol

This yields,

E n = n 2 -1 i=0 n(n -1) (n -2i)(n -2i -1) = n(n -1) n 2 -1 i=0 1 (n -2i)(n -2i -1) = n(n -1)( n 2 -1 i=0 1 n -2i -1 - n 2 -1 i=0 1 n -2i ) = n(n -1) 2 n 2 -1 i=0 (-1) i+1 n -i ≤ n(n -1) ln 2.
(5.34) Given (5.34), we can deduce that:

E(T Kn ) ∼ O(n 2 ), as n → ∞ . (5.35)
The Maximal Matching over a Complete Graph with the HS Scheduler

We suppose now that the interactions in the population P are handled by the distributed HS Scheduler. We investigate the time needed for the mediated protocol Maximal Matching to stabilize when running in P. The result is described by the following theorem:

Theorem 5.17. Let T Kn be the stabilization time of the Maximal Matching mediated population protocol that runs over a complete interaction graph K n under the HS Scheduler.

Let E(T Kn ) be the expected value of T Kn . Then:

E(T Kn ) ∼ O(n 2 ), as n → ∞ .
Proof. We suppose that the computation of the Maximal Matching protocol under the HS Scheduler proceeds as follows. At each computation step, the HS Scheduler picks at most one ordered pair of agents that are both with state q 0 . Supposing that there is at most one handshake in a round happening between two agents in state q 0 , then at each round, the number of agents with state q 0 decreases by 2.

E(T Kn ) ≤ n 2 k=0 1 Pr(ξ C n-2k ) . (5.36)
where C n-2k the set of edges existing between the remaining (n -2k) agents with state q 0 (it is a complete graph of (n -2k) nodes).

π(C n-2k ) = a∈C n-2k
Pr(HS(a))

= β (n -1) 2 (n -2k)(n -2k -1) 2 ≤ 1.
(5.37)

5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler Given (5.37) and (5.36), and based on Lemma 5.2, we obtain:

E(T Kn ) ≤ n 2 -1 k=0 1 λ π(C n-2k ) ≤ 2(n -1) 2 λ β n 2 -1 k=0 1 (n -2k)(n -2k -1) ≤ 2(n -1) 2 λ β ( n 2 -1 k=0 1 n -2k -1 - n 2 -1 k=0 1 n -2k ) ≤ 2(n -1) 2 λ β 2 n 2 -1 k=0 (-1) k+1 n -k ≤ 2(n -1) 2 λ β ln 2. ( 5.38)
According to (5.38),

E(T Kn ) ∼ O(n 2 ), as n → ∞ . (5.39)

Comparison

According to Theorem 5.16 and to Theorem 5.17, the Maximal Matching protocol needs a stabilization time which is a O(n 2 ) when running in the population P, either under the Random Scheduler, or under the HS Scheduler. We consequently get:

Corollary 5.18. The HS Scheduler is time equivalent to the Random Scheduler with respect to the Maximal Matching mediated population protocol running over a complete interaction graph.

The Maximal Matching over a Random Graph

We suppose now that P is a population that has a random interaction graph, which is G n,p = (V, E) with p = α log n n and α ≥ 1. We investigate on the time needed by the Maximal Matching protocol running in this population to stabilize. As in the previous sections, we consider two scheduling scenarios: under the Random Scheduler, and under the HS Scheduler.

The Maximal Matching over a Random Graph under the Random Scheduler

We describe the expected value of the stabilization time of the Maximal Matching protocol running in the population P under the Random Scheduler through the following theorem: Theorem 5.19. Let T Gn,p denote the time needed by the Maximal Matching mediated population protocol to stabilize while running over the random graph G n,p under the Random Scheduler. Let E(T Gn,p ) denote the expected value of T Gn,p . Then:

E(T Gn,p ) ∼ O( n 3 log n
), as n → ∞ .

The Maximal Matching Mediated Population Protocol

Proof. Using the same notation as for the case G = K n , we have initially the set X 0 consists of all the agents of the population as they all start with state q 0 . Then, ∀t ≥ 0, the size of the set X t decreases by 2 if, and only if, the two communicating nodes are picked from X t and obviously an edge from E is linking them. The probability of this event can be described by:

Pr (x t+1 = i -2 | x t = i) = i(i -1) n(n -1) × p. (5.40)
Hence, as for the complete graph, we denote by T i the time complexity of the Markov process starting at x t = i to reach the absorbing state x t ≤ 1 (we are aware that in case of random graph, the absorbing state could be greater than 1, but we consider the minimum value that the set of agents with state q 0 can reach). We also define

E i = E (T i ).
Then, for any 0 ≤ i ≤ n 2 , we have:

E n-2i = 1 + (1 - (n -2i)(n -2i -1) n(n -1) p)E n-2i + (n -2i)(n -2i -1) n(n -1) p E n-2(i+1) .
This gives:

E n-2i = n(n -1) (n -2i)(n -2i -1) p + E n-2(i+1) .
A same reasoning as for the previous case yields:

E n = n(n -1) p 2 n 2 +1 i=0 (-1) i+1 n -i ≤ n(n -1) p ln 2 ≤ n 2 (n -1) α log n ln 2.
(5.41) Given (5.41), we can state that:

E(T Gn,p ) ∼ O( n 3 log n
), as n → ∞ .

(5.42)

The Maximal Matching over a Random Graph under the HS Scheduler

We suppose now that the pairwise interactions in the population P are under the control of the HS Scheduler. Then, a characterization of the expected value of the time needed by the Maximal Matching, running in the population P, to stabilize is given by the theorem that follows.

Theorem 5.20. Let T Gn,p denote the time needed by the Maximal Matching protocol to stabilize when executed over the random graph G n,p under the HS Scheduler. Let E(T Gn,p ) denote the expected value of T Gn,p . Then:

E(T Gn,p ) ∼ O(n log 2 (n)), as n → ∞ .
5.5. Time Complexity with High Probability

Time Complexity with High Probability

In this section, we continue the study of the three protocols we studied above: the OR population protocol, the Leader Election and the Maximal Matching. However, we will focus now on a characterization with high probability of the stabilization time of these protocols when running under the HS Scheduler. We recall that with high probability means with probability (1 -o( 1 n )).

The Leader Election Population Protocol

We consider a population P whose interaction graph is complete and where interactions are scheduled by the HS Scheduler. Supposing that the Leader Election protocol is running in P, a description of its stabilization time, with high probability, is given by this theorem:

Theorem 5.22. The time needed for the Leader Election population protocol to stabilize when it runs in a complete interaction graph and under the HS Scheduler is, with high probability, O(n). Let G L = (V L , E L ) be the graph where the set of vertices consists of the set V L , and the set of edges E L is the set of links existing between the agents with state L. For the following analysis, the graph G L should satisfy the following property: "At each step of the protocol's computation, G L is a connected subgraph of the communication graph G". The hypothesis that the interaction graph G = K n guarantees the satisfaction of this condition.

Let Pr (HS G L ) be the probability of having at least one handshake over G L . According to Lemma 4.3 stated in the previous chapter, we have the following result:

Pr (HS G L ) ≥ 1 -e -β 2 .
Let f be any round (phase) of the protocol's computation. f is called a good (successful) round if there have been at least one handshake between two agents with state L that took place during f . Otherwise, f is called a bad (unsuccessful) round.

∀ t > 0, let f t denote the t th round and let X(t) denote the size of the set of successful rounds among the t rounds: f 1 , f 2 , ..., f t . Then, we have:

E(X(t)) ≥ (1 -e (-β 2 ) )t.
According to the Chernoff bound (see Definition 1.68), we have:

∀a > 0, Pr (X(t) ≤ E(X(t)) -a) ≤ 2 e (-a 2 3E(X(t)) ) .
This yields,

Pr X(t) ≤ (1 -e (-β 2 ) )t -a ≤ 2 e - a 2
3(1-e (- β 2
) )t ≤ 2 e -a 2 3t .
5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler For t = 2(n-1)

1-e (-β

2 ) and a = n, we get:

Pr(X(t) ≤ n -2) ≤ 2 e (-n 6 ) = o( 1 n ).
Hence, we can state that with high probability, at time t = 2(n-1)

1-e (-β

2 ) , we have (n -1) successful rounds that already took place.

On the other hand, to reach |V L | = 1, at most (n -1) good rounds are needed, because at each good round there is at least one leader from V L that is defeated.

Thus, the time needed for the Leader Election protocol to stabilize when G = K n and the imposed scheduler is the HS Scheduler is, with high probability, O(n).

The OR Population Protocol

Let P be a population whose interaction graph is complete and where pairwise interactions take place according to the HS Scheduler. We suppose that the OR population protocol is running in P. A description of its stabilization time, with high probability, is presented in the following theorem:

Theorem 5.23. The time needed for the OR population protocol to stabilize when the interaction graph G = K n and under the HS Scheduler is, with high probability, O(n).

Proof. Let G = (V, E) be the communication graph with V = V 1 ∪ V 0 . V 1 (respectively V 0
) denotes the set of agents with state q 1 (respectively q 0 ) and |V Let G = (V, E ) be the graph formed by the set of initial vertices V , and the set of edges E ⊂ E, a restriction of E that contains only the edges existing between agents with different states. More specifically, any edge from E should have one extremity from V 0 and the second from V 1 .

For the following analysis, the graph G should satisfy the following property: At each step of the protocol's computation, G is a connected subgraph of the communication graph G . If we initially suppose that G is a complete graph, we can guarantee that, at each step of the computation of the protocol, G is a connected subgraph of G.

For any round f of the protocol's computation, f is called a good round if there have been at least one handshake over G . Otherwise, f is called a bad (unsuccessful) round.

Let Pr (HS G ) be the probability of having at least one handshake over G , which corresponds to the probability of a good round. According to Lemma 4.3, we have:

Pr (HS G ) ≥ 1 -e -β 2 .
∀ t > 0, let f t denote the t th round and let X(t) denote the size of the set of successful rounds among the t rounds: f 1 , f 2 , ..., f t . Thus, we can have:

E(X(t)) ≥ (1 -e (-β
2 ) )t.

The same reasoning as the previous section, using the Chernoff bound, yields:

∀a > 0, Pr X(t) ≤ (1 -e (-β 2
) )t -a ≤ 2 e (-a 2 3t ) .

Time Complexity with High Probability

Now, by assuming that t = 2(n-1)

1-e (-β

2 ) and a = n, we obtain:

Pr (X(t) ≤ n -2) ≤ 2 e (-n 6 ) = o( 1 n ).
(5.45)

If we consider the pessimistic process, where at each successful round, only one agent goes from state q 0 to state q 1 , we can notice that (n -1) successful rounds are needed to reach a whole population with q 1 . Consequently, the OR protocol needs at most (n -1) successful rounds to stabilize.

According to (5.45), at t = 2(n-1)

1-e (-β

2 ) and with high probability, wa have (n-1) successful rounds that already took place over the communication graph. This implies that the stabilization time of the OR protocol running over a complete graph, and scheduled by the HS Scheduler is, with high probability, O(n).

The Maximal Matching Mediated Population Protocol

Theorem 5.24. The Maximal Matching mediated population protocol running under the HS Scheduler and over a complete interaction graph needs, with high probability, O(n) computation steps to stabilize.

Proof. Let V 1 (respectively V 0 ) denote the set of agents with state q 1 (respectively q 0 ) and |V 1 | (respectively |V 0 |) the size of this set. Initially, all the agents start with state q 0 , hence:

|V 1 | = 0 and |V 0 | = n.
As the interaction graph is supposed to be complete, the protocol stabilizes when:

• |V 1 | = n and |V 0 | = 0, if n is even, • |V 1 | = n -1 and |V 0 | = 1, if n is odd.
Let G V 0 = (V 0 , E 0 ) be the graph formed by the set of vertices V 0 , and the set of edges E 0 which is the set of links existing between the agents of V 0 . For the following analysis, the graph G V 0 should satisfy the following property: "At each step of the protocol's computation, G V 0 is a connected subgraph of the communication graph G". This property is satisfied in this case, as the communication graph is supposed to be complete.

Let Pr (HS V 0 ) be the probability of having at least one handshake over G V 0 . A reasoning similar to those already presented above gives:

Pr (HS V 0 ) ≥ 1 -e -β 2 .
Let f be any round (phase) of the protocol's computation. f is called a good (successful) round if there have been at least one handshake between two agents from V 0 during f . Otherwise, f is called a bad (unsuccessful) round.

As in the previous proofs, ∀ t > 0, f t denotes the t th round and X(t) denotes the size of the set of successful rounds among the t rounds: f 1 , f 2 , ..., f t . Then, we have:

E(X(t)) ≥ (1 -e (-β 2 ) )t.
Using the same Chernoff bound as above, we get:

∀a > 0, Pr X(t) ≤ (1 -e (-β 2
) )t -a ≤ 2 e (-a 2 3t ) .

5. Time Complexity Analyses of some Protocols under the Random/HS Scheduler

For t = n-1 1-e (-β
2 ) and a = n 2 , we get:

Pr X(t) ≤ n 2 -1 ≤ 2 e (-n 12 ) = o( 1 n ) .
(5.46)

Now, if we consider the pessimistic process where, at each successful round, only one new edge is added to the maximal matching of the communication graph. In this process, n 2 good rounds are needed to reach stabilization. This implies that the maximal matching mediated population protocol needs at most n 2 successful rounds to stabilize. Yet, according to (5.46), we have: with high probability, at time t = n-1

1-e (-β 2 ) , ( n 2 -1) successful rounds have already took place.

Consequently, we conclude that, the Maximal Matching protocol needs, with high probability, O(n) time to stabilize.

Conclusion

We summarize in Table 5.1 the results we obtained in this chapter. In fact, we considered three protocols: the OR protocol, the Leader Election protocol and the Maximal Matching protocol. We analyzed the complexity of the time each needed to stabilize for two scheduling scenarios: running under the Random Scheduler, or running under the HS Scheduler.

We found that the Random scheduler and the HS Scheduler are time equivalent with respect to these three protocols in case the interaction graph is complete. However, they are not when the interaction graph is a random graph. Indeed, in this case of interaction graph, the protocols stabilize faster when they are under the scheduling of the HS Scheduler. Population protocols are defined as being protocols that do not halt, but only stabilize [START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]. However, introducing termination to this model would be interesting. The termination property is basic for distributed systems. Also, given the constraining characteristics of the systems for which the population protocols are designed, this property could help the agents preserve their energies. In [START_REF] Michail | Terminating Population Protocols via Some Minimal Global Knowledge Assumptions[END_REF][START_REF] Michail | Terminating population protocols via some minimal global knowledge assumptions[END_REF], the authors suppose that the agents can have access to some global knowledge via an oracle called an Absence Detector. Thanks to this knowledge, they design halting protocols where all the agents eventually reach some special states from which they stop participating in effective interactions.

Graph's Structure Scheduler Time Complexity K n G n,p Random HS OR × × O(n log(n)) × × O(n log(n)) × × O(n 2 ) × × O(n log 2 (n)) Leader Election × × O(n 2 ) × × O(n 2 ) × × O( n 3 log n ) × × O(n log 2 (n)) Maximal Matching × × O(n 2 ) × × O(n 2 ) × × O( n 3 log n ) × × O(n log 2 (n)
In this chapter, we focus on the Leader Election protocol with absence detector. We study its stabilization time when its computation takes place under the Random Scheduler, and then under the HS Scheduler.

We then focus on the question: could an agent halt while having only a local knowledge based on its current state? For this purpose, we extend a subclass of population protocols (and the models extending it), with a local detection termination that enables each agent to detect if it reached a final state. A final state is an irreversible state that does not appear in effective transition rules. We also introduce, the Protocol Aware HS Scheduler. This is slight modified version of the HS Scheduler that allows agents with final states to stop participating in the protocol's computation and terminate. We prove that this scheduler is fair with probability 1. We then present some time complexity analyses of the Leader Election and the Maximal Matching protocols under this scheduler.

Population Protocols with Absence Detector

Michail et al. extend the basic population protocols with a cover-time service which is capable of detecting if a walking state has covered the whole network (in term of states and not agents). Thanks to this service, introducing termination to the population protocols becomes possible. The authors then reduce this service to an oracle model: all the agents of the population will be connected to a powerful oracle-node able to detect if any state is present or not in the population. This special oracle-node is called absence detector and this new extension of the population protocols is called population protocols with absence detector.

The Model of Population Protocols with Absence Detector

The model of population protocols with absence detector is described as a basic population protocol for which we add a detection transition function representing the interaction rules of the agents with the absence detector. Formally, it can be specified as follows: Definition 6.1. (Population Protocol with Absence Detector) A population protocol with absence detector is a 7-tuple (X, Y , Q, I, ω, δ, γ) where X, Y and Q are finite sets and:

• X and Y are respectively the input and output alphabets,

• Q is the set of states,

• I: X → Q is the input function,

6. The Fair Protocol Aware HS Scheduler

• δ: Q × Q → Q × Q is the transition function, • γ: Q × {0, 1} |Q| → Q is the detection transition function.
This model supposes a complete interaction graph. Let G = (V, E) denote the interaction graph over which a protocol with absence detector runs. V is the set of nodes representing the n agents of the population in addition to the absence detector. The size of the set V is: |V | = n + 1. And E is the set of edges representing all the permissible communication links that are in this case linking each node from the set V to all the other nodes of this set.

The absence detector has a special state which is the absence vector that indicates the presence or not of each state from the population in the current configuration. The absence vector consists of a vector a ∈ {0, 1} |Q| such as, ∀q ∈ Q, a[q] = 1 iff q is absent in the current configuration of the population.

Based on the absence detector, Michail et al. introduce some termination to these protocols. A population protocol with absence detector is halting if, Q includes two special subsets Q h accept and Q h reject such that: every agent eventually reaches some state q ∈ Q h accept (respectively q ∈ Q h reject ). Once this happens, the agent halts, that is: it stops participating in effective interactions. If q ∈ Q h accept (respectively q ∈ Q h reject ), then its output is 1 (respectively 0). Note that, halting in this context does not mean that the agent stops interacting with the others, but only that these interactions will not lead to any states update.

The Halting Leader Election Population Protocol with Absence Detector

In [START_REF] Michail | Terminating Population Protocols via Some Minimal Global Knowledge Assumptions[END_REF][START_REF] Michail | Terminating population protocols via some minimal global knowledge assumptions[END_REF], the authors present a halting population protocol that elects a leader in a population. We denote this protocol LE AD = (X, Y , Q, I, ω, δ, γ) with:

• X = {1}, • Q = {L, F, L halt , F halt }, • I(1) = F ,
• δ defining only one effective transition rule which is: δ(L, F ) = (L, F halt ), and

• γ : (F, a) → L, if a[L] = 1, (L, a) → L halt , if a[F ] = 1.
The authors do not specify the output alphabet and the output function as they consider them meaningless for this setting.

All the agents of the population have as initial input 1, which is mapped to the follower state F . The leader state L is assigned to the first agent that interacts with the absence detector according to the application of the detection transition function rule γ(F, a) = L as a[L] = 1 (no leader state already exists in the population). Henceforth, no more state L appears anymore as a[L] = 0, and consequently γ(F, a) = L is not applicable 6.1. Population Protocols with Absence Detector anymore. This unique agent with leader state will reduce every agent with state F , it interacts with, to an agent with state F halt until a[F ] becomes 1. Thus, the only effective remaining interaction is γ(L, a) = L halt that changes the state of the agent with state L to L halt . As a result, the agent with state L halt is the unique leader of the population and all the remaining agents (except the absence detector) are followers.

According to this description, the agent that reaches the state L halt can detect the global termination of this protocol which corresponds to the fact that all the agents have halted and a unique leader is designated. This was not possible with the basic Leader Election population protocol, but to achieve this the global knowledge was needed.

The Halting Leader Election Population Protocol with Absence Detector LE AD under the Random Scheduler

We investigate now if including this absence detector in the population has any impact on the stabilization (or halting in this case) time of this protocol while running under the Random Scheduler. We have as a result the following theorem. Theorem 6.1. Let T LE AD be the time needed by the LE AD , that runs over a complete graph under the Random Scheduler, to stabilize. Let E(T LE AD ) be its expected value. Then, we have:

E(T LE AD ) ∼ O(n 2 log(n)), as n → ∞.
Proof. Initially, the population if formed by (n + 1) agents: n agents with state F , and the absence detector. Let X t denote the set of agents with state L at time t, for any t ≥ 0. Let x t be the random variable that represents the size of X t . Initially, x 0 = 0 and the absorbing state is x t = 1, as according to the transition function δ of this LE AD protocol, only one agent from the initial agents with state F , is allowed to become L.

Then, the first interaction that takes place between an agent with state F and the absence detector happens according to the following probability:

Pr(x t+1 = 1|x t = 0) = n 1 n(n+1) 2 1 = 2 n + 1 . (6.1)
Let T AF denote the time needed for the first meeting between an agent F and the absence detector to happen. Let E(T AF ) be its expected value. Then, with respect to (6.1), we get:

E(T AF ) = 1 Pr(x 1 = 1|x 0 = 0) = n + 1 2 . (6.2)
From the moment when an agent with state L appears, it starts reducing every agent from the remaining (n -1) agents with state F to F halt .

The Fair Protocol Aware HS Scheduler

Thus, let Y t designate the set of agents with state F halt at time t, for any t ≥ 0 and y t be the random variable denoting its size. At t = 0, y 0 = 0. Then, y t is incremented each time the agent with state L interacts with an agent with state F until reaching the absorbing state (n -1).

Consequently, ∀i, such that 0 ≤ i ≤ n -2, we have:

Pr(y t+1 = i + 1|y t = i) = n-i-1 1 n(n+1) 2 1 = 2(n -i -1) n(n + 1) . (6.3)
If T LF is the time needed to reduce the (n -1) agents with state F to state F halt , and E(T LF ) its expected value, then according to (6.3) we get:

E(T LF ) = n-2 i=0 1 Pr(y t+1 = i + 1|y t = i) = n-2 i=0 n(n + 1) 2(n -i -1) = n(n + 1) 2 n-2 i=0 1 n -i -1 = n(n + 1) 2 n-2 i=0 1 n -i -1 = n(n + 1) 2 n-1 i =1 1 i n(n + 1) 2 log(n -1), as n → ∞. (6.4)
Finally, the leader needs to interact again with the absence detector to update its state from L to L halt . Let l t be the r.v denoting the size of the set of vertices with agent L at time t. In this case, l 0 = 1 and its absorbing state is 0. Let T LA be the time needed for this event to take place, and let E(T LA ) be its expected value. Then,

E(T LA ) = 1 Pr(l t+1 = 0|l t = 1) = n(n + 1) 2 . ( 6.5)
Now, let T LE AD be the time needed for the protocol LE AD to stabilize. Then, its expected value E(T LE AD ) is such that:

E(T LE AD ) = E(T AF ) + E(T LF ) + E(T LA ) = O(n 2 log(n)), as n → ∞. (6.6)
The LE AD protocol, running under the Random Scheduler over the complete graph, needs O(n 2 log(n)) computation steps to stabilize, while the basic Leader Election population protocol needs O(n 2 ).

Population Protocols with Absence Detector

The Halting Leader Election Population Protocol with Absence Detector LE AD under the HS Scheduler

We suppose now that the protocol LE AD is running under the HS Scheduler in a population whose interaction graph is complete. A description of the expected value of its stabilization time is given in the following theorem: Theorem 6.2. Let T LE AD be the time needed by the LE AD , that runs over a complete graph under the HS Scheduler, to stabilize. Let E(T LE AD ) be its expected value. Then:

E(T LE AD ) ∼ O(n 2 log(n)), as n → ∞.
Proof. As already specified above, we suppose that the protocol LE AD runs over a population formed by (n + 1) elements: n agents that are initially with state F , and the absence detector.

We start by focusing on the first effective step of this protocol which consists on the first meeting of an agent with state F with the absence detector and that will update the state of this agent to L. Let T AF denote the time needed for this first meeting to happen and let E(T AF ) be its expected value.

Let G AF be the set of edges linking each agent of the population to the absence detector. G AF forms a star where the center is the absence detector and we have:

π(G AF ) = a=(u,v) ∈ G AF

Pr(HS(a)).

As the interaction graph is the complete graph K n+1 , and according to (4.11), we can write:

π(G AF ) = a=(u,v) ∈ G AF β n 2 = β n 2 × n = β n ≤ 1 . (6.7)
Let ξ G AF be the event of obtaining at least (and also at most in this case as we can not have more than one handshake over a star) one handshake in G AF . According to Lemma 5.2, we can write: Pr(ξ G AF ) ≥ λ min(1, π(G AF )) that, given (6.7), becomes:

Pr(ξ G AF ) ≥ λ π(G AF ) . (6.8)
On the other hand we have,

E(T AF ) = 1
Pr(ξ G AF ) . (6.9)

This yields:

E(T AF ) ≤ 1 λ π(G AF ) ≤ n λ β . (6.10)
6. The Fair Protocol Aware HS Scheduler Now, once the state L appeared in the population, the agent having this state will try to change each agent with state F to F halt . Let G LF be the set of edges linking the agent L to each of the k remaining agents with state F . Initially k = n -1 and should finally reach 0. G LF forms the star of size k + 1 where the center is the agent with state L.

π(G LF ) = a=(u,v) ∈ G LF Pr(HS(a)) = a=(u,v) ∈ G LF β n 2 = β n 2 × |G LF | = β k n 2 ≤ 1, ∀ 0 ≤ k ≤ n -1 . (6.11)
Let ξ G LF be the event of obtaining at least one handshake in G LF . According to Lemma 5.2, and given (6.11), we have:

Pr(ξ G LF ) ≥ λ π(G LF ) .
(6.12) Let T LF be the time needed to reach a configuration where k = 0, and thus all the agents that were F have become F halt . Let E(T LF ) be the expected value of T LF . Then, we have:

E(T LF ) = n-1 k=1 1 Pr(ξ G LF )
. Given (6.12), this becomes:

E(T LF ) ≤ n-1 k=1 1 λ π(G LF ) ≤ n-1 k=1 n 2 λ β k ≤ n 2 λ β n-1 k=1 1 k ≤ n 2 λ β H n-1 . (6.13)
Now, let T LA be the time needed for the leader L to interact with the absence detector. Let E(T LA ) be the expected value of T LA . Let a be the edge linking the leader with the absence detector, then:

E(T LA ) = 1 Pr(HS(a)) = n 2 β . (6.14)
The expected value of the time needed for the LE AD to halt is the sum of the three expected values that we just estimated. We can thus conclude that: the expected value of the stabilization time of this protocol is O(n 2 log(n)).

Population Protocols with Some Local Termination Detection

According to Theorem 6.1 and Theorem 6.2, the protocol LE AD has the same time complexity when running over a complete graph under the Random Scheduler or under the HS Scheduler. Consequently, we can deduce the following corollary: Corollary 6.3. The Random Scheduler and the Handshake Scheduler are time equivalent with respect to the LE AD protocol running over a population P with a complete interaction graph.

Population Protocols with Some Local Termination Detection

According to Michail et al., introducing termination to population protocols has needed an oracle-node that has a global knowledge about the states of the agents forming the population, and which is connected to each of them. However, population protocols are distributed protocols designed to run over distributed systems and supposing that the agents have access to some global knowledge is a bit too strong as hypothesis. Thus, a question arises of whether it is possible to introduce termination to population protocols without any need to a global knowledge.

In the sequel, we propose the population protocols model with some local termination detection that extends a specific subclass of protocols from the original model to allow the detection of the local termination of some agents according to their states.

We would mention that attributing some local termination detection is applicable for any model extending the population protocols.

The Model of Population Protocols with Some Local Termination Detection

When reviewing the already proposed population protocols in literature (and also those extending them), we can notice that there is a family of protocols that have some states which once reached by an agent are never left. Furthermore, these states never appear as a member of an effective interaction. In other words, an agent that reaches such a state stops contributing to the protocol's progress. We denote these states final states, which correspond to halting states in the context of population protocols with absence detector. Definition 6.2. (Final State) A final state is a state that never appears in the left hand side of an effective transition rule of a population protocol. It is also an irreversible state: once it is reached by an agent, this latter will never be updated to a new one.

A final state can be described more formally as follows: -Q f inal ⊂ Q, and -∀ q ∈ Q, ∀ q f inal ∈ Q f inal , δ(q f inal , q) = (q f inal , q) and δ(q, q f inal ) = (q, q f inal ).

Population Protocols with Some Local Termination Detection

The Leader Election Population Protocol with Some Local Termination Detection

Let LE denote the basic Leader Election population protocol designed to run over complete graphs and already introduced in Chapter 2. It is a restriction of the protocol proposed by Angluin et al. [START_REF] Angluin | Stably computable properties of network graphs[END_REF] to only one effective transition rule which is:

(L, L) → (L, F ).
We can notice that, in this protocol, once an agent reaches the state F , it stops contributing in effective transitions and can not also update its state to a new one anymore. Consequently, F is a final state according to Definition 6.2 and Definition 6.3. Now, introducing local termination and the detection of this termination to this population protocol gives rise to a leader election population protocol with some local termination detection that we denote LE T . This protocol consists of the following 8-tuple (X, Y, Q f inal , Q, I, O, δ, ζ) with:

• X = {L}, Y = {L, F }, • Q f inal = {F }, Q = {L, F }, • ∀ x ∈ X, I(x) = x, • ∀ y ∈ Y , O(y) = y,
• δ : (L, L) → (L, F ), and

• ∀q ∈ Q, ζ(q) = 1 if q = F
, and ζ(q) = 0 otherwise.

The VarProduct Mediated Population Protocol with Some Local Termination Detection

According to the description of the VarProduct mediated population protocol presented in Section 2.5, and to our definitions of finite states, we can conclude that the state c is a final state. Thus, converting VarProduct to a mediated population protocol with some local termination detection gives V arP roduct T = (X, Y, Q f inal , Q, S, I, O, ι, ω, δ, ζ) with:

• X, Y , Q, S, I, O, ι, ω, and δ are the same elements as those described for the VarProduct protocol,

• Q f inal = {c}, and

• ∀q ∈ Q, ζ(q) = 1 if q =c,
and ζ(q) = 0 otherwise.

The Maximal Matching Mediated Population Protocol with Some Local Termination Detection

The Maximal Matching, as it is described in Section 5.4, consists of only one effective transition rule which is: (q 0 , q 0 , 0) → (q 1 , q 1 , 1).

6. The Fair Protocol Aware HS Scheduler Thus, an agent reaching q 1 stops participating in effective interactions. Consequently, q 1 is a final state. Hence, a Maximal Matching mediated population protocol for which we introduce some local termination detection can be described by the protocol M axM atch T = (X, Y, Q f inal , Q, S, I, O, ι, ω, δ, ζ) with:

• X, Y , Q, S, I, O, ι, ω, and δ are the same elements as those described for the Maximal Matching protocol,

• Q f inal = {q 1 }, and

• ∀q ∈ Q, we have: ζ(q) = 1 if q = q 1 , and ζ(q) = 0 if q = q 0 .

Unlike the previous protocols, the M axM atch T protocol (also the Maximal Matching protocol) can reach a configuration where all the agents are with the final state q 1 . We say that this protocol is a locally terminating protocol. Definition 6.4. (Locally Terminating Population Protocol) A locally terminating population protocol is a population protocol with some local detection of termination where all the agents eventually reach a final state. Remark 6.1. Introducing local termination detection to any population protocol has no effect on the computation process of this latter (there are no added or omitted computation steps). Thus, the time needed for the protocol with some local termination detection to stabilize is the same as the one needed for the original protocol.

The Protocol Aware HS Scheduler

In both models, the population protocols with absence detector and the population protocols with some local detection of termination, a node halts when reaching a state from which is does not contribute to any effective interaction anymore, but continue interacting with the rest of the population. Any interaction that will involve the halting agent can not lead to any states update. Thus, if an agent with a final state stops interacting with the others, this has no consequence on the computation of the protocol. Therefore, we think about introducing effective termination of agents with final states. Stopping the interactions that involve agents with final states could be interesting as this could help an agent save its limited resources, and also may even lead to a faster stabilization of the protocol as non effective interactions will be avoided.

The Description of the Protocol Aware HS Scheduler

We propose to introduce this effective termination of the agents with final states via a protocol aware scheduler able to take into account the states of the agents. This protocol aware scheduler should consider that an agent with a final state is not an enabled agent anymore, which implies that this agent will never be picked among an ordered pair of agents chosen to communicate by this scheduler.

Therefore, we design a slightly modified version of the HS Scheduler that we call Protocol Aware HS Scheduler. This scheduler is also based on randomized handshakes while taking into account the states of the agents. Hence, no handshake will be possible over an edge where one extremity is an agent in a final state.

The Protocol Aware HS Scheduler

The Protocol Aware HS Scheduler can also be considered as a labeling of the edges of the interaction graph over which the protocol runs. The label of each edge is the probability that a handshake happens over it. However, unlike the case of the HS Scheduler, this labeling depends on the current states of the nodes, and thus on the current configuration of the population.

Accordingly, a formal definition that describes a scheduling of a population protocol with some local termination detection under the Protocol Aware HS Scheduler corresponds to: Definition 6.5. (Protocol Aware HS Scheduler) Let P be a population with an interaction graph G = (V, E). Let A be a population protocol with some local termination detection running over P. A scheduling of A with the Protocol Aware HS Scheduler corresponds to the following mapping:

HS Aware : (V (T ), E) → [0, 1] (C, e) → Pr (HS C (e))
with V (T ) is the set of vertices of T (A, G) which is the transition graph of the protocol A over the graph G, and Pr (HS C (e)) is the probability that, given the configuration C of the population P, a handshake takes place over the edge e.

Compared to the protocol aware schedulers that are already proposed in the context of population protocols, this scheduler can simulate the Modified Scheduler (see Section 4.3.2) where ε = 1 but without being diam(G)-central. In fact, as it is based on handshakes, the Protocol Aware HS Scheduler is 1-central.

The Protocol Aware HS Scheduler is suitable not only for the population protocols with some local termination detection but also for all the models extending them as long as they preserve the pairwise interactions.

The Protocol Aware HS Scheduler Procedure

As mentioned above, the Protocol Aware HS Scheduler is based on the randomized handshake model that should take into account the states of the agents. Some slight modifications are brought to the local randomized handshake procedure described in Algorithm 7 so that its global result can suit the description of the Protocol Aware HS Scheduler and simulate its functioning. The result is called the Protocol Aware HS Scheduler procedure defined by Algorithm 8.

The Protocol Aware HS Scheduler procedure is the Algorithm 7 where we insert, once the loop is initiated, a test step. If the agent's state is a final state, and consequently ζ returns 1, then the agent halts. Otherwise, it executes the computation steps from 2 to 18 of the Algorithm 7 that remain unchanged.

Traduced in the context of message passing communication model in wireless sensor networks, this gives: the agent that halts stop sending any "hello" messages so that its neighbors can not detect its presence anymore. And from its neighbors side, and as the agents are anonymous, no activity will be detected over the port via which the halting agent was supposed to send messages. Consequently, the neighbors of the halting node will not detect its presence but without realizing that this specific agent has halted or does not belong to their neighborhood anymore. Consequently, once a node halts, it simply 6. The Fair Protocol Aware HS Scheduler stops being able to initiate any handshake (or any interaction). Likewise, its neighbors can not detect it anymore as a neighbor being able to interact with, and thus do not initiate any handshake with it.

Therefore, the global result of the Protocol Aware HS Scheduler procedure guarantees that no handshake is possible over an edge where one extremity is a node with a final state.

Algorithm 8

The Protocol Aware HS Scheduler Procedure In this section, we aim to analyze the Protocol Aware HS Scheduler procedure that we proposed to better describe the processing of Protocol Aware HS Scheduler. Therefore, we start by defining, for each agent belonging to a population that runs a population protocol, and for each possible configuration C of the population, an attribute d C (v). Definition 6.6. (Node's Degree in a Configuration) Let P be a population with an interaction graph G = (V, E). Let A be a population protocol running over P. Let T = (V (T ), E(T )) be the transition graph of the protocol A over the graph G. For any v ∈ V , any C ∈ V (T ), d C (v) denotes the degree of the node v according to the configuration C. This attribute is initialized as follows: Definition 6.7. (Initialization of Node's Degree) Let P be a population with an interaction graph G = (V, E). Let A be a population protocol running in P. Let T = (V (T ), E(T )) be the transition graph of the protocol A over the graph G.

Let C 0 ∈ V (T ) denote the initial configuration. For any v ∈ V , d C 0 (v) = d(v) where d(v) is the degree of the node v in G.
Then, this attribute can vary as described in the following definition: Definition 6.8. (Node's Degree Variation) Let P be a population with an interaction graph G = (V, E). Let A be a population protocol running over P. Let T = (V (T ), E(T )) be the transition graph of the protocol A over the graph G. Let C i-1 and C i be any two configurations from V (T ) such that C i-1 → C i . Then, for any v ∈ V ,

d C i (v) =      0, if C i (v) ∈ Q f inal (v reaches a final state in C i ) d C i-1 (v) -x, if x neighbors of v reach final states in C i d C i-1 (v),
otherwise.

The Protocol Aware HS Scheduler

In words, d C (v) denotes the number of the enabled neighbors of the node v: those that are not with final states in C and with which v can potentially interact. d C (v) = 0 implies that: either no neighbor of v is enabled during the configuration C, or the state of v in C is final. This corresponds to the fact that v stops communicating with any of its neighbors.

For any configuration C, any node v from the population, the attribute d C (v) satisfies the following lemma: Lemma 6.4. Let P be a population with an interaction graph G = (V, E). Let A be a population protocol running over P. Let T = (V (T ), E(T )) be the transition graph of the protocol A over the graph G. For any t ≥ 1, for any C ∈ V (T ), let C t denote the t th time that the configuration C is encountered. Then, for any v ∈ V ,

d C t (v) = d C t-1 (v) = ... = d C 1 (v).
Proof. Recall that a configuration C is a snapshot of all the nodes states in the population. By definition, for any t ≥ 1, and for any v ∈ V :

C t (v) = C t-1 (v) = ... = C 1 (v)
Also, for any two configurations C and C from V (T ) such that C = C , there exists at least one node u ∈ V for which C(u) = C (u).

Let v be any node from the set V . Then, according to the Definition 6.8, d C (v) is determined by the state of the node v and also the states of its neighborhood. Suppose that, for t ≥ 1, there exists t > t, such that, d C t (v) = d C t (v). This implies that v or one of its neighbors reached a final state. Even if this final state was not reached in the t th time where C is encountered but in another configuration from which C is reachable, and given that a final state is irreversible, this final state will still appear in C t . That is: there exists at least one node u from V such that C t (u) = C t (u), which contradicts the definition. Thus, the condition that:

∀ t ≥ 1, ∀ v ∈ V , C t (v) = C t-1 (v) = ... = C 1 (v)
, guarantees that each agent has the same state each time the configuration C is encountered. This implies that:

d C t (v) = d C t-1 (v) = ... = d C 1 (v).
The Probability of a Handshake over an Edge with the Protocol Aware HS Scheduler Let A denote a population protocol that runs over a population P with a communication graph G = (V, E), and let T = (V (T ), E(T )) be its transition graph over G. Each agent of P executes Algorithm 8. As we already mentioned: ∀ e = (u, v) ∈ E, ∀ C ∈ V (T ), Pr (HS C (e)) denotes the probability that, given the configuration C, a handshake happens over the edge e. Pr (HS C (e)) corresponds to the probability that the Protocol Aware HS Scheduler picks the edge e and consequently allows the pair of agents forming e to communicate. This probability is described by the following lemma: Lemma 6.5. Let A be a population protocol running over an interaction graph G = (V, E). Let T = (V (T ), E(T )) be the transition graph of the protocol A over the graph G. Then, ∀ e = (u, v) ∈ E, ∀ C ∈ V (T ), we have:

Pr (HS C (e)) = β d C (u) d C (v) .
6. The Fair Protocol Aware HS Scheduler

Proof. The proof is based on a same reasoning than the one of the proof of Lemma 4.2.

We recall that a handshake between two agents means that they have mutually chosen each others to communicate, and they generated two different random values. A node u can choose a node v iff u detects v as one of its neighbors (that is: v is still an enabled neighbor of u). Accordingly, given a configuration C from V (T ), the probability that u chooses v is:

Pr(c(u) = v) = 1 d C (u) . (6.15)
Let Pr(r u = r v ) denote the probability that u and v generate two different random numbers. According to (4.2), we have:

Pr(r u = r v ) = 1 -1 N = β .
According to these two probabilities, if e = (u, v), we obtain:

Pr (HS C (e)) = β d C (u) d C (v)
.

As a consequence of this Lemma, we have: a scheduling of a population protocol (or any of its extensions) that has an empty set of final states, with the Protocol Aware HS Scheduler, corresponds simply to a scheduling with the HS Scheduler. In fact, for any possible configuration C of the population, as there are no final states, nothing will cause the modification of the attribute d C of each agent of the population. Thus, for any agent u, d C (u) will be equal to d(u). Hence, for any possible configuration C of the population and ∀e = (u, v) ∈ E, we have: Pr (HS C (e)) = Pr (HS(e)). Remark 6.2. We recall that in the proofs of Lemma 5.1, Lemma 5.2 and Corollary 5.3, proposed in [START_REF] Duchon | Broadcast in the rendezvous model[END_REF], the value of the probability of a handshake was not involved. Thus, in spite of the difference between the handshake model used there (in [START_REF] Duchon | Broadcast in the rendezvous model[END_REF]) and the one we just proposed, these two lemmas and this corollary remain valid for our model of handshake too.

The Probability of a Least one Handshake over a Graph with the Protocol Aware HS Scheduler Now, we focus on the probability that the Protocol Aware HS Scheduler picks at least one pair of agents to communicate, which corresponds to the probability of having at least one handshake over the interaction graph. This probability is as specified in the following lemma: Lemma 6.6. Let A be a population protocol with some local termination detection running on a communication graph G = (V, E) under the Protocol Aware HS Scheduler. Then, the probability that this Scheduler picks at least one ordered pair of nodes at the end of Algorithm 8 is lower bounded by 1 -e -β 2 .

Proof. In the sequel, we denote {e 1 , . . . , e m } the set of edges in the interaction graph over which the protocol A runs. Let C be any possible configuration of the population where A is executed. We also denote by HS C (G) the event: Given the configuration C, there is at least a handshake in the graph G. The HS C (G) and HS C (e) are respectively the complement events of HS C (G) and HS C (e).

The Protocol Aware HS Scheduler

We have:

Pr HS C (G) = Pr ∧ m i=1 HS C (e i ) .
A similar computation to the one established in the proof of Lemma 4.3 gives:

Pr HS C (G) ≤ 1 - m i=1 Pr (HS C (e i )) m m . (6.16)
On the other hand, we have:

m i=1 Pr (HS C (e i )) = {u,v}∈E β d C (u)d C (v)
.

Now, with respect to Definition 6.7 and Definition 6.8, for any possible configuration C, we have:

∀ u ∈ V, d C (u) ≤ d(u) .
This yields:

m i=1 Pr (HS C (e i )) ≥ {u,v}∈E β d(u)d(v) .
Yet, given (4.7) established in the proof of Lemma 4.3, we can write:

m i=1 Pr (HS C (e i )) ≥ β 2 .
Thus, (6.16) becomes:

Pr HS C (G) ≤ 1 - β 2m m ∼ e -β 2 .
(6.17)

Consequently, we obtain:

Pr (HS C (G)) ≥ 1 -e -β 2 . (6.18)
The Number of Simultaneous Handshakes with the Protocol Aware HS Scheduler

Let G = (V, E) be the interaction graph of a protocol A running under the Protocol Aware HS Scheduler. Let T (A, G) = (V (T ), E(T )) be the transition graph of A over G and C represent any configuration from V (T ). Given C, we denote X the random variable (r.v) which counts the number of simultaneous handshakes that can take place at the same step. A similar computation to the one performed in 4.10, using the linearity of the expectation, we can obtain the expected number of X:

E (X) = (u,v)∈E β d C (u)d C (v) . (6.19)
6. The Fair Protocol Aware HS Scheduler

The Fairness of the Protocol Aware HS Scheduler

The Protocol Aware HS Scheduler, as it was introduced above, should satisfy the fairness condition proposed by Chatzigiannakis et al. in [START_REF] Chatzigiannakis | Not all fair probabilistic schedulers are equivalent[END_REF].

Theorem 6.7. The Protocol Aware HS Scheduler is a probabilistic consistent fair scheduler with probability 1.

Proof. First, we start by proving that the Protocol Aware HS Scheduler is probabilistic. Let A be any population protocol with an interaction graph G = (V, E). Let T (A, G) = (V (T ), E(T )) be any transition graph and C i be any configuration in V (T ). Let C j be any configuration in V (T ) reachable in one step from C i . We define Enc C i C j = {enc | enc ⊂ E(G) and C i enc → C j }. Now, for each element enc from Enc C i C j , we rewrite the set E of the edges of the communication graph G as the union of three disjoint subsets:

E = enc F 1 F 2 ,
with:

• F 1 = {f ∈ E | if f = (u, v) then ∃e ∈ enc such that e = (u, v ) or e = (u , v)}, and
• F 2 = {f ∈ E | if f = (u, v) then ∀e ∈ enc, if e = (u , v ) then u = u , u = v , v = u and v = v } .
Any time C i is encountered, C j is selected with the following probability:

Pr C i C j = enc⊂Enc C i C j Pr (HS C i (enc)) Pr HS C i (F 2 ) .
Hence, the scheduler can define a probability distribution to every configuration C ∈ V (T ). It is then a probabilistic scheduler.

The probability Pr C i C j depends on the probabilities of the handshakes, given C i , over enc and F 2 , which in turn depend on the probability Pr (HS C i (e)) where e ∈ (enc ∪ F 2 ).

According to Lemma 6.4 and Lemma 6.5, this probability does not depend on the number of times the configuration C i is encountered. As a consequence, Pr C i C j also does not depend on the number of times the configuration C i is encountered. Therefore, we can state that the Protocol Aware HS Scheduler is consistent. Also, according to Definition 4.15 of a one step computation, C i → C j implies that there exists enc ⊂ E such that C i enc --→ C j which means that Pr C i C j > 0. Thus, with respect to Theorem 4.1, the Protocol Aware HS Scheduler is a probabilistic consistent fair scheduler with a probability 1. Proof. Let P be a population of n agents and an absence detector. Let C 0 denote the initial configuration of P executing the LE AD protocol over a complete interaction graph G = (V, E), under the Protocol Aware HS Scheduler. Let T AF denote the time needed for the first agent with state L to appear (which is the time needed for the first meeting between an agent with state F and the absence detector to take place). And, let E(T AF ) be its expected value. Let G AF be the set of edges linking each agents of the population to the absence detector.

π(G AF ) = a=(u,v) ∈ G AF Pr(HS C 0 (a)) = a=(u,v) ∈ G AF β d C 0 (u) d C 0 (v)
.

With respect to Definition 6.7, we have: ∀u ∈ V , d C 0 (u) is initialized with the degree of u in G. Thus, we can rewrite (6.20) such as:

π(G AF ) = a=(u,v) ∈ G AF β d(u) d(v) = a=(u,v) ∈ G AF β n 2 = β n 2 × n = β n ≤ 1 . (6.20)
This takes us back to the same case already studied in the proof of Theorem 6.2. Thus, we can conclude that:

E(T AF ) ≤ n λ β . ( 6

.21)

As an agent with state L appeared in the population, this latter will reduce every agent with state F it meets, to F halt . Let G LF be the set of edges linking the agent L to each of the k remaining agents with state F . Initially k = n -1 and should finally reach 0. Now, ∀ 0 ≤ k ≤ n -1, we denote C k any configuration where there are k agents with state F .

π(G LF ) = a=(u,v) ∈ G LF Pr(HS C k (a)) = a=(u,v) ∈ G LF β d C k (u) d C k (v) . (6.22)
6. The Fair Protocol Aware HS Scheduler

In a configuration C k , there are k agents with state F , one agent with state L, the rest of the population, except the absence detector, are with the final state F halt . Thus, in this configuration, and as the interaction graph is complete, the attribute d C k of each vertex from those forming the edges of G LF is equal to k + 1. This yields:

π(G LF ) = β (k + 1) 2 × |G LF | = β k (k + 1) 2 ≤ 1, ∀ 0 ≤ k ≤ n -1 . (6.23)
Let ξ G LF be the event of obtaining at least one handshake in G LF . According to Lemma 5.2, and given (6.23), we have:

Pr(ξ G LF ) ≥ λ π(G LF ) . (6.24)
T LF denotes the time needed for reducing all the agent with state F to F halt by the agent L, and E(T LF ) denotes its expected value. We have:

E(T LF ) = n-1 k=1 1 Pr(ξ G LF )
. Given 6.12, this becomes:

E(T LF ) ≤ n-1 k=1 1 λ π(G LF ) ≤ n-1 k=1 (k + 1) 2 λ β k ≤ 1 λ β n-1 k=1 (k + 2 + 1 k ) ≤ 1 λ β n(n -1) 2 + 2(n -1) + H n-1 .
The configuration C 0 , as described above, denotes the one where there are (n -1) agents with state F halt and one agent L (C 0 is not the initial configuration C 0 ). Now, given this configuration, the last step needed for this protocol to stabilize (or halt) is an interaction between the agent with state L and the absence detector. Let T LA the time needed for this step to take place and let E(T LA ) be its expected value. Let a be the edge linking the leader with the absence detector.

E(T

LA ) = 1 Pr(HS C 0 (a)) (6.25)
As the agent with state L and the absence detector are the only remaining agents with non final states, they both have attributes d C 0 equal to 1. Consequently, (6.25) becomes: According to this theorem, and to Theorem 6.8 and Corollary 6.3, we can conclude that the protocol LE AD , running over a complete graph, stabilizes faster when it is under the Protocol Aware HS Scheduler, compared to the Random Scheduler and HS Scheduler.

E(T LA ) = 1 β . ( 6

The Time Complexity of the Leader Election with Some

Local Termination Detection under the Protocol Aware HS Scheduler Theorem 6.9. The complexity of the stabilization time of the Leader Election protocol with some local termination detection, running over a complete graph, under the Protocol Aware HS Scheduler is: O(n), as n → ∞.

Proof. Let P be the population of n agents that executes the Leader Election with some local termination detection as described in Section 6.2.2 over a complete graph. We denote C k any configuration of P where there are k agents with state L, with 1 ≤ k ≤ n.

The initial configuration will be C n as initially, all the agents start with state L. Given C k , let G k denotes the set of edges existing between the k agents with state L. G k is a complete graph of k nodes. ξ G k is the event of obtaining at least one handshake in a round for at least one edge in G k .

Let T LE be the time needed for this protocol to stabilize and let E(T LE ) be its expected value. Then, if we suppose that, at each round, at most one L goes to the final state F , then we obtain:

E(T Kn ) ≤ n k=2 1 P (ξ C k )
On the one hand and according to Lemma 5.2, we have:

Pr(ξ G k ) ≥ λ min(1, π(G k )) . (6.27)
On the other hand, π(G k ) is such that:

π(G k ) = a=(u,v) ∈ G k Pr(HS C k (a)) = a=(u,v) ∈ G k β d C k (u) d C k (v) = β (k -1) 2 |G k | = β k 2(k -1)
≤ 1 . (6.28)

6. The Fair Protocol Aware HS Scheduler Then, (6.27) and (6.28) imply:

E(T Kn ) ≤ n k=2 1 λ π(C k ) ≤ 2 λ β n k=2 (1 - 1 k ) ≤ 2 λ β ((n -2) -(H n -1)) ≤ 2 λ β (n -H n -1)
Accordingly, the complexity of the stabilization time of this Leader Election with some local termination detection running over a complete graph under the Protocol Aware HS Scheduler is O(n), as n → ∞.

Accordingly, we can notice that introducing some local termination detection to the Leader Election protocol and its scheduling with the Protocol Aware HS Scheduler in a complete graph allows us to have an expected value of the stabilization time which is O(n) compared to O(n 2 ) in case of the Random Scheduler and HS Scheduler.

The Time Complexity of a Particular Case: the Iterated Population Protocols

In this section, we focus on a particular case of the protocols with some local termination detection running under the Protocol Aware HS Scheduler. We call these protocols: the iterated protocols. In an iterated protocol, once a node participates in a computation, it directly goes to a final state and halts. As an example, we can consider the mediated population protocol Maximal Matching with some local termination detection (see Section 6.2.2) as an iterated mediated population protocol since once a pair of agents is picked by the scheduler, both agents go to the final state q 1 . A study of the time complexity of these iterated protocols is presented while considering different interaction graph structures.

A General Upper Bound

As a general upper bound for the time complexity of an iterated protocol, we have the following lemma: Lemma 6.10. Let A be an iterated protocol. Then, the expected time to compute A is upper bounded by O(n).

Proof. Let T be the r.v. that counts the number of rounds before the agents of the population computing the iterated protocol A halt. We define the following (pessimistic) process (Y t ) t≥0 :

Y t =    n if t = 0 Y t-1 -2 if X t ≥ 1 Y t-1 if X t = 0. (6.29)
The process (Y t ) t≥0 is an irreversible ergodic Markov chain whose states are in the set {n, n -2, • • • , n -2 n 2 } and by Lemma 4.3, the transition probabilities are given by:

Pr Y t = n -2 n 2 | Y t-1 = n -2 n 2 =
1 and for any i > 0, and any j ∈ {n, • • • , 0},

Pr Y t = i | Y t-1 = j =    e -β 2 if i = j 1 -e -β 2 if i = j -2 0 otherwise . (6.30)
Let T denote the time for the process (Y t ) t≥0 , starting at Y 0 = n to reach the absorbing state Y t ≤ 1. Then, the expected value of T is such that :

E (T ) = n 2 -1 i=0 1 Pr Y t = n -2(i + 1) | Y t-1 = n -2i = n 2 -1 i=0 1 1 -e -β 2 = n 2 1 -e -β 2 .
On the other hand, it is clear that T < T and hence E (T ) ≤ E (T ), which ends the proof.

Upper Bound when the Interaction Graph is Complete

A represents any iterated protocol running over a population P of n agents with a complete interaction graph G = (V, E) = K n . In this case, we can state the following lemma: Lemma 6.11. Let T Kn denote the time complexity of an iterated protocol A running over an interaction graph a complete communication graph G. Then, the expected value of T Kn satisfies:

E (T Kn ) ≤ n -log( n 2 ) λ β , as n → ∞.
Proof. Let G k denote the graph formed by the k agents that are still with non final states in the population. Initially, k = n, then k decreases until reaching n -

2 n 2 . ∀ n -2 n 2 ≤ k ≤ n, G k is a complete graph. ξ C k
is the event of obtaining at least one handshake in a round for at least one edge in G k . C k represents any possible configuration of the population P where there are k remaining agents with non final states. Now, if we consider the pessimistic process, where at each round, there is at most one pair of agents that go to final states, then:

E(T Kn ) ≤ n 2 k=0 1 Pr(ξ G n-2k ) (6.31)
6. The Fair Protocol Aware HS Scheduler Now, to evaluate Pr(ξ G n-2k ), we focus on:

π(G n-2k ) = a∈G n-2k Pr(HS(a)) = (u,v)∈G n-2k β d C n-2k (u)d C n-2k (v) = (u,v)∈G n-2k β (n -2k -1) 2 = β (n -2k -1) 2 (n -2k)(n -2k -1) 2 = β(n -2k) 2(n -2k -1) ≤ 1 .
Now, by Lemma 5.2, we obtain:

E(T Kn ) ≤ n 2 k=0 1 λ π(G n-2k ) ≤ n 2 k=0 2(n -2k -1) λ β (n -2k) ≤ 2 λ β   n 2 + 1 - n 2 k =n mod 2 1 2k   ≤ 2 λ β n 2 + 1 - 1 2 H n 2 .
We recall that the expected value of the stabilization time of the Maximal Matching protocol running in a complete graph is O(n 2 ), either being scheduled by the Random Scheduler or the HS Scheduler. Now, according to this lemma, we can conclude that introducing some local termination to this protocol, and its computation under the Protocol Aware HS Scheduler allows us to have a lower upper bound of the stabilization time, which is O(n).

Upper Bound when the Interaction Graph is with Bounded Degree

Let A be any iterated protocol running over a population P of n agents with G = (V, E) its interaction graph. In this section, we consider interaction graphs with degrees bounded by ∆. Then, we have the following lemma: Lemma 6.12. Let T be the time complexity of an iterated protocol A running over an interaction graph G that has a degree bounded by ∆. The expected value of T satisfies:

E (T ) ≤ - log( n∆ 2 ) log 1 -β ∆ 2 .
6.5. The Time Complexity of a Particular Case: the Iterated Population Protocols Proof. Let t represent an iteration of the algorithm and we define the sequence of graphs (G t ) (t≥0) as follows: G 0 = G and for all t ≥ 1, G t+1 is the graph obtained by removing, from G t , the pairs that execute a computation step and their incident edges. In other words, G t is the graph formed by the agents of the population that are not with final states at iteration t.

We define the following random variables: for any t ≥ 0, X t denotes the number of edges of the graph G t and Y t denotes the number of edges removed from the graph G t at the end of iteration t. Then, we have X t+1 = X t -Y t and thus:

E (X t+1 | G t ) = E (X t | G t ) -E (Y t | G t ) = X t -E (Y t | G t ) . (6.32)
On the other hand, for any pair e = (u, v), if a computation is done by the pair (u, v) at iteration t, then the edge e is removed from the graph G t . Hence, by (6. [START_REF] Berge | Graphs and Hypergraphs[END_REF]),

E (Y t | G t ) ≥ (u,v)∈E(Gt) β d Ct (u)d Ct (v) , (6.33)
where C t stays for the configuration of the population at iteration t. Then:

E (X t+1 | G t ) ≤ X t - (u,v)∈E(Gt) β d Ct (u)d Ct (v) . (6.34)
Since, for any C t , for any u, d Ct (u) ≤ d(u) ≤ ∆, this becomes:

E (X t+1 | G t ) ≤ X t 1 - β ∆ 2 . (6.35)
For t ≥ 0, we define the r.v.

Z t = Xt (1-β ∆ 2 ) t . Then, E (Z t+1 | G t ) ≤ Z t .
Thus, the r.v. Z t is a super-martingale, and then:

E (Z t+1 ) = E (E (Z t+1 | G t )) ≤ E (Z t ) . (6.36)
A direct application of a theorem from [START_REF] Williams | Probability with Martingales[END_REF] yields to E (Z t ) ≤ Z 0 = m. Thus:

E (X t ) = 1 - β ∆ 2 t E (Z t ) ≤ m 1 - β ∆ 2 t . (6.37)
We have m ≤ n∆ 2 and the algorithm halts when X t < 1. This implies that t is upper bounded by -

log( n∆ 2 ) log(1-β ∆ 2 )
which ends the proof. Corollary 6.13. If ∆ is a constant, then the expected time to compute the iterated protocol is O (log n).

Upper Bound when the Interaction Graph is a Random Graph

In this section, we analyze the complexity of an iterated protocol in random graphs. We focus our study on the case where G = G n,p with p = α log n n (with α > 1), that is on the random graphs which are connected with high probability. We have the following result:

6. The Fair Protocol Aware HS Scheduler Lemma 6.14. Let G n,p = (V, E) be a random graph with p = α log n n (for α > 1). Let T the time complexity of an iterated protocol A running over this G n,p . The expected value of T satisfies:

E (T ) ≤ - log n log 1 -β α log n .
Proof. The proof uses the same arguments as for the proof of Lemma 6.12. We define the sequence of graphs (G t ) (t≥0) , and the two r.v. X t as the size of G t and Y t as the number of edges removed at the end of the computation step t. Then we have X t+1 = X t -2Y t , and:

E (X t+1 | G t ) = X t -2E (Y t | G t ) .
Given (6.33), and as we have: for any C t , for any u, d Ct (u) ≤ d(u), we get:

E (Y t | G t ) ≥ (u,v)∈E(Gt) β d(u)d(v) . (6.38)
Then, using (4.21), this becomes:

E (Y t | G t ) ≥ β X t 2α log X t . (6.39)
Consequently, we obtain:

E (X t+1 | G t ) ≤ X t - β α log X t X t .
Now, as X t ≤ n, ∀t ≥ 0, we have:

E (X t+1 | G t ) ≤ 1 - β α log n X t .
Then, the theorem holds by the same reasoning as for the proof of (6.36) and (6.37).

We recall that the expected value of the stabilization time of the Maximal Matching protocol running in a G n,p graph is: O( n 3 log n ) under the Random Scheduler, and O(n log 2 (n)) under the HS Scheduler. Consequently, given Lemma 6.14, we can conclude that introducing some local termination to this protocol and using the Protocol Aware HS Scheduler, allows a faster stabilization of this protocol.

Conclusion

We presented in this chapter, the model of population protocol with absence detector proposed by Michail et al. that introduces the concept of termination in population protocol. We focused on the Leader Election protocol with absence detector. We studied the expected value of its stabilization time first when running under the Random Scheduler, then when running under the HS Scheduler. We concluded thanks to this study, that the Random Scheduler and the HS Scheduler are time equivalent with respect to this 6.6. Conclusion protocol running in a complete interaction graph. They both have an expected value of the stabilization time which is O(n 2 log(n)).

We then introduced the model of population protocol with some local termination detection. We designed for these protocols a protocol aware distributed scheduler: the Protocol Aware HS Scheduler. This scheduler is also based on randomized handshakes. It allows agents that reach a specific state, called final state, to stop participating in the pairwise interactions. We proved that this scheduler is fair with probability 1. We took up the example of the Leader Election protocol with absence detector. This protocol running in a complete graph under the Protocol Aware HS Scheduler needs O(n 2 ) computation steps to stabilize. It thus stabilizes faster compared to its computation under the Random Scheduler and the HS Scheduler.

We also studied the stabilization time of the Leader Election with some local termination detection and the iterated protocols that we proposed, when running under the Protocol Aware HS Scheduler.

We proved that introducing some local termination detection to the Leader Election protocol, and to the Maximal Matching protocol, and their computation under the Protocol Aware HS Scheduler gave lower upper bounds compared to their executions under the Random Scheduler and the HS Scheduler. In this chapter, we introduce ViSiDiA: the Java framework designed for the visualization and simulation of distributed algorithms. Thanks to this framework, we are going to illustrate the possibility of the mappings that we presented in Chapter 3, between the population protocols and tasks with graph relabeling systems on the one hand, and between the population protocols and the anonymous asynchronous message passing model on the other hand. We thus represent the possibility of describing a (mediated) population protocol with each of these two models through the examples of the three protocols already studied in the previous chapters. Then, once the different studied schedulers (the Random Scheduler, the HS Scheduler and the Protocol Aware HS Scheduler) are implemented on ViSiDiA, we propose to validate the theoretical analyses established in the previous chapters with experiments under this platform.

Our publication in [START_REF] Abdou | ViSiDiA: A Java Framework for Designing, Simulating, and Visualizing Distributed Algorithms[END_REF] can be a tool for the reader to get familiar with ViSiDiA platform.

ViSiDiA

ViSiDiA (Visualization and Simulation of Distributed Algorithms) is a Java framework that allows to implement, simulate and visualize distributed algorithms [START_REF] Abdou | ViSiDiA: A Java Framework for Designing, Simulating, and Visualizing Distributed Algorithms[END_REF][START_REF] Bauderon | A unified framework for designing, implementing and visualizing distributed algorithms[END_REF]. It is based on the modeling of a network as a graph wherein each node represents a processor and the edges represent communication channels. ViSiDiA has a dual purpose: educational and research. Regarding the educational goals, ViSiDiA aims to facilitate the understanding of distributed algorithms. From the research point of view, the goal is to make easier the design, evaluation and analyses of new distributed algorithms.

Main Functionalities

The main functionalities of ViSiDiA, from a user's perspective, are depicted in Figure 7.1. In fact, a user can run an experiment, implement a new algorithm, or replay a simulation.

To run an experiment, the user should first define a network topology. He can either create it in ViSiDiA, or import it as a GML (Graph Modeling Language) file. Creating a network topology in ViSiDiA can be done manually, or automatically thanks to a new module that we added to this platform. This module offers the possibility of automatically generating three different types of graphs: Random Graphs (the G n,p model), Random Geometric Graphs (Unit Disk Graph model) and Small World Graphs. This makes the task of the user much easier especially when he has to generate graphs with huge sizes. No matter how the graph is generated, the status of the processes and edges are encoded by labels.

Thereafter, the user can select an algorithm among those provided in ViSiDiA's database which may be enhanced by user's defined algorithms. Once an algorithm is selected, the simulation can be carried out. The user can visualize the progress of the simulation through animations, but this is not mandatory. Also, instead of running a new experiment, a user can replay a previously recorded simulation. ViSiDiA is implemented in Java and has been designed using a multi-layer architecture. This design choice allows to easily extend the functionalities of each layer independently of the other layers. For instance, this architecture facilitates the implementation of new algorithms. The flowchart of this multi-layer architecture is illustrated by Figure 7.2 (where plain arrows represent direct association, while the dashed arrow is an indirect association). This architecture relies on a Model-View-Controller (MVC) pattern where: the model is the graph representing a distributed system, the view is the Graphical User Interface (GUI), and the controller is the simulator module.

Experimentation under ViSiDiA Platform

The GUI is the first layer. It enables to build the graph that represents the network topology, to visualize the progress of the simulation and to potentially influence this progress (speed up, slow down or pause the simulation). The second layer includes the graph description tool and the distributed algorithms simulator. The latter is the main module of ViSiDiA. It is worth noting that this module is independent from the GUI. Indeed, a simulation can run without any GUI. ViSiDiA uses an event-driven simulator. Any action leads to the generation of an event. These events are interpreted by the simulator which (eventually) modifies the graph. For example, the communication process by message passing can lead to several events:

-event 1: the source node issues a message.

Computing Models for Networks of Tiny Objects 7.1. ViSiDiA -event 2: the GUI (if any) displays the message going from the source node to the destination(s).

-event 3: once the message reaches the destination, it is put in the receiver's queue.

-event 4: the receiver performs some actions according to the content of the message.

These events are transparently managed by the simulation module and algorithm developers do not have to deal with them.

The last layer contains an Application Programming Interface (API) that allows users to program their own distributed algorithms and run them on ViSiDiA.

Regarding this architectural pattern, we can draw several conclusions:

-the simulation console is independent from the GUI, -the graph is only modified by GUI (through user interaction) and simulation console, -the algorithms must refer to the simulation console to operate on the graph.

Distributed Communication Models

ViSiDiA implements various distributed communication models that are: message passing, mobile agents, and local computations with graph relabeling rules, using both synchronous and asynchronous systems. By asynchronous system, we mean there is no global clock shared by all nodes and messages can arrive at arbitrary times.

The algorithms database of ViSiDiA contains some well-known distributed algorithms such as: leader election, spanning tree computation, ring coloring, graph enumeration, etc, implemented with these different models of communication. Also, as already mentioned above, the API allows ViSiDiA users to implement their own algorithms. According to the distributed communication model on which the algorithm will be based, they can simply invoke the corresponding already defined functions.

Developing New Algorithms with Message Passing

We present the example of the implementation of a broadcast algorithm based on message passing. This algorithm is as follows: we suppose that a given node (say v), labeled "A" has an information to broadcast. v sends the message to all its neighbors. Upon receiving the message, each node changes its own label to "A" then forward this message to its respective neighbors (except the one which previously sent this message). We propose the asynchronous version of this broadcast algorithm (see Listing 7.1).

The getDescription() method is not mandatory. It is used to add a description of the algorithm that will be displayed in the GUI when the user will browse the list of the algorithm in order to select one of them (using a Java JFileChooser).

The getMessageTypeList() is used by ViSiDiA to get the list of messages that will be displayed on the GUI (the user can choose to display them or not). In this example, there is only one message type, called wave.

Population Protocols in ViSiDiA

by the user). Therefore it sends to all its neighbors a message that contains the text " Wave" (line 6). If the label of the node is not "A", then the node waits for the first message coming on one of its doors (lines 8-9). Then the node changes its label (line 10) before forwarding the message it received (lines [START_REF] Attiya | Distributed Computing: Fundamentals, Simulations and Advanced Topics[END_REF][START_REF] Bollobas | Random graphs[END_REF][START_REF] Bauderon | From local computations to asynchronous message passing systems[END_REF][START_REF] Bauderon | Graph relabelling systems: A tool for encoding, proving, studying and visualizing distributed algorithms[END_REF].

Developing New Algorithms with Graph Relabeling Systems

Now, if the user chooses to describe its distributed algorithm in ViSiDiA using the abstract model of graph relabeling systems, then ViSiDiA offers him an easier method to implement it without writing any code. In fact, he has just to draw the sequence of the corresponding relabeling rules that encode its algorithm. These relabeling rules can be described as LC0, LC1 or LC2 rules.

We consider the graph relabeling system R ST , described in Section 3.1, that encodes a distributed algorithm computing a spanning tree of any graph. R ST consists of only one relabeling rule: R ST . Thus, implementing the distributed algorithm encoded by R ST in ViSiDiA consists on drawing R ST as it is shown in Figure 7. Accordingly, in the left part of Figure 7.3, the relabeling rule that allows to relabel the graph is described. And, in the right part, some forbidden contexts can be added.

Population Protocols in ViSiDiA

Through Chapter 5 and Chapter 6, we established some theoretical results concerning the time complexity of some protocols running under different schedulers. We aim to validate these results through some experiments and simulations. We propose to use ViSiDiA as a simulation tool. We can notice that, according to the description that we provided in the previous section, ViSiDiA was not specially designed to handle the population protocol model and its extensions. However, we already established in Chapter 3 an approach that allows to describe the computation of a (mediated) population protocol as a realization of a task with graph relabeling system, or as a distributed algorithm in an anonymous asynchronous system based on message passing. We describe in this section how such mappings are possible with ViSiDiA. In this section, we illustrate the possibility of describing the computation a (mediated) population protocol as a realization of a task with a graph relabeling system in ViSiDiA.

We show this through the following three examples: the OR population protocol, the Leader Election population protocol and the Maximal Matching mediated population protocol.

The OR Protocol

We recall the population protocol OR described in Section 4.6.3. We just update Q OR such that Q OR = {A, N } with A standing for the state q 1 and N for the state q 0 (it is more adapted with the existing labels in ViSiDiA). Let T OR be a task whose input and output labeling types are respectively: L OR i and L ORo . Let (G, σ i ) be a labeled graph in the domain of T OR . And let R OR = {L OR , I OR , P OR } be a graph relabeling system. Now, with respect to the mapping approach that we established in Chapter 3, we have to define the parameters of T OR and R OR such that the realization of T OR on (G, σ i ) according to R OR corresponds to the computation of the OR protocol.

Consequently, these parameters should be as follows:

• L OR i = L ORo = X OR = {0, 1},
• L OR = Q OR = {A, N },

• I OR = L OR ,

• P OR = φ(δ OR ) = {R OR 1 , R OR 2 },

• the initialization function of this realization λ OR = I OR , and

•

The Leader Election Protocol

We consider now the population protocol Leader Election (see Section 2.2.3) where we just modify the notation of the states forming the set Q LE such that Q LE = {N, A}. The state N stands for the state L and A for F .

Population Protocols in ViSiDiA

To map the computation of this protocol to a realization of task with a graph relabeling system, we define a task T LE with an input labeling type L LE i = X LE and an output labeling type L LEo = Y LE .

We also consider a We recall that in case of complete interaction graphs, the transition function of this protocol can restricted to only one transition rule which is δ LE (N, N ) = (N, A). Then P LE can also be restricted to the relabeling rule R LE 1 in this case.

The Maximal Matching Protocol

We consider the Maximal Matching mediated population protocol, introduced in Section 5.4 with a slight modification of the states denotation (to better suit the existing labels in ViSiDiA). Accordingly, a state A replaces the state q 1 and a state N replaces the state q 0 . We focus now on describing the computation of this protocol as a realization of a task.

Let T M axM atch be a task with an input labeling type

L M i = X M = {0},

Simulation Results

Now to validate our theoretical results concerning the time complexity of some (mediated) population protocols under different scheduling scenarios and over different graph structures, we have the possibility of implementing them in ViSiDiA using one of the two models as described in the previous section.

In what follows, we present the results of the simulations of these different scenarios in ViSiDiA. For each scenario, the experiments were repeated 20 times.

In the sequel, we are going to use the following abbreviations:

-n: denoting the size of the interaction graph (the size of the population) where the protocol runs.

-Exp. Av.: denoting the experimental average of the stabilization time obtained with simulations. We recall that time is estimated in number of rounds of the protocol.

-Exp. U. B.: denoting the experimental upper bound, which is the highest value of the stabilization time of a given scenario reached in the simulations.

-Theo. U. B.: denoting the theoretical upper bound we established through the theoretical analyses of the stabilization time of the protocol.

The OR Protocol

The OR Protocol over Complete Graphs

We consider the population protocol OR running in a population whose interaction graph is the complete graph K n . We present in According to Corollary 5.6, the two schedulers are time equivalent with respect to this protocol. In fact, the expected value of the stabilization time of the OR protocol either running under the Random Scheduler, or under the HS Scheduler, is in this case O(n ln(n)). This is confirmed by the results presented in computation steps compared to its computation under the Random Scheduler. The probability of an edge to be picked by the HS Scheduler has the minimum value when the graph is complete.

The Leader Election over Random Graphs

Now, we suppose that the population, over which the Leader Election protocol is running, has a connected random interaction graph G n,p . We proceed on simulations of this protocol under this population by assuming that the pairwise interactions are handled by the Random Scheduler. Then, a second set of simulations is performed by assuming that the pairwise interactions are handled by the HS Scheduler. The results of these simulations are represented in Given Table 7.4, we can notice that both theoretical bounds related to the two considered scenarios are respected. Also, Corollary 5.15 is validated as the two schedulers are not time equivalent with respect to the Leader Election protocol. Indeed, the computations under the HS Scheduler stabilize faster. Also, according to these experimental results, we think that a tighter theoretical bound related to the expected stabilization time of this protocol can be found. Also, by referring to the experimental results presented in Table 7.5, we can conclude that an iterated Maximal Matching stabilizes faster when running under the Protocol Aware HS Scheduler compared to its computation either under the Random Scheduler or the HS Scheduler.

The Iterated Maximal Matching in Random Graphs

Let P be a population whose interaction graph is the connected random graph G n,p . We simulate the computation of the iterated Maximal Matching in this population where the pairwise interactions are handled by the Protocol Aware HS Scheduler. We present the results of these experiments in Table 7.8.

The upper bound of this scenario, established in Lemma 6.14, is validated through these experimental results. Thanks to the Protocol Aware HS Scheduler, we have computations of the Maximal Matching protocol that quickly stabilize.

Conclusion

We presented in this chapter the ViSiDiA platform, the Java framework designed for implementing and simulating distributed algorithm. We realized through this platform the possible mappings of the population protocol model to tasks with graph relabeling systems, and to anonymous asynchronous distributed algorithms based on message passing. We illustrated these mapping through some examples of protocols, so that the user of ViSiDiA can reproduce this for any protocol. We implemented the different schedulers introduced in this work in this platform. We then simulated each of the studied protocols by considering different scenarios. Thanks to the experimental results of these simulations, we validated the theoretical results we obtained for the stabilization times of these protocols.

Conclusion

The pairwise computational model of population protocols was designed for anonymous asynchronous networks of tiny objects that can be passively mobile. A pairwise interaction in fact synchronizes two agents that exchange their states and update them accordingly. However, Angluin et al. do not specify how this synchronization and this simultaneous bidirectional exchange take place.

We noticed that the population protocols present some similarities with a local computational model in graphs, which is tasks with graph relabeling systems. This latter also uses an abstract communication model. Also, among its possible interaction models, there are pairwise interactions. We established a comparative study to explore the existing correspondences and the key differences between the (mediated) population protocols and tasks with graph relabeling system. As a result, we proposed a mapping approach. We proved that the mapping of the execution of a (mediated) population protocol to a realization of a task according to a graph relabeling system is always possible. However, the reverse mapping is possible only under some conditions.

Then, we proposed to describe the computation of a (mediated) population protocol, and more particularly, the simultaneous bidirectional pairwise interaction, through a less theoretical model. We considered the model of anonymous asynchronous message passing with port numbering. Hence, a population protocol is described as a distributed algorithm based on message passing and running in an anonymous asynchronous system. The pairwise interaction is thus split into two phases: a synchronization phase and a simultaneous send and receive phase.

Based on these two comparative studies, we established a bridge between the: population protocol model and tasks with graph relabeling systems model that are based on abstract communications and anonymous asynchronous message passing model that uses explicit communications. The pairwise interactions in population protocols are under the control of a scheduler. In the context we presented above, the role of the scheduler includes the synchronization of the communicating pair of agents. We proposed an implementation of the Random Scheduler, introduced by Angluin et al., based on message passing according to the mapping we defined. Also, as all the existing schedulers in population protocols are sequential, we proposed a 1-central scheduler called the HS Scheduler. This scheduler is able to capture concurrent interactions. It is based on randomized handshakes. We also proposed a suitable algorithm describing this scheduler and based on message passing. Through the analysis of this algorithm, we proved that this scheduler is fair with probability 1.

We then established a comparative study to investigate the time equivalence of the Random Scheduler and this HS Scheduler. This was presented through the analyses of the stabilization time of three protocols: the OR protocol, the Leader Election and the Maximal Matching. We proved that the two schedulers are time equivalent with respect to these protocols when the computations are over complete interaction graphs. However, in random interaction graph, the HS Scheduler allows faster stabilization.

We then introduced population protocols with some detection of local termination. We proposed a slightly modified version of the HS Scheduler, called the Protocol Aware HS Scheduler, to introduce termination to this model of population protocols. We also proved that this version of the protocol is fair with probability 1. We concluded that, with respect to the Leader Election protocol and to the Maximal Matching protocol, the Protocol Aware HS Scheduler is not time equivalent to the Random Scheduler and HS Scheduler. In fact, computations that take place under its scheduling stabilize faster.

Finally, we illustrated through the ViSiDiA platform the mapping approach of a (mediated) population protocol to a task with graph relabeling system, or to a distributed anonymous asynchronous algorithm based on message passing. We also implemented in this platform the protocols we studied, as well as the schedulers procedures we proposed. The experimental results we obtained through simulations allowed us to validate our theoretical results about the stabilization times of these protocols under different scheduling scenarios.

Future Directions

As a future direction of this thesis, we can consider the analysis of the Handshake Scheduler Algorithm under other interaction graphs representing the network of tiny wireless objects.

An interesting graph structure for such networks is a random geometric graph. A random geometric graph G n,r is an undirected graph with n nodes placed randomly in a given area. Two nodes share a communication link if and only if the distance separating them is smaller than r. Indeed, it is a realistic representation of the structure of the network where the objects communicate via a wireless media. The distance r can represent the communication range of this wireless media.

Another interesting graph structure is a small world graph. A small world graph is a random graph with short average path length and high clustering. In fact, there are recently many works proposing to represent networks of tiny objects, such as wireless sensor networks, as small world networks.

Then, the stabilization times of the studied protocols running in these graphs under the HS Scheduler can be analyzed. The obtained theoretical results can be validated through simulations in ViSiDiA.

Another future direction is to extend the pairwise interaction model of population protocols. In fact, wireless networks allow, in addition to point to point communications, one to many communications. That is, an agent in a wireless network can communicate with all its direct neighborhood. Therefore, extending the population protocols to handle such interactions is interesting. We can consider them as star communications where the Conclusion center node and all its neighborhood exchange their respective states. This can correspond to LC1 or LC2 interactions in local computations in graphs.

A probabilistic scheduler can also be designed for these interactions. It can be inspired from the randomized algorithms implementing the synchronizations of these interactions (either LC1 or LC2). We can work on proving the fairness of this scheduler.

We can then analyze the stabilization times of the studied protocols extended to communicate in stars and running under this scheduler. A possible direction is to investigate the time equivalence of the different proposed schedulers with respect to some protocols.

1 . 1 A

 11 matching of a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 A symmetric directed graph . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 LC0 relabeling rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 LC1 relabeling rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 LC2 relabeling rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 The spanning tree relabeling rule R ST . . . . . . . . . . . . . . . . . . . . . 3.5 A distributed computation of a spanning tree with R ST . . . . . . . . . . . 3.6 The LC0 rule R ET for election in a tree with initial knowledge of vertices degrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Realization of the task T election in a tree with initial knowledge of vertices degrees. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 A relabeling rule representing a transition rule . . . . . . . . . . . . . . . . 3.9 The relabeling rules of the relabeling system R T h . . . . . . . . . . . . . . 3.10 A realization of the task T T h . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 The relabeling rules of the graph relabeling system R EC . . . . . . . . . . 3.12 Zoom on a bidirectional communication link in asynchronous message passing system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 Local port numbering of an undirected graph . . . . . . . . . . . . . . . . . 3.14 Attributing input port awareness to a directed graph . . . . . . . . . . . . 3.15 Attributing complete port awareness . . . . . . . . . . . . . . . . . . . . . 3.16 From an undirected to a directed graph . . . . . . . . . . . . . . . . . . . . 3.17 The representation of a directed edge from the interaction graph G in its associated network communication graph G . . . . . . . . . . . . . . . . . 3.18 Representation of (u, v) from G in G with SB u and SB v labellings . . . . 3.19 From the interaction graph G to its associated network communication graph G labeled with SB . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.20 Assigning port numbers to the network communication graph G labeled with SB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.21 Possible Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 The Markov chain corresponding to the computation of the population protocol OR under the Random Scheduler in K n . . . . . . . . . . . . . . .

Definition 1 .

 1 19. (Neighborhood) A neighbor of a vertex is any vertex to which it is adjacent. The set of the neighbors of a vertex u, in a graph G, is denoted N G (u). Definition 1.20. (Degree) The degree of a vertex v, denoted in the sequel d(v), is the size of the set of neighbors N G (v).

Definition 1 .

 1 22. (Distance in a graph) ∀u, v ∈ V , the distance between u and v, denoted dist(u, v), is the length of the shortest path between this two vertices. Definition 1.23. (Diameter of a graph) The diameter of a graph is the largest distance between any two vertices in this graph. Definition 1.24. (Connectivity) An undirected graph G is connected if ∀u, v ∈ V , a path between u and v exists in G. Definition 1.25. (Matching) Let

5 e2Figure 1 . 1 :

 511 Figure 1.1: The set M = {e 2 , e 6 } is a matching of this graph.

Figure 1 . 2 :

 12 Figure 1.2: A symmetric directed graph

Definition 1 .

 1 32. (Tree) A tree is an undirected, connected, acyclic graph. Definition 1.33. (Spanning Tree) A spanning tree of a graph G is a spanning subgraph of G, whose structure is a tree. Definition 1.34. (Star) A graph is a star if it is a rooted tree of a maximum diameter 2. The root is called the center of the star, and the remaining vertices are called the leaves. Definition 1.35. (Regular Graph) A graph is regular if all its vertices have the same degree. Definition 1.36. (Bounded Degree Graph) A graph G = (V, E) has a degree bounded by ∆, if ∀v ∈ V , d(v) ≤ ∆. Definition 1.37. (Complete Graph) A graph is complete if for any pair of its vertices, there is an edge linking them. A complete graph of n vertices is denoted K n and it has n(n-1) 2 edges. 1.3. Probability Theory Definition 1.38. (Random Graph) A random graph is a graph obtained by starting with a set of n vertices and adding edges between them at random.

1. 3 . 1

 31 Basic Definitions Definition 1.40. (Experiment) An experiment is any physically or mentally conceivable undertaking that results in a measurable outcome. Definition 1.41. (Sample Space) The sample space is the set Ω of all possible outcomes of an experiment. Definition 1.42. (Event) An event in the sample space Ω is a subset of Ω. Let {E j | j ∈ J} be a family of events, then: Definition 1.43. (Union of Events) The union j∈J E j is the set of outcomes belonging to at least one E j . Definition 1.44. (Intersection of Events) The intersection j∈J E j is the set of all outcomes belonging to every E j . Definition 1.45. (Complement of an Event) The complement E of an event E is the set of outcomes in the sample space not belonging to E. Definition 1.46. (Disjoint Events) Any two events E and F are disjoint if E ∩ F = ∅.

Proposition 1 . 4 .

 14 (Monotonicity) If F ⊆ E, then Pr(F ) ≤ Pr(E).

Definition 2 . 4 .

 24 (Reachable Configuration) Let C and C be two population configurations. We say that C is reachable from C if there is a sequence of configurationsC 0 , C 1 , . . . , C k where C = C 0 and C k = C and ∀i ∈ {0, 1, . . . , k -1}, C i → C i+1 . We denote this by C * → C .Accordingly, a formal definition describing the execution of a population protocol over a population is as follows[START_REF] Angluin | Computation in networks of passively mobile finite-state sensors[END_REF]: Definition 2.5. (Execution) An execution is a finite or infinite sequence of population configurations

Chapter 3 A

 3 Bridge between Population Protocols, Tasks with Graph Relabeling Systems and Anonymous Asynchronous Message Passing 3.1. From Population Protocols to Tasks with Graph Relabeling Systems

Figure 3 . 1 :

 31 Figure 3.1: LC0 relabeling rule updating the label of the edge (u, v) from s 1 to s 1 , and modifying the labels of the vertices respectively from u and v, to u and v .

Figure 3 . 2 :

 32 Figure 3.2: LC1 relabeling rule updating the label of the center node, labeled u, and all its incident links labeled s 1 , s 2 and s 3 , but without altering the labels of the leaves nodes x, w and v.

Figure 3 . 3 :

 33 Figure 3.3: LC2 relabeling rule involving all components of the star whose center node is labeled u, and modifying all their labels.

Figure 3 . 4 :

 34 Figure 3.4: The spanning tree relabeling rule R ST

  Output states are extracted uniformly over L o according to the local extraction function π : L → L o . we consider the following example of a realization of a task according to a graph relabeling system. Example 3.2. Election in a Tree with Initial Knowledge of the Vertices Degrees.

Figure 3 . 7 :

 37 Figure 3.7: Realization of the task T election in a tree with initial knowledge of vertices degrees.

3 .

 3 Outputs Extraction The states are mapped to outputs according to the agent output function O: Q → Y (and the edge output function ω: S → Y ).

Figure 3 . 8 :

 38 Figure 3.8: A relabeling rule representing the transition (u, v, s) → (u , v , s )

  3. A Bridge between Population Protocols and Other Interaction Models task. Correspondence Computation of a Realization of a Task with (Mediated) Population Protocol a Graph Relabeling System Inputs Input alphabet X Input labeling type L i = X States States sets Q (and S) Labeling type L = Q(∪S) Outputs Output alphabet Y Output labeling type L o = Y Initialization Input functions Initialization function I : X → Q (and ι : X → S ) λ : L i → L A Computation Step A transition from the transition function A rule from the set

  of relabeling rules P = φ(δ) Output Extraction Output functions Extraction function O : Q → Y (and ω : S → Y ) π : L → L o Global State of the Network Configuration Labeling Table 3.1: Mapping an execution of a (mediated) population protocol to a realization of a task with a graph relabeling system: Correspondence between the different elements 3.1. From Population Protocols to Tasks with Graph Relabeling Systems Example 3.3. Mapping the Computation of the Threshold Population Protocol to a Realization of a Task with a Graph Relabeling System.

Figure 3 .

 3 Figure 3.10: A realization of the task T T h

Figure 3 . 11 :

 311 Figure 3.11: The relabeling rules of the graph relabeling system R EC

Figure 3 .

 3 Figure 3.13 is an example of port numbering of an undirected graph.

Figure 3 . 13 :

 313 Figure 3.13: Local port numbering of an undirected graph

Figure 3 . 14 :

 314 Figure 3.14: Attributing input port awareness to a directed graph

Figure 3 .

 3 Figure 3.15 shows an example of attributing complete port awareness to the processes of a network.

Figure 3 . 15 :

 315 Figure 3.15: Attributing complete port awareness

3. 2 .Figure 3 . 16 :

 2316 Figure 3.16: From an undirected to a directed graph

  .

Figure 3 . 17 :

 317 Figure 3.17: The representation of a directed edge from the interaction graph G in its associated network communication graph G

Figure 3 .Figure 3 . 19 :

 3319 Figure 3.19: From the interaction graph G to its associated network communication graph G labeled with SB

Figure 3 . 20 :

 320 Figure 3.20: Assigning port numbers to the network communication graph G labeled with SB

Algorithm 1

 1 The Algorithm Algo Require: T rySynchronization(u)1: state u ← I(input u );

  end loop Example 3.4. Mapping the Computation of the Population Protocol Threshold to the Execution of a Distributed Algorithm in an Asynchronous Anonymous

Algorithm 2

 2 Algorithm Simulating the T hreshold Population Protocol Require: T rySynchronization(u) 1: state u ← I(input u );

Figure 3 .

 3 Figure 3.21: Possible Mappings

3 .

 3 A Bridge between Population Protocols and Other Interaction Models asynchronous algorithm based on message passing model as graph relabeling systems.

Definition 4 . 4 .

 44 (Strong Global Fairness) Let C and C be two configurations, and let α be an input assignment such that (C, α) → C . If (C, α) = (C i , α i ) for infinitely many i, then (C i , α i ) = (C, α) and C i+1 = C for infinitely many i.

Definition 4 . 6 .

 46 (Weak Global Fairness) For every C, α and C such that (C, α) → C , if (C, α) occurs infinitely often in EX, then C occurs infinitely often in EX. Definition 4.7. (Weak Local Fairness) For every action σ, if σ is enabled infinitely often in EX, then there exist C, α, C such that (C, α) σ → C , (C, α) occurs infinitely often in EX, and C infinitely often in EX.

Definition 4 . 8 .

 48 (Transition Graph) The transition graph G(A, P) of a protocol A running in a population P is the directed graph whose nodes are all possible population configurations and whose edges are all possible transitions between these configurations.A transition graph will be denoted, in what follows, by T (A, G) = (V (T ), E(T )) where G is the communication graph over which the protocol A runs.Hence, the formal definition of a probabilistic scheduler with respect to a transition graph is: Definition 4.9. (Probabilistic Scheduler) A probabilistic scheduler, w.r.t a transition graph T (A, G), defines for each configuration C ∈ V (T ) an infinite sequence of probability distributions of the form (d C 1 , d C 2 , . . .), over the set Γ + (C) = {C | C → C }, where d C t : Γ + (C) → [0, 1] and such that Σ C ∈Γ + (C) d C t = 1 holds for all t and C .

Definition 4 .

 4 10. (Consistent Scheduler) A probabilistic scheduler is consistent, w.r.t. a transition T (A, G), if for all configurations C ∈ V (T ), it holds that d C = d C 1 = d C 2 = .. .. This means that any time the configuration C is encountered, the scheduler chooses the next configuration with the same probability distribution d C over Γ + . This holds for all C, each with its own distribution.

4 .

 4 A Distributed Fair Scheduler by Randomized Handshakes Algorithm 3 The Random Scheduler Procedure of Becchetti et al.

5 :

 5 Broadcast m(Id, Rd); 6: while ((ReceivedM essage = ∅) and (InitiatorF lag = true)) do 7:

4. 6 .

 6 The Handshake Scheduler Definition 4.15. (Transition) Let C and C be two population configurations. Let Enc = {e 1 , e 2 , . . . , e k } be a set of disjoint encounters from E such that:

Definition 4 .

 4 16. (Reachable Configuration) Let C and C be two population configurations. C * → C denotes that C is reachable from C via a sequence of configurations C 0 , C 1 , . . . , C k where C = C 0 , C k = C and ∀ i ∈ {0, 1, ..., k -1}, C i → C i+1 (with respect to Definition 4.15).

3 :

 3 Send 1 to c(v);

4 :

 4 Send 0 to each neighbor u = c(v); 5:

5 :

 5 if ((w = c(v)) and (m = 1)) then 6:

else 9 :

 9 if ((w = c(v)) and (m = 0)) then 10:Return to step 2; // There is no rendezvous with c(v) 11:

else 14 :

 14 if (port w = port c(v) ) and ((r w = 0) or (r v = r w ))) then 15:

  (HS(e)) = Pr(HS(e)|e ∈ E) × Pr(e ∈ E) + Pr(HS(e)|e / ∈ E) × Pr(e / ∈ E). (4.18)

n 1 Figure 5 . 1 :

 151 Figure 5.1: The Markov chain corresponding to the computation process of the population protocol OR under the Random Scheduler in a complete interaction graph.

  Proof. Let V L (respectively V F ) denote the set of agents with state L (respectively F ) and |V L | (respectively |V F |) the size of this set. Initially, |V L | = n as all the agents start with state L. When the Leader Election population protocol stabilizes, only one leader remains in the whole population which leads to: |V L | = 1 and |V F | = n -1.

1 |

 1 (respectively |V 0 |) the size of this set. Initially, only one agent is supposed to be aware of the information, then |V 1 | = 1 and |V 0 | = n -1. The protocol stabilizes when |V 1 | = n and |V 0 | = 0.

Definition 6 . 3 .

 63 (Final States of a Protocol) Let A=(X, Y, Q, I, O, δ) be a population protocol. Q f inal is the finite set of final states of the protocol A such that:

6. 4 . 6 . 8 .

 468 The Time Complexity of Leader Election Protocols under the Protocol Aware HS Scheduler 6.4 The Time Complexity of Leader Election Protocols under the Protocol Aware HS Scheduler 6.4.1 The Time Complexity of the Halting Leader Election under the Protocol Aware HS Scheduler Theorem The expected value of the stabilization time of the protocol LE AD running over a complete graph under the Protocol Aware HS Scheduler is O(n 2 ), as n → ∞.

Figure 7 . 1 :

 71 Figure 7.1: ViSiDiA's functionalities from users perspective

Figure 7 . 2 :

 72 Figure 7.2: ViSiDiA's architecture

  3.

Figure 7 . 3 :

 73 Figure 7.3: The spanning tree relabeling rule R ST in ViSiDiA

7 .

 7 Experimentation under ViSiDiA Platform 7.2.1 From Population Protocols to Tasks with Graph Relabeling Systems in ViSiDiA

R OR 2 :Figure 7 . 4 :

 274 Figure 7.4: The relabeling rules of R OR

Figure 7 .

 7 Figure 7.4 describes the relabeling rules R OR 1 and R OR 2 that should be drawn in ViSiDiA.

7 R LE 2 :Figure 7 . 5 :

 7275 Figure 7.5: The relabeling rules of R LE

  and an output labeling type L Mo = Y M = {0, 1}. Let R M = {L M , I M , P M } be a graph relabeling system with: L M = Q M ∪ S M = {A, N, 0, 1}, I M = {N, 0} and P M = φ(δ M ) = {R M }. The relabeling rule R M is as shown in Figure 7.6.

Figure 7 . 6 :

 76 Figure 7.6: The relabeling rule R M

7 .

 7 Experimentation under ViSiDiA Platform

5 .

 5 Equivalence en Temps: le Random Scheduler et le HS Scheduler. Nous étudions l'équivalence en temps du Random Scheduler et du HS Scheduler, par rapport aux protocoles suivants : le OU , l' Élection d'un Leader, et le Couplage Maximal. Nous présentons des analyses théoriques des temps de stabilisation de ces protocoles en considérant deux scénarios d'ordonnancement. Dans le premier scénario, c'est le Random Scheduler qui est utilisé. Dans le deuxième, c'est le HS Scheduler qui est utilisé. Nous considérons aussi deux différents types de graphe HS Scheduler de telle manière qu'il permet aux agents dont les états sont finaux de ne plus participer au calcul du protocole, et ainsi terminer. Ainsi, ces petites entités pourront éviter de dissiper leurs ressources limitées pour des interactions inutiles. Nous prouvons que cet ordonnanceur est équitable avec probabilité 1. Nous présentons aussi des calculs des bornes supérieures des temps de stabilisation des protocoles suivants : Élection d'un Leader et Couplage Maximal, s'exécutants sous cet ordonnanceur. Nous prouvons que cet ordannanceur permet une stabilisation plus rapide de ces protocoles comparé au Random Scheduler et au HS Scheduler. Une partie de cette contribution est apparue dans [61].

d'interaction : le graphe complet, et le graphe aléatoire. Nous prouvons que le Randam Scheduler et le HS Scheduler sont équivalents en temps par rapport aux protocoles étudiés lorsqu'ils sont exécutés sur des graphes d'interaction complets. Par contre, lorsque le graphe d'interaction est un graphe aléatoire, le HS Scheduler permet une stabilisation plus rapide de ces protocoles. 6. L'ordonnaceur Protocol Aware HS Scheduler. Nous proposons un nouveau modèle de calcul appelé protocoles de population avec une certaine détection locale de la terminaison. Ce modèle est une extension d'une sous classe des protocoles de population (et des modèles qui les étendent) avec une fonction de détection de terminaison locale qui permet à un agent de détecter si son état est final. Par la suite, nous présentons le Protocol Aware HS Scheduler, un nouvel ordonnanceur distribué et probabiliste qui prend en compte le protocole exécuté. Il s'agit d'une version ajustée du Une partie de ces résultats ont fait l'objet d'un article que nous avons soumis au journal Mathematical Structures in Computer Science , et dont nous attendons encore la réponse.

Table 3 .

 3 2 gives an overview of the basic differences existing between these two models, and that we are going to detail in the sequel:

	Differences	Task's Realization with Graph Relabeling System	(Mediated) Population Protocol's Computation
	Memory Constraint	×
	Symmetry Breaking	×
	Star Synchronization		×
	Termination		×
	Termination Detection		×
	Local Control Mechanisms		×

Table 3 . 2 :

 32

Table 5 .

 5 1: Summary of time analyses of some protocols under the Random Scheduler and the HS Scheduler 6.1. Population Protocols with Absence Detector

  .26) 6.4. The Time Complexity of Leader Election Protocols under the Protocol Aware HS SchedulerAccordingly, the complexity of the stabilization time of the protocol LE AD is, as n → ∞, O(n 2 ).

Table 6 .

 6 1 summarizes the established results related to the stabilization time upper bounds.

		Graph Structure K n G n,p	Scheduler Random HS P A HS	Time Complexity
	Leader Election	×	×	O(n 2 log(n))
	with	×	×	O(n 2 log(n))
	absence detector	×	×		O(n 2 )
	Leader Election with some LTD	×	×		O(n)
	MaxMatch	×	×		O(n)
	with some LTD	×	×	O(-	log n log(1-β α log n )	)

Table 6 .

 6 1: Time complexity of protocols with Absence Detector and with some local termination detection 7.1. ViSiDiA

Table 7

 7 .1 the results of the simulations of this protocol under the Random Scheduler, and under the HS Scheduler.

	n	Random Scheduler Exp. Av. Exp. U. B. Exp. Av. Exp. U. B. HS Scheduler	Theo. U. B. O(n ln(n))
	10	25	45	42	79	23
	20	70	96	123	175	60
	30	126	173	250	324	102
	40	159	202	317	426	148
	50	238	374	391	547	196
	60	262	325	584	698	246
	80	352	431	751	931	351
	100	455	542	973	1078	461

Table 7 .

 7 1: Simulations of the OR protocol over K n

Table 7 .

 7 1. ) Exp. Av. Exp. U. B. Exp. Av. Exp. U. B.

	7. Experimentation under ViSiDiA Platform
	Random Scheduler O(n 2 10 HS Scheduler Theoretical U. B. n 81 135 164 303 100
	20	338	718	543	1027	400
	30	918	2086	1361	2452	900
	40	1406	3169	2977	6068	1600
	50	2700	5769	4573	9786	2500
	60	3284	5546	4169	7256	3600

Table 7 .

 7 3: Simulations of the Leader Election protocol over K n

Table 7

 7

				.4.
	n	α	Random Scheduler Exp. Av. Exp. U. B. Theo. U. B. O( n 3 log n )	HS Scheduler Theo. U. B. Exp. Av. Exp. U. B. O(n log 2 n)
	40	2	1615	3208	39949	364	747	103
	50 2.25	2754	5287	73573	616	1482	144
	60 2.69	3199	6164	121474	551	1208	190
	80	2.7	6374	16134	269036	1118	1839	290
	100 2.5	11475	18185	500000	1693	3414	400

Table 7 .

 7 4: Simulations of the Leader Election protocol over G n,p

Table 7 .

 7 6: Simulations of the Leader Election with some local termination detection protocol in K nThe Iterated Maximal Matching in Complete GraphsWe focus on the computation of the Maximal Matching with some local termination detection in a complete graph under the scheduling of the Protocol Aware HS Scheduler. We proceeded on simulating this protocol, and the results are given in Table7.7.

	7. Experimentation under ViSiDiA Platform
	n	Protocol Aware HS Scheduler Theo. U. B. Exp. Av. Exp. U. B. O(n)
	100	192	224	100
	150	255	319	150
	200	392	433	200
	250	490	536	250
	300	584	610	300
	n	Protocol Aware HS Scheduler Theo. U. B. Exp. Av. Exp. U. B. O(n)
	100	98	105	100
	150	140	152	150
	200	188	204	200
	250	245	255	250
	300	296	306	300

Table 7 .

 7 7: Simulations of the iterated Maximal Matching protocol under Protocol Aware HS Scheduler in K n Through the results of this table, we experimentally validate Lemma 6.11 related to the upper bound of this protocol running under the Protocol Aware HS Scheduler and which is O(n).

Table 7 .

 7 8: Simulations of the iterated Maximal Matching protocol under Protocol Aware HS Scheduler in G n,p

	7.4. Conclusion

Plongement du modèle des protocoles de population dans le modèle des algorithmes distribués anonymes et asynchrones basés sur échange de messages. Nous établissons une étude comparative du modèle des protocoles de population (et qui est valable pour tout modèle étendant les protocoles de population tout en préservant le principe de communication entre paires) avec le modèle anonyme et asynchrone d'échange de messages. En effet, nous considérons qu'utiliser un modèle de communication abstraite dans des réseaux d'objets connectés est une hypothèse assez forte et théorique. Nous proposons ainsi une approche qui permet de traduire le calcul d'un protocole de population en un algorithme distribué basé sur échange de messages dans un système asynchrone et anonyme avec numérotation de ports. La numérotation de ports est la connaissance minimale et nécessaire pour pouvoir passer du modèle de communication abstraite à un modèle de communication explicite. L'échange simultané et bidirectionnel entre une paire d'agents dans un protocole de population est ainsi traduite en deux phases dans l'algorithme distribué correspondant : une phase de synchronisation, puis une phase d'envoi et de réception simultanés.En combinant ces deux approches avec des travaux déjà existants, nous établissons une passerelle entre ces trois différents modèles qui offre la possibilité de décrire chaque modèle à travers un

autre.3. L'algorithme du Random Scheduler.Basé sur la contribution précédente, nous proposons un algorithme distribué et anonyme basé sur échange de messages qui encode l'ordonnanceur Random Scheduler. Cet algorithme est conçu pour le cas où le graphe d'interaction est un graphe complet. Cette contribution est une amélioration d'un résultat que nous avons publié dans[START_REF] Ouled Abdallah | Randomized broadcasting in wireless mobile sensor networks[END_REF].Computing Models for Networks of Tiny Objects

Computing Models for Networks of Tiny Objects

2.4. Conclusion

3.3. Conclusion: Bridges between Models

Acknowledgments

I would like to thank my advisers Professor Akka Zemmari and Professor Mohamed Jmaiel, and my co-adviser Professor Mohamed Mosbah for introducing me to this research field, for welcoming me in their teams and for their directives, support and guidance.

Nesrine OULED ABDALLAH Bibliography

Chapter 4

The Handshake Scheduler: a Distributed Fair Scheduler by Randomized Handshakes LocalM in ← nbre;

7:

LocalM inP ort ← i; for i from 1 to d(u) do Receive(N eighborLocalM in, i); 20: if (LocalM in ≤ N eighborLocalM in) then

21:

GlobalM in ← f alse; Proof. Let X t be the set of agents with state q 0 and x t the size of this set, ∀t ≥ 0. Initially, as all the agents of the population P start with state q 0 , we have x 0 = n. Then, at each computation step, we consider the pessimistic scenario where the size of the set X t can either decrease by 2 or still unaltered. x t decreases by 2, only if a handshake happens between two agents with state q 0 and that are necessarily linked by an edge from the random interaction graph. The probability of this event is as follows:

Hence, if we bound the expected time to obtain a Maximal Matching of the interaction graph, by allowing at most one new edge in the matching per computation step, we can sum up the expected time to decrease the number nodes with state q 0 by 2.

Given the fact we supposed p = α log(n) n , we obtain from inequality (5.43):

(5.44)

Comparison

Based on the analyses we established in the two previous section, we can state the following corollary:

Corollary 5.21. The Random Scheduler and the HS Scheduler are not time equivalent with respect to the Maximal Matching protocol running in a population whose interaction graph is a random graph G n,p .

Proof. According to Theorem 5.19, the Maximal Matching protocol running in the population P under the Random Scheduler has a stabilization time whose expected value is O n 3 log(n) . However, when the computation in P is under the HS Scheduler, the expected value of the stabilization time of this protocol is O(n log 2 (n)). We can thus deduce that the computation of the Maximal Matching in a random interaction graph stabilizes faster when it is under the scheduling of the HS Scheduler. Consequently, these two schedulers are not time equivalent with respect to the Maximal Matching protocol running in the population P (whose interaction graph is G n,p ).

We also proved in this chapter, that with high probability, these three protocols need O(n) computation step to stabilize when running in a complete interaction graph under the HS Scheduler.

Chapter 6

The Fair Protocol Aware HS Scheduler 6. The Fair Protocol Aware HS Scheduler Hence, regardless of the state of the agent with which an agent with a final state may interact, this interaction can not lead to any progress in the computation of the protocol. We therefore propose to introduce local termination of such agents. When an agent reaches a final state, it implies that it has locally terminated and halts without stopping interacting with the rest of the population.

From Population Protocols to Population Protocols with some Local Termination Detection

We are going to focus now on the family of protocols where Q f inal = ∅ and rethink them in such a way that they can deal with the local termination of agents with final states. We thus extend this family of basic population protocols with a local termination detection function that enables an agent to check if its state is final.

We call this new extension of this subclass of population protocols the population protocols with some local termination detection. We should mention that all the concepts and definitions that are going to be presented hold for the population protocols model as well as any model extending it (among those that we presented in Chapter 2).

Let then A = (X, Y, Q, I, O, δ) be a population protocol with Q including a non empty set of final states Q f inal . Then, expressing A as a population protocol with some local termination detection gives

sets and:

• X, Y , Q, I, O, and δ are the same elements than those designed for A,

• Q f inal is a subset of the set of states Q that consists of the set of the final states of the protocol A, and

, 1} is a local termination detection function described as follows:

-

Thanks to this function, an agent can detect that it has locally terminated.

Accordingly, unlike the population protocols with absence detector, an agent in a population executing a population protocol with some local termination detection can halt based, not on some global knowledge, but only on its local state. However, even if an agent detects that it has locally terminated, it continues interacting with the rest of the population.

Examples of Population Protocols with Some Local Termination Detection

In this section, we propose three examples of protocols that we converted to (mediated) population protocols with some local termination detection: the Leader Election population protocol (see Section 2.2.3), the VarProduct mediated population protocol (see Section 2.5) and the Maximal Matching mediated population protocol (see Section 5.4).

Chapter 7

Experimentation under ViSiDiA Platform The core of the broadcast algorithm is described in the init method (Listing 7.2). The user does not have to handle the send and receive processes. He has only to invoke the corresponding function already defined in ViSiDiA, and that correspond in this example to: sendTo(), sendAll(), receive().

The instruction in line 3 allows to get the label of the node. On line 5, if the node's label equals to "A", this means the node is the initiator of the broadcast (decision taken

Implementation and Simulation in ViSiDiA

The implementation of any of these protocols described above consists on generating a labeled graph in the domain of the corresponding task and drawing the relabeling rules of the corresponding graph relabeling system. We should mention that in ViSiDiA, when drawing the relabeling rules, we do not need to specify the direction of the edges to break the symmetry. In fact, if we focus on Figure 7.3, we can notice that a LC0 rule is described over an edge where one of its extremities is the center of the ball of radius 1. The center will thus be considered as being the initiator while the other node is the responder.

Before launching the simulation, the user should choose the scheduling scenario. This is possible through the specification of the corresponding synchronization when drawing the relabeling rules. Then, simulation with ViSiDiA can take place and consequently the number of rounds needed for this computation to stabilize can be obtained.

From Population Protocols to Anonymous Asynchronous Message Passing in ViSiDiA

We consider in this section the possibility of simulating a (mediated) population protocol in ViSiDiA by mapping it to an asynchronous algorithm running over an anonymous system based on message passing. This algorithm is a distributed one consisting of a collection of local algorithms that are a detailed implementation of the Algo algorithm (see Algorithm 1) where:

• The procedure T rySynchronization() is replaced by the synchronization part of the algorithm related to the corresponding scheduler: either the Random Scheduler (Algorithm 4), the HS Scheduler (Algorithm 7) or the Protocol Aware HS Scheduler (Algorithm 8).

• Line 7 is replaced by an implementation of the application of any possible transition rule of the transition function of the corresponding protocol.

We continue with the same examples of the previous section by detailing, for each protocol, the part of the algorithm describing its transition function. We just give their descriptions as pseudo codes that are later implemented in Java under ViSiDiA. We should mention that we continue using, for each of these protocols, the same notation of the states already used in the previous section.

The OR Protocol

Describing the transition function δ OR in the context of an algorithm based on message passing corresponds to Algorithm 9.

Algorithm 9 The Transition

The Maximal Matching Protocol

The transition function δ M of the Maximal Matching protocol described in an algorithm based on message passing can be represented by Algorithm 12.

Note that stateEdge (u,c(u)) denotes the state of the edge linking a node u to c(v).

Algorithm 12 The Transition Function

Simulation Results

However, we can notice that a computation under the HS Scheduler needs more computations steps (or more time) to stabilize. Indeed, we can conclude from Table 7.1 that the experimental average of this protocol running under the HS Scheduler is twice the experimental average under the Random Scheduler. This is related to the probability of an edge from the interaction graph K n to be picked by each of these two schedulers.

In fact, we recall that this probability corresponds to 2 n(n-1) in the case of the Random Scheduler. However, it corresponds to β (n-1) 2 , with 0 < β < 1, in the case of the HS Scheduler. We can conclude that, this probability is higher when the scheduler is the Random one. This can explain the differences between the obtained values of the two scheduling scenarios.

The OR Protocol over Random Graphs

We summarize in Table 7.2 the results of the simulations of the OR protocol running in a population whose interaction graph is G n,p , with p = α log n n (α > 1). We considered a scheduling of the pairwise interactions with the Random Scheduler on the one hand, and under the HS Scheduler on the other hand.

We can notice that, in both scenarios, the theoretical upper bounds of the stabilization time are respected. Also, according to these experimental results, the two schedulers are not time equivalent which validate the result of Corollary 5.9. In fact, the computation of the OR protocol in a graph G n,p stabilizes faster when running under the HS Scheduler. As for the computation of the OR protocol, we can notice that the computation of the Leader Election in the complete graph under the HS Scheduler needs some additional 7.3. Simulation Results

The Maximal Matching Protocol

The Maximal Matching Protocol over Complete Graphs

We consider a population P whose interaction graph is the complete graph K n . We suppose that the agents of this population are running the Maximal Matching mediated population protocol. Simulations of this computation are performed by assuming a scheduling under the Random Scheduler on the one hand, and under the HS Scheduler on the other hand. The obtained results are summarized in Table 7 Thanks to these simulation results, Corollary 5.18 is confirmed: the two schedulers are time equivalent. Both scenarios respect the theoretical upper bound O(n 2 ).

The Leader Election with some Local Termination Detection

We consider the Leader Election population protocol with some local termination detection introduced in Section 6.2.2 running in a complete interaction graph K n . We proceed on simulating the computation of this protocol under the Protocol Aware HS Scheduler. The results of these simulations are shown in Table 7.6.

We can notice that the theoretical upper bound O(n) is respected. We recall that introducing some local termination detection does not affect the stabilization time of a population protocol. Hence, the results related to the Leader Election population protocol that we presented in the previous sections hold also for the Leader Election population protocol with some local termination detection. Accordingly, comparing the results of Table 7.6 to those of Table 7.3, we can confirm that the computation of the Leader Election population protocol with some local termination detection stabilizes faster when running under the Protocol Aware HS Scheduler, compared to its computation under the Random Scheduler or the HS Scheduler.

The Iterated Protocols

We consider in this section the iterated protocols defined in the previous chapter. As an example of these protocols, we consider the Maximal Matching with some local termination detection (see Section 6.2.2).