A Probabilistic Model for Distributed Merging of Mobile Agents

We propose a probabilistic algorithm for mobile agents which roam around in the network following a random walk . We consider the following problem: when two or more agents meet at a node, they merge into a single agent. As the graph is connected, the agents meet in ﬁnite time. We are interested in the time it takes for all agents to merge. More precisely, we study a probabilistic model and we analyse the time complexity of a distributed algorithm for all the agents to merge into a single one.


INTRODUCTION
With the current trends in distributed algorithms and computing, mobile agents are playing an important role.The stress is laid in using less resources.Acquiring global information of a huge network is a tedious job.The information is scattered around the globe and a mechanism is required to access them easily.A lot of research has been done keeping this in mind, however, there are still a lot of axes to be discovered in this area.In old and traditional distributed systems the data was transferred from node to node which was more difficult due to many network constraints.Mobile agents play an active role i.e., they migrate themselves from one node to another to perform any task.
We are working on models to create and analyse the algorithms using mobile agents.We can define our mobile agent as a light weight entity which does not have any memory.The important aspect of these agents is their displacement property.Owing to the fact that they do not have any memory the displacement method followed by them is random i.e. they decide at any moment t where to move in the step t + 1.They are free to make decision on their own and they can also decide to stay at the same place.However, their decision is only limited to a displacement of one step i.e. in their neighboring nodes.
The agents without memory performs the random walk which means that they do not know before hand, where will they go next.Simulating a random walk on a graph requires local information about the graph.That is why random walk has nice global properties.This makes random walk very useful in computations, where limited resources are available to determine global information.

PROBLEM
We consider multiple agents 2 ≤ k ≤ n; where k being the number of agents in the network and n is the number of nodes.The agents are placed randomly on the nodes.The problem we are studying is that if these agents move in the network then after how much time will all the agents take to meet.We consider the fact that whenever two or more agents meet, they merge and an agent is reduced.We are interested in calculating the time it takes to merge all the k agents into 1.In this paper, we launch the agents directly in the stationary regime.They displace in the network by doing random walk.
Question: Starting by k number of agents with n being the number of nodes of the network, k ≤ n, how much time it takes to merge k agents into 1?
We also observe that the agents will meet with probability 1.As the graph is connected so the agents will merge in finite time.
We are concerned here with a generic problem, which means that we are giving a mechanism for the agents to meet in the network.This problem is of greater interest for a big network where acquiring lot of resources is an issue.So in this case, the agents share or transfer knowledge to other agents hence avoiding the duplicacy in traversal schemes of agents.This means that studying this problem leads to many applications in the field of distributed algorithms.

AGENTS' PLACEMENT ON THE NETWORK
Now the question arises as by what mechanism can we place the agents in the network.
1.The agents are placed deterministically on the network; i.e. we place the agents on the nodes according to our requirement or will.2. The agents are created by the nodes of the network.The nodes choose at random to generate agents based on some timeout mechanism [5].3. The agents are placed arbitrarily on the nodes hence are completely randomized.4. The agents are placed arbitrarily on the nodes hence are completely randomized.Moreover, the agents launch their random walk in stationary regime.
The agents are not required to know the placement of the other agents.However, when any two agents come at the same node, they know the existence of the other agent and hence can merge sharing the information etc.

CONTRIBUTION
We study this problem using the Markov chain technique.The agents perform the random walk and there is a transition in the state of the agents.The transitions are explained in Section 3. We have done analysis considering the probabilistic behaviour of the agents.We did the calculations based on the fact that the mobile agents start their random walk in stationary regime.

RELATED WORKS
Merging of agents is directly related to rendezvous problem [4].There are many parameters to be taken into account for studying this kind of problem.
By using the random walk technique, the problem of rendezvous can be solved by introducing the mobile agents.A survey on random walks on graphs can be found in [14].We are analysing as what happens if we are using multiple agents.Does it improve the efficiency or not?Some works where these agents are used are spanning tree [1], Gathering [11] and Election problem [6].
A survey on mobile agent rendezvous can be found in [13].In this survey, authors have narrated various results on the mobile agent rendezvous on distributed networks having deterministic and randomized rendezvous among agents; the agents having computing power, control and memory and the number of agents vary from 2 to k.However, in our problem the mobile agents do not have control, memory and intelligence.
Furthermore, this merging techniques can be used in different applications such as searching for black-holes in the network [8].

OUTLINE
This paper is organized as follows.Some definitions has been given regarding the stationary regime and the model under study is described in Section 2. The general model for the transitions using Markov chain from 2 to k agents is given in Section 3. Then in Section 4, we study the rendezvous problem under stationary regime.In Section 5, we describe the states of the agents using laws such as Poisson distribution.The agents are placed on the graph and their position is determined by a random variable.The agents are in a unique stationary distribution.In Section 6, we conclude the paper.

MODEL & DEFINITIONS
Let G = (V, E) be a connected graph where vertices represent process and edges represent communication links.
In the sequel n will denote the size of G, i.e. n = |V | and m = |E| be the number of edges in the graph G.For any We consider a synchronous network which means nodes have access to a global clock.
A mobile agent (MA) is an entity which moves in the graph.The agents have unique identities.As the network is synchronous so all the agents move at one time step t.The agent can also decide to stay at the same node at instant t + 1. Negligible time is considered in computation.
The agents do not store information about the nodes visited as they do not have memory associated with them.This is useful for applications in which the network is huge.We do not want to increase the network traffic if they require lots of resources.The MAs are not aware of the topology of the network.These agents can follow many models based on various parameters but for our problem the technique we use to analyse their complexity is the model of random walks.When an agent is located in a vertex v, if B(v, 1) denotes the ball of center v and radius 1, the MA chooses uniformly at random one of the vertices in B(v, 1), if the chosen vertex is v, the MA does not move, else it moves to the chosen vertex.We have kept the hypothesis that the agent can decide to stay at the same node because of the synchronous condition and breaking the symmetry.A simple example of this is that if we take any 2 nodes, and an agent is present on each node then they will never meet.In this paper we use the following definitions and notations from the probability theory (see [9,10]).
• Let X and Y be two random variables.We say that X and Y have the same probability law, and we denote distribution with parameters k and p i 1≤i≤n , [9], and we denote it Let a be any MA in the graph G, and X a (t) the r.v. that represents the a's position in G at time t ≥ 0. G is a connected graph and for any vertex v ∈ V , Pr(X a (t + 1) = v | X a (t) = v) = 0, then the Markov chain corresponding to the random walk performed by a is irreducible and aperiodic, hence it is ergodic [10], i.e., there is a unique stationary distribution π : Remark 1 Recall that the word stationary means that if a starts in the stationary distribution, a remains in the stationary distribution.

Configuration Graph
The first formulation of the problem is inspired from [7].However, their problem is different from ours as they somehow use the centralized control for the agents but for our problem the mobile agents are distributed in the network and there is no central control over the agents.As in [7], a configuration of k agents on the graph G is a multiset of k vertices of G.A configuration {y 1 , y 2 , • • • , y k } describes a placement of k agents on the vertices of G, where y i is the position of agent a i .If y i = y j then the agents a i and a j are merged into one agent: a i if a i > a j and a j otherwise.The process starts in an initial configuration where N (y i ) denotes the set of neighbours of y i , 2. for all i = j, if y i = y j then z i = z j An execution starting at initial configuration ν 0 is a finite sequence of configurations {ν 0 , ν 1 , As in [7], the configuration graph is the directed graph defined as follows: V (G k ) is the set of all the possible configurations and The behaviour of the set of agents {a 1 , a 2 , • • • , a k } in the undirected graph G is then the same as the behaviour of a random walk on the directed configuration graph G k .This random walk is a Markov chain with one absorbing state T ERM , all the other states are transient.
Since G k is connected, it is clear that, with probability 1, the random walk in G k will reach the state T ERM , meaning that all the MAs will end by merging on a single MA.
In this study, we are interested in the expected time before all the agents merge into one agent.This can be interpreted as the expected time for a random walk starting in an initial configuration to reach the state T ERM in G k .In terms of random walks, this corresponds to the notion of hitting time H(ν 0 , T ERM ).(see [9]).

Component Graph
Let G be a connected graph.As we have seen in the previous section, the behaviour of k MAs on G is the same as the behaviour of a random walk on the configuration graph G k .Nevertheless, this random walk, even if it is a Markov chain, seems not easy to study and do not provide a simple method to upper bound the merging time of k MAs on G.
Let ν i be any configuration, we define the size of ν i , and we denote it | ν i |, the number of different vertices in ν i .We define the component graph G k = (V k , E k ) as follows: The main idea of this construction is to gather, on a single component, all the configurations of the same size and there is a transition from a component C to a component C iff for any configuration ν 1 in C, there is at least a configuration ν 2 in C such that (ν 1 , ν 2 ) ∈ E k .
Proof: By induction on k.
In [2], the authors show how the study of the particular case of two agents in a graph G = (V, E) allow to obtain an upper bound for the general case of k ≥ 3 MAs in G.In the following study we assume that G k is connected.
Let G = (V, E) be a given graph of size n and k ≥ 3 be the number of the MAs in G. Let (X t ) t≥0 be the r.v. which counts the number of the MAs in the graph at time t.Clearly, X 0 = k and ∀t ≥ 0, X t+1 ≤ X t .The behaviour of the M is an absorbing Markov chain [12] with a single absorbing state (the state 0) with the following transition matrix: Let (Y t ) t≥0 be the r.v.defined as follows: Y t ∈ S, ∀t ≥ 0 and This corresponds to an absorbing Markov chain M = (S, T ) with the following transition matrix: M is a Markov chain whose set of states is the same as for M and the only possible transitions are between i and i − 1.This intuitively means that whereas in M, from a state i it is possible to reach all the states i − 1, i − 2, Proof: From the transition matrices P and P , we deduce the following recursions: ∀i ≥ 2, E( Hence, an induction reasoning yields to On the other hand, using the fundamental matrix (see [12]) of the chain M , it is easy to compute E(T i ) in terms of the transition probabilities (q i,j ) (see [2]) to obtain: Remark 5 Previous results can be obtained from [2].The agents perform random walks and the results are obtained on different classes of graphs.

Rendezvous of k MAs Under the Stationary Regime
In this section, we assume that there are exactly k ≥ 2 MAs in the graph G.We suppose that all the MAs are under the stationary regime, and we study the expected time for all the MAs to merge on a single MA.We denote by T k the r.v. which denotes time.
We suppose that k ≥ 3. From the result in Lemma 3 in Section 3, if the component graph G k is connected then it suffices to compute the transition probabilities q i,i−1 for all i ∈ {2, 3, • • • , k}. q i,i−1 is the probability that at least two MAs meet somewhere in the graph, that is q i,i−1 ≥ q 2,1 for any i ∈ {2, 3, .

Remark 6
In our case, the G k is a connected graph.If we do not consider this case then unfortunately our study in previous section will not be valid because of the Markov chain requirements, nevertheless we can upper bound it by using the above mentioned techniques.
, we obtain the following lemma: Lemma 7

Rendezvous of a Random Number of MAs
In this section, we suppose that the expected number of MAs in the graph is controlled as described in Section 5.That is, the number X of MAs is a r.v.having a Poisson distribution with parameter λ = k.wlog., we assume that E T 0 = E T 1 = 0. Then: Theorem 8 If each vertex generates a random number of MAs as described above, and if we denote by τ k the r.v. that represents the time for all the MAs to merge into a single MA, then Proof: The proof is based on the results from previous section.Let X denote the r.v. which counts the total number of MAs in G. Then

Rendezvous in cycle-graphs
Let G = (V, E) be a cycle of length n ≥ 3 and let a and b be two MAs in G.We assume that the two MAs are under stationary regime.For any t ≥ 0, let D t denote the distance between the two MAs.It is clear that After solving the system, we find That is, since and Pr(D One can prove: Lemma 9 If we denote by T 2 the time for the two MAs to merge into a single MA then: Proof: The time for the two agents to merge into a single agent is 2nd International Workshop on Verification and Evaluation of Computer and Communication Systems VECoS 2008

Lemma 10
The time for the k MAs to merge into a single MA is given by:

HOW TO GUIDE LOCALLY THE TOTAL NUMBER OF MAS
In this section, we show how to control locally the global number of MAs in all the graph.We start by giving some properties of random variables with Poisson distribution.
Let X 1 , X 2 , • • • , X n be a set of n ≥ 2 independent r.v., such that, ∀i ∈ {1, 2, • • • , n}, X i has a Poisson distribution with parameter λ i .That is: For any On the other hand, let X be the r.
and using equation (3), this yields to Let a be an MA in G.The Markov chain that describes the random walk of a is an ergodic one and admits a unique stationary distribution.That is if we denote by X a the position of a in G, under the stationary regime, then Assume that we have k MAs in the graph, and all the MAs are under the stationary regime, then we have the following lemma: Lemma 11 Suppose we have k MAs under the stationary regime in the graph, and let

which counts the number of MAs in the vertex
k n π k1 v1 π k2 v2 Then, the lemma follows by (6).
We now give the fundamental theorem which will be used in the following section Proof: It suffices to take, in (5), λ i = d(vi)+1 2m+n k, ∀i ∈ {1, 2, • • • , n}, and then use the result in Lemma 11.

Application
In this paragraph, we show how the results from the above section can be applied to obtain a set of k ≥ 2 MAs already in the stationary regime.We suppose in the sequel that each vertex knows the number n of vertices, m the number of edges and k the number of desired MAs.Consider the following process: each vertex v generates a random number X v of MAs according to the Poisson distribution with parameter Then we have the following lemma: Lemma 13 If each vertex v in the graph generates a random set of MAs using a Poisson distribution with parameter λ v as defined above, then all the generated MAs are under the stationary regime.
Proof: Direct if we substitute λ v in ( 5) and if we apply Theorem (12).

CONCLUSION AND PERSPECTIVES
In this paper, we have given a general upper bound for a set of k MAs to merge into a single MA.We also give a technique to control locally the total number of MAs in the graph.Nevertheless, we have supposed that all nodes know n, m and k.So, the natural question that arises is how can we design a similar technique that does not need all the nodes to know these parameters?We used Poisson distribution, what will happen if we use another distribution?
The upper bound obtained in this work for the cycle graph is (O(kn 2 )).Can we do better in other classes of graphs?A first answer may be obtained if we can exactly compute the transition probabilities of the original Markov chain (in Section 3).

Figure 1 :
Figure 1: Possible transitions in a cycle graph(a)at extremeties (b)in general , • • • , n 2 } and we can model the behaviour of D t by a Markov chain with the following transitions graph:Then, if we denote by E i the expected time for the two MAs to merge into a single MA, conditioned by the fact that the two MAs start at distance 0 ≤ i ≤ n 2 one from other then