Forming Sequences of Patterns With Luminous Robots

,


I. INTRODUCTION
The control and coordination of systems of autonomous mobile robots operating in continuous spaces has been the object of intensive investigations in a variety of fields, including robotics, control, AI, and distributed computing.

A. FRAMEWORK
Within distributed computing, the robots are seen as mobile computational entities operating in the Euclidean space in Look-Compute-Move cycles. During a cycle, a robot obtains a snapshot of the positions of the other robots, expressed in its own local coordinate system (Look); using the snapshot as an input, it executes an algorithm, the same for all robots, to determine a destination (Compute); and it moves The associate editor coordinating the review of this manuscript and approving it for publication was Yilun Shang . towards the computed destination (Move); after a cycle, a robot may be inactive for some time. The main focus has been on determining the minimal capabilities the robots need to have to be able to solve a problem, and the extensive literature has almost exclusively focused on simple computational entities operating under strong adversarial conditions. The robots are anonymous (without ids or distinguishable features), autonomous (without central or external control), homogeneous (they execute the same program), silent (without explicit means of communication), and oblivious (no recollection of computations and observations done in previous cycles).
In this standard model of robots, typically called OBLOT , depending on the activation schedule and timing assumptions, three main sub-models have been studied in the literature: the asynchronous model (ASYNC), where no assumptions are made on synchronization among the robots' cycles VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ nor their duration; and the fully synchronous (FSYNC) and semi-synchronous (SSYNC) models where the robots operate in synchronous atomic rounds, the only difference being whether all robots are activated in every round or, subject to some fairness condition, a possibly different subset is activated in each round. Extensive research has been carried out to determine, in all three sub-models, the computational boundaries as well as the impact that factors such as presence/absence of common coordinate system, movement rigidity (i.e., being able to always reach the destination), etc., have on computability and complexity (e.g., see [3], [6], [14]- [16], [18], [28], [29], [31], and the recent books and chapters therein [12], [13]). Although this research is highly theoretical, its influence is sometimes felt in more practical settings (e.g., see [5], [19], [20], [22], [27] in the recent literature). Among all the restricting conditions, being oblivious and silent are the most limiting constraints for the robots, forcing them to rely only on movement and observation of the environment to coordinate and decide their next step. On the other hand, both obliviousness and silence are very desirable characteristics, as the former provides a form of self-stabilization, while the latter allows for applications in environments where communication is impossible or dangerous.
Recently, to partially overcome the limits of obliviousness and silence while maintaining some of their advantages, the stronger model of luminous robots, LUMI, has been introduced where robots, otherwise oblivious and silent, carry a visible light that can take (a bounded number of) different colors, can be seen by observing robots, and persists from cycle to cycle [7], [8].
The availability of visible lights clearly changes the computational power of the robots, which have now the means for a bounded amount of persistent memory (by coding information into the colors), and limited communication (by using the change of colors to transmit a bounded amount of information to the other robots). The research is now ongoing to determine the impact that the availability of visible lights has on the computability power of the robots, and how lights can be used to overcome additional limitations (e.g., obstructed visibility). The first crucial result is the existence of an algorithmic transformation that allows any semi-synchronous protocol for luminous robots with k colors to be executed asynchronously with O(k) colors [8]. In other words, when solving a problem for asynchronous luminous robots, it suffices to solve it for semi-synchronous ones; the price to pay is a (small) constant muliplicative factor in the number of colors. Furthermore, since robots in OBLOT are luminous robots with k = 1 color, this result implies that asynchronous luminous robots are at least as powerful as semi-synchronous traditional robots. Since their introduction, a large amount of work has been done on luminous robots ( [1], [2], [4], [8], [10], [17], [21], [23]- [26], [30]; see [11] for a recent review). In this paper we continue the investigation on the computational impact of lights, and examine the problem of forming a sequence of geometric patterns.

B. FORMING A SEQUENCE OF PATTERNS
The research on the computational aspects of autonomous mobile robots has in large part focused on the fundamental class of Geometric Pattern Formation problems. A geometric pattern (or simply pattern) P is a set of points in the plane; the robots form the pattern P at time t if the configuration of the robots (i.e., the set of their positions) at time t is similar to P (i.e., coincident with P up to scaling, rotation, translation, and reflection); a pattern P is formable if there exists an algorithm that allows the robots to form P within finite time and no longer move.
Determining which patterns are formable under what conditions has been the subject of extensive studies in a variety of settings (e.g., see [16], [18], [28], [29], [31]). A crucial role is played by the notion of symmetricity of a set of points, which informally measures the amount of symmetries of the set. Indeed, for a pattern P to be formable, its symmetricity must divide the one of the starting configuration (i.e. initial placement of the robots in the plane). The obtained results indicate that, in most settings, the robots can form single arbitrary geometric patterns in spite of their silence and obliviousness. In other words, apart from the inevitable limitations due to symmetry, obliviousness and silence are not limiting factors to form a single pattern.
The problem of forming more than one pattern in a specified order is clearly much more difficult due to the obliviousness of the robots. In fact, to be able to correctly transition from a pattern to the next in the prescribed order, the robots must create in the environment the mechanism to ''remember'' and ''communicate''.
Let S = S 0 , S 1 , . . . , S m−1 be an ordered sequence of patterns. Forming sequence S requires the robots to form the infinite periodic sequence S ∞ = S 0 , S 1 , . . . , S m−1 ∞ , called coreography; that is, after forming pattern S i , the robots must form pattern S (i+1)mod m , where the first formed pattern can be any pattern in the sequence [9]. The problem of determining which coreographies can be formed from a given initial configuration, the PATTERNSEQUENCEFORMATION problem, has been studied in the OBLOT model in [9], where a complete characterization was given for the set of the sequences formable from the initial configuration by semi-synchronous robots with rigid movements (i.e., when moving, a robot always reaches its destination), assuming chirality (i.e., clockwise orientation). Specifically, the authors proved that a sequence S of patterns formable from can be formed by rigid robots in SSYNC only if (R1) the number of points in each pattern is the same and (R2) no pattern appears more than once in the sequence.
Since traditional robots without lights are the particular case of luminous robots with one color, the results proven in [8] imply that all sequences formable by robots in SSYNC with rigid movements and chirality can be done by asynchronous luminous robots under the same conditions. This naturally poses several questions on the sequence of patterns formable by asynchronous luminous robots vs those formable by traditional robots. Specifically, are asynchronous luminous robots more powerful than traditional robots in SSYNC? If so, what other sequence of patterns can be formed? how? can they be formed without rigidity? In this paper, we provide a complete answer to these questions.

C. CONTRIBUTIONS
We provide a complete characterization of the sequences of patterns formable by (non-rigid) luminous robots with chirality, starting from an input configuration .
The characterization shows that, in contrast with the case without lights, the sequences F( ) of patterns that can be formed do not suffer from restrictions (R1) and (R2); in fact, formable sequences can contain repeated patterns ( repetitions), and the number of points in the patterns can be different (contractions). The number of colors needed by the robots, and used by the algorithm, depends necessarily on the number of repetitions and contractions in the sequence of patterns; i.e., it is bounded but not by a constant. Furthermore, unlike the case without lights, the set F( ) of sequences formable by luminous robots is the same regardless of (a)synchrony and regardless of rigidity.
The characterization is constructive. We first identify the sequences that cannot be formed even if the robots are fully synchronous and rigid; we then provide a universal protocol that, for any given arbitrary initial configuration and any given ordered sequence S = S 0 , . . . , S m−1 of patterns formable from , allows the robots to form S starting from ; furthermore, this is done asynchronously, without requiring rigidity, and always starting from S 0 .
This characterization explicitly and clearly identifies the computational strength of LUMI over OBLOT with respect to the PATTERNSEQUENCEFORMATION problem.
The paper is organized as follows: in Section II, we introduce some notation and definitions; in Section III, we establish some basic limitations of the robots as well as a lower bound on the number of colors to be employed; in Section IV, we describe an Algorithm to solve the problem and analyze its correctness; in Section V, we establish bounds on the number of colors necessary to solve the problem; finally, in Section VI we draw some conclusions and discuss open research directions.

II. MODEL AND DEFINITIONS A. THE MODEL
The system is composed of a team R of mobile entities, called robots, each modelled as a computational unit provided with its own local memory and capable of performing local computations.
The robots are placed in a spatial universe, here assumed to be R 2 , and they are viewed as points in R 2 . We assume that the robots always start from distinct points in the plane, but during the course of the algorithm multiple robots may occupy the same point in R 2 . Each robot has its own local coordinate system that might not be consistent with that of the other robots. A robot is endowed with sensorial capabilities and it observes the world by activating its sensors, which return a snapshot of the positions of the other robots in its local coordinate system.
The robots are identical and anonymous: they are indistinguishable by their appearance, execute the same protocol, and do not have distinct identities. The robots are autonomous, without a central control. The robots are silent, meaning that a robot cannot directly communicate with another robot (e.g., using wireless communication). The robots can however communicate information indirectly, e.g. using specific movements or using lights, as explained later.
Each robot is endowed with motorial capabilities, and can freely move in the plane.
At any point in time, a robot is either active or inactive. When active, a robot executes a Look-Compute-Move (LCM) cycle. In Look, a robot obtains an instantaneous snapshot of the positions of all robots (i.e., the set of their coordinates) expressed in its own coordinate system, which might be different in different cycles. In Compute, the robot executes its algorithm, using the snapshot as input; the result of the computation is a destination point. In Move, the robots moves toward the computed destination; if the destination is the current location, the robot stays still (performs a null movement). When inactive, a robot is idle. All robots are initially inactive. The amount of time to complete a cycle is assumed to be finite.
The algorithm to be executed, with all the functions it uses, as well as the target to be achieved (in our case, the sequence of patterns) are the only information persistently available to a robot. Otherwise, the robots are oblivious: they start each cycle without any information of past observations and computations. The local coordinate systems of the robots may not be consistent with each other, and might differ in different cycles; however, a robot always sees itself at the origin of the system and, as in [9], [18], it shares the same chirality (e.g., a clockwise orientation of the plane) with all the other robots.
In a move, a robot might always reach its destination, in which case the move is said to be rigid; alternatively, the move might stop before reaching its destination, e.g., because of limits to its motion energy. In the non-rigid case, the distance traveled in a move is neither infinite nor infinitesimally small. More precisely, there exists an (arbitrarily small) constant δ > 0 such that, if the destination point is closer than δ, the robot will reach it; otherwise, it will move towards it a distance of at least δ; the quantity δ might not be known to the robots. In this paper, the proposed algorithms are able to operate in this more difficult general setting of non-rigid movements.
With respect to the activation schedule of the robots and their Look-Compute-Move cycles, the most common models are the fully-synchronous, the semi-synchronous, and the asynchronous. In the fully-synchronous (FSYNC) model, the activations of all robots can be logically divided into global rounds; in each round, the robots are all activated, obtain the same snapshot, compute and perform their move. Note that this is computationally equivalent to a fully synchronized VOLUME 8, 2020 system in which all robots are activated simultaneously and all operations are instantaneous. The semi-synchronous (SSYNC) model is like the fully-synchronous model where however not all robots are necessarily activated in each round. Based on the fairness of the activation scheduler, sub-models can be obviously defined; it is assumed that every robot is activated infinitely often. On the opposite side of the spectrum, in the asynchronous (ASYNC) model, the robots do not have a common notion of time; they are activated independently from each other, and the duration of each Compute, Move and inactivity is finite but unpredictable. As a consequence, robots perceived in a snapshot might be performing any operation and, in particular, they might be moving; moreover, computations might be made based on obsolete observations. In this paper, the proposed algorithm is able to operate in this more difficult but more general model.
A luminous robot r is a robot that, in addition to its capabilities, is endowed with a persistent and externally visible state variable Light[r], called light, whose values are from a finite set C of states called colors (including the color that represents the state when the light is off). Note that if |C| = 1, then the light is always off; thus, this case corresponds to the traditional setting of robots without lights. In this paper, we assume |C| > 1 for (truly) luminous robots. The value of Light[r] (i.e., its color) can be changed in each cycle by r at the end of its Compute operation. A light is externally visible in the sense that its color at time t is visible to all robots that perform a Look operation at that time; we assume weak chromatic multiplicity detection: the robots can distinguish the colors of robots co-located at a point, but not their number. 1 A light is persistent from one computational cycle to the next; while robot r might be oblivious, forgetting all other information from previous cycles, the color is not automatically reset at the end of a cycle.

B. CONFIGURATIONS, SYMMETRIES, AND PATTERNS
Let V be a set of points in the Euclidean plane, size(V ) be the cardinality of V , and SEC(V ) be the smallest circle enclosing all the points (refer to Figure 2 for a summary of the used notation). The set V can be decomposed into a set of concentric circles centred in the centre of SEC(V ), each containing at least a point of V ; let σ (V ) be their number, and let us denote them as Cir V 1 , . . . , Cir V σ (V ) , with Cir V 1 being the smallest one; in the following, when clear from the context, the superscript will be omitted. As well known, there exists a q ≥ 1 divisor of size(V ), such that every Cir i can be decomposed into a set of q-gons; if there is a point at the centre of SEC(V ), this point is, by definition, a (degenerated) 1-gon. The largest q for which this holds is called symmetricity of V and denoted by q(V ) (refer also to examples in Figure 1). The set of points in each q(V )-gon is called a symmetricity class, or simply class; we denote by α(V ) the number of classes in V . We extend  in a natural way the definition of symmetricity also to multisets; in a multisetV , a point of multiplicity k at the centre of SEC(V ) is, by definition, a (degenerated) k-gon.
For two k-gons A and B placed on two concentric circles C A and C B , we denote by θ (C A , C B ) the clockwise rotational angle between A and B.
Given a set of distinct colors C = {c 1 , . . . , c k } and a set of points V , we define a coloring of V with C any function λ : V → C. We say that λ is proper when λ(x) = λ(y) iff x and y belong to the same class of symmetricity in V . We denote by q c (V , λ) the chromatic symmetricity of V when colored by λ; in the following, when λ is understood, we use just q c (V ). We extend in a natural way the definition of chromatic symmetricity also to multi-sets.
In the following, we will describe the global positions of the robots using a fixed coordinate system (not available to the robots); let r i (t) denote the position of r i at time t in this system.
The configuration of the robots on the plane at time t is the multi-set (t) = {(r(t), λ(r(t))) : r ∈ R} where λ(r(t)) is the color of robot r at time t; the set of distinct points occupied by the robots in (t) is denoted by L( (t)). A configuration is said to be central if there is a point at the center of SEC( ), not-central otherwise; we denote by − the configuration where the robots at the center of SEC( ), if any, are removed. In the initial configuration = (t 0 ), we assume that all robots occupy distinct positions and that all robots have the same color, called OFF. A pattern P is a set of distinct points. A pattern P is said to be central if there is a point at the center of SEC(P), non-central otherwise. A pattern P i is said to be isomorphic to a pattern P j , denoted P i ≡ P j , if P j can be obtained by a combination of translation, rotation and scaling of pattern P i . Two patterns that are not isomorphic to each other are said to be distinct. We will denote the size of a pattern P by size(P), and denote by P − the pattern where the point at the center of SEC(P), if any, is removed.
We say that the robots have formed the pattern P at time t if L( (t)) ≡ P.
Let S = S 0 , . . . , S m−1 be an ordered sequence of patterns with S i ≡ S i+1 . The maximum number of points in the patterns is called size of the choreography and it is denoted by size(S) = max i {size(S i )}. The maximum number of symmetricity classes in S is defined as α(S) = max i {α(S i )}. Without any loss of generality, let α(S 0 ) = α(S). Given a pattern P ∈ S, we denote by µ(P) the number of occurrences of P in S, i.e. ∀P ∈ S, µ(P) = |{S i ∈ S : S i ≡ P}|. Let µ(S) = max i {µ(S i )}. We say that the sequence S has repetitions, if µ(S) > 1; and contractions, if there is P in S such that α(P) < α(S) (refer to Figure 3). Also, if α(S i ) < α(S i+1 ), we will say that S i contracts.
A set of luminous robots executing an algorithm A starting from a configuration (t 0 ) is said to form S if in every possible execution of A from configuration (t 0 ), there exist increasing time instances t 0 , .
Given the sequence S = S 0 , . . . , S m−1 , we call choreography the infinite periodic sequence S ∞ = S 0 , S 2 , . . . , S m−1 ∞ . We say that a set of robots executing an algorithm A, starting from configuration (t 0 ) performs the choreography S ∞ = S 0 , S 2 , . . . , S m−1 ∞ if they repeatedly form S.
In the following, for simplicity, with an abuse of notation, we will refer to a choreography S ∞ simply as S.

A. BASIC LIMITATIONS
We first establish an obvious basic limitation of patternformation by luminous robots.
Lemma 1: Consider a set of n luminous robots in configuration with chromatic symmetricity q c ( ). The robots cannot form a configuration where q c ( )/q c ( ) is not an integer, even in FSYNC, with rigid movements, and regardless of the number of available colors.
Proof: By contradiction, let A be an algorithm that, starting from configuration , correctly allows the robots to reach configuration , where q c ( )/q c ( ) is not an integer, and it does so in all possible executions, regardless of the local coordinate systems of the robots. For the q c ( ) robots of a class not at the center of SEC(L( )) chirality induces a natural cyclical order; for the q c ( ) robots of a class at the center of SEC(L( )), consider an arbitrary cyclic order. Consider now a fully synchronous execution of A where the coordinate system of each robot is a rotation by 2π/q c ( ) of that of the robot before it in the cyclic order of its class. In every step of such an execution, all the robots in the same chromatic class of will obtain the same chromatic snapshot, perform the same computation, choose the same new color, and perform a move which will not change their symmetry; hence, they will remain in the same chromatic class. It is possible that two (or more) distinct classes choose the same color and their movements position them into a symmetric configuration; however, this will cause the size of the chromatic classes to either stay unchanged or to increase by an integer factor. This means that, in each step t of the execution, we have q c ( (t − 1)) ≥ q c ( (t)) and q c ( (t − 1))/q c ( (t)) is an integer. This will hold also when the robots finally reach at step t . That is, (t ) = but q c ( )/q c ( (t )) is an integer; a contradiction.
The basic limit to performing a choreography immediately follows.
Theorem 2: A set of n luminous robots starting from initial configuration where all robots are in distinct positions and have the same color, cannot perform a choreography S, if any of the following holds: is not a multiple of q( ), for some S j ∈ S. 3) S contains both central and non-central patterns, q( ) > 1, and α( ) = α(S).
This holds even in FSYNC, with rigid movements, and regardless of the number of available colors. Proof: We consider each condition separately. (1) This condition trivially holds since size( ) = n robots cannot occupy more than n distinct positions at any one time.
(2) This condition follows from Lemma 1 observing that, since in the initial configuration all robots have the same color, q c ( ) = q( ).
(3) Let S contains both central and non-central patterns, q( ) > 1, and α( ) = α(S). By contradiction, let S be formable; that is, there is an algorithm A that starting from always correctly performs choreography S in all possible executions.
Consider now a fully synchronous execution of A where initially the coordinate system of each robot is a rotation by 2π/q c ( ) of that of the robot before it in the cyclic order of its class. By assumption, S contains central and non-central patterns. Let S k be the first central pattern formed in this execution (i.e., all S i with 0 ≤ i < k are non-central), and let k be the configuration when the robots form S k for the first time. Since in the robots are in distinct positions and q( ) > 1, to form k at least one robot must move to the center. In this execution, when a robot moves to the center, all the robots in the same class will necessarily do the same (''class collapse''). It follows that size(S k ) < size( ). Continue now the synchronous execution of A with all robots belonging to the same (chromatic) class located in the center of k having the same coordinate system; these robots will, from this moment on, move as one robot, always taking the same decision and moving to the same point. In other words, the number of distinct points occupied by robots in any subsequent configuration is less than size( ). Recall that there exists a pattern S max ∈ S with size(S max ) = size( ) distinct points; this means that the pattern S max cannot ever be formed again, contradicting the correctness of A.
A choreography is feasible from initial configuration if none of the three forbidden conditions stated in the previous theorem holds. Let F( ) denotes the class of all feasible choreographies starting from .
Notice that, as a consequence of Theorem 2, unless the initial configuration is asymmetric or the number of robots is greater than the number of points in the largest pattern, feasible choreographies can only be composed of exclusively non-central patters, or of exclusively central patterns: in the former case, we will say that S is non-central, and in the latter that S is central.

IV. THE ALGORITHM
In this section we present an algorithm that, starting from an arbitrary initial configuration , allows the robots to perform any choreography in F( ) even if the execution is asynchronous and the movements are not rigid. In the following, for simplicity, we assume α( ) = α(S); the case α( ) > α(S) is easily handled, as discussed in Section VI.
We will first consider the case when the initial configuration is symmetric (i.e., q( ) > 1); for ease of presentation, we will introduce in Sections from IV-A to IV-H a solution that assumes S non-central; in Section IV-I we will describe how to extend such a solution to handle also the case when S is central.
The case of asymmetric initial configuration (i.e., q( ) = 1), can be solved with a simpler protocol, and will be described in Section IV-J.

A. SYMMETRIC INITIAL CONFIGURATION
Let the initial configuration be symmetric and S be noncentral; that is, q( ) > 1, and all patterns S i ∈ S are noncentral.
We start with an informal overview of the algorithm for this case (Algorithm 1).
Whenever the robots have to form the next (initially, the first) pattern in S, from a global point of view, the algorithm makes the robots perform two main phases: a pre-processing phase and an actual formation phase. The pre-processing phase is articulated into a 2-step process: • SetUp. A class is elected as leader.
• Pattern Identification. The robots identify the pattern S i of the sequence that has to be formed. Initially all the robots are colored OFF. From this initial configuration, as a preliminary step, a class of robots is elected as leader in SETUP(): robots in this class assume a special color that will uniquely identify them from this moment on. At this point the robots start the actual formation process.
The first action undertaken by the robots is to ensure that the next pattern to be formed, say S i , is recognizable during the entire formation process. This is done in PATTERNIDENTIFICATION() by positioning the leader robots on a special circle, centered in the SEC of the current configuration, and having a special radius that uniquely identifies S i ; hence, once all the leader robots reach that circle, their position enables the other robots to identify S i as the next pattern to be formed. The algorithm ensures that, while the leaders move towards that circle, they can understand from the position and colors of the other robots, the radius they have to reach.
Next, the algorithm starts the actual formation phase of S i , that is articulated into a 3-step process: • Separation. Each class of robots places itself on a distinct concentric circle centred in the center of SEC.
• Rotation. Each class rotates so that the relative angles of the pattern to be formed are respected.
• Formation. The robots move to their final destination, thus forming S i . In particular, the algorithm now determines which of these three steps the current configuration of the robots is in. This check is carried out by testing conditions ready-to-separate, in-separation, separated, in-rotation, rotated, and in-formation that will be detailed in Sections IV-E, IV-G, and IV-H: these tests are carried out by considering the positions and the colors of the robots. We will prove that, at each time, at most one of these conditions can be verified.
To start the actual formation of S i , each class of robots is first placed on a distinct concentric circle, thus separating the different classes, and then it is mapped onto a ''target'' class of S i (SEPARATION()). The robots of every class then start rotating (one class at the time and never leaving their own circle) in order to be at the correct relative rotational angle with respect to their own target class (ROTATION()).
Once all classes, including the one containing the leader robots, are placed at the correct rotational angle, the robots start moving, one class at the time, towards their target positions, forming S i (FORMATION()). As soon as the robots of a class reach their final destination, they assume a proper color, assigned by a coloring function defined in Section IV-C; the last class to be moved in this process is the leader class. Once the process is completed, it starts again to form the next pattern S (i+1)mod m .
The difficulties obviously derive from the fact that, in this endless process, each robot performs all the required operations in complete asynchrony, without communication or memory (other than the colors), and its movements can be interrupted (they are not rigid).
We now proceed with the detailed description and discussion of the PATTERNSEQUENCE algorithm and of its components. The algorithm is expressed from a robot's point of view, and it is executed, from the start, by a robot every time it performs the Compute operation.

B. SET UP AND LEADERS IDENTIFICATION
Since the robots agree on chirality, it follows that, in the initial configuration , the robots can compute and agree on a total ordering of the symmetricity classes of . For instance, one such ordering can be obtained as follows: classes are ordered from the ones lying on the largest concentric circle (i.e., the SEC) to the ones on the smallest concentric circle of ; if on a concentric circle there is more than one class, these are ordered according to the angles between them in the clockwise direction.
As a consequence, one class can always be elected as leader class. Let IDENTIFYLEADERS( ) denote the procedure that determines a leader class among those on the SEC. The set of robots in this class is denoted by R l , and they will assume the special color GOLD (see Algorithm 2). Note that, due to asynchrony, some robots in R l might become GOLD while others are not active yet; still, the identification of R l is not affected as long as the robots do not move. Therefore: Lemma 3: Within finite time from the start of the algorithm, the robots agree on the leaders, and the leaders are colored GOLD. Throughout the lifetime of the system, the leaders can transition only through color GOLD-OUT or GOLD-IN before becoming GOLD again. Thus, once the initial set-up has been completed, the set R l of leader is always uniquely identifiable by those colors.

C. COLORS
Before describing and analyzing the core steps of the algorithm, we describe the mechanism to decide the colors used by the robots. As already mentioned, the GOLD color is used exclusively by the leader class.
Our algorithm, as will be evident later, always preserves during its execution the symmetricity classes Q of the initial configuration . For each pattern S i , it maps the symmetricity classes Q to those Q i of S i (specifying in this way which class of S i should be formed by which classes of robots). Let τ i : Q → Q i denote such a mapping; notice that this mapping is not necessarily injective, as α(S i ) is possibly smaller than α( ). To take into account repetitions and contractions in the sequence, as well as non-rigid movements and asynchrony of the robots, colors are assigned to classes carefully during the whole process.
The algorithm uses a set (Q, S) of coloring functions λ i : where λ i specifies which color the robots of a class should assume when forming S i . Thus, since α(S i ) is possibly smaller than α( ), λ i indirectly (i.e., in conjunction with τ i ) specifies which set of colors will be associated to each symmetricity class of S i once the robots form S i . LetŜ i denote the pattern S i colored according to λ i , and let q c (S i ) denote its chromatic symmetricity.
The set (Q, S), called overall coloring, is chosen so to have the following properties: Coloring Properties: 1) If r and r belong to the same symmetricity class in , then ∀i, λ i (r ) = λ i (r ). That is, robots that initially belong to the same symmetricity class, will never be assigned different colors.
2) The number of chromatic symmetricity classes of each colored pattern is the same and equal to the number of classes of the initial configuration; i.e., ∀i, . That is, a GOLD robot is always assigned that color in every pattern of the sequence. 5) ∀i, the class colored GOLD according to denotes the colored patternŜ * from which the color GOLD has been removed; if the class colored GOLD had no other colors inŜ * , thenŜ * ¬GOLD denotes the colored patternŜ * from which that class has been removed. Any overall coloring with such properties, if deterministically identifiable from Q and S, can be employed by our algorithm. Note that there are many such colorings. Consider, for example, the overall coloring * (Q, S) defined by the following process: (i) Assign a distinct color to each class of Q, with GOLD assigned to the leader class, and MUTANT 0 to an arbitrarily chosen class, called mutant class; (ii) every class maintains its originally assigned color in all patterns, except for the mutant class which assumes a new color MUTANT i at each repetition of the same pattern (see the example depicted in Figure 4). This overall coloring clearly satisfies the Coloring Properties, and is deterministically identifiable from Q and S.
In the following, we denote by = (Q, S) the global coloring employed by the algorithm. As already mentioned, the leader class determined in the SETUP step is assigned color GOLD by . We will denote by GETCOLORS(S i ) the routine that returns the coloring function λ i for S i according to ; finally, we will say that a robot is λ i -colored, or simply colored, when colored according to λ i .
In addition to the colors employed by , the algorithm uses some special service colors: WHITE-S, WHITE-R, WHITE-F, BRONZE, SILVER, PLATINUM, GOLD-IN, GOLD-OUT, BLACK, as well as OFF which is the initial color of all robots.

D. PATTERN IDENTIFICATION
This step of the algorithm is used to identify the pattern of the choreography that the robots should form next or are currently forming (refer to Algorithm 3). To aid in this process, two tools are used by the algorithm.
The first tool is an injective function f : S → R that maps each element S i ∈ S into a real number f (S i ). The only requirement on f (S i ) is the following: let C be the smallest populated circle in , let S i (C) be the pattern S i scaled so that its smallest populated circle has the same radius as C, let SEC i (C) be the SEC of S i (C), and let SEC(C) be the largest of all SEC i (C); then, each f (S i ) must be greater that the radius of SEC(C).
This mapping is used to inform the non-leader robots of the pattern of the sequence, say S i , they are currently forming or should form. This is done by having the leader robots positioning themselves so that the smallest non-degenerated populated circle C in has a radius that is 1/f (S i ) times the distance between the leader robots and the center of C (refer to the example depicted in Figure 5).
Let RATIO(f (S i )) denote the set of configurations with this property. Since function f (·) is injective, once a configuration in RATIO(f (S i )) has been created, all robots can uniquely agree on the pattern S i that is being currently formed. In particular, observe that, in a configuration of type RATIO(x), any robot can compute the exact value of x as a ratio of two distances measured in its own coordinate system. Thus, even if the robots do not agree on the unit distance, they can agree on the value of this ratio x. This means that, once the leaders have positioned themselves appropriately, all robots understand which pattern should be formed or is already being formed, regardless of their movements provided C is not changed. Our protocol ensures that C will never be changed. This general idea is based on one used in [9], where, however, the movements were rigid and the model SSYNC, while in this paper the movements are non-rigid and the model ASYNC.
To position themselves in such a RATIO configuration, the leaders must know where to go; i.e., they need to know which pattern should be done next. Furthermore, they should continue to have this information, despite their obliviousness, if they are stopped before reaching their destination, due to non-rigidity. In the algorithm, the leaders obtain this information by just observing the set of the non-leader robots; this is achieved through the second tool of the algorithm: the coloring function . In fact, one of the Coloring Properties of is that for i = j,Ŝ i ¬GOLD =Ŝ j ¬GOLD; that is, each pattern S i , once colored according to , is different from all other patterns colored according to even if the leaders are removed from the patterns. In other words, just by looking at the non-leader robots, the leaders know what pattern has just been formed and hence where they should go so to communicate the identity of the next pattern. Note that, at the very beginning, after the SETUP, all robots are OFF while the leaders are GOLD. Also in this case, just by looking at the non-leader robots, the leaders know the pattern to be formed, S 0 , and hence their destination.
Using these two tools, the PATTERNIDENTIFICATION() step (described in Algorithm 3) determines whether (1) a new pattern has to be formed or (2) a pattern is already under formation; in both cases, it identifies the pattern, say P ∈ S.
If P is a new pattern to be formed, using procedure SIGNAL(P) reported in Algorithm 4, the leaders are first colored GOLD; then they start moving along their radiuses, to reach a configuration in RATIO(f (P)). Note that, during these movements, the leaders temporarily change color to GOLD-OUT, so that this transition phase can be clearly identified by all robots. Within finite time, a configuration in RATIO(f (P)) is formed, signalling to the other robots that pattern P ∈ S has to be formed, and the leaders change color back to GOLD. Summarizing: Become GOLD. If All R l are GOLD and at distance rad · x from c Then Return Lemma 4: Starting either from the initial configuration or from any S i colored according to λ i , in finite time the leaders reach, avoiding any collision, a configuration where they are at distance f (S (i+1)mod m ).
Proof: First of all, note that once a robot turns its color from OFF to some other color, it will never become OFF again. Hence, by Lemma 3, within finite time the leader class R l is identified, and those robots are colored GOLD.
Let us assume now that, at time t, the robots are either in the initial configuration (i.e., all robots, but the leaders, are colored OFF); or they form pattern S i ∈ S, with all robots colored according to λ i . As soon as a robot becomes active after time t, we distinguish the two possible cases: 1) At time t all robots are OFF (i.e., we are in the initial configuration, and the robots are about to form S 0 ): hence, SIGNAL(P) is executed, which places the robots in a configuration in RATIO(f (S 0 )). In particular, the only robots that move are the leaders: they first compute f (S 0 ); then, they change their color to GOLD-OUT. Once all leaders are colored GOLD-OUT, they all move radially at distance rad · f (S 0 ) from c, where c is the center of SEC(R \ R l ) and rad is the radius of the smallest non-degenerated populated circle centered in c. Once they reach such a point, by construction, RATIO(f (S 0 )) is achieved and the lemma follows. VOLUME 8, 2020 2) At time t the robots form pattern S i ∈ S, with all robots colored according to λ i : that is, the robots just completed the formation of S i , and the next pattern to be formed is S (i+1)mod m . As soon as a robot becomes active after time t, it executes SIGNAL(P). Following the argument of the previous case, the leaders compute f (S (i+1)mod m ), change color to GOLD-OUT, and they all move radially at distance rad · f (S 0 ) from c. During these moves, no other robot is allowed to move; hence, within finite time all leaders will reach p. At this time, by construction, RATIO(f (S (i+1)mod m )) is achieved and the lemma follows. Finally, we note that both Algorithm 2 and 3 are collision free: in fact, the only robots that are allowed to move are the leaders, and they move outwards radially starting from the SEC of the current configuration.
After the leaders reach distance f (·), the non-leader robots will start forming the next pattern in the sequence within the circle C, by performing the SEPARATE, ROTATE, and FORM steps of the algorithm. Finally, if PATTERNIDENTIFICATION() instead determines that pattern P is already under formation, the robots will continue with their execution of the algorithm.

E. SEPARATION
After PATTERNIDENTIFICATION(), the next step of the algorithm is SEPARATION() (Algorithm 5). The purpose of this step is to create a configuration where each of the α( ) classes of the initial configuration is on a distinct concentric circle. This step uses the control color SILVER and the service color WHITE-S.
Before describing it and discussing its behaviour and properties, some useful definitions of properties of a configuration during the execution of this step are in order.
Definition 5 (Ready-to-Separate): We say that a configuration is ready-to-separate under coloring λ i ∈ if the following two conditions hold: 1) the robots on SEC are GOLD and ∈RATIO(f (S i )); 2) the robots not on SEC are either all OFF or they form S i−1 ¬GOLD. Note that the condition that all robots not on SEC are OFF is satisfied only after the first execution of PATTERNIDENTIFICATION() (Algorithm 3).
Definition 6 (In-Separation): We say that a configuration is in-separation under coloring λ i ∈ if the following conditions hold: 1) the robots on SEC are GOLD and ∈ RATIO(f (S i )); 2) among the robots not on SEC : a) there is at least a SILVER robot; or b) there is at least a WHITE-S robot and σ ( ) = α( ); or c) not all robots are WHITE-S and σ ( ) = α( ). Definition 7 (Separated): We say that a configuration is separated under coloring λ i ∈ if the following two conditions hold: 1) the robots on SEC are GOLD and ∈ RATIO(f (S i )); 2) the robots not on SEC are all WHITE-S, and σ ( ) = α( ).
The SEPARATION( ) step transforms a ready-to-separate configuration into a separated configuration where each of the α( ) classes of the initial configuration is on a distinct concentric circle. Let Cir 1 , . . . , Cir σ ( ) denote the populated concentric circles of the ready-to-separate , with Cir 1 being the smallest one. Informally, starting from i = 1, if Cir i contains multiple (chromatic) classes, we move one class at a time, in an ordered fashion, to a slightly smaller concentric circle, until all classes originally on Cir i have been separated on different circles. When a class is alone on a circle, it is then colored WHITE-S; the process is then applied to Cir i+1 .
In more detail, the separation is performed by iterating the strategy described below.
Since at the beginning of the separation process the configuration is not separated yet, there exists at least one circle that contains multiple classes: let C B be the largest one. Since the robots agree on a common chirality, the classes on C B can be totally ordered: let K 1 , . . . , K k be the distinct classes on C B . Now, all the robots in K 1 become SILVER, and no robot can move as long as there is a non SILVER robot in K 1 . In particular, this process is carried out as follows: let q be symmetricity of the initial configuration (i.e., the number of GOLD robots); if a robot r ∈ K 1 observes at least two classes on C B and it sees that the number of SILVER robots on C B is not q, then r colors itself SILVER. After a finite amount of time, all robots in K 1 become SILVER. Once this occurs, C B contains an integral number k of classes, with k ≥ 2, and exactly q robots on C B are SILVER (those in K 1 ).
Let C A be the largest populated circle, smaller than C B , that does not contain any SILVER robot, and let dis be the distance between C A and C B . Now the algorithm forces all robots in K 1 to move inwards on the circle at distance dis/2 from C B , call it C T . Note that, during their movements, due to asynchrony and non-rigidity, these SILVER robots will create circles between C B and C A that contain only SILVER robots. Routine MOVETOCIR() (Algorithm 6) makes sure that all SILVER robots reach C T . Once all SILVER robots reach C T , C T is the only circle that is populated with just SILVER robots: these robots can now uncolor themselves. Now C B contains one less class. These operations are repeated until C B contains only one class; when this happens this class uncolors itself. The entire process is applied to the new largest circle that contains multiple classes, until the configuration is fully separated.
Proof: Since is ready-to-separate, then, by definition, no robot is SILVER or WHITE-S. Any robot observing in its Look operation, will correctly identify the largest circle C other than SEC (which contains only the GOLD robots); hence, within finite time, one or more of the robots on C will independently and asynchronously become WHITE-S or SILVER (depending on whether on C there is one or more than one class, respectively). As soon as the first of these robots changes color, the configuration becomes in-separation and appears as such to any robot performing its VOLUME 8, 2020 Look operation. Notice that no robot can move during this time.
From this moment on, the algorithm proceeds as follows. Let C B be the largest circle with no GOLD robots on it, containing colored robots; let K 1 , . . . , K k be the colored classes of robots on C B , and let t 0 be the first time a robot executes the SEPARATION( ) process. 1) If k = 1, according to the Algorithm, within finite time these robots will first become SILVER, and then WHITE-S, and no robot can move during this time.
Algorithm 6 MOVETOCIR(C A , C B ) dis := Distance between C A and C B ; C T = Circle of radius dis/2 If I am not on C T Then Move inwards radially to C T .
2) If k > 1, let C A be the largest circle smaller than C B with colored robots on it, and C T be the circle halfway between C B and C A . a) Within finite time, say at time t 1 > t 0 , all robots in K 1 become SILVER, and no robot moves between t 0 and t 1 . b) Within finite time, each SILVER robot will leave C B , moving radially toward C T (MOVETOCIR(C A , C B )); during this time no other robot is allowed to move, hence C B , C A and C T stay invariant. Hence, within finite time, say at time t 2 > t 1 , all SILVER robots will be on C T . Note that at this time the number of chromatic classes is still α( ). c) Once all SILVER robots are on C T (hence, there are exactly q robots on it), each SILVER robot becomes WHITE-S and, within finite time, say at time t 3 > t 2 , all robots on C T become WHITE-S. Thus, at time t 3 , the number of classes on C B decreased by one. By iterating the above process, within finite time, say at t 4 > t 3 , between C B and C A there will be k − 1 circles each containing exactly one class, each colored WHITE-S (note that at time t 4 also C B contains one class colored WHITE-S).
Finally, by iterating the above argument, the claim follows.

F. TARGETS
Before continuing the description and analysis of the algorithm, some discussion is now required on the mechanism used to decide where each robot should go to form the next pattern S i .
As shown in the previous section, procedure SEPARATION() disassembles the previous configuration (or initially ) so that each symmetricity class Q ∈ Q of is in a distinct concentric circle. Once this is done, the algorithm will start the assembly of the next pattern.
In this process the algorithm uses the mapping τ i : Q → Q i , where Q i denotes the set of symmetricity classes of S i . It assigns to each class Q ∈ Q a unique symmetricity class τ i (Q) ∈ Q i of S i , called target class, following the global ordering of the symmetricity classes of S i (this ordering is uniquely identified because of the common chirality). In other words, the mapping τ i , called targeting function, specifies that the goal of the robots of Q should be to move to form τ i (Q). Notice that this mapping, while surjective, is not necessarily injective since α(S i ) is possibly smaller than α( ).
Among the many possible targeting functions usable by the algorithm, we are going to employ the one described in the following. Let Q = Q 1 , . . . , Q a be the a = α( ) classes, Here, the only extra class is Q 5 , whose target is Q 4 . (c) A different next pattern S i to be formed, where: a = 2; Also, here the only extra class is Q 5 , whose target is Q 2 .
each on a distinct concentric circle, after SEPARATION(), where Q j is in a smaller circle than Q j+1 (1 ≤ j < a). Let Q = Q 1 , . . . , Q a be the (totally ordered) a = α(S i ) ≤ a classes of S i , where Q k is in the same circle as or in a smaller circle In other words, φ i classes in are needed to form a single class in S i . Hence, there are e = a − a · φ i classes which are not necessary to form S i ; these extra classes will be all positions on Q a (refer to Figure 7).

G. ROTATION
After SEPARATION(), the next step of the algorithm is ROTATION(), reported in Algortihm 7: this step begins when the current configuration is separated under some coloring λ i ∈ . By construction, after SEPARATION() the robots on each of the concentric circles Cir i on , with 1 ≤ i ≤ σ ( ) = α( ), belong to the same symmetricity class, and on each Cir i there is exactly one symmetricity class. In the following, we will use the concepts of targets and targeting function introduced and defined in the previous section (Section IV-F).
The aim of this phase is to rotate each symmetricity class in so that, if each Q j , 1 ≤ j ≤ a, is projected onto τ (Q j ), then S i would be formed. More specifically, let us first introduce the following definition (refer to Figure 8): Definition 9 (Properly Rotated): A properly rotated robot is defined as follows: 1) All robots on Q 1 are properly rotated.
2) Robots on Q j , with j ≤ a · φ i and (j mod φ i ) = 1, are properly rotated if they form an angle of θ = 360/q(S i ) degrees with respect to Q j−1 .
3) Given Q j , with j ≤ a · φ i and (j mod φ i ) = 1, let Q l = τ (Q j ), and θ be the clockwise angle between Q 1 and Q l . Robots in Q j are properly rotated are all robots in Q r , r < j, are properly rotated, and Q j forms a clockwise angle of θ with respect to Q 1 . 4) Given Q j , with j > a · φ i , robots in Q j are properly rotated if all robots in Q r , r < j, are properly rotated, and Q j form an angle of zero degrees with respect to Q a ·φ i . We will refer to the angle θ used in 2) and 3) as the proper rotation angle. We will say that Q j is properly rotated if all robots on Q j are properly rotated.
This phase uses service colors BRONZE and WHITE-R to rotate all robots, one class at the time according to their total order so that, within finite time, all of them are properly rotated. In particular, by definition, all robots on Q 1 are properly rotated, so they just color themselves WHITE-R. Then, robots on Q 2 color themselves BRONZE, compute their proper rotational angle, and rotate so to become properly rotated; once their rotation process is over, they all color themselves WHITE-R. And so on, one concentric circle at a time, until also the robots on SEC (the GOLD robots) rotate, completing this phase.
Note that the existence of a BRONZE robot in some Cir l implies that Cir l is under the process of rotation. When the rotation is completed all robots will become either WHITE-R (the non leaders) or GOLD (the leaders). This process is denoted by ROTATION( ), and reported in Algorithm 7, where routine ProperlyRotated() and ComputeProperRotationAngle() are defined according to Definition 9.
In the following, we will also make use of the following definitions: Definition 10 (In-Rotation): We say that a configuration is in-rotation under coloring function λ i ∈ if the following conditions hold: 1) the robots on SEC are GOLD, and ∈ RATIO(f (S i )); 2) the robots are on σ ( ) = α( ) concentric circles each containing q robots, the robots in Q 1 are all WHITE-R, and there are robots not WHITE-R (beside the leaders). Definition 11 (Rotated): We say that a configuration with coloring function λ is rotated if the following conditions hold: 1) the robots on SEC are GOLD, and ∈ RATIO(f (S)), for some S i ∈ S; 2) the robots not on SEC are all WHITE-R, and q c ( , λ) = σ ( ). 3) all robots are properly rotated. Lemma 12: Starting from a separated configuration with coloring function λ, within finite time the robots reach a rotated configuration with coloring function λ such that q c ( , λ) = q c ( , λ ), σ ( ) = σ ( ).
Proof: By hypothesis, in there are either WHITE-S or GOLD robots. By construction, all robots on Q 1 are properly rotated (these robots are on Cir 1 ); hence, by Algorithm 7, , and there are no extra robots. Q 1 is already properly rotated. Robots in Q 2 have to rotate of an angle of 360/6 degrees in order to be properly rotated. (c) Q 2 after rotation. (d) Now, let δ be the clockwise angle between Q 1 and Q 2 (see (a)): robots on Q 3 , to become properly rotated, have to form a clockwise angle of δ with respect to Q 1 . (e) Q 3 is now properly rotated; Q 4 has to rotate of δ with respect to Q 2 to be properly rotated. Same argument applies to Q 5 and Q 6 , that have to rotate of an angle of δ (see (a)) with respect to Q 1 and Q 2 , respectively. within finite time, say at time t, they all become WHITE-R, and no other robot is allowed to move until this time.
Now, let C i , 1 < i ≤ σ ( ), be the smallest concentric circle that it is not properly rotated. Also, let t 0 ≥ t be the first time any robot executes the ROTATION( ) process. 1) Within finite time, say at time t 1 > t 0 , all robots on C i will become BRONZE, and no robot moves between time t 0 and t 1 . Thus, at t 1 , on C i there are q BRONZE robots. 2) Now, the robots on C i compute the proper rotation angle θ , according to Definition 9, and they rotate on C i of an angle θ . Within finite time, say at t 2 > t 1 , all robots on C i complete their rotation. 3) Finally, within finite time, say at t 3 > t 2 , all robots on C i change their color: they become WHITE-R.
Finally, by Definition 9 and by induction on the number of concentric circles in , the lemma follows.

H. FORMATION
In this last phase, the robots start from a separated and rotated configuration ; its outcome is to bring the robots in their correct final positions, so that the next pattern of the sequence, say S i , is formed.
Let us first compute the positions of the target circles where the robots have to move to form S i , call them T 1 , . . . , T σ (S i ) : these are obtained by mapping the smallest concentric circle of S i (i.e., the circle where the first class Q 1 = τ i (Q 1 ) resides), onto the smallest concentric circle of (i.e., the one containing Q 1 ), and by scaling consequently all other concentric circles of S i . Also, let k l be the number of classes that have to end up on T l in order to correctly form S i .

Definition 13 (In-Formation):
We say that a configuration with coloring function λ is in-formation if the following conditions hold: 1) the robots on SEC are GOLD, and ∈ RATIO(f (S i )), for some S i ∈ S; 2) the robots not on SEC are either PLATINUM or WHITE-R or λ-colored; if a robot is λ-colored, it is on one of the target circles. Definition 14 (Formed): We say that a configuration with coloring function λ is formed if = S i , for some S i ∈ S, and λ = λ i .
We say that a target T l is complete with respect to S i at time t if the positions of the robots on T l form Cir S i l , and they are correctly colored according to λ i . By convention, we will say that T 0 is complete.
By construction, the robots on the smallest concentric circle in , Cir 1 , are already on T 1 , i.e. they are on the correct positions to form S i . The formation process iterates on all concentric circles in , one at the time, from the smallest to the largest one.
In particular, let us assume that the first j−1 concentric circles in are complete and that there are no robots below T j−1 that are not on their final targets; hence, T j is the first target 90590 VOLUME 8, 2020 that is not complete. The algorithm, reported in Algorithm 8, distinguishes the only three possible cases: 1) Between T j and T j−1 there are robots whose targets are not T j : these robots must move above T j . In this case, the class of robots whose target is not T j and that is closest to T j is first colored PLATINUM, and then moved to a new circle larger than T j . When this occurs, the number of classes whose target is not T j , between T j and above T j−1 , decreases; this process is repeated until this case no longer applies. 2) Between T j and T j−1 there are only classes whose target is T j : in this case, these robots are moved, one class at the time, to T j , using the special PLATINUM color. 3) Between T j and T j−1 there are no robots: the class of robots that is on the smallest circle closest to T j whose target is T j is moved onto T j , using the special PLATINUM color. After finite time, this class reaches T j , and the number of classes on T j increases. Thus, after finite time, all circles in are correctly processed, and S i correctly formed.
Lemma 15: Starting from a rotated configuration with coloring function λ, within finite time the robots reach a formed configuration with coloring function λ with respect to S, where S is the next pattern of the sequence to be formed, such that q c ( , λ) = q c ( , λ ).
Proof: By definition, right after the rotation process in there are no PLATINUM robots; in particular, all robots not on SEC are WHITE-R, and those on SEC are GOLD. By construction, the robots on the smallest concentric circle of are already on their target, T 1 : within finite time, say at time t 0 , they have computed and assumed the color assigned by routine GETCOLORS(S). Starting from this moment, let T j , j ≥ 1, be the smallest target circle which is not complete; i.e., some of the classes that have to be on T j are still missing. Also, let us denote by up j the number of classes between T j−1 and T j , including T j , whose target is not T j (by convention, T 0 is complete). The algorithm now distinguishes three cases: 1) up j > 0. In this case, we have that between T j−1 and T j there are robots whose target is not T j . a) By construction of routine MOVEFROMTODES() (Algorithm 9), within finite time the class of robots (whose target is not T j ) on the largest concentric circle between T j−1 and T j , including T j , say C from , starts becoming PLATINUM. Hence, there is a time t 1 > t 0 where there are exactly q PLATINUM robots on C from . b) At this stage, the goal of the algorithm is to move above T j all robots on C from . In particular, all these robots will be moved to an empty circle C des computed as follows. Let C * be the smallest circle populated by non PLATINUM robots between T j and T j+1 , including T j+1 (note that, at time t 1 , there are no PLATINUM 90592 VOLUME 8, 2020 robots; hence C * is the smallest populated circle between T j and T j+1 ). Then, C des is the circle halfway between T j and C * . Starting at t 1 , robots on C from move radially to C des , again by calling routine MOVEFROMTODES(). Within finite time, say at t 2 > t 1 , all PLATINUM robots will be on C des . c) Once all q PLATINUM robots are on C des , they all become WHITE-F at some time t 3 > t 2 . Note that, between time t 1 and t 3 no other robot is allowed neither to move, hence C des stays invariant, nor to change color. Thus, at time t 3 , the number of classes between T j−1 and T j whose target is not on T j (i.e., the value of up j ), decreases by one. 2) up j = 0 and between T j and T j−1 there are only classes whose target is T j . In this case, all these robots, one class at the time, move to T j . At this point, the proof Algorithm 8 FORMATION( ) Requires: The current configuration is either rotated or in-formation. Also, let S be the next pattern of the sequence to be formed.
If There are WHITE-R robots on the smallest concentric circle of Then If I am on the smallest concentric circle of , and I am WHITE-R Then Color = Color assigned to robots on the smallest concentric circle by routine GETCOLORS(S); Become Color. Else T j = The smallest target circle which is not complete; up j = Number of classes between T j−1 and T j , including T j , whose target is not T j ; Case up j • > 0 C * = The smallest circle populated by non PLATINUM robots between T j and T j+1 , including T j+1 ; C des = Circle halfway between T j and C * ; C from = Largest circle between T j−1 and T j , including T j , populated by classes whose target is not T j ; MOVEFROMTODES(C from , C des , PLATINUM, WHITE-F).
If There are populated circles between T j−1 and T j Then C from = Largest populated circle between T j−1 and T j ; new_color = Color assigned to robots on C from by routine GETCOLORS(S) MOVEFROMTODES(C from , T j , PLATINUM, new_color). Else C from = Smallest circle larger than T j , populated by classes whose target is T j ; If C from is SEC or There is at least one GOLD-IN Then MOVEFROMTODES(C from , T j , GOLD-IN, GOLD). Else new_color = Color assigned to robots on C from by routine GETCOLORS(S) MOVEFROMTODES(C from , T j , PLATINUM, new_color).
is analogous to the previous case, where C des is T j , and the color assigned at the end of the movement is the one assigned by GETCOLORS(S): this is because the robots have reached their final destination to form S. Hence, within finite time, one more class with target T j reaches T j . VOLUME 8, 2020 3) up j = 0 and all robots whose target is T j are on circles larger than T j . Also in this case, all these robots, one class at the time, move onto T j by calling routine MOVEFROMTODES(); the only difference with the previous case is that the robots are moving from a larger circle, T from , to a smaller circle, T j . Hence, within finite time, one more class with target T j reaches T j .
Hence, by induction, within finite time, the last class to move is that of the GOLD robots. Once again, this case is handled by routine MOVEFROMTODES(), where the robots use the color GOLD-IN instead of PLATINUM, and GOLD instead of the the color assigned by GETCOLORS(S). Therefore, within finite time all targets become complete. Since, by definition, a complete target T l coincides with Cir S l , the theorem follows.
I. SYMMETRIC AND S CENTRAL Algorithm 1 assumes both q( ) > 1 and S non-central. In the following, we will briefly outline how to extend it to cover also the case when q( ) > 1 and S is central.
In this case, by Theorem 2, S is feasible if q(S − i ) is a multiple of q( ), for all i. Thus, at the beginning, the first action to do is to move one class to the center c of SEC (note that, being symmetric, there cannot be any robot at c at the beginning): this class will assume the special color BLACK.
In more detail, the SETUP() algorithm (Algorithm 2) is changed as follows: (I) the guard of the first If statement checks also for the presence of BLACK robots (All robots' colors are GOLD and/or OFF and/or BLACK); (II) instead of the first Return statement, routine FIXCENTRAL() (Algorithm 10) is called. This routine ensures that all robots in the class of closest to c first change their color to BLACK, and then move to c.
At this point the execution runs following Algorithm 1, where BLACK robots never move; also, they are never considered by all the other robots (i.e., it is like they do not exists). In other words, − it is considered instead of , and S − i instead of S i , for all S i ∈ S.
By following the same techniques used in the previous algorithms, it is easy to see that within finite time Algorithm 10 moves one class to c: the first class on the smallest populated circle according to the total ordering of the classes. At this point, the BLACK robots will never move again, and the correctness of the overall solution (that covers both central and non-central sequences) follows from previous Lemmas 3-16.

J. ASYMMETRIC INITIAL CONFIGURATION
In case the initial configuration is asymmetric, that is q( ) = 1, the entire protocol is much simpler. Note that, since q( ) = 1, each class contains only one robot, and there is a total order of the classes; hence, the robots can agree on a unique leader and on a common orientation of SEC, i.e., there is a common chirality. In the algorithm, the main difference is that we keep invariant the initial SEC, instead of the smallest concentric populated circle of the starting configuration. Another difference is that the unique leader uses color In this phase, if no robot is colored RAINBOW, the first one in the total order whose removal does not destroy the SEC becomes RAINBOW.

2) PATTERNIDENTIFICATION PHASE
This phase, described in Algorithms 12 and 13, follows an idea similar to that described in Section IV-D. The main differences with Algorithms 3 and 4 is that rad in Algorithm 12 is computed with respect to the SEC \ {r R }.

3) FORMATION PHASE
In this phase, we have the following three steps: Become RAINBOW. If R r is at distance r · x from c Then Return is considered already in its final position, and thus changes color according to GETCOLORS(S). At this point, the pattern to be formed is scaled and rotated accordingly, and the final destination the robots have to reach in order to correctly form S can be computed. Now, a one-to-one mapping is established between the other robots in and the other destinations of the pattern to be formed for which there exists a sequential scheduling of the movements of the robots onto the assigned destination, such that the SEC(R \ {r R }) does not change during each movement. Note that such a scheduler trivially exists.
2) Each robot, excluding the one colored RAINBOW, one at the time (according to scheduling associated to the oneto-one mapping): a) Becomes PLATINUM; b) Moves to its destination; c) Gets the color assigned by GETCOLORS(S). 3) Finally, the only robot that still needs to be placed is the RAINBOW: it moves to the last available target, by using RAINBOW-IN color during its movement.
Once it reaches its destination, it becomes RAINBOW.
The correctness of the case with q = 1 follows the same lines of previous Lemmas 3-15, thus we can conclude that: Lemma 16: Starting from any asymmetric initial configuration (i.e., q( ) = 1), ASYMMETRICPATTERNSEQUENCE allows the robots to perform any feasible choreography in F( ).

K. FINAL ALGORITHM
The final algorithm can be easily obtained by merging the two cases for q( ) = 1 and q( ) > 1. The distinction between these two cases is trivially done at the starting of the execution. In any subsequent configuration, it can be done depending on whether there are GOLD or RAINBOW robots.
By previous Lemmas 3-16, we can conclude that: Theorem 17: Starting from any initial configuration , the robots can perform any feasible choreography in F( ).

V. LIMITATIONS TO THE NUMBER OF COLORS
Since the focus of this paper is on the characterization of the set F( ) of sequences of patterns that can be formed by luminous robots starting from an arbitrary initial configuration , and the feasibility of constructing them, the number of colors used in the construction has not been a concern. It is however an important element worth discussing.
Our protocol employs a coloring function , which assigns colors to the classes of so that, once those classes are mapped by our algorithm to the classes of the pattern to be formed, the Coloring Properties (see Section IV-C) are guaranteed to hold.
From the point of view of characterization and feasibility, the choice of is irrelevant. However, it has an impact on the number of colors used by the robots. For example, the function * described in Section IV-C, provides the following upperbound: The immediate question that arises is how many colors are truly necessary to form any sequence S ∈ F( ), starting from a configuration . Note that in the OBLOT model, where the robots have a single color, it is possible only to form sequences without repetitions and contractions [9]. Intuitively, this is because, if two robots move to occupy the same point performing a contraction, they will not be able to separate anymore and will thus not be able to form alternatively patterns with different number of vertices. VOLUME 8, 2020 Moreover, the presence of repetitions would not allow the robots to ''understand'' which repetition of the same pattern they are currently forming without an external indication. Multiple colors are needed to deal with contractions, repetitions, as well as with asynchrony. We now establish bounds on how many colors are actually needed.
Theorem 18: A set of luminous robots starting from initial configuration , cannot perform a choreography S ∞ = S 0 , . . . , S m−1 ∞ with less than max{α(S)/ min i {α(S i )}, α(S) √ µ(S)} colors. The lower bound holds even if the robots are fully-synchronous and rigid.
Proof: First of all, the robots need to distinguish between at least a = α(S) distinct classes, during the execution of any algorithm. Even if the initial configuration is such that α( ) > α(S), can be contracted to a configuration containing a = α(S) distinct classes, without any loss. However, for forming any pattern S i ∈ S with α(S i ) < α(S), after the contraction, the robots from distinct classes must be distinctly colored before they are contracted to a single class. Thus at least α(S)/α(S i ) colors are needed to perform this contraction and thus the total number of colors c( ) must satisfy For two patterns S i and S j , such that i = j and S i ≡ S j , the coloring λ i and λ j must be visibly distinguishable by the robots. With a distinct (ordered) classes and c colors, it is possible to have c a visibly distinct colorings for patterns having a classes. This gives the following bound on the total number of colors There is a large gap between the lower bound of (4) and the upper bound of (1). To narrow this gap, e.g. by identifying a more efficient coloring or by designing a different pattern formation protocol, is a very interesting and important open question.

VI. CONCLUDING REMARKS
In this paper we have characterized the set F( ) of sequences of patterns that can be formed by luminous robots starting from an initial configuration , showing that F( ) is much larger than the set of sequences of patterns formable without lights characterized in [9].
Our characterization is complete and constructive: We have provided a universal protocol that, for any initial configuration and for any pattern sequence S ∈ F( ), allows the robots to form S even if asynchronous and with non-rigid movements.
Note that we have assumed that α( ) = α(S). It is actually possible that α( ) > α(S); should this be the case, it suffices to apply a simple pre-processing phase that will reduce the number of classes to α(S). In more detail, all extra classes of are moved to the center c of SEC and colored BLACK, following an approach similar to the one adopted in Section IV-I to handle central sequences. From now on: if the next pattern to be formed is central, the BLACK will occupy c; otherwise, after all other classes have occupied their final destinations (hence the pattern is formed up to the robots at c) each of them will choose as destination one of the points of any other class (e.g., the closest class to c), and move there. Once the pattern has been formed they will move back to the center to start the formation of the next pattern.
There are several interesting open questions. The results for formation of sequences of patterns without lights established in [9], and those with luminous robots established in this paper have been derived under the assumption that there is chirality; what happens when there is no chirality ? What happens when robots may fail? What kind of failures can be tolerated in forming patterns? Is it possible to have self-stabilizing algorithms when the robots may start from any arbitrary color?
As mentioned in the previous section, the determination of a better upper-bound on the number of colors, through a more efficient coloring or different pattern formation protocol, is an immediate and natural open problem.

ACKNOWLEDGMENT
Some of these results were presented at the 7th International Conference on Fun with Algorithms.
SHANTANU DAS received the Ph.D. degree in computer science from the University of Ottawa, Canada, in 2007. Since then, he worked with various research institutes, including ETH Zurich, Switzerland, and Technion, Israel, before joining the Faculty of Aix-Marseille University, Marseille. He has been an Associate Professor with Aix-Marseille University, France, since 2013. He is also known as an Expert on distributed algorithms and in particular on algorithms for distributed systems of mobile agents or robotic swarms. He has coauthored more than 60 scientific articles and has presented seminars and invited lectures at several venues on distributed computing. He was awarded the Chair of the excellence in research by CNRS, the National Agency for Scientific Research, France. His current research interests include optimization in distributed systems, energy-aware computing, distributed robotics, programmable matter, dynamic networks, and fault tolerance.
PAOLA FLOCCHINI received the Ph.D. degree from the University of Milan, Italy.
She is currently a Full Professor and the University Research Chair of distributed computing with the School of Electrical Engineering and Computer Science, University of Ottawa, Canada. Her main research areas are theoretical computer science, specifically, distributed computing with special focus on mobility (moving and computing) and on dynamicity (time-varying graphs). She is also interested in fundamental computational and algorithmic issues that arise among autonomous mobile computational entities, in the design of algorithmic solutions in the context of dynamic networks, and in sense of direction and other structural information. In 2019, she was awarded the Prize for Innovation in Distributed Computing.
GIUSEPPE PRENCIPE received the Ph.D. degree in computer science from the University of Pisa, Italy, in 2001.
He is currently an Associate Professor with the Department of Computer Science, Università di Pisa. His research activities focused on the study of mobile and distributed systems. In particular, on the design and analysis of algorithms to control and coordinate a set of mobile sensors totally autonomous that can freely move on a plane. Recently, the interest shifted towards the study of Programmable Matter, that refers to a system composed by a great number of small computing (micro and nano level) programmed to collectively solve tasks exclusively using local interactions (neighborhood). Other research activities focused on the study of mobile agents whose goal is to locate corrupted nodes (called black holes) in a network. Also, some effort was devoted to the study of efficient routing strategies in distributed networks with faulty connections.

NICOLA SANTORO is currently a Distinguished
Research Professor of computer science with Carleton University. He has been involved in distributed computing from the beginning of the field, authoring many seminal articles and founding the main theoretical conferences in the field. He is the author of the book Design and Analysis of Distributed Algorithms (Wiley, 2007). His current research is on distributed computing by mobile entities (agents, robots, sensors, and particles), and on highly dynamic networks. In 2009, he was awarded the Prize for Innovation in Distributed Computing. VOLUME 8, 2020