#
Time-Optimal Gathering under Limited Visibility with One-Axis Agreement^{ †}

^{*}

^{†}

Previous Article in Journal

Previous Article in Special Issue

Previous Article in Special Issue

Department of Computer Science, Kent State University, Kent, OH 44240, USA

Author to whom correspondence should be addressed.

A preliminary version of this article has been published in SSS’17 conference.

Academic Editor: Giovanni Viglietta

Received: 30 August 2021
/
Revised: 18 October 2021
/
Accepted: 24 October 2021
/
Published: 27 October 2021

(This article belongs to the Special Issue Distributed Systems and Mobile Computing)

We consider the distributed setting of N autonomous mobile robots that operate in Look-Compute-Move (LCM) cycles following the well-celebrated classic oblivious robots model. We study the fundamental problem of gathering N autonomous robots on a plane, which requires all robots to meet at a single point (or to position within a small area) that is not known beforehand. We consider limited visibility under which robots are only able to see other robots up to a constant Euclidean distance and focus on the time complexity of gathering by robots under limited visibility. There exists an $\mathcal{O}\left({D}_{G}\right)$ time algorithm for this problem in the fully synchronous setting, assuming that the robots agree on one coordinate axis (say north), where ${D}_{G}$ is the diameter of the visibility graph of the initial configuration. In this article, we provide the first $\mathcal{O}\left({D}_{E}\right)$ time algorithm for this problem in the asynchronous setting under the same assumption of robots’ agreement with one coordinate axis, where ${D}_{E}$ is the Euclidean distance between farthest-pair of robots in the initial configuration. The runtime of our algorithm is a significant improvement since for any initial configuration of $N\ge 1$ robots, ${D}_{E}\le {D}_{G}$ , and there exist initial configurations for which ${D}_{G}$ can be quadratic on ${D}_{E}$ , i.e., ${D}_{G}=\Theta \left({D}_{E}^{2}\right)$ . Moreover, our algorithm is asymptotically time-optimal since the trivial time lower bound for this problem is $\Omega \left({D}_{E}\right)$ .

In the classic model of distributed computation by mobile robots, also known as the $OBLOT$ model, each robot is modeled as a point in the plane [1,2]. The robots are autonomous (no external control), anonymous (no unique identifiers), indistinguishable (no external identifiers), disoriented (no agreement on local coordinate systems and units of distance measures), oblivious (no memory of past computation), and silent (no direct communication and actions are coordinated via only vision and mobility). They execute the same algorithm. Each robot proceeds in Look-Compute-Move (LCM) cycles: when a robot becomes active, it first obtains a snapshot of its surroundings (Look), then computes a destination based on the snapshot (Compute), and then finally moves towards the destination (Move) [2].

We consider the gathering problem in the $OBLOT$ model, where starting from any arbitrary (yet connected) initial configuration, all robots are required to meet at a single point (or to position within a small area) that is not known beforehand. Relaxing the requirement to meet at a single point by positioning them within a small area is performed to circumvent the impossibility result of gathering to a point in the asynchronous setting, even for two robots [3]. In fact, the algorithm we designed in this article positions all robots either at a single point not known beforehand or within a unit line segment not known beforehand depending on different conditions. Gathering is one of the most fundamental tasks and a central benchmark problem in distributed mobile robotics [4]. Early studies on gathering in the $OBLOT$ model solved it under unlimited visibility, where each robot is assumed to observe (the locations of) all other robots [5], and all the robots are connected to each other. The viewing range defines the maximum possible distance up to which a robot can observe other robots, and the connectivity range defines the maximum possible distance between any two nodes to be connected (i.e., to have an edge between them). Flocchini et al. [6] provided the first algorithm for gathering in the $OBLOT$ model under limited visibility, where each robot can observe (the locations of) other robots within a fixed unit distance (viewing range), and each robot is connected to all other robots within that fixed unit distance (connectivity range), i.e., the viewing and connectivity ranges are the same. Subsequently, several algorithms were studied for this problem under different constraints [2,7,8,9,10]. These studies proved the correctness of the algorithms but provided no runtime analysis (except a proof of finite time termination).

The runtime analysis for gathering has been studied relatively recently [11,12,13,14,15]. Degener et al. [11] provided the first algorithm for this problem with runtime $\mathcal{O}\left({N}^{2}\right)$ in expectation in the fully synchronous setting, where N is the total number of robots. Degener et al. [12] provided an $\mathcal{O}\left({N}^{2}\right)$-time algorithm for this problem in a fully synchronous setting. They also showed that, for some initial configurations, their algorithm is essentially tight by providing a matching lower bound of $\Omega \left({N}^{2}\right)$. Kempkes et al. [13] provided an $\mathcal{O}(OPTlogOPT)$-time algorithm for this problem under a slightly different continuous time setting, where $OPT$ is the runtime of an optimal algorithm. All the above algorithms assume that both the viewing and connectivity ranges are of (fixed) radius 1. Recently, Cord-Landwehr et al. [14] provided an $\mathcal{O}\left(N\right)$-time algorithm for this problem for robots positioned on a grid in a fully synchronous setting. In this algorithm, it is assumed that robots have the viewing range of (distance) 20, i.e., each robot can observe other robots within a fixed distance of 20, but the connectivity range is one, i.e., two robots are connected if and only if they are vertical or horizontal neighbors on the grid. Moreover, each robot is assumed to possess memory for remembering a constant number of previous cycles. Recently, Fischer et al. [15] provided an $\mathcal{O}\left({N}^{2}\right)$-time algorithm for gathering on a grid in the fully synchronous setting, if the memory is not available, by using the improved viewing range of 7.

The intriguing open question is whether a time-optimal algorithm can be designed for gathering under limited visibility and if possible, under what conditions. We define time optimality as follows: Let G be the visibility graph of an arbitrary initial configuration I of $N\ge 1$ robots in a plane. The robots in the system act as nodes of G. There is an edge between any two nodes in G if the distance between these two nodes is at most the connectivity range. Note that, according to the definitions above, the viewing and connectivity ranges may or may not be the same. If each robot is connected to all robots within its viewing range, then the viewing range also serves as the connectivity range; otherwise, the connectivity range is different than the viewing range. In order to solve the gathering problem, G must be connected [2]; G is connected if the robots (or nodes of G) cannot be separated into two subsets such that no robot of the one subset is connected to any robot of the other subset (and vice versa). For example, the authors in [14] used the viewing range 20, but the robots in horizontal or vertical distance of one are connected. Let ${D}_{G}$ be the diameter of G, which is the greatest distance between any pair of nodes in G following the edges of G. Let ${D}_{E}$ be the diameter of the initial configuration I, which is the greatest Euclidean distance between any pair of robots in I. Notice that for any I, ${D}_{E}\le {D}_{G}$, and for some configurations the gap between ${D}_{G}$ and ${D}_{E}$ can be as much as quadratic on ${D}_{E}$, i.e., ${D}_{G}=\Theta \left({D}_{E}^{2}\right)$. Figure 1 illustrates these ideas. Therefore, an $\mathcal{O}\left({D}_{E}\right)$-time algorithm would be time-optimal for gathering starting from any initial connected configuration, since $\Omega \left({D}_{E}\right)$ is the trivial time lower bound for robots to meet at a single point (or to position within a small area) starting from any arbitrary initial configuration. Hence, the open question specifically is whether an $\mathcal{O}\left({D}_{E}\right)$-time algorithm can be designed for gathering for classic oblivious robots under limited visibility.

Recently, Izumi et al. [4] made progress towards addressing this open question. Specifically, they presented an $\mathcal{O}\left({D}_{G}\right)$-time algorithm for gathering on the plane in a fully synchronous setting under limited visibility with the condition that robots agree on one coordinate axis. They used viewing range of one with an assumption that the visibility graph G remains connected even if the edges with the corresponding distance of greater than $1-\frac{1}{\sqrt{2}}$ are removed from it. The assumption on the visibility graph G in Izumi et al. [4] essentially means that the connectivity range is of radius $1-\frac{1}{\sqrt{2}}$ (different and in fact smaller than the viewing range of one).

There is still a large gap between the $\mathcal{O}\left({D}_{G}\right)$ time bound of Izumi et al. [4] and the asymptotically optimal $\mathcal{O}\left({D}_{E}\right)$ time bound, since ${D}_{G}$ can be quadratic on ${D}_{E}$ (Figure 1). This work closes this gap under the same one axis agreement with a slightly modified viewing range of $\sqrt{10}$ and the square connectivity range (if we do not explicitly write “square”, then the viewing and connectivity ranges are circular ) of $\sqrt{2}$ compared to the viewing range of one and the (circular) connectivity range of $1-\frac{1}{\sqrt{2}}$ in [4] (if we consider the viewing range of one similar to [4], we need the square connectivity range of $1-\frac{\sqrt{2}}{\sqrt{10}}$, and our algorithm again achieves $\mathcal{O}\left({D}_{E}\right)$ runtime). Notice that the square connectivity range of distance c means that a robot is connected to all other robots inside or on the boundary of the (axis-aligned) square area with the (diagonal) distance from the robot to each corner of the square c. Notice also that the square connectivity range of $\sqrt{2}$ for a robot is equivalent to the ${L}_{\infty}$-distance of 1 around the robot. Therefore, if we have both the viewing and connectivity ranges of c, then the area they enclose differs if the connectivity range is “square”; otherwise, they enclose the same area. Moreover, in contrast to Izumi et al. [4], which works in the fully synchronous setting, our algorithm works in the asynchronous setting. The algorithm presented by Izumi et al. [4] follows the movements of robots in one direction (either north or east) along ${D}_{G}$ in such a way that in each round, starting from the southmost and westmost robots, each robot moves towards the farthest neighbor within its connectivity range. In our algorithm, robots do not follow ${D}_{G}$; instead, they gather at a point (or within a small area) that is not known beforehand in $O\left({D}_{E}\right)$ rounds. Particularly, in our algorithm, all the robots gather at a single point not known beforehand under both axis agreements and inside a horizontal line segment of length one that is not known beforehand under one axis agreement. A preliminary version of this article has been published in SSS’17 conference [16], and this article extends that version by including many details and proofs that were missing in that version.

In this article, we prove the following result which, to our best knowledge, is the first algorithm for gathering that is asymptotically time-optimal for classic oblivious robots under limited visibility since the trivial time lower bound for gathering under limited visibility starting from any initial configuration of $N\ge 1$ robots is $\Omega \left({D}_{E}\right)$.

For any initial connected configuration of $N\ge 1$ robots with the viewing range of $\sqrt{10}$ and the square connectivity range of $\sqrt{2}$ on a plane, gathering can be solved in $\mathcal{O}\left({D}_{E}\right)$ time in the asynchronous setting, when robots agree on one coordinate axis.

Notice that, the visibility graph G must be connected, since gathering may not be solvable under limited visibility if G is not connected [2,6]. Our selection of the viewing and (square) connectivity ranges and the assumption of one-axis agreement play an important role in proving Theorem 1. For both viewing and (circular or square) connectivity ranges of one, we conjecture that there is no $\mathcal{O}\left({D}_{E}\right)$-time algorithm for gathering of classic oblivious robots in the asynchronous setting, even when robots agree on both coordinate axes. This is because a robot cannot move more than distance one in each LCM cycle to preserve connectivity, and only the end robots can move in each cycle. Therefore, if the robots are connected as shown in Figure 1, $O\left({D}_{G}\right)$ time is required to gather them since only end robots can move and the rest cannot. For the viewing and (circular or square) connectivity ranges of constant $>1$, we conjecture that there is no $\mathcal{O}\left({D}_{E}\right)$-time algorithm for gathering of classic oblivious robots if the robots do not agree on any coordinate axis. This is because the robots’ movements become arbitrary as there is no agreement on the coordinate axes. Thus, robots can only gather if they move following the diameter ${D}_{G}$, which only provides an $O\left({D}_{G}\right)$-time algorithm.

Similarly, let ${L}_{b}$ be the bottommost horizontal line (parallel to L) so that the robots of I are either on ${L}_{b}$ or north of ${L}_{b}$. The main idea is to show that the robots on ${L}_{b}$ do not move south of ${L}_{b}$ forever. Specifically, we show that robots on ${L}_{b}$ wait for all the robots in the north of ${L}_{b}$ so that they meet at distance (at most) D south of ${L}_{b}$ where D is proportional to the horizontal diameter of the initial configuration I. This is achieved by asking robots not to make any diagonal, horizontal, or vertical hops if they see at least a robot in the north at vertical distance 1 (or more) from their positions (i.e., on or outside the connectivity range of the corresponding robot).

Gathering on a predefined point has been studied in several papers [22,23,24]. These papers studied gathering in the context of robots with an extent (i.e., fat robots). Applying these algorithms to the classic model solves gathering in $\mathcal{O}\left(D\right)$ time (provided that gathering point is known to robots), where D is the largest distance from any robot to the predefined gathering point. However, the runtime bound is provided only for the grid, and the gathering point is known to robots a priori. Recently, Braun et al. [25] studied the gathering problem in a three-dimensional Euclidean space under limited visibility and presented $O\left({n}^{2}\right)$-time and $O({D}_{E}\xb7{n}^{\frac{3}{2}})$-time algorithms in the fully synchronous and continuous time models, respectively.

The question of gathering on graphs instead of gathering in the plane was studied in [26,27,28]. Di Stefano and Navarra [27] assumed unlimited visibility and an asynchronous setting and proved the optimal bounds on the number of robot movements for special graph topologies such as trees and rings. D’Angelo et al. [28] showed that gathering can be solved in grids without multiplicity detection. Di Stefano and Navarra [26] extended the results of [28] to infinite grids and bounded the total number of robot movements.

Gathering is solved by circumventing the impossibility of gathering at a single point in some recent papers. The relaxation is on the gathering requirement: Gathering occurs within a small area instead of at a point. A prominent paper that solves gathering in a small area is written by Cord-Landwehr et al. [14] in which, starting from any arbitrary configuration on a grid, robots gathered within a $2\times 2$-sized grid area. Cord-Landwehr et al. [29] provided an $\mathcal{O}\left(N\right)$-time algorithm for the robot convergence problem (converging toward a single not predefined point) [30].

Izumi et al. [31] considered the robot scattering problem (opposite of gathering) in the semi-synchronous setting and provided an expected $\mathcal{O}(min\{N,{D}^{2}+logN\})$-time algorithm; here, D is the diameter of the initial configuration.

All the previous algorithms, including Izumi et al. [4], work in the fully synchronous setting, except for [11] which works in the one-by-one activation setting (also known as sequential activation). Our algorithm works in the asynchronous setting. Furthermore, all previous algorithms assume that when two or more robots move to the same location, they are merged as only one robot. Our algorithm does not merge robots; in other words, even if robots located at the same position are activated at different times, the gathering progress is achieved through the (individual) moves of those robots.

- Look: For each robot ${r}_{j}$ that is within the viewing range of ${r}_{i}$, ${r}_{i}$ can observe the position of ${r}_{j}$ on the plane. Robot ${r}_{i}$ also knows its own position;
- Compute: In any cycle, robot ${r}_{i}$ may perform an arbitrary computation using only the positions observed during the “look” portion of that cycle. This includes determination of a (possibly) new position for ${r}_{i}$ for the start of next cycle;
- Move: At the end of the cycle, robot ${r}_{i}$ moves to its new position.

(Initial Visibility Graph). The visibility graph $G\left(I\right)=(\mathcal{Q},E)$ of any arbitrary initial configuration I of robots is the graph such that, for any two distinct robots ${r}_{i}$ and ${r}_{j}$, $({r}_{i},{r}_{j})\in E$ where ${r}_{j}$ is positioned on or inside $SQ\left({r}_{i}\right)$ (or vice-versa).

$SQ(\ast )$ provides connectivity for robots with square connectivity range $\sqrt{2}$. The gathering problem may not be solvable under limited visibility if the initial visibility graph $G\left(I\right)$ is not connected [2,6]. Therefore, we assume that $G\left(I\right)$ is connected at time $t=0$. Moreover, any algorithm for gathering must maintain the connectivity of $G\left(I\right)$ during its execution until a gathering configuration is reached. For the sake of clarity, we denote by ${G}_{t}\left(I\right)$ the visibility graph $G\left(I\right)$ for any time $t\ge 0$.

(Ideal Gathering Configuration). An ideal gathering configuration is one where all robots are at a single point that is not known beforehand.

(Relaxed Gathering Configuration). A relaxed gathering configuration is one where all robots are on a horizontal segment of length 1 unit that is not known beforehand.

The relaxed gathering configuration (Definition 3) is inspired from the recent work of Cord-Landwehr et al. [14], where the authors modified the ideal gathering configuration (Definition 2) to solve gathering on a grid by locating all robots within a $2\times 2$-sized square area that is not known beforehand. Additionally, Definition 3 helps us to circumvent the impossibility results relative to gathering to a point in the $\mathcal{ASYNC}$ setting [3], even when $N=2$, by gathering the robots in a unit horizontal line segment. As an example, consider two robots ${r}_{i},{r}_{j}$ at distance 1 apart on a horizontal line working under an $\mathcal{ASYNC}$ setting. Let ${r}_{i}$ and ${r}_{j}$ activate at the same time and ${r}_{i}$ moves to the position of ${r}_{j}$ and ${r}_{j}$ moves to the position of ${r}_{i}$ as both of them move in the horizontal line. This scenario may repeat infinitely since ${r}_{i}$ and ${r}_{j}$ do not have common agreement on east or west under one-axis agreement on north. By using our square connectivity range $\sqrt{2}$, the viewing range $\sqrt{10}$ and one-axis agreement, even when $N=2$, the robots can reach a horizontal segment of length one unit. The viewing range helps each robot ${r}_{i}$ to see whether there is a robot outside $SQ\left({r}_{i}\right)$ and decide whether Definition 3 is reached.

Under both axis agreement, our algorithm provides an ideal gathering configuration (Definition 2). Under one-axis agreement, our algorithm provides a relaxed gathering configuration (Definition 3). Since we focus on runtime, we do not explicitly characterize the configurations that do not achieve Definition 2 under one-axis agreement, but we simply prove that all the configurations (at least) attain Definition 3 in $\mathcal{O}\left({D}_{E}\right)$ time.

In this section, we define the grid model that is a restriction imposed on the Euclidean plane. The motivation behind designing an algorithm for this model is that it is simple to understand and easy to analyze. We design and analyze an algorithm without the grid restriction in Section 4. In the grid model, a robot moves on a two-dimensional grid and changes its position to one of its eight horizontal, vertical, or diagonal neighboring grid points. Throughout this section, we assume that robots agree on both coordinate axes, and each robot has the viewing range of two. Moreover, each robot has the square connectivity range of $\sqrt{2}$. We say gathering is performed when the robot configuration satisfies Definition 2.

The pseudocode of the algorithm is given in Algorithm 1. Depending on the positions of other robots within its viewing range, ${r}_{i}$ distinguishes diagonal, horizontal, and vertical hops, which we discuss separately below. A robot ${r}_{i}$ hops on one of its neighboring grid points based on the diagonal, horizontal, or vertical pattern that matches the snapshot it takes in the Look phase. Notice that since robots agree on north, ${r}_{i}$ never hops on any of the three neighboring grid points relative to north from its position, i.e., ${r}_{i}$ hops only to one of its five neighboring grid points on the same horizontal line ${L}_{i}$ or south of ${L}_{i}$. We will show that this allows achieving a gathering progress in every epoch. Since robot moves are not instantaneous due to the $\mathcal{ASYNC}$ setting, a robot ${r}_{i}$ also does not move if it observes at least one robot in the north of ${L}_{i}$ inside or on $SQ\left({r}_{i}\right)$. This is crucial for guaranteeing that robots do not move south forever. Robot ${r}_{i}$ terminates when it sees no other robot inside or on $SQ\left({r}_{i}\right)$ other than its position.

In this hop, the robot moves diagonally at a distance of $\sqrt{2}$. Figure 3a,b illustrate diagonal hops.

Algorithm 1: The algorithm for gathering on a grid (under both axis agreement) | |

/*$\phantom{(}$ In every LCM cycle, each robot ${r}_{i}$ does the following when it | |

activates: $\phantom{(}$ */ | |

/* Look: */ | |

1 | $({x}_{i},{y}_{i})\leftarrow $ current position of robot ${r}_{i}$ in the grid graph G; |

2 | $C\left({r}_{i}\right)\leftarrow $ snapshot of the positions of other robots within the viewing range of ${r}_{i}$; |

/*$\phantom{(}$ Compute:$\phantom{(}$ */ | |

3 | $SQ\left({r}_{i}\right)\leftarrow $ square area for robot ${r}_{i}$; |

4 | ${L}_{i},{L}_{i}^{\prime}\leftarrow $ horizontal and vertical lines passing through ${r}_{i}$, respectively; |

5 | ${L}_{i,t},{L}_{i,b}\leftarrow $ horizontal lines parallel to ${L}_{i}$ and passing through $({x}_{i},{y}_{i}+1)$ and |

$({x}_{i},{y}_{i}-1)$, respectively; | |

6 | ${L}_{i,r},{L}_{i,l}\leftarrow $ vertical lines parallel to ${L}_{i}^{\prime}$ and passing through $({x}_{i}+1,{y}_{i})$ and |

$({x}_{i}-1,{y}_{i})$, respectively; | |

7 | ${d}_{i}\leftarrow $ destination point for ${r}_{i}$ to move; |

8 | If${r}_{i}$ sees no other robot in any of the neighboring grid points on $SQ\left({r}_{i}\right)$ then |

9 | ${r}_{i}$ terminates; |

10 | Else if${r}_{i}$ sees at least a robot in $SQ\left({r}_{i}\right)$ in North of ${L}_{i}$ then |

11 | ${r}_{i}$ keeps waiting; ${d}_{i}\leftarrow ({x}_{i},{y}_{i})$; //$\phantom{(}$ do nothing |

/*$\phantom{(}$ Check the following two conditions for a diagonal hop. */ | |

12 | Else if${r}_{i}$ sees no robot in $SQ\left({r}_{i}\right)$ on or West of ${L}_{i}^{\prime}$ (except at its position), and sees |

at least a robot on ${L}_{i,r}$ that is part of $SQ\left({r}_{i}\right)$ in South of ${L}_{i}$ then //$\phantom{(}$Figure 3a | |

13 | ${d}_{i}\leftarrow ({x}_{i}+1,{y}_{i}-1)$; |

14 | Else if${r}_{i}$ sees no robot in $SQ\left({r}_{i}\right)$ on or East of ${L}_{i}^{\prime}$ (except at its position), and sees |

at least a robot on ${L}_{i,l}$ that is part of $SQ\left({r}_{i}\right)$ in South of ${L}_{i}$ then //$\phantom{(}$Figure 3b | |

15 | ${d}_{i}\leftarrow ({x}_{i}-1,{y}_{i}-1)$; |

/*$\phantom{(}$ Check the following condition for a horizontal hop.$\phantom{(}$ */ | |

16 | Else if${r}_{i}$ sees at least a robot on $({x}_{i}+1,{y}_{i})$ and sees no other robot in $SQ\left({r}_{i}\right)$, |

except on ${L}_{i}$ in the East then // $\phantom{(}$Figure 3c | |

17 | ${d}_{i}\leftarrow ({x}_{i}+1,{y}_{i})$; |

18 | Else//$\phantom{(}$ Check either of the following two conditions for a vertical |

hop. | |

19 | If ${r}_{i}$ sees no robot in $SQ\left({r}_{i}\right)$ in North of ${L}_{i}$ and sees at least a robot ${r}_{j}$ on ${L}_{i}^{\prime}$ in |

South in $SQ\left({r}_{i}\right)$ then// $\phantom{(}$Figure 3d | |

20 | ${d}_{i}\leftarrow ({x}_{i},{y}_{i}-1);$ |

21 | Else if ${r}_{i}$ sees no robot in $SQ\left({r}_{i}\right)$ in North of ${L}_{i}$ and sees at least one robot each |

on two lines ${L}_{i,l}$ and ${L}_{i,r}$ on or South of ${L}_{i}$ in $SQ\left({r}_{i}\right)$ then //$\phantom{(}$Figure 3e | |

22 | ${d}_{i}\leftarrow ({x}_{i},{y}_{i}-1)$; |

/*$\phantom{(}$ Move:$\phantom{(}$ */ | |

23 | ${r}_{i}$ moves to ${d}_{i}$; |

/*Note:Each robot reaches a grid point after the completion of a | |

cycle. But a robot may not necessarily see other robot(s) (which | |

is/are moving) only at grid points since the robots may perform | |

their LCM cycles at arbitrary times due to the $\mathcal{ASYNC}$ setting. | |

*/ |

We first prove the correctness of the algorithm in the sense that the visibility graph ${G}_{t}\left(I\right)$ remains connected during execution. We then prove the progress of the algorithm such that after a finite number of epochs, any connected initial configuration converges to an ideal gathering configuration (Definition 2). Let I be any arbitrary initial configuration of robots in $\mathcal{Q}$ on a grid such that ${G}_{0}\left(I\right)$ is connected. Let $SER\left(I\right)$ be the axis-aligned smallest enclosing rectangle for the robots in I. Let ${D}_{Y}$ and ${D}_{X}$, respectively, be the height and width of $SER\left(I\right)$. Let ${L}_{{D}_{Y}},{L}_{{D}_{Y}-1},\dots ,{L}_{0}$ be the horizontal line segments of $SER\left(I\right)$ at every 1 unit vertical distance, with ${L}_{{D}_{Y}}$ being the topmost horizontal line segment and ${L}_{0}$ being the bottommost horizontal line segment. Similarly, let ${L}_{{D}_{X}}^{\prime},{L}_{{D}_{X}-1}^{\prime},\dots ,{L}_{0}^{\prime}$ be the vertical line segments of $SER\left(I\right)$ at every one unit horizontal distance, with ${L}_{{D}_{X}}^{\prime}$ being the rightmost vertical line segment and ${L}_{0}^{\prime}$ being the leftmost vertical line segment. Let ${L}_{S}$ be the line parallel to ${L}_{0}$ at distance $\frac{{D}_{X}}{2}$ south of ${L}_{0}$. Figure 4 illustrates these definitions.

Given any initial configuration I such that the visibility graph ${G}_{0}\left(I\right)$ is connected, the graph ${G}_{t}\left(I\right)$ at any time $t>0$ remains connected.

For a robot ${r}_{i}$, since ${G}_{0}\left(I\right)$ is connected, there are robots in at least two out of its eight neighboring grid points, unless ${r}_{i}$ is a leaf node in ${G}_{0}\left(I\right)$ in which case there may be a robot in only one out of its eight neighboring grid points. We will show that no matter the moves of ${r}_{i}$ and the robots in its eight neighboring grid points, in the new configuration, ${r}_{i}$ has robots in at least two out of its eight neighboring grid points (unless it is a leaf node in ${G}_{0}\left(I\right)$ in which case there will be a robot in one of eight neighboring grid points). This immediately proves this lemma from our definition of connectivity.

Notice that the movements of ${r}_{i}$ are either diagonal, horizontal, or vertical, and ${r}_{i}$ never moves to its three neighboring grid points on $SQ\left({r}_{i}\right)$ in the north of ${L}_{i}$. Furthermore, ${r}_{i}$ does not move when it sees at least one robot ${r}_{j}$ at the north of ${L}_{i}$ or inside $SQ\left({r}_{i}\right)$.

A diagonal hop for ${r}_{i}$ is possible when ${r}_{i}$ sees other robot(s) ${r}_{j}$ only on one of its two diagonal neighboring grid points on $S{Q}_{3}\left({r}_{i}\right)$ or $S{Q}_{4}\left({r}_{i}\right)$, and ${r}_{i}$ moves to the position of ${r}_{j}$ (since ${r}_{j}$ does not move as ${r}_{j}$ sees ${r}_{i}$ at the north of ${L}_{j}$ until ${r}_{i}$ reaches the position of ${r}_{j}$). Robot ${r}_{i}$ also makes a diagonal hop when it sees other robot(s) ${r}_{j}$ on either ${L}_{i,l}$ only or ${L}_{i,r}$ only that is part of $SQ\left({r}_{i}\right)$ in the south of ${L}_{i}$. Since ${r}_{j}$ is at the south of ${L}_{i}$, it must be in transit to the neighboring diagonal grid point of ${r}_{i}$ and ${r}_{i}$, and ${r}_{j}$ meet together when both of them reach that grid point. If one reaches that grid point before, it waits for the other since there will be at least one robot at the north of the horizontal line for the robot on that grid point until ${r}_{i}$ and ${r}_{j}$ meet.

A horizontal hop for ${r}_{i}$ is possible only when ${r}_{i}$ sees ${r}_{j}$ in the east at the horizontal neighboring grid point (and no other robot inside or on $SQ\left({r}_{i}\right)$ except on ${L}_{i}$ in the east). After the movement, ${r}_{i}$ either reaches the position of ${r}_{j}$ (if ${r}_{j}$ does not move) or ${r}_{i}$ and ${r}_{j}$ will be at the two vertical neighboring grid points (if ${r}_{j}$ moves). That is, for ${r}_{j}$ to move, ${r}_{j}$ has to see at least one other robot in addition to ${r}_{i}$ on ${L}_{i}$ or at the south. The connectivity is maintained since ${r}_{i}$ is the endpoint robot (i.e., it has only one neighboring robot), and if ${r}_{j}$ is also the endpoint robot, then there is no third robot in the system; otherwise, ${r}_{j}$ must see a robot ${r}_{k}\ne {r}_{i}$ in one of its five neighboring grid points on ${L}_{i}$ or south of ${L}_{i}$.

A vertical hop for ${r}_{i}$ is possible when it sees at least one other robot ${r}_{j}$ on the neighboring grid point that is vertically south of it (and possibly others between ${r}_{i}$ and ${r}_{j}$), but no robot is observed on or inside $SQ\left({r}_{i}\right)$ in the north of ${L}_{i}$. In this case, ${r}_{i}$ reaches the position of ${r}_{j}$ since ${r}_{j}$ cannot move until there is ${r}_{i}$ in the north. ${r}_{i}$ performs a vertical hop also when it sees at least one robot each on the two vertical lines ${L}_{i,l}$ and ${L}_{i,r}$ on or south of ${L}_{i}$ in $SQ\left({r}_{i}\right)$ and no robot in $SQ\left({r}_{i}\right)$ in the north of ${L}_{i}$. Suppose ${r}_{i}$ sees two robots ${r}_{j}$ and ${r}_{k}$ in $SQ\left({r}_{i}\right)$ on or south of ${L}_{i}$ such that ${r}_{j}\in {L}_{i,l}$ and ${r}_{k}\in {L}_{i,r}$. After the movement, in this case, the distance between ${r}_{i}$ and one of ${r}_{j},{r}_{k}$ is at most $\sqrt{2}$ as they will be (at most) at the diagonal neighboring grid points from each other. The lemma is described as follows. □

Given any initial configuration I, if all the robots are not at one or two neighboring grid positions on the same horizontal line, the robots on the line segment ${L}_{{D}_{Y}}$ of $SER\left(I\right)$ move to the line segment ${L}_{{D}_{Y}-1}$ in at most two epochs.

Since ${L}_{{D}_{Y}}$ is the topmost horizontal line segment, there is no robot in the north of ${L}_{{D}_{Y}}$. Moreover, since robots agree on north, the robots at the grid points of ${L}_{{D}_{Y}}$ never move north of ${L}_{{D}_{Y}}$. Therefore, if all the robots at the grid points of ${L}_{{D}_{Y}}$ make diagonal or vertical hops when they become active, then they will reach the positions of ${L}_{{D}_{Y}-1}$; hence, in at most one epoch, all robots on ${L}_{{D}_{Y}}$ will be at ${L}_{{D}_{Y}-1}$, even in the $\mathcal{ASYNC}$ setting. Note that in an epoch, each robot completes its LCM cycle at least once. This means that, in this case, each activated robot at ${L}_{{D}_{Y}}$ completes its LCM cycle after moving to the position of ${L}_{{D}_{Y}-1}$. Therefore, a robot ${r}_{i}$ on ${L}_{{D}_{Y}}$ remains at a grid point on ${L}_{{D}_{Y}}$ if and only if it makes a horizontal move in that epoch. We will show that ${r}_{i}$ either terminates or moves to a position on ${L}_{{D}_{Y}-1}$ in the next epoch.

Let ${r}_{j}$ be the robot at the horizontal neighboring grid point that ${r}_{i}$ sees on ${L}_{{D}_{Y}}$ when it makes a horizontal hop. We have it that ${r}_{i}$ must not have seen any robot on its other seven neighboring grid points or inside of $SQ\left({r}_{i}\right)$ (except between ${r}_{i}$ and ${r}_{j}$ on the same horizontal line). When ${r}_{i}$ moves to the position of ${r}_{j}$, either ${r}_{j}$ is still on ${L}_{{D}_{Y}}$ or has moved to ${L}_{{D}_{Y}-1}$ in the neighboring grid point that is vertically south of ${r}_{j}$. If ${r}_{j}$ has not moved south, either the execution is still in the first epoch or ${r}_{j}$ does not see any other robot except on or between the positions of ${r}_{i}$ and ${r}_{j}$ in the same horizontal line. If ${r}_{j}$ is still in the first epoch, then ${r}_{i}$ reaches the position of ${r}_{j}$, and either this horizontal moving scenario repeats with execution still being in the first epoch or ${r}_{j}$ moves south. If ${r}_{j}$ does not see any other robot except on or between the positions of ${r}_{i}$ and ${r}_{j}$ in the same horizontal line, ${r}_{i}$ (and all other robots on ${L}_{i}$ up to ${r}_{j}$) reaches the position of ${r}_{j}$, and all of them terminate by achieving the gathering configuration. If ${r}_{j}$ has moved to ${L}_{{D}_{Y}-1}$ in the first epoch, ${r}_{i}$ moves to the position of ${r}_{j}$ on ${L}_{{D}_{Y}-1}$ when it becomes active next time since ${r}_{j}$ is in the neighboring grid point of $SQ\left({r}_{i}\right)$ that is vertically south of it. Therefore, in at most two epochs, all the robots on ${L}_{{D}_{Y}}$ move to the positions of ${L}_{{D}_{Y}-1}$. □

The following observation is immediate for vertical hops since a vertical hop by a robot takes it to its neighboring grid point vertically south of it. For a horizontal/diagonal hop, this is also true since a robot performing a horizontal/diagonal hop never finds its neighboring robot outside ${L}_{{D}_{X}}^{\prime}$ and ${L}_{0}^{\prime}$.

No robot of $SER\left(I\right)$ moves to the positions outside of lines ${L}_{0}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$ during the execution.

No robot of $SER\left(I\right)$ reaches the south of horizontal line ${L}_{S}$ (Figure 4) during the execution.

Let $\mathcal{X}:=\{{r}_{0},\dots ,{r}_{X}\}$ be the robots on ${L}_{0}$ in the increasing order of their x-coordinates (some of the grid points on ${L}_{0}$ may be empty, and it does not impact our analysis). If all robots ${r}_{0},\dots ,{r}_{X}$ on set $\mathcal{X}$ have robots on or inside $SQ(\ast )$ at the north of ${L}_{0}$, they do not move until those robots at the north of ${L}_{0}$ are moved to ${L}_{0}$. Therefore, we first assume that only ${r}_{0}$ and ${r}_{X}$ have robots at the north of ${L}_{0}$ inside or on $SQ\left({r}_{0}\right)$ and $SQ\left({r}_{X}\right)$, respectively, and $\{{r}_{1},\dots ,{r}_{X-1}\}$ have no such robots at the north of ${L}_{0}$ inside or on their respective $SQ(\ast )$. Robots ${r}_{2},\dots ,{r}_{X-2}$ can move to their neighboring grid points that are vertically south of them in one epoch. This is because they do not see any robot at the north of the horizontal line passing through their positions.

In the second epoch, ${r}_{2}$ and ${r}_{X-2}$ see ${r}_{1}$ and ${r}_{X-1}$, respectively, in the north on their respective $SQ(\ast )$, and only the robots ${r}_{3},\dots ,{r}_{X-3}$ can move to the next line in the south from their current horizontal line. This implies that each robot ${r}_{i},1\le i\le \frac{X}{2}$ waits for ${r}_{i-1}$ since it sees ${r}_{i-1}$ on the neighboring grid point in the north from their position, and this is also the case for the robots from ${r}_{\frac{X}{2}+1}$ (from ${r}_{\frac{X}{2}+2}$ in the even ${D}_{X}$ case) to ${r}_{X-1}$. The scenario repeats until the middle robot of ${L}_{0}$ reaches at most $\frac{{D}_{X}}{2}-1$ distance south from ${L}_{0}$, if ${D}_{X}$ is an odd number). If ${D}_{X}$ is an even number, two robots ${r}_{\frac{X}{2}}$ and ${r}_{\frac{X}{2}+1}$ of ${L}_{0}$ reach at most $\frac{{D}_{X}}{2}-2$ distance south from ${L}_{0}$.

Now consider the case where either ${r}_{0}$ or ${r}_{X}$ has no robot on the neighboring grid point that is vertically north from it in addition to ${r}_{1},\dots ,{r}_{X-1}$. Notice that at least one of ${r}_{0}$ or ${r}_{X}$ must have a robot at the north to maintain the connectivity of ${G}_{t}\left(I\right)$. Let ${r}_{0}$ be that robot (the case of ${r}_{X}$ is analogous). If ${r}_{0}$ moves first, it moves to the position of ${r}_{1}$ in ${L}_{0}$ performing a horizontal hop. If ${r}_{1}$ moves first, ${r}_{0}$ reaches ${r}_{1}$ at the horizontal line immediately below ${L}_{0}$ performing a diagonal hop. By repeating this, the robots ${r}_{0},\dots ,{r}_{\frac{X}{2}-1}$ may reach the position of ${r}_{\frac{X}{2}}$ (the middle robot) at distance ${D}_{\frac{X}{2}}$ south of ${L}_{0}$ (i.e., ${L}_{S}$). For the remaining robots ${r}_{\frac{X}{2}},\dots ,{r}_{X}$, each robot ${r}_{X-i},1\le i\le \frac{X}{2}$ sees ${r}_{X-i+1}$ in the north on respective $SQ(\ast )$; thus, the middle robot can reach at most ${D}_{\frac{X}{2}}$ south of ${L}_{0}$. Therefore, this process again ends up at line ${L}_{S}$ in the worst-case.

During the execution, the robots at the north of ${L}_{0}$ in $SER\left(I\right)$ may visit the robots south of ${L}_{0}$. In that case, the robots at the south of ${L}_{0}$ do not move until they see at least one robot at the north of its position inside $SQ(\ast )$. If a robot does not see any robots at the north of its position, then it either performs a diagonal hop which never takes it to the south of ${L}_{S}$ or it performs a vertical hop. If it performs a vertical hop, it will perform a horizontal hop in the next epoch, and this never takes it south of ${L}_{S}$. Therefore, according to the moves of the robots of ${L}_{0}$, it is easy to see that all the robots in $\mathcal{Q}$ are within the triangular area (as depicted in Figure 4). □

The viewings of two and the square connectivity range of $\sqrt{2}$ are sufficient for gathering relative to a grid point (that is not known beforehand) on a grid under both axis agreements.

If a robot ${r}_{i}$ sees robots only at the south (vertically below or diagonal), it can simply move towards the south, and when ${r}_{i}$ sees no robot in the south and no robot on horizontal neighboring grid points, it can simply terminate. This is because if there is another robot within its viewing range, ${r}_{i}$ must see it in one of its eight neighboring grid points in order to satisfy connectivity for ${G}_{t}\left(I\right),t>0,$ (Lemma 1) since ${G}_{0}\left(t\right)$ satisfies this condition. If ${r}_{i}$ sees a robot ${r}_{j}$ in either of its horizontal neighboring grid points, then ${r}_{i}$ moves to the position of ${r}_{j}$ if ${r}_{j}$ is at its east, and ${r}_{j}$ simply waits for ${r}_{i}$ as it does not perform a horizontal hop to the west or moves vertically south. Even in this case, ${r}_{i}$ sees ${r}_{j}$. Therefore, if ${r}_{i}$ sees no robot in $SQ\left({r}_{i}\right)$, it can terminate. According to the definition of the connectivity range, the viewing range of two is enough for ${r}_{i}$ to maintain connectivity with any of the eight neighboring grid points. □

The analysis of this section proves the following main result.

Given any connected configuration of $N\ge 1$ robots with the viewing range of two and the square connectivity range of $\sqrt{2}$ on a grid, the robots can gather to a point in $\mathcal{O}\left({D}_{E}\right)$ epochs in the $\mathcal{ASYNC}$ setting under both axis agreement.

We have from Lemma 1 that ${G}_{t}\left(I\right)$ remains connected during the execution. We have from Lemma 2 that all the robots at the topmost horizontal line ${L}_{{D}_{Y}}$ of $SER\left(I\right)$ move to ${L}_{{D}_{Y}-1}$ in at most two epochs. Thus, after at most two epochs, Lemma 2 applies again to the robots of ${L}_{{D}_{Y}-1}$, which takes all the robots on ${L}_{{D}_{Y}-1}$ to ${L}_{{D}_{Y}-2}$ or south in next two epochs. This process continues and all the robots in $SER\left(I\right)$ move to line ${L}_{0}$ or south of it in at most $2\xb7{D}_{Y}$ epochs. These robots will be at one grid point in at most the next ${D}_{X}$ epochs. This is because for every one unit of vertical hop of the robots at the south of ${L}_{0}$, the width of the positions of robots decreases by two. The width of the positions of robots at ${L}_{0}$ is at most ${D}_{X}$. Thus, the width of the positions of robots becomes zero at distance $\le \frac{{D}_{X}}{2}$ south of ${L}_{0}$. Again, from Lemma 2, it takes at most two epochs to move all the robots one unit south; hence, to move all the robots at $\frac{{D}_{X}}{2}$ distance south of ${L}_{0}$, it takes at most ${D}_{X}$ epochs. Therefore, the robots can gather in $\mathcal{O}({D}_{X}+{D}_{Y})$ epochs. We have that $max\{{D}_{X},{D}_{Y}\}\le {D}_{E}\le \sqrt{2}\xb7max\{{D}_{X},{D}_{Y}\}$ for $SER\left(I\right)$ of any initial configuration I. Therefore, ${D}_{X}+{D}_{Y}\le 2\xb7max\{{D}_{X},{D}_{Y}\}$; hence, $\mathcal{O}({D}_{X}+{D}_{Y})=\mathcal{O}(2\xb7max\{{D}_{X},{D}_{Y}\})=\mathcal{O}\left({D}_{E}\right)$. The algorithm terminates (Lemma 4) since if a robot ${r}_{i}$ sees no robot in $SQ\left({r}_{i}\right)$ other than its current position, then all the robots of $\mathcal{Q}$ must be gathered in the current position of ${r}_{i}$ (due to the connectivity guarantee of Lemma 1). □

We discuss here how to solve gathering in a Euclidean plane by removing the restrictions on robot moves imposed on a grid. The viewing range is of $\sqrt{10}$, and the square connectivity range is of $\sqrt{2}$ (both measured in Euclidean distance). The robots agree on both coordinate axes.

We say gathering is performed when the robot configuration satisfies the ideal gathering configuration (Definition 2).

The pseudocode of the algorithm is provided in Algorithm 2. Depending on the positions of other robots in its viewing range, a robot ${r}_{i}$ can decide to hop on the positions of one of its neighboring quadrants $S{Q}_{3}\left({r}_{i}\right)$ or $S{Q}_{4}\left({r}_{i}\right)$; we do not allow ${r}_{i}$ to move to the positions north of ${L}_{i}$. In contrast to grid where robots always move in either unit distances (horizontal and vertical hops) or distance $\sqrt{2}$ (diagonal hops), in the Euclidean plane, a robot may move with varying distance of at most one for horizontal and vertical hops and varying distance of at most $\sqrt{2}$ for diagonal hops. The main difference (with the grid) is on how robots match patterns to perform diagonal, horizontal, and vertical hops. In contrast to relatively simple matching patterns of robots on a grid, the matching patterns of robots for the Euclidean plane are complex.

The idea is to resemble the patterns for the Euclidean plane to the respective patterns for the grid. For this purpose, we ask each robot ${r}_{i}$ to compute unit area $S{Q}_{unit}\left({r}_{i}\right)$ as defined in Section 2. $S{Q}_{unit}\left({r}_{i}\right)$ helps ${r}_{i}$ to decide whether to make a diagonal, horizontal, or vertical hop. If ${r}_{i}$ sees itself or at least one robot in $S{Q}_{unit}$, $\left({r}_{i}\right)$ is connected to a robot at the north of ${L}_{T}$, and it does not move. This guarantees that robots do not move south forever. If the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are not connected to any other robot outside of $S{Q}_{unit}\left({r}_{i}\right)$ at the west of ${L}_{R}$ (or similarly at the east of ${L}_{L}$), then ${r}_{i}$ makes a horizontal hop to the east (or similarly to west). If ${r}_{i}$ satisfies the conditions for a horizontal hop, except that there is a robot on point ${p}_{BR}$ (or similarly on ${p}_{BL}$), and the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are in a single diagonal line, then it makes a diagonal hop to ${p}_{BR}$ (or similarly to ${p}_{BL}$). If the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are not connected to any other robot outside of $S{Q}_{unit}\left({r}_{i}\right)$ at the north of ${L}_{B}$ but (at least) a robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to a robot on or south of ${L}_{B}$ and ${r}_{i}$ does not satisfy a condition for a diagonal hop, then ${r}_{i}$ makes a vertical hop. Moreover, if ${r}_{i}$ sees at least one robot on each of its two sides (east and west) at horizontal distance ≥ 2, then it makes a vertical hop. The termination is guaranteed by asking ${r}_{i}$ to check, in every LCM cycle, whether all robots in its viewing range are positioned in $S{Q}_{unit}\left({r}_{i}\right)$ (that is, ${r}_{i}$ sees no robot outside $S{Q}_{unit}\left({r}_{i}\right)$). When that is the case, ${r}_{i}$ and the remaining robots in $S{Q}_{unit}\left({r}_{i}\right)$ run a special procedure in order to reach a single point (Definition 2) and terminate their computation. Reaching a single point is facilitated for robots by both axis agreement.

Algorithm 2: The algorithm for gathering in the Euclidean plane | |

/* In every LCM cycle, each robot ${r}_{i}$ does the following when it become | |

activated: */ | |

/* Look: */ | |

1 | $({x}_{i},{y}_{i})\leftarrow $ current position of robot ${r}_{i}$ in the plane; |

2 | $C\left({r}_{i}\right)\leftarrow $ snapshot of the positions of other robots within the viewing range of ${r}_{i}$; |

/* Compute: */ | |

3 | $SQ\left({r}_{i}\right)\leftarrow $ square area for robot ${r}_{i}$; |

4 | $S{Q}_{unit}\left({r}_{i}\right)\leftarrow $ unit area for ${r}_{i}$; |

5 | ${L}_{i},{L}_{i}^{\prime}\leftarrow $ horizontal and vertical lines passing through ${r}_{i}$, respectively; |

6 | ${L}_{i,t},{L}_{i,b},{L}_{i,r},{L}_{i,l}\leftarrow $ top, bottom, right and left boundary lines of $SQ\left({r}_{i}\right)$, respectively; |

7 | ${L}_{T},{L}_{B},{L}_{R},{L}_{L}\leftarrow $ top, bottom, right and left boundary lines of $S{Q}_{unit}\left({r}_{i}\right)$, respectively; |

8 | ${d}_{i}\leftarrow $ destination point for ${r}_{i}$ to move; |

9 | If${r}_{i}$ sees no robot outside $S{Q}_{unit}\left({r}_{i}\right)$ then |

10 | execute the termination procedure; |

11 | If${r}_{i}$ sees a robot ${r}_{j}$ in $S{Q}_{unit}\left({r}_{i}\right)$ that is connected to other robot in North of ${L}_{i,t}$ (of $SQ\left({r}_{i}\right)$) |

then | |

12 | ${r}_{i}$ does not move; ${d}_{i}\leftarrow ({x}_{i},{y}_{i})$; |

/*$\phantom{(}$ Conditions for horizontal hops$\phantom{(}$ */ | |

13 | Else if there is no robot on ${L}_{B}$ in the segment of $S{Q}_{unit}\left({r}_{i}\right)$ ∧ no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is |

connected to any other robot in West of ${L}_{R}$ except the robots in $S{Q}_{unit}\left({r}_{i}\right)$ then | |

14 | set the destination point ${d}_{i}$ as a point at horizontal distance $1-{L}_{ij}$ in East (where ${L}_{ij}$ is |

the horizontal distance from ${r}_{i}$ to the leftmost robot ${r}_{j}$ in $S{Q}_{unit}\left({r}_{i}\right)$); | |

/* Note:If ${r}_{i}$ be the leftmost robot in $S{Q}_{unit}\left({r}_{i}\right)$, then it moves | |

distance 1 horizontally in East. And, if the conditions satisfy | |

symmetrically, then ${r}_{i}$ sets as destination point to the position on | |

${L}_{L}$ in West.$\phantom{(}$ */ | |

/*$\phantom{(}$ Conditions for diagonal hops$\phantom{(}$ */ | |

15 | Else if${r}_{i}$ sees at least a robot on the diagonal point ${p}_{BR}$ ∧ all the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are in |

the diagonal line that passes through $S{Q}_{4}\left({r}_{i}\right)$ ∧ no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any | |

other robot in the West of ${L}_{R}$, except the robots in $S{Q}_{unit}\left({r}_{i}\right)$ then | |

16 | set ${d}_{i}$ as the diagonal point ${p}_{BR}$ at distance $\sqrt{2}-{L}_{ij}$ (where ${L}_{ij}$ is the distance from ${r}_{i}$ to |

${r}_{j}$, the topmost and leftmost robot in $S{Q}_{unit}\left({r}_{i}\right)$); | |

/*$\phantom{(}$Note:Here, ${p}_{BR}$ is the intersection point of ${L}_{B}$ and ${L}_{R}$ and $S{Q}_{4}\left({r}_{i}\right)$ | |

is the unit square quadrant of $SQ\left({r}_{i}\right)$ in the South-West region. If ${r}_{i}$ | |

be the topmost (leftmost) robot in $S{Q}_{unit}\left({r}_{i}\right)$, then it moves distance | |

$\sqrt{2}$ diagonally to ${p}_{BR}$. Moreover, if the above conditions satisfy | |

symmetrically, then ${r}_{i}$ sets as destination point ${p}_{BL}$ (the | |

intersection point of ${L}_{B}$ and ${L}_{L}$). */ | |

17 | Else//$\phantom{(}$ Conditions for vertical hops |

18 | $S{P}_{unit}\left({r}_{i}\right)\leftarrow $ unit area in West of ${L}_{i,l}$ and South of ${L}_{B}$; |

19 | If ${r}_{i}$ sees a robot at the intersection point of lines ${L}_{i}^{\prime}$ and ${L}_{B}$ ∨ ${r}_{i}$ sees at least one robot |

each in both sides (East and West) at horizontal distance $\ge 2$ ∨ (${r}_{i}$ sees a robot on ${L}_{B}$ of | |

$S{Q}_{unit}\left({r}_{i}\right)$, no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to other robot in North of ${L}_{B}$ and West of | |

${L}_{L}$) ∨ (${r}_{i}$ sees at least one robot in $S{Q}_{unit}\left({r}_{i}\right)$ that is connected to other robot in South of | |

${L}_{B}$ in West of ${L}_{R}$ and no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to other robot in North of ${L}_{B}$ | |

and West of ${L}_{L}$) ∨ (${r}_{i}$ sees at least a robot in $S{P}_{unit}\left({r}_{i}\right)$ and at least a robot in $S{Q}_{unit}\left({r}_{i}\right)$ | |

is connected to a robot in North of ${L}_{B}$ and West of ${L}_{L}$) then | |

20 | set ${d}_{i}$ as the point vertically South at distance $1-{L}_{ij}$ on ${L}_{B}$ of $S{Q}_{unit}\left({r}_{i}\right)$ (where ${L}_{ij}$ |

is the vertical distance from ${r}_{i}$ to ${L}_{T}$); | |

/* Note: If ${r}_{i}$ be the topmost robot in $S{Q}_{unit}\left({r}_{i}\right)$ then it moves | |

distance 1 vertically South.$\phantom{(}$ */ | |

/*$\phantom{(}$ Move:$\phantom{(}$ */ | |

21 | ${r}_{i}$ moves to ${d}_{i}$; |

We provide details of the patterns below. Robot ${r}_{i}$ terminates when it sees no other robot in $SQ\left({r}_{i}\right)$, except on its current position.

- This case is similar to the grid. If ${r}_{i}$ sees a robot ${r}_{j}$ at its east at distance one on line ${L}_{i}$ and there is no robot in $SQ\left({r}_{i}\right)$, except the current position of ${r}_{i}$ and possibly on ${L}_{i}$ from ${r}_{i}$ up to ${r}_{j}$, ${r}_{i}$ hops to the position of ${r}_{j}$ (distance 1).
- Robot ${r}_{i}$ hops horizontally east on ${L}_{i}$ distance $1-{L}_{ik}$ (${L}_{ik}$ is the distance between ${r}_{i}$ and ${r}_{k}$, the leftmost robot in $SQ\left({r}_{i}\right)$) if all the following conditions are satisfied (Figure 5a illustrates this case for a horizontal hop):
- -
- No robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any other robot at the north of ${L}_{T}$.
- -
- No robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any other robot at the west of ${L}_{R}$, except for the robots in $S{Q}_{unit}\left({r}_{i}\right)$.
- -
- There is no robot on ${L}_{B}$ of $S{Q}_{unit}\left({r}_{i}\right)$.

Since we ask the robots to always move east in a horizontal hop, we do not have a symmetric case for horizontal hops under both axis agreements.

- This case is similar to grid. If ${r}_{i}$ sees no other robot in $SQ\left({r}_{i}\right)$ except at least one robot ${r}_{j}$ in $S{Q}_{4}\left({r}_{i}\right)$ on the diagonal corner point ${p}_{br}$, ${r}_{i}$ hops to ${p}_{br}$. Robot ${r}_{i}$ moves at a distance of exactly $\sqrt{2}$ if it performs this hop.
- Robot ${r}_{i}$ hops diagonally at a distance of $\sqrt{2}-{L}_{ij}$ (where ${L}_{ij}$ is the distance between ${r}_{i}$ and ${r}_{j}$, the topmost which is also the leftmost robot of $S{Q}_{unit}\left({r}_{i}\right)$ at point ${p}_{TL}$) to a point in $S{Q}_{4}\left({r}_{i}\right)$, if the following conditions are satisfied:
- -
- No robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any other robot at the north of ${L}_{T}$.
- -
- No robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any other robot at the west of ${L}_{R}$, except the robots in $S{Q}_{unit}\left({r}_{i}\right)$.
- -
- All robots in $S{Q}_{unit}\left({r}_{i}\right)$ are in the diagonal line that passes through $S{Q}_{4}\left({r}_{i}\right)$.
- -
- There is at least one robot on the diagonal point ${p}_{BR}$ of $S{Q}_{unit}\left({r}_{i}\right)$.

- Robot ${r}_{i}$ sees at least one robot at the intersection point of ${L}_{i}^{\prime}$ and ${L}_{B}$.
- Robot ${r}_{i}$ sees at least one robot each at both the east and west at horizontal distance $\ge 2$. Figure 6b illustrates this case.
- Robot ${r}_{i}$ sees at least one robot on ${L}_{B}$ of $S{Q}_{unit}\left({r}_{i}\right)$, no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any other robot at the north of ${L}_{B}$ and west of ${L}_{L}$, and the conditions for a diagonal hop are not satisfied for ${r}_{i}$. Figure 6a illustrates this case.
- Robot ${r}_{i}$ sees at least one robot in $S{Q}_{unit}\left({r}_{i}\right)$ that is connected to a robot at the south of ${L}_{B}$ on or west of ${L}_{R}$, and no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to any other robot at the north of ${L}_{B}$ and west of ${L}_{L}$. Figure 6a also illustrates this case.
- Let $S{P}_{unit}\left({r}_{i}\right)$ be a unit area at the west of ${L}_{i,l}$ and south of ${L}_{B}$ with ${L}_{B}$ being the topmost horizontal line ${L}_{T}$ of $S{P}_{unit}\left({r}_{i}\right)$ and ${L}_{i,l}$ being the rightmost vertical line ${L}_{R}$ of $S{P}_{unit}\left({r}_{i}\right)$. Robot ${r}_{i}$ sees that at least one robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to a robot at the north of ${L}_{B}$ and west of ${L}_{L}$, ${r}_{i}$ sees at least one robot in $S{P}_{unit}\left({r}_{i}\right)$, and the conditions for a horizontal hop are not satisfied. Figure 6c illustrates this case.

Robot ${r}_{i}$ also makes a vertical hop if the symmetric situations in the last three conditions are satisfied. The above rules infer that the robots move only under certain situations. Robots do not move in all the remaining situations. This process repeats until all robots of $\mathcal{Q}$ are inside an (axis-aligned) $1\times 1$-sized square area so that the special procedure for termination, as described in the next paragraph, can be applied.

We will show in the analysis that the diagonal, horizontal, and vertical hops described above position all robots in $\mathcal{Q}$ in an axis-aligned $1\times 1$-sized square area, say $SA$. We now discuss how the robots reach a point and terminate. Let ${r}_{l}$, ${r}_{b}$, and ${r}_{r}$ be the leftmost, bottommost, and rightmost robots in $SA$. We have that the unit area $S{Q}_{unit}\left({r}_{i}\right)$ of each robot ${r}_{i}$ that is in $SA$ overlaps. Therefore, if all the robots in $SA$ are in a single diagonal line, then ${r}_{b}$ does not move, and all other robots in $SA$ make a diagonal hop with their destination as the current position of ${r}_{b}$. Otherwise, the robots first perform a horizontal hop, as the destination points the positions on the right vertical line ${L}_{R}$ of $SA$. The robots on ${L}_{R}$ do not move until all the robots in $SA$ (the same for all robots) are positioned on ${L}_{R}$. After that, the robots (now on ${L}_{R}$) perform a vertical hop to the destination, which is the position of the bottom most robot on ${L}_{R}$, which does not move. Now, since all the robots reach the same position, they terminate in the next epoch.

We have the following immediate observation after all the robots in $\mathcal{Q}$ are positioned in an axis-aligned $1\times 1$-sized square area $SA$.

The robots within an axis-aligned $1\times 1$-sized square area $SA$ are positioned at a single point in at most two epochs.

We first prove correctness and then progress to providing a guarantee of the algorithm. We use $SER\left(I\right)$ and other definitions as in Section 3 except ${L}_{S}$. Here, we define ${L}_{S}$ as a horizontal line parallel to ${L}_{0}$ at distance ${D}_{X}$ south of ${L}_{0}$. Figure 7 illustrates these definitions for the algorithm in the Euclidean plane.

Based on the movement of robots in horizontal, diagonal, and vertical hops, the following observation is immediately made. This is because the robots never make a horizontal hop to the west, and the robots making the horizontal hops never reach east of ${L}_{{D}_{X}}^{\prime}$. In the diagonal hops, robots move to the diagonal position that is closer to the other neighboring robots. Since all the robots are inside ${L}_{0}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$ initially, there is no neighboring robot outside of those lines; hence, the diagonal hops will also be inside ${L}_{0}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$. In the vertical hops, robots always move vertically south. Since no robot has reached outside of ${L}_{0}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$ with the horizontal as well as diagonal hops, this is true with the vertical hop as well.

No robot of $SER\left(I\right)$ moves outside of lines ${L}_{0}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$ during the execution.

Given that ${G}_{0}\left(I\right)$ is connected, the visibility graph ${G}_{t}\left(I\right)$ at any time $t>0$ remains connected.

We extend the proof of Lemma 1. Similarly to the grid, a robot ${r}_{i}$ either does not move or performs either a diagonal, horizontal, or a vertical hop. Note also that ${r}_{i}$ never moves to any position at the north of ${L}_{i}$. Furthermore, ${r}_{i}$ does not move when it sees at least one robot ${r}_{j}$ on line ${L}_{i,t}$ or at the north of ${L}_{i,t}$.

First of all, if the robots move as in the grid case, Lemma 1 provides the connectivity proof for ${G}_{t}\left(I\right),t>0$, starting from connected ${G}_{0}\left(I\right)$. Therefore, we focus only on the cases that are particularly relevant to the Euclidean plane.

A diagonal hop for ${r}_{i}$ is possible only when the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are in the diagonal line that passes through $S{Q}_{4}\left({r}_{i}\right)$ and are not connected to any other robot at the west of ${L}_{R}$ besides the robots in $S{Q}_{unit}\left({r}_{i}\right)$ (the analogous case of $S{Q}_{3}\left({r}_{i}\right)$ can be handled similarly). Moreover, there is at least one robot at point ${p}_{BR}$. Robot ${r}_{i}$ then moves to ${p}_{BR}$. This preserves connectivity for ${G}_{t}\left(I\right)$ since the robot at ${p}_{BR}$ must be connected to at least one robot at the east of ${L}_{R}$ if all the robots of $\mathcal{Q}$ are not inside $S{Q}_{unit}\left({r}_{i}\right)$. Due to the $\mathcal{ASYNC}$ setting, the robot ${r}_{j}$ at ${p}_{BR}$ may perform its Look phase while ${r}_{i}$ is in transit to ${p}_{BR}$. Let ${t}^{\prime}$ be the time at which ${r}_{j}$ performs its Look. Let ${r}_{i}$ be at point p at distance $\sqrt{2}-x$ from ${p}_{BR}$ at time t. Let $S{Q}^{p}\left({r}_{i}\right)$ be $SQ\left({r}_{i}\right)$ for ${r}_{i}$ when it is at position p. Even in this case, ${r}_{j}$ does not move in a position outside of $S{Q}^{p}\left({r}_{i}\right)$ regardless of whether it performs a horizontal, vertical, or a diagonal hop, preserving connectivity.

A horizontal hop for ${r}_{i}$ is possible only when the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are not connected to any other robot at the west of ${L}_{R}$ similarly to the diagonal hop case with only the difference being that there is no robot on ${p}_{BR}$ so that even when all the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are in a diagonal line, ${r}_{i}$ cannot perform a diagonal hop. Even in this case, connectivity is preserved since, if the robots move at most the permitted distance, they would have moved in the grid case.

Similarly, in the vertical hop of robot ${r}_{i}$, if it sees no robot at the north in $SQ\left({r}_{i}\right)$, it moves vertically south on ${L}_{i}^{\prime}$ with a distance of exactly one. If ${r}_{i}$ sees at least one robot ${r}_{j}$ at the north in $SQ\left({r}_{i}\right)$ and satisfies the conditions for vertical hopping, it hops $1-{L}_{ij}$ (where ${L}_{ij}$ is the vertical distance between ${r}_{i}$ and ${r}_{j}$) distance south to a position on ${L}_{B}$ (of $S{Q}_{unit}\left({r}_{i}\right)$). In both cases, by the end of first epoch, each robot moves at most a distance of one toward the south, and the robots remain connected because ${r}_{i}$ reaches at most $\sqrt{2}$ distance away from the neighbor robot in $SQ\left({r}_{i}\right)$ (if the neighbor robot does not move in this epoch) and remains connected. Moreover, the robots connected to ${r}_{i}$ at the south of ${L}_{B}$ do not move as they find ${r}_{i}$ at the north and the connectivity with them remains unaffected. Thus, ${G}_{t}\left(I\right),t>0$ remains connected with a vertical hop. Figure 8 illustrates the movement of robots and how the connectivity is preserved. Note here that regardless of the grid case where robots are positioned on the grid points, in the Euclidean plane, robots can be positioned anywhere in the plane. The shaded regions in Figure 8 represent the arbitrary positions of robots within the equivalent grid areas in the Euclidean plane. □

All the robots in at the north of ${L}_{{D}_{Y}-1}$ in $SER\left(I\right)$ move to the positions on ${L}_{{D}_{Y}-1}$ or south of ${L}_{{D}_{Y}-1}$ in at most three epochs.

Since ${L}_{{D}_{Y}}$ is the topmost horizontal line segment of $SER\left(I\right)$, there is no robot at the north of ${L}_{{D}_{Y}}$. Moreover, since robots agree on north, they never move to the north of the horizontal line they are currently positioned. Consider the robots in the corridor area $CA$ of $SER\left(I\right)$ formed by horizontal lines ${L}_{{D}_{Y}}$ and ${L}_{{D}_{Y}-1}$, excluding the positions of ${L}_{{D}_{Y}-1}$. Note that in the grid case, the robots were either on ${L}_{{D}_{Y}}$ or on ${L}_{{D}_{Y}-1}$, and we proved in Lemma 2 that the robots on ${L}_{{D}_{Y}}$ reach ${L}_{{D}_{Y}-1}$ or the south in at most two epochs.

Consider $S{Q}_{unit}\left({r}_{i}\right)$ of any robot ${r}_{i}$ in $CA$. We will show that all the robots in $S{Q}_{unit}\left({r}_{i}\right)$ that are in $CA$ reach ${L}_{{D}_{Y}-1}$ or below in at most two epochs. Since these robots do not see any robot on or north of ${L}_{{D}_{Y}}$, they perform at least one kind of hop (vertical, horizontal, or diagonal) in the first epoch except the robots positioned between ${L}_{1}^{\prime}$ and ${L}_{2}^{\prime}$ in the west and ${L}_{{D}_{X}-2}^{\prime}$ and ${L}_{{D}_{X}-1}^{\prime}$ in the east in CA (Figure 8). The robots between ${L}_{1}^{\prime}$ and ${L}_{2}^{\prime}$ and ${L}_{{D}_{X}-2}^{\prime}$ and ${L}_{{D}_{X}-1}^{\prime}$ may not satisfy any conditions for movement in the first epoch. If all the robots in $S{Q}_{unit}\left({r}_{i}\right)$ in $CA$ perform either a diagonal or a vertical hop, they reach ${L}_{{D}_{Y}-1}$ or south in one epoch because, with both the diagonal and vertical hops, robots in $S{Q}_{unit}\left({r}_{i}\right)$ reach ${L}_{B}$ or below ${L}_{B}$ and ${L}_{B}$ is either ${L}_{{D}_{Y}-1}$ or below. If some robots perform a horizontal hop in the first epoch, we show that it performs either a vertical or a diagonal hop in the second epoch.

A robot makes a horizontal hop if it sees no other robot at the west of ${L}_{R}$, except the robots in $S{Q}_{unit}\left({r}_{i}\right)$, and there is no robot on ${L}_{B}$ of $S{Q}_{unit}\left({r}_{i}\right)$. By the end of the first epoch, all the robots in $S{Q}_{unit}\left({r}_{i}\right)$ reach the positions on or east of ${L}_{R}$ if all of them make a horizontal hop. In this case, the robots in CA between ${L}_{1}^{\prime}$ and ${L}_{2}^{\prime}$ do not move in the first epoch. If some robots performed horizontal hops and the rest performed vertical/diagonal hops, we only need to guarantee that the robots that performed a horizontal hop on the first epoch reached ${L}_{B}$ or south of it in the second epoch performing a vertical or a diagonal hop. Consider a robot ${r}_{i}$ that satisfies the conditions for a horizontal hop in the first epoch. We have it that there is no robot on ${L}_{B}$, and the robots in $S{Q}_{unit}\left({r}_{i}\right)$ are connected to no other robot besides the robots in $S{Q}_{unit}\left({r}_{i}\right)$ at the west of ${L}_{R}$. Let $S{Q}_{unit}^{E}\left({r}_{i}\right)$ be a square area adjacent to $S{Q}_{unit}\left({r}_{i}\right)$ at the east between lines ${L}_{T}$ and ${L}_{B}$. Let ${L}_{B}^{\prime}$ and ${L}_{R}^{\prime}$ be the bottom horizontal and right vertical lines of $S{Q}_{unit}^{E}\left({r}_{i}\right)$. If the robots in $S{Q}_{unit}^{E}\left({r}_{i}\right)$ are not on ${L}_{B}^{\prime}$ and not connected to any other robot below ${L}_{B}^{\prime}$ at the west of ${L}_{R}^{\prime}$, they do not move until all the robots in $S{Q}_{unit}\left({r}_{i}\right)$ reach ${L}_{R}$ or east of ${L}_{R}$ in $S{Q}_{unit}^{E}\left({r}_{i}\right)$. If there are robots on ${L}_{B}^{\prime}$, let x be the robot on ${L}_{B}^{\prime}$ that is the closest from ${L}_{R}$. Let ${L}_{V}$ be a line parallel to ${L}_{R}$ at some unit distance west of x. All the robots in $S{Q}_{unit}\left({r}_{i}\right)$ at the west of ${L}_{V}$ perform one horizontal move each in the first epoch. The robots on ${L}_{V}$ or east in $S{Q}_{unit}\left({r}_{i}\right)$ perform a vertical hop as there are robots on ${L}_{B}^{\prime}$. The robots of $S{Q}_{unit}\left({r}_{i}\right)$ that performed a horizontal hop on the first epoch now observe robots on ${L}_{B}$ in the second epoch and make a vertical move. Moreover, the robots in $S{Q}_{unit}^{E}\left({r}_{i}\right)$, which were waiting for the robots in $S{Q}_{unit}\left({r}_{i}\right)$ to perform a horizontal hop in the first epoch, now see robots at their respective ${L}_{B}$ and, hence, perform either a vertical or a diagonal hop to ${L}_{B}$. This means that the robots in $CA$ between ${L}_{0}^{\prime}$ and ${L}_{2}^{\prime}$ also move to ${L}_{{D}_{Y}-1}$ or south in two epochs. Arguing similarly, if the robots in $CA$ between ${L}_{{D}_{X}-2}^{\prime}$ and ${L}_{{D}_{X}-1}^{\prime}$ do not move in the first epoch, they also see a robot on their respective ${L}_{B}$ in the second epoch since the robots at the west of ${L}_{{D}_{X}-2}^{\prime}$ have already moved south in the first epoch. Thus, these robots also move south in the second epoch. In the same manner the remaining robots between ${L}_{{D}_{X}-1}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$ in $CA$ move to ${L}_{{D}_{Y}-1}$ or move south in the third epoch as they can observe at least one robot on their respective ${L}_{B}$. Therefore, in three epochs, all the robots in $CA$ reach ${L}_{{D}_{Y}-1}$ or south. The Lemma is described follows. □

No robots of $SER\left(I\right)$ reaches south of ${L}_{S}$ during the execution.

We extend the proof of Lemma 3. Let $\mathcal{X}:=\{{r}_{0},\dots ,{r}_{X}\}$ be the set of robots in the increasing order of their x-coordinates in the corridor area $CA$ between ${L}_{1}$ and ${L}_{0}$ of $SER\left(I\right)$. If the robots on set $\mathcal{X}$ see other robots at distance $\ge 1$ north from their positions, they do not move and wait until they do not see any robot at the north at a distance $\ge 1$. Therefore, similarly to Lemma 3, the robots in $CA$ that do not see any robot in the north at distance $\ge 1$ proceed to move south. This will take those robots to the next corridor $C{A}^{\prime}$ adjacent to $CA$ in the south. Suppose at some time $t>0$, all the robots reach $CA$ between ${L}_{0}$ and ${L}_{1}$. Some robots might see no robots at the north at the distance $\ge 1$ before time t, and they can perform their moves earlier, which does not affect our argument. Now, the robots in $CA$ that are in a unit square area (i.e., between ${L}_{0}^{\prime}$ and ${L}_{1}^{\prime}$) in the east perform horizontal moves, and the robots in the next unit square area (i.e., between ${L}_{1}^{\prime}$ and ${L}_{2}^{\prime}$) do not move in the first epoch. Similarly, the robots in $CA$ that are in two unit square areas in the west (i.e., between ${L}_{{D}_{X}-2}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$) do not move in the first epoch. The remaining robots in $CA$ between ${L}_{2}^{\prime}$ and ${L}_{{D}_{X}-2}^{\prime}$ move south. In the next epoch, the robots in $CA$ between ${L}_{1}^{\prime}$ and ${L}_{2}^{\prime}$ (including the robots that moved horizontally to this area in the previous epoch) move south. The robots in $CA$ between ${L}_{{D}_{X}-2}^{\prime}$ and ${L}_{{D}_{X}-1}^{\prime}$ also move south in the this epoch whereas the robots in $CA$ between ${L}_{{D}_{X}-1}^{\prime}$ and ${L}_{{D}_{X}}^{\prime}$ still do not move; they move in the third epoch. The robots in $C{A}^{\prime}$ between ${L}_{2}$ and ${L}_{4}$ and ${L}_{{D}_{X-4}}$ and ${L}_{{D}_{X-2}}$ do not move first, and the other robots move south.

Following this, we can observe that as the robots move to the next corridor (of size one) in the south of ${L}_{0}$, the width of the positions of robots decreases by one. This is because, at every corridor, the robots in the east most unit square area perform horizontal moves. Therefore, all the robots in $\mathcal{X}$ will be within a single unit square area in the corridor at distance ${D}_{X}$ south of ${L}_{0}$ (at most). When all the robots are within a unit square area, they follow the termination procedure and do not move further south.

Figure 8 illustrates how the robots move south of ${L}_{0}$. The figure also shows how the robot chains merge to eventually reach a unit square during execution so that the termination procedure can be executed. □

The following observation is also immediate.

For every one unit vertical hop of the robots in $\mathcal{Q}$ in the south of ${L}_{0}$, the width of the positions of robots decreases by (at least) one.

The viewing range of $\sqrt{10}$ is sufficient for gathering to a point (that is not known beforehand) on a plane under both axis agreements.

Let r be a robot in $\mathcal{Q}$. $S{Q}_{unit}\left(r\right)$ is computed based on the position of other robots in $SQ\left(r\right)$, which may lie anywhere within $SQ\left(r\right)$. For r to decide whether it is connected to other robots outside $S{Q}_{unit}\left(r\right)$, it has to see other robots in both the horizontal and vertical distance of at most one outside $S{Q}_{unit}\left(r\right)$. Therefore, the maximum distance between r and some other robot ${r}^{\prime}$ in $S{Q}_{unit}\left(r\right)$ (or $SQ\left(r\right)$) is $\sqrt{2}$ and ${r}^{\prime}$ may be connected to a robot at a distance of at most $\sqrt{2}$ away from ${r}^{\prime}$. Therefore, r needs to see at most a distance of $\sqrt{2}+\sqrt{2}=2\sqrt{2}=\sqrt{8}$ to find out whether there is a robot outside $S{Q}_{unit}\left(r\right)$ or not. When r sees that no robot in $S{Q}_{unit}\left(r\right)$ is connected outside of $S{Q}_{unit}\left(r\right)$, it can execute the termination procedure.

Now, for the vertical hops, there is one condition that requires r to see at least one robot each at horizontal distance $\ge 2$ at both the east and west, within the corridor of ${L}_{T}$ and ${L}_{B}$. To guarantee whether there is a robot at horizontal distance $\ge 2$ or not, r needs to see up to a horizontal distance of $<3$ and vertical distance of $<1$. This is because if there is any robot at horizontal distance $>2$, it must be connected to a robot at horizontal distance $<2$. Therefore, r needs to see at most distance $\sqrt{{3}^{2}+{1}^{2}}=\sqrt{10}$. Figure 9 (left) illustrates this requirement. □

The analysis of this section proves the following main result.

Given any connected configuration of $N\ge 1$ robots with the viewing range of $\sqrt{10}$ and the square connectivity range of $\sqrt{2}$ on a plane, the robots can gather to a point in $\mathcal{O}\left({D}_{E}\right)$ epochs in the $\mathcal{ASYNC}$ setting under both axis agreements.

We have from Lemma 5 that, given a connected ${G}_{0}\left(I\right)$, ${G}_{t}\left(I\right),t>0,$ remains connected during the execution of the algorithm. We have from Lemma 6 that all the robots at the topmost horizontal line ${L}_{{D}_{Y}}$ of $SER\left(I\right)$ move to ${L}_{{D}_{Y}-1}$ or south of ${L}_{{D}_{Y}-1}$ in at most two epochs. In other words, ${L}_{{D}_{Y}-1}$ becomes ${L}_{{D}_{Y}}$ in at most two epochs and Lemma 6 applies again to ${L}_{{D}_{Y}-1}$. Therefore, all the robots in $SER\left(I\right)$ move to line ${L}_{0}$ or south of it in at most $2\xb7{D}_{Y}$ epochs. After that, we have it that, from Lemma 7, these robots will be inside an axis-aligned unit area in at most next $2\xb7{D}_{X}$ epochs, arguing similarly with respect to Lemma 6. After all the robots of $\mathcal{Q}$ reach the insides of an unit square area, we have from Observation 2 that they reach a single point in at most the next two epochs. Therefore, the robots gather to a single point in $2\xb7{D}_{Y}+2\xb7{D}_{X}+2=\mathcal{O}({D}_{X}+{D}_{Y})=\mathcal{O}\left({D}_{E}\right)$ epochs. The algorithm terminates (Lemma 8). □

We discuss modifying the above algorithms when the robots agree on only one axis.

We first discuss changes in the model of Section 3. We say gathering is performed when the robot configuration satisfies the relaxed gathering configuration (Definition 3). We also relax the viewing range from 2 to 3.

We now discuss changes in Algorithm 1 (Section 3). The change is only on Rules 1 (termination) and 3 (horizontal hop). Regarding Rule 3, instead of ${r}_{i}$ moving only to the east (Figure 3 (middle)), ${r}_{i}$ can also move to the west as well if it sees no robots on or inside $SQ\left({r}_{i}\right)$, except for the situation where there is exactly one robot ${r}_{j}$ on the neighboring grid point on ${L}_{i}$ in the west. Regarding Rule 1, ${r}_{i}$ terminates if it sees all the robots at at most one unit apart in a horizontal line (i.e., all the robots are positioned in two horizontal neighboring grid points).

The viewing range of three is sufficient for gathering on a grid with guaranteed termination under a one-axis agreement.

Notice that a robot ${r}_{i}$ terminates if it sees all the robots in $\mathcal{Q}$ are at most two neighboring grid points (one is current position of ${r}_{i}$ and the other is either the left horizontal grid point only or the right horizontal neighboring grid point only). For ${r}_{i}$ to make a decision that the robots are not at any third grid point, it has to see all the neighboring grid points of its two horizontal neighboring grid points as well. The distance from ${r}_{i}$ to either of its horizontal neighboring grid point is one, and the distance of the neighboring grid points of ${r}_{i}$’s horizontal neighboring grid points is at most $\sqrt{2}$. Therefore, ${r}_{i}$ needs the viewing range of $(1+\sqrt{2})<3$. The connectivity range remains $\sqrt{2}$. □

Having the viewing range of three, the analysis of the algorithm in Section 3 applies directly to the modified algorithm for the grid under the one axis agreement. Therefore, we summarize the main result in the following theorem.

Given any connected configuration of $N\ge 1$ robots with the viewing range of three and the square connectivity range of $\sqrt{2}$ on a grid, the robots can gather in a unit length horizontal line segment (that is not known beforehand) in $\mathcal{O}\left({D}_{E}\right)$ epochs in the $\mathcal{ASYNC}$ setting under a one-axis agreement.

We first discuss changes in the model of Section 4. We say gathering is performed when the configuration satisfies the relaxed gathering configuration (Definition 3). The viewing and square connectivity ranges remain the same as in Section 4.

We now discuss changes in the algorithm. The change is on horizontal and vertical hops and on termination. Instead of computing $S{Q}_{unit}\left({r}_{i}\right)$ using ${L}_{L}$ and ${L}_{T}$ as reference lines, $S{Q}_{unit}\left({r}_{i}\right)$ also needs to be computed by using ${L}_{R}$ and ${L}_{T}$ as references. When ${r}_{i}$ sees no other robot on one side (say west) at a distance of >1 but does on the other side (east), it takes the topmost robot ${r}_{j}$ and leftmost robot ${r}_{k}$ in $SQ\left({r}_{i}\right)$ in order to compute $S{Q}_{unit}\left({r}_{i}\right)$; for the symmetric case, it takes the topmost and rightmost robots in $SQ\left({r}_{i}\right)$ as a reference. This allows the robots to make horizontal hops in both directions (not necessarily only east under both axis agreement). Therefore, ${r}_{i}$ hops to the west of ${L}_{i}$ if the conditions for horizontal hop defined in Section 4 are satisfied symmetrically. Regarding vertical hopping, the following changes are made in the last three conditions:

- –
- Robot ${r}_{i}$ sees at least one other robot each on both sides of ${L}_{i}^{\prime}$ on ${L}_{B}$ or south of ${L}_{B}$, which is connected to at least one robot of $S{Q}_{unit}\left({r}_{i}\right)$.
- –
- Robot ${r}_{i}$ sees at least one other robot on ${L}_{B}$ or south of ${L}_{B}$ (which is connected $S{Q}_{unit}\left({r}_{i}\right)$) at one side of ${L}_{i}^{\prime}$ (say east) and at least one other robot at horizontal distance ≥2 on the other side (west) (and vice-versa).
- –
- Robot ${r}_{i}$ sees other robot(s) on ${L}_{B}$ (or connected to other robot(s) at the south of ${L}_{B}$) only at one side of ${L}_{i}^{\prime}$, say east, then finds the leftmost robot ${r}_{l}$ on ${L}_{B}$ of $S{Q}_{unit}\left({r}_{i}\right)$ (or south of ${L}_{B}$ that is connected to $S{Q}_{unit}\left({r}_{i}\right)$) and sees that no robot in $S{Q}_{unit}\left({r}_{i}\right)$ is connected to another robot at its left (i.e., west) at a horizontal distance of ≥1 from ${r}_{l}$ (and vice-versa).

Regarding termination, ${r}_{i}$ terminates if all the robots it sees within its viewing range (including itself) are within a horizontal line segment of length 1. We will show in the analysis that, with these changes, the algorithm positions the robots in $\mathcal{Q}$ inside an axis-aligned $1\times 1$-sized square area $SA$ in $\mathcal{O}\left({D}_{E}\right)$ epochs.

We now discuss how the robots in $SA$ reached a relaxed gathering configuration (Definition 3). Let ${r}_{b}$ be the bottommost robot in $SA$ (if more than one, pick one arbitrarily). Let ${L}_{B}$ be the horizontal line passing through ${r}_{b}$. The robots on ${L}_{B}$ (including ${r}_{b}$) do not move. The other robots move vertically to the positions of ${L}_{B}$. The viewing range allows the robots to decide whether there are robots outside $SA$ or not.

It is easy to see from the analysis of Section 4 that robots in $\mathcal{Q}$ reach inside an axis-aligned unit square area in $\mathcal{O}\left({D}_{E}\right)$ epochs. The only change on the analysis is on horizontal hops, which does not increase the number of epochs for the robots in $\mathcal{Q}$ to reach the inside of the unit area. Finally, it takes at most one additional epoch for all the robots that are in the unit square area to reach ${L}_{B}$. The robots that are not on ${L}_{B}$ move vertically to ${L}_{B}$, and the robots on ${L}_{B}$ do not move. Therefore, the robots reach a relaxed gathering configuration (Definition 3) in $\mathcal{O}\left({D}_{E}\right)$ epochs. □

We have presented, to the best of our knowledge, the first time-optimal $\mathcal{O}\left({D}_{E}\right)$-epoch algorithm for gathering $N\ge 1$ classic oblivious robots in a plane in the $\mathcal{ASYNC}$ setting under limited visibility, improving significantly on the previous $\mathcal{O}\left({D}_{G}\right)$-round algorithm of [4] that works in the $\mathcal{FSYNC}$ setting. Our result assumes the viewing range of $\sqrt{10}$, the square connectivity range of $\sqrt{2}$, and the agreement on one axis. This is in contrast to the viewing range of one and the (circular) connectivity range of $1-\frac{1}{\sqrt{2}}$ in [4] under the same one axis agreement. For future work, it will be interesting to relax our assumption of rigid moves to accommodate non-rigid moves. It will also be interesting to reduce the gap between the connectivity and viewing ranges without affecting time complexity.

Conceptualization, G.S.; methodology, P.P. and G.S.; formal analysis, P.P. and G.S.; investigation, P.P. and G.S.; resources, G.S.; writing—original draft preparation, P.P.; writing—review and editing, G.S.; supervision, G.S.; project administration, G.S. All authors have read and agreed to the published version of the manuscript.

This research received no external funding.

The authors thank Costas Busch for introducing this problem.

The authors declare no conflict of interest.

- Suzuki, I.; Yamashita, M. Distributed Anonymous Mobile Robots: Formation of Geometric Patterns. SIAM J. Comput.
**1999**, 28, 1347–1363. [Google Scholar] [CrossRef] - Flocchini, P.; Prencipe, G.; Santoro, N. Distributed Computing by Oblivious Mobile Robots. Synth. Lect. Distrib. Comput. Theory
**2012**, 3, 1–185. [Google Scholar] [CrossRef] - Prencipe, G. Impossibility of Gathering by a Set of Autonomous Mobile Robots. Theor. Comput. Sci.
**2007**, 384, 222–231. [Google Scholar] [CrossRef] - Izumi, T.; Kawabata, Y.; Kitamura, N. Toward Time-Optimal Gathering for Limited Visibility Model. 2015. Available online: https://sites.google.com/site/micromacfrance/abstract-tasuke (accessed on 18 October 2021).
- Cieliebak, M.; Flocchini, P.; Prencipe, G.; Santoro, N. Solving the Robots Gathering Problem. In Proceedings of the 30th International Colloquium on Automata, Languages, and Programming, Eindhoven, The Netherlands, 30 June–4 July 2003; pp. 1181–1196. [Google Scholar]
- Flocchini, P.; Prencipe, G.; Santoro, N.; Widmayer, P. Gathering of Asynchronous Robots with Limited Visibility. Theor. Comput. Sci.
**2005**, 337, 147–168. [Google Scholar] [CrossRef] - Prencipe, G. Autonomous Mobile Robots: A Distributed Computing Perspective. In Proceedings of the 9th International Symposium on Algorithms and Experiments for Sensor Systems, Wireless Networks and Distributed Robotics, Sophia Antipolis, France, 5–6 September 2013; pp. 6–21. [Google Scholar]
- Souissi, S.; Défago, X.; Yamashita, M. Gathering Asynchronous Mobile Robots with Inaccurate Compasses. In Proceedings of the 10th on Principles of Distributed Systems, Bordeaux, France, 12–15 December 2006; pp. 333–349. [Google Scholar] [CrossRef]
- Cieliebak, M.; Flocchini, P.; Prencipe, G.; Santoro, N. Distributed Computing by Mobile Robots: Gathering. SIAM J. Comput.
**2012**, 41, 829–879. [Google Scholar] [CrossRef] - Agathangelou, C.; Georgiou, C.; Mavronicolas, M. A Distributed Algorithm for Gathering Many Fat Mobile Robots in the Plane. In Proceedings of the 2013 ACM Symposium on Principles of Distributed Computing, Montréal, QC, Canada, 22–24 July 2013; pp. 250–259. [Google Scholar]
- Degener, B.; Kempkes, B.; Meyer auf der Heide, F. A Local O(n2) Gathering Algorithm. In Proceedings of the Twenty-Second Annual ACM Symposium on Parallelism in Algorithms and Architectures, Thira, Greece, 13–15 June 2010; pp. 217–223. [Google Scholar]
- Degener, B.; Kempkes, B.; Langner, T.; Meyer auf der Heide, F.; Pietrzyk, P.; Wattenhofer, R. A Tight Runtime Bound for Synchronous Gathering of Autonomous Robots with Limited Visibility. In Proceedings of the Twenty-Third Annual ACM Symposium on Parallelism in Algorithms and Architectures, San Jose, CA, USA, 4–6 June 2011; pp. 139–148. [Google Scholar]
- Kempkes, B.; Kling, P.; Meyer auf der Heide, F. Optimal and Competitive Runtime Bounds for Continuous, Local Gathering of Mobile Robots. In Proceedings of the Twenty-Fourth Annual ACM Symposium on Parallelism in Algorithms and Architectures, Pittsburgh, PA, USA, 25–27 June 2012; pp. 18–26. [Google Scholar]
- Cord-Landwehr, A.; Fischer, M.; Jung, D.; Meyer auf der Heide, F. Asymptotically Optimal Gathering on a Grid. In Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures, Pacific Grove, CA, USA, 11–13 July 2016; pp. 301–312. [Google Scholar] [CrossRef]
- Castenow, J.; Fischer, M.; Harbig, J.; Jung, D.; Meyer auf der Heide, F. Gathering Anonymous, Oblivious Robots on a Grid. Theor. Comput. Sci.
**2020**, 815, 289–309. [Google Scholar] [CrossRef] - Poudel, P.; Sharma, G. Universally Optimal Gathering Under Limited Visibility; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2017; Volume 10616, pp. 323–340. [Google Scholar] [CrossRef]
- Distributed Computing by Mobile Entities, Current Research in Moving and Computing; Lecture Notes in Computer Science; Flocchini, P.; Prencipe, G.; Santoro, N. (Eds.) Springer: Berlin/Heidelberg, Germany, 2019; Volume 11340. [Google Scholar] [CrossRef]
- Ando, H.; Suzuki, I.; Yamashita, M. Formation and Agreement Problems for Synchronous Mobile Robots with Limited Visibility. In Proceedings of the Tenth International Symposium on Intelligent Control, Monterey, CA, USA, 27–29 August 1995; pp. 453–460. [Google Scholar] [CrossRef]
- Kirkpatrick, D.; Kostitsyna, I.; Navarra, A.; Prencipe, G.; Santoro, N. Separating Bounded and Unbounded Asynchrony for Autonomous Robots: Point Convergence with Limited Visibility. In Proceedings of the 2021 ACM Symposium on Principles of Distributed Computing; ACM: New York, NY, USA, 2021; pp. 9–19. [Google Scholar] [CrossRef]
- Pagli, L.; Prencipe, G.; Viglietta, G. Getting Close Without Touching: Near-gathering for Autonomous Mobile Robots. Distrib. Comput.
**2015**, 28, 333–349. [Google Scholar] [CrossRef] - Bhagat, S.; Mukhopadhyaya, K.; Mukhopadhyaya, S. Computation Under Restricted Visibility. In Distributed Computing by Mobile Entities: Current Research in Moving and Computing; Springer International Publishing: Cham, Switzerland, 2019; pp. 134–183. [Google Scholar] [CrossRef]
- Sharma, G.; Busch, C.; Mukhopadhyay, S.; Malveaux, C. Tight Analysis of a Collisionless Robot Gathering Algorithm. ACM Trans. Auton. Adapt. Syst.
**2017**, 12, 3:1–3:20. [Google Scholar] [CrossRef] - Lukovszki, T.; auf der Heide, F.M. Fast Collisionless Pattern Formation by Anonymous, Position-Aware Robots. In Proceedings of the 18th Principles of Distributed Systems, Cortina d’Ampezzo, Italy, 16–19 December 2014; pp. 248–262. [Google Scholar]
- Cord-Landwehr, A.; Degener, B.; Fischer, M.; Hüllmann, M.; Kempkes, B.; Klaas, A.; Kling, P.; Kurras, S.; Märtens, M.; Meyer auf der Heide, F.; et al. Collisionless Gathering of Robots with an Extent. In Proceedings of the 37th Conference on Current Trends in Theory and Practice of Computer Science, Nový Smokovec, Slovakia, 22–28 January 2011; pp. 178–189. [Google Scholar]
- Braun, M.; Castenow, J.; auf der Heide, F.M. Local Gathering of Mobile Robots in Three Dimensions. In SIROCCO; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2020; Volume 12156, pp. 63–79. [Google Scholar] [CrossRef]
- Di Stefano, G.; Navarra, A. Optimal Gathering on Infinite Grids. In Proceedings of the 16th Symposium on Self-Stabilizing Systems, Paderborn, Germany, 28 September–1 October 2014; pp. 211–225. [Google Scholar]
- Di Stefano, G.; Navarra, A. Optimal gathering of oblivious robots in anonymous graphs and its application on trees and rings. Distrib. Comput.
**2017**, 30, 75–86. [Google Scholar] [CrossRef] - D’Angelo, G.; Stefano, G.D.; Klasing, R.; Navarra, A. Gathering of Robots on Anonymous Grids without Multiplicity Detection. In Proceedings of the 19th International Colloquium on Structural Information and Communication Complexity, Reykjavik, Iceland, 30 June–2 July 2012; pp. 327–338. [Google Scholar] [CrossRef]
- Cord-Landwehr, A.; Degener, B.; Fischer, M.; Hüllmann, M.; Kempkes, B.; Klaas, A.; Kling, P.; Kurras, S.; Märtens, M.; Meyer auf der Heide, F.; et al. A New Approach for Analyzing Convergence Algorithms for Mobile Robots. In Proceedings of the 38th International Colloquium on Automata, Languages, and Programming, Zurich, Switzerland, 4–8 July 2011; pp. 650–661. [Google Scholar] [CrossRef]
- Cohen, R.; Peleg, D. Convergence Properties of the Gravitational Algorithm in Asynchronous Robot Systems. SIAM J. Comput.
**2005**, 34, 1516–1528. [Google Scholar] [CrossRef] - Izumi, T.; Potop-Butucaru, M.G.; Tixeuil, S. Connectivity-preserving Scattering of Mobile Robots with Limited Visibility. In Proceedings of the 12th Symposium on Self-Stabilizing Systems, New York, NY, USA, 20–22 September 2010; pp. 319–331. [Google Scholar]

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).