SELF-STABILIZING MOBILE MEDICAL ROBOTS SCATTERING ALGORITHM

The paper is devoted to the possibility of determinate and probabilistic scattering under various assumptions of the state of the locations of medical robots in both fault-tolerance and vulnerable environments. The topicality of the work is due to the need to place medical robots in the coordinate space having disjoint polygons (robot bodies) which is absolutely unacceptable in the case of medical applications. As a limitation it is assumed that the medical robot sees its nearest neighbors and local monitor of multiplicity is functioning, which can determine the situation when robots occupy intersecting spaces. We propose a probabilistic scattering algorithm which describes the initial states of medical robots and the proper transient state algorithm which can predict the movement of robots to a location where they can intersect. It is shown, that when using the algorithm the states and motion algorithms can be estimated in a fault-tolerance (robots do not fail and the medium is stationary) and vulnerable (the robot may fail and the byzantine problem is not solved, the environment changes faster than the robot can react) environments. The estimates for the computational complexity of the algorithm working without the mission planner are given.


Introduction
In recent years, centralized sophisticated and expensive medical robots gave way to distributed systems of mobile autonomous and cheap medical robots [1][2][3]. The rise of distributed systems was based on two main reasons: 1. The lower cost of uniform medical robots compared to centralized ones. For example, now there are polymorphic medical robots which consist of a network of low cost simple medical robots that are able to reorganize themselves into a single complex medical robot [4]).
2. The simplicity of uniform medical robots. Indeed, it may be advantageous to use a group of simple small and relatively cheap medical robots in some instances of cooperative work. For example, application of medical robot networks in hazardous or harsh environments, such as space, great depths of seas, or after some natural or man caused disasters, etc. It follows that the group should be able to reorganize themselves without any prior infrastructure or after a major disaster occurred.
On the other hand, as the systems of cheap, simple and relatively weak medical robots are not reliable we can face the problem of possible failures, especially when such medical robot systems are expected to operate in hazardous or harsh environments. At the same time, one of the main advantages of mobile medical robot systems is the possibility to correctly execute a given task even in case of faults. This is possible due to redundancy of such systems [5]. Another problem of these systems is a complexity of coordination which appears because of the large medical robot networks. Due to simplicity of medical robots algorithm they follow must be simultaneously self-organized fault-tolerant and distributed.
Another important task that has been studied to a lesser extent is that of scattering. In this task, the medical robots must start from any initial configuration, and then scatter on the positions, not fixed in advance, such that no two medical robots occupy the same position.
To study the scattering problem, we consider the ATOM system model first defined by Suzuki and Yamashita [6]. In this model, medical robots are represented as points that evolve on the plane. At any given time, a medical robot can be either idle or active. In the latter case, the medical robot observes the locations of other medical robots, computes a target position, and moves towards it. In our case we have a partially blind medical robot meaning that the medical robot has the capability of detecting the position of its nearest neighbor. Hereinafter, we use the term of visibility of nearest neighbor to express the sense of "partially blind". The time when a medical robot becomes active is governed by an activation daemon (scheduler). In the original definition of Suzuki and Yamashita, called the ATOM model, activations (i.e., look-compute-move) are atomic, and the scheduler is assumed to be arbitrary and distributed, meaning that at each configuration, an arbitrary (non-empty) subset of enabled medical robots is activated. In the CORDA model of Prencipe [7], activations are completely asynchronous, for instance allowing medical robots to be seen while moving.

Model
Medical robots networks We consider a network of n autonomous mobile medical robots, denoted by r 1 ; … ; r n , arbitrarily deployed in a two-dimensional unbounded plane. The medical robots are viewed as points, and they are capable to freely move in the plane. The medical robots never collide and two or more medical robots may simultaneously occupy the same physical position. The medical robots are devices with sensing, computational and motion capabilities. The medical robots are devoid of any common orientation and any means of explicit communication. Communication occurs in a totally implicit manner, by observing other medical robots' position. Each medical robot has its own local coordinate system (e. g., Cartesian).
The medical robots are uniform, it means that they all execute the same algorithm. The medical robots are anonymous. They cannot be distinguished by their appearance and they do not have any kind of identifiers that can be used during the computation. The medical robots are oblivious, meaning that they do not remember any previous observation nor computations performed in the previous steps.
In this paper, we consider that medical robots have complementary capabilities: 1. Visibility of nearest neighbor -each medical robot can only observe the position of its nearest neighbor.
2. Local multiplicity detector -a medical robot can distinguish if there are more than one medical robot at the current position.
This model is more adapted to systems where the visibility is replaced by wireless communication or radar detection.
Summarizing, the medical robots are uniform, anonymous, oblivious, and endowed with capabilities of local multiplicity detection and visibility of nearest neighbor; they are devoid of any orientation.
Medical robot computation cycle. Each medical robot repeatedly cycles through the following states: -Look. The medical robot observes the world and returns a snapshot of the positions of all other medical robots in the visibility range with respect to its local coordinate system. In our case, this observation returns the value of the distance between the medical robot and its nearest neighbor.
-Compute. The medical robot performs a local computation to a probabilistic algorithm A. The algorithm is the same for all medical robots and the result of the computed state is a destination point.
-Move. The medical robot moves towards the computed destination. It can be stopped anywhere before the destination by the scheduler after some predefined distance has been traversed.

Computational model
The literature proposes two computational models: ATOM and CORDA. The ATOM model was introduced by Suzuki and Yamashita [6]. In this model, each medical robot performs the actions of a computation cycle (observation, computation and motion) once activated by the scheduler in an atomic manner. The execution of the system can be modeled as an infinite sequence of rounds. In a round one or more medical robots are activated and perform a computation cycle. In every single activation, the distance that medical robot r i can travel in one cycle is bounded by δ ri > 0. Specifically, if the destination point computed at a given cycle by medical robot r is farther than δ ri , then the algorithm returns a point of at most δ ri . This distance may be different for different medical robots.
The CORDA model was introduced by Prencipe [7]. This model refines the atomicity of actions performed by each robot. Hence, medical robots may perform in a decoupled fashion the atomic actions of a computation cycle. They may be interrupted by the scheduler in the middle of a computation cycle. In particular, when a medical robot goes towards its goal, the move can end anywhere before the destination. Moreover, while a medical robot performs an action A, where A can be one of the following atomic actions: wait, look, compute or move, another medical robot may perform a totally different action B. Scheduler. A scheduler decides at each configuration the set of medical robots allowed to perform their actions. We distinguish various kinds of scheduler. The arbitrary scheduler is such that at each configuration an arbitrary subset of enabled medical robots is activated. In our case, a medical robot is enabled if it occupies a multiplicity point. A scheduler is fair if, in an infinite execution, a medical robot is activated infinitely often. The probabilistic scheduler guarantees that the probability for medical robot r i to be activated at time t j is such that lim j→∞ Pr[r i (t j ) = active] = 1. A centralized scheduler guarantees that at each configuration a single medical robot is allowed to execute its actions.
In our work we use two hypotheses to assure the termination of scattering procedure: 1. A non-fair scheduler activates a medical robot which is placed on one of multiplicity points, if a medical robot is alone on its position it will be never activated.
Definition 2.1. A multiplicity aware scheduler -a scheduler which activates a medical robot which is placed on one of multiplicity points.
2. A fair scheduler activates a medical robot even if it is alone on its position. In this case, the medical robots have a complementary capability as the local multiplicity detection.

Faults
The ordinary models of medical robot networks are relatively simple and cheap medical robots and, hence, not fail-proof. In addition, hazardous or harsh environments (explosion, theft, crash, etc.) can also affect the fail-proof of medical robots. Thus, it is essential to study distributed networks of autonomous mobile medical robots in the context of faulty medical robots. Our attention focuses on two types of faults: 1. crash failures can happen in two cases: -medical robots physically disappear from the network; -medical robots stop all their activities, however they are still physically present in the network. Note. The scheduler activates only non-crashed medical robots in the case of crashed medical robots which are still physically present in the network.
2. Byzantine failures. A Byzantine medical robot [8] might behave in arbitrary and unforeseeable ways. To prevent correct medical robots to disperse on the plan, a Byzantine medical robot chooses, by vision, one or more medical robots on the same multiplicity point and go at the same position.

Scattering problem
In the following we formally define the scattering problem. The Scatter problem is considered solved when no two medical robots occupy the same position [9,10]. A system of n autonomous mobile medical robots solves the scattering problem if any execution of the system verifies the following properties: 1. Convergence: Regardless of the initial position of the medical robots on the plane, no two medical robots are eventually located at the same position.
2. Closure: Starting from a configuration where no two medical robots are located at the same position, no two medical robots are located at the same position thereafter.
3. Termination: Starting from any configuration the scattering procedure is finite when no two medical robots are located at the same position.
Lemma. Termination of scattering is impossible without additional assumptions. Proof. During an execution of scattering procedure without additional assumptions, the medical robots never stop moving. A scheduler activates a medical robot even if it is alone on its position. The medical robots have no ability to detect number of medical robots on the same position and, even if no two medical robots are located at the same position, to stop. So, execution of scattering procedure must be infinite.
Note. Petit and Dieudonné [10] proved that there does not exist a deterministic algorithm that solves the scattering problem in ATOM model, even if the medical robots have the localization knowledge or are able to detect the multiplicity. If the faults are present (crash or Byzantine medical robots) in the system we can have a situation where several faulty medical robots can be on the same multiplicity point, so, the scattering of medical robots is impossible in the general sense. But to avoid this situation we consider that the scattering problem has a solution for the correct medical robots. For that we introduce a following definition: Definition. The weak scattering problem consists in providing scattering of correct medical robots. By definition [11] a self-stabilizing system is a system that will end in a correct state after a finite number of execution steps regardless of the initial states of the computing units. So, an algorithm is selfstabilizing if it solves the scattering problem with oblivious or stateless medical robots [12].

Probabilistic scattering algorithm
In this section we present a probabilistic self-stabilizing algorithm for the scattering problem. In general, r denotes a medical robot in the system, p(r) is used to represent the point in the plane occupied by that robot. A configuration of the medical robots at given time t (t > 0) is the set of positions in the plane occupied by the medical robots at time t: P(t) = {p 1 ; … ; p n }.
We consider that medical robots move according to a local coordinate system (i.e. the axes and the distances may be specific to each robot). The local coordinate system makes use of possible distances and directions. We consider the set A = {a 1 ; a 2 ; … ; a k } as the set of possible distances in the plane. The Lemma. Termination of scattering procedure in fault-free systems is possible with additional assumptions.
Proof. We can get a termination for the scattering procedure in fault-free systems in two cases. Case 1. Under a non-fair multiplicity aware scheduler (which activates a medical robot locating on one of multiplicity points).
A non-fair scheduler can choose the same set of medical robots at each activation, so, the scattering problem has no solution. If we apply an additional assumptions that a non-fair scheduler activates only medical robots which are placed on a multiplicity point, thus, gradually we reduce number of multiplicity points (at moment of activation each medical robot is obliged to move on other position). So, execution of scattering procedure is finite.
Case 2. Under a fair scheduler which activates a medical robot even if it is alone on its position with multiplicity detection capability of medical robots.
In [10], the authors apply a fair scheduler and note the necessity of multiplicity detection capability to ensure the termination of scattering procedure. During an execution of scattering procedure without additional assumptions, the medical robots never stop moving. Because they have no ability to detect number of medical robots on the same position and, even if no two medical robots are located at the same position, to stop. So, execution of scattering procedure must be infinite.
But multiplicity detection allows the medical robots to stop if there exists no position with more than one robot. So, execution of scattering procedure can be finite. In fault-free systems we can apply both cases for the termination of scattering procedure.

Systems under an arbitrary multiplicity aware scheduler
In this section, we consider a system of medical robots with visibility of nearest neighbor under an arbitrary multiplicity aware scheduler.
At the time of activation, the multiplicity aware scheduler activates a medical robot which is placed on a multiplicity point. This medical robot detects its nearest neighbor by vision and it builds its movement circle by taking the half of the distance between itself and its neighbor. Then, it chooses a position with a probability within its movement circle and it moves towards the chosen position.
A medical robot r 1 has the capability of viewing its nearest neighbor -he detects the medical robot r 2 its nearest strict neighbor (p(r 1 ) ≠ p(r 2 )). It estimates the value of distance between them as β r1 . Then, the medical robot r 1 takes the half of this distance β r1 to build its movement circle with radius 1 2 r β . It moves at distance a i which is chosen with probability 1/k and a direction b j which is chosen with prob- Definition The movement circle of medical robot r is a set of points in the circle with radius ( ε min ; 1 2 r β ), where β r1 is value of distance between medical robot r and its nearest strict neighbor; where ε min > 0 and ε min can be different for every computation cycle. Algorithm 1. Probabilistic scattering for medical robot r. Function: compute nearest distance :: returns the distance β r1 between r and a nearest neighbor r'. A 1 :: compute nearest distance () and medical robot r chooses a position p j with probability 1/kd (k -distance; d -direction) and move from current position pi towards the chosen position p j where p i ≠ p j within Circle r2 e ( ε min ; 1 2 r β ). Lemma. No two medical robots which are nearest neighbors choose the same destination point.
Proof. Consider a system of two medical robots r 1 and r 2 , so, they are nearest neighbors. The value of distance between medical robot r 1 and r 2 is β. By algorithm 1 each of the medical robots builds its movement circle by taking half of the distance between itself and its neighbor. If medical robot r is alone at its position it will be never activated. Lemma (Convergence). For any time t z and for every pair of medical robots (r i ; r j ) such that p(r i ) = p(r j ). By executing scattering algorithm, we have ( ) ( ) Proof. If medical robots occupying the same position at the instant of activation do not choose the same destination, the condition of convergence is accomplished.
The probability that n medical robots choose the same destination tends to zero when the number of rounds tends to infinity:  where x is the number of rounds of execution.
Consider two medical robots r1 and r 2 which occupy the same position in the initial configuration.
The probability that the medical robot r1 chooses a distance among k-elements is 1/k (respectively for r 2 ). The probability that two medical robots r 1 and r 2 choose the same distance is upper bounded by k/k 2 = 1/k. It's the same for direction. The probability that two medical robots r 1 Mechanics. Physics, 2018, vol. 10, no. 3, pp. 41-51  46 Lemma. Algorithm 1 converges in 1 1 1 n kd − + − rounds under an arbitrary scheduler with multipliciy detection assumption. Proof. The scheduler activates only the medical robots with strict multiplicity. That is a medical robot alone on its position is not activated.
Consider a system with n medical robots and let X t = k be the stochastic process shown in fig. 3: at round t there are k medical robots at the same position and n-k medical robots with different positions.
In the worst case, all the n medical robots are initially placed on the same point, X 0 = n. We should compute the time needed for the stochastic process to reach 1 (all the medical robots have different positions). Note that in a particular configuration the scheduler may activate all the medical robots on the same multiplicity point at the same time and all of them may choose the same destination. Let e b T be the expectaction time for the Markov chain defined above to reach state e starting from state b. Formally,   Note that we studied the time of convergence of Algorithm 1 in a discrete space. In a continuous space the set of possible destinations for every medical robot tends to infinity. For k-distances choices →∞ and for d-directions choices →∞, the fraction 1 1 kd − tends to 0. It follows that the convergence time tends to n-1 rounds. Lemma. Algorithm 1 converges in n-1 steps under a centralized scheduler with multiplicity detection assumption.
Proof. A centralized scheduler activates the medical robots on multiplicity points one by one. The probability that the activated medical robot reaches a sigularity position after it completes its move operation is 1.

Fig. 4. Time of convergence in the best case
The convergence time is (n-1) steps. Lemma 4.7. Algorithm 1 converges on average in log kd n rounds under an arbitrary multiplicity aware scheduler.
Proof. Consider a system of n medical robots. A scheduler activates the non empty subset of medical robots which are placed on the multiplicity points. If a medical robot is alone on its position it will be never activated. At the moment of activation a medical robot chooses with probability 1/kd its future position, where k -number of elements of possible distances and d -number of elements of possible directions.

Математика
Bulletin of the South Ural State University Ser. Mathematics. Mechanics. Physics, 2018, vol. 10, no. 3, pp. 41-51  48 Consider that all n medical robots are initially placed on the same point p 0 . The scheduler activates the medical robots. The probability that at least one medical robot chooses the position p x (a pair (a i ; b j ) is the position p x in the plane) is n = kd. The probability that after i-rounds on the position p x remains no more than one medical robot is n/(kd)i. So, the average convergence time is log kd n. If kd →∞ the average convergence time equal to 1.
The number of rounds is log log Note. The convergence time with the same assumptions as in Lemma is log 4 2.

Systems under a fair scheduler
In this section we consider a system of medical robots with nearest neighbor visibility under a fair scheduler which activates a medical robot even if it is alone on its position. In this case, the medical robots possess complementary capability as the local multiplicity detection to assure the termination of scattering procedure.
A system of n autonomous mobile medical robots solves the scattering problem if any execution of the system verifies the following properties: 1. Convergence: regardless of the initial position of the medical robots on the plane, no two medical robots are eventually located at the same position.
2. Closure: starting from a configuration where no two medical robots are located at the same position, no two medical robots are located at the same position thereafter.
3. Termination: starting from any configuration the scattering procedure is finite when no two medical robots are located at the same position.
In Lemma we proved that the termination is possible in the systems of medical robots with capability of local multiplicity detection under a fair scheduler.
At the time of activation, the scheduler activates a medical robot even if it is alone on its position. This medical robot verifies the multiplicity. If the medical robot distinguishes more than one medical robot on its position it executes the algorithm 1, else it does not move. Executing algorithm 1 the medical robot detects its nearest neighbor by vision and it builds its movement circle by taking the half of the distance between itself and its neighbor. Then, it chooses a position with a probability within its movement circle and it moves towards the chosen position.
A medical robot r 1 has the capability of viewing its nearest neighbor -he detects the medical robot r 2 its nearest strict neighbor (p(r 1 ) ≠ p(r 2 )). It estimates the value of distance between them as β r1 .
Then, the medical robot r1 takes the half of this distance β r1 to build its movement circle with radius then compute nearest distance () and medical robot r chooses a position p j with probability 1/kd (kdistance; d -direction) and move from current position p i towards the chosen position p j where p i ≠ p j within Circle r2 e ( ε min ; 1 2 r β ). else do not move. Lemma (Convergence) are true for this case, because, in these Lemmas we do not use any assumtions of scheduler.
Lemma (Closure) Started in a legitimate configuration the system verifies the closure property. Proof. Each medical robot has a complementary capability as local multiplicity detection. At the moment of activation a medical robot verifie legitimate configuration. If local multiplicity detection (position[r]) > 1 than this medical robot chooses a new position with probability 1/kd (k -distance, d -direction) and move towards it, else it does not move.
The time of convergence in the case of arbitrary multiplicity aware schaduler is better than in the case of fair scheduler, because, an arbitrary multiplicity aware scheduler activates the medical robots of multiplicity points whereas a fair scheduler activates a medical robot even if it is alone on its position.
Note. The time of convergence in the case of multiplicity aware scheduler is better than in the case of fair scheduler, because, a multiplicity aware scheduler activates the medical robots of multiplicity points whereas a fair scheduler activates a medical robot even if it is alone on its position.
The goal of our research is to define minimal capabilities of theoretical medical robots for solving the scattering problem in both fault-free and fault-prone systems. We proposed a probabilistic selfstabilizing algorithm for the scattering problem. As far as we know, this is the first attempt to solve scattering in fault-prone environments [13,14].
The given paper is completed with the support of the Ministry of Education and Science of the Russian Federation within the limits of the project part of the state assignment of TUSUR in 2017 and 2019 (project 2.3583.2017) and science school (№ NSH-3070.2018.8).
In conclusion, the authors are pleasant sincere gratitude to Professor A.V. Bogomolov for his hearts discussion of the on problem of medical device and equipment in the framework of medical and biological research and congratulate him on anniversary.