Sayaka Kamei

Anissa Lamani

Fukuhito Ooshita

Sébastien Tixeuil

Koichi Wada

Asynchronous Gathering in a Torus

We consider the gathering problem for asynchronous and oblivious robots that cannot communicate explicitly with each other, but are endowed with visibility sensors that allow them to see the positions of the other robots. Most of the investigations on the gathering problem on the discrete universe are done on ring shaped networks due to the number of symmetric configurations. We extend in this paper the study of the gathering problem on torus shaped networks assuming robots endowed with local weak multiplicity detection. That is, robots cannot make the difference between nodes occupied by only one robot from those occupied by more than one robots unless it is their current node. As a consequence, solutions based on creating a single multiplicity node as a landmark for the gathering cannot be used. We present in this paper a deterministic algorithm that solves the gathering problem starting from any rigid configuration on an asymmetric unoriented torus shaped network.

Introduction

We consider autonomous robots [START_REF] Suzuki | Distributed anonymous mobile robots: Formation of geometric patterns[END_REF] that are endowed with visibility sensors and motion actuators, yet are unable to communicate explicitly. They evolve in a discrete environment, i.e., their space is partitioned into a finite number of locations, conveniently represented by a graph, where the nodes represent the possible locations that a robot can be, and the edges denote the possibility for a robot to move from one location to another.

Those robots must collaborate to solve a collective task despite being limited with respect to computing capabilities, inputs from the environment, etc. In particular, the robots we consider are anonymous, uniform, yet they can sense their environment and take decisions according to their own ego-centered view. In addition, they are oblivious, i.e., they do not remember their past actions. Robots operate in cycles that include three phases: Look, Compute, and Move (LCM for short). The Look phase consists in taking a snapshot of the other robots positions using a robot's visibility sensors. During the Compute phase, a robot computes a target destination based on its previous observation. The Move phase simply consists in moving toward the computed destination using motion actuators. Using LCM cycles, three execution models have been considered in the literature, capturing the various degrees of synchrony between robots. According to current taxonomy [START_REF]Distributed Computing by Mobile Entities[END_REF], they are denoted FSYNC, SSYNC, and ASYNC, from the stronger to the weaker. FSYNC stands for fully synchronous. In this model, all robots execute the LCM cycle synchronously and atomically. In the SSYNC (semi-synchronous) model, robots are asynchronously activated to perform cycles, yet at each activation, a robot executes one cycle atomically. With the weaker model, ASYNC (asynchronous), robots execute LCM in a completely independent manner. Of course, the ASYNC model is the most realistic.

In the context of robots evolving on graphs, the two benchmarking tasks are exploration [START_REF] Ilcinkas | Oblivious robots on graphs: Exploration[END_REF] and gathering [START_REF] Cicerone | Asynchronous robots on graphs: Gathering[END_REF]. In this paper, we address the gathering problem, which requires that robots eventually all meet at a single node, not known beforehand, and terminate upon completion.

We focus on the case where the network is an anonymous unoriented torus (or simply torus, for short). The terms anonymous and unoriented mean that no robot has access to any kind external information (e.g., node identifiers, oracle, local edge labeling, etc.) allowing to identify nodes or to determine any (global or local) direction, such as North-South/East-West. Torus networks were previously investigated for the purpose of exploration by Devismes et al. [START_REF] Devismes | Optimal torus exploration by oblivious robots[END_REF]. Related Works. Mobile robot gathering on graphs was first considered for ring-shaped graphs. Klasing et al. [START_REF] Klasing | Gathering asynchronous oblivious mobile robots in a ring[END_REF][START_REF] Klasing | Taking advantage of symmetries: Gathering of many asynchronous oblivious robots on a ring[END_REF], who proposed gathering algorithms for rings with global-weak multiplicity detection. Globalweak multiplicity detection enables a robot to detect whether the number of robots on each node is one, or more than one. However, the exact number of robots on a given node remains unknown if there is more than one robot on the node. Then, Izumi et al. [START_REF] Izumi | Time-optimal gathering algorithm of mobile robots with local weak multiplicity detection in rings[END_REF] provided a gathering algorithm for rings with localweak multiplicity detection under the assumption that the initial configurations are non-symmetric and non-periodic, and that the number of robots is less than half the number of nodes. Local-weak multiplicity detection enables a robot to detect whether the number of robots on its current node is one, or more than one. This condition was slightly relaxed by Kamei et al. [START_REF] Kamei | Gathering an even number of robots in an odd ring without global multiplicity detection[END_REF]. D'Angelo et al. [START_REF] Gianlorenzo | A unified approach for gathering and exclusive searching on rings under weak assumptions[END_REF] proposed unified ring gathering algorithms for most of the solvable initial configurations, using local-weak multiplicity detection. Overall, for rings, relatively few open cases remain [START_REF] Bonnet | Asynchronous gathering in rings with 4 robots[END_REF], as algorithm synthesis was demonstrated feasible [START_REF] Millet | On the synthesis of mobile robots algorithms: The case of ring gathering[END_REF].

The case of gathering in tree-shaped networks was investigated by D'Angelo et al. [START_REF] Gianlorenzo | Gathering of robots on anonymous grids and trees without multiplicity detection[END_REF] and by Di Stefano et al. [START_REF] Di | Optimal gathering of oblivious robots in anonymous graphs and its application on trees and rings[END_REF]. Hypercubes were the focus of Bose at el. [START_REF] Bose | Optimal gathering by asynchronous oblivious robots in hypercubes[END_REF]. Complete and complete bipartite graphs were outlined by Cicerone et al. [START_REF] Cicerone | Gathering robots in graphs: The central role of synchronicity[END_REF], and regular bipartite by Guilbault et al. [START_REF] Guilbault | Gathering asynchronous oblivious agents with local vision in regular bipartite graphs[END_REF]. Finite grids were studied by D'Angelo et al. [START_REF] Gianlorenzo | Gathering of robots on anonymous grids and trees without multiplicity detection[END_REF], Das et al. [START_REF] Das | Gathering of robots in a grid with mobile faults[END_REF], and Castenow et al. [START_REF] Castenow | Gathering anonymous, oblivious robots on a grid[END_REF], while infinite grids were considered by Di Stefano et al. [START_REF] Di | Optimal gathering of oblivious robots in anonymous graphs and its application on trees and rings[END_REF], and by Durjoy et al. [START_REF] Dutta | Gathering multiple robots in a ring and an infinite grid[END_REF]. Results on grids and infinite grids do not naturally extend to tori. On the one hand, the proof arguments for impossibility results on the grid can be extended for the torus, since their indistinguishability criterium remains valid. So, if a torus admits an edge symmetry (the robot positions are mirrored over an axial symmetry traversing an edge), or is periodic (a non-trivial translation leaves the robot positions unchanged), gathering is impossible on a torus. On the other hand, both the finite and the infinite grid allow algorithmic tricks to be implemented. For example, the finite grid has three classes of nodes: corners (of degree 2), borders (of degree 3), and inner nodes (of degree 4), and those three classes permit the robots to obtain some sense of direction. By contrast, the infinite grid makes a difference between two locations: the inner space (the set of nodes within the convex hull formed by the robot positions) and the outer space (the rest of the infinite grid), which also give some sense of direction. Now, every node in a torus has degree 4, and no notion of inner/outer space can be defined. To our knowledge, torus-shaped networks were never considered before for the gathering problem. The aforementioned work by Devismes et al [START_REF] Devismes | Optimal torus exploration by oblivious robots[END_REF] only considers the exploration task.

Our contribution. We consider the problem of gathering on torus-shaped networks. In more details, for initial configurations that are rigid (i.e. neither symmetric nor periodic), we propose a distributed algorithm that gather all robots to a single node, not known beforehand. We only make use of local-weak multiplicity detection: robots may only know whether at least one other robot is currently hosted at their hosting node, but cannot know the exact number, and are also unable to retried multiplicity information from other nodes. Furthermore, robots have no common notion of North, and no common notion of handedness. Finally, robots operate in the most general and realistic ASYNC execution model.

Axes of symmetry

Periodic configuration

Fig. 1. Instance of a symmetric configuration and a periodic configuration they cannot remember the operations performed before. No direct communication is allowed between robots however, we assume that each robot is endowed with visibility sensors that allow him to see the position of the other robots on the torus. Robots operate in cycles that comprise three phases: Look, Compute and Move. During the first phase (Look), each robot takes a snapshot to see the positions of the other robots on the torus. In the second phase (Compute), they decide to either stay idle or move. In the case they decide to move, a neighboring destination is computed. Finally, in the last phase (Move), they move to the computed destination (if any).

At each instant t, a subset of robots is activated for the execution by an external entity known as the scheduler. We assume that the scheduler is fair, i.e., all robots must be activated infinitely many times. The model considered in this paper is the asynchronous model (ASYNC) also known as the CORDA model. In this model, the time between Look, Compute and Move phases, is finite but not bounded. In our case, we add a constraint that is the move operation is instantaneous, i.e., when a robot performs a look operation, it sees all the robots on nodes and never on edges. However, note that even under this constraint, each robot may move according to an outdated view, i.e., the robot takes a snapshot to see the positions of the other robots, but when it decides to move, some other robots may have moved already.

In this paper, we refer by v i,j to the j th node located on i . By d i,j (t) we denote the number of robots on node v i,j at time t. We say that v i,j is empty if d i,j (t) = 0. Otherwise, v i,j is said to be occupied. In the case where d i,j (t) = 1, we say that there is a single robot on v i,j . By contrast, if d i,j (t) ≥ 2, we say that there is a multiplicity on v i,j . In this paper, we assume that robots have a local weak multiplicity detection, that is, for any robot r, located at node u, r can only detect a multiplicity on its current node u (local). Moreover, r cannot be aware of the exact number of robots part of the multiplicity (weak).

During the process, some robots move and occupy at any time some nodes of the torus, their positions form the configuration of the system at that time. At instant t = 0, we assume that each node is occupied by at most one robot, i.e., the initial configuration contains no multiplicities.

In the following, we assume that for any occupied node v i,j , independently of the number of robots on v i,j , d i,j (t) = 1. For any i, j ≥ 0, let δ + i,j (t) denote the sequence < d i,j (t), d i,j+1 (t), . . . , d i,j+ -1 (t) >, and let δ - i,j (t) denote the sequence < d i,j (t), d i,j-1 (t), . . . , d i,j-( -1) (t) >. Similarly, let ∆ +s i,j (t) be the sequence < δ s i,j (t), δ s i+1,j (t), . . . , δ s i+(L-1),j (t) > and ∆ -s i,j (t) to be the sequence < δ s i,j (t), δ s i-1,j (t), . . . , δ s i-(L-1),j (t) > with s ∈ {+, -}.

The view of a given robot r located on node v i,j at time t is defined as the pair view r (t) = (V i,j (t), m j ) where V i,j (t) consists of the four sequences ∆ ++ i,j , ∆ +- i,j , ∆ -+ i,j , ∆ -- i,j ordered in the lexicographical order and m j = 1 if v j hosts a multiplicity and m j = 0 otherwise. By view r (t)(1), we refer to V i,j (t) in view r (t). Let r and r be two robots satisfying view r (t)(1) > view r (t) [START_REF] Bonnet | Asynchronous gathering in rings with 4 robots[END_REF]. Robot r is said in this case to have a larger view than r . Similarly, r is said to have the largest view at time t, if for any robots r = r, not located on the same node as r, view r (t)(1) > view r (t)(1) holds.

A configuration is said to be rigid at time t, if for any two robots r and r , located on two different nodes of the torus, view r (t)(1) = view r (t)(1) holds. A configuration is said to be periodic at time t if there exist two integers i and j such that i = j, i = 0 mod , j = 0 mod L, and for every robot r (x,w) located on x at node v x,w , view r (x,w) (t)(1) = view r (x+i,w+j) (t)(1) (An example is given in Fig. 1).

As defined by D'Angelo et al. [START_REF] Gianlorenzo | Gathering of robots on anonymous grids and trees without multiplicity detection[END_REF], a configuration is said to be symmetric at time t, if the configuration is invariant after a reflexion with respect to either a vertical or a horizontal axis. This axis is called axis of symmetry (An example is given in Fig. 1).

In this paper, we consider asymmetric ( , L)-torus, i.e., = L. We assume without loss of generality that L < . In this case, we can differentiate two sides of the torus. We denote by nb i (C) the number of occupied nodes on -ring i , in configuration C. An -ring i is said to be maximal in

C if ∀ j ∈ {1, . . . , } \ {i}, nb j (C) ≤ nb i (C).
Given a configuration C and two -rings i and j . We say that j is adjacent to i if |i-j| = 1 mod L holds. Similarly, we say that j is neighbor of i in configuration C if nb j (C) > 0 and nb k (C) = 0 for any k ∈ {i + 1, i + 2, . . . , j -1} or k ∈ {i -1, i -2, . . . , j + 1}. For instance, in Figure 2, 1 and 2 are adjacent while 2 and 3 are neighbors.

We also define dis(x i , x j ) to be a function which returns the shortest distance, in terms of hops, between x i and x j where x i and x j are two nodes of the torus. We sometimes write x i = r i where r i is a robot. In this case, x i refers to the node that hosts r i . Finally, we use the notion of d.block to refer to a sequence of consecutive nodes in which there are occupied nodes each d hops (distance).

Algorithm

We describe in the following our strategy to solve the gathering problem is the predefined settings. Before explaining our algorithm in details, let us first define an important set configurations.

A configuration C is called C target if there are three -rings max , secondary and target satisfying following properties:

1. max is the unique maximal -ring in C. 2. secondary and target are adjacent to max . 3. nb secondary (C) = 0. 4. target satisfies exactly one of the following conditions:

(a) nb target (C) = 1. We refer to the occupied node on target by v target . (b) nb target (C) = 2. Let us refer to the robots on target by r 1 and r 2 respectively. Then, r 1 and r 2 are at distance 2 from each other. We refer to the node that has two adjacent occupied nodes on target by v target . (c) nb target (C) = 3. In this case, there is three consecutive occupied nodes on target . By v target , we refer to the unique node on target that has two adjacent nodes on target .

Some instances of C target configurations are presented in Figure 3. We call v target target node. Let C target be the set of all C target configurations. Our algorithm consists of two phases as explained in the following:

1. Preparation Phase. This phase starts from an arbitrary rigid configuration C 0 in which there is at most one robot on each node, i.e., no node contains a multiplicity. The aim of this phase is to reach a configuration C ∈ C target . 2. Gathering Phase. Starting from a configuration C ∈ C target configuration, robots perform the gathering task in such a way that at the end of this phase, all robots are, and remain, on the same node, i.e., the gathering is achieved.

Let us refer by C p1 (respectively C p2 ) to the set of configurations that appear during the Preparation (respectively the Gathering) phase. Let C be the current configuration, robots execute Protocol 1.

Protocol 1 Main protocol if C ∈ C p2 then Execute Gathering phase else Execute Preparation phase end if Observe that C p1 ∩ C p2 = ∅ and C target ⊂ C p2 .
We also define the following predicates on a given configuration C:

-Unique(C): There exists a unique i ∈ {1, 2, . . . , L} such that

∀ j ∈ {1, . . . , L} \ {i}, nb j (C) < nb i (C). -Empty(C): (C ∈ C target ) ∧ (∀ i ∈ {1, . . . , L}, such that i = target and i = max , nb i (C) = 0). -Partial(C): (C ∈ C target ) ∧ (∃ i ∈ {1, . . . , L}, such that i = target and i = max , nb i (C) = 0).
Given a configuration C, Unique(C) indicates that C contains a unique maximal -ring max . Empty(C) indicates that all the -rings in C, except for max and target , are empty. By contrast, Partial(C) indicates that there is at least one -ring besides max and target that is occupied (has at least one occupied node).

Procedure Align

Let us present a procedure referred to by Align( i , k ) which is called by our algorithm to align robots on i with respect to robots positions on k . The procedure is only called when the following properties hold on both i and k :

1. nb i (C) = j with j ∈ {2, . . . , 5}, i.e., there are at least two and at most five robots on i .

2. nb i (C) > nb k (C) holds, and either (1) nb k (C) = 1 or (2) nb k (C) = 2 and k contains a 2.block or (3) nb k (C) = 3 and k contains a 1.block of size 3. Let u mark be the node on k that is

-occupied if nb k (C) = 1. -empty in the 2.block if nb k (C) = 2.
occupied in the middle of the 1.block if nb k (C) = 3.

Let u 1 , u 2 , u 3 , u 4 and u 5 be five consecutive nodes on i such that u 3 is on the same L-ring as u mark . This notation is used for explanation purposes only, recall that the nodes are anonymous. The purpose of procedure Align( i , k ) is to align robots on i with respect to the robots on k . Depending on the number of robots on i and k , the following cases are possible:

a) nb i (C) = 2. In this case, Align( i , k ) is only called when nb k (C) = 1.
The aim is to create a 2.block on i whose middle node is on the same L-ring as u mark (refer to Figure 4). Let r 1 and r 2 be the two robots on i . The aim is to make the robots on i move to reach a configuration in which both u 2 and u 4 are occupied. Observe that in the desired configuration, robots r 1 and r 2 form a 2.block whose unique middle node is u 3 .

-If u 3 is occupied and without loss of generality it hosts r 1 . Robot r 1 is the one allowed to move. If both u 2 and u 4 are empty and without loss of generality dist(r 2 , u 2 ) < dist(r 2 , u 4 ) then r 1 moves to u 4 . If dist(r 2 , u 2 ) = dist(r 2 , u 4 ), then r 1 moves to either u 2 or u 4 (the adversary chooses a node to which r 1 moves to). -If u 3 is empty then assume without loss of generality that the path on i between r 1 (respectively r 2 ) and u 2 (respectively u 4 ) is empty. If u 2 (respectively u 4 ) is an empty node then r 1 (respectively r 2 ) moves on its adjacent empty node on the empty path toward u 2 (respectively u 4 ).

𝑙 𝑖 𝑙 𝑘 𝐴𝑙𝑖𝑔𝑛(𝑙 𝑖 , 𝑙 𝑘 ) 𝑢 3 𝑢 𝑚𝑎𝑟𝑘 𝑢 𝑚𝑎𝑟𝑘 𝑢 3 𝑢 2 𝑢 4 𝑢 2 𝑢 4 𝑙 𝑖 𝑙 𝑘 Fig. 4. Align( i, k ) when nb i (C) = 2 b) nb i (C) = 3. The aim of Align( i , k
) is to create a 1.block of size 3 whose middle occupied node is on u 3 (refer to Figure 5). To this end, the robots behave as follows: Let r 1 , r 2 and r 3 be the three robots on i .

-If u 3 is occupied (assume without loss of generality that r 1 is on u 3 ) then r 2 and r 3 are both allowed to move. Assume without loss of generality that there is an empty path on i between r 2 and u 2 respectively r 3 and u 4 . The destination of r 2 (resp. r 3 ) is its adjacent node on i toward u 2 (resp. u 4 ). -If u 3 is empty, then the aim of the robots is to make u 3 occupied without creating a tower. To this end, we identify two special cases c1 and c2.

• In Case c1: r 1 , r 2 and r 3 form a 1.block and the two extremities of the 1.block are equidistant to u 3 (Assume without loss of generality that r 1 and r 3 are at the ones at the borders of the 1.block, refer to Figure 6). Both r 1 and r 3 are allowed to move. Their respective destination is their adjacent node on i outside the 1.block they belong to. • In Case c2: without loss of generality, r 1 and r 2 form a 1.block while r 3 is at distance 2 from r 2 . Moreover, dis(r 1 , u 3 ) = dis(r 3 , u 3 ) + 1 (refer to Figure 6). Robot r 1 is the only one allowed to move, its destination is its adjacent empty node. Observe that Case c2 can be reached from Case c1 when a unique robot moves outside the block it belongs to. Case c2 ensures that the second robot that was supposed to move, also moves. Finally, if neither Case c1 nor Case c2 hold then, let R m be the set of robots that are the closest u 3 . If |R m | = 2 then the third robot (not in R m ), say r 2 , is used to break the symmetry, i.e., the robot that is allowed to move is the one that is the closest to r 2 . Its destination is its adjacent empty node on i on the empty path toward u 3 . If r 2 is equidistant from both robots in R m then r 2 first moves to one of its adjacent empty nodes on i (the choice is made by the adversary), the symmetry is then broken. If |R m | = 1, then the unique robot on R m moves to its adjacent empty node on its current -ring taking the shortest path to u 3 . Fig. 6. Special cases c1 and c2 c) nb i (C) = 4. The aim of Align( i , k ) is to create two 1.blocks of size 2 being at distance 2 from each other in such a way that the unique empty node between the two 1.blocks is on the same L-ring as u mark (refer to Figure 7). Let r 1 , r 2 , r 3 and r 4 be the four robots on i , we distinguish the following two cases: (a) Node u 3 is empty. Let → and ← be two directions of the -ring starting from u 3 . Let r 1 ≤ r 2 ≤ r 3 ≤ r 4 be the ordering of robots according to their distance to u 3 with respect to a given direction →, i.e., r 1 is the closest to u 3 with respect to → while r 4 is the farthest one. Observe that the order of the robots according to their distance to u 3 with respect ← is r 4 ≤ r 3 ≤ r 2 ≤ r 1 . If u 2 (respectively u 4 ) is empty then r 1 (respectively r 4 ) moves toward u 3 with respect to the direction → (respectively ←). If u 2 is occupied while u 1 is empty (respectively u 4 is occupied while u 5 is empty) then r 2 (respectively r 3 ) moves toward u 1 (respectively u 5 ) with respect to the direction → (respectively ←). (b) Note u 3 is occupied. (i) If both u 2 and u 4 are empty then, the robots on u 3 moves to one of its adjacent nodes on i (either u 2 or u 4 , the choice is made by the scheduler). (ii) if without loss of generality, u 2 is empty while u 4 is occupied then the robot on u 3 moves to u 2 . Finally, (iii) if both u 2 and u 4 are occupied then since nb i (C) = 4, we are sure that either u 1 or u 5 is empty. If without loss of generality, if only u 1 is empty then the robot on u 2 moves to u 1 . If both u 1 and u 5 are empty then assume that r 1 is the robot not part of the 1.block of size 3 on i . If dis(u 1 , r 1 ) = dis(u 5 , r 1 ) then r 1 moves to one of its adjacent empty node on i (the choice is made by the adversary). By contrast, if without loss of generality, dis(u 1 , r 1 ) < dis(u 5 , r 1 ), then r 1 moves to its adjacent empty node toward u 1 .

𝑙

𝑙

Fig. 7. Align( i, k ) when nb i (C) = 4 d) nb i (C) = 5
. The aim of Align( i , k ) is to create a 1.block of size 5 whose middle robot is on the same L-ring as u mark . Let → and ← be two directions of the -ring starting from u 3 . Let r 1 ≤ r 2 ≤ r 3 ≤ r 4 ≤ r 5 be the ordering of robots according to their distance to u 3 with respect to a given direction →, i.e., r 1 is the closest to u 3 with respect to → while r 5 is the farthest one.

-If u 3 is occupied, then u 3 hosts r 1 by assumption. If u 2 (respectively u 5 ) is empty then r 2 (respectively r 5 ) is allowed to move. Its destination is its adjacent node on i towards u 2 (respectively u 4 ) taking the empty path. If u 2 (respectively u 4 ) is occupied then robot r 3 (respectively r 4 ) is allowed to move. Its destination is its adjacent node on i toward u 2 (respectively u 4 ) taking the empty path.

-If u 3 is empty, then as for the case in which nb i (C) = 3, robots need to be careful not to create a tower. We first distinguish some special configurations that help us deal with robot with potentially outdated view. These cases are presented in Figures 8 and9 along with the robots to move. If robots are not in any of these special cases then they proceed as follows: Let R be the set of the robots on i which are the closest to u 3 . If |R| = 1 then the unique robot in R moves to its adjacent empty node toward u 3 taking the shortest path. By contrast, if |R| = 2 then by assumption r 1 and r 5 are equidistant from u 3 . To choose the one to move, the two robots compare dist(r 1 ,r 3 ) and dist(r 5 ,r 3 ). If dist(r 1 ,r 2 ) = dist(r 5 ,r 4 ) then r 3 moves to one of its adjacent empty node on i (Observe that the case in which there is no such empty node is handled by the special configurations identified in Figures 8 and9). Finally, if without loss of generality, r 3 is closer to r 1 than r 5 , then r 1 is the one to move.

Case c1

Case c2 r r 2 r 3 r 4 r 5

u 5 u 4 u 3 u 2 u r 1 r 2 r 3 r 4 r 5 u 5 u 4 u 3 u 2 u 1 ℓ k ℓ k ℓ i ℓ i Case c3 Case c4 r 1 r 2 r 3 r 4 r 5 u 5 u 4 u 3 u 2 u r 1 r 2 r 3 r 4 r 5 u 5 u 4 u 3 u 2 u 1 ℓ k ℓ k ℓ i ℓ i dist dist Fig. 8. Align( i, k ) when nb i (C) = 5

Case c5 Case c6

Case c7

r 1 r r 3 r 4 r 5 u 5 u 4 u 3 u 2 u r 1 r 2 r 3 r 4 r 5 u 5 u 4 u 3 u 2 u 1 ℓ k ℓ k ℓ i ℓ i Dist-1 dist r 1 r 2 r 3 r 4 r 5 u 5 u 4 u 3 u 2 u 1 ℓ k ℓ i
Fig. 9. Align( i, k ) when nb i (C) = 5

Preparation phase

Let C ∈ C p1 . The main purpose of this phase is to reach a configuration C ∈ C target from C. For this aim, robots first decrease the number of maximal -rings to reach a configuration C in which Unique(C ) is true. From C , a configuration C ∈ C target is then created. In the case in which Unique(C) is true, we refer to the unique maximal -ring in C by max and to the two adjacent -rings of max by respectively k and i . To ease the description of our this phase, we distinguish five main sets of configurations when Unique(C) is true:

1. Set C Empty : C ∈ C Empty if nb i (C) = nb k (C) = 0. 2. Set C Semi-Empty : C ∈ C Semi-
C oriented that are not in C Oriented-1 . That is, C Oriented-2 = C Oriented -C Oriented-1 . 4. Set C Semi-Oriented : C ∈ C Semi-Oriented if without loss of generality nb i (C) = 1 and nb k (C) = 1. 5. Set C U ndef ined : C ∈ C U ndef ined if nb i (C) > 1 and nb k (C) > 1.
Robots behavior We describe in the following robots behavior during the preparation phase. Let C be the current configuration. Recall that if Unique(C) is false then robots first aim at decreasing the number of maximal -rings to reach a configuration C in which U nique(C ) is true. From there, robots create a configuration C ∈ C target . That is, we distinguish the following two cases:

1. Unique(C) is false. The idea of the algorithm is to reduce the number of maximal -rings while keeping the configuration rigid. We distinguish two cases: (a) nb max (C) = . Using the rigidity of C, a single maximal -ring is selected and a single robot on this -ring is selected to move. Its destination is its adjacent occupied node on its current -ring.

The robot to move is the one that keeps the configuration rigid (the existence of such a robot is proven in Lemma 2). (b) nb max (C) < . As there is at least one empty node on each maximal -ring, the idea is to fill exactly one of these nodes. Let R be the set of robots that are the closest to an empty node on a maximal -ring. Under some conditions, using the rigidity of C, one robot of R, say r, is elected to move. Its destination is its adjacent empty node toward the closest empty node on a maximal -ring, say u, taking the shortest path. Among robots in the set R, the robot to move is the one that does not create a symmetric configuration. If no such robot exists in R then, some extra steps are taken to make sure that the configuration remains rigid. We discuss the various cases in what follows :

-Assume that C contains exactly two occupied -rings. This means that C contains two maximal -rings and r belongs to a maximal -ring. Using the rigidity of C, one robot is elected to move, its destination is its adjacent empty node on an empty -ring. -If C contains more than two occupied -rings then the robots proceed as follows: let r be the robot in R with the largest view. By u and target-we refer to respectively the closest empty node on a maximal -ring to r and the -ring including u. If by moving, r does not create a symmetric configuration then r simply moves to its adjacent node toward u taking the shortest path. By contrast, if by moving r creates a symmetric configuration then let C be the configuration reached once r moves. Using configuration C that each robot can compute without r moving, a robot in C is selected to move. We show later on that a symmetric configuration can only be reached when r joins an empty node on the same L-ring as u for the first time or when it joins u. For the other cases, the configuration remains rigid (refer to Lemma 4, Claims 1 and 2). Hence, we only consider the following two cases: i. Robot r joins an empty node on the same L-ring as u for the first time in C . In this case, in C, the robot that is on target-being on the same L-ring as r moves to u (refer to Figure 10). ii. Robot r joins u in C . If in C there are only two occupied -rings then using the rigidity of C, one robot from a maximal -ring is elected to move. Its destination is its adjacent empty node on an empty -ring. By contrast, if there are more than two occupied -rings in C then robots proceed as follows:

• If the axes of symmetry lies on the unique max in C then we are sure that there are two -rings which are maximal in C and that are symmetric with respect to the unique maximal -ring in C . Using the rigidity of C, one robot from such an -ring is allowed to move. Its destination is its adjacent empty node on its current -ring. • If the axes of symmetry is perpendicular to the unique maximal -ring in C then let T be the set of occupied -rings in C without target-. If there is an -ring in T which does not contain two 1.blocks separated by a single empty node on each side then using the rigidity of C, a single robot on such an -ring which is the closest to the biggest 1.block is elected to move. Its destination is the closest 1.block. If there no such -ring in T (all -rings contains two 1.blocks separated by a unique empty node, then using the rigidity of C, one robot being on an -ring of T who has an empty node as a neighbor on its -ring is elected to move. Its destinations is its adjacent empty node on its current -ring. Note that we only discussed the cases in which the reached configuration is either rigid and symmetric. We will show in the correctness proof that when r moves, it cannot create a periodic configuration. This is mainly due to the fact that in C there is a unique maximal -ring and C is assumed to be rigid. 2. Unique(C) is true. From C, robots aim to create a configuration C ∈ C target . Let max be the unique maximal -ring and let i and k be the two adjacent -rings of max . We use the set of configurations defined previously to describe robots behavior: (a) C ∈ C Empty . Let ni and n k be the two neighboring -rings of max (one neighboring -ring from each direction of the torus). Observe that in the case where ni = n k = max , then C contains a single -ring that is occupied. Using the rigidity of C, one robot from C is selected to move to its adjacent empty node outside its -ring (the scheduler chooses the direction to take: move toward i or k ). Otherwise, let R m be the set of robots which are the closest to either i or k .

If |R m | = 1 then, the unique robot in R m , referred to by r, is the one allowed to move. Assume without loss of generality that r is the closest to i . The destination of r is its adjacent empty node outside its current -ring on the shortest empty path toward i . If r is the closest to both i and k then the scheduler chooses the direction to take (it moves either toward i or k ). In the case where |R m | > 1 (R m contains more than one robot) then, by using the rigidity of C, one robot r is selected to move. Its behavior is the same as r in the case where

|R m | = 1. (b) C ∈ C Semi-Empty . Without loss of generality nb k (C) > 1 and nb i (C) = 0. We distinguish two cases as follows: i. nb k (C) > 3 or nb k (C) = 2. Recall that C ∈ C target .
Let "↑" be the direction defined from max to k taking the shortest path and let n be the -ring that is neighbor of i . Observe that n = k is possible (in the case where only two -rings are occupied in C). Using the rigidity of configuration C, one robot from n is elected. This robot is the one allowed to move, its destination is its adjacent node outside n and towards i with respect to the direction ↑. ii. nb k (C) = 3. Again, recall that C ∈ C target . The aim is to make the three robots form a single 1.block. To this end, if the configuration contains a single d.block of size 3 with d > 1 then the robot in the middle of the d.block moves to its adjacent node on k (the scheduler chooses the direction to take). By contrast, if the configuration contains a single d.block of size 2 (d ≥ 1) then the robot not part of the d.block moves towards its adjacent empty node towards the d.block taking the shortest empty path. (c) C ∈ C Oriented . Let r i be the single robot on i . Recall that two sub-sets of configurations are defined in this case: i. C ∈ C Oriented-1 . If nb max (C) > 4 then the unique robot on i moves to its adjacent node on max . Otherwise, let u be the node on max which is adjacent to the unique robot on i .

-If nb max (C) = 3 and the robots form a 1.block of size 3 whose middle robot is adjacent to u then the unique robot on i moves to its adjacent node on max . Otherwise, robots on max execute Align( max , i ).

-If nb max (C) = 4 and u is empty, then the unique robot on i moves to u. Otherwise (u is occupied), then let r be the robot on u.

• If r has an adjacent empty node on max then r moves to one of its adjacent nodes (the scheduler chooses the node to move to in case of symmetry). • If r does not have an adjacent empty node on max , then let r be the robot on max which is adjacent to r and which does not have a neighboring robot on max at distance /2 . Robot r is the one allowed to move. Its destination is its adjacent empty node on

max . ii. C ∈ C Oriented-2 . If nb k (C) = 2 or nb k (C) = 3 then Align( k , i ) is executed. Otherwise, if nb k (C) > 3 then, nb k (C) - 2
robots gather on the node u k located on k and which is on the same L-ring as the unique occupied node on i . For this purpose, the robot on k which is the closest to u k with the largest view is the one allowed to move. Its destination is its adjacent node on k toward u k . (d) C ∈ C Semi-Oriented . Let ni and n k be the two neighboring -rings of i and k respectively.

-If without loss of generality, i = n k (and hence k = ni ). Then configuration C contains only 3 occupied -rings i , max and j . Using the rigidity of C, one robot from either ni or n k (not both) is selected to move. Its destination is its adjacent empty node outside its current -ring in the opposite direction of max . -In the case where i = n k (and hence k = ni ) then, again, by using the rigidity of C, a unique robot is selected from either ni or either n k (not both) to move. Its destination is its adjacent empty node outside its current -ring toward i (respectively k ) if the robot was elected from ni (respectively n k ). If ni = n k then the direction of the selected robot is chosen by the adversary. (e) C ∈ C U ndef ined . Depending on the number of robots on i and k , we distinguish the following two cases: i.

nb i (C) < nb k (C).
The idea is to make robots on i gather on a single node on i . We define in the following a configuration, denoted Γ (C), built from C ignoring some -rings and that will be used in order to identify a single node on i on which all robots on i will gather. In the case in which there are at least four occupied -rings in C then Γ (C) is the configuration built from C ignoring both i and k . By contrast, if there are only three occupied -rings then Γ (C) is the configuration built from C ignoring only i . The following cases are possible: A. Configuration Γ (C) is rigid. Using the rigidity of Γ (C), one node on i is elected as the gathering node. Let us refer to such a node by u. Robots on i moves to join u starting from the closest ones and taking the shortest path. B. Configuration Γ (C) has exactly one axes of symmetry. In this case the axes of symmetry of Γ (C) either intersects with i on a single node (edge-node symmetric), or on two nodes (node-node symmetric) or only on edges (edge-edge symmetric). We discuss in the following each of the mentioned cases:

-Γ (C) is node-edge symmetric: The single node on i that is on the axes of symmetry of Γ is identified as the gathering node. Robots on i move to join this node starting from the closest robots and taking the shortest path.

-Γ (C) is node-node symmetric: Let u 1 and u 2 be the two nodes on i on which the axes of symmetry passes through. If both nodes are occupied, then using the rigidity of C, exactly one of the two nodes is elected. Assume without loss of generality that u 1 is elected. Robots on u 1 move to their adjacent node. If both u 1 and u 2 are empty then let R be the set of robots on i that are at the smallest distance from either u 1 or u 2 .

If |R| = 1 (Let r be the robot in R and assume without loss generality that r is the closest to u 1 ) then, r moves to its adjacent node on its current -ring toward u 1 taking the shortest path. By contrast, if |R| > 1 then using the rigidity of C, exactly one robot of R is elected to move. Its destination is its adjacent node on its current -ring toward the closest node being on the axes of symmetry of Γ (C), taking the shortest path. -Γ (C) is edge-edge symmetric. Without loss of generality, assume that the axes of symmetry of Γ (C) passes through i on the following two edges e 1 = (u 1 , u 2 ) and e 1 = (u 3 , u 4 ) with u 1 and u 3 being on the same side. Let U = {u j , j ∈ [1 -4]}. We distinguish the following cases:

• For all u ∈ U , u is occupied. Using the rigidity of C, a single node u ∈ U is elected. Robots on u move to their adjacent node u ∈ U (refer to Figure 11,(A)). • Three nodes of U are occupied. Assume without loss of generality that u 1 is the empty node of U . If there are robots on i which are located on the same side as u 1 and u 3 with respect to the axes of symmetry of Γ (C) then the robots among these which are the closest to u 3 are the ones to move. Their destination is their adjacent node on their current -ring toward • Two nodes of U are occupied. First, assume without loss of generality that u 1 and u 2 are occupied (the case where the two nodes are neighbors). If all robots on i are on the same side of the axes of symmetry (assume without loss of generality that they are at the same side as u 1 ). Robots on u 2 are the ones allowed to move. Their destination is their u 1 (refer to Figure 12,(A)). By contrast, if there are robots on both sides of the axes of symmetry of Γ (C) then let U be the set of occupied nodes on i which are the farthest from the occupied node of U which is on the side (of the axes of symmetry). If there are two of such nodes (one at each side), as C is rigid, the scheduler elects exactly one of these two nodes. Let us refer to the elected node by u. Robots on u are the ones allowed to move. Their destination is their adjacent node on their current -ring towards the occupied node of U which is on their side (refer to Figure 12, (B)). By contrast if there is only one node in U then, robots on the other side of the axes of symmetry are the ones allowed to move starting starting from the robots that are the closest to the occupied node of U which is on their side. Their destination is their adjacent node on their current -ring toward the occupied node of U on their side (refer to Figure 12, (C)). Finally, if there are no robots on both side of the axes of symmetry, then using the rigidity of C, one occupied node of U is elected. Robots on the elected node are the ones allowed to move. Their destination is their adjacent occupied node in U . Next, assume without loss of generality that u 1 and u 3 are occupied (the two node of U are not neighbors but are at the same side of Γ (C)'s axes of symmetry). Robots on a node of U with the largest view are the ones allowed to move. Their destination is their adjacent node in the opposite direction of a node of U (refer to Figure 12, (D)). Finally, assume without loss of generality that u 1 and u 4 are occupied (the two nodes of U are not neighbors and are in opposite sides of the axes of symmetry).

Robots on a node of U with the largest view are the ones allowed to move. Their destination is their adjacent node in the opposite direction of their adjacent node in U (refer to Figure 12,(A)). • There is only one node of U that is occupied. Assume without loss of generality that u 1 is occupied. If all robots on i are on the same side of the axes of symmetry as u 1 then the closest robots to u 1 on i is allowed to move. Its destination is its adjacent node towards u 1 taking the shortest path. By contrast, if all robots on i are in the opposite side of the axes of symmetry of u 1 then robots on u 1 are the ones to move. Their destination is u 2 . Finally, if robots on i are on both sides of the axes of symmetry then the closest robots to u 1 which are on the same side of the axes of symmetry as u 1 are the ones allowed to move. Their destination is their adjacent node on i towards u 1 taking the shortest path. • All nodes of U are empty. Let d be the smallest distance between a node of u ∈ U and a robot being on the same side of the axes of symmetry as u. Let R be the set of robots that are at distance d from a node u ∈ U . If |R| = 1 then the unique robot in R moves towards the closest node u ∈ U . By contrast, if |R| > 1 then, using the rigidity of C, a unique robot in R is selected to move. Its destination is its adjacent node toward the closest node u ∈ U .

u 2 u 1 u 3 u 4 u 2 u 1 u 3 u 4 u 1 u 3 u 4 (A) (B) (C) (D) dist dist u 2 u 1 u 3 u 4 u 2
C. Configuration Γ (C) has more than one axes of symmetry. Using the rigidity of C, a single robot from Γ (C) is elected to move. Its destination is its adjacent empty node on its current -ring. This reduces the number of axes of symmetries to either 1 or 0 (Please refer to Lemma7).

ii. nb i (C) = nb k (C). Let i and k be the two -rings that are adjacent to respectively i and k . Assume without loss of generality that i is empty while k hosts at least one robot. Using the rigidity of C, one robot from i is elected to move. Its destination is its adjacent empty node on i . In the case in which both i and k are empty, using the rigidity of C, one robot is elected to move. Assume without loss of generality that the elected robot is on i . The destination of the elected robot is its adjacent empty node on i . By contrast, if neither i nor k is empty then, as for the case in which nb i (C) < nb k (C), we use configuration Γ (C) to elect the robot to move. Recall that Γ (C) is defined as the configuration in which both i and k are ignored (the set of -ring without i and k ). Robots proceed as follows:

A. Configuration Γ (C) is rigid. Using the rigidity of Γ (C), a unique node u is elected on either i or k . Assume without loss of generality that u is elected on i . If u is empty and nb i (C) = -1 then the robot on i that is adjacent to u and is not part of a multiplicity moves to u. Otherwise, robots on i which are the closest to u move to their adjacent node toward u taking the shortest path. B. Configuration Γ (C) contains one axes of symmetry. We distinguish the following cases:

-Γ (C) is node-edge symmetric. Let u and u be the nodes on respectively i and k on which the axes of symmetry of Γ (C) passes through. If, without loss of generality, only u is occupied then the closest robot to u on i is the one allowed to move. Its destination is its adjacent node towards u taking the shortest path. If there are two such robots, one is elected using the rigidity of C. On another hand, if both u and u are occupied then using the rigidity of C one closest robot to either u or u is elected. Assume that the elected robot r is on i . The destination of r is its adjacent node on its current -ring towards u taking the shortest path. Finally, if both u and u are empty then the idea is to make either u or u occupied. Let R 1 (C) (respectively R 2 (C)) be the set of robots on i (respectively k ) which are not on u (respectively u ) but are the closest

u (respectively u ). Let R(C) = R 1 (C) ∪ R 2 (C). If |R(C)| > 1 then using the rigidity of C a unique robot of R(C
) is elected to move otherwise, the unique robot in R(C) is the one allowed to move. Let us refer to such a robot by r and assume without loss of generality that r is on i . Robot r is the only one allowed to move. Its destination is its adjacent empty node on its current -ring toward u taking the shortest path. -Γ (C) is node-node symmetric. Let u i and u i (respectively u k and u k ) be the two nodes on i (respectively k ) on which the axes of symmetry of Γ (C) passes through. First assume that ∀u ∈ {u i , u i , u k , u k }, u is occupied. Let U ⊆ {u i , u i , u k , u k } be the set of nodes that have an occupied adjacent node on their -ring. If |U | ≥ 1 then, using the rigidity of C a single node in U is elected. Assume without loss of generality that this node is u i . The robot on u i is the one allowed to move. Its destination is its adjacent occupied node on its -ring. By contrast, if |U | = 0. Again, using the rigidity of C, one node of u ∈ {u i , u i , u k , u k } is elected. The robot on node u is the one allowed to move. Its destination is its adjacent empty node on its current -ring (the scheduler chooses the direction to take). Next, let us consider the case in which ∃u ∈ {u i , u i , u k , u k } such that u is empty. Several cases are possible depending on the nodes that are occupied. If there is a unique node u ∈ {u i , u i , u k , u k } which is occupied then the closest robot to u on the same -ring as u moves to its adjacent node toward u. By contrast, if there are three nodes in {u i , u i , u k , u k } which are occupied then assume without loss of generality that u i is the empty node. Robots on i which are the closest to u i are the only ones allowed to move. Their destination is their adjacent node towards u i . Finally, if there are two nodes of {u i , u i , u k , u k } which are occupied then, if the two nodes are part of the same -ring (assume without loss of generality that these two nodes are u i and u i ) then using the rigidity of C one node among u i and u i is elected. The robot on the elected node is the one allowed to move. Its destination is its adjacent node on its current -ring (the direction is chosen by the scheduler). If the two occupied nodes are on two different -rings then let R(C) be the set of robots on i and k which are the closest to the occupied node of {u i , u i , u k , u k } on their -ring. Using the rigidity of C, one robot from R(C) is elected to move. Its destination is its adjacent node on its current -ring toward the occupied node of {u i , u i , u k , u k } which is on its -ring. -Γ (C) is edge-edge symmetric. Assume without loss of generality that the axes of symmetry of Γ (C) passes through respectively e 1 = (u 1 , u 2 ) and e 2 = (u 3 , u 4 ) on i and e 1 = (u 1 , u 2 ) and e 2 = (u 3 , u 4 ) on k and that u 1 and u 3 (respectively u 1 and u 3 ) are on the same side of Γ (C)'s axes of symmetry on i (respectively k ). Let L = { i , k },

U i = {u 1 , u 2 , u 3 , u 4 }, U k = {u 1 , u 2 , u 3 , u 4 } and U = U i ∪ U k .
The main idea is to gather all robots on either i or k . For this purpose, the number of occupied nodes is decreased in exactly one of the two -rings of L so that we can reach a configuration C in which nb i (C ) = nb k (C ) and hence use the strategy explained previously. That is, a single -ring r ∈ L needs to be selected. Robots on the selected -ring, r behaves in the same manner as in the case in which nb i (C) = nb k (C). That is, we describe in the following how a unique -ring in L is selected.

Given two nodes u and u of U located on the same side of Γ (C)'s axes of symmetry and being on the same -ring j , we refer by F ree(u, u ) to the predicate that is equal to true is there is no robot on the shortest sequence of nodes between u and u (excluding u and u ) on j . In the case where F ree(u, u ) is true for a given -ring j , we say that j has an empty side. Otherwise, we say that j has an occupied side. Observe that each -ring of L have at most two empty sides. In order to select a unique -ring in L, robots checks if the following properties hold in this order and decide accordingly:

-First, there exists an -ring in L, let this -ring be without loss of generality i , in which: |U i | = 2 with the two occupied nodes of U i being adjacent to each other (Assume without loss of generality that u 1 and u 2 are the occupied node of U i ), F ree(u 2 , u 4 ) ∧ F ree(u 1 , u 3 ) holds. Observe that since C is rigid and

Γ (C) is sym- metric, on k , if |U k | = 2 then the two occupied nodes of U k cannot be neighbors.
That is, k cannot satisfy the same properties at the same time in C. In this case i is the one that is selected. As this case is not considered in a configuration C in which nb i (C ) = nb k (C ), in addition to the selection process, we describe robots behavior: the robot that is on a node of U i with the largest view is the one allowed to move. Its destination is u 1 .

-Next, there exists an -ring in L, let this -ring be without loss of generality i , in which: |U i | = 1 (Assume without loss of generality that u 1 is the occupied node of U i ), F ree(u 2 , u 4 ) ∧ ¬F ree(u 1 , u 3 ) holds. In this case, if k does not satisfy the same properties then i is elected. Otherwise, assume without loss of generality that u 1 is the occupied node in U k . Let d i (respectively d k ) be the smallest distance between a robot on i (respectively k ) and u 1 (respectively u 1 ). If d i = d k (assume without loss of generality that d i < d k ) then i is elected. Otherwise (i.e., d i = d k ), let r (respectively r ) be the robot on i (respectively k ) which is at distance

d i from u 1 (respectively u 1 ). If view r (t)(1) > view r (t)(1) then i is elected. Otherwise, k is elected.
-Next, there exists an -ring in L, let this -ring be without loss of generality i , in which: |U i | = 2 with the two occupied nodes of U i being neighbors (let these two nodes be respectively u 1 and u 2 ), F ree(u 1 , u 3 ) ∨ F ree(u 2 , u 4 ) holds. If k does not satisfy the same properties as i then, i is the one that is selected. Otherwise, the -ring that hosts a robot located on a node of U with the largest view is the one that is selected.

-Next, there exists an -ring in L, let this -ring be without loss of generality i , in which:

|U i | = 2
with the two occupied nodes of U i being on the same side of Γ (C)'s axes of symmetry (let these robots be respectively u 1 and u 3 ), F ree(u 2 , u 4 ) and ¬F ree(u 1 , u 3 ) holds. If k does not satisfy the same properties as i then, i is the one that is selected. Otherwise, the -ring of L that hosts a robot on a node of U with the largest view is the one to be selected.

-Next, there exists an -ring in L, let this -ring be without loss of generality i , in which: |U i | = 3 (let u 1 be the unique empty node in U i ) and F ree(u 1 , u 3 ) holds. If k does not satisfy the same properties then, i is selected. Otherwise, the -ring that hosts a robot on a node of U with the largest view is the one to be elected. For all the remaining cases, if, without loss of generality, |U i | < |U k | then i is the selected. Otherwise, in the case where |U i | = |U k | then, the selection is achieved as follows:

• |U i | = 4.
Let R be the set of robots on a node of U . The -ring that hosts the robots of R with the largest view is the one to be selected (Recall that C is rigid). • |U i | = 3. Assume without loss of generality that u 1 and u 1 are the empty nodes on i and k respectively. Observe that ¬F ree(u 1 , u 3 ) an ¬F ree(u 1 , u 3 ) holds. Let R i (respectively R k ) be the set of robots on i (respectively k ) being on the same side of the axes of symmetry as u 1 (respectively

u 1 ). Let R = R i ∪ R k . If without loss of generality |R i | < |R k | then, i is elected. By contrast, if |R i | = |R k | then, let r
1 (respectively r 1 ) be the robot on i (respectively k ) which is the closest to u 3 (respectively u 3 ). If without loss of generality dist(r 1 , u 3 ) < dist(r 1 , u 3 ) then i is selected. Otherwise, if dist(r 1 , u 3 ) = dist(r 1 , u 3 ) then the views of r 1 and r 1 are used for the selection. Assume without loss of generality that view r1 (t)(1) > view r 1 (t)(1). Then, i is selected. That is, if i and k have two different priorities then, the -ring with the largest priority is elected. By contrast, if the two -rings have the same priority (they belong to the same case), the selection is done in the following manner: if both i and k belongs to Case(I) (assume without loss of generality that u 1 , u 2 are the two nodes of U i which are occupied and u 1 and u 2 are the two occupied nodes of U k ). Let F 1 , F 2 (respectively F 1 , F 2 ) be the number of robots on i (respectively k ) being on each side of Γ (C)'s axes of symmetry. Let F = min(F 1 , F 2 , F 1 , F 2 ). The -ring that has a side with F robots is selected. If both -rings has a side with F robots, we use the distance to break the symmetry. That is, let d be the smallest distance between a robot on an -ring of L and the occupied node of U on the same -ring. The -ring that hosts a robot at distance d from a node of U is elected. Again, if both -rings satisfy the property, the -ring hosting the robot at distance d from a node of U with the largest view is elected. Lastly, if both -ring of L belong to Case(II) or if they both belong to Case(III) then, let r (respectively r ) be the robot allowed to move on i (respectively k ) with respect to our algorithm. If view r (t)(1) > view r (t)(1) then i is elected. Otherwise, k is selected. • |U | i = 1. let d be the smallest distance between a robot on an -ring of L and a node of U located on the same -ring. The -ring that hosts a robot at distance d from a node of U with the largest view is the one that is elected (this is possible as C is rigid). • |U i | = 0. Let d be the smallest distance between a robot on an -ring of L and a node of U on its -ring. The -ring that hosts a robot at distance d from a node of U with the largest view is the one that is elected. -Γ (C) has more than one axes of symmetry. Using the rigidity of C, a single robot of Γ (C) is elected to move to its adjacent node on its current -ring. By doing so, the number of axes of symmetry is reduced to either 1 or 0 (Please refer to Lemma7).

• |U i | = 2.

Gathering Phase

Recall that this phase starts from a configuration C ∈ C target . From C, an orientation of the torus can be defined (from target to max ). The idea is to make all robots that are neither on target nor max move to join v target following the predefined orientation. Then, some robots on max move to join v target while the other are aligned with respect to v target to finally gather all on one node.

To ease the description of our algorithm, we first identify a set of configurations that can appear in this phase and then present for each of them the behavior of the robots.

Set of configurations. Three sets are identified as follows:

1. Set C sp which includes the following four sub-sets:

(a) SubSet C sp-1 : C ∈ C sp-1 if there are exactly two occupied -rings in C. Let these two -rings be i and j respectively. The following conditions are verified: (1) i and j are adjacent. (2) nb j (C) < nb i (C) (3) either :

nb i (C) = 4 and i contains two 1.blocks of size 2 being at distance 2 from each other. Let u be the unique node between the two 1.blocks on i . nb i (C) = 3 and i contains a 1.block of size 3. Let u be the middle node of the 1.block of size 3. nb i (C) = 5 and i contains a 1.block of size 5. Let u be the middle node of the 1.block of size 5. (4) Either nb j (C) = 3 and j contains a 1.block of size 3 whose middle node is adjacent to u or nb j (C) = 2 and j contains either a 2.block of size 2 whose middle node is adjacent to u or a 1.block of size 2 having one extremity adjacent to u (refer to Figure 13 for some examples).

(b) SubSet C sp-2 : C ∈ C sp-2 if C ∈ C target and nb target (C) = 1.
In addition either one of the following conditions are verified: (1) nb max (C) = 4 and on max there are two 1.blocks of size 2 being at distance 2 from each other. Let u be the unique node between the two 1.blocks then u is adjacent to v target . ( 2) nb max = 5 and on max there is a 1.block of size 5 whose middle robot is adjacent to v target . (3) nb max (C) = 4 and on max there is a 1.block of size 3 having a unique occupied node at distance 2. Let u be the unique empty node between the 1.block of size 3 and the 1.block of size 1. Then u is adjacent to v target (refer to Figure 13). (2) nb max (C) = 2 and the two robots form a 2.block on max . Let u be the unique empty node between the two robots on max , then u is adjacent to v target (refer to Figure 14). (d) SubSet C sp-4 : C ∈ C sp-4 if there is a unique -ring that is occupied and on this -ring there are either two or three occupied nodes that form a 1.block (refer to Figure 14). Robots behavior. We present now the behavior of robots during the gathering phase. If the current configuration C ∈ C target then we define ↑ as the direction from target to max taking the shortest path.

C sp-1 C sp-1 C sp-1 C sp-2 C sp-2 C sp-2 ℓ i ℓ j ℓ i ℓ j ℓ i ℓ j
Observe that ↑ can be computed by all robots and in addition, ↑ is unique (recall that max is unique and ∀ C ∈ C target , nb target (C) = nb secondary (C)). Using Direction ↑, we define a total order on the -rings of the torus such that i ≤ j if i is not further to target than j with respect to Direction ↑. Note that C p2 = C pr ∪ C ls ∪ C sp . Let C be the current configuration, we present robots behavior for each defined set:

1. C ∈ C pr . Let us refer by i to the -ring that is adjacent to target such that i = max . Depending on the number of robots on i , two cases are possible as follows:

(a) nb i (C) > 0. Let R m be the set of robots on i that are the closest to v target . We distinguish the following cases: i. There is an occupied node on i that is adjacent to v target . Let us refer to such a node by u i . Robots on u i are the ones allowed to move. Their destination is their adjacent node on target i.e., they move to v target . ii. There is no robots on i that is adjacent to v target and nb i (C) < -1. In this case, robots in R m are the ones allowed to move, their destination is their adjacent empty node on i on the empty path toward v target . iii. There is no robots on i that is adjacent to v target and nb i (C) = -1. In this case, let R m be the set of robots that share a hole with u i where u i is the node on i that is adjacent to v target . Robots in R m are allowed to move only if they are not part of a multiplicity. Their destination is their adjacent empty node towards u i taking the empty path. (b) nb i (C) = 0. Let k be the closest neighboring -ring of target with respect to ↑. Let R m be the set of robots on k that are the closest to v target . Robots on R m are the ones allowed to move, their destination is their adjacent node outside k and toward target with respect to ↑.

2. C ∈ C ls . The aim for the robots is to reach a configuration C ∈ C sp .

If nb max (C) <= 5, robots on max execute Align( max , target ). Otherwise, robots behave as follows: Let u 1 , u 2 , u 3 , u 4 and u 5 be a sequence of five consecutive nodes on max such that u 3 is adjacent to v target . If u 3 is occupied and has exactly one adjacent occupied node on max (assume without loss of generality that this node is u 2 ) then the robot on u 2 is the one allowed to move. Its destination is u 3 . By contrast, if u 3 has either no adjacent occupied nodes on max or two adjacent occupied nodes on max then robots on u 3 are the ones allowed to move. Their destination is v target . Finally, if u 3 is empty then let R be the set of robots that are on max which are the closest to u 3 . If |R| = 2 then both robots in R are allowed to move. Their destination is their adjacent node on max toward u 3 . By contrast, if |R| = 1 then first assume that the distance between the robot in the set R and u 3 is d. If there is a robot on max which shares a hole with u 3 and which is at distance d + 1 from u 3 then this robot is the one allowed to move. Its destination is its adjacent empty node towards u 3 taking the shortest path. If no such robot exists then the robot in the set R is the one allowed to move. Its destination is its adjacent node toward u 3 taking the shortest path. 3. C ∈ C sp . We distinguish:

(a) C ∈ C sp-1 . If C ∈ C target then the robots on target that are at the extremities of the 1.block or the 2.block are the ones allowed to move. Their destination is their adjacent occupied node on max . By contrast, if C ∈ C target then the robot not on max which has two adjacent occupied nodes is the one allowed to move. Its destination is its adjacent node on max . (b) C ∈ C sp-2 . Recall that three cases are possible as follows: If there is a 1.block of size 3 on max then the robots that are in the middle of the 1.block of size 3 moves to their adjacent occupied node that has one robot at distance 2. If max contains a 1.block of size 5 then the robots on max that are adjacent of the extremities of the 1.block move on max in the opposite direction of the extremities of the 1.block. Finally, if max contains two 1.blocks of size 2 then the robots that share a hole of size 1 move toward each other. (c) C ∈ C sp-3 . In this case, robots on v target are the ones that are allowed to move (note that v target can be occupied by either a single robot or a tower). Their destination is their adjacent node on max . (d) C ∈ C sp-4 . If C contains a 1.block of size 3 then the robots that are at the extremities of the 1.block are the ones allowed to move. Their destination is their adjacent occupied node. By contrast, if C contains a 1.block of size 2 then the robot that is not part of a tower moves to its adjacent occupied node (As it will be shown later, the proposed solution ensures that in this case, one node hosts a tower while the other one hosts only one robot).

Proof of correctness

Let us first show the correctness of Procedure Align( i , k ). For this purpose, we define the set of configurations to which we refer to by Aligned ( i , k ). A configuration C is said to be Aligned ( i , k ) if the following conditions hold on i and k :

1. nb i (C) = 2 and robots on i form a 2.block of size 2. By u, we refer to the empty node which is the middle of the 2.block on i . Or nb i (C) = 3 (respectively nb i (C) = 5) and robots on i form a 1.block of size 3 (respectively of size 5). By u, we refer to the occupied node which is in the middle of the 1.block on i . Or, nb i (C) = 2 and robots on i form two 1.blocks of size 2 being at distance 2 from each other. Let u be the unique empty node between the two 1.blocks. 2. nb i (C) > nb k (C) holds, and either (1) nb k (C) = 1 or (2) nb k (C) = 2 and k contains a 2.block or (3) nb k (C) = 3 and k contains a 1.block of size 3. Let u mark be the node on k that is

-occupied if nb k (C) = 1. -empty in the 2.block if nb k (C) = 2.
occupied in the middle of the 1.block if nb k (C) = 3. 3. Nodes u and u mark are on the same L-ring. Lemma 1. Starting from a configuration in which Align( i , k ) is called with no robots with outdated views, an Aligned( i , k ) configuration is eventually reached. Proof. As Align( i , k ) is called only when the second property of Aligned ( i , k ) is verified and as no robot is allowed to move on k when executing Align( i , k ), we only focus in this proof on robots which are on i . Let u 1 , u 2 , u 3 , u 4 and u 5 be five consecutive nodes on i such that u 3 is on the same -ring as k . Let r 1 , r 2 , ..., r j be the robots that are located on i in the case where nb i (C) = j. Depending on the number of robots on i , procedure Align( i , k ) considers the following cases:

1. nb i (C) = 2. Assume without loss of generality that there is no robot between r 1 and u 2 on i . By procedure Align( i , k ), if u 2 (respectively u 4 ) is empty then r 1 (respectively r 2 ) is allowed to move. Its destination is its adjacent empty node on i toward u 2 (respectively u 4 ). By doing so, the robot gets even more closer to u 2 (respectively u 4 ) and hence it is still allowed to move, eventually u 2 (respectively u 4 ) becomes occupied and the Lemma holds. 2. nb i (C) = 3. If u 3 is occupied then as for case 1, we can deduce that eventually u 2 and u 4 become occupied. That is, we only focus in the following in the case in which u 3 is empty. As the scheduler is asynchronous, we need to be careful not to create a tower. If there is a unique robot, say r 1 which is the closest to u 3 then by procedure Align, r 1 is the only one allowed to move. Its destination is its adjacent empty node on its current -ring towards u 3 . That is, eventually u 3 becomes occupied. By contrast if there are two robots which are the closest to u 3 (assume that these two robots are r 1 and r 2 ) then procedure Align uses r 3 to break the symmetry. Two special cases are identified to deal with robots with potential outdated views: the case in which dist(r 1 , r 3 ) = dist(r 2 , r 3 ) and r 1 and r 2 are part of the same 1.block (refer to Figure 5). By procedure Align, both r 1 and r 2 are allowed to move. Their destination is their adjacent empty node in the opposite direction of r 3 . If only one of the two robots move (assume without loss of generality that this robot is r 1 ) then a configuration in which there is a 1.block of size 2 on i with dist(r 1 , r 3 ) = dist(r 2 , r 3 ) +1 is reached. This situation corresponds the second special case (c2) (refer to Figure 5). In this case, by procedure Align, robot r 2 is the only one allowed. That is, eventually r 2 moves to its adjacent empty node in the opposite direction of r 3 . That is, we are sure that in the configuration reached none of the robots on i has an outdated view. Now note that, in the case where dist(r 1 , r 3 ) = dist(r 2 , r 3 ) with r 1 and r 2 not part of the same 1.block, then r 3 is the one allowed to move, its destination is its adjacent empty node on its current -ring (the scheduler chooses the direction to take), that is eventually dist(r 1 , r 3 ) < dist(r 2 , r 3 ) or dist(r 1 , r 3 ) > dist(r 2 , r 3 ). Finally, if without loss of generality dist(r 1 , r 3 ) < dist(r 2 , r 3 ), then r 1 is the only one allowed to move. Its destination is its adjacent node on its current -ring towards u 3 . By moving, r 1 becomes the only one which is the closest u 3 and as discussed previously u 3 becomes occupied eventually. We can thus deduce that the lemma holds. 3. nb i (C) = 4. If node u 3 is occupied and either u 2 or u 4 is empty. Then by procedure Align, robot on u 3 is the one allowed to move. Its destination is its adjacent empty node (in case of symmetry, the scheduler chooses the direction to take). By contrast, if both u2 and u 4 are occupied then since nb i (C) = 4 then either u 1 or u 5 is empty. Assume without loss of generality that u 1 is the node that is empty. In this case, by procedure Align, the robot on u 2 is the one allowed to move, its destination is its adjacent empty node in the opposite direction of u 3 . Hence, we can deduce that u 3 becomes eventually empty. Let us now consider the case in which u 3 is empty. By procedure align, an order on robots is defined according to the robots distance from u 3 and a given orientation of the ring i . Assume that r 1 ≤ r 2 ≤ r 3 ≤ r 4 . Robot r 1 's (respectively r 4 's) destination is u 2 (respectively u 4 ). Similarly r 2 's (respectively r 3 's) destination is u 1 (respectively u 5 ). As they move to their respective target node starting from the ones which are the closest, we can deduce that in this case too the Lemma hods. 4. nb i (C) = 5. If u 3 is occupied, then as for the case in which nb i (C) = 4 with u 3 empty (robots not on u 3 have the same behavior), we can easily show that eventually u 1 , u 2 , u 4 and u 5 become occupied which makes the lemma hold. By contrast, if u 3 is empty then given an orientation of the ring, assume that r 1 ≤ r 2 ≤ r 3 ≤ r 4 ≤ r 5 holds where r ≤ r means that r is closer to u 3 than r with respect to the chosen orientation. If there is a unique robot which is the closest to u 3 , by procedure Align, this robot is the only one allowed to move. Its destination is its adjacent empty node towards u 3 taking the shortest path. By moving, the robot either joins u 3 or becomes even closer. In the later case, the same robot remains the only one allowed to move. That is eventually, u 3 becomes occupied. If there are more than one robot that is the closest to u 3 (by hypothesis, these two robots are r 1 and r 5 ), then procedure Align identifies some special configurations to deal with robots with possible outdated views (refer to Figures 8 and9): if all robots are part of a single 1.block with distance(r 1 , u 3 ) = distance(r 5 , u 3 ) then Align makes r 1 and r 5 moves on their -ring outside the 1.block they belong to. If the scheduler activates only one robot (say r 1 ) then in the reached configuration, by procedure Align, the robot that was supposed to move previously is the only one allowed to move. That is,a configuration in which both r 1 and r 5 have moved is eventually reached. Now, if dist(r 1 , r 2 ) = dist(r 5 , r 4 ) with r 2 and r 5 being on the same 1.block then by procedure Align, r 2 and r 4 are the only one allowed to move, their destination is their adjacent empty node toward respectively r 1 and r 5 . If only one of the two robots moves, in the reached configuration the robot that was supposed to move is the only one allowed to move. That is a configuration in which both r 2 and r 4 have moved is reached. For all the other cases in which distance(r 1 , u 3 ) = distance(r 5 , u 3 ), robot r 3 is used to break the symmetry. That is, if without loss of generality dist(r 1 , r 3 ) = dist(r 5 , r 3 ) then r 3 moves to one of its adjacent empty node on i . By contrast, if without loss of generality, dist(r 1 , r 3 ) < dist(r 5 , r 3 ), then r 1 is the one allowed to move. Its destination is its adjacent empty node on i taking the shortest path. By moving, r 1 either joins u 3 or becomes the only robot that is the closest to u 3 . Hence, eventually u 3 becomes occupied and we can deduce that the lemma holds.

From the cases above, we can deduce that starting from a configuration in which Align( i , k ) is called, an Aligned( i , k ) configuration is eventually reached. Hence the lemma holds.

Let us now focus on the correctness of the Preparation phase. Let | max |(C) be the number of maximal -rings in configuration C. Lemma 2. Let C be a rigid configuration in which | max | C > 1 and nb max (C) = . On each maximal -ring on C there exists at least one robot r such that if r moves to one of its adjacent occupied node on its current -ring, the configuration reached C , is rigid and

| max | C > | max | C .
Proof. We proceed by contradiction. Assume that for every robot r located on a maximal -ring in C, if r moves to its adjacent occupied node on its current -ring in C, then the configuration reached C is either symmetric or | max | C ≤ | max | C . Let r be one robot on a given max . When r moves to its adjacent occupied node on its current -ring that we denote m , since initially there is one robot on each node, nb m (C ) = -1. Since by assumption no other robot is allowed to move, | max | C > | max | C . Hence, we deduce that C is either symmetric or periodic. We first show the following claim: Claim 1. On each maximal -ring m , there exists at most one robot r such that if r moves to one of its adjacent nodes on , a periodic configuration is reached.

Proof of Claim 1. Assume by contradiction that the claim does not hold. That is, there exists at least 2 robots on each maximal -rings m such that if they move to their adjacent node on m , a periodic configuration is reached.

Let r be such a robot and let C be the periodic configuration reached. First, observe that when r moves, as there is a single empty node on m , there exists no sequence of L-rings L 0 , L 1 , L 2 , ...L k which is repeated at least twice. Since C is periodic, we can deduce that, instead, there exists a sequence of -rings 0 , 1 , . . . , k with k > 1 which is repeated t times with t > 1. Assume without loss of generality that i (0 ≤ i ≤ k) is the -ring in C that hosts r ( i = m ). Configuration C can be expressed as (p 0 , i , p 1 ) t where p 0 = 0 , 1 , . . . , i-1 and p 1 = i+1 , i+2 , . . . , k .

By assumption, there is another robot r on the same -ring as r such that if r moves to one of its adjacent node on its current -ring, a periodic configuration C is reached. Let us consider the case in which r moves. As for the previous case, we can deduce that there exists a sequence of -rings 0 , 1 , . . . , k with k > 1 which is repeated t times with t > 1. Assume without loss of generality that i is the -ring that hosts r ( i = m ). Recall that i = i . Since r is the only robot that has moved in C, configuration C can be expressed as (p 0 , i , p 1 ) t-1 (p 0 , i , p 1 ). That is, if C is periodic then r = r which is a contradiction.

We can now assume that each robot r = r on m when it moves, it creates a symmetric configuration. Let A be one of the axes of symmetry in C . We prove some properties of A Claim 2. A is horizontal to m .

Proof of Claim 2. Suppose by contradiction that A is perpendicular to m . Since contains a single empty node in C (the node that became empty once r moved), A must intersect with m on this empty node. Since C is symmetric, C is also symmetric. Contradiction. Claim 3. A does not lay on m .

Proof of Claim 3. Since r moved on on its adjacent node which is on the axes of symmetry in C then C was also symmetric. Contradiction. Proof of Claim 4. Let X and X be the axes of symmetry in respectively C and C such that X = X . By Claim 3, there exists another -ring m that is symmetric to m with respect to X and X . Since r and r are located on two different nodes in C, there are two empty nodes on m which is a contradiction.

Since we consider an asymmetric torus with L < , by Claims 3 and 4 we can deduce a contradiction. Thus the lemma holds.

From Lemma 2, we can deduce: Lemma 3. Starting from a rigid configuration C in which U nique(C) is false and nb max (C) = , a rigid configuration C with no outdated robots and in which U nique(C) is true is eventually reached. Moreover, for any i with i ∈ {1, 2, ..., } in C , if i hosts a multiplicity node then the following three conditions are verified: (1) nb i (C ) = -1, (2) the multiplicity node hosts exactly two robots and (3) the multiplicity node is at a border of a 1.block of size -1.

Lemma 4. Starting from a rigid configuration C in which |nb mac | C > 1 and nb max (C) < , by executing our algorithm, a rigid configuration C with no outdated robots and in which U nique(C ) is true is eventually reached. Moreover, for any i with i ∈ {1, 2, ..., } in C , i does not host a multiplicity node.

Proof. By our algorithm, the robot with the largest view in the set R(C) is supposed to move. As C is rigid and initially no node hosts a multiplicity, a unique robot is allowed to move. Let us first state and prove some important claims: Claim 1. Assume that r moves on its current -ring and its new position is not on the same L-ring as u. Then, the configuration C reached once r moves is rigid. Moreover r ∈ R(C ) and |R(C )| = 1.

Proof of Claim 1. Assume by contradiction that the claim does not hold. That is either C is symmetric or r is not the only closest robot to an empty node on -max in C . In both cases, this means that there is another robot r in C which was even closer to an empty node on -max. Contradiction. Claim 2. Assume that r moves outside its -ring but does not join a maximal -ring in C. Then, the configuration C reached once r moves is rigid. Moreover r ∈ R(C ) and |R(C )| = 1.

Proof of Claim 2. Assume by contradiction that the claim does not hold. That is either C is symmetric or r is not the closest robot to an empty node on -max in C . In both cases, this means that there is another robot r in C which was even closer to an empty node on -max. Contradiction.

By Claims 1 and 2, we know that as long as r does not join a maximal -ring or a node that is on the same L-ring as u (for the first time), the configuration reached remains rigid. Note that by moving r remains the only robot allowed to move as it becomes the only closest robot to an empty node on a maximal -ring. At some time, r has either to join an empty node in the same L-ring as u or join u. If the configuration remains rigid at each time then a rigid configuration C in which there is a unique maximal -ring is reached and the lemma holds.

Let us consider the case in which a symmetric configuration C can be reached when r moves to join either a node that is on the same L-ring as u or u . Recall that by our algorithm, r does not move in this case but C is computed by all robots to elect one robot to move in C.

Two cases are possible:

1. Robot r joins an empty node on the same L-ring as u for the first time. Note that in this case, the axes of symmetry in C lies on the L-ring containing r. Let d1 and d2 be the two 1.blocks that has u as a neighbor on -target. Since C is symmetric, the size of d1 is equal to the size of d2. By our algorithm, r , the robot which is on target-which is on the same L-ring as r in C is the one allowed to move. Its destination is u (Note that we are sure of the existence of such a robot since otherwise r will be supposed to move on its current L-ring instead of its current -ring). In the case where max (C) = -1, by moving, r does not create a symmetric configuration as there is at least another maximal -rings in C whose unique empty node is not on the same L-ring as r. In the other cases, assume by contradiction that when r moves, the configuration reached C is also symmetric. As previously stated, the axes of symmetry lies on the L-ring that contains r (otherwise C contains a robot which was closer to an empty node on a maximal -ring than r). Assume without loss of generality that r moved toward d1. Note that the size of d1 in C has increased by one while the size of d2 has decreased by one. That is, d1 and d2 cannot be symmetric which is a contradiction. We can thus conclude that the reached configuration once r moves is rigid. Robot r is now on the same L-ring as u. By Claim 2, we know that as long as r moves toward u without joining u, the configuration remains rigid. Once r becomes adjacent to u, if by joining u the configuration remains rigid then the lemma holds. Otherwise, we retrieve Case 2. 2. Robot r joins u. Let m and i be respectively the -ring that hosts u and r. Let k be the other -ring that is adjacent to m . If the reached configuration C is rigid then the lemma holds. Let us focus on the case in which C is symmetric. First assume that the axes of symmetry in C lies on the unique maximal -ring (i.e., it lies on m ). Note that since C is symmetric, on k there is no robot on the same L-ring as r in C. Since initially, U nique(C) is false, there are two -rings which were maximal in C and that are symmetric in C with respect to the unique maximal -ring m . Let us refer to such -rings by respectively s and s . In the following, in a given configuration, we say that i == i (for any i and i ) if given an orientation of the torus, the position of the occupied nodes in i is the exactly the same as in i . Note that s == s in C . We write i ! = i if i == i does not hold. If i == i then r == r holds if r has the same position on i as r on i . We now state some important observations. Since C is symmetric, we can deduce that the number of -rings r satisfying the following properties is odd in C: (i) r == m , (ii) if i and k are adjacent to r then without loss of generality i == i and k == k . Let R be the set of such -ring. For any -ring r ∈ R, their number is even in C. By our algorithm, using the rigidity of C, one robot on either s or s moves to its adjacent empty node on its current -ring. Assume without loss of generality that this robot was selected from s . Let us refer to the reached configuration after such a move by C . We first show by contradiction that C is rigid. Note that, because of s and s , we are sure that there is no axes of symmetry that is perpendicular to m in C and in addition, m cannot be an axes of symmetry in C . That is, the axes of symmetry in C lies on another -ring that we denote by axes . First assume that, for any -ring r in C, axes == r does not hold. That is, the number of -ring r ∈ R remains odd in C . This means that C is rigid. A contradiction. Next, assume that for any -ring r ∈ R, axes ! = r but there exists an -ring r in C such that r == axes . As the number of such -rings was even in C, their number becomes odd in C . Similarly to the previous case, the number of -ring R remains also odd. Hence, C is rigid. A contradiction. Lastly, assume that for an -ring r ∈ R r == axes . Let i and k be the two -rings adjacent to axes . Assume without loss of generality that i == i . Let r be the robot on i such that r == r. As C is symmetric and axes is on the axes of symmetry, the node that is on k which is on the same L-ring as r is occupied. A contradiction. We can thus deduce that C is rigid.

Observe that, in the new configuration C , another robot might become the closest to an empty node on a maximal -ring with a the largest view, if by moving, the configuration is rigid then the robot can move, otherwise, we are sure that there is at least one robot in R(C ) which is r that can move and join u without reaching a symmetric configuration (recall that the priority is to choose a robot that keeps the configuration rigid). Now, assume by contrast that the axes of symmetry is perpendicular to the unique maximal -ring in C . The axes of symmetry in this case cannot be on the same L-ring as u otherwise C is also symmetric. Since C is symmetric then each -ring in the configuration, except maybe for target-and the -ring hosting r, has at least one axes of symmetry in C (considering the -rings individually). Moreover, they all share at least one axes of symmetry. By our algorithm, if there is an -ring in T (C) (the set of all none empty -rings except for target-) that does not contain exactly two 1.blocks at distance 2 from each other from each side then using the rigidity of C, one robot on such an -ring is elected to move. The elected robot has to be the closest to the largest 1.block on its current -ring. By r and , let us refer to respectively the elected robot to move and its current -ring in C. If by moving, r does not join the biggest 1.block then r is the only closest robot to a largest 1.block and hence does not contain any axes of symmetry. That is, the reached configuration is rigid. Moreover, r can join u without reaching a symmetric configuration. By contrast, if r joins the largest 1.block, we show in the following that C cannot be symmetric. Assume by contradiction, that C , is symmetric. Two cases are possible: (a) the 1.block that r joined is on the axes of symmetry in C . In this case, let d1 and d2 be two 1.blocks of C that are symmetric with respect to the axes of symmetry in C and which are the closest to it. In this case, r was part either of d1 or d2 in C. Assume without loss of generality that r was part of d1. Recall that by our algorithm, the size of d1 is less or equal to the size of d2. When r moves, the size of d1 has decreased by one while the size of d2 did not change. That is, there is no axes of symmetry in (recall that the unique largest 1.block has to be on the axes of symmetry). Contradiction. (b) Otherwise. Let B be the size of the largest 1.block in C. By our algorithm, the robot r to move is the one that is in the smallest This means that the size of this block is smaller then the size of Block in C. Hence r was not enabled to move. Contradiction. Now, let us consider the case in which the size of Block is equal to 1 in C (r is an isolated robot). When r moves, as C is supposed to be symmetric, the number of 1.blocks of size B with an isolated robot at distance 2 is odd. Hence the configuration is rigid. Contradiction. Finally, if all -rings in T (C) contains only two 1.blocks separated by exactly one empty node on each side then they either share exactly one axes of symmetry or all the axes (Observe that the axes of symmetry either crosses an -ring on an empty node or in the middle of a 1.block. By our algorithm, using the rigidity of C, one robot at the border of the smallest 1.block moves outside the 1.block it belongs to. By doing so, it joins the largest 1.block creating a new axes of symmetry which not shared by the other -ring in T (C). Thus the configuration that is reached is rigid. moreover, when r moves to join u, the configuration remains rigid.

From the cases above, we can deduce that the lemma holds.

From Lemmas 3 and 4 we can deduce the following Corollaries : Corollary 1. Starting from a rigid configuration C in which U nique(C) is false, a rigid configuration C in which U nique(C ) is true, is eventually reached.

Corollary 2. Let C be the first configuration in which Unique(C) is true. Then, for any i with i ∈ {1, 2, ..., }, there is at most one multiplicity node. Moreover, if i hosts a multiplicity node then the three following conditions hold: (1) nb i (C ) = -1, (2) the multiplicity node hosts exactly two robots and (3) the multiplicity node is at a border of a 1.block of size -1.

We now focus on configurations C ∈ C p1 in which U nique(C) is true and show that eventually a configuration C ∈ C p2 is reached. Lemma 5. Let C ∈ C U ndef ined be a rigid configuration in which the following conditions hold:

-C does not contain outdated robots nb i (C) < nb k (C) -Γ (C) is either rigid or contains a single axes of symmetry From C, a configuration C ∈ C oriented with no outdated robots is eventually reached.

Proof. From corollary 1, we know that C do not contain an outdated robot. We consider the following cases:

1. Γ (C) is rigid. As by our algorithm, no robot on an -ring r = i moves, Γ (C) remains rigid. That is, a unique node on i can be uniquely identified. Let us refer to such a node by u. By our algorithm, robots on i which are the closest to u are the ones to move. their destination is their adjacent empty node on their current -ring toward u. As the robots join u one by one, the number of robots on i decreases to eventually be equal to 1. That is, eventually a configuration C in which nb i (C ) = 1 is reached. Observe that once the robots join u they are not allowed to move anymore. That is in C there are no outdated robots. Hence the lemma holds in this case. 2. Γ (C) is symmetric. First note that by definition, whatever the position of the robots on i , Γ (C) remains symmetric with the same axes of symmetry. Depending on how the axes of symmetry crosses i , we consider the following cases: (a) The axes of symmetry of Γ (C) crosses i on a single node (Γ (C) is node-edge symmetric). Let us refer to this node by u. By our algorithm, u is identified as a target node for all robots on i . The closest ones first move to join u taking the empty path. That is, eventually all robots join u and a configuration C in which which nb i (C ) = 1 is reached. (b) The axes of symmetry crosses i on two nodes (Γ (C) is node-node symmetric). Let us refer to these nodes by u and u respectively. By our algorithm, using the rigidity of C, one robot on either u or u is elected to move. It destination is its adjacent node on its current -ring. Since nb i (C) < nb k (C), we are sure that neither u nor u contains a tower (recall that a tower is only created to reduce the number of maximal -rings when each of their nodes is occupied). As for case in which the axes of symmetry crosses a single node on i , a configuration C in which nb i (C ) = 1 is reached. (c) The axes of symmetry crosses i on edges (Γ (C) is edge-edge symmetric). Assume without loss of generality that the axes of symmetry crosses i on the edges e 1 = (u 1 , u 2 ) and e 2 = (u 3 , u 4 ) and that u 1 and u 3 are on the same side of the axes of symmetry. Let U = {u j , j ∈ {1, . . . , 4}}.

The following cases are distinguished by our algorithm: i. ∀u ∈ U , u is occupied. By our algorithm, using the rigidity of C, one of these nodes is elected. Assume without loss of generality that u 1 is elected. Robots on u 1 are the ones to move. their destination is u 2 . Note that if u 1 hosts more than one robot and that the scheduler activates only a subset of robots then robots on u 1 remain the only ones allowed to move. That is, eventually, u 1 becomes empty and no robot has an outdated view. Also, thanks to both i and max , the configuration reached is rigid. We retrieve the case 2(c)ii. ii. Three nodes of U are occupied. Assume without loss of generality that u 1 is empty. By our algorithm, robots on i which are on on the side of u 3 and u 1 and are the closest to u 3 are the ones allowed to move. Their destination is their adjacent node toward u 3 taking the shortest path. As long as there are robots between u 3 and u 1 , these robots are the only one allowed to move. That is, eventually, the side between u 3 and u 1 becomes empty. Once such a configuration is reached, by our algorithm, robots on u 2 are now the ones allowed to move. Their destination is their adjacent node in the opposite direction of u 1 . Observe that as long as u 2 is occupied, robots on u 2 remain the only ones allowed to move. That is, eventually, u 2 becomes empty and we retrieve Case 2(c)iii with a rigid configuration (there is at least one occupied node on the side of u 4 and u 2 and no robots on the other side) in which u 3 and u 4 are occupied. We retrieve Case 2(c)iii. iii. Two nodes of U are occupied. Several scenarios are considered depending on the nodes that are occupied: first (i) assume without loss of generality that u 1 and u 2 are occupied (the case in which the two nodes are neighbors). By our algorithm, if there is no other occupied node on i then using the rigidity of C, a node of U is elected. Assume without loss of generality that this node is u 1 . Robots on u 1 are the ones allowed to move. Their destination is u 2 . Note that as long as there are robots on u 1 , robots on u 1 remain the only ones allowed to move. That is, eventually, u 1 becomes empty. Thanks to i , we can deduce that the configuration reached is rigid. That is, we retrieve Case 2(c)iv. By contrast, if all robots which are not on a node of U are on the same side of the axes of symmetry of Γ (C) (assume without loss of generality that they are on the same side as u 1 ) then, robots on u 2 are the ones allowed to move. Their destination is u 1 . Observe that as long as there are robots on u 2 , these robots are the only ones allowed to move. That is, eventually u 2 becomes empty and no robot has an outdated view. Observe that since robots are on only one side of the axes of symmetry of Γ (C) the configuration reached is rigid. Thus, we retrieve Case 2(c)iv. By contrast, if robots are on both sides of the axes of symmetry then, by our algorithm, one robot remains idle to play the role of a landmark. This robot is the one that is on i which the farthest from the an occupied node of U being on the same side of the axes of symmetry of Γ (C). That is, if there are two robots that are the farthest to an occupied node of U (there is one robot on each side) then, since C is rigid, one robot is elected to move. It destination is its adjacent node towards the occupied node of U being on the same side. By doing so, a configuration in which there is only one occupied node, u, which is the farthest from the occupied node of U is reached. This robot (occupied node) is the landmark. Assume without loss of generality that u is on the same side as u 1 . By our algorithm, robots that are on the opposite side of u 1 which are the closest to u 2 moves on their current -ring to join u 2 . As robots join u one by one, eventually, a configuration in which robots occupy only one side of the axes of symmetry is reached. This case was discussed earlier. Hence, we can deduce that we retrieve Case 2(c)iv. Next, (ii) let us now consider the case in which u 1 and u 3 are occupied (the case in which the two nodes of u are on the same side of the axes of symmetry). By our algorithm, robots on the node of U with the largest view are the ones allowed to move. Since C is rigid, robots on exactly one node of U are elected to move. Assume without loss of generality that robots on u 1 are the ones allowed to move. Their destination is their adjacent node in the opposite direction of u 2 . Observe that as long as u 1 is occupied, robots on u 1 are the only ones allowed to move. That is, eventually, u 1 becomes empty and no robot has an outdated view. We thus, retrieve Case 2(c)iv. Finally, (iii) assume without loss of generality that u 1 and u 4 are occupied (the case when the two nodes of U are not neighbors and at different sides of the axes of symmetry of Γ (C). By our algorithm, robots with the largest view on either u 1 or u 4 are allowed to move. Their destination is their adjacent node on i which is not in the set U . Assume without loss of generality that robots on u 1 are the ones that are elected. Note that as long as u 1 is occupied, robots on u 1 remain the only ones to move. That is, eventually u 1 becomes empty. Thanks to i the reached configuration is rigid. Thus, we retrieve Case 2(c)iv. iv. Exactly one node of U are occupied. Assume without loss of generality that u 1 is the node of U which is occupied. By our algorithm, if all robots on i are on the same side as u 1 , then the closest robots on i to u 1 moves to their adjacent node on their current -ring towards u 1 . That is eventually, all robots on i join u 1 and no robot has an outdated view. Hence, a configuration C ∈ C oriented is eventually reached. By contrast, if all robots on i are on the opposite side of u 1 then by our algorithm robots on u 1 are the ones to move. Their destination is their adjacent node of U . That is either we remain in Case 2(c)iv with u 2 the only node of U which is occupied and all robots on i being on the same side as u 2 or a configuration in which there are exactly two nodes of U (u 1 and u 2 ) which are occupied and neighbors. Note that in the later case, robots on u 1 remain the only ones allowed to move as there is no robot on the same side as u 1 . Their destination remains also the same (they move toward u 2 ). Hence we can deduce that a configuration C ∈ C oriented is eventually reached. Finally, if there are robots on both sides of the axes of symmetry of Γ (C) then by our algorithm, robots that are on the same side as u 1 which are the closest to u 1 are the ones allowed to move. Their destination is their adjacent node on their current -ring towards u 1 . That is eventually, the side of u 1 becomes empty and as discussed previously a configuration in which all robots on i join the same node of U is eventually reached. v. ∀u ∈ U , u is empty. By our algorithm, the closest robot on i to a node of U being on the same side of the axes of symmetry is the one allowed to move. Its destination is its adjacent node toward a node of U . In the case in which there are more than one such robot, as C is rigid, robots on exactly one node are elected to move. that is, we retrieve Case 2(c)iv. From the case above, we can deduce that eventually, all robots on i gather on a unique node of U . Moreover, no robot has an outdated view as they have all moved and once they are on the same node, they are no more allowed to move. Hence, a configuration C ∈ C oriented with no outdated robots is eventually reached and the lemma holds. Lemma 6. Let C ∈ C U ndef ined be a rigid configuration in which the following conditions hold:

-C has no outdated robots.

-nb i (C) = nb k (C).
-Γ (C) is either rigid or contains a single axes of symmetry.

From C, a configuration C ∈ C oriented with no outdated robots is eventually reached.

Proof. By Corollary 2, we know that an -ring can host a multiplicity in C only if nb (C) = -1. Moreover, the multiplicity is adjacent to an empty node in . That is, whenever nb (C) < -1, we are sure that each node of hosts one robot. Hence, by moving, no new maximal -ring is created. Depending on Γ (C), robots behavior is different. Our algorithm distinguish the following cases:

1. Γ (C) is rigid. Using the rigidity of Γ (C), a unique node, u is selected from either i or k . Assume without loss of generality that the selected node u is on i . Note that since C does not contain any outdated robots and since no robot of Γ (C) is allowed to move, u keeps being identified. By our algorithm, two cases are possible: (i) u is empty and nb i (C) = -1 and (ii) all the other cases. In case (i), by our algorithm, the robot r on i that is adjacent to u which is not part of a multiplicity moves to u. By Corollary 2, we are sure that such a robot exists. By moving u becomes occupied. Note that since r was note part of a multiplicity, by moving no new maximal -ring is created. That is, we retrieve Case (ii). In case (ii), by our algorithms, robots on i move to join the selected node starting from the closest ones. That is, eventually, one robot will join u and a configuration C in which nb i (C ) < nb k (C ) is reached. Robots on u are not allowed to move anymore. If C is rigid and does not contain outdated robots then by Lemma 5, we can deduce that the lemma holds. Otherwise, as u is identified in a unique manner, the target node of the robots on i remains node u. That is eventually, all robots on i join u and the lemma holds in this case. 2. Γ (C) is node-edge symmetric. Let u (respectively u ) be the node on i (respectively k ) which is on the axes of symmetry of Γ (C). Assume without loss of generality that u is occupied while u is empty. By our algorithm, the robot that is on i which is the closest to u is the one allowed to move. If there are more than one robot, using the rigidity of C only one robot is elected to move. By moving, either it becomes the only closest robot to u or it joins u. In the first case, by our algorithm the robot that has moved remains the only one allowed to move. Its destination is its adjacent empty node toward u. That is eventually it joins u. As there is only one robot that was allowed to move. When the robot joins u, the configuration does not contain any outdated robot. In the reached configuration C , nb i (C ) < nb k (C ) holds. By our algorithm, robots on u are not allowed to move anymore. That is, if C is rigid then by Lemma 5 we can deduce that the lemma holds. By contrast if C is symmetric, then as no robot moved from Γ (C), the only possible axes of symmetry in C is the one that lies on the axes of Γ (C). By our algorithm, in this case, robots on i move to join u taking the shortest path and starting from the closest robots. That is, eventually, all robots on i are located on u. A configuration C ∈ C oriented is reached. As robots are not allowed to move anymore once on u, C does not contain outdated robots. Hence, the lemma holds. Now assume that both u and u are occupied. Let R i (respectively R k ) be the closest robot to u (respectively u ) on i (respectively k ). By our algorithm, since C is rigid, exactly one robot is selected from either R i or R k . Assume without loss of generality that the selected robot is in R i . This robot is the one allowed to move. Its destination is its adjacent empty on its current -ring toward u. By moving, the robot either joins u and we retrieve the case in which nb i (C ) < nb k (C ) discussed earlier or the robot remains the only closest robot to u and hence it is the only one allowed to move. That is, eventually, the robot joins u and we can deduce that the lemma holds. Finally, assume that both u and u are empty. Observe that in this case nb i (C) = -1 (otherwise C is symmetric and not rigid). That is, by Corollary 2 neither i nor k contain a multiplicity. Let R i (respectively R k ) be the closest robot to u (respectively u ) on i (respectively k ). By our algorithm, since C is rigid, exactly one robot is selected from either R i or R k . Assume without loss of generality that the selected robot is in R i . This robot is the one allowed to move. Its destination is its adjacent empty node toward u. By moving, the robot either joins u or it becomes the only robot allowed to move (as it is the only closest robot to u). That is eventually, the robot joins u. If the reached configuration is rigid then we retrieve the previous discussed case.

Otherwise, thanks to the unique max , both i and k can still be identify, the same for u as no robot from Γ (C) has moved. By our algorithm, the closest robots to u on i are the ones allowed to move, their destination is their adjacent node towards u. That is, all robots eventually move to join u. Since they are no more allowed to move, we can deduce that the lemma holds in this case. 3. Γ (C) is node-node symmetric. Let u i and u i (respectively u k and u k ) be the two nodes on i (respectively k ) on which the axes of symmetry of Γ (C) passes through. We consider the following two cases: (a) ∀u ∈ {u i , u i , u k , u k }, u is occupied. Let U ⊆ {u i , u i , u k , u k } be the set of nodes that have an occupied adjacent node on their -ring. By our algorithm, if |U | ≥ 1 then by our algorithm, using the rigidity of C a single node in U is elected. Assume without loss of generality that this node is u i . Robots on u i are the ones allowed to move. Their destination is their adjacent occupied node on their -ring. Observe that if u i hosts a multiplicity then by Corollary 2, there are only 2 robots part of the multiplicity. If the scheduler activates only one robot, as the destination node is occupied, the robot on u i that were supposed to move remains the only one allowed to move. Its destination remains the same. That is, by moving, we reach a configuration in which ∃u ∈ {u i , u i , u k , u k } such that u is empty. We retrieve Case 3b. By contrast, if |U | = 0, by our algorithm, using the rigidity of C, one node of u ∈ {u i , u i , u k , u k } is elected. The robot on u node moves to one of its adjacent occupied node (the scheduler chooses the direction to take). Assume without loss of generality that u = u i . From Corollary 2, we are sure that u does not contain a multiplicity (A multiplicity exists only in the case where nb i (C) = -1). By moving, u i becomes empty and we retrieve Case 3b. (b) ∃u ∈ {u i , u i , u k , u k } such that u is empty. If there is a unique node u ∈ {u i , u i , u k , u k } which is occupied then the closest robot to u on the same -ring as u moves to their adjacent empty node toward u. Assume without loss of generality that u = u i . Once one robot joins u i , a configuration C ∈ C U ndef ined with nb i (C ) < b k (C ) and no outdated robots is reached. By contrast, let us consider now the case in which there are three node in {u i , u i , u k , u k } which are occupied. Assume without loss of generality that u i is the empty node. By our algorithm, robots on i which are the closest to u i are the only one allowed to move. By moving they keep being the closest ones. That is eventually, one robot on i joins u i , a configuration C ∈ C U ndef ined with nb i (C ) < b k (C ) is then reached. Finally, if there are two nodes of {u i , u i , u k , u k } which are occupied then first note that nb i (C) < -1 (otherwise three nodes of the set {u i , u i , u k , u k } should have been occupied). That is, by Corollary 2, neither i nor k contain a multiplicity. If the two occupied nodes of {u i , u i , u k , u k } are part of the same -ring (assume without loss of generality that these two nodes are u i and u i ) then by our algorithm, using the rigidity of C one node among u i and u i is elected. The robot on the elected node is the one allowed to move. Its destination is its adjacent node on its current -ring. By moving a configuration C in which nb i (C ) < b k (C ) is reached. By contrast, if the two occupied nodes are on two different -rings then let R(C) be the set of robots on i and k which are the closest to the occupied node of {u i , u i , u k , u k } on their -ring. One robot from R(C) is elected to move. Its destination is its adjacent node on its current -ring toward the closest occupied node of {u i , u i , u k , u k } which is on its -ring. By moving it either Proof. Recall that when C ∈ C Semi-Oriented , nb i (C) = nb k (C) = 1 where i and k are the two -rings that are adjacent to max . Let ni and n k be the two -rings that are neighbors of respectively i and k . In the case where i = n k and hence k = ni (the configuration contains only three occupied -rings) then by our algorithm, using the rigidity of C one robot on either k or i is elected to move. Its destination is its adjacent empty node in the opposite direction of max . Once the robot moves, a configuration C ∈ C p2 is eventually reached. By contrast, if i = n k and hence k = ni then using the rigidity of C, one of the closest robot to either i or k is elected to move. Its destination is its adjacent empty node towards the closest node to either i or k . Note that once the robot moves, it is the only one allowed to move as it is the closest one. That is a configuration C ∈ C Oriented is reached. Note also that since at each time only one robot is allowed to move, C does not contain outdated robots.

By Corollary 4 and Lemma 12, we can deduce the following: We now show that starting from a configuration C ∈ C p2 with no outdated robots and a potential one multiplicity node on max which is on the same L-ring as v target , the gathering is eventually achieved.

We now show that starting from a configuration in either C pr or C ls , a configuration in C sp is eventually reached.

Lemma 13. Starting from C ∈ C pr with no outdated robots, a configuration C ∈ C ls with no outdated robots is eventually reached.

Proof. Recall that for any C ∈ C pr , C ∈ C target holds. Let i be the -ring adjacent to target such that i = max . We distinguish two cases:

1. nb i (C) > 0 . Recall that in some cases during the preparation phase, to reduce the number of maximal -rings, a single tower of size 2 is created in some -rings that were maximal in the initial configuration (the case in which the number of occupied nodes on each max is equal to ). Robots need to move carefully so that the number of -rings that are maximal never increases again. Hence, in the proposed solution, depending on the number of robots on i , robots behave differently. Let R i be the set of robots on i and let R m ⊆ R i be the set of robots that are the closest to v target . We refer by u to the node on i which is adjacent to v target . The following sub-cases are possible: (a) u is occupied. With respect to the algorithm, robots on u move to join v target . Observe that as long as there are robots on u, these robots remain the only ones that are allowed to move. Since the scheduler is weakly fair, eventually, u becomes empty, R i decreases and we retrieve Case 1b. (b) u is empty. With respect to the proposed solution, if nb i (C) < -1, robots in R m are allowed to move, their destination is their adjacent empty node on i toward u taking the shorted path. That is, at least one robot on i eventually joins u and we retrieve Case 1a (Observe that in this case, there are no towers on i ). By contrast, if nb i (C) = -1 then by Lemma 2, i can hosts at most one multiplicity node. That is, there is at least one robot in R m which is not part of a multiplicity node. According to the algorithm, this robot is the one allowed to move, its destination is its adjacent empty node on i toward u taking the shortest path. By moving, we retrieve eventually Case 1a. According to the algorithm, as long as nb i (C) > 0, no robot other than those which are on i are allowed to move. That is, R i never increases. On another hand, at each time Case 1a occurs, R i decreases. From Cases 1a and 1b, we can deduce that a configuration C in which nb i (C ) = 0 is eventually reached. We then retrieve Case 2. 2. nb i (C) = 0. Let k be the neighboring -ring of target with respect to direction → (from target to max taking the shortest path). Let R m be the set of robots on k that are the closest to v target with respect to →. From the proposed algorithm, robots on R m are the ones allowed to move, their destination is their adjacent node outside k and toward target with respect to →. Let us refer to the -ring to which the robots have moved by k-1 . Note that k-1 is empty in C (By definition of neighboring -ring). Once the scheduler activates at least one robot from R m in C, a configuration C in which 1 <= nb k-1 (C ) <= 2 is eventually reached. Since no other robots on k is allowed to move, by induction, we can show that at least one robot from the robots that moved from k eventually reaches i . Thus, we retrieve Case 1.

From the cases above, we can deduce that robots on an -ring different from max and target keep getting closer to v target to eventually join it. Once they join v target they are not allowed to move anymore. Hence, we can deduce that the lemma eventually holds. Lemma 14. Starting from a configuration C ∈ C ls in which nb target (C) = 1, a configuration C ∈ C sp-3 or C ∈ C sp-2 is eventually reached. Moreover, the only multiplicity node on max is the one that is adjacent to v target .

Proof. From Theorem 1, we know that when the second phase starts, no robot has an outdated view. On another hand, by Lemma 10, if nb max (C) = 4 then no robot on max contains a multiplicity node. That is, by Lemma 1, we can deduce that a configuration C ∈ C sp-3 or C ∈ C sp-2 is eventually reached and no multiplicity node exists on max . By contrast, if nb max (C) = 4 then by Lemmas 1 and Lemma 13 max contains no outdated robots and a most one multiplicity node. This multiplicity node (if it exists) is the one that is adjacent to v target .

Let R be the set of robots on max which are the closest to u 3 . By our algorithm. If |R| = 2 then both robots of R are allowed to move. Their destination is their adjacent node toward u 3 . If only one of the two robots move then by our algorithm the robot that was supposed to move is the only one allowed to move (the robot that is at distance d+1 from u 3 or the robot that is adjacent to u 3 ). That is a configuration C in which both robots of R have moved is eventually reached. Note that in C , either nb max (C) = nb max (C ) (robots do not join u 3 ) or nb max (C) = nb max (C ) + 1 (both robots join u 3 ). In the first case, robots in R remain the only one allowed to move. That is eventually they join node u 3 . In the later case, if nb max (C ) > 5 then by our algorithm, robots on u 3 are the ones allowed to move. That is, eventually u 3 becomes empty in the configuration reached C , nb max (C) = nb max (C ) + 2. By

3 Fig. 2 .

 32 Fig. 2. Instance of two adjacent/ neighboring -rings

v i target node when occupied v i target node when empty ` secondary Fig. 3 .

 secondary3 Fig. 3. Three instances of Ctarget configurations

Fig. 10 .

 10 Fig.10. On the left, r is suppose to move but by moving, it creates a symmetric configuration C shown in the middle. The robot on target-on the same L-ring as r moves to u.

  u 3 (refer to Figure (refer to Figure 11, (B)). By contrast, if there are no robots on i which are on the same side of u 1 and u 3 then robots on u 2 are the ones allowed to move. Their destination is their adjacent node in the opposite direction of u 1 (refer to Figure11, (C)).

Fig. 11 .

 11 Fig. 11. Γ (C) is edge-edge symmetric -Part 1

Fig. 12 .

 12 Fig. 12. Γ (C) is edge-edge symmetric -Part 2

  Three cases are possible on each -ring of L depending on the nodes of U that are occupied: Case(I) the two nodes are neighbors, Case(II) the two nodes are on the same side of Γ (C)'s axes of symmetry. Case(III) the two nodes are not neighbors and are on different sides of Γ (C)'s axes of symmetry. We set: Case(I) > Case(II) > Case(III) where Case(a) > Case(b) means that Case(a) has a higher priority than Case(b).

Fig. 13 .

 13 Fig. 13. Subsets Csp-1 and Csp-2

C sp- 3 C sp- 3 C sp- 4 C sp- 4 Fig. 14 .

 334414 Fig. 14. Subsets Csp-3 and Csp-4

2 .

 2 Set C pr : C ∈ C pr if C ∈ C target and P artial(C) is true. That is, ∃ i ∈ {1, . . . , L} such that i = max and i = target and nb i (C) > 0. Note that we are sure that C ∈ C sp . 3. Set C ls : C ∈ C ls if C ∈ C target and C ∈ C sp and Empty(C). In other words, there are only two -rings that are occupied: max and target .

Claim 4 .

 4 Let r = r be another robot on m in C. If r moves to its adjacent occupied node on m in C then if C is the configuration reached once r moves and if C is symmetric then the axes of symmetry in C are different from the axes of symmetry in C .

Corollary 5 .Theorem 1 .

 51 Starting from a configuration C ∈ C Semi-Oriented , a configuration C ∈ C p2 with no outdated robots is eventually reached. Starting from any rigid configuration C ∈ C p1 with no outdated robots, a configuration C ∈ C p2 with no outdated robots is eventually reached. Moreover, max contains at most one multiplicity node. This node is the one hat is on the same L-ring as v target .Proof. Derived from Corollaries 1, 3, 4 and 5 and Lemma 8.

Figure 15 summarizesFig. 15 .

 1515 Figure 15 summarizes the transitions within Preparation phase configurations.

  Empty if without loss of generality nb i (C) = 0 and nb k (C) > 1. 3. Set C Oriented : C ∈ C Oriented if without loss of generality nb i (C) = 1 and nb k (C) > 1. Set C Oriented includes: (a) C Oriented-1 . In this case either (i) nb k (C) = 3 and k contains a 1.block of size 3 whose middle robot is on the same L-ring as the unique occupied node on i . (ii) nb k (C) = 2 and k contains a 2.block. Moreover, the unique empty node in the 2.block is on the same L-ring as the unique robot on i . (b) C Oriented-2 . Contains all the configuration in

  1.block in C which is the closest to a 1.block of size B. When r moves, if r do not join a 1.block of size B then r is the only robot that is the closest to a 1.block of size B and hence the configuration reached is rigid. By contrast, if r joins a 1.block of size B then in the configuration reached C , there is a unique largest 1.block on . Its size is B + 1. By Biggest (respectively Block ) the largest 1.block in C (respectively to 1.block to which r belonged in C). If Block contained more than one robot in C then Block still exists in C and its size decreased by one. As by assumption C is also symmetry, Biggest is on the axes of symmetry. That is, Block is symmetric to another 1.block which shares a hole with Biggest.

joins the node or becomes the unique closest robot. In the latter case, the robot remains the only one allowed to move. That is eventually, a configuration C ∈ C U ndef ined with nb i (C ) < b k (C ) is eventually reached. Once a configuration C ∈ C U ndef ined in which nb i (C ) < b k (C ) is reached then if C is rigid then by Lemma 5 we can deduce that the lemma holds. By contrast, if C is symmetric then the axes of symmetry of C lies on the axis of symmetry of Γ (C). By our algorithm, the robots on i which are the closest to u i are the ones allowed to move. Their destination is their adjacent empty node on their current -ring. That is, eventually all robots on i joins u i . A configuration C ∈ C oriented is then reached. As robot on u i are not allowed to move we can deduce that the lemma holds. [START_REF] Cicerone | Asynchronous robots on graphs: Gathering[END_REF]. Γ (C) is edge-edge symmetric. Assume without loss of generality that:

the axes of symmetry of Γ (C) passes through respectively e 1 = (u 1 , u 2 ) and e 2 = (u 3 , u 4 ) on i and e 1 = (u 1 , u 2 ) and e 2 = (u 3 , u 4 ) on k . nodes u 1 and u 3 (respectively u 1 and u 3 ) are the same side of the axes of symmetry on i (respectively k ). Let L = { i , k }, U i = {u 1 , u 2 , u 3 , u 4 }, U k = {u 1 , u 2 , u 3 , u 4 } and U = U i ∪ U k . By our algorithm, a single -ring is selected and robots that are on the selected -ring behave exactly in the same manner as in the case in which nb i (C) = nb k (C). To determine which -ring to select, robots check if a given number of properties are verified in a given order: (a) There exists an -ring in L, let this -ring be, without loss of generality i , in which |U i | = 2 with the two nodes of U i being neighbors to reach other and F ree(u 1 , u 3 ) ∧ F ree(u 1 , u 3 ) holds. As C is rigid and Γ (C) is symmetric, we are sure that if |U | k = 2, the the two nodes of U k cannot be neighbors (Otherwise C is symmetric). By our algorithm, i is the one that is selected. The robot to move is the one that is on an occupied node of U i with the largest view. Its destination is adjacent occupied node. That is, the robot moves to an occupied node of U i . By moving, a configuration C in which nb i (C ) = 1 is reached. As no other robot is allowed to move and since all robots that were allowed to move have moved, we can deduce deduce that there are no outdated robots. Hence, we can deduce that the lemma holds. (b) There exists an -ring in L, let this -ring be without loss of generality i in which |U i | = 1 (Assume that u 1 is the occupied node of U i ), F ree(u 2 , u 4 ) ∧ ¬F ree(u 1 , u 3 ) holds. If k does not satisfy the same properties then i is the one that is selected. The robot to move is the one that is on i which the closest to u 1 . Note that since nb i (C) = -1, by Corollary 2, we are sure that the robot to move is not part of a multiplicity. That is, by moving, it either joins u 1 or becomes the only robot that is the closest to u 1 . In the latter case, this robot remains the only one a allowed to move. Its destination is its adjacent node toward u 1 . Hence, eventually it joins u 1 . By joining u 1 , a configuration C in which nb i (C ) < nb k (C ). Since there is no other robot that was allowed to move, in C , we are sure that there is no robot with an outdated view. If nb i (C ) = 1 then the lemma holds. By contrast, if nb i (C ) > 1 then, since Γ (C) = Γ (C ) and there are robots only on one side of Γ (C )'s axes of symmetry, C is rigid. Moreover, robots on u 1 are not allowed to move anymore, the robots that are on i which are the closest to u 1 are the ones to move. Their destination is their adjacent node on their -ring toward u 1 . That is, eventually all robots on i joins u 1 . Thus, lemma holds. Now assume that k verify the same properties as i . That is, |U k | = 1 (Assume without loss of generality that u 1 is the occupied node of U k ), F ree(u 2 , u 4 ) ∧ ¬F ree(u 1 , u 3 ). In this case, by our algorithm, the selection is done with respect to distance of a robot to the occupied node of U located on its -ring. More precisely, let d i (respectively d k ) be the smallest distance between a robot on i (respectively k ) from u 1 (respectively u 1 ). Assume without loss of generality that d i < d k . In this case, the robot on i which is the closest to u 1 is the one allowed to move (let us refer to this robot by r). The destination of r is its adjacent node on its -ring toward u 1 . By moving, r either joins u 1 or becomes the only closest robot to u 1 . That is, in the configuration reached d i remains smaller than d k and hence i keeps being the only -ring to be selected. Note this holds until r joins u 1 . When r joins u 1 as discussed previously, we can deduce that the lemma holds. Finally, in the case in which d i = d k then the -ring that hosts a robot which is at distance d i from the occupied node of U being on its current -ring, with the largest view is the one which is selected. Note that this is possible as C is rigid. By moving, the robot either joins the occupied node of U or becomes the only closest robot to an occupied node of U which has been already discussed. Thus, We can deduce that the Lemma holds. (c) Next, there exists an -ring in L, let this -ring be without loss of generality i in which

and the two occupied nodes of U i are neighbors (let these two nodes be respectively u 1 and u 2 ), F ree(u 1 , u 3 ) ∨ F ree(u 2 , u 4 ) holds. Note that both F ree(u 1 , u 3 ) ∧ F ree(u 2 , u 4 ) does not hold otherwise we are in Case 4a. By our algorithm, if k does not satisfy the same properties then, i is selected. Otherwise, let the two occupied nodes of U k be respectively u 1 and u 2 and let r and r be the robots located on respectively u 2 and u 2 . By our algorithm, view r (t)(1) < view r (t)(1) then i is selected. Otherwise k is selected (Recall that since C is rigid, we are sure that view r (t)(1) = view r (t)(1)). Assume without loss of generality that i is selected. By our algorithm, if F ree(u 1 , u 3 ) holds then the robot on u 1 is the one to move. Its destination is u 2 . By contrast, if F ree(u 2 , u 4 ), then the robot on u 2 is the the one allowed to move. Its destination is u 1 . By moving, u 2 becomes empty. As u 1 was occupied, in the configuration reached C , nb i (C ) < nb k (C). Moreover, as there is one side of i which is occupied, we are sure that the configuration reached C is rigid. Robots on u 1 are no more allowed to move as robots being on the same side as u 1 are the ones that move, starting from the ones that are the closest to u 1 , toward u 1 . That is, eventually, all robots on i join u 1 and we can deduce that the lemma holds. (d) There exists an -ring in L, let this -ring be, without loss of generality i , in which

and the two occupied nodes of U i are on the same side of Γ (C)'s axes of symmetry (let these robots be respectively u 1 and u 3 ), F ree(u 2 , u 4 ) and ¬F ree(u 1 , u 3 ). By our algorithm, if k does not satisfy the same properties then, i is selected. Otherwise, the -ring that hosts a robot of U with the largest view is the one to be elected (note that this is possible as C is rigid). Assume without loss of generality that i is elected. Let r and r be the robots on respectively u 1 and u 3 . If view r (t)(1) < view r (t)(1) then robot r is the one allowed to move. Its destination is its adjacent node on its -ring in the opposite direction of u 4 . By moving u 3 becomes empty. If r moved to an empty node, as F ree(u 2 , u 4 ) holds, we retrieve Case 4b. Otherwise (r moves to an occupied node), a configuration C in which nb i (C ) < nb k (C ) is reached. By our algorithm, robots that are the closest to u 1 , are the ones allowed to move. Their destination is their adjacent node toward u 1 . Observe that if r is the closest to u 1 , as it is part of a multiplicity of size 2, by moving, we can reach alternatively a configuration C in which nb i (C ) < nb k (C ) and a configuration C in which nb i (C ) = nb k (C ). However, since in both configurations, robots keep the same destination (recall that |U i | = 1 and F ree(u 2 , u 4 ) holds) then eventually, they will join u 1 and we can deduce that the lemma holds. (e) there exists an -ring in L, let this -ring be without loss of generality i in which |U i | = 3 (let u 1 be the unique empty node in U i ) and F ree(u 1 , u 3 ). By our algorithm, if k does not satisfy the same properties then, i is elected. Otherwise, assume loss of generality that the empty node on k is u 1 . Let r and r be the two robots located on respectively u 2 and u 2 . By our algorithm, if view r (t)(1) > view r (t)(1) then, i is elected (recall that C is rigid and hence we are sure that view r (t)(1) = view r (t)(1)). Otherwise k is selected. Assume without loss of generality that i is the elected -ring. The robot, r on u 2 is the one allowed to move. Its destination is its adjacent node in the opposite direction of u 1 . If r moves to an empty node then, since F ree(u 1 , u 3 ) holds, we retrieve Case 4c. By contrast, if it moves to an occupied node then, a configuration C in which nb i (C ) < nb k (C ) is reached. Again, as F ree(u 1 , u 3 ) holds, the robot on u 3 is the one that is allowed to move. Its destination is u 2 . By moving, a configuration C in which the only node of U i to be occupied is u 4 . Moreover, nb i (C ) < nb k (C ) -1. That is, when r moves toward u 4 , as it is part of a multiplicity of size 2, the scheduler can break the multiplicity. However, as nb i (C ) < nb k (C ) -1, i remains the one to be elected and u 4 remains the target of the robots on i . That is, eventually, all robots join u 4 and the lemma holds. (f) Non of the cases above is verified. Assume without loss of generality that |U i | ≤ |U k |. The following cases are possible: i.

Let R be the set of robots on a node of U . The -ring that hosts the robot of R with the largest view is the elected -ring (Recall that this is possible as C is rigid). Assume without loss of generality that i is selected. By our algorithm, using the rigidity of C, a unique robot, say r, on a node of U i is selected to move. Assume without loss of generality that r is located on u 1 . The destination of r is u 2 . By Corollary 2, u 1 hosts no more than 2 robots in C. If u 1 hosts a multiplicity and the scheduler activates only one robot on u 1 , as the robot moves to an occupied node, the configuration remains the same and hence, the robot that was supposed to move is the only one allowed to move. That is eventually, u 1 becomes empty and u 2 hosts at least 2 and at most 3 robots (3 robots in the case in which nb elli (C) = -1. In the configuration reached C , nb i (C ) < nb k (C ). Let us first discuss the case in which u 2 hosts a multiplicity of size 3. Since F ree(u 1 , u 3 ) does not hold (recall that nb elli (C) = -1). By our algorithm, the robot that is on the same side as u 1 which is the closest to u 3 is the one allowed to move. Its destination is its adjacent node toward u 3 . That is, eventually, F ree(u 1 , u 3 ) becomes true. Robots on u 2 are then allowed to move as we retrieve Case 4e. Note that, in every configuration reached C , nb i (C ) < nb k (C ) (even if the scheduler activates only a subset of robots, as by moving they add at most one occupied node) and hence i is uniquely identified. When u 2 becomes empty, robots that are on u 3 are the one toward u 4 . As long as u 4 is occupied, the configuration remains the same and hence only robots on u 3 are allowed to move. Eventually, u 3 becomes empty and in the configuration reached |U i | = 1 and F ree(u 1 , u 3 ) holds. As discussed previously, all robots on i move to join u 4 starting from the closest ones. Eventually, a configuration C in which nb i (C ) = 1 is reached. Hence the lemma holds. Lastly, let us consider the case in which u 2 hosts two robots. If F ree(u 1 , u 3 ) does not hold then robots located on i which are on the same side as u 1 move to join u 3 starting from the closest one. That is, as for the case in which u 2 hosts a multiplicity of size 3, i is uniquely identified as the number of its occupied nodes is strictly smaller than the number of occupied nodes on k . By contrast, if F ree(u 1 , u 3 ) holds, then since in the configuration |U | k = 4 and |U | i = 3 (recall that u 1 became empty), i is also uniquely identified. As discussed in Case 4e, we can deduce that the lemma holds. ii.

assume without loss of generality that u 1 and u 1 are the empty nodes on i and k respectively. Observe that ¬F ree(u 1 , u 3 ) and ¬F ree(u 1 , u 3 ) holds (otherwise we are in Case 4e). Let R i (respectively R k ) be the set of robots on i (respectively k ) being on the same side of the axes of symmetry as u 1 (respectively

then, let r 1 (respectively r 1 ) be the robot on i (respectively k ) which is the closest to u 3 (respectively u 3 ). If without loss of generality dist(r

Otherwise, k is selected. Assume without loss of generality that i is the one that is selected. By our algorithm, the robot on i which is the closest to u 3 , is the one allowed to move. Its destination is its adjacent node toward u 3 . By moving, the robot joins u 3 or becomes the only robot that is closest to u 3 . Let C be the reached configuration. If the robot joined

By Lemma 5, we can deduce that the lemma holds. By contrast, if the robot does not join u 3 , as the robot get even closer to u 3 , i remains the selected -ring and the robot that has moved remains the only one allowed to move. That is eventually, it joins u 3 and as discussed previously, we can deduce that the lemma holds. iii. means that Case(a) has a higher priority than Case(b). That is, if i and k have two different priorities then, the -ring with the largest priority is one that is selected. By contrast, if the two -rings have the same priority (they belong to the same case), the selection is done in the following manner: if both i and k belongs to Case(I) (assume without loss of generality that u 1 , u 2 , u 1 and u 2 are the nodes of U that are occupied) then, let F 1 , F 2 (respectively F 1 , F 2 ) be the number of robots on i (respectively k ) being on each side of Γ (C)'s axes of symmetry (Observe that ∀i ∈ {1, 2}, F j = 0 and F j = 0, otherwise we are in Case 4c). Let

. The -ring that has a side with F robots is elected. If both -rings has a side with F robots, we use the distance to break the symmetry. That is, let d be the largest distance between an occupied node on an -ring of L and the occupied node of U on the same -ring. Let R 1 and R 2 be the set of these nodes located on respectively i and k .

If without loss of generality R 1 < R 2 then i is selected. Otherwise, let d i (respectively d k ) be the smallest distance between a robot on i (respectively k ) that are in a different side from the node of R i (respectively R k ). If without loss of generality

the that hosts a robot that is at distance d i from an occupied node of U with the largest view is one that is selected. Now, if both -ring of L belong to Case(II) or if they both belong to Case(III) then, let r (respectively r ) be the robot allowed to move on i (respectively k ) with respect to our algorithm. If view r (t)(1) > view r (t)(1) then i is elected. Otherwise, k is elected. From here, we know that a unique -ring is selected. Assume without loss of generality that this -ring is i . We discuss each case separately:

-The two occupied nodes of U i are neighbors. Let R be the set of occupied nodes on i that are the farthest from an occupied node of U i being on the same side of Γ (C)'s axes of symmetry. Note that 1 ≤ |R| ≤ 2 (one at each side of the axes of symmetry). If |R| = 2 then, as C is symmetry the robot that is on a node of R with the largest view is the one allowed to move. Its destination is its adjacent node on its -ring toward the occupied node of U i , being on the same side, taking the shortest path. By moving, a configuration C which is still in Case(I) and in which |R| = 1 is reached. When |R| = 1, the robot that is on i in the opposite side of the axes from the node of u and which is the closest to the occupied node of U i is the one allowed to move. By moving, it either joins the occupied node of U i or it becomes the only closest robot to an occupied node of U . Hence, in the latter case, i remains the one that is elected and the robot that has moved remains the only one allowed to move. That is, eventually it joins the occupied node of U i . In the configuration reached C , nb i (C ) < nb k (C ) and thanks to the farthest occupied node in R, the configuration is rigid. Hence, by Lemma 5, we can deduce that the lemma holds. -The two occupied nodes of U i are located on the same side or different sides of Γ (C)'s axes of symmetry. By our algorithm, the robot on an occupied node of U i having the largest view is the one allowed to move. Its destination is its adjacent node on its current -ring in the opposite direction of the adjacent node in U i . Assume without loss of generality that this node is u 1 . Once the robot moves, u 1 becomes empty. If the robot of u 1 joined an occupied node, then in the configuration reached C , C , nb i (C ) < nb k (C ). As C is rigid (thanks to the unique occupied node of U i ), by Lemma 5, we can deduce that the lemma holds. By contrast, if the robot of u 1 joined an empty node then nb i (C ) = nb k (C ) but U i = 1. We thus retrieve Case 4(f)iv.

iv.

then, let d be the smallest distance between a robot on an -ring of L and a node of U located on the same -ring. The -ring that hosts a robot at distance d from a node of U with the largest view is the one that is elected (this is possible as C is symmetric). Assume without loss of generality that i is the one that is selected and that u 1 is the only occupied node of U i . By our algorithm, the robot that is the closest to u 1 is the one allowed to move. Its destination is its adjacent node on its current -ring toward u 1 . By moving, it either joins u 1 or get closer to u 1 . If the robot of u 1 joined an occupied node, then in the configuration reached C , C , nb i (C ) < nb k (C ). As C is rigid (thanks to the unique occupied node of U i ), by Lemma 5, we can deduce that the lemma holds. By contrast, if the robot did not join u 1 , then as this robot is the only one that is the closest to u 1 , i remains the selected -ring and the same robot remains the only one allowed to move. That is, eventually, it joins u 1 . Hence, we can deduce that the lemma holds in this case too. v.

d be the smallest distance between a robot on an -ring of L and a node of U on its -ring. The -ring that hosts a robot at distance d from a node of U with the largest view is the one that is elected (Again, this is possible as C is rigid). Assume without loss of generality that i is selected. By our algorithm, the robot that is the closest to a node of U i with the largest view is the one that is allowed to move. Its destination is its adjacent node toward the closest node of u i taking the shortest path. By moving it either joins a node of U i and in this case, we retrieve Case 4(f)iv or it becomes the only robot that is the closest to a node of U . Hence, i remains the one that is selected and the robot that has moved remains the only one allowed to move. That is, the robot eventually joins a node of U i and we retrieve Case 4(f)iv.

From the cases above we can deduce that the lemma holds. -Set R(C) is not empty. As C is rigid, one robot in R can be elected to move. Let this robot be the one with the smallest view. We refer to this robot by r. Let C be the configuration reached when r moves. In C either there is a single biggest d.block D as r joins one of the biggest d.block in C or r becomes the only robot that is the closest to a d.block D. In the case in which Γ (C ) contains an axes of symmetry then this axes is unique (it crosses the unique biggest block D in C ) which is a contradiction. In the later case, C is rigid otherwise in C there was another robot r which was closer to a block D which is also a contradiction. -Set R(C) is empty (there is a single d.block on t in C). In this case, let r be the robot at the border of the unique d.block with the smallest view. Note that as C is rigid, such a robot is unique. If r moves to its adjacent node on t inside the d.block it belongs to then in C , the configuration reached once r moves, there is a unique d -1.block. Hence, if Γ (C ) contains an axes of symmetry then this axes is unique which a contradiction.

From the cases above we can deduce that there exists a robot r on an -ring t ∈ { i , k } such that if r moves then a configuration C ∈ C U ndef ined is reached with Γ (C ) being either rigid or contains a single axes of symmetry. Note that since there is a unique robot that is allowed to move. In C there are no outdated robots. Hence the Lemma holds.

From Lemmas 5, 6 and Lemma 7 we can deduce the following corollary: 1. ∀j ∈ {1, 2, . . . , L} such that j = max , nb j (C) = 0. Remember that C contains a single -ring that is occupied which is max by default. Since the configuration is rigid, by our algorithm, one robot is selected from max to move to its adjacent empty node outside the -ring it belongs to (the direction is chosen by the adversary). Once it moves, a configuration C ∈ C p2 is then reached. 2. Otherwise i.e., ∃ j ∈ {1, 2 . . . , L} such that j = max and nb j (C) = 0. According to our algorithm robots in R m are the ones allowed to move where R m is the set of robots that are the closest to a node on max . Using the rigidity of C, a unique robot from R m is selected. Let us refer to this robot by r. The destination of r is its adjacent empty node outside its -ring toward max taking the shortest path. Observe that when the robot moves, if it is neither on i nor k , r remains the only one allowed to move (since it is the closest one to max , |R m | = 1). Robot r keeps the same destination and hence keep moving toward max taking the shortest path. That is, eventually, r becomes on either i or k . That is, a configuration C ∈ C p2 .

Observe from the cases above that at each instant, there is only one robot which is allowed to move. That is, as long as such a robot remains idle, it keeps being the only one allowed to move. Hence, we can deduce that the lemma holds. Lemma 9. Starting from a configuration C ∈ C Semi-Empty in which there are no outdated robots, a configuration C ∈ C Oriented with no outdated robots is eventually reached.

Proof. Let i and k be the two -rings that are adjacent to max . Assume without loss of generality that nb k (C) > 1 and nb i (C) = 0. Let n be the -ring that is neighbor to i . Note that n = k is a possible case. Let → be the direction from max to k taking the shortest path. By our algorithm, since C is rigid, exactly one robot from n is selected to move. Its destination is its adjacent empty node outside its -ring with respect to →. Let us refer to this robot by r. Observe that when r moves, if r is not on i , then no other robot is allowed to move except r (since r is the only closest robot now to i ). Hence, eventually, r joins i . Let us refer to the configuration reached by C . Then, nb i (C ) = 1 and nb k (C ) > 1. Therefore C ∈ C Oriented is eventually reached. Moreover, as there is a unique robot that is activated at each time, when C is reached there are no robots with outdated views. Hence the lemma holds.

Lemma 10. Starting from a configuration C ∈ C Oriented-2 with no outdated robots, a configuration C ∈ C Oriented-1 with no outdated robots is eventually reached.

Proof. Let u be the node on k that is on the same L-ring as v targer . According to our algorithm, as long as nb k (C) > 3, robots that are the closest to u moves to their adjacent node towards u taking the shortest path. As robots move to join u, the number of robots decreases on k and eventually a configuration C in which nb k (C ) = 3 or nb k (C ) = 2 is eventually reached. Once such such a configuration is reached, Align( k , i ) is executed. By Lemma 1, a configuration C ∈ C Oriented-1 with no outdated robot is reached and the lemma holds.

Lemma 11. Starting from a configuration C ∈ C Oriented-1 with no outdated robots, a configuration C ∈ C p2 with no outdated robot is eventually reached. Moreover, nb max (C) = 4 and max contains at most one multiplicity node. This node is adjacent to v target .

Proof. Let u be the node on max such that u is on the same L-ring as the unique occupied node on i . Some extra steps are taken in the case where nb max (C) < 5. By our algorithm, if nb max (C) = 3 then robots on max executes Align( max , i ). By Lemma 1, robots on max eventually form a 1.block of size 3 whose middle node is adjacent to the unique robot on i and no robot on max has an outdated view. From the reached configuration, the unique robot on i moves to its adjacent node on max (note that this node is occupied). That is a configuration C ∈ C p2 with no outdated robot is eventually reached. Moreover, in C , max contains one multiplicity node. This node is adjacent to v target . By contrast, if nb max (C) = 4 then if u is empty then the unique robot on i moves to join u and the lemma holds (Observe that in this case max contains no multiplicity node). If u is occupied then by our algorithm if u has an empty adjacent node on max then the robot on u moves to its adjacent empty node on max (the scheduler chooses the direction to take if the robot has a choice to make). If u has no adjacent empty node on max then by our algorithm the robot on max which is adjacent to u and does not have a neighboring robot at distance /2 is the one allowed to move. Its destination is its adjacent empty node on max . That is, eventually u becomes empty. The unique robot on i is then the only one allowed to move. Its destination is u. Hence, a configuration C ∈ C p2 in which there are no multiplicity nodes and no outdated robots on max is reached.

Finally, if nb max (C) ≥ 5 then by our algorithm, the unique robot on i is the one allowed to move. Its destination is its adjacent node on max . We can thus deduce that the lemma holds. contrast, if nb max (C ) = 5 (respectively nb max (C ) = 3), robots on max execute Align( max , i ). Note that during the execution of Align, if u 3 is occupied and possibly hosts a multiplicity, robots on u 3 do not move. That is, through out the execution of Align, the number of robots on max remains equal to 5 (respectively 3). By Lemma 1, we can deduce that a configuration C ∈ C sp-3 or C ∈ C sp-2 is eventually reached. Moreover, the only multiplicity node on max is the one that is adjacent to v target . Hence the lemma holds.

Similarly to Lemma 14, we can show the following lemma: Proof. Let C ∈ C sp-1 . We refer to the non empty -ring that is adjacent to max by mark . Depending on the number of robots on mark , the following cases are considered:

1. nb mark (C) = 2 and mark contains a 1.block of size 2. By our algorithm, robots on mark that have two adjacent occupied nodes are the ones allowed to move. If the scheduler activates all the robots allowed to move, C ∈ C sp-2 is reached and hence the lemma holds. By contrast, if the scheduler activates only a subset of robots, the configuration remains in C sp-1 . Moreover, the same robots keep being the only ones allowed to move. Since the scheduler is weakly fair, these robots are eventually activated and hence a configuration C ∈ C sp-2 is eventually reached. 2. nb mark (C) = 2 and mark contains a 2.block of size 2. Observe that in this case C ∈ C target and target = mark . By our algorithm, robots adjacent to v target are the ones allowed to move. Their destination is v target . If the scheduler activates all the robots allowed to move, a configuration C ∈ C sp-2 is reached and the lemma holds. If the scheduler activates only robots at one border of the 2.block, we retrieve Case 1. Finally if the scheduler activates a subset of robots then a 1.block of size 3 is created and we retrieve Case 3. 3. nb mark (C) = 3. Observe that, in this case C ∈ C target and target = mark . According to our algorithm, robots on mark that are at the border of the 1.block are the only ones allowed to move. Their destination is their adjacent on mark inside the block they belong to. If the scheduler activates all the robots allowed to move, C ∈ C sp-2 is reached and the lemma holds. If by contrast, the scheduler activates only robots on one border of the block, target contains a single 1.block of size 2 and hence we retrieve Case 1. Finally, if the scheduler activates only a subset of robots that move then the configuration remains in C sp-1 and the same robots remain the only one allowed to move. As the scheduler is weakly fair, the number of robots on the borders of the 1.block decreases. Thus, eventually, a configuration C ∈ C sp-2 is reached.

From the cases above, we can deduce that eventually all robots on target join v target and hence we can deduce that the lemma holds. 1. nb max (C) = 5 . By our algorithm, robots on max which are adjacent to the borders of the 1.block of size 5 move to join the middle node of the 1.block. If all robots allowed to move, execute the move phase then a configuration in which max contains a single 2.block of size 3 is reached. By our algorithm, the robots on max execute Align( max , target ) and hence the robots at the extremities of the 2.block eventually move to create a single 1.block of size 3 whose middle robot is adjacent to v target . Thus a configuration C ∈ C sp-3 is reached in this case. By contrast, if only a subset of robots which are allowed to move perform the move phase then we retrieve Case 3.

2. nb max (C) = 4 and max contains two 1.blocks of size 2. According to our algorithm, robots in each 1.block who has an adjacent occupied node at distance 2 are the one allowed to move. Depending on the robots that have moved, we retrieve either Case 1 or Case 3 or a configuration in which a single 1.block of size 3 whose middle robot is adjacent to v target is created. In the later case, by our algorithm Align( max , target ) is executed. That is, the extremities of the 2.block eventually move to create a single 1.block of size 3 whose middle robot is adjacent to v target . A configuration C ∈ C sp-3 is then reached. 3. nb max (C) = 4 and max contains a 1.block of size 3 . By our algorithm, robots in the middle of the 1.block are the ones allowed to move. As the scheduler is weakly fair, eventually a 2.block of size 3 is created. By our algorithm, as Align( max , target ) is executed the extremities of the 2.block eventually move to create a single 1.block of size 3 whose middle robot is adjacent to v target . Thus the Lemma holds.

From the cases above we can deduce that the lemma holds.

Lemma 18. Starting from a configuration C ∈ C sp-3 in which the only node that hosts a multiplicity on max is the node that is adjacent to v target , a configuration C ∈ C sp-4 is eventually achieved. Moreover, in C sp-4 , there is at most one occupied node that hosts a multiplicity. This node is the onde that is in the middle of the 1.clock of size 3.

Proof. Let C ∈ C sp-3 . Depending on the number of robots on max , two cases are distinguished:

1. nb max (C) = 2. By assumption, since the node on max which is adjacent to v target is empty, max does not host a multiplicity. From our algorithm, robots on v target move to their adjacent node on max . If v target hosts only one robot, then when the robot moves, a configuration C ∈ C sp-4 is reached and the lemma holds. By contrast, if v target hosts more than one robot and the scheduler activates all robots on v target to move then a configuration C ∈ C sp-4 is also reached and the lemma holds. Finally, if the scheduler activates only a subset of robots on v target then we retrieve Case 2. 2. nb max (C) = 3. Robots on v target are the only one allowed to move. Their destination is their adjacent node on max . Note that as long as v target is occupied, the only robots allowed to move are the ones that are on v target . Hence, eventually all robots on v target move to their adjacent node on max and a configuration C ∈ C sp-4 is then reached.

From the cases above, we can deduce that the lemma holds.

Lemma 19. In a configuration C ∈ C sp-4 , if nb max (C) = 3 (respectively nb max (C) = 2) then the border robots (respectively at least one of the two border robots) of the 3.block (respectively 2.block) do not host a multiplicity.

Proof. From Theorem 1, we know that when the second phase starts, no robot has an outdated view and the only multiplicity node that can exist on max is the one that is adjacent to v target . On another hand, in any configuration C ∈ C ls or C ∈ C pr , no robot on max is enabled to move and no robot moves to a node of max . That is when a configuration C ∈ C sp is reached, the only possible multiplicity node on max is the one that is adjacent to v target . By Lemmas 14, 15, 16, the only node on max that can host a multiplicity is the one that is adjacent to v target . From Lemma 18, the only node that hosts a multiplicity is the one that is in the middle of the 1.block of size 3. By our algorithm, in a configuration C ∈ C sp-4 in which there are 3 occupied nodes, the robot that is at the border of the 1.block is the one allowed to move. If the scheduler activates one robot then the configuration remains in C sp-4 but with only two occupied nodes. That is, one of the two occupied nodes does not belong to a multiplicity. Thus, the lemma holds.

Lemma 20. Starting from a configuration C ∈ C sp-4 , the gathering is eventually achieved.

Proof. With respect to our algorithm, the following cases are considered :

1. C contains a 1.block of size 3 . From Lemma 19, the nodes at the border of the 1.block do not host a multiplicity. According to our algorithm, the border robots are the ones allowed to move. Their destination is their adjacent occupied node. If both robots move at the same time then the gathering is achieved and the lemma holds. Otherwise, we retrieve Case 2.

2. C contains a 1.block of size 2. From Lemma 19, exactly one of the two occupied nodes hosts a multiplicity. The unique robot that is allowed to move is the one that is not part of a multiplicity. By moving, the gathering is achieved and the lemma holds.

From the cases above we can deduce that the lemma holds.

Lemma 21. Starting from a configuration C ∈ C sp , the gathering is eventually achieved.

Proof. Holds from Lemmas 18, 16, 17 and 20 (refer to Figure 16). Theorem 3. Assuming an ( , L)-torus in which L < and L > 4 and starting from an arbitrary rigid configuration, Protocol 1 solves the gathering problem for any k ≥ 3.

Concluding remarks

We presented the first algorithm for gathering oblivious mobile robots in a fully asynchronous execution model in a torus-shaped space graph. Our work raises several interesting open questions:

1. What is the exact set of initial configurations that are gatherable? Our work considers initial rigid configurations only, and we know that periodic and edge-symmetric configurations make the problem impossible to solve. As in the case of the ring, there may exist special classes of symmetric configuration that are still gatherable. 2. The case of a square torus is intriguing: the robots would loose the ability to distinguish between the big side and the small side of the torus, so additional constraints are likely to hold if gathering remains feasible. 3. Following recent work by Kamei et al. [START_REF] Kamei | Gathering on rings for myopic asynchronous robots with lights[END_REF] on the ring, it would be interesting to consider myopic (i.e. robot whose visibility radius is limited) yet luminous (i.e. robots that maintain a constant size state that can be communicated to other robots in the visibility range) robots in a torus.