Abstract
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 time algorithm for this problem in the fully synchronous setting, assuming that the robots agree on one coordinate axis (say north), where is the diameter of the visibility graph of the initial configuration. In this article, we provide the first time algorithm for this problem in the asynchronous setting under the same assumption of robots’ agreement with one coordinate axis, where 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 robots, , and there exist initial configurations for which can be quadratic on , i.e., . Moreover, our algorithm is asymptotically time-optimal since the trivial time lower bound for this problem is .
1. Introduction
In the classic model of distributed computation by mobile robots, also known as the 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 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 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 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 in expectation in the fully synchronous setting, where N is the total number of robots. Degener et al. [12] provided an -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 . Kempkes et al. [13] provided an -time algorithm for this problem under a slightly different continuous time setting, where 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 -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 -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 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 be the diameter of G, which is the greatest distance between any pair of nodes in G following the edges of G. Let 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, , and for some configurations the gap between and can be as much as quadratic on , i.e., . Figure 1 illustrates these ideas. Therefore, an -time algorithm would be time-optimal for gathering starting from any initial connected configuration, since 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 -time algorithm can be designed for gathering for classic oblivious robots under limited visibility.
Figure 1.
An illustration of two initial configuration dependent parameters, (the Euclidean diameter) and (the visibility graph diameter), and the relation between them: (a) the diameter for an initial arbitrary configuration, (b) the visibility graph G with diameter for the configuration of the left, and (c) an initial configuration showing the quadratic difference between and with .
Recently, Izumi et al. [4] made progress towards addressing this open question. Specifically, they presented an -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 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 (different and in fact smaller than the viewing range of one).
There is still a large gap between the time bound of Izumi et al. [4] and the asymptotically optimal time bound, since can be quadratic on (Figure 1). This work closes this gap under the same one axis agreement with a slightly modified viewing range of and the square connectivity range (if we do not explicitly write “square”, then the viewing and connectivity ranges are circular ) of compared to the viewing range of one and the (circular) connectivity range of in [4] (if we consider the viewing range of one similar to [4], we need the square connectivity range of , and our algorithm again achieves 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 for a robot is equivalent to the -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 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 ; instead, they gather at a point (or within a small area) that is not known beforehand in 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.
Contributions. We focus, in this article, on optimizing runtime for gathering under limited visibility. We consider autonomous, anonymous, indistinguishable, oblivious, and silent point robots (also called swarms) as in the classic model [2]. Robots agree on the unit of distance measure. The viewing range is —a robot can see all other robots within the fixed radius of at most distance . The square connectivity range is —a robot is connected to all other robots inside or on the boundary of the (axis-aligned) -sized square area for which its center is the position of the robot. In a LCM cycle, a robot can move to any position inside or on the square area, including its four corners. The challenge here is that robot movements must not harm swarm connectivity. As in Izumi et al. [4], we assume that robots agree on one coordinate axis (say north), but they may not agree on the other coordinate axis. Moreover, we assume that the robot setting is asynchronous—there is no notion of common time, and robots perform their LCM cycles arbitrarily. Furthermore, we assume that the robot moves are rigid—a robot in motion in each cycle cannot be stopped (by an adversary) before it reaches its destination at that cycle. Additionally, all previous algorithms assume that when two or more robots move to the same location, they are merged and act as a single robot. In this article, we do not have that assumption; in other words, even if robots are located at the same position and activated at different time, the gathering progress is achieved through the (individual) moves of those robots.
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 robots is .
Theorem 1.
For any initial connected configuration of robots with the viewing range of and the square connectivity range of on a plane, gathering can be solved in 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 -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, 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 , we conjecture that there is no -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 , which only provides an -time algorithm.
Technique. Let L be the topmost horizontal line so that all the robots of any initial configuration I are either on the positions of line L or south from L. Let be the line parallel to L at distance one south of L. The main idea behind the algorithm is to make robots of I in the north of move to the positions of or south of in epochs, even under the asynchronous setting, where an epoch is the time interval for all N robots to execute their LCM cycle at least once (the formal definition of epoch is in Section 2). To accomplish this, we classify the moves of robots into three categories: diagonal hops, horizontal hops, and vertical hops. We will show that if all the robots in the north of make diagonal or vertical hops, they reach or south of in one epoch. However, if some of those robots make a horizontal hop, then in two epochs, they reach positions of or south of through the subsequent vertical or diagonal hop. We also show that, if some robots in the north of do not move in the first epoch, then they reach positions of or south of through the vertical or diagonal hop by the next two epochs.
Similarly, let be the bottommost horizontal line (parallel to L) so that the robots of I are either on or north of . The main idea is to show that the robots on do not move south of forever. Specifically, we show that robots on wait for all the robots in the north of so that they meet at distance (at most) D south of 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).
Other Related Work. The classic oblivious robots model or the model has been considered heavily in order to solve a diverse set of problems, such as scattering, gathering, convergence, circle formation, flocking, etc., in distributed mobile robotics. A comprehensive description of the state-of-the-art research on distributed computing by mobile robots can be found in these excellent books [2,17]. Much work on the classic model on these problems does not provide runtime analysis, for example, see papers on gathering in a non-predefined point [5,6,7,18,19]. Pagli et al. [20] considered gathering classic robots to a small area by avoiding collisions between robots. However, they also do not provide runtime analysis. Kirkpatrick et al. [19] studied gathering as a point convergence problem where starting from an arbitrary initial configuration, robots move in such a manner that they reach inside a circle of radius that is at most , . They proposed an algorithm to solve the problem in the k-asynchronous model (i.e., the degree of asynchrony is bounded to k); however, they showed that point convergence is unsolvable in the fully asynchronous model. In this article, we present an algorithm with runtime analysis to solve the gathering problem in the fully asynchronous model by assuming robots agree on one coordinate axis. Bhagat et al. [21] studied the limited visibility model for robots and presented different geometric pattern formation problems under limited visibility.
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 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 -time and -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 -sized grid area. Cord-Landwehr et al. [29] provided an -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 -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.
Roadmap. In Section 2, we detail the model and touch on some preliminaries. For the sake of simplicity in discussion, we first provide an -time algorithm for robots on a grid agreeing on both the coordinate axes in Section 3. We then provide an -algorithm for robots on a plane agreeing on both the coordinate axes in Section 4. In Section 5, we discuss how the algorithms of Section 3 and Section 4 can be modified to solve gathering when robots agree on only one axis. Finally, we provide concluding remarks in Section 6 with a brief discussion.
2. Model and Preliminaries
Robots. We consider a distributed system of N robots (agents) from a set . Each robot is a (dimensionless) point that can move in an infinite two-dimensional real space . Throughout this article, we will use a point to refer to a robot as well as its position. We denote by the distance between two robots . Each robot works under limited visibility and viewing range of each robot is , i.e., a robot can see and be visible to another robot if and only if . For some cases, e.g., for grid, the viewing range smaller than is sufficient. We describe what exactly is the viewing range when we describe algorithms in Section 3 and Section 5. The connectivity range of each robot is following square connectivity, i.e., two robots have an edge between them on G if one robot is inside the (axis-aligned) -sized square area formed by the other robot being at its center. The robots agree on the unit of distance measure, i.e., the viewing and connectivity ranges of and are the same for each robot . The robots also agree on one coordinate axis, north (the assumption of robots agreeing on east is analogous). For the sake of simplicity in discussion, the algorithms in Section 3 and Section 4 assume that robots agree on both coordinate axes. The assumption on both axis agreement is lifted in Section 5.
Look-Compute-Move. Each robot is either active or inactive. When a robot becomes active, it performs the “Look-Compute-Move” cycle as follows:
- Look: For each robot that is within the viewing range of , can observe the position of on the plane. Robot also knows its own position;
- Compute: In any cycle, robot 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 for the start of next cycle;
- Move: At the end of the cycle, robot moves to its new position.
Robot Activation. In the fully synchronous setting (), every robot is active in every LCM cycle. In the semi-synchronous setting (), at least one robot is active, and over an infinite number of LCM cycles, every robot is often infinitely active. In the asynchronous setting (), there is no common notion of time, and no assumption is made on the number and frequency of LCM cycles in which a robot can be active. The only guarantee is that every robot is active infinitely often. Complying with the setting, we assume that a robot “wakes up” and performs its Look phase at an instant of time. We also assume that during the Move phase, it moves in a straight line and stops only after reaching its destination point; in other words, the moves are rigid [2].
Runtime. For the setting, time is measured in rounds. Since a robot in the and settings could stay inactive for an indeterminate interval of time, we bound a robot’s inactivity and use the standard notion of epoch to measure runtime. An epoch is the smallest interval of time within which each robot is guaranteed to execute its LCM cycle at least once. Therefore, for the setting, a round is an epoch. We will use the term “time” generally to mean rounds for the setting and epochs for the and settings.
Square Area. Let be a robot positioned at coordinate . Let , respectively, be the horizontal and vertical lines passing through . Since knows north, can easily compute . The square area for , denoted as , is an area of the plane enclosed by four lines with being parallel to (perpendicular to ) and passes through coordinates and , respectively, and is perpendicular to (parallel to ) and passes through coordinates and , respectively. Notice that is axis-aligned, and both the height and width of it is two. We denote by the intersection points of lines and , and , and , and and , respectively. We can divide to four quadrant squares , and with both heights and widths as one. Let and be at the north of and and be at the south of . Moreover, let and be at west of and and be at east of . We say that the positions of in belong to and . Figure 2a illustrates these ideas.
Figure 2.
An illustration of (a) Square Area and (b) Unit Area.
Unit Area. Let , respectively, be the topmost and leftmost robots among the robots in . In some situations, both and may be the same robot, and this definition is still valid. Let be the horizontal line passing through and be the vertical line passing through . Let be the horizontal line parallel to , and it is at distance one south of . Similarly, let be the vertical line parallel to and at a distance of one east of . The unit area for , denoted as , is an area of the plane inside enclosed by lines , and . Note that is an (axis-aligned) unit square of both height and width one. We denote by , and the intersection points of lines and , and , and , and and , respectively. Figure 2b illustrates the idea of unit area computation.
Visibility Graph and Gathering Configuration. We define the visibility graph of any initial configuration I and gathering configurations as follows.
Definition 1
(Initial Visibility Graph). The visibility graph of any arbitrary initial configuration I of robots is the graph such that, for any two distinct robots and , where is positioned on or inside (or vice-versa).
provides connectivity for robots with square connectivity range . The gathering problem may not be solvable under limited visibility if the initial visibility graph is not connected [2,6]. Therefore, we assume that is connected at time . Moreover, any algorithm for gathering must maintain the connectivity of during its execution until a gathering configuration is reached. For the sake of clarity, we denote by the visibility graph for any time .
Definition 2
(Ideal Gathering Configuration). An ideal gathering configuration is one where all robots are at a single point that is not known beforehand.
Definition 3
(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 -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 setting [3], even when , by gathering the robots in a unit horizontal line segment. As an example, consider two robots at distance 1 apart on a horizontal line working under an setting. Let and activate at the same time and moves to the position of and moves to the position of as both of them move in the horizontal line. This scenario may repeat infinitely since and do not have common agreement on east or west under one-axis agreement on north. By using our square connectivity range , the viewing range and one-axis agreement, even when , the robots can reach a horizontal segment of length one unit. The viewing range helps each robot to see whether there is a robot outside 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 time.
3. Time Algorithm for the Grid
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 . We say gathering is performed when the robot configuration satisfies Definition 2.
3.1. The Algorithm
The pseudocode of the algorithm is given in Algorithm 1. Depending on the positions of other robots within its viewing range, distinguishes diagonal, horizontal, and vertical hops, which we discuss separately below. A robot 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, never hops on any of the three neighboring grid points relative to north from its position, i.e., hops only to one of its five neighboring grid points on the same horizontal line or south of . We will show that this allows achieving a gathering progress in every epoch. Since robot moves are not instantaneous due to the setting, a robot also does not move if it observes at least one robot in the north of inside or on . This is crucial for guaranteeing that robots do not move south forever. Robot terminates when it sees no other robot inside or on other than its position.
Diagonal Hops. A diagonal hop takes a robot to one of the two diagonal neighboring grid points in the south (i.e., either or ). Let be a horizontal line that passes from the current position of a robot . Robot makes a diagonal hop when it sees no robot in at the north of (including the positions of ) and either (i) sees no other robot in (except at its position) and sees at least one robot on at the south of or (ii) sees no other robot in (except at its position) and sees at least one robot on at the south of . In case (i), hops on grid point , whereas in case (ii), it hops on grid point .
In this hop, the robot moves diagonally at a distance of . Figure 3a,b illustrate diagonal hops.
Figure 3.
An illustration of moves made by a robot: (a,b) diagonal hops, (c) horizontal hop, and (d,e) vertical hops. The blue shaded area along the grid lines represents that there is no robot in that area. The outer diamond represents the set of grid points within the viewing range of in grid (i.e., 2).
| Algorithm 1: The algorithm for gathering on a grid (under both axis agreement) | |
| /* In every LCM cycle, each robot does the following when it | |
| activates: */ | |
| /* Look: */ | |
| 1 | current position of robot in the grid graph G; |
| 2 | snapshot of the positions of other robots within the viewing range of ; |
| /* Compute: */ | |
| 3 | square area for robot ; |
| 4 | horizontal and vertical lines passing through , respectively; |
| 5 | horizontal lines parallel to and passing through and |
| , respectively; | |
| 6 | vertical lines parallel to and passing through and |
| , respectively; | |
| 7 | destination point for to move; |
| 8 | If sees no other robot in any of the neighboring grid points on then |
| 9 | terminates; |
| 10 | Else if sees at least a robot in in North of then |
| 11 | keeps waiting; ; // do nothing |
| /* Check the following two conditions for a diagonal hop. */ | |
| 12 | Else if sees no robot in on or West of (except at its position), and sees |
| at least a robot on that is part of in South of then //Figure 3a | |
| 13 | ; |
| 14 | Else if sees no robot in on or East of (except at its position), and sees |
| at least a robot on that is part of in South of then //Figure 3b | |
| 15 | ; |
| /* Check the following condition for a horizontal hop. */ | |
| 16 | Else if sees at least a robot on and sees no other robot in , |
| except on in the East then // Figure 3c | |
| 17 | ; |
| 18 | Else// Check either of the following two conditions for a vertical |
| hop. | |
| 19 | If sees no robot in in North of and sees at least a robot on in |
| South in then// Figure 3d | |
| 20 | |
| 21 | Else if sees no robot in in North of and sees at least one robot each |
| on two lines and on or South of in then //Figure 3e | |
| 22 | ; |
| /* Move: */ | |
| 23 | moves to ; |
| /*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 setting. | |
| */ | |
Horizontal Hops. A horizontal hop takes to its neighboring grid point on in the east. When a robot sees at least one robot at its horizontal neighboring grid point (and possibly others on between and ) and no other robot in , makes a horizontal hop to the neighboring grid point in the east. Figure 3c illustrates the horizontal hop.
Vertical Hops. A vertical hop always takes to its neighboring grid point vertically south from it. Robot makes a vertical hop if either (i) it sees a robot on at the south of and no other robot in at the north of or (ii) it sees at least one robot each on and or south of and no other robot in at the north of . Figure 3d illustrates case (i) and Figure 3e illustrates case (ii).
3.2. Analysis of the Algorithm
We first prove the correctness of the algorithm in the sense that the visibility graph 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 on a grid such that is connected. Let be the axis-aligned smallest enclosing rectangle for the robots in I. Let and , respectively, be the height and width of . Let be the horizontal line segments of at every 1 unit vertical distance, with being the topmost horizontal line segment and being the bottommost horizontal line segment. Similarly, let be the vertical line segments of at every one unit horizontal distance, with being the rightmost vertical line segment and being the leftmost vertical line segment. Let be the line parallel to at distance south of . Figure 4 illustrates these definitions.
Figure 4.
An illustration of an axis-aligned smallest enclosing rectangle and the triangular area south of it.
Lemma 1.
Given any initial configuration I such that the visibility graph is connected, the graph at any time remains connected.
Proof.
For a robot , since is connected, there are robots in at least two out of its eight neighboring grid points, unless is a leaf node in 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 and the robots in its eight neighboring grid points, in the new configuration, has robots in at least two out of its eight neighboring grid points (unless it is a leaf node in 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 are either diagonal, horizontal, or vertical, and never moves to its three neighboring grid points on in the north of . Furthermore, does not move when it sees at least one robot at the north of or inside .
A diagonal hop for is possible when sees other robot(s) only on one of its two diagonal neighboring grid points on or , and moves to the position of (since does not move as sees at the north of until reaches the position of ). Robot also makes a diagonal hop when it sees other robot(s) on either only or only that is part of in the south of . Since is at the south of , it must be in transit to the neighboring diagonal grid point of and , and 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 and meet.
A horizontal hop for is possible only when sees in the east at the horizontal neighboring grid point (and no other robot inside or on except on in the east). After the movement, either reaches the position of (if does not move) or and will be at the two vertical neighboring grid points (if moves). That is, for to move, has to see at least one other robot in addition to on or at the south. The connectivity is maintained since is the endpoint robot (i.e., it has only one neighboring robot), and if is also the endpoint robot, then there is no third robot in the system; otherwise, must see a robot in one of its five neighboring grid points on or south of .
A vertical hop for is possible when it sees at least one other robot on the neighboring grid point that is vertically south of it (and possibly others between and ), but no robot is observed on or inside in the north of . In this case, reaches the position of since cannot move until there is in the north. performs a vertical hop also when it sees at least one robot each on the two vertical lines and on or south of in and no robot in in the north of . Suppose sees two robots and in on or south of such that and . After the movement, in this case, the distance between and one of is at most as they will be (at most) at the diagonal neighboring grid points from each other. The lemma is described as follows. □
Lemma 2.
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 of move to the line segment in at most two epochs.
Proof.
Since is the topmost horizontal line segment, there is no robot in the north of . Moreover, since robots agree on north, the robots at the grid points of never move north of . Therefore, if all the robots at the grid points of make diagonal or vertical hops when they become active, then they will reach the positions of ; hence, in at most one epoch, all robots on will be at , even in the 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 completes its LCM cycle after moving to the position of . Therefore, a robot on remains at a grid point on if and only if it makes a horizontal move in that epoch. We will show that either terminates or moves to a position on in the next epoch.
Let be the robot at the horizontal neighboring grid point that sees on when it makes a horizontal hop. We have it that must not have seen any robot on its other seven neighboring grid points or inside of (except between and on the same horizontal line). When moves to the position of , either is still on or has moved to in the neighboring grid point that is vertically south of . If has not moved south, either the execution is still in the first epoch or does not see any other robot except on or between the positions of and in the same horizontal line. If is still in the first epoch, then reaches the position of , and either this horizontal moving scenario repeats with execution still being in the first epoch or moves south. If does not see any other robot except on or between the positions of and in the same horizontal line, (and all other robots on up to ) reaches the position of , and all of them terminate by achieving the gathering configuration. If has moved to in the first epoch, moves to the position of on when it becomes active next time since is in the neighboring grid point of that is vertically south of it. Therefore, in at most two epochs, all the robots on move to the positions of . □
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 and .
Observation 1.
No robot of moves to the positions outside of lines and during the execution.
Lemma 3.
No robot of reaches the south of horizontal line (Figure 4) during the execution.
Proof.
Let be the robots on in the increasing order of their x-coordinates (some of the grid points on may be empty, and it does not impact our analysis). If all robots on set have robots on or inside at the north of , they do not move until those robots at the north of are moved to . Therefore, we first assume that only and have robots at the north of inside or on and , respectively, and have no such robots at the north of inside or on their respective . Robots 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, and see and , respectively, in the north on their respective , and only the robots can move to the next line in the south from their current horizontal line. This implies that each robot waits for since it sees on the neighboring grid point in the north from their position, and this is also the case for the robots from (from in the even case) to . The scenario repeats until the middle robot of reaches at most distance south from , if is an odd number). If is an even number, two robots and of reach at most distance south from .
Now consider the case where either or has no robot on the neighboring grid point that is vertically north from it in addition to . Notice that at least one of or must have a robot at the north to maintain the connectivity of . Let be that robot (the case of is analogous). If moves first, it moves to the position of in performing a horizontal hop. If moves first, reaches at the horizontal line immediately below performing a diagonal hop. By repeating this, the robots may reach the position of (the middle robot) at distance south of (i.e., ). For the remaining robots , each robot sees in the north on respective ; thus, the middle robot can reach at most south of . Therefore, this process again ends up at line in the worst-case.
During the execution, the robots at the north of in may visit the robots south of . In that case, the robots at the south of do not move until they see at least one robot at the north of its position inside . 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 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 . Therefore, according to the moves of the robots of , it is easy to see that all the robots in are within the triangular area (as depicted in Figure 4). □
Lemma 4.
The viewings of two and the square connectivity range of are sufficient for gathering relative to a grid point (that is not known beforehand) on a grid under both axis agreements.
Proof.
If a robot sees robots only at the south (vertically below or diagonal), it can simply move towards the south, and when 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, must see it in one of its eight neighboring grid points in order to satisfy connectivity for (Lemma 1) since satisfies this condition. If sees a robot in either of its horizontal neighboring grid points, then moves to the position of if is at its east, and simply waits for as it does not perform a horizontal hop to the west or moves vertically south. Even in this case, sees . Therefore, if sees no robot in , it can terminate. According to the definition of the connectivity range, the viewing range of two is enough for to maintain connectivity with any of the eight neighboring grid points. □
The analysis of this section proves the following main result.
Theorem 2.
Given any connected configuration of robots with the viewing range of two and the square connectivity range of on a grid, the robots can gather to a point in epochs in the setting under both axis agreement.
Proof.
We have from Lemma 1 that remains connected during the execution. We have from Lemma 2 that all the robots at the topmost horizontal line of move to in at most two epochs. Thus, after at most two epochs, Lemma 2 applies again to the robots of , which takes all the robots on to or south in next two epochs. This process continues and all the robots in move to line or south of it in at most epochs. These robots will be at one grid point in at most the next epochs. This is because for every one unit of vertical hop of the robots at the south of , the width of the positions of robots decreases by two. The width of the positions of robots at is at most . Thus, the width of the positions of robots becomes zero at distance south of . 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 distance south of , it takes at most epochs. Therefore, the robots can gather in epochs. We have that for of any initial configuration I. Therefore, ; hence, . The algorithm terminates (Lemma 4) since if a robot sees no robot in other than its current position, then all the robots of must be gathered in the current position of (due to the connectivity guarantee of Lemma 1). □
4. Time Algorithm for the Euclidean Plane
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 , and the square connectivity range is of (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).
4.1. The Algorithm
The pseudocode of the algorithm is provided in Algorithm 2. Depending on the positions of other robots in its viewing range, a robot can decide to hop on the positions of one of its neighboring quadrants or ; we do not allow to move to the positions north of . In contrast to grid where robots always move in either unit distances (horizontal and vertical hops) or distance (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 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.
4.1.1. Overview of the Patterns
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 to compute unit area as defined in Section 2. helps to decide whether to make a diagonal, horizontal, or vertical hop. If sees itself or at least one robot in , is connected to a robot at the north of , and it does not move. This guarantees that robots do not move south forever. If the robots in are not connected to any other robot outside of at the west of (or similarly at the east of ), then makes a horizontal hop to the east (or similarly to west). If satisfies the conditions for a horizontal hop, except that there is a robot on point (or similarly on ), and the robots in are in a single diagonal line, then it makes a diagonal hop to (or similarly to ). If the robots in are not connected to any other robot outside of at the north of but (at least) a robot in is connected to a robot on or south of and does not satisfy a condition for a diagonal hop, then makes a vertical hop. Moreover, if 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 to check, in every LCM cycle, whether all robots in its viewing range are positioned in (that is, sees no robot outside ). When that is the case, and the remaining robots in 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 does the following when it become | |
| activated: */ | |
| /* Look: */ | |
| 1 | current position of robot in the plane; |
| 2 | snapshot of the positions of other robots within the viewing range of ; |
| /* Compute: */ | |
| 3 | square area for robot ; |
| 4 | unit area for ; |
| 5 | horizontal and vertical lines passing through , respectively; |
| 6 | top, bottom, right and left boundary lines of , respectively; |
| 7 | top, bottom, right and left boundary lines of , respectively; |
| 8 | destination point for to move; |
| 9 | If sees no robot outside then |
| 10 | execute the termination procedure; |
| 11 | If sees a robot in that is connected to other robot in North of (of ) |
| then | |
| 12 | does not move; ; |
| /* Conditions for horizontal hops */ | |
| 13 | Else if there is no robot on in the segment of ∧ no robot in is |
| connected to any other robot in West of except the robots in then | |
| 14 | set the destination point as a point at horizontal distance in East (where is |
| the horizontal distance from to the leftmost robot in ); | |
| /* Note:If be the leftmost robot in , then it moves | |
| distance 1 horizontally in East. And, if the conditions satisfy | |
| symmetrically, then sets as destination point to the position on | |
| in West. */ | |
| /* Conditions for diagonal hops */ | |
| 15 | Else if sees at least a robot on the diagonal point ∧ all the robots in are in |
| the diagonal line that passes through ∧ no robot in is connected to any | |
| other robot in the West of , except the robots in then | |
| 16 | set as the diagonal point at distance (where is the distance from to |
| , the topmost and leftmost robot in ); | |
| /*Note:Here, is the intersection point of and and | |
| is the unit square quadrant of in the South-West region. If | |
| be the topmost (leftmost) robot in , then it moves distance | |
| diagonally to . Moreover, if the above conditions satisfy | |
| symmetrically, then sets as destination point (the | |
| intersection point of and ). */ | |
| 17 | Else// Conditions for vertical hops |
| 18 | unit area in West of and South of ; |
| 19 | If sees a robot at the intersection point of lines and ∨ sees at least one robot |
| each in both sides (East and West) at horizontal distance ∨ ( sees a robot on of | |
| , no robot in is connected to other robot in North of and West of | |
| ) ∨ ( sees at least one robot in that is connected to other robot in South of | |
| in West of and no robot in is connected to other robot in North of | |
| and West of ) ∨ ( sees at least a robot in and at least a robot in | |
| is connected to a robot in North of and West of ) then | |
| 20 | set as the point vertically South at distance on of (where |
| is the vertical distance from to ); | |
| /* Note: If be the topmost robot in then it moves | |
| distance 1 vertically South. */ | |
| /* Move: */ | |
| 21 | moves to ; |
4.1.2. Detailed Description of the Patterns
We provide details of the patterns below. Robot terminates when it sees no other robot in , except on its current position.
Horizontal Hops. Robot makes a horizontal hop in the following conditions:
- This case is similar to the grid. If sees a robot at its east at distance one on line and there is no robot in , except the current position of and possibly on from up to , hops to the position of (distance 1).
- Robot hops horizontally east on distance ( is the distance between and , the leftmost robot in ) if all the following conditions are satisfied (Figure 5a illustrates this case for a horizontal hop):
Figure 5. An illustration of a horizontal hop (a) and diagonal hops (b,c).- -
- No robot in is connected to any other robot at the north of .
- -
- No robot in is connected to any other robot at the west of , except for the robots in .
- -
- There is no robot on of .
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.
Diagonal Hops. Robot makes a diagonal hop in either of the following conditions:
- This case is similar to grid. If sees no other robot in except at least one robot in on the diagonal corner point , hops to . Robot moves at a distance of exactly if it performs this hop.
- Robot hops diagonally at a distance of (where is the distance between and , the topmost which is also the leftmost robot of at point ) to a point in , if the following conditions are satisfied:
- -
- No robot in is connected to any other robot at the north of .
- -
- No robot in is connected to any other robot at the west of , except the robots in .
- -
- All robots in are in the diagonal line that passes through .
- -
- There is at least one robot on the diagonal point of .
Vertical Hops. If no robot in of a robot is connected to any other robot at the north of (of ), makes a vertical hop of distance (where is the vertical distance from to line ) in either of the following conditions:
- Robot sees at least one robot at the intersection point of and .
- Robot sees at least one robot each at both the east and west at horizontal distance . Figure 6b illustrates this case.
Figure 6. An illustration of vertical hops. (a) sees at least one robot on of . (b) sees at least one robot each in both sides east and west at horizontal distance . (c) does not see any robot at horizontal distance in both sides east and west, but at least one in the west of (or East of ) and is connected to other robot in the south of and west of (or East of ). - Robot sees at least one robot on of , no robot in is connected to any other robot at the north of and west of , and the conditions for a diagonal hop are not satisfied for . Figure 6a illustrates this case.
- Robot sees at least one robot in that is connected to a robot at the south of on or west of , and no robot in is connected to any other robot at the north of and west of . Figure 6a also illustrates this case.
- Let be a unit area at the west of and south of with being the topmost horizontal line of and being the rightmost vertical line of . Robot sees that at least one robot in is connected to a robot at the north of and west of , sees at least one robot in , and the conditions for a horizontal hop are not satisfied. Figure 6c illustrates this case.
Remark 1.
Robot 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 are inside an (axis-aligned) -sized square area so that the special procedure for termination, as described in the next paragraph, can be applied.
4.1.3. The Termination Procedure
We will show in the analysis that the diagonal, horizontal, and vertical hops described above position all robots in in an axis-aligned -sized square area, say . We now discuss how the robots reach a point and terminate. Let , , and be the leftmost, bottommost, and rightmost robots in . We have that the unit area of each robot that is in overlaps. Therefore, if all the robots in are in a single diagonal line, then does not move, and all other robots in make a diagonal hop with their destination as the current position of . Otherwise, the robots first perform a horizontal hop, as the destination points the positions on the right vertical line of . The robots on do not move until all the robots in (the same for all robots) are positioned on . After that, the robots (now on ) perform a vertical hop to the destination, which is the position of the bottom most robot on , 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 are positioned in an axis-aligned -sized square area .
Observation 2.
The robots within an axis-aligned -sized square area are positioned at a single point in at most two epochs.
4.2. Analysis of the Algorithm
We first prove correctness and then progress to providing a guarantee of the algorithm. We use and other definitions as in Section 3 except . Here, we define as a horizontal line parallel to at distance south of . Figure 7 illustrates these definitions for the algorithm in the Euclidean plane.
Figure 7.
Illustration of and the triangular area south of it 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 . In the diagonal hops, robots move to the diagonal position that is closer to the other neighboring robots. Since all the robots are inside and initially, there is no neighboring robot outside of those lines; hence, the diagonal hops will also be inside and . In the vertical hops, robots always move vertically south. Since no robot has reached outside of and with the horizontal as well as diagonal hops, this is true with the vertical hop as well.
Observation 3.
No robot of moves outside of lines and during the execution.
Lemma 5.
Given that is connected, the visibility graph at any time remains connected.
Proof.
We extend the proof of Lemma 1. Similarly to the grid, a robot either does not move or performs either a diagonal, horizontal, or a vertical hop. Note also that never moves to any position at the north of . Furthermore, does not move when it sees at least one robot on line or at the north of .
First of all, if the robots move as in the grid case, Lemma 1 provides the connectivity proof for , starting from connected . Therefore, we focus only on the cases that are particularly relevant to the Euclidean plane.
A diagonal hop for is possible only when the robots in are in the diagonal line that passes through and are not connected to any other robot at the west of besides the robots in (the analogous case of can be handled similarly). Moreover, there is at least one robot at point . Robot then moves to . This preserves connectivity for since the robot at must be connected to at least one robot at the east of if all the robots of are not inside . Due to the setting, the robot at may perform its Look phase while is in transit to . Let be the time at which performs its Look. Let be at point p at distance from at time t. Let be for when it is at position p. Even in this case, does not move in a position outside of regardless of whether it performs a horizontal, vertical, or a diagonal hop, preserving connectivity.
A horizontal hop for is possible only when the robots in are not connected to any other robot at the west of similarly to the diagonal hop case with only the difference being that there is no robot on so that even when all the robots in are in a diagonal line, 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 , if it sees no robot at the north in , it moves vertically south on with a distance of exactly one. If sees at least one robot at the north in and satisfies the conditions for vertical hopping, it hops (where is the vertical distance between and ) distance south to a position on (of ). 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 reaches at most distance away from the neighbor robot in (if the neighbor robot does not move in this epoch) and remains connected. Moreover, the robots connected to at the south of do not move as they find at the north and the connectivity with them remains unaffected. Thus, 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. □
Figure 8.
An illustration of movements of robots in the Euclidean plane below . The horizontal and vertical lines are separated by 1 unit distance away, and the robots are positioned arbitrarily in the shaded regions (i.e., they do not need to be necessarily always on the horizontal or vertical lines as in the grid case). At every one unit south of , the width of the positions of robots decreases by 1 unit; hence, all the robots reach inside a unit square at most unit south of . (i) All the robots reached South of . (ii–xi) Movements of robots in the South of in each round. (xii) Robots gathered inside a unit square area in the South of .
Lemma 6.
All the robots in at the north of in move to the positions on or south of in at most three epochs.
Proof.
Since is the topmost horizontal line segment of , there is no robot at the north of . 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 of formed by horizontal lines and , excluding the positions of . Note that in the grid case, the robots were either on or on , and we proved in Lemma 2 that the robots on reach or the south in at most two epochs.
Consider of any robot in . We will show that all the robots in that are in reach or below in at most two epochs. Since these robots do not see any robot on or north of , they perform at least one kind of hop (vertical, horizontal, or diagonal) in the first epoch except the robots positioned between and in the west and and in the east in CA (Figure 8). The robots between and and and may not satisfy any conditions for movement in the first epoch. If all the robots in in perform either a diagonal or a vertical hop, they reach or south in one epoch because, with both the diagonal and vertical hops, robots in reach or below and is either 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 , except the robots in , and there is no robot on of . By the end of the first epoch, all the robots in reach the positions on or east of if all of them make a horizontal hop. In this case, the robots in CA between and 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 or south of it in the second epoch performing a vertical or a diagonal hop. Consider a robot that satisfies the conditions for a horizontal hop in the first epoch. We have it that there is no robot on , and the robots in are connected to no other robot besides the robots in at the west of . Let be a square area adjacent to at the east between lines and . Let and be the bottom horizontal and right vertical lines of . If the robots in are not on and not connected to any other robot below at the west of , they do not move until all the robots in reach or east of in . If there are robots on , let x be the robot on that is the closest from . Let be a line parallel to at some unit distance west of x. All the robots in at the west of perform one horizontal move each in the first epoch. The robots on or east in perform a vertical hop as there are robots on . The robots of that performed a horizontal hop on the first epoch now observe robots on in the second epoch and make a vertical move. Moreover, the robots in , which were waiting for the robots in to perform a horizontal hop in the first epoch, now see robots at their respective and, hence, perform either a vertical or a diagonal hop to . This means that the robots in between and also move to or south in two epochs. Arguing similarly, if the robots in between and do not move in the first epoch, they also see a robot on their respective in the second epoch since the robots at the west of 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 and in move to or move south in the third epoch as they can observe at least one robot on their respective . Therefore, in three epochs, all the robots in reach or south. The Lemma is described follows. □
Lemma 7.
No robots of reaches south of during the execution.
Proof.
We extend the proof of Lemma 3. Let be the set of robots in the increasing order of their x-coordinates in the corridor area between and of . If the robots on set see other robots at distance north from their positions, they do not move and wait until they do not see any robot at the north at a distance . Therefore, similarly to Lemma 3, the robots in that do not see any robot in the north at distance proceed to move south. This will take those robots to the next corridor adjacent to in the south. Suppose at some time , all the robots reach between and . Some robots might see no robots at the north at the distance before time t, and they can perform their moves earlier, which does not affect our argument. Now, the robots in that are in a unit square area (i.e., between and ) in the east perform horizontal moves, and the robots in the next unit square area (i.e., between and ) do not move in the first epoch. Similarly, the robots in that are in two unit square areas in the west (i.e., between and ) do not move in the first epoch. The remaining robots in between and move south. In the next epoch, the robots in between and (including the robots that moved horizontally to this area in the previous epoch) move south. The robots in between and also move south in the this epoch whereas the robots in between and still do not move; they move in the third epoch. The robots in between and and and 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 , 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 will be within a single unit square area in the corridor at distance south of (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 . 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.
Observation 4.
For every one unit vertical hop of the robots in in the south of , the width of the positions of robots decreases by (at least) one.
Lemma 8.
The viewing range of is sufficient for gathering to a point (that is not known beforehand) on a plane under both axis agreements.
Proof.
Let r be a robot in . is computed based on the position of other robots in , which may lie anywhere within . For r to decide whether it is connected to other robots outside , it has to see other robots in both the horizontal and vertical distance of at most one outside . Therefore, the maximum distance between r and some other robot in (or ) is and may be connected to a robot at a distance of at most away from . Therefore, r needs to see at most a distance of to find out whether there is a robot outside or not. When r sees that no robot in is connected outside of , 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 at both the east and west, within the corridor of and . To guarantee whether there is a robot at horizontal distance or not, r needs to see up to a horizontal distance of and vertical distance of . This is because if there is any robot at horizontal distance , it must be connected to a robot at horizontal distance . Therefore, r needs to see at most distance . Figure 9 (left) illustrates this requirement. □
Figure 9.
An illustration of the viewing range of .
The analysis of this section proves the following main result.
Theorem 3.
Given any connected configuration of robots with the viewing range of and the square connectivity range of on a plane, the robots can gather to a point in epochs in the setting under both axis agreements.
Proof.
We have from Lemma 5 that, given a connected , remains connected during the execution of the algorithm. We have from Lemma 6 that all the robots at the topmost horizontal line of move to or south of in at most two epochs. In other words, becomes in at most two epochs and Lemma 6 applies again to . Therefore, all the robots in move to line or south of it in at most epochs. After that, we have it that, from Lemma 7, these robots will be inside an axis-aligned unit area in at most next epochs, arguing similarly with respect to Lemma 6. After all the robots of 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 epochs. The algorithm terminates (Lemma 8). □
5. Gathering under One-Axis Agreement
We discuss modifying the above algorithms when the robots agree on only one axis.
5.1. Grid
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 moving only to the east (Figure 3 (middle)), can also move to the west as well if it sees no robots on or inside , except for the situation where there is exactly one robot on the neighboring grid point on in the west. Regarding Rule 1, 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).
Lemma 9.
The viewing range of three is sufficient for gathering on a grid with guaranteed termination under a one-axis agreement.
Proof.
Notice that a robot terminates if it sees all the robots in are at most two neighboring grid points (one is current position of and the other is either the left horizontal grid point only or the right horizontal neighboring grid point only). For 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 to either of its horizontal neighboring grid point is one, and the distance of the neighboring grid points of ’s horizontal neighboring grid points is at most . Therefore, needs the viewing range of . The connectivity range remains . □
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.
Theorem 4.
Given any connected configuration of robots with the viewing range of three and the square connectivity range of on a grid, the robots can gather in a unit length horizontal line segment (that is not known beforehand) in epochs in the setting under a one-axis agreement.
5.2. Euclidean Plane
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 using and as reference lines, also needs to be computed by using and as references. When 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 and leftmost robot in in order to compute ; for the symmetric case, it takes the topmost and rightmost robots in as a reference. This allows the robots to make horizontal hops in both directions (not necessarily only east under both axis agreement). Therefore, hops to the west of 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 sees at least one other robot each on both sides of on or south of , which is connected to at least one robot of .
- –
- Robot sees at least one other robot on or south of (which is connected ) at one side of (say east) and at least one other robot at horizontal distance ≥2 on the other side (west) (and vice-versa).
- –
- Robot sees other robot(s) on (or connected to other robot(s) at the south of ) only at one side of , say east, then finds the leftmost robot on of (or south of that is connected to ) and sees that no robot in is connected to another robot at its left (i.e., west) at a horizontal distance of ≥1 from (and vice-versa).
Regarding termination, 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 inside an axis-aligned -sized square area in epochs.
We now discuss how the robots in reached a relaxed gathering configuration (Definition 3). Let be the bottommost robot in (if more than one, pick one arbitrarily). Let be the horizontal line passing through . The robots on (including ) do not move. The other robots move vertically to the positions of . The viewing range allows the robots to decide whether there are robots outside or not.
Proof of Theorem 1:
It is easy to see from the analysis of Section 4 that robots in reach inside an axis-aligned unit square area in epochs. The only change on the analysis is on horizontal hops, which does not increase the number of epochs for the robots in 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 . The robots that are not on move vertically to , and the robots on do not move. Therefore, the robots reach a relaxed gathering configuration (Definition 3) in epochs. □
6. Concluding Remarks
We have presented, to the best of our knowledge, the first time-optimal -epoch algorithm for gathering classic oblivious robots in a plane in the setting under limited visibility, improving significantly on the previous -round algorithm of [4] that works in the setting. Our result assumes the viewing range of , the square connectivity range of , and the agreement on one axis. This is in contrast to the viewing range of one and the (circular) connectivity range of 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.
Author Contributions
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.
Funding
This research received no external funding.
Acknowledgments
The authors thank Costas Busch for introducing this problem.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Suzuki, I.; Yamashita, M. Distributed Anonymous Mobile Robots: Formation of Geometric Patterns. SIAM J. Comput. 1999, 28, 1347–1363. [Google Scholar] [CrossRef] [Green Version]
- 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] [Green Version]
- 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] [Green Version]
- 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] [Green Version]
- 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] [Green Version]
- 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] [Green Version]
- 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] [Green Version]
- 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/).