Constant-Time Complete Visibility for Robots with Lights: The Asynchronous Case †

: We consider the distributed setting of N autonomous mobile robots that operate in Look-Compute-Move (LCM) cycles and use colored lights (the robots with lights model). We assume obstructed visibility where a robot cannot see another robot if a third robot is positioned between them on the straight line segment connecting them. In this paper, we consider the problem of positioning N autonomous robots on a plane so that every robot is visible to all others (this is called the C OMPLETE V ISIBILITY problem). This problem is fundamental, as it provides a basis to solve many other problems under obstructed visibility. In this paper, we provide the first, asymptotically optimal, O ( 1 ) time, O ( 1 ) color algorithm for C OMPLETE V ISIBILITY in the asynchronous setting. This significantly improves on an O ( N ) -time translation of the existing O ( 1 ) time, O ( 1 ) color semi-synchronous algorithm to the asynchronous setting. The proposed algorithm is collision-free , i.e., robots do not share positions, and their paths do not cross. We also introduce a new technique for moving robots in an asynchronous setting that may be of independent interest, called Beacon-Directed Curve Positioning.


Introduction
The classical model of distributed computing by mobile robots models each robot as a point in the plane that is equipped with a local coordinate system and sensory capabilities to determine the positions of other robots [1]. The local coordinate system of a robot may not be consistent with that of other robots. The sensory capability of a robot, generally called vision, allows a robot to determine the positions of other robots in its own coordinate system. The robots are autonomous (no external control), anonymous (no unique identifiers), indistinguishable (no external identifiers), and disoriented (no agreement on local coordinate systems or units of distance measures).
They execute the same algorithm. Typically, robots have unobstructed visibility, that is, robots are transparent such that three collinear robots can see each other. Each robot proceeds in Look-Compute-Move (LCM) cycles: When a robot becomes active, it first gets a snapshot of its surroundings (Look), then computes a destination based on the snapshot (Compute), and finally moves towards the destination (Move). Moreover, the robots are oblivious, i.e., in each cycle, each robot has no memory of its past LCM cycles [1]. Furthermore, the robots are silent because they do not communicate directly, and only vision and mobility enable them to coordinate their actions.
While silence has advantages, many other situations, e.g., hostile environments, assume direct communication. The robots with lights model [1][2][3] incorporates direct communication, where each robot has an externally visible light that can assume colors from a constant-sized set; robots explicitly communicate with each other using these colors. Sharma et al. [9] semi-synchronous O(1) 12 = O(1) Das et al. [2] with Sharma et al. [9] asynchronous O(N) 60 = O(1) Our algorithm is deterministic and has three stages, Stages 0-2, that execute one after another. Stage 0 is needed only if the initial configuration has robots on a straight line; it breaks this initial linear arrangement and places all robots within or on a convex polygon P (convex hull of points) in O(1) time. After that, Stage 1 places all robots on the corners and sides of a convex polygon P . (P is first transformed to P , which is completely contained inside P, and then P is transformed to P . All this happens during Stage 1, which operates in five sub-stages, Stage 1.1-1.5.) Finally, Stage 2 moves each robot on a side of polygon P to a corner of a new convex polygon P (the points that are positioned on the corners of P do not move at this stage). (The precise definitions of all these convex polygons are given later in Section 2). Keys to Stage 1 are corner moving, internal moving, and the beacon-directed curve positioning procedures that permit all interior robots of P to move to the sides of P executing each stage in O(1) time, even in the asynchronous setting. An important part of Stage 2 is a corner insertion procedure that moves side robots of P to corners of P in O(1) time while retaining convexity. This paper is a combination of the ideas presented in IPDPS'17 [13] and SSS'17 [14]. We proved all the properties of Theorem 1 in Reference [13] (IPDPS '17), except that the runtime is O(log N). Moreover, there were three stages, Stages 0-2, with Stage 1 having 5 sub-stages, Stage 1.1-1. 5 [14] (SSS'17) allows to run Stages 1.2, 1.3, and 1.5 in O(1) time each, giving overall time complexity O (1). Therefore, the combination of the ideas of [13,14] makes the runtime of O(1) claimed in this paper possible.

Related Work
The problem of COMPLETE VISIBILITY has been getting much attention recently, after it was proposed for the very first time by Di Luna et al. [5] in 2014. They proposed the problem on a 2-dimesional real plane and we also consider the problem on the real plane. The most closely related works on a plane are listed in Table 1. Di Luna et al. [5] designed the first algorithm for robots with lights to solve COMPLETE VISIBILITY. Their algorithm uses 6 colors in the semi-synchronous setting and 10 colors in the asynchronous setting. Their algorithm arranged robots on corners of a convex polygon, which naturally solves this problem. Although other ways exist to solve COMPLETE VISIBILITY without forming a convex hull, such a convex hull solution provides additional advantages [10,15] in solving some other problems. One example is our recent work on pattern formation [4], where we use the convex hull based COMPLETE VISIBILITY result of this paper in the first step of the four-step algorithm for pattern formation in the asynchronous setting presented in that paper. In this paper, we, too, form a convex hull as a solution to COMPLETE VISIBILITY. Di Luna et al. [5] established the correctness of their algorithm, including a proof of (finitetime) termination; however, the work does not include a runtime analysis. Subsequent work [6,7] reduced the number of colors used for the algorithm. The minimum number of colors is 2, and Sharma et al. provided 2-color algorithm for the semi-synchronous and asynchronous settings of monotonic robot movements (defined later) and 3-color algorithm in the asynchronous setting with non-monotonic robot movements. Therefore, with respect to optimizing the number of colors, there is not much work left except designing a 2-color algorithm for the asynchronous setting of non-monotonic robot movements.
Therefore, the recent focus is mostly on runtime [8,9], keeping the number of colors constant, i.e., O(1). Runtime is a critical factor when robots have to arrange themselves in a target configuration, frequently while working in real-time after being deployed in their work environments. In this direction, Vaidyanathan et al. [8] designed the first algorithm with O(log N) runtime, and with the use of O(1) colors in the fully synchronous setting. Sharma et al. [9] improved on this result with O(1) runtime using O(1) colors in the semi-synchronous setting. Whether this O(1) runtime, O(1) colors result extends to the asynchronous setting, is an important open question left from these existing works, which we address in this paper by designing such an algorithm that works in O(1) time using O(1) colors. Of the three models typically considered, fully synchronous, semi-synchronous, and asynchronous, the asynchronous setting is the weakest, and full synchronous is the strongest; asynchronous algorithms present significant challenges in their design and analysis. Therefore, our work considers the problem in the most difficult setting, and, since the algorithm we present works in this most difficult setting, it subsumes all the existing works designed for the relatively simpler fully synchronous and semi-synchronous settings.
It is interesting to consider whether COMPLETE VISIBILITY can be solved when robots may experience faults. Di Luna et al. [6] observed that their COMPLETE VISIBILITY algorithm for non-faulty robots can solve COMPLETE VISIBILITY tolerating a faulty robot if the faulty robot is in the perimeter of the convex hull formed by the initial configuration of the robots. Aljohani and Sharma [16] provided an algorithm that tolerates one faulty robot (irrespective of whether the faulty robot is in the interior or not) when robots have both-axis agreement in the semi-synchronous setting under rigid movements. The idea was to position all the robots on the corners of a convex hull except the faulty robot that may still be in the interior of the hull in the final configuration. Aljohani and Sharma [16] also showed that COMPLETE VISIBILITY can be solved tolerating, at most, 2 faulty robots under certain assumptions on initial configurations. Recently, Poudel et al. [17] assumed a weaker one-axis agreement and presented an algorithm for COMPLETE VISIBILITY in the asynchronous setting that can tolerate any number of faulty robots. An interesting property of their algorithm is that it solves COMPLETE VISIBILITY without arranging (non-faulty) robots on the corners of a convex hull.
COMPLETE VISIBILITY was also studied in the classical oblivious robots model (no lights) [1]. Di Luna et al. [15] provided the first algorithm in this model considering the semi-synchronous setting. Sharma et al. [12] then provided an algorithm with runtime O(N) in this model under the fully synchronous setting. They also showed that the algorithm of Di Luna et al. [15] has runtime Ω(N 2 ). Bhagat et al. [18] solved COMPLETE VISIBILITY under one-axis agreement in the asynchronous setting.
Recently, COMPLETE VISIBILITY was also studied in the so-called fat robots model (with or without lights) [10,19] in which robots are not points, but non-transparent unit discs with mass occupiying certain area. In the fat robots with lights model, Sharma et al. [11] provided an O(N) runtime COMPLETE VISIBILITY algorithm using 9 colors in the fully synchronous setting under rigid (monotonic) movements. In the fat robots (without lights) model, Sharma et al. [12] provided an O(N) runtime COMPLETE VISIBILITY algorithm in the semi-synchronous setting under rigid movements, with some assumptions on the initial configurations.
Additionally, there is a recent interest in solving COMPLETE VISIBILITY in the grid setting, which discretizes the Euclidean real plane. The grid setting is interesting from the aspect of real applications of robots. Adhikary et al. [20] provided a solution to COMPLETE VISIBILITY using 11 colors in the grid setting and no runtime analysis. We provided an algorithm with a provable runtime bound keeping the number of colors constant [21]. These solutions do not arrange robots on the corners of a convex hull, in contrast to what we do in this paper. Finally, Hector et al. [22] provided matching lower and upper bounds on arranging robots on a convex hull in the grid setting, analogous to what we do in this paper.
Beyond COMPLETE VISIBILITY, the computational power of the robots with lights compared to classical oblivious robots was studied in Reference [2], while the robots are working on the Euclidean plane, and in Reference [23], while the robots are working on graphs.
The obstructed visibility, in general, was also considered in the different problems in different settings. One problem that considers obstructed visibility is the problem of uniform spreading of robots on a line [24]. The robots considered there are classical robots [1] (without lights). The fat robots model, in which an individual robot is a unit disc (rather than a point), also assumes obstructed visibility [10,19,[25][26][27]. However, this body of work do not analyze runtime. Pagli et al. [28] study the problem of collision-free GATHERING classical robots to a small area; however, they do not provide a runtime analysis. Similarly, much work on the classical robot model [24,[29][30][31] for GATHERING does not have runtime analysis, except in a few cases [32][33][34][35][36]. Furthermore, Izumi et al. [37] considered the robot scattering problem (opposite of GATHERING) in the semi-synchronous setting and provided a solution with an expected runtime of O(min{N, D 2 + log N}); here, D is the diameter of the initial configuration. Our paper focuses on runtime analysis and provides an optimal O(1) runtime algorithm for COMPLETE VISIBILITY on a plane for point robots in the lights model in the asynchronous setting keeping the number of colors constant. It will be interesting to see where our runtime approach can help to provide runtime bounds for some/all problems that we discussed above in the paragraph.

Roadmap
In Section 2, we detail the robot model and discuss some preliminaries. We define the beacon directed framework for positioning a set of robots on a curve in Section 3. Sections 4-7 are devoted to proving Theorem 1 using the framework of Section 3. In Section 8, we provide some concluding remarks.

Model and Preliminaries Robots
Let Q = {r 0 , r 1 , · · · , r N−1 } be a set of N robots (agents) in a distributed system. Each robot is represented as a (dimensionless) point that moves in R 2 , the infinite 2-dimensional real plane. In this paper, a point will denote a robot, as well as its position. A robot r i can see, and be visible to, another robot r j iff there is no third robot r k in the line segment joining r i and r j . Each robot has a light that can assume one color at a time; this color comes from a set with a constant number of colors.

Look-Compute-Move
At any given time, a robot r i can be active or inactive. When robot r i becomes active, it performs the "Look-Compute-Move" (LCM) cycle described below.
• Look: For each robot r j that is visible to r i , robot r i observes the position of r j and the color of its light. It is assumed that r i is visible to itself. Each robot observes position of other robots accurately, but within its own local frame of reference. That is, two different robots observing the position of the same point may produce different coordinates. • Compute: After observing the position and light color of visible robots, robot r i may perform an arbitrary computation using only the positions and colors observed during the "look" portion of the current LCM cycle. This computation includes determination of a (possibly) new position to move to and light color for robot r i for the start of next cycle. • Move: At the end of the LCM cycle, robot r i changes its light to the new color (determined during the compute phase) and moves to its new position. Robot r i maintains this new light color from the current LCM cycle until it is possibly changed in the move phase of the next LCM cycle.

Robot Activation and Synchronization
In the fully synchronous setting (F SY N C), every robot is active in every LCM cycle. In the semi-synchronous setting (S SY N C), at least one robot is active, and over an infinite number of LCM cycles, every robot is active infinitely often. In the asynchronous setting (AS Y N C), robots have no common notion of time. No limit exists on the number and frequency of LCM cycles in which a robot can be active except that every robot is active infinitely often. Complying with the ASY N C setting, we assume that a robot "wakes up" and performs its Look phase at an instant of time. An arbitrary amount of time may elapse between the Look and Compute phases and between the Compute and Move phases. We also assume that during the Move phase it moves in a straight line at some (not necessarily constant) speed, but without stopping or changing direction. We will call such robot moves monotonic movements.

Runtime
For the F SY N C setting, time is measured in rounds. Since a robot in the SSY N C and ASY N C settings could stay inactive for an indeterminate number of rounds, we introduce the idea of an epoch to measure runtime. An epoch is the smallest number of rounds within which each robot is active at least once [38]. Let t 0 denote the start time of the algorithm. Epoch i (i ≥ 1) is the time interval from t i−1 to t i where t i is the first time instance after t i−1 when each robot has completed at least one complete LCM cycle. Therefore, for the F SY N C setting, a round is an epoch. We will use the term "time" generically to mean rounds for the F SY N C setting and epochs for the SSY N C and ASY N C settings.

Convex Polygon
For N ≥ 3, represent a convex polygon as a sequence P = (c 0 , c 1 , · · · , c N−1 ) of corner points in a plane that enumerates the polygon vertices in clockwise order. Figure 1 shows a 5-corner convex polygon (c 0 , c 1 , c 2 , c 3 , c 4 ). A point s on the plane is a side point of P iff there exists 0 ≤ i < N such that c i , s, c (i+1)(mod N) are collinear. Figure 1 shows nine side points s 1 -s 9 . A side S = (c i , s 1 , s 2 , · · · , s m , c i+1 ) is a sequence of collinear points in which its beginning and end are adjacent corner points and in which its remaining points are side points. For any pair of points a, b, we denote the line segment connecting them by ab and the length of this segment by length(ab). Moreover, we denote the infinite line passing through a, b by ← → ab . A given polygon P divides the plane into interior and exterior parts. Figure 1 shows the interior of the polygon (the rest of the plane is the exterior). For a given side S of P, the infinite line obtained by extending side S divides the plane into the interior and exterior parts of the side. The interior part of S contains the interior of the polygon. Figure 1 shows the interior and exterior of side c 0 c 1 . The corridor of S is the infinite subregion on its exterior that is bounded by S and perpendicular lines through points c i , c i+1 of S. The corridors of the sides of P are disjoint except for the corner points.

Configuration and Local Convex Polygon
A configuration C t = {(r t 0 , col t 0 ), . . . , (r t N−1 , col t N−1 )} defines the positions of the robots in Q and their colors for any time t ≥ 0. A configuration for a robot r i ∈ Q, C t (r i ), defines the positions of the robots in Q that are visible to r i (including r i ) and their colors, i.e., C t (r i ) ⊆ C t , at time t. The convex polygon formed by C t (r i ), P t (r i ), is local to r i since P t (r i ) depends on the points that are visible to r i at time t. We sometimes write C, P, C(r i ), P(r i ) to denote C t , P t , C t (r i ), P t (r i ), respectively.
Corner Triangle, Corner Line Segment, Triangle Line Segment, and Corner Polygon Let c i be a corner of a convex polygon P. Let c i−1 and c i+1 be the neighboring corners of c i on the boundary of P. Let x i , y i be the points on sides c i c i−1 and c i c i+1 at distance length(c i c i−1 )/8 and length(c i c i+1 )/8, respectively, from c i . We pick distance 1/8-th for our convenience; in fact, any factor less than or equal to 1/2 works for our algorithm. We say that triangle c i x i y i is the corner triangle for c i , denoted as T(c i ), and line segment x i y i is the triangle line segment for c i , denoted as TL i . We say that the interior of P except the corner triangles is the special polygon of P, denoted S(P). Let r be any robot inside T(c i ) and S i be the line segment parallel to x i y i passing through r. Let T (r) be the portion of T(c i ) between S i and c i . We say that S i is the corner line segment for c i , denoted as CL i , if there is no robot inside T (r). Let L i−1 , L i+1 be the lines perpendicular to c i c i−1 and c i c i+1 , respectively, passing through their midpoints. We say the interior of P divided by L i−1 , L i+1 towards c i is the corner polygon of c i , denoted as CP(c i ).

Eligible Area and Eligible Line
Let c i be a corner of P and let a, b be the neighbors (sides or corners) of c i in the perimeter of P, and let u, w be the midpoints of c i a, c i b, respectively. The eligible area for c i , denoted as EA(c i ), is a polygonal subregion inside P within triangle c i uw, omitting the lines from each robot to c i [9]. The eligible areas for any two corners of P are disjoint. EA(c i ) is computed based on C(c i ) and the corresponding polygon P(c i ). Lemma 1 (Reference [9]). The eligible area EA(c i ) for each corner c i of P is bounded by a nonempty convex polygon. Moreover, when c i moves to a point inside EA(c i ), then c i remains as a corner of P and all internal and side robots of P are visible to c i (and vice versa).
It is easy to see that edges c i a and c i b are always in the perimeter of the polygonal subregion EA(c i ). Let x i , y i be two points in c i a and c i b, respectively, that are also in the perimeter of EA(c i ). Points x i , y i can be any point in c i a and c i b between c i and e and c i and f , respectively, where e, f are the neighbor corners of c i in EA(c i ). We say line x i y i is the eligible line for c i and denote it by EL i (Figure 3 illustrates these ideas). Proof. This lemma is immediate since the eligible area EA(c i ) for each corner c i of P is a non-empty convex polygon (Lemma 1); hence, any line connecting any two points on the perimeter of P visits only the points that are in the interior of EA(c i ), except for intersections with lines from internal robots to c i . Convex Polygons P, P , P , and P P is the convex polygon of the points in Q. P is the convex polygon connecting the corners of P after all of them moved to their eligible areas, EA( * ). P is the convex polygon with the corners of P and the side robots of P from those sides with at least two robots.
P is the convex polygon after all side points in P become corner points moving to the exterior of the side of P to which they belong. Observe that P contains P and P , but not P . The left part of Figure 4 depicts P, P , P , and the right part depicts P formed from P .

Beacon-Directed Curve Positioning
The Beacon-Directed Curve Positioning framework uses robots that we call as beacons to define a curve and to guide other robots from their initial positions to final positions on the curve. The beacons start at their final positions on the curve, and all robots are ASY N C robots with lights. Section 4 will use the Beacon-Directed Curve Positioning framework as a tool in constructing an O(1) time COMPLETE VISIBILITY algorithm.
The destination curve is a "k-point curve" (Definition 1) that the positions of the k points can specify, so the positions of the k beacons in the framework determine. For example, the curve can be a straight line that function y = ax + c describes. Two points on this curve (line) enable one to determine constants a and c and so the line. As another example, the curve can be a semicircle that equation (y − a) 2 + (x − b) 2 = c 2 describes. Three points on this curve enable one to determine the constants and the curve. As another example, c + 1 points can determine a cth order polynomial. Note that this section uses a global coordinate system to describe the framework, but the framework works with robots that each have only a local coordinate system.
In most robot algorithms, the movement of a robot in the move portion of an LCM cycle is along a straight line. The Beacon-Directed Curve Positioning framework assumes monotonic movement but does not require straight-line movement. So, for this section, we define a path p i in an LCM cycle of robot r i as a finite curve from initial point (x i , y i ) to final point (x i , y i ).
Let f : A −→ R denote a k-point curve. Let R = {r i : 0 ≤ i < m} denote a set of m robots with lights. The "curve positioning" goal of Beacon-Directed Curve Positioning for each r i at distinct initial point (x i , y i ) is to move r i to distinct final point (x i , y i ) = (x i , f (x i )) on the k-point curve. We refer to robots in R as "waiting robots" as they are waiting to move to the curve. The left beacons are robots b ,i , for 0 ≤ i < k, are initially on the curve at points with x-coordinates smaller than the x-coordinates of the final positions of all waiting robots. Similarly, right beacons are robots b r,i , for 0 ≤ i < k, are initially on the curve at points with x-coordinates larger than the x-coordinates of the final positions of all waiting robots. Figure 5 depicts these concepts.  Definition 3. The Beacon-Directed Curve Positioning Problem is defined as follows: Let f : A −→ R be a k-point curve, let R = {r i : 0 ≤ i < m}, and let B be a set of k left and k right beacons on f such that f , R, B is admissible. Let the initial color of each robot r i ∈ R be wait, and let the beacons in B be colored beacon. The objective is to move each robot r i ∈ R to its final position on f and then change its color to beacon.
The three condition-action pairs below present robot actions to solve the Beacon-Directed Curve Positioning Problem.
Condition 1: Robot r has color wait, and it can see at least k robots with color beacon. Action 1: Robot r changes its color to not-waiting, determines the equation for the k-point curve, f , and moves monotonically on its path p to position itself on curve f . Condition 2: Robot r has color not-waiting. Action 2: Robot r changes its color to beacon. Condition 3: Robot r has color beacon, and it cannot see any robot colored wait. Action 3: Terminate.
Call as a transient robot any robot that is in motion along its path (between its initial and final positions); clearly, a transient robot was a waiting robot at the start of its cycle and is on its way to becoming a beacon at the end of its next cycle. Observe that, if a waiting robot cannot see some beacon, then there must be a transient robot that blocks its view.
We now establish conditions on the number of transient robots and the look times of waiting robots required to block the view of beacons from the waiting robots (Lemmas 3-6).
Then, we will lower bound the increase in the number of beacons from one epoch to the next (Lemma 7) toward establishing an O(log k) epoch run time for the Beacon-Directed Curve Positioning algorithm. In the remainder of this section, we will implicitly assume in all lemmas that admissibility is satisfied; we also consider any robot with color beacon or not-waiting as a beacon. Recall that all robot movements are monotonic.
For any robot r i , define the projection of r i on a k-point curve f : A −→ R (denoted by proj(r i )) as the x-coordinate, x i , of the final position of r i . For a beacon b, its projection on f is proj(b), the x-coordinate of its position. When applied to a set S of robots, proj(S ) refers to the smallest interval within A in which the projections of all elements of S lie.

Lemma 3.
For left (resp., right) beacon b and waiting robot r i , if a transient robot u blocks b from Proof. Recall that admissibility requires that paths not cross. Suppose b is a left beacon, then proj(b) < proj(r i ). If proj(u) > proj(r i ), then the paths of u and r i must cross (see Figure 6b), providing the necessary contradiction. The proof for a right beacon is analogous.
Proof. Without loss of generality, let the x-axis be a horizontal line and let the projection of b be to the left of the projections of all elements of R (see Figure 6a). Since u blocks b from all robots of R, we must have proj(b) < proj(u) < proj(r i ), for all r i ∈ R (Lemma 3). Suppose that proj(r i ) < proj(r j ) and t i > t j . Then, again, the paths of r i and r j will have to cross (see Figure 6c), providing the necessary contradiction.

Remark 1.
An analogous version of the lemma applies to a right beacon, as well.
Lemma 5. Let b be a right beacon and let R = {r i : 0 ≤ i < m} be a set of m waiting robots. For 0 ≤ i < m, let t i denote the time when r i performs its look operation. For any distinct 0 ≤ i, j < m, let proj(r i ) < proj(r j ) and let t i < t j . Then, a transient robot u can block the view of b from at most one waiting robot from R.
Proof. Suppose there exist distinct i, j such that a single transient robot u blocks right beacon b from the view of both waiting robots r i , r j . Then, proj(u) must lie between proj(b ) and proj({r i , r j }). Without loss of generality, let proj(r i ) < proj(r j ) < proj(u) < proj(b ); this implies that t i < t j (from the lemma statement). By a result analogous to that of Lemma 4 applied to a right beacon b , we have t i > t j ; this provides the necessary contradiction so that u cannot block b from the view of more than one waiting robot.
Lemma 4 orders the "look-times" of waiting robots that are blocked from viewing a left beacon by a single transient robot. Given this order, Lemma 5 shows that each right beacon will have to be blocked by a different transient robot, for the same set of waiting robots. For left and right beacons b, b and waiting robots r 0 , . . . , r m−1 , in order from left to right, observe that, at the time instant at which r 0 looks and transient robot u blocks b from r 0 , some transient w blocks b from r 0 , and w cannot block the view of b from r 1 , . . . , r m−1 when they look. The following result captures this observation.  Proof. The min{·} is only to capture the idea that we cannot have more robots on f than we start out with. Blocking two different beacons, b i , b j from the view of a given waiting robot w requires at least two transient robots. Therefore, blocking at least v − k + 1 ≥ k + 1 beacons from any given waiting robot (so that it sees, at most, k − 1 beacons and fails to move during the epoch) needs at least v − k + 1 transient robots, so the next epoch begins with at least v − k + 1 more beacons. Observe that this is independent of the location of the beacons on f . Thus, the number of beacons at the start of epoch e + 1 is at least 2v Therefore, from Lemma 7, in O(log k) epochs, all initial waiting robots have been converted to beacons. This gives the following main result of this section. We use this result in Section 4 with k = 2 and k = 3. For these cases, the number of epochs needed is, at most, 5 and 7, respectively.

Theorem 2.
The algorithm for the Beacon-Directed Curve Positioning Problem using a k-point curve runs on the robots with lights model in O(log k) epochs, using 3 colors in the ASY N C setting.

O(1)-Time ASY N C COMPLETE VISIBILITY Algorithm
Our algorithm consists of three stages, Stages 0-2. In each stage, the robots make progress on converging toward a configuration where all the robots are in a convex hull (see Figure 7).

•
Stage 0 (initialization) handles the case of a collinear initial configuration. The endpoint robots move a small distance perpendicular to the line, which ensures that, in the resulting configuration, not all robots are collinear. Figures 7a and 8 depict a worst case scenario, where all robots are initially collinear. In an F SY N C setting, this stage runs for one round [9]. In an ASY N C setting, we show later that this stage runs in O(1) epochs. • Stage 1 (interior depletion) moves all interior robots of P to the sides of P (Figure 7c). Stage 1 achieves this in five sub-stages, Stages 1.1-1.5, that work as follows.
-Stage 1.1 starts as soon as the robots in C 0 reach a non-collinear configuration ( Figure 9a). Stage 1 moves the corner robots of P ( Figure 9a) to make them corners of P (Figure 9b). -Stage 1.2 first computes the eligible lines for the corners of P and then moves (at least) 4 interior robots of P (all these robots have color start) to those eligible lines. Figure 9c illustrates this stage. -Stage 1.3 moves all the remaining interior robots of P to the eligible lines of the corners of P . Figure 9d shows how the robots in the interior of P in Figure 9c move to EL 3 . -Stage 1.4 moves the robots on the eligible lines to the sides of P . Figure 9e shows how the robots on the eligible lines in Figure 9d become side robots of P . -Stage 1.5 moves the side robots of P and P to the sides of P . Figure 9f shows how the side robots of P and P in Figure 9e become side robots of P .
Stage 1 starts as soon as the robots in C 0 reach to a non-collinear configuration ( Figure 7b). In an F SY N C setting, this stage runs for four rounds [9]. In an ASY N C setting, we show later that each sub-stage runs on O(1) epochs and Stage 1 finishes in O(1) epochs. • Stage 2 (edge depletion) relocates the side robots of P ( Figure 7d) to the corners of P . Figure 7e shows the resulting convex hull. In an F SY N C setting, this stage runs for four rounds [9]. In an ASY N C setting, we show later that this stage runs for O(1) epochs.
At the initial configuration C 0 , all robots in Q have color start. Each robot r i works autonomously having only the information about C(r i ). If P(r i ) is a line segment and N > 3, Stage 0 to a non-collinear C 0 . Stage 1 proceeds autonomously until all robots are colored either corner or side. This acts as the starting configuration for Stage 2, which proceeds autonomously until all robots have color corner for their lights. The algorithm then terminates. The robots execute the stages sequentially one after another. One could use (only for brevity of this discussion) a different palette of colors for each stage (while keeping the number of colors used a constant). Thus, the algorithm can explicitly synchronize at the end of each stage, and our analysis can consider each stage separately. We will indicate on high level (for brevity) how robots collectively and consistently detect the end of each stage. Table 2 gives the transition of colors of the corner, side, and interior robots during the execution of the algorithm. Though robots are oblivious, the colors and configurations that the robots in Q assume synchronize execution of the stages (Table 3) so that robots execute stages (and sub-stages) sequentially one after another.
The algorithm uses 47 colors and runs for a total of O(1) epochs.   We managed to address this challenge by exploiting the eligible area EA( * ) of the corners of P. Notice that all the points inside EA(c i ) for each corner c i are visible to all the robots in the interior of P (while they are not moving). Therefore, we first develop a technique to compute an eligible line EL i for each corner c i of P by the interior robots of P. We then develop a technique to place (at least) four interior robots on an eligible line EL i (note that EL i is inside EA(c i )), two as left beacons and two as right beacons (Definition 3). After that, we develop a technique to maintain the property that the interior robots always see c i (irrespective of the robots on EL i ), and, when there is no transient robot, they see all the robots on EL i . This idea also turned out to satisfy the remaining three conditions (Definition 2) of the Beacon-Directed Curve Positioning framework. Putting these ideas altogether achieves O(1) runtime for Stages 1.2 and 1.3. We then extend these techniques in the same spirit to run Stages 1.5 and 2 in O(1) time. We provide details of Stages 0-2 separately below and outline the major properties they satisfy.

Stage 0-Initialization
The goal of this stage is to transform a collinear initial configuration C 0 to a noncollinear C 0 . Initially at C 0 , all N ≥ 1 robots are stationary and have color start. Let C denote the condition that a robot x can see only one other robot y (for C to be true for x, all robots in Q must be collinear with x a robot at one end of the line). Otherwise, this stage is not needed since all the robots in Q are already on the corners, sides, and interior of a hull P with (at least) three corners.
If C holds, x sets its color to start_moving and moves perpendicular to line xy for a small distance δ. Robot x then changes its color to ready when it becomes active next time. When at least one robot does this move, the configuration changes to a non-collinear configuration for N > 3 (see Figure 8). The cases of N ≤ 3 can be treated separately as special cases. For N = 3, if the robots are not collinear after at least x (or y) moved once, we already have a polygon with three corners. However, if all three robots y, z, x in Q are again collinear after x, y are moved and colored ready, the middle robot z sets its color to ready and moves orthogonal to line xy for δ > 0. Since x, y are already colored ready, they do not make the perpendicular move again, and the move of z guarantees that the collinear configuration translates to a triangle configuration. When N = 1, the only robot x can simply terminate since it sees no other robot. If N = 2, one robot sees the light of other robot ready and figures out that there are only two robots in Q and terminates. This happens at the second (and final) round of the algorithm.
x y x y z z Lemma 8. At the end of Stage 0, one of the following holds: (i) for N = 1, the only robot simply terminates with color start; (ii) for N = 2, both the robots terminate changing their color to ready from start; (iii) for N = 3, all three robots are in the vertices of a triangle with color ready; and (iv) for N > 3, there exists a hull P such that all robots in Q are in the corners, sides, and the interior of P with color ∈ {start, ready}. Proof. For N = 1, it is immediate that the algorithm terminates in one epoch. For N > 3, any collinear configuration translates to a non-collinear configuration in the first epoch, since the two endpoint robots move orthogonal to the line segment in that epoch. For N = 2, the only two robots change their color to start_moving in the first epoch. In the second epoch, they again find themselves in a line and change their color to ready. In the third epoch, each realizes that the other is the only robot in the system and terminates. For N = 3, by the third epoch, the middle robot realizes that it is the only robot between two endpoint robots in the line segment and moves orthogonal to the line by δ > 0 setting its color to ready. Since the endpoint robots have color ready and do not move, this gives a non-collinear (triangle) configuration by the end of that epoch. (e) (f)

Stage 1-Interior Depletion
The goal of this stage is to move the corner, side, and interior robots of P to the corners and sides of P . At the start of Stage 1, each robot is colored start or ready (Lemma 8). A robot with color ready is located at a corner of P. A robot with color start is located at a corner or side or in the interior of P. From Stage 0, we have that P is not a line segment.
Let Q c , Q s , Q i be the sets of robots at corners, sides, and the interior of P, respectively. For a robot r i , if all other visible robots are within an angle of <180 • (=180 • , >180 • , respectively), then r i is a corner (side, interior, respectively) robot. Stage 1 moves robots in all Q c , Q s , Q i to corners and sides of P and colors them as corner and side. Figure 9 illustrates Stage 1.
This stage needs four rounds in the F SY N C setting [9]. In Round 1.1, all corners of P become corners of P with color corner, and the side robots of P change their color to side1 without moving. In Round 1.2, all interior robots of P (also interior in P ) assume color transit moving closer to their closest corners in P , and the robots with color side1 move to the closest sides of P assuming color side. In Round 1.3, some transit colored robots become side robots of P , and, by the end of Round 1.4, all transit colored robots become side robots of P .
Stage 1 organizes into five sub-stages in the ASY N C setting: Stage 1.  Table 3 explains how robots explicitly synchronize stages (and sub-stages) so that a next stage begins only after the current stage finishes.
• Stage 1.1 is to move the corner robots of P (Figure 9a) to the corners of P (Figure 9b) so that all interior robots of P see them (and vice versa). Each corner robot of P first moves to some point inside the eligible area in the interior of P and colors itself corner1. After that, each corner that has a robot in its corner triangle changes color to corner2. Otherwise, if an interior robot in present in P , it changes color to corner3, while if no interior robot is present, it changes color to corner. The side robots of P first color themselves side1, and some of them later change color to special.  Figure 9e shows how the transit robots in Figure 9d become sides of P . • Stage 1.5 is to make the side robots of P and P the side robots of P . For this, if there is only one robot in a side of P, it moves to the closest side in P and takes color side. If there are at least two robots in a side of P, then the side robots of P move to the sides of P and take color side. The robots with colors side1 and special also change their color to side. Figure 9f shows how the side robots of P and P in Figure 9e become side robots of P . At the end of this stage, all the robots in Q are on the corners and sides of P with corners colored corner and sides colored side.
In the following, we provide details of Stages 1.1-1.5 separately below and show that each stage runs for O(1) epochs each.  After c i has color ready, if it sees both r a , r b have color ∈ {ready, side1, corner1}, then it assumes color ready_moving and moves to a point in EA(c i ). When c i becomes active next time, it is already in EA(c i ), and each robot in the sets Q s , Q i sees it (Lemma 1). Corner c i then changes its color to corner1. After that, c i does not move in any future epochs (but it may assume new colors).
After all corners of P move to their EA( * ), they form P . Any robot with color side1 changes its color to special when it becomes a corner (due to the moves of corners of P) and it sees at least one other robot with color side1 or special in the side of P to which it belongs. If the robot with color side1 is the only robot in that side, then it retains color side1. The robot can easily identify this situation since it is in the corridor of the side of P that is formed from the moves of the corners in the side of P to which it belongs. For example, if s i is the only side robot in a side S of P, then it sees no other robot in the corridor of S besides itself.
Lemma 9 (Reference [9]). The interior robots of P remain as the interior robots of P . Lemma 10. P has the same number of corners as P.

Proof.
A corner c i of P moves to EA(c i ) only after it sees both r a , r b have color ∈ {ready, side1, corner1}. Since the interior robots of P do nothing, it only remains to show that side robots of P remain in their original positions. This is immediate since, if r a and/or r b are side robots of P, then they take color side1 before c i moves to EA(c i ). Moreover, after r a and/or r b take color side1, they do not move to their eligible areas even if they become corners of P. The only possibility is that r a , r b might change their color to special. Lemma 11. The corners of P become corners of P and take color corner1 in (at most) three epochs.
Proof. All the robots in the sets R c and R s (corners and sides of P, respectively) change their colors to ready and side1, respectively, in, at most, one epoch. All the corners in R c then move to their EA( * ) by the end of the next epoch with color ready_moving. By the end of the third epoch, the robots that moved to EA( * ) change their color to corner1.
We now describe how the corners of P change their colors from corner1 to corner2, corner3, or corner. For a corner c i with color corner1, we will define conditions to be satisfied on both adjacent sides that will depend on r a , its side S a , and the neighboring corner on that side c i−1 and, likewise, r b , S b , and c i+1 . Figure 10 shows c i (as c 0 ) and its neighboring sides c i−1 and c i+1 (as w and w ) as it moves from P to P . The following lemma deals with visibility of the neighboring corners.

Lemma 12.
Corner c i of P sees both neighboring corners c i−1 and c i+1 .
Proof. Since c i , c i−1 , and c i+1 were the endpoints of S a and S b of P and now moved to their EA( * ), the remaining side robots in S a and S b do not block the view of c i to see both c i−1 and c i+1 . This is because c i and c i−1 and c i and c i+1 are not in the sides S a and S b anymore, and the interior robots of P remain as interior in P (Lemma 9).
Corner c i waits until r a and c i−1 satisfy one of the conditions below for side S a and r b and c i+1 satisfy a corresponding condition for side S b .
(C1) If r a is corner c i−1 , then c i−1 has color ∈ {corner1, corner2, corner3, corner}. (C2) If r a is the only side robot on S a , then r a has color side1 and c i−1 has color ∈ {corner1, corner2, corner3, corner}.
(C3) If r a is one of multiple side robots on S a , then r a has color special and c i−1 has color ∈ {corner1, corner2, corner3, corner}.
When the robots of both sides adjacent to c i satisfy the appropriate conditions, then c i takes a color changing action as follows. If at least one robot is inside corner triangle T(c i ) (defined with respect to P ), then change color to corner2. Otherwise, if at least one robot is in the interior of P , then change color to corner3, but, if no robot is in the interior of P , change color to corner. Lemma 13. When Stage 1.1 finishes, all the corners of P are colored ∈ {corner2, corner3, corner}.
Proof. If there is a corner of P with color start, ready, ready_moving, then either condition C1 or conditions C2 and C3 do not hold for at least one corner of P with color corner1, and that corner cannot change its color to corner2, corner3, or corner.

Lemma 14.
All corners of P are colored ∈ {corner2, corner3, corner} in (at most) one epoch after they are colored corner1.
Proof. The proof is immediate since, after all corners of P are colored corner1, either condition C1 or both C2 and C3 hold for each corner of P .
The corollary below follows from Lemmas 11 and 14. Corollary 1. Stage 1.1 finishes in (at most) four epochs.

Stage 1.2: Positioning the Robots Inside Corner Triangles of the Corners of P on the Corner Line Segments
Note that after Stage 1.1 finishes, the corner robots of P have color corner2, corner3, or corner. The side robots of P have color side1 or special. The interior robots of P have color start. We first provide an high level overview of an algorithm that finishes Stage 1.2 in O(log N) epochs and then provide details of an algorithm that runs Stage 1.2 in O(1) epochs.
The O(log N)-epoch algorithm for Stage 1.2 works as follows. The goal is to move all the interior robots inside corner triangles to position them on the corner line segments CL i . First, two robots are positioned on CL i of each triangle sequentially, if no such two robots are already on CL i . In fact, the robots that are closest to CL i are chosen to perform those actions. Others remain stationary. Those robots that now moved to CL i are colored differently to indicate that they are on that line segment. This can be done in O(1) epochs. After two robots are positioned on CL i of each triangle and colored appropriately, the remaining robots start to move to CL i . For a robot r i to move to CL i , it has to correctly identify CL i . For that, r i has to see (at least) two robots that are on CL i . Therefore, in one epoch after two robots are positioned on CL i , at least a robot moves to CL i since it sees two robots on CL i . In the next epoch, at least a robot moves to CL i . This makes 4 robots on CL i . Therefore, in the third epoch, at least two robots move to CL i , making total 6 robots. Then, 4, 8, 16, . . . number of robots can move to CL i in each subsequent round. Since there are n robots all internal robots may be inside a corner triangle, this whole process finishes in O(log N) epochs. This approach was developed in our IPDPS'17 paper [13].
We are now ready to describe O(1)-epoch algorithm for Stage 1.2 which we developed in our SSS'17 paper [14]. We execute Stage 1.2 in two sub-stages. In Stage 1.2.1, we compute eligible lines for the corners of P . In Stage 1.2.2, we put (at least) four interior robots in each of those lines to serve as left and right beacons as required in the Beacon-Directed Curve Positioning framework of Section 3 to run Stage 1.3 in O(1) epochs.

Stage 1.2.1-Computing Eligible Lines for the Corners of P
Let c i be a corner of P colored corner2. If there are robots inside corner triangle T(c i ), then pick the corner line segment CL i ; otherwise, pick the triangle line segment TL i . Denote this line as L i . We first put four interior robots of P in L i (Figure 11a) and color them transit. This helps later to compute the eligible line EL i for c i .

Stage 1.2.1.1: Moving Four Interior Robots in P to L i :
Let r i be the first robot to be activated among the interior robots Q i after Stage 1.1 finishes. Suppose corner c i of P is closest to r i . Robot r i sees c i and its neighbor corners c i−1 and c i+1 in P (Lemma 1). Therefore, r i can find whether it is inside T(c i ) or not.
Suppose first that r i is inside T(c i ). Let L r i be the line parallel to c i−1 c i+1 passing through r i . If there is no robot in P divided by L r i towards c i , r i changes its color to transit. Notice that, in this case, L r i is in fact the corner line segment CL i . Let r = r i be the robot in Q i closest to CL i (w.r.t. the line parallel to CL i ) and also closest to c i (among the corners of P ). Robot r changes its color to start_moving and moves to the intersection point w of CL i and line c i r . It then changes its color to transit when it becomes active next time. Until r takes color transit, no other robot in Q i moves toward c i because each robot r in Q i closer to c i sees at least a robot with color start or start_moving in the area divided by line L r (parallel to CL i ) towards c i . Similarly as r , two other robots can sequentially move to CL i and take color transit. The remaining robots in Q i do not move toward c i after four transit robots are in CL i since either they see at least a robot with color start or start_moving toward c i from their position or four transit robots already on L i . Suppose now that r i is not inside T(c i ). It moves to TL i at the intersection point of TL i and c i r i assuming color start_moving and colors itself transit when it becomes active next time. The three other robots in Q i closest to c i then move sequentially to TL i as the previous paragraph discussed and color themselves transit.
Corner c i changes its color to corner21 after it sees (exactly) four robots on L i with color transit. This synchronizes it with the interior robots as they also do not move to L i after four robots are already on it. After c i takes color corner21, the robots in the set Q i (with color start) that find c i closest among the corners of P assume color internal (without moving). After all robots in Q i take color internal, c i assumes color corner22 (changing from corner21). All this is possible because c i sees all the robots in Q i (with color start), and vice versa (Lemma 1). The robots in the set Q i , after taking color internal, wait until all corners of P have color ∈ {corner3, corner5, corner}. This is because they see all the corners of P .
Observe that it is possible for some of the corners of P to have fewer than four robots (or even no robot) on L i even after all robots in Q i have color internal. Those corners change their color directly to corner5 from corner2.

Stage 1.2.1.2-Computing Eligible Lines for the Corners of P :
We describe how to compute EL i for c i . Let t 1 , t 2 , t 3 , t 4 be the four robots in L i of corner c i (Stage 1.2.1.1) with t 2 and t 3 between t 1 and t 4 , and t 2 , t 3 being closer to t 1 , t 4 , respectively (Figure 11a). We ask t 1 and t 4 to move to the lines c i t 2 and c i t 3 , respectively, assuming color transit_moving. Robots t 1 , t 4 perform this move only when they have color transit and c i has color corner22. The position they move to in those lines is the 1/8-th point from c i to t 2 and t 3 , respectively. They then change their color to transit1 (Figure 11b). After c i sees both t 1 , t 4 with color transit1, it computes EA(c i ) and a point x i on c i c i−1 (or y i on c i c i+1 ) so that the line, say L i , parallel to t 1 t 4 passing through x i (or y i ) crosses EA(c i ). According to the construction, t 1 t 4 is parallel to t 2 t 3 , and also parallel to c i−1 c i+1 . Let x i on c i c i−1 be the point so that L i crosses EA(c i ). Observe that L i is in fact the eligible line EL i . Corner c i then moves to x i (the procedure for c i moving to point y i is analogous) assuming color corner22_moving (Figure 11c) and changes its color to corner23. Let op i be the position of c i before it moves to x i .
We now describe a technique to put all t 1 , t 2 , t 3 , t 4 on L i (which is EL i ) so that the interior robots of P can recognize it as EL i . Let t 1 be closer to c i than t 4 from the new position x i of c i (the case of t 4 being closer to c i than t 1 is analogous). Robot t 1 moves to the intersection point of L i and t 1 t 2 assuming color transit1_moving (Figure 11d) and then changes its color to transit2 when it becomes active next time. After c i sees t 1 colored transit2, it moves back to its previous position op i (where it was colored corner22) assuming color corner23_moving (Figure 11e). Although c i has no memory of op i , it can compute op i since op i is the intersection point of lines t 1 t 2 and t 4 t 3 . Robot c i then assumes corner24. After this, t 4 with color transit1 moves to the intersection point of L i and t 4 t 3 assuming color transit1_moving (Figure 11f). It then assumes color transit2.
Let op 1 , op 4 be the current positions of t 1 , t 4 , respectively. The robots t 1 and t 4 (after taking color transit2) move either left or right in L i to make room for robots t 2 and t 3 to move to L i without blocking any internal colored robots to see c i and also the robots t 1 , t 2 , t 3 , t 4 on L i . Robot t 1 (and similarly t 4 ) moves as follows. Let ← → c i t 1 be a line that connects t 1 with c i . Let L be a line connecting c i with an internal colored robot r in the left or right of ← → c i t 1 such that, in the cone area QC(r) formed by L and ← → c i t 1 , there is no other internal colored robot. Let w be the intersection point of L i and L . Robot t 1 moves to the midpoint m of the line segment that connects it with w (note that all three points w, t 1 , and m are in L i ) assuming color transit2_moving (Figure 11g). It then changes its color to eligible when it becomes active next time. After t 2 and t 3 see both t 1 and t 4 with color eligible, t 2 moves to point op 1 (the position of t 1 in L i before it moved to point m) and t 3 moves to op 4 (the position of t 4 in L i before it moved) (Figure 11h). Robots t 2 , t 3 then assume color eligible. After c i sees all t 1 , t 2 , t 3 , t 4 are on L i with color eligible, it assumes color corner3. Proof. It is easy to see that, if the robot r in the interior of P is not inside CP(c i ), it does not move to EL i since r does not find c i closest to it among the corners of P . We first show that four robots on CP(c i ) correctly move to L i (which is TL i or CL i ) and then show that they are then correctly positioned on the eligible line EL i .
To prove the first case, it is sufficient to show that an internal robot r i always sees its closest corner c i and two neighboring corners c i−1 and c i+1 of c i in P during Stage 1.2.1. This will allow r i to correctly compute L i and move to it if it is closer to L i than any other interior robot of P .
Notice that r i sees all the corners of P in the beginning of Stage 1.2.1 as no robot has moved to lines CL i or TL i at that time. Let r i−1 , r i+1 be the closest interior robots to corners c i−1 , c i+1 , respectively. Let r i−1 (r i+1 ) be currently moving or have moved to L i−1 (L i+1 ). We will show that r i−1 , r i+1 do not block r i to see c i−1 , c i+1 , respectively. Observe that, since r i−1 (r i+1 ) is currently moving to or has moved to L i−1 (L i+1 ), that means r i−1 (r i+1 ) is closer to c i−1 (c i+1 ) than any other internal robot of P . Moreover, according to the algorithm for Stage 1.2.1.1, except r i−1 (r i+1 ), no other robot is currently moving to c i−1 (c i+1 ).
Let L r i be the line parallel to c i−1 c i+1 passing through r i . Define lines L r i−1 , L r i+1 similarly. Note that, if r i−1 (r i+1 ) is moving to or has already moved to L i−1 (L i+1 ), then no other robot with color start is inside the triangle divided by line L r i−1 (L r i+1 ) towards c i−1 (c i+1 ). Moreover, since the corners c i , c i−1 , c i+1 have already moved to their eligible areas, a unique line connects every internal robot with these corners. Therefore, as r i , r i−1 , and r i+1 are moving toward different corners of P , they do not block the view of r i to see corners c i−1 and c i+1 . Furthermore, no more than four robots will move to L i because the interior robot in CP(c i ) that is closest to L i after four robots are in L i sees all the robots in L i and, hence, simply waits.
We now show that these four robots on L i are correctly positioned on EL i . Note that c i sees all four robots on L i . Robot c i simply waits until four robots are on L i . After four robots are on L i , c i can wait for two of them to take color eligible. At this time, the two robots t 1 , t 4 are on a line in the triangular area divided by line L i towards c i and the line t 1 t 4 is parallel to L i (Figure 11b). As c i now computes EA(c i ) and moves to the point x i on one side c i c i−1 (Figure 11c), the line parallel to t 1 t 4 going through x i must pass through EA(c i ). Now, since the four robots are arranged on two lines t 1 t 4 and L i with two robots on each of them, they provide the bearing to move t 1 , t 4 to EL i . After that, the color eligible of t 1 , t 4 will provide the bearing for t 2 , t 3 to move to EL i . We now show that the execution of Stage 1.2.1 is collision-free. Note that the robots moving to two different corners do not collide since they are closer to those corners than others. The robots moving to L i in Stage 1.2.1.1 do not collide because the lines joining them with the corner c i intersect only at c i (and they do not reach c i ). For Stage 1.2.1.2, it is clear from the construction (see Figure 11) that the robots never share the same positions, and their paths do not cross.
Finally, since all the interior robots of P see all the corners of P , the interior robots do not start Stage 1.2.1 since they see at least a robot with color corner1 until all corners of P are colored corner2, corner3, or corner.

Proof.
We have from Lemma 1 that, in the beginning of Stage 1.2, all interior robots of P can see c i as c i is positioned at a point inside EA(c i ). Since all the interior robots of P can see c i , a unique line joins c i with each interior robot r j of P . Therefore, it is easy to see that two lines c i r j and c i r k joining c i with two interior robots r j , r k of P intersect only at c i .
In Stage 1.2.1.1, when four interior robots t 1 , . . . , t 4 of P move to L i , they move in their lines c i t j , 1 ≤ j ≤ 4, to reach L i ; hence, they do not block any other internal robot in P to see c i (and vice versa). Note that we consider only the robots that are colored internal (or colored start in Stage 1.2.1.1). In Stage 1.2.1.2, when t 1 , . . . , t 4 move to EL i , t 2 , t 3 move again in lines c i t 2 and c i t 3 and t 1 and t 4 move to the points of EL i that are not on any line c i r k joining any interior robot r k (with color internal) with c i (note that r k has not yet moved to L j or EL j of any corner c j of P ). Therefore, all the interior robots (with color internal) see c i even after t 1 , . . . , t 4 moved to EL i .
We now show that all the interior robots of P see all t 1 , . . . , t 4 (in addition to c i ) after t 1 , . . . , t 4 are positioned on EL i . We have from Lemma 1 that any point inside EA(c i ) is visible to all the interior robots (with color internal) of P . Moreover, since c i is already in EA(c i ) due to its move in Stage 1.1 and EL i joins two points in the neighbor edges of c i in the perimeter of P , the lines joining interior robots with c i intersect EL i exactly at one point, and no two interior robots of P are in any line c i r j of an interior robot r j . Therefore, t 1 , . . . , t 4 are visible to all the interior robots of P even after that are positioned on EL i (and vice versa). Moreover, since t 1 , . . . , t 4 are in EL i , they are colored eligible.

Stage 1.2.2: Positioning (at least) Four Interior Robots on the Eligible Lines of the Corners of P
After computing the eligible line EL i for a corner c i of P in Stage 1.2.1, the goal in this stage is to see whether the four robots on EL i with color eligible can serve as left and right beacons to apply the Beacon-Directed Curve Positioning framework of Section 3 to reposition the remaining interior robots of P (with color internal) to the eligible lines in O(1) epochs. If those four robots are positioned such that all the interior robots of P inside the corner polygon CP(c i ) are within the cone area QC(c i ) formed by lines ← → c i t 2 , ← → c i t 3 , then these robots serve as left and right beacons and this stages finishes with c i changing its color to corner4. Otherwise, (at most) four robots inside CP(c i ) move to EL i in this stage so that two of them serve as left beacons and two of them serve as right beacons for the Beacon-Directed Curve Positioning framework. Figure 12 illustrates these ideas. The details are as follows. Let r i be the first robot with color internal to be activated after all the corners of P are colored corner3, corner5, or corner with at least a corner colored corner3. Let r i be closest to corner c i of P than any other corner of P . Robot r i sees c i (Lemma 16) which has color corner3. Robot r i also sees both the neighboring corners c i−1 , c i+1 of c i in P and eligible colored robots t 1 , t 2 , t 3 , t 4 that are on the eligible line EL i of c i (Lemma 16).
Let QC (r i ) be the cone area of P formed by line ← → c i r i and side c i c i−1 of P ; the left of Figure 12 shows the cone areas QC (r 3 ) and QC (r 4 ) of two internal robots r 3 and r 4 . QC (r i ) for r i formed by lines ← → c i r i and c i c i+1 can be defined similarly; the left of Figure 12 also shows QC (r 1 ) and QC (r 2 ) of two internal robots r 1 and r 2 . If there is no other robot with color internal in QC (r i ) (and/or QC (r i )) that is closer to c i than r i , then r i moves to EL i at the intersection point of EL i and c i r i assuming color internal_moving. As depicted in the left of Figure 12, r 1 does not see any other robot closer to c i in QC (r 1 ) and moves to EL i . It then assumes color eligible when it becomes active next time.
Robot r i determines whether there is some other robot r j in the cone area QC (r i ) (and/or QC (r i )) that is closer to c i than itself as follows. Let L , L be two lines perpendicular to c i c i−1 and c i c i+1 , respectively, passing through their midpoints, forming the convex polygon CP(c i ). If there is a robot r j with color internal in QC (r i ) (QC (r i )) divided by line L (L ) towards c i , then r i assumes that r j is closer to c i in QC (r i ) (QC (r i )).
Note that r i always sees c i (Lemma 16). However, r i may not see c i−1 or c i+1 when there is another robot r in CP(c i ) that it currently transient to EL i . Nevertheless, observe that the robots moving to EL i−1 and EL i+1 do not block the view of r i to see c i−1 and c i+1 . Therefore, r i decides to move to EL i if and only if the first robot it sees in both the left and right of c i has color ∈ {corner3, corner4, corner5, corner}. Finally, when r i sees two robots with color eligible in its cone area QC (r i ) (and/or QC (r i )), it does not move to EL i (even if there is no other robot r closer to c i in QC (r i ) and/or QC (r i ) than itself).
As soon as the corner c i sees (at least) four eligible robots in EL i , it assumes color corner4 if the following holds. Let t (t ) be the second robot in EL i from the either end x i , y i of EL i (Figure 12). Let QC(c i ) be the cone area formed by lines ← → c i t and ← → c i t (the area between two thick dotted lines in the right of Figure 12). If all the robots with color internal inside the corner polygon CP(c i ) lie within QC(c i ), c i assumes color corner4. The right of Figure 12 illustrates these ideas, where all the internal robots (shown as black) are within QC(c i ).

Lemma 17.
Let there be at least four eligible colored robots on EL i . All the robots with color internal inside the corner polygon CP(c i ) see c i and the robots on EL i . Furthermore, c i sees all the robots on EL i .

Proof.
The proof is to extend the argument of Lemma 16 for the robots that move to EL i during Stage 1.2.2. We have from Lemma 16 that the points on EL i are visible to all the interior robots of P. Moreover, since any interior robot r j moves to EL i following the line c i r j joining c i with r j , it does not block the visibility of c i to see the robots inside CP(c i ).
Moreover, c i sees all the robots on EL i since there is no other robot in the interior of P divided by EL i towards c i .
Observe that it is possible for some corner c j of P to not have (at least) four eligible robots in EL j even after all the robots inside CP(c j ) moved to EL j . In this case, c j assumes color corner5 (directly from corner3). Observe also that there can be, at most, eight robots on EL i before any corner c i changes its color to corner4 since all four robots t 1 , t 2 , t 3 , t 4 that are positioned on EL i in Stage 1.2.1.2 are such that they are positioned within QC(c i ) and four new robots inside CP(c i ) need to be moved to EL i so that there will be two robots to act as left beacons and two robots to act as right beacons on EL i . This configuration is needed for an admissible configuration for Stage 1.3.

Proof.
We have from Lemma 16 that, when Stage 1.2.1 finishes, any robot with color internal in the interior of P sees c i and all four eligible colored robots on EL i . Robot r i also sees c i−1 and c i+1 if no robot is currently in transit to EL i (irrespective of the interior robots in transit to EL i−1 and EL i+1 ). Note that only the robots inside CP(c i ) move to c i since, otherwise, they will be closest to some other corner of P than c i . Therefore, any robot Lemma 17). Therefore, r i can compute the cone areas QC (r i ) and QC (r i ). Moreover, since r i sees all c i , c i−1 , c i+1 , it can find whether there is some robot inside cone QC (r i ) and/or QC (r i ). Therefore, r i can correctly move to EL i .
We now show that Stage 1.2.2 runs for O(1) epochs. Note that since four robots are already on EL i due to the execution in Stage 1.2.1, at most, four new robots move to EL i at Stage 1.2.2. A robot can move to EL i in two epochs; hence, it needs eight rounds to put four new robots on EL i . After that, the corner c i can color itself corner4 in one epoch.
The execution is collision-free since the robots moving to different eligible lines do not collide. Moreover, the robots moving to the same eligible line also do not collide since the straight lines (joining them with c i ) they follow to reach EL i do not intersect before c i .
Finally, Stage 1.2.2 starts only after Stage 1.2.1 finishes because the robots in the interior of P with color internal see at least a corner with color / ∈ {corner3, corner5, corner} during Stage 1.2.1.

Stage 1.3-Positioning the Remaining Internal Robots of P on the Eligible Lines
In the beginning of Stage 1.3, all corners of P have color ∈ {corner4, corner5, corner} with at least a corner colored corner4 (otherwise, there is no interior robot with color internal in P ).
Using the O(log N)-epoch approach developed in IPDPS'17 [13], all interior robots of P that are on the corner line segments have color eligible and the rest have color internal. The goal is to move the internal colored robots to position themselves on the corner line segments. This is done as follows: Each robot colored internal find the closest corner of P . It then moves toward that corner to be positioned on the corner line segment if it sees at least twp robots that are positioned on that corner line segment with color eligible. The O(log N)-epoch argument for this approach is in the lines of the argument we provided in Stage 1.2.
We now describe the O(1)-epoch approach developed in SSS'17 [14]. At the end of Stage 1.2, all interior robots of P that are on the eligible lines have color eligible and the rest have color internal. Let c i be a corner of P colored corner4, and let r be a robot with color internal that is inside the corner polygon CP(c i ). Note that r is closer to c i than other corners of P and it always sees c i (Lemma 16). Robot r moves as follows.  As soon as c i does not see any robot with color internal or internal_moving (i.e., all robots in the interior of P are placed in the eligible lines), it assumes color corner5. We can prove the following two lemmas. Proof. We have from Lemmas 16 and 17 that the robots inside CP(c i ) see all the robots on EL i at the end of Stage 1.2. The direct extension of those lemmas shows that, if a robot inside CP(c i ) moves to EL i , it will also be visible to the remaining robots inside CP(c i ) waiting to move to EL i . Therefore, if some interior robot r l inside CP(c i ) does not see any robot r e on EL i , then there must be some robot r f that is blocking the view of r e from r l . Since the interior robots do not block the view while they are waiting to move to EL i , there must be a robot currently in transit to EL i . Let y i−1 and x i+1 be the points in sides c i c i−1 and c i c i+1 at distance length(c i c i−1 )/8 and length(c i c i+1 )/8 from c i−1 and c i+1 , respectively. It is easy to show that each robot on x i y i sees all robots that are positioned on c i c i−1 and c i c i+1 between points x i and y i−1 and y i and x i+1 . Therefore, we first move two robots on (i) x i y i and x i+1 y i+1 to y i x i+1 and (ii) x i y i and x i−1 y i−1 to x i y i−1 and color them side2. After that, all robots in x i y i can move to c i x i or c i y i . Figure 13 illustrates the ideas of this stage.

Lemma 21.
Let α be the robot on x i y i and β be the robot on x i+1 y i+1 that are closest to side c i c i+1 among the robots in x i y i and x i+1 y i+1 , respectively. At least one of α, β sees both c i and c i+1 .
Proof. Robot α can see c i as it is closest to x i y i , and no robots are in the triangle {c i x i y i }. Similarly, β can see c i+1 . If α can also see c i+1 , then the lemma is satisfied. Otherwise, a robot on x i+1 y i+1 blocks the view. In that case, β, at the end of x i+1 y i+1 , can see c i as its line of sight passes between α and c i c i+1 , and the lemma is satisfied. Suppose α sees both c i and c i+1 (the case of β seeing c i , c i+1 is analogous). Robot α assumes color transit_moving and moves to the point ρ at distance length(c i c i+1 )/4 from c i in c i c i+1 . Then, α changes its color to side2. Repeat this process so that one more robot α places itself at point at distance length(c i c i+1 )/4 from c i+1 in c i c i+1 . This robot α will be β unless the next robot γ on x i y i after α determines that β cannot see c i , and then α will be γ.

Lemma 22.
Each robot on x i y i sees the robots with color side2 placed at points ρ and of side c i c i+1 . Moreover, they see two robots placed at points ρ and on c i c i−1 defined analogously to ρ and .
Proof. As noted above, each robot on x i y i sees all robots that are positioned on c i c i−1 and c i c i+1 between points x i and y i−1 and y i and x i+1 . Robots at ρ, , ρ , and are in these ranges.
Robot r in x i y i , after seeing two side2 colored robots each in c i c i−1 and c i c i+1 , moves as follows. Let L and L be the lines perpendicular to ← → ρ and ← → ρ passing through r, respectively. Robot r assumes color transit_moving and moves to the intersection point w of ← → ρ and L or w of ← → ρ and L, whichever is closest to it. When r becomes active next, it changes it color to side2 from transit_moving. Proof. The movement to a side of P is an instance of Beacon-Directed Curve Positioning. Robots move to points ρ and on each side c i c i+1 of P and take color side2 in, at most, four epochs. The remaining robots on corner line segments or triangle line segments move to a side of P and take color side2 in two more epochs.
Finally, Stage 1.4 starts only after this stage finishes since the eligible colored robots on the eligible lines see at least a robot with color internal or internal_moving until Stage 1.3 finishes. The corners can change their color to corner5 since they do not see any robot with color internal or internal_moving after all robots in the interior of P moved to the eligible lines of the corners of P .
6.5. Stage 1.5-Making Side Robots of P the Side Robots of P Let S be a side of P with c i , c i+1 its endpoints. There is a side S in P with c i , c i+1 its endpoints and all the side robots in S are in the corridor of S with color either side1 or special. The robots that become side robots in Stage 1.4 are on S with color side2. Stage 1.5 is for the side robots on S . Stage 1.5 starts for the side robots on S when they do not see any other robot with color except corner, side2, side1, special.
We assume in the description below that there are at least two side robots on S and at least a side robot on S . The cases of number of robots on S and S not satisfying this assumption can be treated as special cases and can be executed in a constant number of epochs. Let {s 1 , s 2 , . . . , s w } be the side robots on S with s 1 being closer to c i . Robots s 1 , s w have color special and the others have side1. Since c i , c i+1 are endpoints of S , divide S into three sides S l , S m , S r , where S l = c i s 1 , S m = s 1 s w , and S r = s w c i+1 . Let L l , L r be the lines perpendicular to S passing through s 1 , s w , respectively. Let s 1 , s w be the intersection points of L l , S and L r , S , respectively. Points s 1 , s w divide S into three segments S l , S m , S r , where S l = c i s 1 , S m = s 1 s w , and S r = s w c i+1 . Figure 14 illustrates these ideas. Recall that Stage 1.5 moves the robots on S l , S m , and S r with color side2 to S l , S m , and S r , respectively, and colors them side.
We run two sub-stages, Stage 1.5.1 and Stage 1.5.2, one after another. In Stage 1.5.1, the robots in S l , S r move to S l , S r , respectively. In Stage 1.5.2, the robots in S m move to S m . Stages 1.5.1 and 1.5.2 synchronize by changing the colors of s 1 , s w from special to temp_corner. In both the sub-stages, the idea is to satisfy the conditions for the Beacon- We discuss here how robots on S l move to S l (the case of robots on S r moving to S r is analogous). Our goal is to satisfy the conditions for the framework of Section 3 to run this stage in O(1) epochs. In Sharma et al. [13], this stage runs in O(log N) epochs. Therefore, we first move four robots from S l to S l perpendicular to S l and color them side. To make sure that they serve as left and right beacons for the robots on S l , we move two robots in S l closer to c i and two robots on S l closer to s 1 to S l .
We first provide details on how we move four robots on S l to S l . Let s be the robot adjacent to c i in S l . Robot s knows S l , as it sees both c i and s 1 . Let L be a line perpendicular to S l passing through s . Robot s assumes color side2_moving and moves to the intersection point of L and S l . Robot s then assumes color side when it becomes active next time. There are now three robots in S l . The other robots on S l simply wait facilitating the sequential repositioning since they see a robot moving from S l to S l . Robot s ( = s ) on S l that sees three robots on S l is then moved to S l similarly as s . After s completes its move and assumes color side, there will be four robots on S l . We then move similarly the two robots on S l closer to point s 1 to S l sequentially. After there are four robots on S l , the robots on S l that see at least three robots of S l (with color side or special or corner) move to S l . That is, the robots with color side, special, and corner act as left and right beacons for the robots on side S l with color side2. They move assuming color side3_moving and change that color to side when they become active next time. Robots on S l can determine that they can move to S l when they see (at least) three robots of S l since they either (i) see more than six robots of S l or (ii) if they see fewer than six robots, then there must be (at least) a robot with color side3_moving they see and this indicates that they can move. Moreover, the color side3_moving is not used in any other stage.
Since the robots on S r are moving to S r simultaneously with the robots on S l moving to S l , we have to be careful that the robots of S l (S r ) do not move to S r (S l ). That is, we have to guarantee that the robots on S l do not mistake S r as S l . This is needed for the collision-guarantee of the algorithm. We guarantee this as follows. Let X denote the set of robots with color ∈ {corner, side, special} that the robot s on S l sees when it becomes active. The robots in X may be of S l or S r or both. Though S l (S r ) is a 2-point curve, observe that a special colored robot is at one end and a corner colored robot is at the other end also acting as beacons. Let |X| ≥ 3; otherwise, s does not move. Let L l denote the line formed by at least three robots in X. Let X denote the robots of X that do not belong to L l . Let L r denote the line formed by the robots in X.
Let L denote the line through s perpendicular to S l . Robot s moves to L l if and only if either of the following two conditions is satisfied.
(i) Not all robots on L l are in the same side of L. That is, there is at least one robot of L l on the left and at least one robot of L l on the right from the point x on L l where L intersects L l . This is because the robots in L r will always be on only one side of point x. (ii) If all the robots on L l are in the one side of L, then there is at least one robot r with color side3_moving that s sees in the other side of L (not necessarily on line L l ). Moreover, robot r is closer to L than any robot r that is on line L r (w.r.t. the perpendicular distance from the robot r on L r to L). If these conditions hold for r, then r must be either a robot of L l (that is already on L l or on its way to L l ) or the robot is at w 1 .
Robots s 1 and s w assume color temp_corner as soon as all the robots on S l and S r reach to S l and S r , respectively, and take color side. Observe that s w (s 1 ) sees the robots on S l (S r ) and the robots on S l (S r ) except s 1 (s w ). Proof. We prove this lemma for the robots on S l moving to S l (the proof for the robots on S r moving to S r is analogous). Until four robots are on S l , the robots on S l move sequentially one after another to position themselves on S l . Moreover, as they move perpendicular to S l , they do not land on S m or S r . After four robots are on S l , we show that the robots on S l satisfy all the conditions of the Beacon-Directed Curve Positioning framework. Condition (a) is satisfied as the robots on S l always move perpendicular to S l to position themselves on S l . Conditions (b) and (c) are also satisfied due to the perpendicular moves of the robots on S l . Condition (d) is also satisfied as S l is a line segment and all the waiting robots on S l are between two left and two right beacons with color side, and the waiting robots on S l have color side2. Therefore, through Theorem 2, all the robots on S l move to S l in O(1) epochs.
We now show that the execution of Stage 1.5.1 is collision-free. This is immediate as in the beginning of Stage 1.5.1, no side robots are on S l or S r . Moreover, the robots on S l are in distinct positions, and they always move perpendicularly to S l . Therefore, the robots moving from S l to S l do not collide. Furthermore, as robots on S l do not move to S r (and vice versa), the robots from S l and S r do not collide.
Finally, Stage 1.5.1 starts only when side robots see other robots with colors only in {corner, side2, side1, special}.

Stage 1.5.2-Moving Robots on Segment S m to S m
The robots on S m do not move during Stage 1.5.1. In Stage 1.5.2, similarly to Stage 1.5.1, two robots each on S m closer to s 1 and s w move to S m sequentially and take color side3. After that, the robots of S m that see at least two side3 robots move perpendicularly to S m to the line L m formed by those (at least) two side3 robots, assuming color side2_moving. The robots of S m after moving to L m take color side3 when they next become active. It is easy to prove that L m is in fact S m . After all robots on S m move to S m , the side robots on S m take color side and the endpoint robots of S m take color corner. As S m may already contain side robots (which are, in fact, the side robots of P), when the robots on S m move, they may end up in the positions of S m that other robots already occupy. In this case, the robot moving from S m to S m finds the first position that is free to the left or right of the point m on S m at which a line L passing through the robot and perpendicular to S m intersects S m . This guarantees collision freedom. Therefore, we have the following lemma.  The correctness and collision-freedom follow similarly as in Sharma et al. [9] and the runtime follows combining Corollary 1, Lemmas 15,18,20,23, and Corollary 2.

Stage 2-Edge Depletion
After Stage 1.5 finishes, all robots in Q are on the sides and corners of P colored side and corner, respectively. The objective of Stage 2 is to move all side robots of P to corners of P using the Beacon-Directed Curve Positioning framework (see Figure 7d,e). The algorithm achieves this by working independently on each side S = (c i , s 1 , s 2 , · · · , s m , c i+1 ) of P , placing all side robots of S on an arc of a circle (that is, a 3-point curve) in the corridor of S that traverses the end points c i , c i+1 of S; call this circle a safe circle and denote it by Circle(S). Clearly, this ensures that no three side points of S are collinear. The algorithm further guarantees that P is convex, thus ensuring complete visibility. Note that the technique we developed in IPDPS'17 [13] also runs Stage 2 in O(1) epochs without using the Beacon-Directed Curve Positioning framework; however, the use of the Beacon-Directed Curve Positioning framework streamlines the discussion as it was used in Stages 1.2, 1.3, and 1.5.
Definition 5 (Reference [9]). Let u, v, w, x, y be points such that (a) v, w, x are collinear with w between v and x, (b) u, y are not collinear with line segment vx, and (c) u, y lie on the same side of vx such that line segments uv and xy do not intersect. Let (non-reflex) angles θ 1 , θ 2 < 180 • be θ 1 = ∠(u, v, w) and θ 2 = ∠(w, x, y). Let φ 1 = 45 • − θ 1 4 and φ 2 = 45 • − θ 2 4 . Let L 1 (resp., L 2 ) be the line traversing point v (resp., x) such that it forms an angle φ 1 (resp., φ 2 ) with vx. The point of intersection h of L 1 , L 2 is called the "safe apex" of w w.r.t. u, v, x, y and the triangle vxh is called the "safe area" of vx ( Figure 15). Stage 2 has six stages (see Figure 16). We describe the effect of these stages; Sharma et al. [9] established the correctness and collision-freedom of Stage 2 itself. Initially each side S = (c i , s 1 , s 2 , · · · , s m , c i+1 ) has robots of color side and corner. In Stage 2.1 (the first sub-stage of Stage 2), the two extremal side robots s 1 , s m (next to corners c i and c i+1 ) move into the safe area of side S and become "scouts" d 1 and d m with color scout1 (Figure 16(1)). In Stage 2.2, each scout, d 1 or d m , determines the circle C 1 or C m that traverses points (c i , d i , c i+1 ) or (c i , d m , c i+1 ), respectively. The scout d x with the lower radius circle C x moves to the other circle and both scouts now become "beacons" with color beacon (Figure 16(2)). The safe circle of side S (denoted by Circle(S)) passes through both beacons b 1 and b m and the corners c i , c i+1 . In Stage 2.3, the next pair of extremal points uses the corners and the two beacons to position themselves on Circle(S) as two more beacons s 2 and s m−1 with color beacon (Figure 16(3)). Stage 2.4 similarly adds the third pair of beacons s 3 and s m−2 to Circle(S) with color beacon (Figure 16(4)). At this point, Circle(S) serves as a 3-point function, and the side robots execute the Beacon-Directed Curve Positioning algorithm. Therefore, in Stage 2.5, all remaining side points, s 4 , s 5 , · · · , s m−3 move to Circle(S) (Figure 16 (5)). When no points remain in the interior of the polygon with color side, the beacons color themselves as corners in Stage 2.6 and the algorithm terminates (Figure 16(6)).
During Stage 2, each robot can unambiguously determine with which side S it is associated. This allows us to consider each side in isolation. We show below that this stage satisfies all the conditions required to apply the Beacon-Directed Curve Positioning framework, so it runs in O(1) epochs.

Lemma 26.
During Stage 2, all the side robots of P become corners of P and take color corner. Stage 2 starts only after Stage 1.5.2 finishes. Moreover, Stage 2 runs for O(1) epochs avoiding collisions and then the algorithm terminates.
Proof. Stages 2.1-2.4 run in O(1) epochs since only, at most, two robots are moving in these stages. Stage 2.6 also runs in O(1) epochs as no robots move in this stage and only color computation is needed.
Therefore, it remains to show that Stage 2.5 runs in O(1) epochs, even by ASY N C robots, using the Beacon-Directed Curve Positioning framework. Observe that side S of Circle(S) has 1 ≤ m < N − 8 side robots. Moreover, due to the moves of the side robots of S in Stages 2.1-2.4, six beacons are already on the safe circle, Circle(S).
We now argue that Stage 2.5 satisfies all the conditions required to apply the Beacon-Directed Curve Positioning technique. We first show that the waiting robots on S that are yet to move to Circle(S) satisfy all the conditions for an admissible configuration (Definition 2). Condition (a) is satisfied as the robots in S always move perpendicularly to S to positions on Circle(S). Condition (b) is also satisfied due to their perpendicular moves. Condition (c) is satisfied as the path of any robot on S perpendicular to S intersects Circle(S) at exactly one point, as Circle(S) is a circle that passes through the beacons b 1 and b m and the corners c i and c i+1 . Condition (d) is also satisfied as all the waiting robots are on a line S and Circle(S) passes through the corners c i and c i+1 in the corridor of S. Furthermore, all the waiting robots on S are between the three left beacons and three right beacons with color beacon and the waiting robots on S have color side. Therefore, from Theorem 2, Stage 2.5 finishes in O(1) epochs as k = 3 due to our use of Circle(S) as a curve for the final positions of the robots on S. Thus, Stage 2 runs for O(1) epochs. The collision-freedom in the execution of Stage 2 is immediate as the robots move perpendicularly to S. We also observe that side robots can distinguish the interior of the polygon from the outside; hence, each side S can proceed independently.
Stage 2 starts only after Stage 1.5.2 finishes as, otherwise, the robots on the sides of P with color side see at least a robot with color that is not side or corner.
The algorithm terminates after Stage 2 as all the robots have color corner after Stage 2.5 finishes and that signifies that all the robots in Q are on the corners of a hull P, solving COMPLETE VISIBILITY. Proof of Theorem 1. We have the runtime of Theorem 1 in the ASY N C setting combining the results of Theorems 3-5. We have the number of colors bound of Theorem 1 counting the colors listed in Table 2, which totals 47 different colors.

Concluding Remarks
We have presented, to our knowledge, the first asymptotically optimal, O(1)-time algorithm for COMPLETE VISIBILITY for point robots with lights using O(1) colors in the asynchronous setting with monotonic robot movements in a 2-dimensional real plane. The best previous results for this problem were O(log N) time in the fully synchronous setting and O(1) time for the semi-synchronous setting, both using O(1) colors. The result of this paper significantly improves on these existing results through new techniques as the asynchronous setting is the weakest and fully synchronous setting is the strongest among the three settings, fully synchronous, semi-synchronous, and asynchronous.
The COMPLETE VISIBILITY problem is fundamental with application in solving other problems under obstructed visibility. For example, the solution presented in this paper already played a crucial role in solving the pattern formation problem considered in Reference [4], where the solution was used in the first step of the four-step pattern formation algorithm. The benefit was that since the algorithm presented here arranges robots on the corners of a convex hull, we were able to exploit the knowledge of N obtained after COMPLETE VISIBILITY is solved to plan for how to run steps 2-4 of the pattern formation algorithm of [4].
Several questions remain open. The open questions can be categorized depending on the focus on number of colors, runtime, color/runtime trade-off, and nature of a solution.
We discuss open problems in each categories below. Regarding the number of colors, a major open question is to design a 2-color algorithm (ignoring runtime) that works in the asynchronous setting even when robots have non-monotonic movements. Non-monotonic movements meaning that robots may stop before reaching the destination point or change direction before reaching the destination. The existing solutions in this direction provide a 2-color algorithm only in the case of monotonic movements in the asynchronous setting. The same can be done for the case of fat robots and design a color-optimal algorithm.
Regarding runtime, a major open question is to design a provably-efficient runtime algorithm in the asynchronous setting with non-monotonic movements. Our result in this paper only provides O(1) runtime with monotonic movements. First, of all, it would be interesting to see whether the algorithm of this paper can be extended to establish O(D/∆) runtime algorithm, where D is the diameter of the initial configuration and ∆ > 0 is the minimum distance a robot travels in each move operation. ∆ cannot be zero since, otherwise, the problem may not simply be solved. After that, it would be interesting to see whether the O(D/∆) bound can be improved.
Regarding trade-off, a major open question is to minimize the number of colors from current 60 to say 30 (the best possible is 2) without impacting runtime. Can we do better if we could have two lights on a robot so that it can have information on two colors for the two lights than just a single color for the single light?
Regarding nature of a solution, a major open question is to solve COMPLETE VISIBILITY without robots needing to be arranged on the corners of a convex hull. Can the runtime of O(1) can be achieved for such non-convex hull solution? What about the number of colors? What about handling non-monotonic movements? This aspect can also be considered for fat robots.
Furthermore, can the fault-tolerant algorithms be designed for COMPLETE VISIBILITY? There are some algorithms that handle faults in certain cases, but this direction calls for systematic effort to deal with faults under different settings. All the aforementioned aspects can be considered for robots working on a grid setting, as well.
Finally, are there other algorithms and problems that can benefit from the Beacon-Directed Curve Positioning framework the we developed in this paper? Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest.