**Distributed Systems and Mobile Computing**

Editor **Giovanni Viglietta**

MDPI • Basel • Beijing • Wuhan • Barcelona • Belgrade • Manchester • Tokyo • Cluj • Tianjin

*Editor* Giovanni Viglietta Japan Advanced Institute of Science and Technology (JAIST) Japan

*Editorial Office* MDPI St. Alban-Anlage 66 4052 Basel, Switzerland

This is a reprint of articles from the Special Issue published online in the open access journal *Information* (ISSN 2078-2489) (available at: https://www.mdpi.com/journal/information/special issues/distributed systems mobile computing).

For citation purposes, cite each article independently as indicated on the article page online and as indicated below:

LastName, A.A.; LastName, B.B.; LastName, C.C. Article Title. *Journal Name* **Year**, *Volume Number*, Page Range.

**ISBN 978-3-0365-2842-7 (Hbk) ISBN 978-3-0365-2843-4 (PDF)**

© 2021 by the authors. Articles in this book are Open Access and distributed under the Creative Commons Attribution (CC BY) license, which allows users to download, copy and build upon published articles, as long as the author and publisher are properly credited, which ensures maximum dissemination and a wider impact of our publications.

The book as a whole is distributed by MDPI under the terms and conditions of the Creative Commons license CC BY-NC-ND.

## **Contents**


## **About the Editor**

**Giovanni Viglietta** has been an Assistant Professor in the School of Information Science at the Japan Advanced Institute of Science and Technology (JAIST) since 2018. He completed his PhD in Computer Science at the University of Pisa (Italy) in 2013, and he obtained postdoctoral fellowships from the University of Ottawa (Canada) and ETH Zurich (Switzerland) in 2013–2018. His research is at the interface between Mathematics and Theoretical Computer Science; his interests include Distributed Computing, Discrete and Computational Geometry, and Combinatorial Game Theory. Throughout his career, he has made contributions to several research areas, including motion planning for mobile robots, population protocols, programmable matter, computer vision, polyhedral combinatorics, the mathematical analysis of games and puzzles, etc. Dr. Viglietta has collaborated with several research teams from USA, Canada, Japan, France, The Netherlands, Italy, Mexico, etc., and has published two book chapters and over 50 peer-reviewed articles in international journals and conferences. In 2015, he was a recipient of the Best Paper Award at the 17th International Symposium on Stabilization, Safety, and Security of Distributed Systems (SSS '15) for a paper on population protocols. He has been a member of the IEICE since 2021; he has been in the Program or Organizing Committees of 11 international conferences and workshops, and has been a referee or sub-referee for over 40 international journals and conferences.

## **Preface to "Distributed Systems and Mobile Computing"**

Recent years have seen rapid development of the field of Distributed Computing, whose interest is the study of systems of autonomous computational entities with limited communication capabilities. Since its first appearances in the 1960s and 1970s, in the context of concurrent processes in early operating systems, Distributed Computing has become a rich and diverse branch of theoretical computer science. Current applications are no longer limited to message-passing in concurrent processes, but extend to wireless computer and sensor networks, the Internet of Things (IoT), autonomous intelligent vehicles, swarms of mobile robots, programmable matter, crawlers on the Web, molecular interactions, etc. Research in Distributed Computing is now at the interface between graph theory, computational geometry, combinatorics, and control theory.

This book is aimed at specialists in computer science, mathematics, and engineering who are interested in current research developments in two topical areas of Distributed Computing: network construction and analysis, and motion planning for mobile robots. The volume includes five research papers authored by some established world-class experts in modern Distributed Computing.

The first article is about the recently introduced model of network constructors: groups of anonymous agents that interact randomly and have the ability to form connections. This behavior naturally emerges in situations where the environment exhibits passive or adversarial dynamics, while agents can actively modify the network structure; examples are found in molecular interactions, which occur in dynamic solutions where proteins are nonetheless able to form stable bonds. The article investigates the fundamental question of which families of networks can be stably constructed in polylogarithmic parallel time, assuming the presence of a unique leader in the system.

The second article is concerned with improving quality of service in IoT networks. While long-range communication offers several advantages in terms of flexibility and cost, ultra-dense IoT networks employing these technologies experience a significant increase in traffic intensity. This is mitigated by subdividing the network into clusters and selecting a structure that maximizes quality of service, as measured under some mathematical models. Typical metrics are throughput and channel capacity. This article formulates a mathematical model to estimate the expected throughput capacity of a given clustering choice. It also develops clustering methods, which depend on the distribution of end devices, achieving near-optimal throughput capacity.

The subject of the last three articles are mobile robots, which are autonomous entities capable of sensing and moving through the environment. Typically, such robots are modeled as points moving within a continuous geometric space, such as a line or a surface. The first of the three articles studies the classic gathering problem, in which all robots in a large swarm, initially scattered across a plane, are tasked with meeting at a common location. Agreeing on a gathering point is an important part of the problem; in fact, the robots do not have the ability to send messages to each other, and they do not have an explicit way to communicate. Another complicating factor is that robots have limited visibility, and only see other robots within a certain range. The article proposes a time-optimal gathering algorithm, assuming that all robots have compasses pointing in the same direction.

The two final articles deal with the evacuation problem, where two robots must locate an unknown exit point within a given region, and reach it in the shortest possible time. The first article studies the evacuation problem on a line, introducing a novel mechanic: the two robots share a single device, called "bike", that can be used by only one robot at a time to move at greater speed. Two models of communication are considered: face-to-face, in which the robots can communicate only when they physically meet, and wireless, in which they can always communicate instantaneously and at any distance. The article proposes several evacuation algorithms for both communication models, comparing their efficiency, and also discusses lower bounds.

The last article studies the evacuation problem on a disk in the face-to-face communication model, which is the most common setting for this problem. This article introduces a multi-objective version of the classical problem, where the robots must evacuate the disk within a specified time while minimizing the average evacuation time. The latter requirement is equivalent to designing a randomized algorithm with an optimal expected evacuation time. In addition to providing several algorithms that achieve different tradeoffs between the two objective functions, the authors introduce a new systematic method for performing both worst-case and average-case analysis for any evacuation algorithm that admits an analytic description. The method is then applied to previously known algorithms, as well as to the new algorithms proposed in this article.

I would like to thank MDPI, especially in the person of Managing Editor Amanda Liu, for giving me the opportunity to edit this book and for assisting me throughout the process.

> **Giovanni Viglietta** *Editor*

### *Article* **On the Distributed Construction of Stable Networks in Polylogarithmic Parallel Time**

**Matthew Connor 1, Othon Michail <sup>1</sup> and Paul Spirakis 1,2,\***


**\*** Correspondence: P.Spirakis@liverpool.ac.uk

**Abstract:** We study the class of networks, which can be created in polylogarithmic parallel time by *network constructors*: groups of anonymous agents that interact randomly under a uniform random scheduler with the ability to form connections between each other. Starting from an empty network, the goal is to construct a stable network that belongs to a given family. We prove that the class of trees where each node has any *k* ≥ 2 children can be constructed in *O*(log *n*) parallel time with high probability. We show that constructing networks that are *k*-regular is Ω(*n*) time, but a minimal relaxation to (*l*, *k*)-regular networks, where *l* = *k* − 1, can be constructed in polylogarithmic parallel time for any fixed *k*, where *k* > 2. We further demonstrate that when the finite-state assumption is relaxed and *k* is allowed to grow with *n*, then *k* = log log *n* acts as a threshold above which network construction is, again, polynomial time. We use this to provide a partial characterisation of the class of polylogarithmic time network constructors.

**Keywords:** population protocol; distributed network construction; polylogarithmic time protocol; spanning tree; regular network; partial characterisation

#### **1. Introduction**

*Passively dynamic networks* are an important type of dynamic network in which the network dynamics are *external* to the algorithm and are a property of the environment in which a given system operates. Wireless sensor networks in which individual sensors are carried by autonomous entities, such as animals, or are deployed in a dynamic environment, such as the flow of a river, are examples of passively dynamic networks. In terms of modelling such systems, the network dynamics are usually assumed to be controlled by an *adversary scheduler* who has exclusive control over the interaction or communication sequence among the computational entities.

One line of research assumes the scheduler to be *fair* in the sense that it can forever conceal potentially reachable configurations of the system. This sub-type of passively dynamic networks are known as population protocols and were introduced in the seminal paper of Angluin et al. [1]. A type of fair scheduler, which is typically assumed when the running time of protocols is to be analysed, is the *uniform random scheduler*, which in every discrete step, selects equiprobably a pair of entities to interact from all permissible pairs of entities. Traditionally, the population protocols literature considers extremely weak entities and the goal is to reveal the computational possibilities and limitations under such a challenging interaction scheme. Recent progress has highlighted the interesting trade-offs between local space of the entities and the running time of protocols, showing, among other things that very fast running times (where fast is, here, considered to be anything growing as polylog(*n*), *n* being the total number of entities in the system) can be achieved for a wide range of basic distributed tasks if the entities are equipped with as few states as polylog(*n*). Alistarh and Gelashvili [2] also proposed the first sub-linear leader election protocol, which stabilises in *O*(log3 *n*) parallel time, assuming *O*(log<sup>3</sup> *n*) states at each

**Citation:** Connor, M.; Michail, O.; Spirakis, P. On the Distributed Construction of Stable Networks in Polylogarithmic Parallel Time. *Information* **2021**, *12*, 254. https:// doi.org/10.3390/info12060254

Academic Editor: Giovanni Viglietta

Received: 1 May 2021 Accepted: 15 June 2021 Published: 19 June 2021

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

**Copyright:** © 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/).

agent. Gasieniec and Stachowiak [3] designed a space optimal (*O*(log log *n*) states) leader election protocol, which stabilises in *O*(log2 *n*) parallel time. General characterisations, including upper and lower bounds of the trade-offs between time and space in population protocols, are provided in [4]. Doty et al. [5] showed that a state count of *O*(*n*60) enables fast and exact population counting.

Another line considers worst-case adversary schedulers, which may even be aware of the protocol and try to optimise against it. There, the entities are typically assumed to be powerful, such as processors of traditional distributed systems, and the only restrictions imposed on the scheduler are instantaneous or temporal connectivity restrictions, which essentially do not allow the scheduler to forever block communication between any two parts of the system. This was initiated by O'Dell and Wattenhofer [6] for the asynchronous case, and then the synchronous case was extensively studied in a series of papers by Kuhn et al. [7]. Michail et al. [8] extended this to the case of possibly disconnected dynamic networks in which connectivity is only guaranteed in a temporal sense.

The other main type of dynamic networks, with respect to who controls the changes in the network topology, are *actively dynamic networks*. In such networks, the algorithm is able to either implicitly change the sequence of interactions by controlling the mobility of the entities or explicitly modify the network structure by creating and destroying communication links at will. This is, for example, the subject of the area of overlay network construction [9–12]; very recently, Michail et al. introduced a fully distributed model for computation and reconfiguration in actively dynamic networks [13].

An interesting alternative family of dynamic networks rises when one considers a mixture of the passive network dynamics of the environment and the active dynamics resulting from an algorithm that can partially control the network changes or that can fix network structures that the environment is unable to affect. This is naturally motivated by molecular interactions where, for example, proteins can bind to each other, forming structures and maintaining their stability despite the dynamicity of the solution in which they reside. Michail and Spirakis [14] introduced and studied such an abstract model of distributed network construction, called the *network constructors* model, where the network dynamicity is the same as in population protocols but now the finite-state entities can additionally activate and deactivate pairwise connections upon their interactions. It was shown that very complex global networks can be formed stably, despite the dynamicity of the environment. Then, Michail [15] studied a geometric variant of network constructors in which the entities can only form geometrically constrained shapes in 2D or 3D space. Another interesting hybrid dynamic network model is the one by Gmyr et al. [16] in which the entities have partial control over the connections of an otherwise worst-case passively dynamic network, following the model of Kuhn et al. [7].

#### *Our Approach*

We investigate which families of networks can be stably constructed by a distributed computing system in polylogarithmic parallel time. To our knowledge, this is the first attempt made to approach this task.

Our protocols assume the existence of a leader node. A node *x* is a *leader node* if in the initial configuration, all *u* ∈ *V* \ {*x*}, where *V* is the set of all nodes, are in state *q*<sup>0</sup> and *x* is in state *s* = *q*0.

We first study the *k-children spanning tree* problem, where the goal is to construct a tree where each node has, at most *k* ≥ 2, children. We show that it is possible to solve this problem for any *k* in *O*(log *n*) time with high probability. We then show that network constructors which create *k*-regular graphs necessarily take Ω(*n*) time. However, with minimal relaxation to (*k*, *k* − 1)-regular networks, the problem can be solved for any constant *k* ≥ 2 in polylogarithmic time. We examine this as a special case of the (*l*, *k*)*-Regular Network* problem, where the goal is to construct a spanning network in which every node has at least *l* < *k* and at most *k* connections, where 2 < *k* < *n*. We then transition to experimental analysis of the protocol, which not only provides evidence of the

sharp contrast of the minimal relaxation but also reveals a threshold value for *k*, beyond which the problem reverts to polynomial time. We use this knowledge to propose a first partial characterisation of the set of polylogarithmic time network constructors. We leave providing formal bounds as an open problem.

In Section 2, we formally define the model of network constructors and the network construction problems that are considered in this work. In Section 3, we study the *k*children spanning tree problem and provide the lower bound for *k*-regular networks. We then present a protocol for the (*l*, *k*)-regular network problem and our experimental analysis, culminating in partial characterisation. In Section 4, we conclude and give further research directions that are opened by our work.

#### **2. Materials and Methods**

#### *2.1. The Model*

**Definition 1.** *A Network Constructor (NET) is a distributed protocol defined by a 4-tuple* (*Q*, *q*0, *Qout*, *δ*)*, where Q is a finite set of node-states, q*<sup>0</sup> ∈ *Q is the initial node-state, Qout* ⊆ *Q is the set of output node-states, and δ* : *Q* × *Q* × {0, 1} → *Q* × *Q* × {0, 1} *is the transition function.*

If *δ*(*a*, *b*, *c*)=(*a* , *b* , *c* ), we call (*a*, *b*, *c*) → (*a* , *b* , *c* ) a *transition* (or *rule*) and we define *δ*1(*a*, *b*, *c*) = *a* , *δ*2(*a*, *b*, *c*) = *b* , and *δ*3(*a*, *b*, *c*) = *c* . A transition (*a*, *b*, *c*) → (*a* , *b* , *c* ) is called *effective* if *x* = *x* for at least one *x* ∈ {*a*, *b*, *c*} and *ineffective* otherwise. When we present the transition function of a protocol, we only present the effective transitions. Additionally, we agree that the *size* of a protocol is the number of its states, i.e., |*Q*|.

The system consists of a population *VI* of *n* distributed *processes* (called *nodes* for the rest of this paper). In the generic case, there is an underlying *interaction graph GI* = (*VI*, *EI*) specifying the permissible interactions between the nodes. Interactions in this model are always pairwise. In this work, *GI* is a *complete undirected interaction graph*, i.e., *EI* = {*uv* : *u*, *v* ∈ *VI*and *u* = *v*}, where *uv* = {*u*, *v*}. Initially, all nodes in *VI* are in the initial node-state *q*0. A central assumption of the model is that edges have binary states. An edge in state 0 is said to be *inactive* while an edge in state 1 is said to be *active*. All edges are initially inactive. Execution of the protocol proceeds in discrete steps. In every step, a pair of nodes *uv* from *EI* is selected by an *adversary scheduler* and these nodes interact and update their states and the state of the edge joining them, according to the transition function *δ*.

A *configuration* is a mapping *C* : *VI* ∪ *EI* → *Q* ∪ {0, 1} specifying the state of each node and each edge of the interaction graph. Let *C* and *C* be configurations, and let *u*, *υ* be distinct nodes. We say that *C* goes to *C* via *encounter e* = *uυ*, denoted *C <sup>e</sup>* −→ *C* , if (*C* (*u*), *C* (*v*), *C* (*e*)) = *δ*(*C*(*u*), *C*(*v*), *C*(*e*)) or (*C* (*v*), *C* (*u*), *C* (*e*)) = *δ*(*C*(*v*), *C*(*u*), *C*(*e*)) and *C* (*z*) = *C*(*z*), for all *z* ∈ (*VI* \ {*u*, *v*}) ∪ (*EI* \ {*e*}). We say that *C is reachable in one step from C*, denoted *C* → *C* , if *C <sup>e</sup>* −→ *C* for some encounter *e* ∈ *EI*. We say that *C* is *reachable* from *C* and write *C* - *C* , if there is a sequence of configurations *C* = *C*0, *C*1, ... , *Ct* = *C* , such that *Ci* → *Ci*+<sup>1</sup> for all *i*, 0 ≤ *i* < *t*.

An *execution* is a finite or infinite sequence of configurations *C*0, *C*1, *C*2, ... , where *C*<sup>0</sup> is an initial configuration and *Ci* → *Ci*+1, for all *i* ≥ 0. A *fairness condition* is imposed on the adversary to ensure that the protocol makes progress. An infinite execution is *fair* if for every pair of configurations *C* and *C* such that *C* → *C* , if *C* occurs infinitely often in the execution then so does *C* . In what follows, every execution of a NET is, by definition, considered to be fair.

We define the *output of a configuration C* as the graph *G*(*C*)=(*V*, *E*) where *V* = {*u* ∈ *VI* : *C*(*u*) ∈ *Qout*} and *E* = {*uv* : *u*, *v* ∈ *V*, *u* = *v*, and *C*(*uv*) = 1}. In words, the output graph of a configuration consists of those nodes that are in output states and those edges between them that are active, i.e., the active subgraph induced by the nodes that are in output states. The output of an execution *C*0, *C*1, ... is said to *stabilize* (or *converge*) to a graph *G* if there exists some step *t* ≥ 0 such that (abbreviated "s.t." in several places) *G*(*Ci*) = *G* for all *i* ≥ *t*, i.e., from step *t* and onwards, the output graph remains unchanged. Every such configuration *Ci*, for *i* ≥ *t* is called *output stable*. The *running time* (or *time*

*to convergence*) of an execution is defined as the minimum, such as *t* (or ∞ if no such *t* exists). Throughout the paper, whenever we study the running time of a NET, we assume that interactions are chosen by a *uniform random scheduler*, which, in every step, selects independently and uniformly at random one of the |*EI*| = *n*(*n* − 1)/2 possible interactions. In this case, the running time becomes a random variable (abbreviated "r.v." throughout) *X* and our goal is to obtain bounds on the expectation *E*[*X*] of *X*. Note that the uniform random scheduler is fair with probability 1.

In this work, "time" is treated as sequential in our analyses, i.e., a time step consists of a single interaction selected by the scheduler. Such a sequential estimate can be easily translated to some estimate of parallel time. For example, assuming that Θ(*n*) interactions occur in parallel in every step, one could obtain an estimation of parallel time by dividing sequential time by *n*. All results are given in parallel time.

**Definition 2.** *We say that an execution of a NET on n nodes constructs a graph (or network) G, if its output stabilises to a graph isomorphic to G.*

**Definition 3.** *We say that a protocol P constructs a graph language L, if in every execution P constructs a graph G* ∈ *L and for all G, there exists an execution of P, which constructs G.*

#### *2.2. Problem Definitions*

Here, we provide formal definitions for all of the classes of networks considered in this paper.

*k-Children Spanning Tree*: The goal is to construct a spanning tree where each individual element has at most *<sup>k</sup>* <sup>∈</sup> <sup>N</sup> children.

(*l*, *<sup>k</sup>*)*-Regular Network*: A spanning network where for any *<sup>l</sup>*, *<sup>k</sup>* <sup>∈</sup> <sup>N</sup> where *<sup>l</sup>* <sup>&</sup>lt; *<sup>k</sup>*, elements with degree *d* < *l* form a clique and all others have a degree of at least *l* and at most *k*.

#### *2.3. Experimental Setup*

We performed experiments with the goal of guiding a proof of the running time necessary to solve the (*l*, *k*)-regular network problem. We learned that a formal proof would be difficult, due to the reliance of random variables on the values of other random variables, so we left this as an open problem. We then experimented with different values of *k* to see what the effect would be, and discovered a running time threshold in the process. All were implemented using C and compiled with GCC. All tests were repeated at least five times per the value of *n* and the average number of time steps were taken as the result. To terminate our experiments, we designed special stabilisation conditions.

#### **3. Results**

#### *3.1. Polylogarithmic Time Protocols for k-Children Spanning Trees*

In this section, we study the complexity of the *k*-Children Spanning Tree problem. We give a protocol (Algorithm 1) and show that it has a running time of *O*(log *n*) parallel time with high probability.


*Q* = {*F*, *L*0, *L*1,..., *Lk*,*O*0,*O*1,...,*Ok*} *δ*: (*Lx*, *F*, 0) → (*Lx*+1,*O*0, 1) for *x* < *k* (*Oy*, *F*, 0) → (*Oy*+1,*O*0, 1) for *y* < *k*

In the above protocol, the *F* state corresponds to being a node, which is not a member of the tree. *Li* corresponds to the *leader* node, which acts as the root of the tree, and *Oi* to non-leader nodes in the tree, where *i* represents the number of children of a given node. We assume that for every execution of Algorithm 1 on a population *P* of *n* nodes, *n* − 1 nodes initialise to the state *F* and one node initialises to the state *L*0.

We begin by proving that Algorithm 1 stably constructs the graph language *Tk* <sup>=</sup> {*G*|*<sup>G</sup>* is a rooted tree and <sup>∀</sup>*<sup>u</sup>* <sup>∈</sup> *<sup>P</sup>* <sup>=</sup><sup>⇒</sup> <sup>Δ</sup>+(*u*) <sup>≤</sup> *<sup>k</sup>*}, where <sup>Δ</sup>+(*u*) is defined as the number of children of the node *u* and *k* ≥ 2. We then show that this is accomplished in *O*(log *n*) parallel time. Then, we show that this bound holds with high probability.

**Lemma 1.** *Under Algorithm 1, the connected component S, defined as the leader node and all nodes connected to the leader either directly or indirectly through some other nodes, is eventually spanning.*

**Proof.** We observe that the number of open slots *o* is initially *k*. *o* is non-decreasing, as every increase in <sup>Δ</sup>+(*u*) for some *<sup>u</sup>* necessarily increases <sup>|</sup>*V*(*S*)|. Since there are always open slots available, every unconnected node is guaranteed to be able to connect to *S* at some point. Therefore, when *S* stabilises, it contains all *u* ∈ *P*.

**Lemma 2.** *For all executions of Algorithm 1 on the population P of n nodes, it stabilises to some G* ∈ *Tk where* |*V*(*G*)| = *n.*

**Proof.** We prove this via an induction on the connected component *S*. For the base case, there is one node in the state *L*0. This is trivially a member of *Tk*, as no connections have formed yet. We now assume that there is a connected component of size |*S*|. For a connected component of size |*S*| + 1, an unconnected node *u* ∈ *V* \ *S* in the state *F* must connect to *S* at some node *x* ∈ *S*. By Lemma 1, such a node must exist. If the node *x* has two children, it is in the state *O*<sup>2</sup> or *L*2, as for all nodes in states *Oi* and *Lj*, the *i* and *j* correspond to the number of children of those nodes. Since there are no defined transitions from these states, no *u* can connect to *x*. Therefore, *S* remains a tree and *G*(*S*) ∈ *Tk*.

**Lemma 3.** *For all G* ∈ *Tk, there is an execution of Algorithm 1, which stabilises on G when starting on a population P of size n* = |*V*(*G*)|*.*

**Proof.** We first set the value of *k* to the maximum number of connections in any node in the tree. Let the leader node *l* in the population *P* correspond to the root *r* of *G*. If *r* has *i* children, connect *i* nodes in the state *F* to *l*. For each child *c* of the leader node, let it correspond to a child *d* of *r*. If *d* has *j* children, connect *j* nodes in the state *F* to *c*. Continuing this process for all nodes *u* ∈ *G*, the result is a spanning tree where all nodes in the tree are equivalent to some *u* ∈ *G*.

**Theorem 1.** *Algorithm 1 stably constructs the graph language Tk in O*(log *n*) *time w.h.p.*

**Proof.** By application of the Lemmas above.

We now show that Algorithm 1 constructs *Tk* in *O*(log *n*) time w.h.p by considering executions where *k* = 2. Executions where *k* > 2 are necessarily faster, as they have more open slots per node.

**Lemma 4.** *Let G* ∈ *T*<sup>2</sup> *of n nodes. The number of available nodes α*(*G*) = |*G*|/2 + 1*.*

**Proof.** Observe that for *G*, every second node that connects to *G* keeps the number of available nodes the same. This is because two new nodes must become children of the same node, and the second new node takes the second slot. For the base case, *n* = 1 and *α* = 0 + 1 = 1. We divide *n* = *n* + 1 into two cases: *n* is *even* and *n* is *odd*. If *n* is *even*, then *α* = *n*/2 + 1. Then, for *n* = *n* + 1, *α* = *n* + 1/2 + 1 = *n*/2 + 1. This corresponds to the observation earlier that every other node (i.e., *n* is odd) should not increase *α*. If *n* is *odd*, then *α* = *n*/2 + 1 = (*n* − 1)/2 + 1. Then, for *n* = *n* + 1, *α* = *n* + 1/2 + 1 = *n*/2 + 1 as expected.

**Remark 1.** *At any point during the execution of Algorithm 1, for the connected component S, G*(*S*) ∈ *α*(*G*)*.*

Let the probablistic process *P* be an execution of Algorithm 1 for *k* = 2 with the following scheduling restriction: If at any point during the execution of Algorithm 1 two nodes *x* and *y* have exactly one child, disconnect that child of *x* or *y*, which is a leaf, and connect it to the other node. If both are leaves, pick one at random.

#### **Lemma 5.** *The expected time to convergence of the probabalistic process P is O*(log *n*)*.*

**Proof.** Let the r.v. *X* be the number of steps until convergence. A step is *successful* if any unconnected node joins the connected component *S*. An *epoch i* is the period beginning with the step following the (*i* − 1)st success and ending with the step at which the *i*th success occurs. The r.v. *Xi*, 1 ≤ *i* ≤ *n* − 1 is the number of steps in epoch *i*. *pi* is the probability of success at any step in epoch *<sup>i</sup>*. This is defined as *pi* <sup>=</sup> <sup>2</sup>*α*(*Ti*)(*n*−*i*) *<sup>n</sup>*(*n*−1) , where *Ti* is the graph of the strongly connected component G(S) in epoch *i*.

It follows that *<sup>E</sup>*[*Xi*] = 1/*pi* <sup>=</sup> *<sup>n</sup>*(*n*−1) <sup>2</sup>*α*(*Ti*)(*n*−*i*). By linearity of expectation we have the following:

$$\begin{split} E[X] &= E\left[\sum\_{i=1}^{n-1} X\_i\right] = \sum\_{i=1}^{n-1} E[X\_i] = \sum\_{i=1}^{n-1} \frac{n(n-1)}{2a(T\_i)(n-i)} = \frac{n(n-1)}{2} \sum\_{i=1}^{n-1} \frac{1}{a(T\_i)(n-i)} \\ &= \frac{n(n-1)}{2} \sum\_{i=1}^{n-1} \frac{1}{(\lfloor i/2 \rfloor + 1)(n-i)} \le \frac{n(n-1)}{2} \sum\_{i=1}^{n-1} \frac{1}{(i/2)(n-i)} \\ &= n(n-1) \sum\_{i=1}^{n-1} \frac{1}{i(n-i)} = n(n-1) \sum\_{i=1}^{n-1} \frac{1}{n} \left(\frac{1}{i} + \frac{1}{n-i}\right) \\ &= (n-1) \left[\sum\_{i=1}^{n-1} \frac{1}{i} + \sum\_{i=1}^{n-1} \frac{1}{n-i}\right] = (n-1)2H\_{n-1} = 2(n-1)[\ln(n-1) + O(1)] \\ &= O(n \log n) \end{split}$$

**Lemma 6.** *The running time of P is the worst case running time for Algorithm 1.*

**Proof.** Assume that there is an execution of *A*, which has an slower running time than *P*. Such an execution must have a lower number of available nodes at some point than *P*. If the execution simulates the scheduling restriction of *P*, then it cannot be slower than *P*. If the execution does not simulate the restriction, then at some point, two nodes have two leaves and one is not shifted to the other. The number of available nodes is, therefore, greater by one and the expected running time is faster than *P*. Therefore, any execution of *A* must be at least as fast as *P*.

**Theorem 2.** *The expected running time of Algorithm 1 is upper bounded by the O(*log *n) running time of P.*

**Proof.** By application of Lemmas 5 and 6.

**Lemma 7.** *For each time step in Algorithm 1, the probability of any node in the set of unconnected nodes U connecting to the tree is at least* 2 <sup>|</sup>*U*<sup>|</sup> *n .*

**Proof.** Assume that there are |*S*| nodes, which are connected to the tree. The probability of a node *<sup>x</sup>* <sup>∈</sup> *<sup>U</sup>* connecting to the tree is <sup>|</sup>*S*||*U*<sup>|</sup> *<sup>n</sup>*<sup>2</sup> . If there are at least *n*/2 nodes connected to the tree, then <sup>|</sup>*S*||*U*<sup>|</sup> *<sup>n</sup>*<sup>2</sup> <sup>≥</sup> 1/2|*U*<sup>|</sup> *<sup>n</sup>*<sup>2</sup> <sup>=</sup> <sup>2</sup> <sup>|</sup>*U*<sup>|</sup> *<sup>n</sup>* . The case where there are less than *n*/2 nodes connected to the tree is symmetrical, meaning that same process happens in reverse for 1 ≤ *n* ≤ *n*/2. Therefore, 2 <sup>|</sup>*U*<sup>|</sup> *<sup>n</sup>* is a lower bound of the probability of connecting to the tree.

**Lemma 8.** *For Algorithm 1, the number of time steps until convergence is O*(log *n*) *w.h.p.*

**Proof.** Consider the scenario where *m* balls are being thrown into *n* bins. If *Z* is the random variable for the number of empty bins, then *<sup>E</sup>*[*Z*] = *<sup>n</sup>*(<sup>1</sup> <sup>−</sup> 1/*n*)*m*. The probability of a ball entering an empty bin is *e*/*n*; *e* is the number of empty bins. For our protocol scenario, balls are time steps and bins are unconnected nodes. So *m* = *an* ln *n* is the number of balls, and *n* is the number of bins. Since the probabilty of success in the balls and bins scenario is lower than 2 <sup>|</sup>*U*<sup>|</sup> *<sup>n</sup>* when |*U*| = *e*, we can use it as a bound for the probability of success. Therefore, *<sup>E</sup>*[*Z*] = *<sup>n</sup>*(<sup>1</sup> <sup>−</sup> 1/*n*)*an* ln *<sup>n</sup>* <sup>≤</sup> *ne*−*an* ln *<sup>n</sup>* <sup>=</sup> *<sup>n</sup>*1−*a*. Using Markov's inequality, *<sup>E</sup>*[*<sup>Z</sup>* <sup>≥</sup> <sup>1</sup>] <sup>≤</sup> *<sup>E</sup>*[*Z*] = <sup>1</sup> *<sup>n</sup><sup>a</sup>* . Since *a* can be set arbitrarly high, convergence is *O*(log *n*) w.h.p.

**Theorem 3.** *Algorithm 1 stably constructs the graph language Tk in O*(log *n*) *time w.h.p.*

**Proof.** By application of Lemmas 7 and 8.

#### *3.2. Time Thresholds for* (*l*, *k*)*-Regular Networks*

In this section, we present our solution for the (*l*, *k*)-Regular Network problem for *l* = *k* − 1, the *Cross-edges Tree* protocol. We first show that a *k-regular network*, defined as a network where each node has a degree exactly equal to *k*, cannot be constructed in polylogarithmic time. We then show via experimental analysis that this impossibility result does not hold for the minimal relaxation of (*l*, *k*)-Regular Networks when *k* is a constant and *l* = *k* − 1. Finally, we demonstrate that when *k* exceeds the threshold of log log *n*, the protocol itself is no longer in the polylogarithmic time class. Note that from now on, *k* refers to the *degree* of a node, not the *number of children*.

**Theorem 4.** *Any protocol which constructs a k-regular network where k* < *n has a running time of* Ω(*n*)*.*

**Proof.** Consider the population *P* of size *n*, using a generic *k*-regular network construction protocol *X*. The number of connections is limited by *k* to *kn* <sup>2</sup> , as this is less than the *<sup>n</sup>*(*n*−1) 2 maximum for *n* nodes. The population initially has *kn* network connection entry points, which can be used to make new connections and which decrease by 2 for every connection made. Since (*kn*) ≤ *n*(*n* − 1), at some point in the execution, there must be two nodes with 1 unused entry point each. Using these points and stabilising the protocol means that both nodes must be selected by the scheduler at the same time, an event with probability <sup>1</sup> *n*2 . Since an event with probability <sup>1</sup> *<sup>n</sup>*<sup>2</sup> is unavoidable, the protocol *X* must construct a network in at least Ω(*n*2) interactions.

In light of the above impossiblity, we now give our protocol (Algorithm 2) for the (*l*, *k*)-Regular Network problem when *l* = *k* − 1. Note that the leader node has at most two connections; this is to guarantee that there is no scenario where a partial network with unconnected nodes cannot connect to forms.



The Cross-edges Tree protocol adds additional rules, allowing leaves within a tree to connect to other nodes within the tree as though they are candidates for becoming children.

Stabilisation Conditions of the (*l*, *k*)-Regular Network

To implement a simulator that can provide results efficiently, we had to define and prove conditions which, when fulfilled, ensure that the protocol is stable.

**Lemma 9.** *For n* > 3*, protocol 2 stabilises with at least 1 node, which is not in the state of k in the connected tree.*

**Proof.** If all nodes in the connected tree are in the *Ok* state, then at some point, two *Ok*−<sup>1</sup> nodes would have to change to the *Ok* state, which is against the rules of the protocol.

**Corollary 1.** *Due to the presence of nodes in a state s* = *Ok and the fairness condition, Algorithm 2 never stabilises with isolated nodes, defined as nodes which are not part of the main tree structure.*

**Lemma 10.** *For n* > 3*, protocol 2 stabilises with, at most, k* − 2 *nodes in the states* {*Ox*|*x* < *k* − 1}*.*

**Proof.** Assume that there are *k* − 1 nodes in the states *Ox*. If this is the case, there must be some node that is connected to the tree and every other node with any state *Ox*; otherwise, the protocol is not stable. This node must have the state *Ok*−1, which is not in *Ox*. Therefore, the number of nodes in *Ox* is, at most, *k* − 2.

**Theorem 5.** *For n* > *k* > 3*, at most, n* − *k* − 2 *nodes have a degree of either k or k* − 1 *and l* ≤ *k* − 2 *nodes are of a degree of at least* 1 *and at most k* − 2*.*

**Proof.** All nodes with degree *x* < *k* − 1 must be members of a clique; otherwise, the protocol is not stable. By Lemma 12, we know that there are no isolated nodes, or nodes with degree *d* < 1. By Lemma 13, we know that there are, at most, *k* − 2 nodes of degree less than *k* − 1, and that the maximum state within the clique is *Ok*−2. Therefore, the theorem must hold.

We now provide the results of simulating the protocol for *k* = 3. We used the same conditions as in the other running time experiments, executing the protocol 10 times for each population size *n*, where *n* = 10 + 6*t*, where *t* is the test number from 0 to 199. The results are given in Figure 1.

**Figure 1.** Running time of the protocol for *k* = 3, compared with a polylogarithmic function.

The running time is difficult to prove formally. This is because random variables are used, which represent the number of nodes with a given degree in a given time step. Their values depend on the values of all random variables in the previous time step. We, therefore, turn our focus to experiments based on measuring the impact of the value of *k* on the running time of the protocol.

We measured the running time of our Cross-edges Tree protocol for different network sizes. The results below (Figure 2) show that a higher value of *k* has little effect on the running time until *k* exceeds log log *n*.

**Figure 2.** The effect of *k* on the running time of the protocol.

To investigate why the protocol slows down dramatically after this point, we ran experiments where we stored the number of nodes with specific degrees in each time step. We executed the protocol with 200 nodes, and ran 10 iterations. These degrees were set to 0, 1, *k*/2, *k* − 1, and *k*. We collected results for *k* = log log *n* (Figure 3), *k* = log *n* (Figure 4), and *<sup>k</sup>* <sup>=</sup> <sup>√</sup>*<sup>n</sup>* (Figure 5). The results show that the cause seems to be a large reduction in the number of nodes, which are in the *k* − 1 state as *k* grows as a fraction of *n*. They suggest that when the fraction of *k* − 1 nodes is below some fraction between 1/4 and 1/8 of the total, the protocol slows down and enters the class of protocols with polynomial time.

**Figure 3.** The results for *k* = log log *n*. Note the difference in the axes labels.

**Figure 4.** The results for *k* = log *n*. Here, we see the beginning of a leftwards shift of the lines, and an upwards shift in *d* = *k*.

**Figure 5.** The results for *<sup>k</sup>* <sup>=</sup> <sup>√</sup>*n*. Both shifts are more intense.

#### **4. Conclusions**

Population protocols have a history of being applied in the context of physical devices [17]. However, to our knowledge, there has yet to be an attempt to apply the network constructors model to such a setting. For a cluster of devices, as in an Internet of Things style network [18], it may be desirable to form networks in order to solve problems in a very time-sensitive and highly dynamic context. This should typically be achieved without each device being aware of the size of the network or what specific devices the others are connected to. Network constructors and, thus, the protocols presented in this work, may be may be applicable to this, as they help define the class of networks which could be constructed in such a context. Works on social networks and social communities are a possible application domain for our models (see, e.g., [19]). It would be interesting to further investigate the potential applicability of population protocols and network constructors in data streaming applications; a preliminary attempt to do this was attempted by [20].

There are a number of open problems to be addressed. The most important is to develop an exact characterisation of the class of networks which can be constructed in polylogarthimic parallel time. However, there are other, more immediate problems. For example, we have yet to investigate the effect that widening the difference between *k* and *l* will have on the protocol. We speculate that this will result in a faster running time in exchange for less uniformity within the resulting spanning network. We also speculated about the possibilities of using a leaderless version of our Cross-tree Protocol. We believe that such a protocol may offer a trade off between the running time and the possibility of forming networks, which are spanning, depending on the values of *k* and *l*.

**Author Contributions:** Conceptualization, O.M.; Data curation, M.C.; Formal analysis, M.C. and O.M.; Investigation, M.C.; Methodology, O.M.; Software, M.C.; Supervision, O.M.; Writing—original draft, M.C.; Writing—review and editing, M.C., O.M. and P.S. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by an EPSRC Doctoral Training Studentship.

**Data Availability Statement:** We did not use any real data from data sources.

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

#### **References**


### *Article* **Clustering Optimization of LoRa Networks for Perturbed Ultra-Dense IoT Networks**

**Mohammed Saleh Ali Muthanna 1,2, Ping Wang 3, Min Wei 3,\*, Ahsan Rafiq <sup>1</sup> and Nteziriza Nkerabahizi Josbert <sup>1</sup>**


**Abstract:** Long Range (LoRa) communication is widely adapted in long-range Internet of Things (IoT) applications. LoRa is one of the powerful technologies of Low Power Wide Area Networking (LPWAN) standards designed for IoT applications. Enormous IoT applications lead to massive traffic results, which affect the entire network's operation by decreasing the quality of service (QoS) and minimizing the throughput and capacity of the LoRa network. To this end, this paper proposes a novel cluster throughput model of the throughput distribution function in a cluster to estimate the expected value of the throughput capacity. This paper develops two main clustering algorithms using dense LoRa-based IoT networks that allow clustering of end devices according to the criterion of maximum served traffic. The algorithms are built based on two-common methods, K-means and FOREL. In contrast to existing methods, the developed method provides the maximum value of served traffic in a cluster. Results reveal that our proposed cluster throughput model obtained a higher average throughput value by using a normal distribution than a uniform distribution.

**Keywords:** Internet of Things; dense networks; LPWAN; LoRa; clustering; throughput; capacity; QoS

#### **1. Introduction**

Currently, in the era of the IoT [1], communication technologies have significantly expanded to reach a variety of industries. Consequently, providing low-power and longdistance communication networks has become an essential component of many applications within smart cities, such as waste management [2], supply chain [3], Industrial Internet of Things [4], smart metering [5], and traffic control. Low Power Wide Area Networking (LPWAN) is an effective way for such applications to overcome these cost, energy, and complexity challenges, especially when such applications require covering large geographic areas. One of the attracted extensive attentions for LPWAN technologies today is Long Range (LoRa) [6]. The communication model of LoRa can be considered a better alternative for short-range and cellular communications in different applications and will offer notable features, such as low data rates, long-range, and low power consumption. The LoRa technology provides a high flexibility network by introducing long-range communication at low cost and communication specifications (e.g., bit rate, throughput, and delay). Network flexibility is an important issue that is related to LoRa network design [7].

However, a dense number of deployed devices in a large geographical area lead to a significant increase in subscriber traffic intensity. The demand from large retailers is growing to offer enhanced quality of services (QoS) and channel capacity, which is difficult for network operators [8]. The main trends in the development of LoRa networks consist of the rise of LoRa capacity and the number of users served.

**Citation:** Muthanna, M.S.A.; Wang, P.; Wei, M.; Rafiq, A.; Josbert, N.N. Clustering Optimization of LoRa Networks for Perturbed Ultra-Dense IoT Networks. *Information* **2021**, *12*, 76. https://doi.org/10.3390/ info12020076

Academic Editor: Giovanni Viglietta Received: 25 January 2021 Accepted: 8 February 2021 Published: 10 February 2021

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

**Copyright:** © 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/).

In some cases, these processes lead to a decrease in the QoS requirements. To ensure the required QoS in LoRa networks' design, it is necessary to resort to various methods to guarantee the sufficiency of the relevant resources, such as reducing the service area of LoRa gateways, increasing their number, and maximizing the throughput and capacity of the LoRa networks [9]. It can be shown that the previous problems are highly related and simultaneously affect QoS in LoRa networks performance. These problems should be solved considering the peculiarities of the placement of end devices in the service area, possibly considering their movements. When organizing LoRa end devices connection, it is required to solve the problem of ensuring QoS traffic within the cluster and between network elements and certain elements of clusters.

The clustering methods consist of selecting a certain number of clusters and selecting a structure that provides the maximum possible traffic QoS. The clustering problem's solution is similar to the optimization problem's solution in which a certain metric is minimized (maximized). Such a metric may be throughput and channel capacity.

This paper analyzes the channel capacity between the cluster member (CM) and the cluster head (CH). We develop a cluster throughput model to estimate the expected value of the throughput capacity and develop clustering methods to make a rational choice of the algorithm depending on the distribution of end devices, which allows obtaining a cluster throughput capacity value close to the maximum. The main contributions of this paper are summarized as follows:


The rest of the paper is presented in several sections: Section 2 presents the related work and motivation. The LoRa technology overview is detailed in Section 3. Section 4 illustrates the problem statement. Section 5 presents the system description. Section 6 presents the clustering methods. Evaluation results based on two-common methods, Kmeans and FOREL, are presented in Section 7. Section 8 offers the discussion, and lastly, in Section 9, we make a conclusion and discuss future work.

#### **2. Related Work and Motivation**

Recent works on LoRa and Long Rang Wide Area Networking (LoRaWAN) have mainly dealt with LoRa performance evaluation in terms of capability [10,11], performance [12], lifetime [13], latency [14], and parameter setting [15,16] for industrial monitoring applications. For example, in [7], a temperature monitoring application is proposed. Dynamic Line Rating (DLR) for an Overhead Transmission Line (OTL) system is monitored as it relies on the weather, temperature, and inclination measurements. Here, OTL monitoring is carried by a vision system, which is further transmitted by LoRa communication. Communication is carried between the vision system and supervisory control and data acquisition (SCADA) system. This paper illustrates that QoS has a vital function in the received data reliability.

The paper in [17] aims to determine the scalability of the LoRa technology. For that, a high density of sensors is deployed in IoT environments for smart city applications. When the network scale is increased, the data transmission system has been affected. This paper finalizes that the data transmission system can be improved by focusing on optimal transmission policies, including the spreading factor (SF) allocation. Significantly, SF allocation is affected by distance with gateway and other factors. With an increase in network scale, a single gateway fails to ensure better data transmission efficiency.

The work in [18] constructs an infrastructure that is capable of tracking and monitoring the environmental system. LoRa technology is used for tracking applications to overcome energy-related limitations. As this system is planned to be implemented in coastal applications, multiple gateways are deployed. With the multiple gateways, this work attains the required level of connectivity and coverage in the network. Received signal strength indicator (RSSI) is considered for SF allocation, and the data is encrypted for security reasons.

The paper in [19] proposed an adaptive data rate (ADR) algorithm for improving error performance in rough channels resulting in extending the range of the network, the problem addressed by this paper to enhance the scalability, robustness, and fairness between nodes of the network by reducing the number of the data messages in the uplink direction as well as the medium access control (MAC) command messages in the down-link direction by using ADR algorithm. ADR algorithm in this paper is effective in stable channel conditions with a small-scale network, but the main motive of LoRa is in highly variable conditions. Thus, ADR algorithm in this work does not include in large complex networks.

To improve QoS in LoRa, the authors in [20] first derived the IoT node's mathematical model. From the mathematical model, the closed-form formula is derived to characterize the node performance. Then, the performance is maximized by optimizing the performance of IoT nodes. For formulating nodes performance, the Markov chain model is utilized. Then, the optimal transmission policy is derived based on the mathematical model of the node. The work in [20] considered both types of data, including normal data and emergency data. For both data, performance is optimized by a genetic algorithm (GA) and simulated annealing (SA) algorithm. Although normal and emergency types are considered, the same fitness function is formulated for both types. However, different types of data require different QoS levels, which is not achieved in this work. GA and SA update the parameters. GA is complex in nature and difficult to handle scalable problems, while SA is very slow and sensitive to even small changes in the input values. Thus, the optimal parameter assignment for all packets by GA and SA is relatively tricky. Parameters are updated by clustering algorithms, which are efficient since it learns the environment continuously.

Complementary to the presented related works, this paper focuses particularly on throughput capacity in LoRa networks and provides a solution to maximize throughput capacity value and build solutions to achieve the QoS requirements by developing clustering algorithms for distributing and managing LoRa gateways for smart city application and IoT dense networks.

#### **3. LoRa Technology Overview**

In [21], the proprietary LoRa physical layer (PHY) technique is possessed via Semtech Corporation. In [22], LoRa Alliance has specified LoRaWAN as the medium access control (MAC) layer protocol. This section described more specific details of LoRa technology, LoRaWAN, and the main characteristics in the following subsection.

#### *3.1. LoRa Physical Layer*

The LoRa modulation has several parameters: (i) spreading factor (SF); (ii) bandwidth (BW); (iii) chirp spread spectrum (CSS); code rate (CR) [23]. In LoRa modulation, information is transmitted in symbols, the length of which Ts depends on using (SF). Each symbol is a sinusoidal signal, the frequency of which is cyclically shifted within a bandwidth (BW).

In LoRa modulation, the symbol duration Ts and bit rate (Rb) can be calculated as following [24]:

$$\mathrm{R\_b = SF} \ast \frac{\mathrm{BW}}{2^{\mathrm{SF}}} \ast \mathrm{CR},\tag{1}$$

$$\text{T}\_{\text{s}}(\text{s}) = \frac{2^{\text{SF}}}{\text{bw}^{\prime}} \tag{2}$$

where SF refers to the spreading factor, and BW is bandwidth. The transmitted symbol rate Rs is calculated as Rs(Symbol/ sec) = <sup>1</sup> Ts <sup>=</sup> bw <sup>2</sup>SF . Thus, the chip rate Rc can be defined as Rc(chips/ sec ) = Rs <sup>∗</sup> <sup>2</sup>SF, since, as we previously stated, Rc <sup>=</sup> bw.

LoRa modulation also comprises a variable error correction scheme that enhances the signal transmission robustness at the expense of redundancy. Therefore, the data nominal bit rate, Rb, can be defined as the following [23]:

$$\mathrm{R\_b(bps)} = \frac{\mathrm{SF} \ast \mathrm{bw}}{2^{\mathrm{SF}}} \left(\frac{4}{4 + \mathrm{CR}}\right),\tag{3}$$

where CR is for error correction and equal to 4/5, 4/6, 4/7, and 4/8.

Another critical parameter is the receiver sensitivity, which indicates the lowest power level of the received LoRa signal that the receiver can detect and demodulate. Based on the LoRa Semtech designer's guide, the receiver sensitivity of LoRa can be calculated as ρ(dBm) = −174 + 10logBW + NF + SNR.

Where ρ is the receiver sensitivity, NF is the receiver's noise figure, and SNR is the signal-to-noise ratio of the received signal. Table 1 indicates the nominal bit rate and the receiver sensitivity for the bandwidth of 125 kHz. For the values in Table 1, the maximum communication range of the LoRa is around 10 km.

**Table 1.** Transmission speed and receiver sensitivity from spreading factor (SF).


As a LoRa network operates at a frequency of 868 MHz, bandwidth of 125 kHz, the payload of 8 bytes, and a preamble of 6, the payload of 8 bytes, and a preamble of 6, the number of symbols in the physical layer data block can be specified as following [24]:

$$\text{pqyloadSymNb} = 8 + \max\left( \text{ceil}\left(\frac{8 \text{PL} - 4 \text{SF} + 28 + 16 \text{CRC} - 20 \text{H}}{4(\text{SF} - 2 \text{DE})}\right) (\text{CR} + 4), 0\right), \tag{4}$$

where ceil (x) maps to the smallest integer that is greater than the value of x, SF is the spreading factor, CRC is the cyclic redundancy check, H is the header mode, DE is the data rate, CR is the coding rate, and PL is the number of payload bytes of the physical layer block and can be determined based on the payload of the application layer FRM as

$$\text{PL} = 12 + \text{FRM}$$

where FRM is the payload of the application layer.

CRC denotes the payload's existence, and it is fixed to either 0 or 1 to refer to the off and on statuses. The header mode is also fixed to either 0 or 1; H = 0, when the explicit header mode is utilized, andH=1 when the implicit header mode is authorized.

The total duration of the LoRa frame Tframe can be calculated of the sum of the transmission time of the preamble Tpreamble and the payload Tpayload as the following:

$$T\_{\text{frame}} = T\_{\text{preamble}} + T\_{\text{payload}}.\tag{5}$$

The preamble time can be calculated as follows:

$$\mathbf{T\_{preamble}} = \left(\mathbf{n\_{preamble}} + \mathbf{4}, \mathbf{25}\right) \ast \mathbf{T\_{s\nu}} \tag{6}$$

where npreamble is the programmable length of modem registers. The payload duration can be calculated as follows:

$$T\_{\text{payload}} = \text{payloadSymNb} \ast T\_{\text{s}}.\tag{7}$$

Summing up, the total frame duration can be calculated by adding both Equations (6) and (7).

$$\mathbf{T\_{frame}} = \left(\mathbf{n\_{parallel}} + \mathbf{4}, \mathbf{25}\right) \ast \mathbf{T\_{s}} + \mathbf{payloadSymNb} \ast \mathbf{T\_{s}}.\tag{8}$$

Thus, the value of the frame duration changes with the different values of the spreading factor. Table 2 indicates the different values of the up-link frame duration time at the different values of the SF used by LoRa systems. Furthermore, Table 3 shows the same for one confirmatory frame.

**Table 2.** Values of up-link frame duration at various values of SF used by Long Range (LoRa).



12 125 32.77 6 0 12 1 1 0 1 18 335.87 589.86 925.73

**Table 3.** Calculation of the transmission time of one confirmatory frame.

#### *3.2. LoRaWAN MAC Layer*

LoRaWAN is a network protocol designed for many LPWAN applications that use unlicensed frequency bands for transmission. Its standard was published in 2015 and describes the data link layer protocol, while the physical layer protocol is proprietary and belongs to the transmitter manufacturer. Figure 1 shows the defined protocol of LoRaWAN via the LoRa Alliance [22].

LoRaWAN devices are categorized into three classes: A, B, and C. Class A is primary, based on the "asynchronous ALOHA" [25] access method, and is required to be supported by all devices. All LoRaWAN sensors, when turned on, work according to class A and can switch to other classes if such a physical possibility is available and upon agreement with the server. Class B is based on the periodic distribution of service information from the server and access to the channel on a schedule. This assumes that devices can consume more power than Class A devices, which will allow them to listen to periodic messages from the server. Class C is based on constant listening of the channel by sensors.

**Figure 1.** LoRaWAN (Long Range Wide Area Network) stack.

A LoRaWAN network architecture contains end devices, network servers, and LoRa gateways, as shown in Figure 2 [26]. The connection between the gateways and the server is reliable and fast, and the gateways are connected to sensors wirelessly using LoRa technology. The server is the coordinator of the network, and the gateways play the role of repeaters between the sensors and the server—having received a frame via a wireless connection, the gateway encapsulates the frame in an IP packet and transmits it to the server and, similarly, transmits the packets from the server to the sensors.

**Figure 2.** LoRaWAN network architecture.

#### *3.3. Calculation of Packet Arrival Rate*

Packets from different end nodes arrive at the gateways in a Poisson process [27]. In turn, the gateway receives the packets and, as a response, transmits a confirmation packet. Unconfirmed packets are re-transmitted, also forming a Poisson stream. Since a huge number of nodes are located in the network, thus the probability that several nodes transmit simultaneously is high. This probability can be calculated as follows:

The probability of the fact that during the transmission of one packet T in the air, there are still k packets from other nodes is determined as

$$P(\mathbf{k}) = \frac{\lambda^k \mathbf{exp}^{-\lambda}}{\mathbf{k}!},\tag{9}$$

where P (k) is the probability of k packets in the air, transmitted in parallel, and λ is the arrival rate of packets in time T. When the number of parallel packets on the air is zero, i.e., k = 0, there is no collision. The packet is successfully transmitted to the base station or the

gateway. In this case, the probability of successful transmission of a packet, Psuccessful, is defined as

$$P\_{\text{successfull}} = \exp^{-2\lambda}.\tag{10}$$

Therefore, the probability of unsuccessful transmission, which is indicated as the loss probability, can be calculated as

$$P\_{\rm loss}(\lambda) = 1 - \exp^{-2\lambda},\tag{11}$$

where Ploss is the loss probability that also indicates the collision probability. The effect of variations of the rate of arrival packets on the collision probability is illustrated in Figure 3.

**Figure 3.** Dependence of (**a**) the average number of packets C that is successfully transmitted and (**b**) the probability of losses from collisions P from the intensity λ.

Thus, the average number of packets that are successfully transmitted during a time T, where the intensity λ can be determined as

$$C\_{\text{packets}} = \lambda \ast P\_{\text{successful}} = \lambda \ast \exp^{-2\lambda},\tag{12}$$

where Cpackets refers to the average number of packets that are successfully transmitted. Figure 3 shows the effect of packets' arrival rate on the average number of successfully transmitted packets.

#### *3.4. Calculation Gateway Capacity*

Consider a network LoRa operating at a frequency of 868 MHz and a bandwidth of 125 kHz. The number of radio-frequency channels Nf is equal to 8. It is assumed that the nodes transmit a packet of 8 bytes of payload and a preamble with six symbols with a transmission rate of two packets per hour. The admissible probability of loss due to collisions is 2%. If two nodes or more transmit their packets simultaneously at the same SF spreading factor, a collision is likely to occur.

The total transmission time of one packet can be calculated by adding the total up-link and down-link times. The up-link time is the packet transmission time from the node to the gateway, while the down-link time is the transmission time of the confirmation packet from the gateway to the node. For a certain spreading factor, the total transmission time of a packet, TSF, can be calculated as

$$\mathbf{T\_{SF}} = \mathbf{T\_{SF-UL-pack}} + \mathbf{T\_{SF-DL-pack\prime}} \tag{13}$$

where TSF-UL-pack is the total up-link time, and TSF-DL-pack is the total down-link time. The LoRa gateway's capacity can be defined as the total number of packets that the gateway serves per day. This may be represented by the throughput and can be calculated as

$$\text{Throughput} = \text{N}\_{\text{f}} \ast \Sigma\_{\text{SF}} \text{P}\_{\text{SF}} \ast \frac{\text{N}\_{\text{ENpack}} \ast 3600 \ast \lambda 2\%}{\text{T}\_{\text{SF}}},\tag{14}$$

where NENpack is the total number of packets transmitted by one end node per day, λ2% is the rate of arrival of packets at a probability of packet loss Ploss of 2, Nf is the total number of radio channels deployed by the LoRa network, and PSF is the of using certain SF. Based on the results of Figure 3, the value of λ2% is equal to 0.01.

#### **4. Problem Statement**

More cluster members should be expected to result in more significant savings in end devices' network resources. However, the number of end devices in a cluster is limited by the CH throughput and traffic generated and their physical location relative to the CH. Due to the radio channel's peculiarities, the channel resource between the cluster member and the CH may be different for different members or CH and the characteristic of the expected channel quality for the cluster members.

We assume different scenarios and selection criteria choices, both cluster members and CH. For example, we can follow the maximum throughput, uniform distribution among the cluster members or the maximum cluster members, and consider or predict users' traffic intensity. To choose one or another scenario, we need to know the resulting solution's characteristics.

We will characterize the cluster by the throughput between the cluster members and CH and the achievable data transfer rate. We will analyze the throughput of cluster members with different laws of end device distribution. Different clustering methods can provide different solutions in terms of the distribution of end devices within the cluster.

#### **5. System Description**

Building IoT applications provide a high-quality environment due to the massive amount of data collected through many sensors. Such sensors installed in monitoring sites will collect and analyze information about the air level, soil and water pollution; noise level, the level of reservoirs and rivers. All the information received from these heterogeneous applications generates a single LoRa network to provide a high QoS for all traffic types within the LoRa network. The QoS is measured as the packet reception ratio (PRR) function and throughput of the LoRa network. Thus, we must characterize the throughput value made in terms of the QoS. We will consider the throughput as an objective metric among the network elements tij. In our study, we also considered the head node (HN) of the cluster has already been determined without considering the clustering methods. We assumed the HN communication zone is a disk with a radius R, centered at the CH location, as shown in Figure 4.

**Figure 4.** Considered cluster model.

We considered LoRa technology as a communication method among end nodes. We have to specify the nature of dependence tij on the network parameters. On the way of signal propagation to the receiver from the transmitter occurs environmental energy absorption, whereby the output signal at the receiver is significantly reduced, i.e., signal attenuation occurs. There are different attenuation models, taking into account various factors such as distance, carrier frequency, and obstacles in the path of signal propagation. One common attenuation model is described as

$$\mathbf{A(d)} := 20 \log \left( \frac{\lambda}{4 \pi \mathbf{d}} \right) \mathbf{(dB)}. \tag{15}$$

The signal strength depends on the power of the transmitter. The majority of LoRa equipment has 25 mW transmitters. To describe the transmitter power, a relative value (power level) is often used, with the power of 1 mW, in decibels, defined as

$$P\_{\rm tx} := 10 \log 10 \left(\frac{\rm P}{10^{-3}}\right) (\rm dBm), \tag{16}$$

where P is the transmitter power (W).

The signal power at the receiver input will be determined as follows:

$$\mathbf{P\_{tx}(d)} = \mathbf{P\_{tx}} - \mathbf{A(d)},\tag{17}$$

where Prx is the transmitter output signal power, and A(d) is the signal loss from the distance that can be calculated according to the formula (15). Using the data from Table 4 and Formula (17), we can plot a graph of the dependence of the data rate on the distance, as shown in Figure 5. The signal/noise + noise (SINR) and SNR values are the dependent data transmission rate on signal power.

**Table 4.** Dependence LoRa gateway's range on the receiver's sensitivity when using the ITU-RP.1238- 5 attenuation model [28].


**Figure 5.** The dependence between the data transmission rate and distance.

Every parameter determined above impacts the channel throughput and can be chosen as a metric in a clustering task. In this work, we analyze throughput in a cluster.

In Figure 5, the throughput value depends on receiving and, in practice, has considerable dispersion.

In urban conditions for indoor application where there is a dense building, it is possible to apply the decay model ITU-RP.1238-5 for premises:

$$\mathcal{L}(\mathbf{d}) = 20 \log(\mathbf{f}) + \text{Nlog}(\mathbf{d}) + \text{Lf}(\mathbf{n}) - 28,\tag{18}$$

where d is the distance in (m); n = 33—remote power loss factor; f is the center frequency of the signal (MHz); Lf (n) = 24 is the loss factor due to the passage of the signal through the obstacle (dB).

Considering the attenuation model, we depict the throughput dependency on the distance by the Gaussian function (Figure 5) [29].

$$
\hat{\mathbf{f}}(\mathbf{d}) = \hat{\mathbf{f}}(\mathbf{L}(\mathbf{d})),
\tag{19}
$$

$$\mathbf{t}(\mathbf{d}) = \begin{cases} 0 & \mathbf{d} < 0 \\\\ \mathbf{t}\_{\text{max}} \exp^{-\frac{\mathbf{d}^2}{2c^2}} & 0 \le \mathbf{d} \le \mathbf{R} \\\\ 0 & \mathbf{d} > \mathbf{R} \end{cases}, \text{bit/s}, \tag{20}$$

where d is the distance (m); tmax is the maximum data transmission rate (bit/s); c is the curve half-width (m); R = arg{ ˆt(d) = <sup>0</sup> } (m) is the radius from CH to HN communication zone.

Since the throughput, according to the given model, depends on the distance, which to an arbitrarily chosen point should be considered as a random variable, then the throughput is a distribution function t can be calculated as

$$\mathbf{F(t)} = \iint\_{\mathbf{D}\_l} \mathbf{f(x, y)} \, \mathbf{dxdy}\_{\prime} \tag{21}$$

where f(x, y) refers to the users distribution function on a dick with radius R, Dt is the range of t values.

The probability density t is defined as

$$\mathbf{f}(\mathbf{t}) = \frac{\mathbf{d}\mathbf{F}(\mathbf{t})}{\mathbf{d}\mathbf{t}}.\tag{22}$$

The mathematical expected value t is

$$\mathbf{M}(\mathbf{t}) = \int\_0^{\mathbf{t}\_0} \mathbf{t} \cdot \mathbf{f}(\mathbf{t}) \, \mathbf{d} \, \mathbf{t} \, \tag{23}$$

In our clustering model, we consider different types of user distributions, as discussed in Sections 5.1 and 5.2.

#### *5.1. Uniform Distribution*

We will presume that end nodes' uniform distribution is specified in the service area with a circle S and radius R (S = πR2). Thus, end nodes are distributed over the interval 0 ≤ r ≤ R. The radius of the circle R can be defined as a solution to the following equation:

$$\mathcal{R} = \arg\{\hat{\mathbf{f}}(\mathbf{d}) = 0\} \text{ (M)}.\tag{24}$$

The probability density function f(r), in this case, is constant and will be close to the uniform distribution for the distribution of end nodes inside the circle S:

$$\mathbf{f}(\mathbf{r}) = \frac{1}{\mathbf{S}} = \frac{1}{\pi \mathbf{R}^2}. \tag{25}$$

For the functional dependence of the throughput t on the distance between gateways has the form (20), that is

$$\mathbf{t}(\mathbf{d}) = \mathbf{t}\_{\text{max}} \exp^{-\frac{\mathbf{d}^2}{2c^2}}.\tag{26}$$

We can express from (20) d = c <sup>−</sup>2 ln <sup>t</sup> tmax (M).

According to (21), throughput distribution function F(t) on a circle with radius R will be determined as

$$\begin{aligned} \mathbf{F(t)} &= \int\_0^{2\pi} \int\_{c\sqrt{-2\ln\left(\frac{t}{\text{turn}}\right)}}^{\text{R}} \frac{1}{\xi} \text{rd} \mathbf{r} d\theta = \frac{1}{2\pi \mathbf{R}^2} \mathbf{r}^2 \bigg|\_{c} \frac{\text{R}}{\text{c}\sqrt{-2\ln\left(\frac{t}{\text{turn}}\right)}} \cdot 2\pi = \\\\ &= \frac{1}{\mathbf{R}^2} \left(\mathbf{R}^2 + 2\mathbf{c}^2 \ln\left(\frac{\mathbf{t}}{\text{turn}}\right)\right) = 1 + \frac{2\mathbf{c}^2}{\mathbf{R}^2} \ln\left(\frac{\mathbf{t}}{\text{turn}}\right) \end{aligned} \tag{27}$$

Based on (22), the probability density function of the throughput can be shown as

$$\mathbf{f}(\mathbf{t}) = \frac{\mathbf{d} \mathbf{F}\_{\mathbf{t}}(\mathbf{r})}{\mathbf{d}\mathbf{r}} = \frac{\mathbf{d}}{\mathbf{d}\mathbf{r}} \left( 1 + \frac{2\mathbf{c}^2}{\mathbf{R}^2} \ln\left(\frac{\mathbf{t}}{\mathbf{t}\_{\text{max}}}\right) \right) = \frac{2\mathbf{c}^2}{\mathbf{R}^2 \mathbf{t}}.\tag{28}$$

Probability density functions and throughput distribution are shown in Figure 6.

**Figure 6.** Probability of throughput distribution function F(t) (**a**) and throughput probability density function f(t) (**b**) for uniform distribution of nodes.

For the LoRa standard, the mathematical expectation of the throughput M (t) in the communication zone between end nodes according to (23) will be calculated as

$$\mathbf{M}(\mathbf{t}) = \int\_{\mathbf{t}\_{\rm min}}^{\mathbf{t}\_{\rm max}} \mathbf{t} \cdot \frac{2\mathbf{c}^2}{\mathbf{R}^2 \mathbf{t}} \mathbf{d}\mathbf{t} = 2 \cdot \frac{\mathbf{c}^2}{\mathbf{R}^2} (\mathbf{t}\_{\rm max} - \mathbf{t}\_{\rm min}) \text{ bit/s}.\tag{29}$$

When approximating the throughput function on the distance by using a uniform distribution of end nodes in the communication zone, the mathematical expectation of the throughput for the LoRa standard is 2654 bit/s.

#### *5.2. Normal Distribution*

Assuming that end nodes are randomly distributed in the communication area, then the distribution of end nodes over the communicated area is random, and a random value can describe their coordinates in each point on the surface, i.e., such a distribution can be given by a pair of random, independent coordinates x and y. Then the F(t) of the end nodes distribution can be defined as the joint distribution function of the random values x and y. In this case, we will consider the normal distribution of end nodes with a scattering center at the center of the circle representing the communication area. Equation (30) defines the density distribution in both coordinates (x and y):

$$\mathbf{f}(\mathbf{x}, \mathbf{y}) = \frac{1}{2\pi\sigma^2} \exp^{-\frac{\mathbf{x}^2 + \mathbf{y}^2}{2\sigma^2}}, \text{where} \sqrt{\mathbf{x}^2 + \mathbf{y}^2} = \mathbf{r},\tag{30}$$

where σ is the standard deviation (RMS).

For throughput analysis, we will assume that the probability of a point falling inside the circle of radius R is equal to 1, i.e., we will only consider users within the circle. The law of normal distribution is unlimited in both coordinates x and y. This assumption introduces a certain error; this error, a truncated normal distribution was used, which is bounded in both coordinates by the radius R. This distribution cannot be normal since it is bounded. The distribution of users within the communication area described by a circle S can be described by the "truncated normal" distribution [29].

$$\mathbf{f}(\mathbf{x}, \mathbf{y}) = \mathbf{K}(\sigma, \mathbf{R}) \cdot \frac{1}{2\pi\sigma^2} \exp^{-\frac{\mathbf{x}^2 + \mathbf{y}^2}{2\sigma^2}},\tag{31}$$

where

$$\mathbb{K}(\sigma, \mathbf{R}) = \frac{1}{\iint\_{\mathbb{R}} \frac{1}{2\pi\sigma^2} \cdot \exp^{-\frac{\mathbf{x}^2 + \mathbf{y}^2}{2\sigma^2}} \,\mathrm{d}\mathbf{x} \,\mathrm{d}\mathbf{y}}.\tag{32}$$

Here SR denotes the service area bounded by the circle with radius R.

Based on the obtained expressions, we find the F(t) inside the circle with radius R. For this, from (19) and (20), we obtain d = c <sup>−</sup>2 ln <sup>t</sup> tmax .

Then from (20), according to (31) and (32), the throughput distribution function can be determined as

$$\begin{split} \mathbf{F}(\mathbf{t}) &= \mathbf{K}(\sigma, \mathbf{R}) \int\_{0}^{2\pi} \int\_{c\sqrt{-2\ln\left(\frac{\mathbf{t}}{\mathbf{t}\mathbf{max}}\right)}} \frac{1}{2\pi\sigma^{2}} \cdot \exp^{-\frac{\mathbf{r}^{2}}{2\sigma^{2}}} \cdot \mathbf{r} \, d\mathbf{r} d\theta = \\ &= \mathbf{K}(\sigma, \mathbf{R}) \frac{1}{2\pi} \cdot \exp^{-\frac{\mathbf{r}^{2}}{2\sigma^{2}}} 2\pi \bigg|\_{\mathbf{r}} \begin{vmatrix} \mathbf{R} \\ \mathbf{e} \end{vmatrix} \\ &= \mathbf{K}(\sigma, \mathbf{R}) \left( \begin{pmatrix} \frac{\mathbf{t}}{\mathbf{t}\mathbf{max}} \end{pmatrix}^{\frac{\mathbf{r}^{2}}{\sigma^{2}}} - \exp^{-\frac{\mathbf{R}^{2}}{2\sigma^{2}}} \right). \end{split} \tag{33}$$

Based on the obtained expression (33), the throughput probability density, according to (34), will be determined as

$$\mathbf{f}(\mathbf{t}) = \mathbf{K}(\sigma, \mathbf{R}) \frac{\mathbf{c}^2}{\sigma^2 \mathbf{t}\_{\text{max}}} \left(\frac{\mathbf{t}}{\mathbf{t}\_{\text{max}}}\right)^{\frac{\mathbf{c}^2}{\sigma^2} - 1}. \tag{34}$$

Figure 7 shows the probability density and throughput distribution function results.

**Figure 7.** Probability distribution function F(t) (**a**) and probability density function f(t) (**b**) of the throughput (normal distribution of users).

From the expression for the throughput probability density in (34), an expression for the mathematical expectation of the throughput value can be defined as

$$\mathbf{M(t)} = \int\_0^{t\_0} \mathbf{t} \cdot \mathbf{f(t)} dt = \mathbf{K(}\sigma, \mathbf{R}) \frac{\mathbf{c}^2}{\sigma^2 + \mathbf{c}^2} \left( \mathbf{t}\_{\text{max}} - \mathbf{t}\_{\text{min}} \left( \frac{\mathbf{t}\_{\text{min}}}{\mathbf{t}\_{\text{max}}} \right)^{\frac{\sigma^2}{\sigma^2}} \right). \tag{35}$$

For the LoRa standard, the value of M (t) at σ of RMS 100, 200, 250 m takes the values of 8520, 6680, and 5750 bps, respectively.

#### **6. Clustering Method Selection**

We will consider a network of 20 thousand nodes in a field with 10 km sides. The coordinates of the nodes are distributed randomly according to a uniform distribution law. The maximum range of the lock is 824 m (from Table 4). We use two clustering methods [30] to the specifics of the projected communication network described by radio signal attenuation models and the distribution of subscriber traffic on the served area the previous section. The formation of a cluster consists of choosing a group of end devices and distributing their functionality within the cluster. The solution of the clustering problem is similar to the solution of the optimization problem in which some metric d(m, pm) is minimized (maximized), which characterizes the "distance" between a cluster member and the cluster center pm = <sup>1</sup> <sup>|</sup>c<sup>|</sup> <sup>∑</sup> m∈c m. Throughput, distance, and energy efficiency can act as such a metric. A dynamic programming method is used for the solution, which minimizes d2(m, pm) across all clusters.

$$\mathbf{C} = \min \sum\_{\mathbf{c} \in \mathcal{C}} \sum\_{\mathbf{m} \in \mathcal{C}} \mathbf{d}^2(\mathbf{m}, \mathbf{p}\_{\mathbf{m}}).\tag{36}$$

For the formation, it is necessary to determine the method for finding an optimal solution. The QoS for traffic within the cluster between the CH and the network depends on the throughput of the channels between the cluster members and between the CH and LoRa Gateway and the traffic intensity generated by end devices.

Clustering algorithms K-means Algorithm 1 and FOREL Algorithm 2 are used to optimize communication network capacity.

$$\{\mathbf{x}\_{\mathbf{i}}, \mathbf{y}\_{\mathbf{i}}\} = \operatorname\*{argmin}\_{\mathbf{x}, \mathbf{y}\_{\mathbf{i}}} \sum\_{\mathbf{j}=1}^{k} \sum\_{\mathbf{r}=1}^{n\_{\mathbf{j}}} \mathbf{d}\left(\mathbf{C}\_{\mathbf{j}}, \mathbf{e}\_{\mathbf{j}, \mathbf{r}}\right), \mathbf{i} = 1 \ldots \mathbf{k},\tag{37}$$

where d Cj, ej,r is the distance between the center of mass of the j-th cluster Cj and the r-th element of the j-th cluster ej,r;

When interpreting K-means algorithm as an optimization problem, its objective function can be expressed as follows:

$$\mathbf{M} = \sum\_{\mathbf{i}=1}^{k} \sum\_{\mathbf{x}\_{\mathbf{j}} \in \mathbb{S}\_{\mathbf{i}}} \left(\mathbf{x}\_{\mathbf{j}} - \boldsymbol{\mu}\_{\mathbf{i}}\right)^{2},\tag{38}$$

where k is the number of clusters;

Si—defines a set of objects (elements) of the *i*-th cluster;

μi—point of the center of mass of the *i*-th cluster (coordinates of the point of the center of mass);

xj—object of the *j*-th cluster (object coordinates).

#### **Algorithm 1.** K-means

**Require:** The k is a number of clusters, C1, C2, ... .CK points that corresponds to the devices, CMJ j = 1,...,k—centers of clusters (mass centers). **Input:** Set K random points *I* = {*I*1, *I*2,..., *In*} **Output**: Centers (C1, ... .CK) Clist List of Clusters. **Procedure:** Mode selection and K-Means clustering Algorithm. Choose K initial centers CM J =*m*1*m*2,..., *mk*. **For:** CJ <=CMJ **do** Set new centers of mass *m*ˆ1, *m*ˆ2, ..., *m*ˆ*<sup>k</sup>* /\*using Equations (39) or (40) \*/ **If** *m*ˆ1, *m*ˆ2, ..., *m*ˆ*<sup>k</sup>* = *m*1*m*2,..., *mk* **Then** Set m1 is new centers of mass /\*using Equations (39) or (40) \*/ Each object Xi is assigned to the nearest Ci; for the resulting groups, the centers of mass are calculated. Transition CM (CI = CM). **End for** fix Cj as the centers of the masses of the clusters, and Xi as the elements of the J cluster **End procedure**.

#### **Algorithm 2.** FOREL

**Require:** The R is a communication rage (radius of the service area), the cluster number *i* = 1. C1, C2, . . . .CK points that corresponds to the devices, CMJ j = 1, ..., k—centers of clusters (mass centers). **Input:** Set K random points *I* = {*I*1, *I*2,..., *In*}. **Output**: Centers (C1, ... CK) Clist List of Clusters. **Procedure:** Mode selection and FOREL clustering Algorithm. **Choose** K initial centers CM J = *m*1*m*2,..., *mk*. **For**: True **do** for all Xi points at a distance of CI < = R calculate the center of mass (CM)/\*using equations (39) or (40) \*/ **while:** Ci = CM Transition CM (CI = CM). **End while** fix Cj as the centers of the masses of the clusters, and Xi as the elements of the J cluster **End for End procedure**

The difference xj − μ<sup>i</sup> is the Euclidean distance between the cluster object and the center of the given cluster's mass.

When using K-means algorithm for two-dimensional space, i.e., when each of the objects has two characteristics (x and y) coordinates, each object can be considered a point on the flatness, characterized by its two coordinates (xj, yj ).

The coordinates of the center mass of the j-th cluster is defined as the average value for each of the coordinates:

$$\mathbf{C}\_{\mathbf{j}} = \left\{ \mathbf{x}\_{\mathbf{j}}, \mathbf{y}\_{\mathbf{j}} \right\}, \; \mathbf{x}\_{\mathbf{j}} = \frac{1}{\mathbf{n}\_{\mathbf{j}}} \sum\_{\mathbf{r}=1}^{n\_{\mathbf{j}}} \mathbf{x}\_{\mathbf{j}, \mathbf{r}\_{\mathbf{r}}} \; \mathbf{y}\_{\mathbf{j}} = \frac{1}{\mathbf{n}\_{\mathbf{j}}} \sum\_{\mathbf{r}=1}^{n\_{\mathbf{j}}} \mathbf{y}\_{\mathbf{j}, \mathbf{r}\_{\mathbf{r}}} \tag{39}$$

where nj is the number of elements in the j-th cluster xj,r, yj,r are the coordinates of the r-th element of the j-th cluster.

Along with coordinates, each object can be characterized by a certain numerical parameter mj. Taking into account the last coordinates of the center mass of the cluster will be defined as the coordinates of the center of mass of a flat figure as

$$\mathbf{x}\_{\mathbf{i}}^{(\mu)} = \frac{1}{\mathbf{m}\_{\mathbf{i}}^{(\Sigma)}} \sum\_{\mathbf{j}=1}^{n\_{\mathbf{i}}} \mathbf{m}\_{\mathbf{j}} \mathbf{x}\_{\mathbf{j}} \cdot \mathbf{y}\_{\mathbf{i}}^{(\mu)} = \frac{1}{\mathbf{m}\_{\mathbf{i}}^{(\Sigma)}} \sum\_{\mathbf{j}=1}^{n\_{\mathbf{i}}} \mathbf{m}\_{\mathbf{j}} \mathbf{y}\_{\mathbf{j}} \cdot \mathbf{m}\_{\mathbf{i}}^{(\Sigma)} = \sum\_{\mathbf{j} \in \mathcal{S}\_{\mathbf{i}}} \mathbf{m}\_{\mathbf{i}}.\tag{40}$$

The fundamental difference between the FOREL method and the K-means method is that the FOREL algorithm does not specify the number of clusters but assumes specifying the cluster size R.

When using this algorithm, expression (37) is minimized. The coordinates of the centers of mass of clusters are determined, which can be taken as positions for placing gateways.

#### **7. Evaluation Results**

Using the FOREL and K-means clustering methods, a network consisting of 25 clusters was obtained as a result of modeling. The simulation results for both clustering methods are illustrated in Figure 8a FOREL and Figure 8b K-means.

(**a**) (**b**)

**Figure 8.** Simulation results for (**a**) FOREL and (**b**) K-means clustering methods.

To compare the two considered clustering methods for LoRa networks, we consider the distribution of cluster members relative to the cluster's center as the comparison metric. Distribution is obtained by simulation modeling. For center-of-mass, we used the following expression:

$$\mathbf{s} = \mathbf{g} \mathbf{m}\_{\rangle} - \mathbf{C} \mathbf{m}\_{\mathbf{i}},\\ \mathbf{i} = 1 \dots |\mathbf{C}|,\\ \mathbf{j} = 1 \dots \mathbf{n}\_{\mathbf{i}},\\ \mathbf{m}\_{\rangle} \in \mathbf{c}\_{\mathbf{i}}.\tag{41}$$

where Cmi, is the center-of-mass coordinate of cluster i; gmj is the coordinate of mj element of ci cluster; ci is the cluster i; gmj is the element j of cluster i; ni is the number of elements within the cluster i, and |C| is the number of clusters.

It can be seen from the above results that the resulting clusters differ significantly in shape and size. This solution is quite obvious since the clustering problem with a high density of users was close to covering the service area with several circles (the minimum number of circles). Naturally, suppose the circles have the same radius. In that case, it is impossible to avoid their intersections, which ultimately leads to the formation of clusters of different shapes with different numbers of elements.

Figure 9 shows the relative distribution of nodes in the considered cluster for both considered clustering algorithms. The vertical axis in Figure 9 represents the number of nodes, while the horizontal axis indicates the relative distance between nodes and the cluster center. The negative value of the relative distance in Figure 9 shows that the nodes are located at the right side of the cluster center. As indicated in Figure 9, the main distribution of the nodes is located around the cluster center for both clustering methods.

**Figure 9.** Relative distribution of nodes in the clusters for (**a**) FOREL clustering method and (**b**) K-mean clustering method.

Thus, it is possible to determine the average number of nodes in each SF zone; according to Table 4, Figure 10 indicates the average number of nodes in each SF zone for various clustering methods.

**Figure 10.** The average number of nodes in different SF zones (in percent, %) for (**a**) K-mean clustering method and (**b**) FOREL clustering method.

We calculate the capacity of the LoRa gateway for the two clustering methods discussed above, where the nodes are distributed differently by the area of the radio coverage zones. For FOREL = {45.96%; 8.54%; 9.47%; 11%; 12.34%; 6.7%; 5.99%} and for K-means {53.75%; 11.25%; 11.76%; 11.24%; 8.7%; 2.3%; 1.0%} as shown in Figure 11.

**Figure 11.** The average number of nodes in different SF zones for FOREL and K-means clustering methods (in percent, %).

The LoRa gateway's capacity can be calculated for FOREL and K-means clustering methods as shown in using Equation (14). Table 5 indicates this value and the total number of nodes.


**Table 5.** Calculation of the capacity of the LoRa gateway.

Thus, to build a LoRa network that handles 20,000 end devices with the aboveintroduced characteristics, five to six gateways are needed to deploy the clustering algorithm, either FOREL or K-means.

The experiments showed that with a huge number of clusters, the K-means method allows obtaining results with a normal distribution of nodes across clusters and a higher throughput than the FOREL method. The network nodes are uniformly distributed in the service area.

By applying the above-proposed model, the average throughput value with a normal distribution is 8520 bit/s and with a uniform distribution is 2654 bit/s. Thus, to further assess the effectiveness of our solution, we compare our model with the literature. Table 6 describes a comparison of our proposed model with the literature for throughput values.


**Table 6.** Comparison of our proposed results with the literature for throughput values.

#### **8. Discussion**

Before obtaining the results achieved, clustering is to save network resources and improve the QoS. In both cases, the criterion for forming the cluster should take into account the available resources, transfer traffic from end nods, and QoS requirements.

The results presented in the previous section analysis of the channel capacity between the CM and the CH showed its dependence on the distribution of end nodes. In particular, the results showed that a larger average throughput value is achieved with a normal distribution than with a uniform distribution.

Cluster analysis algorithms can be applied to find partial solutions to selecting the coordinates of access points, considering the nature of the distribution of traffic sources over the served territory and CH nodes' choice.

Applying the algorithms of cluster analysis, necessary to the specifics of the projected communication network, which is described by models of radio signal attenuation and the model of distribution of subscriber traffic on the served area, thus the solutions, which are obtained in the previous section as a result of cluster analysis application, are the partial solutions of the optimization problem in communication network capacity.

Simulation of network clustering based on FOREL and K-means algorithm in the above section showed that these algorithms allow forming clusters from local groups of end nodes. The cluster size is given by the parameter R and the number of clusters selected, taking into account the availability and quality of communication.

To form clusters of LoRa end devices based on the bandwidth of the channels between the HN and CM can be used known methods of clustering objects. It is possible to use clustering methods based on finding the centroid, evaluating connectivity, density.

Our simulation results of two centroid clustering methods showed that the law of elements distribution in clusters depends on the number of clusters. With a relatively huge number of clusters, the service area's distribution elements are close to the normal law and relatively small to the uniform law.

The clustering method and parameters' choice is reflected in the distribution of cluster elements and the throughput between cluster elements and HN.

#### **9. Conclusions and Future Work**

This paper proposed a novel cluster throughput model to estimate the expected throughput value in clusters of end devices built using LoRa networks. In contrast to known models, it allows for the description of the throughput distribution function in a cluster of end devices.

We developed clustering algorithms using dense LoRa-based IoT networks that allow clustering of end devices according to the criterion of maximum served traffic. The algorithms are built based on two-common methods, K-means and Forel. In contrast to existing methods, the developed method provides the maximum value of served traffic in a cluster.

Results highlight our solution's effectiveness that our proposed model achieved a larger average throughput value with a normal distribution than with a uniform distribution.

Future work shall consider a novel clustering algorithm for achieving a higher level of flexibility so that the network will support the insertion and cutting of network devices and shall consider more QoS metrics. Furthermore, the LoRa network will have the flexibility level that enables the set-up of new applications.

**Author Contributions:** Conceptualization, M.S.A.M.; methodology, M.S.A.M., P.W. and M.W.; software, P.W., M.W. and A.R.; validation, M.S.A.M.; formal analysis, A.R.; investigation, M.S.A.M.; resources, P.W., M.W. and N.N.J.; data curation, M.S.A.M.; writing—original draft preparation, M.S.A.M.; writing—review and editing, A.R. and N.N.J.; visualization, M.S.A.M.; supervision, P.W. and M.W.; project administration, P.W. and M.W.; funding acquisition, P.W. and M.W. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by The National Key Research and Development Program of China (2017YFE0123000).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data available on request due to restrictions–privacy. The data presented in this study are available on request from the corresponding author.

**Acknowledgments:** Many thanks are due to Ammar Muthanna and Min Wei for the assistance in the methodological work.

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

#### **References**


## *Article* **Time-Optimal Gathering under Limited Visibility with One-Axis Agreement †**

**Pavan Poudel and Gokarna Sharma \***

**\*** Correspondence: sharma@cs.kent.edu

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

**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 O(*DG*) time algorithm for this problem in the fully synchronous setting, assuming that the robots agree on one coordinate axis (say north), where *DG* is the diameter of the visibility graph of the initial configuration. In this article, we provide the first O(*DE*) time algorithm for this problem in the asynchronous setting under the same assumption of robots' agreement with one coordinate axis, where *DE* 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* ≥ 1 robots, *DE* ≤ *DG*, and there exist initial configurations for which *DG* can be quadratic on *DE*, i.e., *DG* = Θ(*D*<sup>2</sup> *<sup>E</sup>*). Moreover, our algorithm is asymptotically time-optimal since the trivial time lower bound for this problem is Ω(*DE*).

**Keywords:** distributed algorithms; mobile robots; classic oblivious robot model; gathering; time complexity; visibility; connectivity

#### **1. Introduction**

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

**Citation:** Poudel, P.; Sharma, G. Time-Optimal Gathering under Limited Visibility with One-Axis Agreement. *Information* **2021**, *12*, 448. https://doi.org/10.3390/info12110448

Academic Editor: Giovanni Viglietta

Received: 30 August 2021 Accepted: 24 October 2021 Published: 27 October 2021

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

**Copyright:** © 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/).

Department of Computer Science, Kent State University, Kent, OH 44240, USA; ppoudel@cs.kent.edu

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–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–15]. Degener et al. [11] provided the first algorithm for this problem with runtime <sup>O</sup>(*N*2) in expectation in the fully synchronous setting, where *N* is the total number of robots. Degener et al. [12] provided an <sup>O</sup>(*N*2)-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 Ω(*N*2). Kempkes et al. [13] provided an O(*OPT* log*OPT*)-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 O(*N*)-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 <sup>O</sup>(*N*2)-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* ≥ 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 *DG* be the diameter of *G*, which is the greatest distance between any pair of nodes in *G* following the edges of *G*. Let *DE* 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*, *DE* ≤ *DG*, and for some configurations the gap between *DG* and *DE* can be as much as quadratic on *DE*, i.e., *DG* = Θ(*D*<sup>2</sup> *<sup>E</sup>*). Figure 1 illustrates these ideas. Therefore, an O(*DE*) time algorithm would be time-optimal for gathering starting from any initial connected configuration, since Ω(*DE*) 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 O(*DE*)-time algorithm can be designed for gathering for classic oblivious robots under limited visibility.

**Figure 1.** An illustration of two initial configuration dependent parameters, *DE* (the Euclidean diameter) and *DG* (the visibility graph diameter), and the relation between them: (**a**) the diameter *DE* for an initial arbitrary configuration, (**b**) the visibility graph *G* with diameter *DG* for the configuration of the left, and (**c**) an initial configuration showing the quadratic difference between *DE* and *DG* with *DG* = Θ(*D*<sup>2</sup> *E*).

Recently, Izumi et al. [4] made progress towards addressing this open question. Specifically, they presented an O(*DG*)-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 <sup>−</sup> <sup>√</sup><sup>1</sup> <sup>2</sup> are removed from it. The assumption on the visibility graph *<sup>G</sup>* in Izumi et al. [4] essentially means that the connectivity range is of radius 1 <sup>−</sup> <sup>√</sup><sup>1</sup> <sup>2</sup> (different and in fact smaller than the viewing range of one).

There is still a large gap between the O(*DG*) time bound of Izumi et al. [4] and the asymptotically optimal O(*DE*) time bound, since *DG* can be quadratic on *DE* (Figure 1). This work closes this gap under the same one axis agreement with a slightly modified viewing range of <sup>√</sup><sup>10</sup> and the square connectivity range (if we do not explicitly write "square", then the viewing and connectivity ranges are circular ) of <sup>√</sup><sup>2</sup> compared to the viewing range of one and the (circular) connectivity range of 1 <sup>−</sup> <sup>√</sup><sup>1</sup> <sup>2</sup> in [4] (if we consider

the viewing range of one similar to [4], we need the square connectivity range of 1 − √ √ 2 10 , and our algorithm again achieves O(*DE*) 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 *<sup>c</sup>*. Notice also that the square connectivity range of <sup>√</sup><sup>2</sup> for a robot is equivalent to the *L*∞-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 *DG* 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 *DG*; instead, they gather at a point (or within a small area) that is not known beforehand in *O*(*DE*) 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 *OBLOT* model [2]. Robots agree on the unit of distance measure. The viewing range is <sup>√</sup>10—a robot can see all other robots within the fixed radius of at most distance <sup>√</sup> √ 10. The square connectivity range is 2—a robot is connected to all other robots inside or on the boundary of the (axis-aligned) 2 × 2-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 *N* ≥ 1 robots is Ω(*DE*).

**Theorem 1.** √ *For any initial connected configuration of N* ≥ 1 *robots with the viewing range of* <sup>10</sup> *and the square connectivity range of* <sup>√</sup><sup>2</sup> *on a plane, gathering can be solved in* <sup>O</sup>(*DE*) *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 O(*DE*)-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*(*DG*) 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 O(*DE*)-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 *DG*, which only provides an *O*(*DG*)-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 *L* 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 *L* move to the positions of *L* or south of *L* in O(1) 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 *L* make diagonal or vertical hops, they reach *L* or south of *L* in one epoch. However, if some of those robots make a horizontal hop, then in two epochs, they reach positions of *L* or south of *L* through the subsequent vertical or diagonal hop. We also show that, if some robots in the north of *L* do not move in the first epoch, then they reach positions of *L* or south of *L* through the vertical or diagonal hop by the next two epochs.

Similarly, let *Lb* be the bottommost horizontal line (parallel to *L*) so that the robots of *I* are either on *Lb* or north of *Lb*. The main idea is to show that the robots on *Lb* do not move south of *Lb* forever. Specifically, we show that robots on *Lb* wait for all the robots in the north of *Lb* so that they meet at distance (at most) *D* south of *Lb* 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 *OBLOT* 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–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 , > 0. 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–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 O(*D*) 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 *<sup>O</sup>*(*n*2)-time and *<sup>O</sup>*(*DE* · *<sup>n</sup>*<sup>3</sup> <sup>2</sup> )-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–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 × 2-sized grid area. Cord-Landwehr et al. [29] provided an O(*N*)-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 <sup>O</sup>(min{*N*, *<sup>D</sup>*<sup>2</sup> <sup>+</sup> log *<sup>N</sup>*})-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 O(*DE*)-time algorithm for robots on a grid agreeing on both the coordinate axes in Section 3. We then provide an O(*DE*) algorithm for robots on a plane agreeing on both the coordinate axes in Section 4. In Section 5, we discuss how the algorithms of Sections 3 and 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 Q = {*r*0,*r*1, ··· ,*rN*−1}. Each robot is a (dimensionless) point that can move in an infinite two-dimensional real space R2. Throughout this article, we will use a point to refer to a robot as well as its position. We denote by dist(*ri*,*rj*) the distance between two robots *ri*,*rj* ∈ Q. Each robot *ri* works under limited visibility and viewing range of each robot is <sup>√</sup>10, i.e., a robot *ri* can see and be visible to another robot *rj* if and only if dist(*ri*,*rj*) <sup>≤</sup> <sup>√</sup>10. For some cases, e.g., for grid, the viewing range smaller than <sup>√</sup><sup>10</sup> is sufficient. We describe what exactly is the viewing range when we describe algorithms in Sections <sup>3</sup> and 5. The connectivity range of each robot is <sup>√</sup><sup>2</sup> following square connectivity, i.e., two robots have an edge between them on *G* if one robot is inside the (axis-aligned) 2 × 2-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 <sup>√</sup><sup>10</sup> and <sup>√</sup><sup>2</sup> are the same for each robot *ri* ∈ Q. 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 Sections 3 and 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 *ri* is either active or inactive. When a robot *ri* becomes active, it performs the "Look-Compute-Move" cycle as follows:


**Robot Activation.** In the fully synchronous setting (FSYNC), every robot is active in every LCM cycle. In the semi-synchronous setting (SSYNC), at least one robot is active, and over an infinite number of LCM cycles, every robot is often infinitely active. In the asynchronous setting (ASYN C), 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 ASYN C 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 FSYNC setting, time is measured in rounds. Since a robot in the SSYNC and ASYN C 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 FSYNC setting, a round is an epoch. We will use the term "time" generally to mean rounds for the FSYNC setting and epochs for the SSYNC and ASYN C settings.

**Square Area.** Let *ri* ∈ Q be a robot positioned at coordinate (*xi*, *yi*). Let *Li*, *L i* , respectively, be the horizontal and vertical lines passing through *ri*. Since *ri* knows north, *ri* can easily compute *Li*, *L i* . The *square area* for *ri*, denoted as *SQ*(*ri*), is an area of the plane

enclosed by four lines *Li*,*t*, *Li*,*b*, *Li*,*l*, *Li*,*<sup>r</sup>* with *Li*,*t*, *Li*,*<sup>b</sup>* being parallel to *Li* (perpendicular to *L i* ) and passes through coordinates (*xi*, *yi* + 1) and (*xi*, *yi* − 1), respectively, and *Li*,*l*, *Li*,*<sup>r</sup>* is perpendicular to *Li* (parallel to *L i* ) and passes through coordinates (*xi* − 1, *yi*) and (*xi* + 1, *yi*), respectively. Notice that *SQ*(*ri*) is axis-aligned, and both the height and width of it is two. We denote by *ptl*, *pbl*, *pbr*, *ptr* the intersection points of lines *Li*,*<sup>t</sup>* and *Li*,*l*, *Li*,*<sup>b</sup>* and *Li*,*l*, *Li*,*<sup>b</sup>* and *Li*,*r*, and *Li*,*<sup>t</sup>* and *Li*,*r*, respectively. We can divide *SQ*(*ri*) to four quadrant squares *SQ*1(*ri*), *SQ*2(*ri*), *SQ*3(*ri*), and *SQ*4(*ri*) with both heights and widths as one. Let *SQ*1(*ri*) and *SQ*2(*ri*) be at the north of *Li* and *SQ*3(*ri*) and *SQ*4(*ri*) be at the south of *Li*. Moreover, let *SQ*1(*ri*) and *SQ*3(*ri*) be at west of *L <sup>i</sup>* and *SQ*2(*ri*) and *SQ*4(*ri*) be at east of *L i* . We say that the positions of *Li* in *SQ*(*ri*) belong to *SQ*3(*ri*) and *SQ*4(*ri*). Figure 2a illustrates these ideas.

**Figure 2.** An illustration of (**a**) Square Area and (**b**) Unit Area.

**Unit Area.** Let *rj*,*rk*, respectively, be the topmost and leftmost robots among the robots in *SQ*(*ri*). In some situations, both *rj* and *rk* may be the same robot, and this definition is still valid. Let *LT* be the horizontal line passing through *rj* and *LL* be the vertical line passing through *rk*. Let *LB* be the horizontal line parallel to *LT*, and it is at distance one south of *LT*. Similarly, let *LR* be the vertical line parallel to *LL* and at a distance of one east of *LL*. The *unit area* for *ri*, denoted as *SQunit*(*ri*), is an area of the plane inside *SQ*(*ri*) enclosed by lines *LL*, *LT*, *LR*, and *LB*. Note that *SQunit*(*ri*) is an (axis-aligned) unit square of both height and width one. We denote by *pTL*, *pBL*, *pBR*, and *pTR* the intersection points of lines *LT* and *LL*, *LB* and *LL*, *LB* and *LR*, and *LT* and *LR*, 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 G*(*I*)=(Q, *E*) *of any arbitrary initial configuration I of robots is the graph such that, for any two distinct robots ri and rj,* (*ri*,*rj*) ∈ *E where rj is positioned on or inside SQ*(*ri*) *(or vice-versa).*

*SQ*(∗) provides connectivity for robots with square connectivity range <sup>√</sup>2. The gathering problem may not be solvable under limited visibility if the initial visibility graph *G*(*I*) is not connected [2,6]. Therefore, we assume that *G*(*I*) is connected at time *t* = 0. Moreover, any algorithm for gathering must maintain the connectivity of *G*(*I*) during its execution until a gathering configuration is reached. For the sake of clarity, we denote by *Gt*(*I*) the visibility graph *G*(*I*) for any time *t* ≥ 0.

**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 2 × 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 ASYN C setting [3], even when *N* = 2, by gathering the robots in a unit horizontal line segment. As an example, consider two robots *ri*,*rj* at distance 1 apart on a horizontal line working under an ASYN C setting. Let *ri* and *rj* activate at the same time and *ri* moves to the position of *rj* and *rj* moves to the position of *ri* as both of them move in the horizontal line. This scenario may repeat infinitely since *ri* and *rj* do not have common agreement on east or west under one-axis agreement on north. By using our square connectivity range <sup>√</sup>2, the viewing range <sup>√</sup><sup>10</sup> 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 *ri* to see whether there is a robot outside *SQ*(*ri*) 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 O(*DE*) time.

#### **3.** *O***(***DE***) 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 <sup>√</sup>2. 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, *ri* distinguishes *diagonal*, *horizontal*, and *vertical hops*, which we discuss separately below. A robot *ri* 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, *ri* never hops on any of the three neighboring grid points relative to north from its position, i.e., *ri* hops only to one of its five neighboring grid points on the same horizontal line *Li* or south of *Li*. We will show that this allows achieving a gathering progress in every epoch. Since robot moves are not instantaneous due to the ASYN C setting, a robot *ri* also does not move if it observes at least one robot in the north of *Li* inside or on *SQ*(*ri*). This is crucial for guaranteeing that robots do not move south forever. Robot *ri* terminates when it sees no other robot inside or on *SQ*(*ri*) other than its position.

**Diagonal Hops.** A diagonal hop takes a robot *ri* to one of the two diagonal neighboring grid points in the south (i.e., either *pbr* or *pbl*). Let *Li* be a horizontal line that passes from the current position of a robot *ri*. Robot *ri* makes a diagonal hop when it sees no robot in *SQ*(*ri*) at the north of *Li* (including the positions of *Li*) and either (i) *ri* sees no other robot in *SQ*3(*ri*) (except at its position) and sees at least one robot on *Li*,*<sup>r</sup>* at the south of *Li* or (ii) *ri* sees no other robot in *SQ*4(*ri*) (except at its position) and sees at least one robot on

*Li*,*<sup>l</sup>* at the south of *Li*. In case (i), *ri* hops on grid point *pbr*, whereas in case (ii), it hops on grid point *pbl*.

In this hop, the robot moves diagonally at a distance of <sup>√</sup>2. 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 *ri* in grid (i.e., 2).

**Horizontal Hops.** A horizontal hop takes *ri* to its neighboring grid point on *Li* in the east. When a robot *ri* sees at least one robot *rj* at its horizontal neighboring grid point (and possibly others on *Li* between *ri* and *rj*) and no other robot in *SQ*(*ri*), *ri* 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 *ri* to its neighboring grid point vertically south from it. Robot *ri* makes a vertical hop if either (i) it sees a robot *rj* on *L <sup>i</sup>* at the south of *Li* and no other robot in *SQ*(*ri*) at the north of *Li* or (ii) it sees at least one robot each on *Li*,*<sup>l</sup>* and *Li*,*<sup>r</sup>* or south of *Li* and no other robot in *SQ*(*ri*) at the north of *Li*. 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 *Gt*(*I*) 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 Q on a grid such that *G*0(*I*) is connected. Let *SER*(*I*) be the *axis-aligned smallest enclosing rectangle* for the robots in *I*. Let *DY* and *DX*, respectively, be the height and width of *SER*(*I*). Let *LDY* , *LDY*−1, ... , *L*<sup>0</sup> be the horizontal line segments of *SER*(*I*) at every 1 unit vertical distance, with *LDY* being the topmost horizontal line segment and *L*<sup>0</sup> being the bottommost horizontal line segment. Similarly, let *L DX* , *L DX*−1, ... , *<sup>L</sup>* <sup>0</sup> be the vertical line segments of *SER*(*I*) at every one unit horizontal distance, with *L DX* being the rightmost vertical line segment and *L* <sup>0</sup> being the leftmost vertical line segment. Let *LS* be the line parallel to *L*<sup>0</sup> at distance *DX* <sup>2</sup> south of *L*0. Figure 4 illustrates these definitions.

**Figure 4.** An illustration of an axis-aligned smallest enclosing rectangle *SER*(*I*) and the triangular area south of it.

**Lemma 1.** *Given any initial configuration I such that the visibility graph G*0(*I*) *is connected, the graph Gt*(*I*) *at any time t* > 0 *remains connected.*

**Proof.** For a robot *ri*, since *G*0(*I*) is connected, there are robots in at least two out of its eight neighboring grid points, unless *ri* is a leaf node in *G*0(*I*) 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 *ri* and the robots in its eight neighboring grid points, in the new configuration, *ri* has robots in at least two out of its eight neighboring grid points (unless it is a leaf node in *G*0(*I*) 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 *ri* are either diagonal, horizontal, or vertical, and *ri* never moves to its three neighboring grid points on *SQ*(*ri*) in the north of *Li*. Furthermore, *ri* does not move when it sees at least one robot *rj* at the north of *Li* or inside *SQ*(*ri*).

A diagonal hop for *ri* is possible when *ri* sees other robot(s) *rj* only on one of its two diagonal neighboring grid points on *SQ*3(*ri*) or *SQ*4(*ri*), and *ri* moves to the position of *rj* (since *rj* does not move as *rj* sees *ri* at the north of *Lj* until *ri* reaches the position of *rj*). Robot *ri* also makes a diagonal hop when it sees other robot(s) *rj* on either *Li*,*<sup>l</sup>* only or *Li*,*<sup>r</sup>* only that is part of *SQ*(*ri*) in the south of *Li*. Since *rj* is at the south of *Li*, it must be in transit to the neighboring diagonal grid point of *ri* and *ri*, and *rj* 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 *ri* and *rj* meet.

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

A vertical hop for *ri* is possible when it sees at least one other robot *rj* on the neighboring grid point that is vertically south of it (and possibly others between *ri* and *rj*), but no robot is observed on or inside *SQ*(*ri*) in the north of *Li*. In this case, *ri* reaches the position of *rj* since *rj* cannot move until there is *ri* in the north. *ri* performs a vertical hop also when it sees at least one robot each on the two vertical lines *Li*,*<sup>l</sup>* and *Li*,*<sup>r</sup>* on or south of *Li* in *SQ*(*ri*) and no robot in *SQ*(*ri*) in the north of *Li*. Suppose *ri* sees two robots *rj* and *rk* in *SQ*(*ri*) on or south of *Li* such that *rj* ∈ *Li*,*<sup>l</sup>* and *rk* ∈ *Li*,*r*. After the movement, in this case, the distance between *ri* and one of *rj*,*rk* is at most <sup>√</sup><sup>2</sup> 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 LDY of SER*(*I*) *move to the line segment LDY*−<sup>1</sup> *in at most two epochs.*

**Proof.** Since *LDY* is the topmost horizontal line segment, there is no robot in the north of *LDY* . Moreover, since robots agree on north, the robots at the grid points of *LDY* never move north of *LDY* . Therefore, if all the robots at the grid points of *LDY* make diagonal or vertical hops when they become active, then they will reach the positions of *LDY*−1; hence, in at most one epoch, all robots on *LDY* will be at *LDY*−1, even in the ASYN C 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 *LDY* completes its LCM cycle after moving to the position of *LDY*−1. Therefore, a robot *ri* on *LDY* remains at a grid point on *LDY* if and only if it makes a horizontal move in that epoch. We will show that *ri* either terminates or moves to a position on *LDY*−<sup>1</sup> in the next epoch.

Let *rj* be the robot at the horizontal neighboring grid point that *ri* sees on *LDY* when it makes a horizontal hop. We have it that *ri* must not have seen any robot on its other seven neighboring grid points or inside of *SQ*(*ri*) (except between *ri* and *rj* on the same horizontal line). When *ri* moves to the position of *rj*, either *rj* is still on *LDY* or has moved to *LDY*−<sup>1</sup> in the neighboring grid point that is vertically south of *rj*. If *rj* has not moved south, either the execution is still in the first epoch or *rj* does not see any other robot except on or between the positions of *ri* and *rj* in the same horizontal line. If *rj* is still in the first epoch, then *ri* reaches the position of *rj*, and either this horizontal moving scenario repeats with execution still being in the first epoch or *rj* moves south. If *rj* does not see any other robot except on or between the positions of *ri* and *rj* in the same horizontal line, *ri* (and all other robots on *Li* up to *rj*) reaches the position of *rj*, and all of them terminate by achieving the gathering configuration. If *rj* has moved to *LDY*−<sup>1</sup> in the first epoch, *ri* moves to the position of *rj* on *LDY*−<sup>1</sup> when it becomes active next time since *rj* is in the neighboring grid point of *SQ*(*ri*) that is vertically south of it. Therefore, in at most two epochs, all the robots on *LDY* move to the positions of *LDY*−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 DX* and *L* 0.

**Observation 1.** *No robot of SER*(*I*) *moves to the positions outside of lines L* <sup>0</sup> *and L DX during the execution.*

**Lemma 3.** *No robot of SER*(*I*) *reaches the south of horizontal line LS (Figure 4) during the execution.*

**Proof.** Let X := {*r*0, ... ,*rX*} be the robots on *L*<sup>0</sup> in the increasing order of their xcoordinates (some of the grid points on *L*<sup>0</sup> may be empty, and it does not impact our analysis). If all robots *r*0, ... ,*rX* on set X have robots on or inside *SQ*(∗) at the north of *L*0, they do not move until those robots at the north of *L*<sup>0</sup> are moved to *L*0. Therefore, we first assume that only *r*<sup>0</sup> and *rX* have robots at the north of *L*<sup>0</sup> inside or on *SQ*(*r*0) and *SQ*(*rX*), respectively, and {*r*1, ... ,*rX*−1} have no such robots at the north of *L*<sup>0</sup> inside or on their respective *SQ*(∗). Robots *r*2, ... ,*rX*−<sup>2</sup> 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*<sup>2</sup> and *rX*−<sup>2</sup> see *r*<sup>1</sup> and *rX*−1, respectively, in the north on their respective *SQ*(∗), and only the robots *r*3, ... ,*rX*−<sup>3</sup> can move to the next line in the south from their current horizontal line. This implies that each robot *ri*, 1 <sup>≤</sup> *<sup>i</sup>* <sup>≤</sup> *<sup>X</sup>* <sup>2</sup> waits for *ri*−<sup>1</sup> since it sees *ri*−<sup>1</sup> on the neighboring grid point in the north from their position, and this is also the case for the robots from *r <sup>X</sup>* <sup>2</sup> <sup>+</sup><sup>1</sup> (from *<sup>r</sup> <sup>X</sup>* <sup>2</sup> <sup>+</sup><sup>2</sup> in the even *DX* case) to *rX*−1. The scenario repeats until the middle robot of *L*<sup>0</sup> reaches at most *DX* <sup>2</sup> − 1 distance south from *L*0, if *DX* is an odd number). If *DX* is an even number, two robots *r <sup>X</sup>* 2 and *r <sup>X</sup>* <sup>2</sup> <sup>+</sup><sup>1</sup> of *<sup>L</sup>*<sup>0</sup> reach at most *DX* <sup>2</sup> − 2 distance south from *L*0.

Now consider the case where either *r*<sup>0</sup> or *rX* has no robot on the neighboring grid point that is vertically north from it in addition to *r*1, ... ,*rX*−1. Notice that at least one of *r*<sup>0</sup> or *rX* must have a robot at the north to maintain the connectivity of *Gt*(*I*). Let *r*<sup>0</sup> be that robot (the case of *rX* is analogous). If *r*<sup>0</sup> moves first, it moves to the position of *r*<sup>1</sup> in *L*<sup>0</sup> performing a horizontal hop. If *r*<sup>1</sup> moves first, *r*<sup>0</sup> reaches *r*<sup>1</sup> at the horizontal line immediately below *L*<sup>0</sup> performing a diagonal hop. By repeating this, the robots *r*0, ... ,*r <sup>X</sup>* <sup>2</sup> −1 may reach the position of *r <sup>X</sup>* 2 (the middle robot) at distance *DX* 2 south of *L*<sup>0</sup> (i.e., *LS*). For the remaining robots *r <sup>X</sup>* 2 , ... ,*rX*, each robot *rX*−*i*, 1 <sup>≤</sup> *<sup>i</sup>* <sup>≤</sup> *<sup>X</sup>* <sup>2</sup> sees *rX*−*i*+<sup>1</sup> in the north on respective *SQ*(∗); thus, the middle robot can reach at most *DX* 2 south of *L*0. Therefore, this process again ends up at line *LS* in the worst-case.

During the execution, the robots at the north of *L*<sup>0</sup> in *SER*(*I*) may visit the robots south of *L*0. In that case, the robots at the south of *L*<sup>0</sup> do not move until they see at least one robot at the north of its position inside *SQ*(∗). 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 *LS* 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 *LS*. Therefore, according to the moves of the robots of *L*0, it is easy to see that all the robots in Q are within the triangular area (as depicted in Figure 4).

**Lemma 4.** *The viewings of two and the square connectivity range of* <sup>√</sup><sup>2</sup> *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 *ri* sees robots only at the south (vertically below or diagonal), it can simply move towards the south, and when *ri* 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, *ri* must see it in one of its eight neighboring grid points in order to satisfy connectivity for *Gt*(*I*), *t* > 0, (Lemma 1) since *G*0(*t*) satisfies this condition. If *ri* sees a robot *rj* in either of its horizontal neighboring grid points, then *ri* moves to the position of *rj* if *rj* is at its east, and *rj* simply waits for *ri* as it does not perform a horizontal hop to the west or moves vertically south. Even in this case, *ri* sees *rj*. Therefore, if *ri* sees no robot in *SQ*(*ri*), it can terminate. According to the definition of the connectivity range, the viewing range of two is enough for *ri* 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 N* ≥ 1 *robots with the viewing range of two and the square connectivity range of* <sup>√</sup><sup>2</sup> *on a grid, the robots can gather to a point in* <sup>O</sup>(*DE*) *epochs in the* ASYN C *setting under both axis agreement.*

**Proof.** We have from Lemma 1 that *Gt*(*I*) remains connected during the execution. We have from Lemma 2 that all the robots at the topmost horizontal line *LDY* of *SER*(*I*) move to *LDY*−<sup>1</sup> in at most two epochs. Thus, after at most two epochs, Lemma 2 applies again to the robots of *LDY*−1, which takes all the robots on *LDY*−<sup>1</sup> to *LDY*−<sup>2</sup> or south in next two epochs. This process continues and all the robots in *SER*(*I*) move to line *L*<sup>0</sup> or south of it in at most 2 · *DY* epochs. These robots will be at one grid point in at most the next *DX* 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*<sup>0</sup> is at most *DX*. Thus, the width of the positions of robots becomes zero at distance <sup>≤</sup> *DX* <sup>2</sup> 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 *DX* <sup>2</sup> distance south of *L*0, it takes at most *DX* epochs. Therefore, the robots can gather in <sup>O</sup>(*DX* <sup>+</sup> *DY*) epochs. We have that max{*DX*, *DY*} ≤ *DE* <sup>≤</sup> <sup>√</sup><sup>2</sup> · max{*DX*, *DY*} for *SER*(*I*) of any initial configuration *I*. Therefore, *DX* + *DY* ≤ 2 · max{*DX*, *DY*}; hence, O(*DX* + *DY*) = O(2 · max{*DX*, *DY*}) = O(*DE*). The algorithm terminates (Lemma 4) since if a robot *ri* sees no robot in *SQ*(*ri*) other than its current position, then all the robots of Q must be gathered in the current position of *ri* (due to the connectivity guarantee of Lemma 1).

#### **4.** *O***(***DE***) 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 <sup>√</sup>10, and the square

connectivity range is of <sup>√</sup><sup>2</sup> (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 *ri* can decide to hop on the positions of one of its neighboring quadrants *SQ*3(*ri*) or *SQ*4(*ri*); we do not allow *ri* to move to the positions north of *Li*. In contrast to grid where robots always move in either unit distances (horizontal and vertical hops) or distance <sup>√</sup><sup>2</sup> (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 <sup>√</sup><sup>2</sup> 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 *ri* to compute unit area *SQunit*(*ri*) as defined in Section 2. *SQunit*(*ri*) helps *ri* to decide whether to make a diagonal, horizontal, or vertical hop. If *ri* sees itself or at least one robot in *SQunit*, (*ri*) is connected to a robot at the north of *LT*, and it does not move. This guarantees that robots do not move south forever. If the robots in *SQunit*(*ri*) are not connected to any other robot outside of *SQunit*(*ri*) at the west of *LR* (or similarly at the east of *LL*), then *ri* makes a horizontal hop to the east (or similarly to west). If *ri* satisfies the conditions for a horizontal hop, except that there is a robot on point *pBR* (or similarly on *pBL*), and the robots in *SQunit*(*ri*) are in a single diagonal line, then it makes a diagonal hop to *pBR* (or similarly to *pBL*). If the robots in *SQunit*(*ri*) are not connected to any other robot outside of *SQunit*(*ri*) at the north of *LB* but (at least) a robot in *SQunit*(*ri*) is connected to a robot on or south of *LB* and *ri* does not satisfy a condition for a diagonal hop, then *ri* makes a vertical hop. Moreover, if *ri* 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 *ri* to check, in every LCM cycle, whether all robots in its viewing range are positioned in *SQunit*(*ri*) (that is, *ri* sees no robot outside *SQunit*(*ri*)). When that is the case, *ri* and the remaining robots in *SQunit*(*ri*) 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.

#### 4.1.2. Detailed Description of the Patterns

We provide details of the patterns below. Robot *ri* terminates when it sees no other robot in *SQ*(*ri*), except on its current position.

**Horizontal Hops.** Robot *ri* makes a horizontal hop in the following conditions:

	- **–** No robot in *SQunit*(*ri*) is connected to any other robot at the north of *LT*.
	- **–** No robot in *SQunit*(*ri*) is connected to any other robot at the west of *LR*, except for the robots in *SQunit*(*ri*).
	- **–** There is no robot on *LB* of *SQunit*(*ri*).

#### **Algorithm 2:** The algorithm for gathering in the Euclidean plane


**<sup>2</sup>** *C*(*ri*) ← snapshot of the positions of other robots within the viewing range of *ri*; /\* Compute: \*/

	- /\* Conditions for horizontal hops \*/
	- /\* **Note:** If *ri* be the leftmost robot in *SQunit*(*ri*), then it moves distance 1 horizontally in East. And, if the conditions satisfy symmetrically, then *ri* sets as destination point to the position on *LL* in West. \*/
	- /\* Conditions for diagonal hops \*/
	- /\* **Note:** Here, *pBR* is the intersection point of *LB* and *LR* and *SQ*4(*ri*) is the unit square quadrant of *SQ*(*ri*) in the South-West region. If *ri* be the topmost (leftmost) robot in *SQunit*(*ri* <sup>√</sup> ), then it moves distance 2 diagonally to *pBR*. Moreover, if the above conditions satisfy symmetrically, then *ri* sets as destination point *pBL* (the intersection point of *LB* and *LL*). \*/
	- /\* **Note:** If *ri* be the topmost robot in *SQunit*(*ri*) then it moves distance 1 vertically South. \*/

/\* Move: \*/ **<sup>21</sup>** *ri* moves to *di*;

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.

**Figure 5.** An illustration of a horizontal hop (**a**) and diagonal hops (**b**,**c**).

**Diagonal Hops.** Robot *ri* makes a diagonal hop in either of the following conditions:

	- **–** No robot in *SQunit*(*ri*) is connected to any other robot at the north of *LT*.
	- **–** No robot in *SQunit*(*ri*) is connected to any other robot at the west of *LR*, except the robots in *SQunit*(*ri*).
	- **–** All robots in *SQunit*(*ri*) are in the diagonal line that passes through *SQ*4(*ri*).
	- **–** There is at least one robot on the diagonal point *pBR* of *SQunit*(*ri*).

Figure 5b illustrates this hop for *ri*. The symmetric diagonal case moves *ri* to point *pBL* which is illustrated in Figure 5c.

**Vertical Hops.** If no robot in *SQunit*(*ri*) of a robot *ri* is connected to any other robot at the north of *Li*,*<sup>t</sup>* (of *SQ*(*ri*)), *ri* makes a vertical hop of distance 1 − *Lim* (where *Lim* is the vertical distance from *ri* to line *LT*) in either of the following conditions:


**Remark 1.** *Robot ri 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* Q *are inside an (axis-aligned)* 1 × 1*-sized square area so that the special procedure for termination, as described in the next paragraph, can be applied.*

**Figure 6.** An illustration of vertical hops. (**a**) *ri* sees at least one robot on *LB* of *SQunit*(*ri*). (**b**) *ri* sees at least one robot each in both sides east and west at horizontal distance ≥ 2. (**c**) *ri* does not see any robot at horizontal distance ≥ 2 in both sides east and west, but at least one in the west of *LL* (or East of *LR*) and is connected to other robot in the south of *LB* and west of *Li*,*<sup>l</sup>* (or East of *Li*,*r*).

#### 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 Q in an axis-aligned 1 × 1-sized square area, say *SA*. We now discuss how the robots reach a point and terminate. Let *rl*, *rb*, and *rr* be the leftmost, bottommost, and rightmost robots in *SA*. We have that the unit area *SQunit*(*ri*) of each robot *ri* that is in *SA* overlaps. Therefore, if all the robots in *SA* are in a single diagonal line, then *rb* does not move, and all other robots in *SA* make a diagonal hop with their destination as the current position of *rb*. Otherwise, the robots first perform a horizontal hop, as the destination points the positions on the right vertical line *LR* of *SA*. The robots on *LR* do not move until all the robots in *SA* (the same for all robots) are positioned on *LR*. After that, the robots (now on *LR*) perform a vertical hop to the destination, which is the position of the bottom most robot on *LR*, 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 Q are positioned in an axis-aligned 1 × 1-sized square area *SA*.

**Observation 2.** *The robots within an axis-aligned* 1 × 1*-sized square area SA 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 *SER*(*I*) and other definitions as in Section 3 except *LS*. Here, we define *LS* as a horizontal line parallel to *L*<sup>0</sup> at distance *DX* 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 DX* . 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* <sup>0</sup> and *L DX* initially, there is no neighboring robot outside of those lines; hence, the diagonal hops will also be inside *L* 0 and *L DX* . In the vertical hops, robots always move vertically south. Since no robot has reached outside of *L* <sup>0</sup> and *L DX* with the horizontal as well as diagonal hops, this is true with the vertical hop as well.

**Figure 7.** Illustration of *SER*(*I*) and the triangular area south of it in the Euclidean plane.

**Observation 3.** *No robot of SER*(*I*) *moves outside of lines L* <sup>0</sup> *and L DX during the execution.*

**Lemma 5.** *Given that G*0(*I*) *is connected, the visibility graph Gt*(*I*) *at any time t* > 0 *remains connected.*

**Proof.** We extend the proof of Lemma 1. Similarly to the grid, a robot *ri* either does not move or performs either a diagonal, horizontal, or a vertical hop. Note also that *ri* never moves to any position at the north of *Li*. Furthermore, *ri* does not move when it sees at least one robot *rj* on line *Li*,*<sup>t</sup>* or at the north of *Li*,*t*.

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

A diagonal hop for *ri* is possible only when the robots in *SQunit*(*ri*) are in the diagonal line that passes through *SQ*4(*ri*) and are not connected to any other robot at the west of *LR* besides the robots in *SQunit*(*ri*) (the analogous case of *SQ*3(*ri*) can be handled similarly). Moreover, there is at least one robot at point *pBR*. Robot *ri* then moves to *pBR*. This preserves connectivity for *Gt*(*I*) since the robot at *pBR* must be connected to at least one robot at the east of *LR* if all the robots of Q are not inside *SQunit*(*ri*). Due to the ASYN C setting, the robot *rj* at *pBR* may perform its *Look* phase while *ri* is in transit to *pBR*. Let *t* be the time at which *rj* performs its *Look*. Let *ri* be at point *<sup>p</sup>* at distance <sup>√</sup><sup>2</sup> <sup>−</sup> *<sup>x</sup>* from *pBR* at time *t*. Let *SQp*(*ri*) be *SQ*(*ri*) for *ri* when it is at position *p*. Even in this case, *rj* does not move in a position outside of *SQp*(*ri*) regardless of whether it performs a horizontal, vertical, or a diagonal hop, preserving connectivity.

A horizontal hop for *ri* is possible only when the robots in *SQunit*(*ri*) are not connected to any other robot at the west of *LR* similarly to the diagonal hop case with only the difference being that there is no robot on *pBR* so that even when all the robots in *SQunit*(*ri*) are in a diagonal line, *ri* 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 *ri*, if it sees no robot at the north in *SQ*(*ri*), it moves vertically south on *L <sup>i</sup>* with a distance of exactly one. If *ri* sees at least one robot *rj* at the north in *SQ*(*ri*) and satisfies the conditions for vertical hopping, it hops 1 − *Lij* (where *Lij* is the vertical distance between *ri* and *rj*) distance south to a position on *LB* (of *SQunit*(*ri*)). 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 *ri* reaches at most <sup>√</sup><sup>2</sup> distance away from the neighbor robot in *SQ*(*ri*) (if the neighbor robot does not move in this epoch) and remains connected. Moreover, the robots connected to *ri* at the south of *LB* do not move as they find *ri* at the north and the connectivity with them remains unaffected. Thus, *Gt*(*I*), *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.

**Lemma 6.** *All the robots in at the north of LDY*−<sup>1</sup> *in SER*(*I*) *move to the positions on LDY*−<sup>1</sup> *or south of LDY*−<sup>1</sup> *in at most three epochs.*

**Proof.** Since *LDY* is the topmost horizontal line segment of *SER*(*I*), there is no robot at the north of *LDY* . 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*(*I*) formed by horizontal lines *LDY* and *LDY*−1, excluding the positions of *LDY*−1. Note that in the grid case, the robots were either on *LDY* or on *LDY*−1, and we proved in Lemma 2 that the robots on *LDY* reach *LDY*−<sup>1</sup> or the south in at most two epochs.

Consider *SQunit*(*ri*) of any robot *ri* in *CA*. We will show that all the robots in *SQunit*(*ri*) that are in *CA* reach *LDY*−<sup>1</sup> or below in at most two epochs. Since these robots do not see any robot on or north of *LDY* , they perform at least one kind of hop (vertical, horizontal, or diagonal) in the first epoch except the robots positioned between *L* <sup>1</sup> and *L* <sup>2</sup> in the west and *L DX*−<sup>2</sup> and *<sup>L</sup> DX*−<sup>1</sup> in the east in CA (Figure 8). The robots between *<sup>L</sup>* <sup>1</sup> and *L* <sup>2</sup> and *L DX*−<sup>2</sup> and *<sup>L</sup> DX*−<sup>1</sup> may not satisfy any conditions for movement in the first epoch. If all the robots in *SQunit*(*ri*) in *CA* perform either a diagonal or a vertical hop, they reach *LDY*−<sup>1</sup> or south in one epoch because, with both the diagonal and vertical hops, robots in *SQunit*(*ri*) reach *LB* or below *LB* and *LB* is either *LDY*−<sup>1</sup> 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 *LR*, except the robots in *SQunit*(*ri*), and there is no robot on *LB* of *SQunit*(*ri*). By the end of the first epoch, all the robots in *SQunit*(*ri*) reach the positions on or east of *LR* if all of them make a horizontal hop. In this case, the robots in CA between *L* <sup>1</sup> and *L* <sup>2</sup> 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 *LB* or south of it in the second epoch performing a vertical or a diagonal hop. Consider a robot *ri* that satisfies the conditions for a horizontal hop in the first epoch. We have it that there is no robot on *LB*, and the robots in *SQunit*(*ri*) are connected to no other robot besides the robots in *SQunit*(*ri*) at the west of *LR*. Let *SQ<sup>E</sup> unit*(*ri*) be a square area adjacent to *SQunit*(*ri*) at the east between lines *LT* and *LB*. Let *L <sup>B</sup>* and *L <sup>R</sup>* be the bottom horizontal and right vertical lines of *SQ<sup>E</sup> unit*(*ri*). If the robots in *SQ<sup>E</sup> unit*(*ri*) are not on *L <sup>B</sup>* and not connected to any other robot below *L <sup>B</sup>* at the west of *L <sup>R</sup>*, they do not move until all the robots in *SQunit*(*ri*) reach *LR* or east of *LR* in *SQ<sup>E</sup> unit*(*ri*). If there are robots on *L <sup>B</sup>*, let *x* be the robot on *L <sup>B</sup>* that is the closest from *LR*. Let *LV* be a line parallel to *LR* at some unit distance west of *x*. All the robots in *SQunit*(*ri*) at the west of *LV* perform one horizontal move each in the first epoch. The robots on *LV* or east in *SQunit*(*ri*) perform a vertical hop as there are robots on *L <sup>B</sup>*. The robots of *SQunit*(*ri*) that performed a horizontal hop on the first epoch now observe robots on *LB* in the second epoch and make a vertical

move. Moreover, the robots in *SQ<sup>E</sup> unit*(*ri*), which were waiting for the robots in *SQunit*(*ri*) to perform a horizontal hop in the first epoch, now see robots at their respective *LB* and, hence, perform either a vertical or a diagonal hop to *LB*. This means that the robots in *CA* between *L* <sup>0</sup> and *L* <sup>2</sup> also move to *LDY*−<sup>1</sup> or south in two epochs. Arguing similarly, if the robots in *CA* between *L DX*−<sup>2</sup> and *<sup>L</sup> DX*−<sup>1</sup> do not move in the first epoch, they also see a robot on their respective *LB* in the second epoch since the robots at the west of *L DX*−2 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 DX*−<sup>1</sup> and *<sup>L</sup> DX* in *CA* move to *LDY*−<sup>1</sup> or move south in the third epoch as they can observe at least one robot on their respective *LB*. Therefore, in three epochs, all the robots in *CA* reach *LDY*−<sup>1</sup> or south. The Lemma is described follows.

**Figure 8.** An illustration of movements of robots in the Euclidean plane below *L*0. 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 *L*0, the width of the positions of robots decreases by 1 unit; hence, all the robots reach inside a unit square at most *DX* unit south of *L*0. (**i**) All the robots reached South of *L*0. (**ii**)–(**xi**) Movements of robots in the South of *L*<sup>0</sup> in each round. (**xii**) Robots gathered inside a unit square area in the South of *L*0.

**Lemma 7.** *No robots of SER*(*I*) *reaches south of LS during the execution.*

**Proof.** We extend the proof of Lemma 3. Let X := {*r*0, ... ,*rX*} be the set of robots in the increasing order of their x-coordinates in the corridor area *CA* between *L*<sup>1</sup> and *L*<sup>0</sup> of *SER*(*I*). If the robots on set X see other robots at distance ≥ 1 north from their positions, they do not move and wait until they do not see any robot at the north at a distance ≥ 1. Therefore, similarly to Lemma 3, the robots in *CA* that do not see any robot in the north at distance ≥ 1 proceed to move south. This will take those robots to the next corridor *CA* adjacent to *CA* in the south. Suppose at some time *t* > 0, all the robots reach *CA*

between *L*<sup>0</sup> and *L*1. Some robots might see no robots at the north at the distance ≥ 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* <sup>0</sup> and *L* <sup>1</sup>) in the east perform horizontal moves, and the robots in the next unit square area (i.e., between *L* 1 and *L* <sup>2</sup>) 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 DX*−<sup>2</sup> and *<sup>L</sup> DX* ) do not move in the first epoch. The remaining robots in *CA* between *L* <sup>2</sup> and *L DX*−<sup>2</sup> move south. In the next epoch, the robots in *CA* between *L* <sup>1</sup> and *L* <sup>2</sup> (including the robots that moved horizontally to this area in the previous epoch) move south. The robots in *CA* between *L DX*−<sup>2</sup> and *<sup>L</sup> DX*−<sup>1</sup> also move south in the this epoch whereas the robots in *CA* between *L DX*−<sup>1</sup> and *<sup>L</sup> DX* still do not move; they move in the third epoch. The robots in *CA* between *L*<sup>2</sup> and *L*<sup>4</sup> and *LDX*−<sup>4</sup> and *LDX*−<sup>2</sup> 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 X will be within a single unit square area in the corridor at distance *DX* south of *L*<sup>0</sup> (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.

**Observation 4.** *For every one unit vertical hop of the robots in* Q *in the south of L*0*, the width of the positions of robots decreases by (at least) one.*

**Lemma 8.** *The viewing range of* <sup>√</sup><sup>10</sup> *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 Q. *SQunit*(*r*) is computed based on the position of other robots in *SQ*(*r*), which may lie anywhere within *SQ*(*r*). For *r* to decide whether it is connected to other robots outside *SQunit*(*r*), it has to see other robots in both the horizontal and vertical distance of at most one outside *SQunit*(*r*). Therefore, the maximum distance between *r* and some other robot *<sup>r</sup>* in *SQunit*(*r*) (or *SQ*(*r*)) is <sup>√</sup><sup>2</sup> and *<sup>r</sup>* may be connected to a robot at a distance of at most <sup>√</sup><sup>2</sup> away from *<sup>r</sup>* . Therefore, *r* needs to see at most a distance of <sup>√</sup><sup>2</sup> <sup>+</sup> <sup>√</sup><sup>2</sup> <sup>=</sup> <sup>2</sup> <sup>√</sup><sup>2</sup> <sup>=</sup> <sup>√</sup><sup>8</sup> to find out whether there is a robot outside *SQunit*(*r*) or not. When *r* sees that no robot in *SQunit*(*r*) is connected outside of *SQunit*(*r*), 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 ≥ 2 at both the east and west, within the corridor of *LT* and *LB*. To guarantee whether there is a robot at horizontal distance ≥ 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 <sup>&</sup>lt; 2. Therefore, *<sup>r</sup>* needs to see at most distance <sup>√</sup> <sup>3</sup><sup>2</sup> <sup>+</sup> <sup>1</sup><sup>2</sup> <sup>=</sup> <sup>√</sup>10. Figure <sup>9</sup> (left) illustrates this requirement.

The analysis of this section proves the following main result.

**Theorem 3.** *Given any connected configuration of <sup>N</sup>* <sup>≥</sup> <sup>1</sup> *robots with the viewing range of* <sup>√</sup><sup>10</sup> *and the square connectivity range of* <sup>√</sup><sup>2</sup> *on a plane, the robots can gather to a point in* <sup>O</sup>(*DE*) *epochs in the* ASYN C *setting under both axis agreements.*

**Figure 9.** An illustration of the viewing range of <sup>√</sup>10.

**Proof.** We have from Lemma 5 that, given a connected *G*0(*I*), *Gt*(*I*), *t* > 0, remains connected during the execution of the algorithm. We have from Lemma 6 that all the robots at the topmost horizontal line *LDY* of *SER*(*I*) move to *LDY*−<sup>1</sup> or south of *LDY*−<sup>1</sup> in at most two epochs. In other words, *LDY*−<sup>1</sup> becomes *LDY* in at most two epochs and Lemma 6 applies again to *LDY*−1. Therefore, all the robots in *SER*(*I*) move to line *L*<sup>0</sup> or south of it in at most 2 · *DY* 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 · *DX* epochs, arguing similarly with respect to Lemma 6. After all the robots of 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 · *DY* + 2 · *DX* + 2 = O(*DX* + *DY*) = O(*DE*) 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 *ri* moving only to the east (Figure 3 (middle)), *ri* can also move to the west as well if it sees no robots on or inside *SQ*(*ri*), except for the situation where there is exactly one robot *rj* on the neighboring grid point on *Li* in the west. Regarding Rule 1, *ri* 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 *ri* terminates if it sees all the robots in Q are at most two neighboring grid points (one is current position of *ri* and the other is either the left horizontal grid point only or the right horizontal neighboring grid point only). For *ri* 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 *ri* to

either of its horizontal neighboring grid point is one, and the distance of the neighboring grid points of *ri*'s horizontal neighboring grid points is at most <sup>√</sup>2. Therefore, *ri* needs the viewing range of (<sup>1</sup> <sup>+</sup> <sup>√</sup>2) <sup>&</sup>lt; 3. The connectivity range remains <sup>√</sup>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.

**Theorem 4.** *Given any connected configuration of N* ≥ 1 *robots with the viewing range of three and the square connectivity range of* <sup>√</sup><sup>2</sup> *on a grid, the robots can gather in a unit length horizontal line segment (that is not known beforehand) in* O(*DE*) *epochs in the* ASYN C *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 *SQunit*(*ri*) using *LL* and *LT* as reference lines, *SQunit*(*ri*) also needs to be computed by using *LR* and *LT* as references. When *ri* 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 *rj* and leftmost robot *rk* in *SQ*(*ri*) in order to compute *SQunit*(*ri*); for the symmetric case, it takes the topmost and rightmost robots in *SQ*(*ri*) as a reference. This allows the robots to make horizontal hops in both directions (not necessarily only east under both axis agreement). Therefore, *ri* hops to the west of *Li* 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:


Regarding termination, *ri* 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 Q inside an axisaligned 1 × 1-sized square area *SA* in O(*DE*) epochs.

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

**Proof of Theorem 1:** It is easy to see from the analysis of Section 4 that robots in Q reach inside an axis-aligned unit square area in O(*DE*) epochs. The only change on the analysis is on horizontal hops, which does not increase the number of epochs for the robots in 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 *LB*. The robots that are not on *LB* move vertically to *LB*, and the robots on *LB* do not move. Therefore, the robots reach a relaxed gathering configuration (Definition 3) in O(*DE*) epochs.

#### **6. Concluding Remarks**

We have presented, to the best of our knowledge, the first time-optimal O(*DE*)-epoch algorithm for gathering *N* ≥ 1 classic oblivious robots in a plane in the ASYN C setting under limited visibility, improving significantly on the previous O(*DG*)-round algorithm of [4] that works in the FSYNC setting. Our result assumes the viewing range of <sup>√</sup>10, the square connectivity range of <sup>√</sup>2, and the agreement on one axis. This is in contrast to the viewing range of one and the (circular) connectivity range of 1 <sup>−</sup> <sup>√</sup><sup>1</sup> <sup>2</sup> 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**


### *Article* **Robot Evacuation on a Line Assisted by a Bike**

**Khaled Jawhar <sup>1</sup> and Evangelos Kranakis 1,2,\***


**Abstract:** Two robots and a bike are initially placed at the origin of an infinite line. The robots are modelled as autonomous mobile agents whose communication capabilities are either in the wireless or face-to-face model, while the bike neither can move nor communicate on its own. Thus, the bike is not autonomous but rather requires one of the robots to ride it. An exit is placed on the line at distance *d* from the origin; the distance and direction of the exit from the origin is unknown to the robots. Only one robot may ride the bike at a time and the goal is to evacuate from the exit in the minimum time possible as measured by the time it takes the last robot to exit. The robots can maintain a constant walking speed of 1, but when riding the bike they can maintain a constant speed *v* > 1 (same for both robots). We develop algorithms for the evacuation of the two robots from the unknown exit and analyze the evacuation time defined as the time it takes the second robot to evacuate. In the wireless model we present three algorithms: in the first the robots move in opposite direction with max speed, in the second with a specially selected "optimal" speed, and in the third the robot imitates the biker (i.e., robot riding the bike). We also give three algorithms in the Face-to-Face model: in the first algorithm the robot pursues the biker, in the second the robot and the biker use zig-zag algorithms with specially chosen expansion factors, and the third algorithm establishes a sequence of specially constructed meeting points near the exit. In either case, the optimality of these algorithms depends on *v* > 1. We also discuss lower bounds.

**Keywords:** arrival time; bike; evacuation; line; robots; search; speed; optimal trajectory

**Citation:** Jawhar, K.; Kranakis, E. Robot Evacuation on a Line Assisted by a Bike. *Information* **2021**, *12*, 28. https://doi.org/10.3390/info12010028

Received: 10 November 2020 Accepted: 5 January 2021 Published: 12 January 2021

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

**Copyright:** © 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/).

#### **1. Introduction**

Recent years have witnessed an explosive growth of research studies on search from the perspective of mobile agent computing. One of the reasons is because one finds countless natural applications of search and exploration in distributed systems in order to facilitate information exchange between communicating entities. Moreover, there are also applications in numerous other computing areas such as data mining, web crawlers, monitoring and surveillance, just to mention a few.

Evacuation, which is the main theme of our present investigation, is related to search in that one is also interested in searching and exploring a domain in order to find a target. However evacuation usually involves many cooperating entities forming an ensemble or group all of whose members are searching simultaneously by exchanging information (according to a predefined communication model); and unlike search which typically involves only one agent, it is aiming to optimize the arrival time of the last entity in the ensemble. There are many factors that affect how linear search and evacuation problems are solved. Let us assume that the exit is located on a line at a distance *d* from the origin where the robot starts. The orientation represents the direction that the robot must proceed to reach the exit. The simplest case would be if a robot moving with unit speed knows the distance and the orientation and can thus reach the exit in time d. In this case, the competitive ratio will be the time needed by the robot to reach the exit, which is *d*, divided

by the time needed by the adversary to head to the exit directly, which is *d* as well. Thus the competitive ratio will be 1. A more complicated case would be if the distance is known and the orientation is not known. As a worst case scenario, it may take the robot 3*d* to find the exit since the robot may move *d* in the wrong direction and thus it will need to switch the direction and move back 2*d* to reach the exit. The competitive ratio in this case is 3. The problem is even more complicated if both the distance and the orientation are not known. The robot starts at the origin and can move with speed 1. The robot needs to explore both directions in order to find the exit. The best way to achieve this goal is to select a direction and move distance 1. If the exit is not found, the robot will reverse direction and move double the previous distance up until the exit is found. The movement, which is repeated periodically, and which uses a sequence of positive distances that specifies the turning points, is called the Zig-Zag search algorithm. The competitive ratio for the Zig-Zag search algorithm is known to be 9 [1]. Most of the linear search and evacuation problems in the literature were studied using single or multiple robots. Introducing a tool such as a bike to aid the robots was not considered before in any previous work. The study of this paper is based on a new paradigm concerning two robots (also called hikers) aided by a bike and searching for an unknown exit placed somewhere on an infinite line. More specifically, in the "bike assisted evacuation" problem, the hikers and the bike all start at the origin and want to evacuate from an exit placed at an unknown distance and direction (either left or right from the origin) on the infinite line. Evacuation means that eventually both robots must find the exit by reaching its exact location (not necessarily at the same time) on the infinite line. The quality of an evacuation algorithm is measured by the time it takes the second hiker to find the exit, which is also referred to as evacuation time of the ensemble.

#### *1.1. Model and Notation*

To analyze the problem proposed, first we describe details concerning mobility and communication of the hikers and describe the role that the bike will play in improving the overall evacuation time.

Mobility and Trajectories.The infinite line is the search domain. It is bidirectional in that the hikers can move in either direction without this affecting their speeds. The hikers can stop at any time and wait as long as they wish, can walk with maximum speed 1 or may ride the bike with speed *v* > 1. An evacuation algorithm is a complete description of the trajectories traced by the two hikers either waiting, walking or riding the bike until they both find the exit. Throughout this paper we are interested in evacuation algorithms.

Sharing the bike. An interesting feature of our problem is the distinction between the hikers and the bike. On the one hand, the hikers are autonomous mobile agents that can move around on their own with speed 1 and communicate with each other. On the other hand, the bike is not autonomous and cannot move and/or communicate on its own and thus plays only the role of assistant in the search. The hiker using the bike has an advantage in that it can move with speed *v* > 1 which is of course faster than its walking speed 1. However, in our model the bike is also a limited resource in that it can be used by only one hiker at a time. This creates an interesting trade off for the evacuation time. The hikers would want to ride the bike to find the exit earlier. However, if the bike is not shared the evacuation time may get worse as the hiker not using the bike may worsen the overall evacuation time. This also implies that the hiker riding the bike has an advantage in sharing the bike with the other hiker as this will ultimately improve the overall evacuation time.

Bike Switching. An important aspect in our algorithms will be "bike switching", by which we mean changing the rider of the bike. We will assume throughout the paper that bike switching between hikers is instantaneous and at no time cost. Note that the hikers may recognize the presence of the bike when they are at the same location as the bike. From now on, to facilitate our discussions we will refer to the hiker riding the bike as the biker, which may be either of the two hikers.

Communication. A designated point on the infinite line is the exit and can be recognized as such by any of the hikers when they are at the same location as the exit. The hikers may communicate throughout the execution of the algorithms. Two types of communication will be studied, namely wireless (also known as wifi) and face-to-face. In the former, the hikers can communicate instantaneously and at any distance, while in the latter only when they are at the same location and at the same time. The fact that a hiker is riding the bike does not diminish its ability to communicate. A typical communication exchange may involve, e.g., "exit is found", "bike released", "switch bike", etc. Note that the hikers are endowed with pedometers and have computing abilities so that they can deduce the location of the other hiker and/or the bike from relevant communications exchanged and/or the protocols they execute.

Notation. Throughout the paper we will be using *R*<sup>1</sup> and *R*<sup>2</sup> to denote the two hikers and *B* to denote the bike. The hikers are equipped with pedometers and are identical in all their capabilities (locomotion and communication) and the subscripts *i* = 1, 2 in *Ri* do not imply that the hikers have identifiers. The origin of the real line will be at the point *x* = 0 on the *x*-axis and this will also be the starting location of the hikers and the bike. The adversary may place the exit at either of the points ±*d*, where *d* > 0 will denote the unknown distance of the exit from the origin. In addition, *v* > 1 will denote the speed that a biker can attain when riding the bike.

#### *1.2. Related Work*

The continuous infinite line is a widely-used search domain. It is in this particular domain that the first search problems in the literature were proposed in the seminal papers [2,3] with a focus on stochastic search models and their analysis. Influential research for deterministic search by a single robot in the infinite line was developed in the work of [1] by proving that searching for a target has competitive ratio equal to 9, and for randomized search on the star graph by [4].

Evacuation is a form of group search in which the robots need to cooperate so that they all find the exit. It arises as a natural problem on the infinite line for the case of robots with faults (crash and/or Byzantine). The two important papers are [5] for robots with crash faults and [6] for robots with Byzantine faults. The study of evacuation in distributed computing for a unit disk is also related and was initiated in the paper [7] for both the wireless and face-to-face models. The reader can find additional related work on the continuous search domain in the survey paper [8].

The addition of an immobile token to aid in the exploration has been considered in the context of the rendezvous problem on a ring [9]. An extension of this work to mobile tokens can be found in [10]. In both of these papers the token is passive and is merely being used as a marker for the presence of the most recent "visit" of another agent. Similarly, in [11] the authors consider searching for a non-adversarial, uncooperative agent, called bus, which is moving with constant speed along the perimeter of a cycle. A different related model was investigated in [12] in which during search a robot can encounter a point or a sequence of points enabling faster and faster movement and the main goal is to adopt the route which allows a robot to reach the destination as quickly as possible.

Two related papers are [13] and its followup journal version [14]. In the former paper the authors introduce evacuation on an infinite line in the F2F model for two robots having max speed 1 and prove that 9 is a tight bound for evacuation. In the followup paper [14] tight bounds are shown for two robots with different speeds in the F2F model. In their model the robots can vary their speed between the min and max value. However, unlike our model, the slower robot is never able to move at the speed of the faster robot. As a consequence in our model a "shared" bike has the effect of averaging the speeds and improving the overall evacuation time of the ensemble. The main idea considered in the present paper of bike assisted evacuation modelled as a passive agent that can enhance the robots' evacuation time has not been considered in the relevant literature on search and evacuation before. (The present study is revised and updated from the first author's MCS Thesis [15]. A preliminary study without proofs in [16]).

It is also worth mentioning a different line of research that has evolved in recent years, concerning bike sharing systems in complementing traditional public transportation to reduce traffic congestion and mitigate atmospheric pollution. As a consequence bike-sharing has grown explosively everywhere [17]. This has led to extensive technical literature on different aspects of the performance of bike based transportation systems. For example, Ref. [18] addresses uncertainty in resource availability, Ref. [19] considers bike utilization conflict, Ref. [20] studies system balance maintainance, Ref. [21] investigates the efficient operation of shared mobility systems, Ref. [22] studies balancing, and [23] proposes a spatio-temporal bicycle mobility model. Finally we mention the recent paper [24] which gives a polynomial time algorithm for the Bike Sharing problem that produces an arrival-time optimal schedule for bikers to travel across the interval.

#### *1.3. Outline and Results of the Paper*

Our main results in the Wireless model are presented in Section 3. We give three algorithms: in the first the robots move in opposite direction with max speed, in the second with a specially selected "optimal" speed, and in the third the hiker imitates the biker. Results on the Face-to-Face model are presented in Section 4. We give three algorithms: in the first algorithm the hiker pursues the biker, in the second the hiker and the biker use zig-zag algorithms with specially chosen expansion factors, and in the third the algorithm establishes a sequence of specially constructed meeting points near the exit. In either communication model we conclude that the optimal algorithm depends on the speed *v* of the bike which we also determine. Details of the results are in Table 1.


**Table 1.** Main algorithms presented in the paper in the WiFi (top three) and Face-to-Face (F2F) (bottom three) models, the theorem where the analysis, and their corresponding evacuation time as a function of the bike's speed *v*, where *v* > 1.

We also establish lower bounds in Section 5. The competitive ratio of the algorithms can be given by dividing by *<sup>v</sup>*+<sup>1</sup> <sup>2</sup>*<sup>v</sup> d*, where *d* is the distance of the exit from the origin (see Theorem 7). The main motivation of our current study on robot evacuation from an unknown target is to better understand the effect that communication models (F2F and Wireless) have on search and evacuation time for an autonomous mobile agent which is aided by another mobile agent (bike) which has limited mobility capabilities.

#### **2. Preliminaries**

In this section we remind the reader that the competitive ratio for the Zig-Zag search algorithm is known to be at most 9. A canonical Zig-Zag search algorithm is defined as follows (Algorithm 1):


The competitive ratio for Algorithm 1 is calculated as follows:

Every time the robot changes direction and moves twice the previous distance. Thus, if the exit is at distance *<sup>d</sup>*, then 2*<sup>k</sup>* <sup>&</sup>lt; *<sup>d</sup>* <sup>≤</sup> <sup>2</sup>*k*+<sup>2</sup> for some *<sup>k</sup>*. Hence the search time *<sup>T</sup>* will be calculated as follows:

$$\begin{aligned} T &= 2 \cdot 1 + 2 \cdot 2 + \dots + 2 \cdot 2^{k+1} + d \\ &= 2 \cdot (2^{k+2} - 1) + d = 2^3 \cdot 2^k - 2 + d \le 8d + d = 9d \end{aligned}$$

Thus, the competitive ratio of this algorithm is <sup>9</sup>*<sup>d</sup> <sup>d</sup>* = 9. The lower bound proof can be found in [1].

#### **3. Evacuation in the Wireless (WiFi) Model**

In this section we provide our main algorithms in the wireless communication model. In this model the two hikers can communicate instantaneously at any distance. Three algorithms will be considered and analyzed their evacuation time depends on the maximum speed *v* of the biker.

#### *3.1. Opposite Direction with Max Speed*

In Algorithm 2, the hiker and the biker move in opposite directions with their maximum speed, assuming that the biker moves with speed *v*. The one which finds the exit first will communicate with the other to proceed to the exit. Moreover, if it is the biker that found the exit first it returns the bike to a suitable position and shares it with the hiker. Details of the algorithm are as follows.


**Theorem 1.** *The evacuation time for Algorithm 2 in the WiFi model is at most* 2*d* + *<sup>d</sup> v* .

**Proof of Theorem 1.** Without loss of generality assume the hiker moves in the leftward and the biker in the rightward direction both starting from the origin. There are two cases to consider depending on whether the hiker or the biker finds the exit first.

*Case 1:* The exit is found by the biker.

When the biker finds the exit, which is at distance *d* from the origin, it has spent time *d <sup>v</sup>* . The biker will communicate with the hiker, to come to the exit. Since the exit is found by the biker first, the biker can help the hiker by returning and dropping off the bike at some distance *x* away from the exit such that the hiker can pick it up and arrive to the exit at the same time as the other robot. It is easy to see that to find the distance *x* where the bike is dropped off, we need to solve the equation *<sup>x</sup> <sup>v</sup>* <sup>+</sup> *<sup>x</sup>* <sup>=</sup> *<sup>d</sup>* <sup>+</sup> *<sup>d</sup> <sup>v</sup>* <sup>−</sup> *<sup>x</sup>* <sup>+</sup> *<sup>x</sup> <sup>v</sup>* . This leads to the solution *x* = *<sup>d</sup>* <sup>2</sup> <sup>+</sup> *<sup>d</sup>* <sup>2</sup>*<sup>v</sup>* . Hence the hiker which is at distance *<sup>d</sup> <sup>v</sup>* when the biker reaches the exit, will need *<sup>d</sup> <sup>v</sup>* to reach the origin, in addition to *<sup>d</sup>* <sup>−</sup> *<sup>x</sup>* <sup>+</sup> *<sup>x</sup> <sup>v</sup>* <sup>=</sup> *<sup>d</sup>* <sup>2</sup> <sup>+</sup> *<sup>d</sup>* <sup>2</sup>*v*<sup>2</sup> to reach the exit. Therefore, the evacuation time will be <sup>2</sup>*<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>d</sup>* <sup>2</sup> <sup>+</sup> *<sup>d</sup>* <sup>2</sup>*v*<sup>2</sup> .

*Case 2:* The exit is found by the hiker.

When the hiker finds the exit which is at distance *d* to the left of the origin, the biker will be at distance *dv* to the right of the origin. The hiker will communicate with the biker to come to the exit. The biker turns back and goes to the exit which takes additional time *d* + *<sup>d</sup> <sup>v</sup>* . It follows that the evacuation time in this case will be *<sup>d</sup>* <sup>+</sup> *<sup>d</sup>* <sup>+</sup> *<sup>d</sup> <sup>v</sup>* <sup>=</sup> <sup>2</sup>*<sup>d</sup>* <sup>+</sup> *<sup>d</sup> v* .

Therefore, by combining the two cases above, we conclude that the evacuation time for this algorithm will be max 2*d* + *<sup>d</sup> <sup>v</sup>* , <sup>2</sup>*<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>d</sup>* <sup>2</sup> <sup>+</sup> *<sup>d</sup>* 2*v*<sup>2</sup> . This completes the proof of Theorem 1.

#### *3.2. Opposite Direction with Optimal Speed*

Unlike Algorithm 2 in which the hiker and biker use their maximum speed, in the next Algorithm 3 the biker will not use its maximum speed *v*. Instead it will move with a specially chosen speed *u* which is less than *v*. The hiker or the biker which finds the exit first will communicate with the other which will then move towards the exit with its maximum speed. It turns out that the modified algorithm performs better than the previous one and it is optimal up to a certain maximum speed *v*. Assuming that *R*<sup>1</sup> is the hiker and *R*<sup>2</sup> is the biker, the algorithm will be as follows.

#### **Algorithm 3:** (OppDirectionWithOptimalSpeedWiFi)


**Theorem 2.** *The evacuation time for Algorithm 3 using the WiFi model is at most* 3*d* + 3*vd* + *d* √ *<sup>v</sup>*<sup>2</sup> <sup>+</sup> <sup>26</sup>*<sup>v</sup>* <sup>+</sup> <sup>9</sup> <sup>4</sup>*<sup>v</sup> .*

**Proof of Theorem 2.** Assume that *R*<sup>1</sup> which is the hiker moves in the leftward direction and *R*2, which is the biker, moves in the rightward direction. There are two cases to consider depending on who reaches the exit first.

*Case 1:* Hiker reaches the exit first.

The time needed by *R*<sup>1</sup> to reach the exit is *d*. At this point *R*<sup>2</sup> will be at distance *du* away from the origin since it is moving with speed *u*. As mentioned in the algorithm, *R*<sup>2</sup> will use its maximum speed *v* on the way back. Thus, it needs *du <sup>v</sup>* to reach the origin and it will need additional time *<sup>d</sup> <sup>v</sup>* to join *R*<sup>1</sup> and reach the exit. Therefore, the evacuation time in this case will be

$$T\_1 = d + \frac{d\mu}{\upsilon} + \frac{d}{\upsilon} = \frac{d\upsilon + d\mu + d}{\upsilon}$$

*Case 2:* Biker reaches the exit first.

The time needed by *R*<sup>2</sup> to reach the exit is *<sup>d</sup> <sup>u</sup>* . As soon as *R*<sup>2</sup> reaches the exit, it will inform *R*<sup>1</sup> immediately. At this point in time, *R*<sup>1</sup> will be at distance *<sup>d</sup> <sup>u</sup>* on the other side of the origin since it is moving with unit speed. *R*<sup>2</sup> will go back distance *x* to drop off the bike for *R*1. The key point to find *x* is to have *R*<sup>2</sup> drop off the bike in a way that *R*<sup>1</sup> can pick it up and arrive at the same time as *R*2. We know from Algorithm 2 that *R*<sup>2</sup> will not use its maximum speed and will move with speed *u* only until it reaches the exit. The only reason for not using its maximum speed before reaching the exit is to avoid having *R*<sup>1</sup> and *R*<sup>2</sup> farther apart from each other since this will increase the overall evacuation time. Thus when *R*<sup>2</sup> goes back to drop off the bike, it will use its maximum speed *v*. Based on that we have the following equation.

$$\mathbf{x} + \frac{\mathbf{x}}{v} = d + \frac{d}{u} - \mathbf{x} + \frac{\mathbf{x}}{v}$$

whose solution is *x* = *<sup>d</sup>* <sup>2</sup> <sup>+</sup> *<sup>d</sup>* <sup>2</sup>*<sup>u</sup>* . Substituting *x* in order to calculate the evacuation time *T*<sup>2</sup> yields:

$$\begin{aligned} T\_2 &= \frac{d}{u} + \mathbf{x} + \frac{\mathbf{x}}{v} \\ &= \frac{d}{u} + \frac{d}{2} + \frac{d}{2u} + \frac{d}{2v} + \frac{d}{2uv} \\ &= \frac{2dv + duv + dv + du + d}{2uv} \\ &= \frac{3dv + du + duv + d}{2uv} \end{aligned}$$

In order to find the best evacuation time, we need to find the best value of *u* which makes the maximum of *T*<sup>1</sup> and *T*<sup>2</sup> minimized given that 1 ≤ *u* ≤ *v*. This means that the objective is to minimize the following quantity

$$\max\{T\_2, T\_2\} = \max\left\{\frac{dv + du + d}{v}, \frac{3dv + du + duv + d}{2uv}\right\} \tag{1}$$

In order to find the solution for (1), we determine the point of intersection of the evacuation time plots for *T*<sup>1</sup> and *T*2. This will give the following:

$$\frac{u+v+1}{v} = \frac{3v+u+uv+1}{2uv} \implies 2u^2v + 2uv^2 + 2uv = 3v^2 + uv + uv^2 + v^2$$

$$\implies 2u^2v + (v^2+v)u - 3v^2 - v = 0$$

The last equation will have two roots, and choosing the positive one gives the following solution for *u*:

$$\begin{aligned} u &= \frac{1}{4v}(-v^2 - v + \sqrt{v^4 + 2v^3 + v^2 - 8v(-3v^2 - v)}) \\ &= \frac{1}{4v}(-v^2 - v + \sqrt{v^4 + 2v^3 + v^2 + 24v^3 + 8v^2}) \\ &= \frac{1}{4v}(-v^2 - v + \sqrt{v^4 + 26v^3 + 9v^2}) \\ &= \frac{1}{4}(-v - 1 + \sqrt{v^2 + 26v + 9}) \end{aligned}$$

In order to get the evacuation time *T*, we can substitute u in *T*<sup>1</sup> or *T*2, we get the following:

$$\begin{split} T &= \frac{dv + du + d}{v} \\ &= \frac{1}{v} (dv + \frac{-dv - d + d\sqrt{v^2 + 26v + 9}}{4} + d) \\ &= \frac{4dv - dv - d + d\sqrt{v^2 + 26v + 9} + 4d}{4v} \\ &= \frac{3d + 3dv + d\sqrt{v^2 + 26v + 9}}{4v} .\end{split}$$

This completes the proof of Theorem 2.

#### *3.3. Slower Imitates Faster*

In the next Algorithm 4 the robots perform a "doubling zig-zag" strategy with different parameters. The biker is using a doubling strategy to search for the exit and moves a distance 2*<sup>k</sup>* during the *k*-th iteration. The hiker is also using a doubling strategy but since it is moving with unit speed it will try to stay as close as possible to the biker. This can be achieved by having the hiker move a distance <sup>2</sup>*<sup>k</sup> <sup>v</sup>* during the *k*-th iteration, since moving any further will cause the hiker to be farther away from the biker during the (*k* + 1)-st iteration. Assuming that robot *R*<sup>1</sup> is the biker and robot *R*<sup>2</sup> is the hiker, the algorithm will be as follows.


**Theorem 3.** *The evacuation time for Algorithm 4 using the WiFi model is at most* <sup>9</sup>*<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>d</sup>* <sup>2</sup> <sup>−</sup> *<sup>d</sup>* <sup>2</sup>*v*<sup>2</sup> .

**Proof of Theorem 3.** In this algorithm the biker uses a doubling strategy with maximum speed *v*. The hiker will follow the biker but will move <sup>2</sup>*<sup>k</sup> <sup>v</sup>* in each iteration instead of 2*k*. The biker will reach the exit first then will communicate with the hiker to proceed to the exit. The biker will go back distance *<sup>d</sup>* <sup>2</sup> <sup>−</sup> *<sup>d</sup>* <sup>2</sup>*<sup>v</sup>* to drop off the bike so that the hiker can pick it up on its way to the exit. We will justify why biker *R*<sup>1</sup> needs to move *<sup>d</sup>* <sup>2</sup> <sup>−</sup> *<sup>d</sup>* <sup>2</sup>*<sup>v</sup>* after reaching the exit to leave the bike for hiker *R*2.

After biker *R*<sup>1</sup> reaches the exit, there is no benefit to stay at the exit with the bike since hiker *R*<sup>2</sup> which is moving with unit speed can benefit from the bike to reach the exit faster. The key to find the distance *x* which is the distance between the exit and the point where the bike is dropped off is to have biker *R*1, drop it off at a point such that when it goes back to the exit it will reach the exit at the same time as hiker *R*2. If we consider that *d* is the distance from the origin to the exit and *x* is the distance from the exit to the point where biker *<sup>R</sup>*<sup>1</sup> drops off the bike, then we have *<sup>d</sup>* <sup>−</sup> *<sup>x</sup>* <sup>+</sup> *<sup>x</sup> <sup>v</sup>* <sup>=</sup> *<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>x</sup> <sup>v</sup>* <sup>+</sup> *<sup>x</sup>* which leads to *<sup>x</sup>* <sup>=</sup> *<sup>d</sup>* <sup>2</sup> <sup>−</sup> *<sup>d</sup>* 2*v* . This will guarantee that when the biker drops off the bike at distance *x*, it will reach the exit at the same time as the hiker. Hence we guarantee that the bike is not kept unnecessarily with the robot which reaches the exit first.

Assume that the exit is found during the *<sup>k</sup>*th iteration, then 2*k*−<sup>2</sup> <sup>&</sup>lt; *<sup>d</sup>* <sup>≤</sup> <sup>2</sup>*k*. We can calculate the evacuation time as follows:

$$\begin{split} T &= \frac{2 \cdot 2^0}{v} + \frac{2 \cdot 2^1}{v} + \dots + \frac{2 \cdot 2^{k-1}}{v} + d - \ge +\frac{\mathbf{x}}{v} \\ &= \frac{2(2^k - 1)}{v} + d - \mathbf{x} + \frac{\mathbf{x}}{v} \\ &= \frac{2^{k+1}}{v} - \frac{2}{v} + d - \frac{d}{2} + \frac{d}{2v} + \frac{d}{2v} - \frac{d}{2v^2} \\ &= \frac{2^{k+1}}{v} - \frac{2}{v} + \frac{d}{2} + \frac{d}{v} - \frac{d}{2v^2} \\ &\le 2^3 \cdot \frac{2^{k-2}}{v} - \frac{2}{v} + \frac{d}{2} + \frac{d}{v} - \frac{d}{2v^2} \\ &\le \frac{8d}{v} - \frac{2}{v} + \frac{d}{2} + \frac{d}{v} - \frac{d}{2v^2} \\ &\le \frac{9d}{v} + \frac{d}{2} - \frac{d}{2v^2} - \frac{2}{v} \\ &\le \frac{9d}{v} + \frac{d}{2} - \frac{d}{2v^2} \end{split}$$

This completes the proof of Theorem 3.

Figure 1 depicts and compares the performance of the three algorithms presented for the WiFi model.

**Figure 1.** Graph for the three algorithms using the wi-fi model. On high speed, the evacuation time for Algorithm 4 converges to *<sup>d</sup>* <sup>2</sup> versus 2*d* and *d* for Algorithms 2 and 3, respectively.

#### **4. Evacuation in the Face-to-Face (F2F) Model**

In this section we provide our main algorithms in the face-to-face communication model. Recall that in this model the hikers can exchange messages only if they occupy the same location at the same time.

#### *4.1. Slower Pursues Faster*

In the first Algorithm 5, we assume that the hiker will follow the biker. Since the biker is using a "doubling zig-zag" strategy, during any iteration, let us say the *k*-th one, the biker will reverse the direction after reaching 2*<sup>k</sup>* and will meet the hiker at some point *X*k. At the meeting point the hiker will reverse its direction. We notice from this that the hiker is following a deterministic strategy specified through a sequence of points *X*1, *X*2, ... , *Xk*, ... (to be defined later), where each *Xk* represents the meeting point for the hiker and the biker during the *k*-th iteration. In other words, the biker will follow a doubling strategy with factor 2*<sup>k</sup>* while the hiker will follow the sequence *X*1, *X*2, ... , *Xk*, ... above. When the biker reaches the exit, it will go back a certain distance *x*, which will be determined later, to drop off the bike and then will return back walking toward the exit.

In the algorithm below we use the parameters *<sup>a</sup>* :<sup>=</sup> <sup>1</sup> <sup>−</sup> *<sup>v</sup>* <sup>1</sup> <sup>+</sup> *<sup>v</sup>* , *<sup>b</sup>* :<sup>=</sup> <sup>1</sup> <sup>1</sup> <sup>+</sup> *<sup>v</sup>* . Further, we assume that *R*<sup>1</sup> is the biker and *R*<sup>2</sup> is the hiker.

**Theorem 4.** *The evacuation time for Algorithm 5 using the F2F model is at most* <sup>9</sup>*<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>d</sup>* <sup>−</sup> <sup>5</sup>*<sup>d</sup>* <sup>8</sup>*v*<sup>2</sup> .

**Proof of Theorem 4.** In order to find the sequence {*X*1, *X*<sup>2</sup> ... *Xk*}, we argue as follows. During the 1st iteration, in order to calculate *X*1, we know that the biker will move 20 to reach the peak point and then will come back 2<sup>0</sup> <sup>−</sup> *<sup>X</sup>*<sup>1</sup> with speed *<sup>v</sup>* to reach point *<sup>X</sup>*<sup>1</sup> while the hiker will move *<sup>X</sup>*<sup>1</sup> with unit speed during the same time. Given that *<sup>a</sup>* <sup>=</sup> <sup>1</sup> <sup>−</sup> *<sup>v</sup>* <sup>1</sup> <sup>+</sup> *<sup>v</sup>* and *<sup>b</sup>* <sup>=</sup> <sup>1</sup> <sup>1</sup> <sup>+</sup> *<sup>v</sup>* , we have the following:

$$X\_1 = \frac{2^0}{v} + \frac{2^0}{v} - \frac{X\_1}{v} \implies X\_1 = \frac{2}{1+v} = 2 \cdot b$$


During the 2nd iteration we have the following:

$$\begin{aligned} X\_1 + X\_2 &= \frac{1}{v}(X\_1 + 2 + 2 - X\_2) \\ \implies X\_2 &= \frac{4}{1+v} + \frac{1-v}{1+v} \cdot X\_1 = a \cdot X\_1 + 2^2 \cdot b \end{aligned}$$

Since *<sup>X</sup>*<sup>2</sup> <sup>=</sup> *<sup>a</sup>* · *<sup>X</sup>*<sup>1</sup> <sup>+</sup> 22 · *<sup>b</sup>*, then for the *<sup>k</sup>*th iteration we have:

$$\mathbf{X}\_k = a \cdot \mathbf{X}\_{k-1} + \mathbf{2}^k \cdot b^k$$

Replacing *Xk*−<sup>1</sup> <sup>=</sup> *<sup>a</sup>* · *Xk*−<sup>2</sup> <sup>+</sup> *<sup>b</sup>* · <sup>2</sup>*k*−<sup>1</sup> in the above equation gives

$$X\_k = a(a \cdot X\_{k-2} + b \cdot 2^{k-1}) + 2^k \cdot b^k$$

Similarly replacing *Xk*−<sup>2</sup> <sup>=</sup> *<sup>a</sup>* · *Xk*−<sup>3</sup> <sup>+</sup> *<sup>b</sup>* · <sup>2</sup>*k*−<sup>2</sup> gives

$$X\_k = a^3 \cdot X\_{k-3} + a^2 \cdot 2^{k-2} \cdot b + a \cdot b \cdot 2^{k-1} + 2^k \cdot b$$

Recursing down to *X*<sup>1</sup> leads to the following calculation:

$$\begin{aligned} X\_k &= b \cdot 2^k \left( \left(\frac{a}{2}\right)^0 + \dots + \left(\frac{a}{2}\right)^{k-1} \right) \\ &= \frac{b \cdot 2^k (1 - (\frac{a}{2})^k)}{1 - \frac{a}{2}} \\ &= \frac{2 \cdot b (2^k - a^k)}{2^k (2 - a)} \cdot 2^k \cdot b \\ &= \frac{2 \cdot b (2^k - a^k)}{2 - a} \end{aligned}$$

Assume that the exit is found during the *k*th iteration of the algorithm. Before writing down the evacuation time, let us find the distance *x* away from the exit, where the bike will be dropped off by the biker. We know that the biker and the hiker will meet at each entry of the sequence and eventually they will meet at *Xk*−1.

• Define *T*<sup>1</sup> to be the time needed by the biker to go to the exit from the point of intersection between the the biker and the hiker at *Xk*−<sup>1</sup> then to return distance *x* to drop off the bike and subsequently go back to the exit. Thus *T*<sup>1</sup> can be defined as follows:

$$T\_1 = \frac{1}{\upsilon}(X\_{k-1} + x + d) + x.$$

• Define *T*<sup>2</sup> to be the time needed by the hiker to go from the point of intersection between the hiker and the biker at *Xk*−<sup>1</sup> to the exit while picking up the bike on its way. Thus *T*<sup>2</sup> can be defined as follows:

$$T\_2 = X\_{k-1} + d - \mathbf{x} + \frac{\mathbf{x}}{\upsilon}.$$

The best thing that the biker can do is to drop off the bike and arrive at the same time to the exit with the hiker who will pick up the bike on its way. This can be achieved by having *T*<sup>1</sup> = *T*2. In turn, this yields

$$\frac{1}{\upsilon}(X\_{k-1} + x + d) + x = X\_{k-1} + d - x + \frac{x}{\upsilon}$$

$$\implies x = \frac{1}{2}(X\_{k-1} + d) - \frac{1}{2\upsilon}(d + X\_{k-1})$$

Thus, the evacuation time *T* can be written as follows:

$$T = \frac{1}{v}(2 \cdot 2^0 + 2 \cdot 2^1 + \dots + 2 \cdot 2^{k-1}) + \frac{d}{v} + \frac{\mathbf{x}}{v} + \mathbf{x}$$

Replacing the value of *x* which was calculated above gives:

$$\begin{aligned} T &= \frac{2}{v}(2^k - 1) + \\ \frac{d}{v} + \frac{d}{2v} - \frac{d}{2v^2} + \frac{d}{2} - \frac{d}{2v} + \frac{1}{2v} \mathcal{X}\_{k-1} - \frac{1}{2v} \mathcal{X}\_{k-1} + \frac{1}{2} \mathcal{X}\_{k-1} - \frac{1}{2v^2} \mathcal{X}\_{k-1} \\ &= \frac{2^{k+1}}{v} - \frac{2}{v} + \frac{d}{v} + \frac{d}{2} - \frac{d}{2v^2} + \left(\frac{1}{2} - \frac{1}{2v^2}\right) \mathcal{X}\_{k-1} \end{aligned}$$

Now recall that *Xk*−<sup>1</sup> <sup>=</sup> <sup>2</sup>*b*(2*k*−1−*ak*−1) −*<sup>a</sup>* , where *<sup>a</sup>* <sup>=</sup> <sup>1</sup>−*<sup>v</sup>* <sup>1</sup>+*<sup>v</sup>* and *<sup>b</sup>* <sup>=</sup> <sup>1</sup> +*<sup>v</sup>* . Since −1 < *a* < 0 and 0 <sup>&</sup>lt; *<sup>b</sup>* <sup>≤</sup> <sup>1</sup> it is obvious that *Xk*−<sup>1</sup> <sup>≤</sup> <sup>1</sup> (2*k*−<sup>1</sup> <sup>+</sup> <sup>1</sup>) = <sup>2</sup>*k*−<sup>2</sup> <sup>+</sup> <sup>1</sup> . Moreover, knowing that *k*−<sup>2</sup> <sup>&</sup>lt; *<sup>d</sup>* <sup>≤</sup> <sup>2</sup>*k*, the evacuation time T can be simplified as follows:

$$\begin{split} T &\leq \frac{2^{k+1}}{v} - \frac{2}{v} + \frac{d}{v} + \frac{d}{2} - \frac{d}{2v^2} + (\frac{1}{2} - \frac{1}{2v^2})(2^{k-2} + \frac{1}{2}) \\ &\leq \frac{2^{k+1}}{v} - \frac{2}{v} + \frac{d}{v} + \frac{d}{2} - \frac{d}{2v^2} + 2^{k-3} + \frac{1}{4} - \frac{2^{k-2}}{2v^2} - \frac{1}{4v^2} \\ &\leq \frac{8d}{v} - \frac{2}{v} + \frac{d}{v} + \frac{d}{2} - \frac{d}{2v^2} + \frac{d}{2} + \frac{1}{4} - \frac{d}{8v^2} - \frac{1}{4v^2} \\ &\leq \frac{9d}{v} + d - \frac{5d}{8v^2} - \frac{1}{4v^2} + \frac{1}{4} - \frac{2}{v} \\ &\leq \frac{9d}{v} + d - \frac{5d}{8v^2} \end{split}$$

This completes the proof of Theorem 4.

#### *4.2. Slower Evacuation Close to Exit without Aid*

In the second Algorithm 6, the biker uses a "doubling zig-zag" strategy with its maximum speed *v*, while the hiker will try to be as close as possible to the biker. In order to achieve that, the hiker will use a doubling strategy as well but will use its own "expansion" factor. The factor will be determined based on the fact that both the hiker and the biker should meet at a specific point during each iteration. These meeting points will form a

sequence whose *k*-th element during iteration *k* is taken to be equal to <sup>2</sup>*k*+<sup>2</sup> <sup>3</sup>*v*+<sup>1</sup> . During the last iteration, when the biker finds the exit, the hiker will eventually reach the meeting point and will not find the biker there. This will let it know that it should keep going toward the exit. Assuming that initially *R*<sup>1</sup> is the biker and *R*<sup>2</sup> is the hiker, the algorithm will be as follows:


**Theorem 5.** *The evacuation time for Algorithm 6 using the F2F model is at most* <sup>3</sup>*dv*<sup>3</sup> <sup>+</sup> <sup>63</sup>*dv*<sup>2</sup> <sup>+</sup> <sup>15</sup>*dv* <sup>−</sup> <sup>9</sup>*<sup>d</sup>* <sup>2</sup>*v*2(3*<sup>v</sup>* <sup>+</sup> <sup>1</sup>) *.*

**Proof of Theorem 5.** The biker is using a doubling strategy and is moving 2*<sup>k</sup>* during each iteration *k*. The hiker will use a doubling strategy as well and it will follow the biker. In order to keep the hiker as close as possible to the biker, we must find the sequence that the hiker should follow. We assume that both the hiker and the biker meet at a certain point *Xk* and that they are willing to meet at point *Xk*<sup>+</sup><sup>1</sup> at the same time without waiting for one another, taking into consideration that *Xk*<sup>+</sup><sup>1</sup> = 2*Xk*. The sequence can be calculated as follows:

$$\begin{aligned} X\_k + X\_{k+1} &= \frac{1}{v} (X\_k + 2^{k+1} + 2^{k+1} - X\_{k+1}) \\ \implies X\_k + 2X\_k &= \frac{1}{v} (X\_k + 2^{k+1} + 2^{k+1} - 2X\_k) \\ \implies \frac{3v+1}{v} X\_k &= \frac{2^{k+2}}{v} \\ \implies X\_k &= \frac{2^{k+2}}{3v+1} \end{aligned}$$

We have the sequence {*X*0, *<sup>X</sup>*1, ... , *Xk*} given that *Xk* <sup>=</sup> <sup>2</sup>*k*+<sup>2</sup> <sup>3</sup>*v*+<sup>1</sup> where *k* ≥ 1. Each of the hiker and the biker will use its own doubling strategy. During each iteration, they will meet on both sides at specific points which are elements of the above sequence. During the *k*th iteration, when the biker reaches the exit, it will move back distance *x* to drop off the bike such that the hiker can pick it up and reach the exit at the same time as itself. The distance *x* can be calculated as follows: *<sup>d</sup> <sup>v</sup>* <sup>+</sup> <sup>1</sup> *<sup>v</sup>* · *Xk*−<sup>1</sup> <sup>+</sup> *<sup>x</sup> <sup>v</sup>* <sup>+</sup> *<sup>x</sup>* <sup>=</sup> *<sup>d</sup>* <sup>+</sup> *Xk*−<sup>1</sup> <sup>−</sup> *<sup>x</sup>* <sup>+</sup> *<sup>x</sup> <sup>v</sup>* . Substituting *Xk*−<sup>1</sup> this becomes *<sup>d</sup> <sup>v</sup>* <sup>+</sup> <sup>2</sup>*k*+<sup>1</sup> *<sup>v</sup>*(3*<sup>v</sup>* <sup>+</sup> <sup>1</sup>) <sup>+</sup> *<sup>x</sup> <sup>v</sup>* <sup>+</sup> *<sup>x</sup>* <sup>=</sup> *<sup>d</sup>* <sup>+</sup> <sup>2</sup>*k*+<sup>1</sup> <sup>3</sup>*<sup>v</sup>* <sup>+</sup> <sup>1</sup> <sup>−</sup> *<sup>x</sup>* <sup>+</sup> *<sup>x</sup> <sup>v</sup>* Solving for *x*, the last equation yields *x* = *<sup>d</sup>* <sup>2</sup> <sup>−</sup> *<sup>d</sup>* <sup>2</sup>*<sup>v</sup>* <sup>+</sup> <sup>2</sup>*<sup>k</sup>* (*<sup>v</sup>* <sup>−</sup> <sup>1</sup>) *<sup>v</sup>*(3*<sup>v</sup>* <sup>+</sup> <sup>1</sup>). Assuming that 2*k*−<sup>2</sup> <sup>&</sup>lt; *<sup>d</sup>* <sup>≤</sup> <sup>2</sup>*<sup>k</sup>* and replacing *<sup>x</sup>* which was calculated above, the evacuation time T can be computed as follows:

$$\begin{split} T &= \frac{1}{v} (2 \cdot 2^0 + 2 \cdot 2^1 + \cdots + 2 \cdot 2^{k-1}) + \frac{d}{v} + \frac{x}{v} + x \\ &= \frac{2}{v} (2^k - 1) + \frac{d}{v} + \frac{x}{v} + x \\ &= \frac{2^{k+1}}{v} - \frac{2}{v} + \frac{d}{v} + \frac{x}{v} + x \\ &= \frac{2^{k+1}}{v} - \frac{2}{v} + \frac{d}{v} + \frac{d}{2v} - \frac{d}{2v^2} + \frac{2^k(v-1)}{v^2(3v+1)} + \frac{d}{2} - \frac{d}{2v} + \frac{2^k(v-1)}{v(3v+1)} \\ &\le \frac{16d}{2v} - \frac{2}{v} + \frac{d}{v} + \frac{d}{2} - \frac{d}{2v^2} + \frac{4d(v-1)}{v^2(3v+1)} + \frac{4d(v-1)}{v(3v+1)} \\ &\le \frac{18d}{2v} + \frac{d}{2} - \frac{d}{2v^2} + \frac{4d(v-1)}{v^2(3v+1)} + \frac{4d(v-1)}{v(3v+1)} - \frac{2}{v} \\ &\le \frac{54dv^2 + 18dv + 3dv^3 + dv^2 - 3dv - d + 8vd - 8d + 8dv^2 - 8dv - \frac{2}{v}}{2v^2(3v+1)} \\ &\le \frac{3dv^3 + 63dv^2 + 15dv - 9d}{2v^2(3v+1)} - \frac{2}{v} \\ &\le \frac{3dv^3 + 63dv^2 + 15dv - 9d}{2v^2(3v+1)} \end{split}$$

This completes the proof of Theorem 5.

#### *4.3. Nearest Meeting to Exit*

In order to reduce the evacuation time, it is more suitable for the biker to search for the exit while the hiker follows a "doubling zig-zag" strategy that will keep it as close as possible to the biker and will expedite its travel time to the exit during the last iteration of the evacuation algorithm. In order to achieve that, the purpose of the next algorithm will be to find this deterministic doubling strategy that the hiker should follow. Assuming that *R*<sup>1</sup> is the biker and *R*<sup>2</sup> is the hiker, Algorithm 7 will be as follows.


**Theorem 6.** *The evacuation time for Algorithm 7 using the F2F model is upper bounded by*

$$\begin{aligned} 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{5v^2 - 12v - 1}{v(v - 1)(3v - 1)}d & \quad \text{if } 1 < v \le \frac{6 + \sqrt{41}}{5} \\\ 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{4(5v^2 - 12v - 1)}{v(v - 1)(3v - 1)}d & \quad \text{if } \frac{6 + \sqrt{41}}{5} \le v \end{aligned}$$

**Proof of Theorem 6.** Let us consider the sequence:*X* = {*X*1, *X*2, *X*3, ... , *Xk*}, where *Xk* = *<sup>r</sup>* · *Xk*−1. The purpose is to find the best value of *<sup>r</sup>* which is the factor related to the doubling strategy that the hiker follows. Definitely the best meeting point would be the peak point reached by the hiker during each iteration, since it will be the closest to the exit. Assume that both the hiker and the biker meet at some point *Xk*−<sup>1</sup> during the *k* − 1 iteration and they are willing to meet during the *k*-th iteration without waiting for one another, then we have:

$$X\_{k-1} + X\_k = \frac{1}{v} \cdot (2^{k-1} - X\_{k-1}) + \frac{2^{k-1}}{v} + \frac{X\_k}{v}$$

and after substituting *Xk*

$$X\_{k-1} + r \cdot X\_{k-1} = \frac{1}{v} \cdot (2^{k-1} - X\_{k-1}) + \frac{2^{k-1}}{v} + \frac{r}{v} \cdot X\_{k-1}.$$

In turn, this implies

$$\begin{aligned} &(r+1)\cdot X\_{k-1} = \frac{2^k}{v} + \frac{r-1}{v} \cdot X\_{k-1} \\ &\implies r \cdot v \cdot X\_{k-1} + v \cdot X\_{k-1} - r \cdot X\_{k-1} + X\_{k-1} = 2^k \\ &\implies X\_{k-1} = \frac{2^k}{r \cdot v + v - r + 1} \end{aligned}$$

Similarly we have *Xk* <sup>=</sup> <sup>2</sup>*k*+<sup>1</sup> *<sup>r</sup>*·*<sup>v</sup>* <sup>+</sup> *<sup>v</sup>* <sup>−</sup> *<sup>r</sup>* <sup>+</sup> <sup>1</sup> . Consider *Xk* <sup>=</sup> *<sup>r</sup>* · *Xk*−1, then we can deduce that *<sup>r</sup>* <sup>=</sup> 2. Substituting *<sup>r</sup>* <sup>=</sup> 2 gives *Xk* <sup>=</sup> <sup>2</sup>*k*+<sup>1</sup> <sup>3</sup>*<sup>v</sup>* <sup>−</sup> <sup>1</sup> . So we conclude that the hiker will use doubling strategy and will follow the sequence *<sup>X</sup>* <sup>=</sup> { <sup>4</sup> <sup>3</sup>*<sup>v</sup>* <sup>−</sup> <sup>1</sup> , <sup>8</sup> <sup>3</sup>*<sup>v</sup>* <sup>−</sup> <sup>1</sup> , ... , <sup>2</sup>*k*+<sup>1</sup> <sup>3</sup>*<sup>v</sup>* <sup>−</sup> <sup>1</sup> }. Assume that *R*<sup>1</sup> is the biker which moves with speed *v* and *R*<sup>2</sup> is the hiker which moves with unit speed. Consider *d* = <sup>2</sup>*k*+<sup>1</sup> <sup>3</sup>*<sup>v</sup>* <sup>−</sup> <sup>1</sup> <sup>+</sup> *<sup>e</sup>* where *<sup>e</sup>* <sup>≥</sup> 0. Definitely *<sup>R</sup>*<sup>1</sup> will reach the exit before *<sup>R</sup>*2. Since the exit is at distance *e* from the meeting point, then from that point on, *R*<sup>1</sup> needs time *<sup>e</sup> <sup>v</sup>* to reach the exit. During this time, *R*<sup>2</sup> will be at distance *e* on the other side of the meeting point. Therefore, when *R*<sup>1</sup> reaches the exit, *R*<sup>2</sup> will be at distance *e* + *<sup>e</sup> <sup>v</sup>* <sup>=</sup> *<sup>e</sup> <sup>v</sup>* <sup>+</sup> <sup>1</sup> *<sup>v</sup>* away from the exit. The distance *z* that hiker *R*<sup>2</sup> moves from the point where *R*<sup>1</sup> reaches the exit till the point it meets *R*<sup>1</sup> will be as follows:

$$\begin{aligned} z &= \frac{\mathfrak{c}(v+1)}{v^2} + \frac{z}{v} \\ \implies \frac{z(v-1)}{v} &= \frac{\mathfrak{c}(v+1)}{v^2} \\ \implies z &= \frac{v+1}{v-1} \cdot \frac{\mathfrak{c}}{v} \end{aligned}$$

Therefore, when biker *R*<sup>1</sup> reaches hiker *R*<sup>2</sup> to inform it about the exit, *R*<sup>2</sup> will be far from the exit by a distance *<sup>x</sup>* <sup>=</sup> *<sup>v</sup>* <sup>+</sup> <sup>1</sup> *<sup>v</sup>* <sup>−</sup> <sup>1</sup> · *<sup>e</sup> <sup>v</sup>* <sup>+</sup> *<sup>e</sup> <sup>v</sup>* <sup>+</sup> <sup>1</sup> *<sup>v</sup>* . Now it is required to find at what distance *y* away from the exit should biker *R*<sup>1</sup> drop off the bike so that hiker *R*<sup>2</sup> can pick it up and proceed to the exit and reach it at the same time as *R*1. After we find out the distance *y*, we will go back to create the algorithm for the two hikers with a bike model. In order to find out the distance *y* we have the following:

$$\frac{\mathbf{x}}{\upsilon} - \frac{\mathbf{y}}{\upsilon} + \mathbf{y} = \mathbf{x} - \mathbf{y} + \frac{\mathbf{y}}{\upsilon}$$

$$\implies \frac{\mathbf{x}}{\upsilon} - \frac{\mathbf{y}}{\upsilon} + 2\mathbf{y} = \mathbf{x} + \frac{\mathbf{y}}{\upsilon}$$

$$\implies y(2\upsilon - 2) = x(\upsilon - 1)$$

$$\implies y = \frac{\mathbf{x}(\upsilon - 1)}{2(\upsilon - 1)} = \frac{\mathbf{x}}{2}$$

The evacuation time *T* can be calculated as follows:

$$\begin{split} T &= \frac{2 \cdot 2^0 + 2 \cdot 2^1 + \dots + 2 \cdot 2^{k-1}}{\upsilon} + \frac{d}{\upsilon} + \frac{x}{\upsilon} + \frac{y}{\upsilon} + y \\ &= \frac{2(2^k - 1)}{\upsilon} + \frac{d}{\upsilon} + \frac{x}{\upsilon} + \frac{x}{2\upsilon} + \frac{x}{2} \\ &= \frac{2^{k+1}}{\upsilon} - \frac{2}{\upsilon} + \frac{d}{\upsilon} + \frac{3}{2\upsilon}(\varepsilon + \frac{\varepsilon}{\upsilon} + \frac{\upsilon + 1}{\upsilon - 1} \cdot \frac{\varepsilon}{\upsilon}) + \frac{1}{2}(\varepsilon + \frac{\varepsilon}{\upsilon} + \frac{\upsilon + 1}{\upsilon - 1} \cdot \frac{\varepsilon}{\upsilon}) \end{split}$$

)

Since *d* = *e* + <sup>2</sup>*k*+<sup>1</sup> <sup>3</sup>*v*−<sup>1</sup> , replacing <sup>2</sup>*k*+<sup>1</sup> *<sup>v</sup>* <sup>=</sup> <sup>3</sup>*<sup>d</sup>* <sup>−</sup> <sup>3</sup>*<sup>e</sup>* <sup>−</sup> *<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>e</sup> <sup>v</sup>* in the above equation gives the following:

$$\begin{split} T &= 3d - \frac{d}{v} - 3\epsilon + \frac{\epsilon}{v} - \frac{2}{v} + \frac{d}{v} + \frac{3\epsilon}{2v} + \frac{3\epsilon}{2v^2} + \frac{3\epsilon (v+1)}{2v^2(v-1)} + \frac{\epsilon}{2} + \frac{\epsilon}{2v} + \frac{\epsilon(v+1)}{2v(v-1)} \\ &= 3d - \frac{2}{v} + \frac{3\epsilon}{v} - \frac{5\epsilon}{2} + \frac{3\epsilon}{2v^2} + \frac{3\epsilon v + 3\epsilon + \epsilon v^2 + \epsilon v}{2v^2(v-1)} \\ &= 3d - \frac{2}{v} + \frac{3\epsilon}{v} - \frac{5\epsilon}{2} + \frac{3\epsilon}{2v^2} + \frac{\epsilon v^2 + 4\epsilon v + 3\epsilon}{2v^2(v-1)} \\ &= 3d - \frac{2}{v} + \epsilon \cdot \frac{6v^2 - 6v - 5v^3 + 5v^2 + 3v - 3 + v^2 + 4v + 3}{2(v-1)v^2} \\ &= 3d - \frac{2}{v} - \epsilon \cdot \frac{5v^2 - 12v - 1}{2v(v-1)} \\ &= 3d - \frac{2}{v} - \frac{5v^2 - 12v - 1}{2v(v-1)} (d - \frac{2^{k+1}}{3v-1}) \\ &= 3d - d \cdot \frac{5v^2 - 12v - 1}{2v(v-1)} + 2^k \frac{5v^2 - 12v - 1}{v(v-1)(3v-1)} - \frac{2}{v} \end{split}$$

There are two cases to consider here:

*Case 1*: 1 <sup>&</sup>lt; *<sup>v</sup>* <sup>≤</sup> <sup>6</sup><sup>+</sup> <sup>√</sup><sup>41</sup> <sup>5</sup> . Since 5*v*<sup>2</sup> <sup>−</sup> <sup>12</sup>*<sup>v</sup>* <sup>−</sup> <sup>1</sup> <sup>≤</sup> 0 and *<sup>d</sup>* <sup>≤</sup> <sup>2</sup>*<sup>k</sup>* we have that

$$\begin{aligned} T &\le 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{5v^2 - 12v - 1}{v(v - 1)(3v - 1)}d - \frac{2}{v} \\ &\le 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{5v^2 - 12v - 1}{v(v - 1)(3v - 1)}d \end{aligned}$$

*Case 2*: <sup>6</sup><sup>+</sup> <sup>√</sup><sup>41</sup> <sup>5</sup> ≤ *v*. Since 0 <sup>≤</sup> <sup>5</sup>*v*<sup>2</sup> <sup>−</sup> <sup>12</sup>*<sup>v</sup>* <sup>−</sup> 1 and 2*k*−<sup>2</sup> <sup>≤</sup> *<sup>d</sup>* we conclude that

$$\begin{aligned} T &\le 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{5v^2 - 12v - 1}{v(v - 1)(3v - 1)} \cdot 2^2 \cdot 2^{k - 2} - \frac{2}{v} \\ &\le 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{4(5v^2 - 12v - 1)}{v(v - 1)(3v - 1)}d - \frac{2}{v} \\ &\le 3d - \frac{5v^2 - 12v - 1}{2v(v - 1)}d + \frac{4(5v^2 - 12v - 1)}{v(v - 1)(3v - 1)}d \end{aligned}$$

This completes the proof of Theorem 6.

Figure 2 depicts and compares the performance of the three algorithms presented for the face-to-face model.

**Figure 2.** Graph for the three algorithms using the face-to-face model. On high speed, the evacuation time for Algorithm 7 converges to *<sup>d</sup>* <sup>2</sup> . The same is for Algorithm 6 versus *d* for Algorithm 5.

#### **5. Lower Bounds**

In this section we establish lower bounds on the competitive ratio in the WiFi and F2F models. Using bike sharing, first we prove a tight bound on the evacuation time when the robots know in which direction from the origin the exit is. Note that Theorem 7 can readily be used to compute the competitive ratio of the algorithms presented in Sections 3 and 4.

**Theorem 7.** *If the direction of the exit is known to the robots then evacuation time is <sup>v</sup>* <sup>+</sup> <sup>1</sup> <sup>2</sup>*<sup>v</sup>* · *<sup>d</sup> and this is optimal.*

**Proof of Theorem 7.** Consider the algorithm whereby robot *R*<sup>1</sup> rides the bike for a distance *x*, releases the bike at *x* and continues by walking the remaining distance *d* − *x*, while robot *R*<sup>2</sup> walks for a distance *x*, picks up the bike at *x* and rides it for the remaining distance *<sup>d</sup>* <sup>−</sup> *<sup>x</sup>*. Note that robot *<sup>R</sup>*<sup>1</sup> reaches the exit at time *<sup>x</sup> <sup>v</sup>* + *d* − *x*, while robot *R*<sup>2</sup> reaches the exit at time *<sup>x</sup>* <sup>+</sup> *<sup>d</sup>* <sup>−</sup> *<sup>x</sup> <sup>v</sup>* . For the two robots to arrive at the same time it is required that *x <sup>v</sup>* <sup>+</sup> *<sup>d</sup>* <sup>−</sup> *<sup>x</sup>* <sup>=</sup> *<sup>x</sup>* <sup>+</sup> *<sup>d</sup>* <sup>−</sup> *<sup>x</sup> <sup>v</sup>* , which solves for *<sup>x</sup>* <sup>=</sup> *<sup>d</sup>* <sup>2</sup> . Hence, the algorithm ensures that the two robots evacuate in time <sup>1</sup> <sup>2</sup> <sup>+</sup> <sup>1</sup> <sup>2</sup>*<sup>v</sup>* <sup>=</sup> *<sup>v</sup>* <sup>+</sup> <sup>1</sup> <sup>2</sup>*<sup>v</sup>* .

Next we prove that the evacuation time above is optimal. If the robots never share the bike then the evacuation time will be *d*, which is also the arrival time of the slowest robot. So we may assume the robots share the bike. Let *ti* be the termination time for robot *Ri* in an optimal algorithm. Let *xi* be the distance that robot *Ri* rides the bike. Without loss of generality let *R*<sup>1</sup> be the robot that fetches the bike from the origin. Clearly, this takes time *<sup>x</sup>*<sup>1</sup> *<sup>v</sup>* <sup>+</sup> *<sup>d</sup>* <sup>−</sup> *<sup>x</sup>*1. Therefore *<sup>t</sup>*<sup>1</sup> <sup>≥</sup> *<sup>x</sup>*<sup>1</sup> *<sup>v</sup>* + *d* − *x*1. Similarly, for robot *R*<sup>2</sup> we have that *<sup>t</sup>*<sup>2</sup> <sup>≥</sup> *<sup>x</sup>*<sup>2</sup> *<sup>v</sup>* + *d* − *x*2. It follows that

$$\begin{aligned} \max \{ t\_1, t\_2 \} &\geq \frac{1}{2} \left( \frac{\mathbf{x}\_1}{v} + d - \mathbf{x}\_1 + \frac{\mathbf{x}\_2}{v} + d - \mathbf{x}\_2 \right) \\ &= d - \frac{\mathbf{x}\_1}{2} - \frac{\mathbf{x}\_2}{2} + \frac{\mathbf{x}\_1}{2v} + \frac{\mathbf{x}\_1}{2v} \\ &= d - (\mathbf{x}\_1 + \mathbf{x}\_2) \frac{v - 1}{2v} \\ &\geq d - \frac{v - 1}{2v} \cdot d = \frac{v + 1}{2v} \cdot d, \end{aligned}$$

where in the last inequality we used the fact that *x*<sup>1</sup> + *x*<sup>2</sup> ≤ *d*, since by assumption only one robot can ride the bike at a time. This completes the proof of Theorem 7.

Using Theorem 7 we can prove the following result.

**Theorem 8.** *The evacuation time of any algorithm in either the WiFi or F2F model is bounded from below by* min*<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>v</sup>* <sup>+</sup> <sup>1</sup> <sup>2</sup>*<sup>v</sup>* · *<sup>d</sup>*, *<sup>d</sup>* <sup>+</sup> *<sup>v</sup>* <sup>+</sup> <sup>1</sup> *<sup>v</sup>* · *<sup>d</sup>* .

**Proof of Theorem 8.** Assume the two robots are starting at the origin and that the exit is placed at one of the two locations ±*d* which are unknown to the robots. Lets call the points ±*d* endpoints of the interval [−*d*, +*d*]. Without loss of generality assume that −*d* is the first endpoint visited by a robot.There are two cases to consider depending on who is visiting this endpoint first.

*Case 1*: The biker visits −*d* first.

To arrive at the endpoint <sup>−</sup>*<sup>d</sup>* the biker has already spent time at least *<sup>d</sup> <sup>v</sup>* since he travels with speed *v*. At the time the biker arrives at −*d* the hiker may be located either in the subinterval [−*d*, 0] or in the subinterval [0, +*d*]. There are two subcases to consider depending on which of the two subintervals the hiker is located


Therefore regardless of the position of the hiker the evacuation time in this case is at least *<sup>d</sup> <sup>v</sup>* <sup>+</sup> *<sup>v</sup>* <sup>+</sup> <sup>1</sup> <sup>2</sup>*<sup>v</sup>* · *<sup>d</sup>*.

*Case 2*: The hiker visits −*d* first.

To arrive at the endpoint −*d* the hiker has already spent time *d* since he travels with speed *v*. As before, the adversary will place the exit at the other endpoint +*d*. Unaided from the bike the hiker will take additional time 2*d* to arrive at the exit which is located at +*d*. However, in the wireless model the hiker can announce the exit has been found and therefore the two robots can share the bike to arrive at the exit +*d*. In view of Theorem 7 this takes additional time at least *<sup>v</sup>*+<sup>1</sup> <sup>2</sup>*<sup>v</sup>* · <sup>2</sup>*<sup>d</sup>* <sup>=</sup> *<sup>v</sup>*+<sup>1</sup> *<sup>v</sup>* · *d*. Hence, in this case a lower bound on the evacuation time is *d* + *<sup>v</sup>*+<sup>1</sup> *<sup>v</sup>* · *d*.

Combining the two cases completes the proof of Theorem 8.

#### **6. Conclusions**

We proposed several evacuation algorithms in the wireless and face-to-face models. For each communication model we presented three algorithms which take advantage of the existence of the bike, a limited resource which can increase the search speed of the system of two robots. The resulting trajectories of the robots are specially designed so as to share the bike and ultimately reduce the overall evacuation time. We also discussed lower bounds.

The problem investigated is of theoretical nature and helps illuminate the trade offs between communication, and search time in search with mobile agents. Our study gives rise to several challenging open problems. For two robots, one could consider the problem when the speed of the bike depends on the hiker riding it. The case of multiple hikers and multiple bikes (not necessarily the same number) has never been investigated before. Additionally, one could also consider the case of faulty robots (crash or Byzantine). It would also be interesting to investigate other search domains such as stars and cycles or robots with reduced and/or enhanced capabilities.

**Author Contributions:** Conceptualization, K.J. and E.K.; methodology, K.J. and E.K.; resources, K.J. and E.K.; data curation, K.J. and E.K.; writing—original draft preparation, K.J. and E.K.; writing review and editing, K.J. and E.K.; supervision, K.J. and E.K.; project administration, K.J. and E.K.; funding acquisition, K.J. and E.K. All authors have read and agreed to the published version of the manuscript.

**Funding:** Research of the second author was supported in part by NSERC Discovery grant.

**Institutional Review Board Statement:** Not applicanle.

**Informed Consent Statement:** Not applicanle.

**Data Availability Statement:** Data sharing not applicable.

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

#### **References**


*Article*

## **A Multi-Objective Optimization Problem on Evacuating 2 Robots from the Disk in the Face-to-Face Model; Trade-Offs between Worst-Case and Average-Case Analysis †**

#### **Huda Chuangpishit, Konstantinos Georgiou \* and Preeti Sharma**

Department of Mathematics, Ryerson University, 350 Victoria St., Toronto, ON M5B 2K3, Canada; h.chuang@ryerson.ca (H.C.); preeti.sharma@ryerson.ca (P.S.)

**\*** Correspondence: konstantinos@ryerson.ca

† This paper is an extended version of our paper published in An extended abstract of this work appeared in the proceedings of the 14th International Symposium on Algorithms and Experiments for Wireless Sensor Networks (ALGOSENSORS'18), Helsinki, Finland, 23–24 August 2018.

Received: 7 September 2020; Accepted: 26 October 2020; Published: 29 October 2020

**Abstract:** The problem of evacuating two robots from the disk in the face-to-face model was first introduced by Czyzowicz et al. [DISC'2014], and has been extensively studied (along with many variations) ever since with respect to worst-case analysis. We initiate the study of the same problem with respect to average-case analysis, which is also equivalent to designing randomized algorithms for the problem. In particular, we introduce constrained optimization problem 2EVAC*F*2*F*, in which one is trying to minimize the average-case cost of the evacuation algorithm given that the worst-case cost does not exceed *w*. The problem is of special interest with respect to practical applications, since a common objective in search-and-rescue operations is to minimize the average completion time, given that a certain worst-case threshold is not exceeded, e.g., for safety or limited energy reasons. Our main contribution is the design and analysis of families of new evacuation parameterized algorithms which can solve 2EVAC*F*2*F*, for every *w* for which the problem is feasible. Notably, the worst-case analysis of the problem, since its introduction, has been relying on technical numerical, computer-assisted calculations, following tedious robot trajectory analysis. Part of our contribution is a novel systematic procedure, which given *any evacuation algorithm*, can derive its worst- and average-case performance in a clean and unified way.

**Keywords:** evacuation; disk; face-to-face model; average-case analysis

#### **1. Introduction**

In search-type problems, several searchers (robots or mobile agents) are moving within a domain with the objective to identify the location of a (hidden) item. Several variations have been introduced for the problem that range among others with respect to the domain, to searcher specs, to the termination criterion (definition of feasibility) and to the objective of the underlying optimization problem. When in particular there are more than one searchers, and the termination criterion is that *all* searchers reach the hidden item (also known as exit), then the search problem is usually referred to as an *evacuation-type problem*. The term was introduced recently by Czyzowicz et al. in [1] who studied the problem of locating a hidden item on the perimeter of the unit disk with at least two robots. Once all searchers reach the hidden item (hence the name of the problem), the cost of the solution was defined as the time that the last searcher reaches the item ( The termination criterion should not be confused with how the cost is quantified.). The problem was studied extensively also by subsequent publications exclusively under the lens of worst-case (competitive) performance, i.e., with the objective

to minimize the worst-case (over all placements of the hidden item) time that the last searcher reaches the exit. In contrast, real-life applications are usually concerned with minimizing the average-case performance of an algorithm, especially if one must solve several instances of the problem. In our case, evacuation-type problems resemble search-and-rescue operations where on one hand it is desirable to minimize the average rescue time, but on the other hand one has to set hard thresholds regarding the possible worst-case performance of the operations (for example, due to safety concerns of the missing person/hidden item).

As a result, we are motivated to revisit existing evacuation-type problems in the realm of average-case performance, where the feasibility criterion is altered so as to also comply with possible bounds on the worst-case performance. Alternatively, one may think of an evacuation-type problem (or even search-type problem) as the multi-objective problem of minimizing simultaneously the worst-case and the average-case cost of feasible evacuation algorithm. In this direction, we study the evacuation problem [1] under the lens of average-case analysis with hard constraints on the worst-case performance, i.e., we study average-case worst-case trade-offs for the underlying optimization problem. More specifically, we introduce new evacuation-type problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* with two searchers, in which the objective is to optimize the average-case evacuation time (or equivalently to minimize the performance of a randomized algorithm with unbounded access to randomness) condition on that the worst-case evacuation time does not exceed value *w*. The latter optimization problem seems to be particularly challenging in light of all previous results for the problem that relied on tedious calculations and/or on arguments tailored to the proposed algorithmic solutions. In that direction, we rely on a simple, novel and systematic theoretical approach that allows us to analyze the performance (both average-case and worst-case) of any evacuation algorithm based on computer-assisted calculations. Taking advantage of this approach, we introduce new families of algorithms for 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*. Interestingly, their worst-case analysis can be done rigorously, giving this way feasible evacuation protocols for the entire spectrum of values *w*. To motivate our results further, we also investigate the performance of existing algorithms of 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, and we actually show that our new algorithms indeed outperform them for many values of *w*.

#### *1.1. Related Work*

In search problems, robots (or commonly referred to as mobile agents or searchers) are equipped with the task of efficiently locating a hidden item in a geometric domain. Studied in many variations since the 1960s, see seminal results [2,3], search problems first focused on identifying optimal probabilistic search and hiding strategies. Several subsequent studies of search-variations gave rise to numerous publications, and eventually to surveys, e.g., [4,5], and books [6–9] that also coined the umbrella term Search Theory. Over the years, search problems were also studied under the lens (i) of exploration by single [10–13] or multiple robots [14–16], (ii) of terrain mapping [17–19] and (iii) of hide-and-seek and pursuit-evasion objectives, e.g., see [20–23].

Although the first reference to a theoretical evacuation problem seems to date back to [24,25], the problem we study follows the line of research of Czyzowicz et al. [1]. Among the many results reported in [1], the one relevant to the current paper pertains to searching with two unit-speed robots for an item/exit hidden at the perimeter of a unit circle. The two searchers operate in the so-called face-to-face model that does not allow exchange of information from distance, and their goal is to minimize the worst-case evacuation time, i.e., the worst-case (over all placements of the exit) time that the last searcher reaches the exit. The first reported upper bound of 5.73906 [1] used a basic evacuation algorithm, according to which robots choose an arbitrary point on the circle, search in opposite directions, while the exit finder detours once the exit is found in order to catch and notify her peer before the evacuate together from the exit. By analyzing the worst placement of the exit [26], improved the upper bound to 5.628 by introducing a carefully chosen detour, before even the exit was reported, that was meant to expedite the catching phase in case the exit was found in a critical time window. The detour trajectory was later simplified and coupled with an elegant performance

analysis that resulted in a further improvement of 5.625 [27]. Only recently, [28] reported yet another improvement of 5.6234, which was achieved by employing multiple detours. In contrast, the best lower bound known of 5.255 is due to [26], and no improvement has been reported since.

Since the inception of 2EVAC*F*2*<sup>F</sup>* in [1], numerous search and evacuation-type variants have emerged that studied different robot specs and/or number of searchers, different communication models, and different domains. Some notable examples include search and/or evacuation in the disk with more than 1 exits [29,30], in triangles [31,32], on multiple rays [33], in graphs [34,35], on a line with at least two robots [36,37] (generalizing the seminal result of [38]), with faulty robots [39–41] or with probabilistically faulty robots [42], with advice (information) [43], with priority specification on the searchers [44,45], with immobile agents [46,47], with time/energy trade-off requirements [48,49], with speed bounds [50], and with terrain dependent speeds [51], just to name some. The interested reader may also see the recent survey [52] that elaborates more on some selected topics.

In a different direction, Baeza-Yates et al. posed the question of minimizing the worst-case trajectory of a single robot searching for a target point at an unknown location in the plane [38]. This was generalized to multiple robots in [53], and later has been studied in [54,55]. More recently, Refs. [56,57] gave lower bounds for related problems. However, in these papers, the robots cannot communicate, and moreover, the objective is for the first robot to find the target.

#### *1.2. Discussion on Closely Related Literature and Improvements*

The problem of evacuating robots from the disc was first introduced in [1]. Among the many results reported in the latter paper, the one we expand upon is that of evacuating 2 robots in the face-to-face model. The algorithmic analysis was done exclusively in the deterministic model, and hence was worst-case. The reported upper bound of 5.628 was achieved by a simple algorithm, call it A, that deploys both robots in an arbitrary point on the perimeter of the unit disc, and then makes them search in different directions. When the exit is found, the finder follows the shortest trajectory (straight line) in order to catch the non-finder in her trajectory so that together they return to the exit.

The first improvement of [26] was motivated by the monotonicity of the cost of A as a function of the time that the exit is found. A careful analysis shows that the cost function is concave, with the maximizer corresponding to the placement of exit that induces the worst-case performance. The weakness of the underlying communication model is that the (potential) non-finder, call it *R*<sup>1</sup> has no way to know whether her peer, *R*<sup>2</sup> has found the exit. At the same time, if enough time has passed and if *R*<sup>1</sup> has not been caught (notified) by *R*2, then *R*<sup>1</sup> can deduce that her peer might have found the exit in the "dangerous" neighborhood of the placement inducing the worst-case cost, and hence *R*<sup>2</sup> might be already moving toward *R*<sup>1</sup> in order to notify her. As a result, *R*<sup>1</sup> has the incentive to deviate from searching the perimeter and to move toward the interior to expedite the (possible) rendezvous. Such a detour needs to be carefully chosen so that it is long enough to save cost in case the exit was indeed found in the dangerous neighborhood and short enough so that the detour does not add much in the cost in case it did not. Overall, the time that the detour occurs together with the direction and length of the detour give three degrees of freedom with an objective to optimize the cost in two different cases; when the exit is found in the "dangerous neighborhood" and when it is not. Call this (family of) algorithm(s) A0. The search space for choosing the three optimal parameters for A<sup>0</sup> is indeed enormous, and at a high level [26] considered only a restriction of the previous idea in which robots agree on a forced meeting on the diameter of the circle, effectively reducing the degrees of freedom of the algorithm but simplifying the already technical and theoretical analysis of its worst-case cost, which eventually relied on numerical calculations.

The upper bound was later improved to 5.625 in [27]. The novelty of the latter work pertained to the introduction of an elegant theoretical analysis of algorithms A0, which on one hand avoided the forced meeting and on the other improved upon the bound of [26] by choosing optimally its three parameters, which were eventually computed by numerical calculations. The authors of [27] further mentioned that their results could potentially be improved by introducing, at a high level, a recursively defined sequence of detour points aiming to address the reduction of the optimal worst-case cost, should the detour points were one less (so the improvement of A to A<sup>0</sup> can be thought as the basic step in the inductive argument). Indeed, ref. [28] used exactly that idea and reported a new upper bound of 5.6234.

Quite interestingly, all previous results pertaining to the worst-case analysis relied on arguments that were somehow tailored to the aforementioned algorithms (robot trajectories). In contrast, we provide a framework that allows us to compute, with computer-assisted calculations, the worst-case cost of any evacuation algorithm, as long as robot trajectories are described by unit-speed-inducing parameterized curves. It is the same framework that allows us also to also compute the average-case cost for any such algorithm.

The main improvement upon the previously results of the same problem pertains to minimizing the average-case cost. In one extreme, one can analyze the naive algorithm in which searchers always stay together, inducing very low average-case cost, but very high worst-case cost. In the other extreme, the optimal algorithm A<sup>0</sup> of [27] has very low worst-case cost (nearly the best known) and, according to our results, relatively high average-case cost. As a result, we are motivated to minimize the average-case cost, subject to the worst-case cost ranges between the cost of the naive algorithm that of the optimal A<sup>0</sup> (or equivalently to consider the multi-objective optimization problem of minimizing simultaneously the average-case cost and worst-case cost). Quite surprisingly, we verify, using our technical framework, that among the family of algorithms A0, the one inducing the minimum average-case cost is that of A. It is the latter observation that gives the main motivation for introducing the three new parameterized families of evacuation algorithms that attempt to minimize their average-case cost, inducing worst-case cost that range, continuously, over the two extreme worst-case costs.

#### *1.3. Outline of Our Results and Paper Organization*

We introduce and study a multi-objective analog of the well-studied problem of evacuating two robots from the disk, performing in the face-to-face communication mode. More specifically, we introduce evacuation problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* in which the two searchers need to evacuate in worst-case time no more than *w*, while still minimizing their average-case performance. One of our main contributions is a systematic method that allows us to perform both worst-case and average-case analysis for any evacuation algorithm that admits an analytic description. We apply our method to verify that previously known algorithms are not efficient (or not feasible) to 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, for certain values of *w*. As a result, we also motivate the introduction of three new families of evacuation algorithms that are feasible to 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* for a wide spectrum of values *w*, and that induce a continuous bound for the efficient (pareto) frontier for the underlying multi-objective optimization problem. For our results we employ a rigorous analysis for the worst-case performance of the new algorithms, and we rely on numerical computer-assisted calculations and on the aforementioned novel systematic method for estimating their average-case performance.

The formal definition of our problem, along with a high-level exposition of our results appears in Section 2.1. In Section 2.2 our cornerstone observation pertaining to a systematic process for computing the average-case (and worst-case) performance of any evacuation algorithm that admits a convenient representation (as described in Section 2.3). Then in Section 3 we analyze two basic (benchmark) algorithms for 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*. This allows us to motivate our problem for a range of *w* values that are related to the benchmark algorithms. In the same section, we also show that the families of previously proposed evacuation algorithms fail to be efficient for 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*. In Section 4 we present new families of evacuation algorithms, which is also one of our main contributions. For these algorithms we give a rigorous worst-case performance analysis in Section 5, and computer-assisted average-case performance analysis in Section 6, based upon our results in Section 2.2. The reader can also find in the

same section a formal quantification of our results for 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*. Lastly, in Section 7 we conclude by discussing our findings and propose some future directions.

#### **2. Preliminaries**

#### *2.1. Problem Definition and Main Results*

The geometric domain of 2EVAC*F*2*<sup>F</sup>* is a unit disk, centered at the origin of the Cartesian plane. Two unit-speed searchers, starting from the origin, can move anywhere in the disk, and aim to identify a hidden object (exit) located at its perimeter (boundary). The object can be identified only by co-located robot, i.e., a robot that passes over it.

The two robots search in parallel, and perform under a centralized setting, i.e., they know each other's trajectories under the assumption that no exit is found. The underlying communication model is the so-called face-to-face that does not allow robots to exchange messages from distance, rather only when they meet. A *feasible evacuation* algorithm is a pair of trajectories, one for each robot, in which for every placement of the exit, both robots reach it eventually. For a technical reason, but also without loss of generality, we also require that robots will eventually stay at the exit idle. Placements of the exit i.e., instances to our problem, will be identified by cycle(*x*) := (cos (*x*), sin (*x*)), where *x* ∈ [0, 2*π*). The evacuation time (cost) C(*x*) of a feasible evacuation algorithm on instance cycle(*x*) is defined as the first time until both robots reach the exit. t.

In this work we are concerned with determining trade-offs between the worst-case and the average-case performance (of uniform placements of the exit) of evacuation algorithms for 2EVAC*F*2*F*. More specifically, we say that an evacuation algorithm A with evacuation cost C(*x*) on instance cycle(*x*) is (*a*, *w*)*-efficient* if

$$\begin{aligned} \text{Avg}\left(\omega'\right) &:= \operatorname{E}\_{\pi \in [0, 2\pi)}\left[\mathcal{C}\left(\mathbf{x}\right)\right] \le a, \\ \text{Wrs}\left(\omega'\right) &:= \sup\_{\mathbf{x} \in [0, 2\pi)} \left\{\mathcal{C}\left(\mathbf{x}\right)\right\} \le w. \end{aligned}$$

where the expectation is with respect to the uniform distribution over [0, 2*π*). Special to our problem is that Avg (A ) can also be interpreted as the expected performance of a randomized algorithm based on A . Indeed, consider an algorithm which first performs a random rotation of the disk around the origin of angle *θ*, where *θ* is chosen uniformly at random from [0, 2*π*), and then simulates A . Please note that theoretically, this step requires infinitely many random bits, but one can simulate with any precision by enough many random bits. This random step is equivalent to choosing a deployment point uniformly at random on the disk. Due to the symmetry of the domain, it is irrelevant where the adversary will place the unique exit, and hence the expected performance of this randomized algorithm equals Avg (A ).

For algorithms A (*p*) parameterized by parameter(s) *p*, the pair (Avg (A (*p*)), Wrs (A (*p*))) will correspond to a subset of R<sup>2</sup> (and a curve if *p* is only one parameter) that we will refer to as the *Efficient Frontier*. We also adopt an optimization perspective of the problem, and we introduce the following optimization problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* on parameter *w*:

$$\begin{aligned} \min & \quad \frac{1}{2\pi} \int\_0^{2\pi} \mathcal{C}(\mathbf{x}) d\mathbf{x} \\ \text{s.t.} & \quad \mathcal{C}(\mathbf{x}) \le w, \; \forall \mathbf{x} \in [0, 2\pi). \end{aligned} \tag{2^{\text{EVAC}}\_{F2F}}$$

Please note that the problem above is equivalent to the multi-objective optimization problem min{Avg (A (*p*)),Wrs (A (*p*))}, and the conversion to the constrained problem above is due to the well-known -constraint method, e.g., see [58]. At the same time, no optimal lower bound is known for the worst-case cost in the case of unconstrained average-case cost, not to mention that lower bounds for similar problems are notoriously difficult. Consequently, under the current state-of-the-art it seems particularly challenging to determine the pareto frontier of the multi-objective optimization problem. Nevertheless, our arguments directly imply bounds for the pareto frontier.

As we show later, the values of *w* that make 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* interesting lie between some special values *w*1, *w*2. Values *w*1, *w*<sup>2</sup> are associated with benchmark algorithms, B1, B2, where in particular Wrs (B1) = *w*<sup>1</sup> ≈ 5.739, Avg (B1) = *a*<sup>1</sup> ≈ 5.1172,Wrs (B2) = *w*<sup>2</sup> ≈ 7.283, Avg (B1) = *a*<sup>2</sup> ≈ 7.28319. As a result, the reader may think of B<sup>1</sup> as being inefficient in average case and efficient in worst case. Similarly, B<sup>2</sup> is inefficient in worst case and efficient in average case.

As is the case for many variations of 2EVAC*F*2*F*, the cost of best solutions known are computed numerically. Our results pertain to upper bounds for a continuous spectrum of parameter *w* for problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*. In particular we propose families of algorithms A (over some parameters) so that as their parameters vary, we obtain Wrs (A ) = *w* and Avg (A ) = *g*(*w*), for each *w* ∈ [*w*1, *w*2]. The curve (*g*(*w*), *w*) summarizing our results is depicted in Figure 1, and it is later quantified in Theorem 7 (see Section 5).

**Figure 1.** Illustration of the performance of our solution to 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, for every *w* ∈ [*w*1, *w*2]. Depicted curve corresponds to parametric curve (*g*(*w*), *w*), where *w*, *g*(*w*) are the worst-case performance and average-case performance of three different families of evacuation algorithms A1, A <sup>2</sup> , A2, discussed formally in Section 4. Please note that the magenta curve is not a straight line and, as we show next, induces decreasing worst-case performance (as the average case performance increases).

Please note that an (*a*, *w*)-efficient algorithm gives a solution of value *a* for 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*. Our approach to prove Theorem 7 is to define families of evacuation algorithms A (*p*) parameterized by parameter(s) *p*. We will prove that these algorithms are (*u*(*p*), *v*(*p*))-efficient for some functions *u*(*p*), *v*(*p*), and in particular the evaluation of the worst-case performance will be exact and monotone in *p*, while the computation of *v*(*p*) will be computer-assisted. Then we will set *p* = *v*−1(*w*), and will be able to describe the average-case performance as a function of *w* as *g*(*w*) := *u*(*v*−1(*w*)).

#### *2.2. Computing Evacuation Times*

For any feasible evacuation algorithm, we denote by S(*x*), the first time, after spending time 1 to reach the perimeter that cycle(*x*) is visited by any robot. In other words, S(*x*) is the time robots spend searching till the exit is found for the first time, assuming that robots do not waste time in the interior of the circle before they start searching. Clearly, when a robot, say R1, locates the exit at cycle(*x*), it may attempt to catch R<sup>2</sup> while moving along R2's trajectory along the shortest line segment, say of length E(*x*). Once robots meet, they return together to cycle(*x*), inducing total evacuation cost C(*x*) = 1 + S(*x*) + 2E(*x*).

*Information* **2020**, *11*, 506

All existing results for 2EVAC*F*2*F*, from a worst-case complexity perspective, rely on numerical computer-assisted estimation of sup*<sup>x</sup>* C(*x*), after identifying properties of the maximizer. In this section, we elevate existing arguments, and we propose a generalized and unified approach for computing C(*x*), for any *x* and for any robot trajectories. For the sake of formality, as well as for practical purposes, robot trajectories will be defined by parametric functions <sup>F</sup>(*t*)=(*f*(*t*), *<sup>g</sup>*(*t*)), where *<sup>f</sup>* , *<sup>g</sup>* : <sup>R</sup> → <sup>R</sup> are continuous and piecewise differentiable. In particular, search protocols for the two robots will be given by trajectories R1(*t*), R2(*t*), where R*i*(*t*) will denote the position of robot R*<sup>i</sup>* at time *t* ≥ 0. Therefore, any evacuation algorithm will be identified by a tuple (R1, R2). To simplify notation, we will only determine the trajectories from the moment the two robots reach the perimeter of the circle, and until the entire circle is searched (under the assumption that no exit is found), and we will silently assume that robots stay put after exploration is over.

**Lemma 1.** *Consider instance* cycle(*x*) *of* 2EVAC*F*<sup>2</sup>*F, and suppose that for a feasible evacuation algorithm* (R1, <sup>R</sup>2)*, robot 1 is the first robot that finds the exit. Then* E(*x*) = ¯*<sup>t</sup>* − S(*x*)*, where* ¯*<sup>t</sup>* = ¯*t*(*x*) *is the smallest root, no less than* S(*x*)*, of function*

$$h\_x(t) := \left\| \mathcal{A}\_2(t) - \mathcal{A}\_1(\mathcal{S}(x)) \right\| - t + \mathcal{S}(x). \tag{1}$$

**Proof.** The reader may consult Figure 2 that complements our argument.

**Figure 2.** An abstract depiction of the trajectories of R1, R2, assuming that R<sup>1</sup> is the finder of the exit, located at cycle(*x*) at time S(*x*). Time ¯*<sup>t</sup>* is the time, after they start searching for the exit on the perimeter that the two robots meet at R1(¯*t*) = R2(¯*t*).

First observe that *hx*(*t*) is continuous. If the robots find the exit together then result holds trivially. So we may assume that that the two robots are not co-located when the exit is found, in which case we have *hx*(S(*x*)) > 0. At the same time, since the evacuation algorithm is feasible, R2(*t*) is eventually a constant, and hence for big enough *t* we have that *hx*(*t*) becomes eventually negative. By the mean value theorem, there is *t*<sup>0</sup> > 0 for which *hx*(*t*0) = 0.

Now consider the smallest positive root ¯*<sup>t</sup>* of *hx*, no less than S(*x*). At time ¯*t*, <sup>R</sup><sup>2</sup> is located at point <sup>R</sup>2(¯*t*), and it is R2(¯*t*) <sup>−</sup> <sup>R</sup>1(S(*x*)) away from the location cycle(*x*) of the discovered exit. At the same time, R<sup>1</sup> moves with speed 1 along the shortest path to catch R<sup>2</sup> in her trajectory. Hence it takes <sup>R</sup><sup>1</sup> some ¯*<sup>t</sup>* − S(*x*) extra time from the moment the exit is found until she reaches point <sup>R</sup>2(¯*t*). By definition we have <sup>R</sup>1(¯*t*) = <sup>R</sup>2(¯*t*), and therefore E(*x*) = ¯*<sup>t</sup>* − S(*x*) as claimed.

For some special trajectories, E(*x*) admits a simpler description that we describe next. Before that, we introduce some notation pertaining to a function *<sup>δ</sup>* : [0, *<sup>π</sup>*] → <sup>R</sup>+, which we widely use in the remaining of the paper:

$$\delta(\mathbf{x}) \coloneqq \text{ unique non-negative root (regarding } d) \text{ of } \, ''\, 2\sin\left(\mathbf{x} + \frac{d}{2}\right) = d \, ''. \tag{2}$$

To simplify notation, we will also abbreviate *δ*(*x*) by *δx*. To show that *δ<sup>x</sup>* is well-defined, consider function *fx*(*d*) = <sup>2</sup> sin *x* + *<sup>d</sup>* 2 − *d*. The derivative of the function is *f <sup>x</sup>*(*d*) = cos *x* + *<sup>d</sup>* <sup>2</sup> − 1 ≤ 0. Since *f <sup>x</sup>*(*d*) has also a unique root in [0, *π*], it follows that *fx*(*d*) is strictly decreasing. Observe now that *fx*(0) = 2 sin (*x*) ≥ 0, while *fx*(2) = 2 sin (*x* + 1) − 2 ≤ 0. We conclude that due to the strict monotonicity of *fx*(*d*), the latter function has indeed unique root in *d* ∈ [0, 2]. Finally, it is easy to see that *fx*(*d*) < 0 when *d* > 2.

**Lemma 2.** *For some instance* cycle(*x*) *of* 2EVAC*F*<sup>2</sup>*F, suppose that for a feasible evacuation algorithm* (R1, R2)*,* R<sup>1</sup> *is the finder of the exit, say at time t*<sup>0</sup> = S(*x*)*. Assume that both* R1(*t*0), R2(*t*0) *lie on the circle at arc distance* 2*α, and suppose that* R2*'s movement is along the perimeter of the circle toward the complementary arc of length* 2*π* − *α. Then,* E(*x*) = *δα.*

**Proof.** The lemma follows by applying transformation *t* − S(*x*) = *d* in the definition of *hx*(*t*) in Lemma 1, so that E(*x*) = *t* − S(*x*) = *d*.

We are ready to conclude with a corollary that will be handy for computing evacuation times numerically, and without relying on excessive case analysis, as was the case before.

**Corollary 1.** *Consider feasible evacuation algorithm* (R1, R2) *for* 2EVAC*F*<sup>2</sup>*F. For any instance* cycle(*x*) *for which* <sup>R</sup><sup>1</sup> *is the exit finder, the evacuation cost can be computed as* C(*x*) = <sup>1</sup> + 2¯*<sup>t</sup>* − S(*x*), *where* ¯*<sup>t</sup>* = ¯*t*(*x*) *is the smallest root, at least* S(*x*)*, of hx*(*t*) := R2(*t*) − R1(S(*x*)) − *t* + S(*x*)*.*

#### *2.3. Trajectory Description*

Robot trajectories will be described in phases. We will always omit the "deployment phase", i.e., the movement from the circle center to its perimeter, and we will only describe the trajectories from the moment robots start searching the circle. In each phase, robot R, will be moving between two explicit points, either along an arc, or along a line segment (chord of an arc), see Observations 1 and 2 below. We will summarize robot trajectories in tables of the following format.


To ease notation, trajectory R(*t*) of phase *i* will be described with parametric equations as if the time is reset to 0 after time *<sup>t</sup>*<sup>0</sup> + *<sup>t</sup>*<sup>1</sup> + *<sup>t</sup>*<sup>2</sup> + ... + *ti*−1, where *<sup>t</sup>*<sup>0</sup> = 1 (this is the time that robots reach the circle). The two fundamental trajectory components are movements along arcs and movements along line segments.

**Observation 1.** *Let b* ∈ [0, 2*π*) *and σ* ∈ {−1, 1}*. The trajectory of an object moving at speed 1 on the perimeter of a unit circle with initial location* cycle(*b*) *is given by the parametric equation* cycle(*σt* + *b*) = (cos (*σt* + *b*), sin (*σt* + *b*)). *If σ* = 1 *the movement is counterclockwise (ccw), and clockwise (cw) otherwise.*

**Proof.** It is immediate that when *t* = 1, the object is located at cycle(*b*). Its speed is given by calculating *∂ <sup>∂</sup><sup>t</sup>* cycle(*σt* + *b*) . Indeed, we have

$$\left(\frac{d}{dt}\cos\left(\sigma t + b\right)\right)^2 + \left(\frac{d}{dt}\sin\left(\sigma t + b\right)\right)^2 = \sigma^2 \left(-\sin\left(\sigma t + b\right)\right)^2 + \sigma^2 \left(\cos\left(\sigma t + b\right)\right)^2 = 1\_{\sigma}$$

as wanted.

**Observation 2.** *Consider distinct points A* = (*a*1, *a*2), *B* = (*b*1, *b*2) *in* R2*. The trajectory of a speed 1 object moving along the line passing through A*, *B and with initial position A is given by the parametric equation*

$$\text{lline}(A, B, t) := \left(\frac{b\_1 - a\_1}{||A - B||}t + a\_1, \frac{b\_2 - a\_2}{||A - B||}t + a\_2\right).$$

**Proof.** By definition, the parametric equation above corresponds to a line. Elementary calculations show that line(*A*, *B*, 0) = *A* and line(*A*, *B*, *A* − *B*) = *B*, that is the object starts at *A*, and that it passes through *B*. Object speed is calculated as *∂ <sup>∂</sup><sup>t</sup>* line(*A*, *B*, *t*) . In that direction we have

$$\left(\frac{d}{dt}\left(\frac{b\_1 - a\_1}{\|A - B\|}t + a\_1\right)\right)^2 + \left(\frac{d}{dt}\left(\frac{b\_2 - a\_2}{\|A - B\|}t + a\_2\right)\right)^2 = \left(\frac{b\_1 - a\_1}{\|A - B\|}\right)^2 + \left(\frac{b\_2 - a\_2}{\|A - B\|}\right)^2 = 1$$

as promised.

Finally, the analysis of our algorithm trajectories will give rise to several constants. For the reader's convenience, we list here the numerical values of the most common constants that will be encountered later. *w*<sup>1</sup> ≈ 5.73906, *w*<sup>0</sup> ≈ 6.11953, *w* ≈ 6.12851, *w*<sup>2</sup> ≈ 7.28319, *α* ≈ 1.15468, *α*¯ ≈ 1.54419, *β* ≈ 0.0241653, *β*<sup>0</sup> ≈ 0.04388.

All constants are formally defined when they are first introduced.

#### **3. Two Benchmark Algorithms and Motivation**

In this section, we describe two benchmark algorithms for 2EVAC*F*2*F*, as well as perform average-case analysis to algorithms previously proposed in the literature. The reader may consult Figure 3 for the algorithms analyzed in this section.

**Figure 3.** Robot Trajectories for algorithms B1, B2, A0. The depicted trajectories show the search of the circle, and not the evacuation step that is performed once the exit is found.

Czyzowicz et al. [1] were the first to introduce an evacuation algorithm for 2EVAC*F*2*F*, which we denote here by B<sup>1</sup> (see Figure 3 on the left).

**Definition 1** (Benchmark Algorithm B1)**.** *For all t* ∈ [0, *π*]*,* R1(*t*) = *cycle*(*t*) *and* R2(*t*) = *cycle*(−*t*)*.*

**Observation 3.** *Benchmark Algorithm* B<sup>1</sup> *is* (5.1172, 5.73906)*-efficient.*

**Proof.** Please note that it takes time *π* to search the entire circle, and that the two trajectories are symmetric with respect to horizontal axis. Therefore, we may assume that the instance cycle(*x*) satisfies *x* ∈ [0, *π*].

Clearly, for any such *x*, we have that S(*x*) = *x*. By Lemma 2, we have that C(*x*) = 1 + S(*x*) + 2E(*x*) = 1 + *x* + 2*δx*. Numerical calculations (software assisted) show that

$$\begin{aligned} \text{Wrs}\left(\mathcal{A}\_{1}\right) &= \sup\_{\mathbf{x}\in[0,\pi]} \{\mathcal{C}(\mathbf{x})\} = \sup\_{\mathbf{x}\in[0,\pi]} \{1+\mathbf{x}+2\delta\_{\mathbf{x}}\} \approx \dots \text{7.73906},\\ \text{Avg}\left(\mathcal{A}\_{1}\right) &= \operatorname{E}\_{\mathbf{x}\in[0,\pi]}[\mathcal{C}(\mathbf{x})] = \frac{1}{\pi} \int\_{\mathbf{x}=0}^{\pi} \left(1+\mathbf{x}+2\delta\_{\mathbf{x}}\right) d\mathbf{x} \approx \dots \text{1172...} \end{aligned}$$

B<sup>1</sup> should be understood as being efficient in the worst case, but inefficient on average. The claim becomes transparent by introducing the following *naive* algorithm for 2EVAC*F*2*<sup>F</sup>* that we depict in the middle of Figure 3.

**Definition 2** (Benchmark Algorithm B2)**.** *For each t* ∈ [0, 2*π*]*,* R1(*t*) = R2(*t*) = *cycle*(*t*)*.*

**Observation 4.** *Benchmark Algorithm* B<sup>2</sup> *is* (1 + *π*, 1 + 2*π*)*-efficient.*

**Proof.** It is easy to see that for all *<sup>x</sup>* ∈ [0, 2*π*) we have ¯*t*(*x*) = S(*x*) = *<sup>x</sup>* and E(*x*) = 0. Therefore C(*x*) = 1 + *x*, and hence

$$\begin{aligned} \text{Wrs} \left( \mathcal{A}\_2 \right) &= \sup\_{\mathbf{x} \in [0, 2\pi)} \{ \mathcal{C}(\mathbf{x}) \} = 1 + 2\pi, \\\text{Avg} \left( \mathcal{A}\_2 \right) &= \mathbf{E}\_{\mathbf{x} \in [0, 2\pi)} [\mathcal{C}(\mathbf{x})] = \int\_{\mathbf{x} = 0}^{2\pi} (1 + \mathbf{x}) \, d\mathbf{x} = 1 + \pi. \end{aligned}$$

B<sup>2</sup> should be understood as highly efficient on average, but inefficient in the worst case. Moreover, it should be clear that B1, B<sup>2</sup> are feasible solutions to 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, for *w* = 5.1172 and *w* = 1 + 2*π*, respectively. We conjecture that B<sup>1</sup> is indeed the optimal evacuation algorithm among all algorithms with worst-case performance no more than 1 + 2*π*. At the same time, below we show that B<sup>2</sup> is the best algorithm for 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, when *w* = 5.1172, among those previously used to improve upon the worst-case performance up to the third decimal. The importance of this observation is two-fold; first we are motivated to study 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* for the entire spectrum of *w* ∈ [Wrs (B1), Wrs (B2)], and second we deduce that in order to perform well on average, we need to devise and analyze new evacuation algorithms.

Upper bounds for the worst-case performance of B<sup>1</sup> were later improved first to 5.628 [26], then to 5.625 [27], and then to 5.623 [28]. The main idea behind the improvement is to understand the monoticity of C(*x*) for algorithm B1. Indeed, the following lemma was implicit in both [26,27], and can be obtained numerically.

**Lemma 3.** *There is α*0*, where α*<sup>0</sup> ≈ 0.96782*, so that evacuation cost* C(*x*) *of* B<sup>1</sup> *for* 2EVAC*F*2*<sup>F</sup> on instance* cycle(*x*) *is strictly increasing for x* ∈ [0, *α*0]*, and strictly decreasing in x* ∈ [*α*0, *π*]*. In particular,* Wrs (B1) = C(*α*0) ≈ 5.73906*.*

Consider now an execution of B<sup>1</sup> in which one of the robots, say R<sup>2</sup> continues searching on the circle and is close to approach a location that would be the meeting point if the instance was cycle(*α*0). In an attempt to help expedite a potential meeting (in case R<sup>1</sup> is approaching) and effectively reducing the cost of the worst case, R<sup>2</sup> would make a minor detour toward the interior of the disk, before returning back to the exploration of the circle. This simple idea was explored in [26] and in [27] where the following family of algorithms were introduced, parameterized by *α* ∈ [0, *π*] and point *B* within the unit disk, see also right of Figure 3 (the simplified version presented here is due to [27]).

**Definition 3** (1-Detour Algorithm A0(*α*, *B*))**.** *For all t* ∈ [0, *π* + 2 cycle(*α*) − *B*]*, the trajectory of* R<sup>1</sup> *is defined as*


*The trajectory of* R<sup>2</sup> *is symmetric with respect to the horizontal axis.*

The crux of the contribution of [26] was to prove that there exists *α*, *B* for which the worst-case performance is no more than 5.644 (and a delicate refinement is needed to achieve 5.628). Notably, their analysis is tedious and lengthy, whereas we can obtain the same result, relying again on numerical calculations, with minimal effort. Then, [27] proposed variations of A0(*α*, *B*) in which each robot performs more than 1 detours (see Phases 2,3 of A0(*α*, *B*)), giving rise to [28]. Hence, *t*-detour algorithms are parameterized by a sequence *α*1, ... , *αt*, where *α<sup>i</sup>* ≥ 0 and ∑*<sup>i</sup> α<sup>i</sup>* ≤ *π*, and points *Bi* in the disk. Even 2-detour algorithms achieve worst-case performance 5.623, while for each *t* ≥ 2, t-detour algorithms do induce strictly improved performance (for appropriate choices of the parameters) but the improvement seems to be negligible.

Motivated by the results in [26,27], one is tempted to ask whether any algorithm in the family A0(*α*, *B*) improves upon B<sup>1</sup> with respect to the average-case analysis. The next claim is due to exhaustive, computer-assisted numerical calculations, see also Figure 4.

### **Theorem 5.** *For every α* ∈ [0, *π*) *and for every B in the unit disk* Avg (A0(*α*, *B*)) ≥ Avg (B1)*.*

Theorem 5 provides strong motivation for studying problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, since it shows that in order to establish good upper bounds, i.e., our main results depicted in Figure 1 and quantified later in Theorem 7, one needs to employ new evacuation algorithms. Recall that even Wrs (B1) and Wrs (A0(*α*, *B*)) were estimated with computer-assisted calculations. Due to the nature of the problem, we are bound to rely on computer-assisted calculations as well. Notably, our much more intense computational work is feasible only because we employ the new method for computing evacuation times due to Corollary 1 and Definition 3 of A0(*α*, *B*) trajectories. Overall, to verify Theorem 5 we compute pairs (Avg (A0(*α*, *B*)), Wrs (A0(*α*, *B*))) for more than 500,000 different parameter values and we depict them in Figure 4.

**Figure 4.** Performance analysis of A0(*α*, *B*) for various values of parameters *α*, *B*. Blue points (*a*, *w*) correspond to (*a*, *w*)-efficient algorithms A0(*α*, *B*). The red point is (Avg (B1), Wrs (B1)), i.e., the performance of B<sup>1</sup> in the average-worst-case space. Please note that no algorithm A<sup>0</sup> performs better on average than B1, while all A0(*t*, cycle(*t*)) is exactly B<sup>1</sup> for every point *t* ∈ [0, *π*]. Notably, all points lie above the threshold of worst-case performance 5.625, and some are arbitrarily close to that value (corresponding to choices of *α*, *B* that give the algorithm of [27]).

#### **4. New Evacuation Algorithms**

In this section, we propose families of evacuation algorithms for problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*F*, for the entire spectrum of *w* ∈ [Wrs (B1), Wrs (B2)]. Our algorithms are summarized in Figure 5.

**Figure 5.** Robot Trajectories for algorithms A1, A2, A <sup>2</sup> . The depicted trajectories show the search of the circle, and not the evacuation step that is performed once the exit is found. Arcs that are searched by both robots are also searched simultaneously, i.e., robots are co-located and search together.

First we define families of evacuation algorithms that, as we show next, perform well for 2EVAC*<sup>w</sup> F*2*F* in the "neighborhood of B1", i.e., for *w* close to Wrs (B1). Our algorithms are parameterized by *α*, and their circle exploration lasts 2*π* − *α*.

**Definition 4** (Algorithm A1(*α*))**.** *For all t* ∈ [0, 2*π* − *α*]*, the trajectory of* R<sup>1</sup> *is defined as*


*where δ<sup>a</sup> is defined in* (2)*. The trajectory of* R<sup>2</sup> *is defined as* R2(*t*) = cycle(−*t*)*, for all t* ∈ [0, 2*π* − *α*]*.*

A<sup>1</sup> is depicted in Figure 5 on the left. At a high level A1(*α*) is a modification of B<sup>1</sup> that is based on the following idea. The execution of A1(*α*) is the same as in B<sup>1</sup> until each robot searches an arc of length *α* (and hence A (*π*) coincides with B1). After time *α*, R<sup>1</sup> abandons her trajectory and catches R2, on the perimeter of the circle resembling a trajectory as if the exit was located at R1(*α*). It is not difficult to see that the definition of *δα* above satisfies R1(*α* + *δα*) = R2(*α* + *δα*) = cycle(−*α* − *δα*).

Next we define a family of algorithms A<sup>2</sup> which, as we show later, perform well in the "neighborhood of B2", i.e., for *w* close to Wrs (B2). For this recall definition (2) of *δa*. We let *γ*<sup>0</sup> ≈ 2.2412 be the root of 2*α* + *δα*/2 = 2*π*. For every *α* ≤ *γ*<sup>0</sup> we define a family of algorithms on parameter *α* whose circle exploration lasts 2*π* − *α*.

**Definition 5** (Algorithm A2(*α*))**.** *For all t* ∈ [0, 2*π* − *α*]*, the trajectory of* R<sup>1</sup> *is defined as*


*The trajectory of* R<sup>2</sup> *is defined as* R2(*t*) = cycle(*α* + *t*)*, for all t* ∈ [0, 2*π* − *α*]*.*

A<sup>2</sup> is depicted in the middle of Figure 5. The condition that *α* ≤ *γ*<sup>0</sup> is added for simplicity to ensure that the latest catching point occurs while the other robot is still searching, and is not mandatory. At a high level A2(*α*) is a generalization of B<sup>2</sup> (note that A2(0) = B2). For the first *α* time units, robots search in the same direction until R<sup>1</sup> arrives at the deployment point of R2. Then, R<sup>1</sup> catches R<sup>2</sup> on the circle, as if the exit was located at R1(*α*) (which by Lemma 2 happens in *δα*/2 extra time).

Finally, we introduce a family of evacuation algorithms which will perform well for 2EVAC*<sup>w</sup> F*2*F* for intermediate values of *w* ∈ [Wrs (B1), Wrs (B2)]. For this we generalize family A<sup>2</sup> so that the two robots perform two alternating jumps, with parameters *α*, *β* satisfying 2*α* + 2*β* + *δ*(*α*+*β*)/2 + *δβ*/2 ≤ 2*π*, see right of Figure 5.

**Definition 6** (Algorithm A <sup>2</sup> (*α*, *β*))**.** *For notational convenience, we set ζα*,*<sup>β</sup>* := 2*α* + *β* + *δ*(*α*+*β*)/2*. For all t* ∈ [0, 2*π* − *α* − *β*]*, the trajectories of* R1, R<sup>2</sup> *are defined as follows*


Next we describe the meaning of parameters *α*, *β* of the Robot trajectories above. As in the family of algorithms A2, parameter *α* represents the arc distance the two robots have before the one preceding decides to jump ahead. In A<sup>2</sup> the two robots meet again once the jumper reaches the perimeter of the circle. In A <sup>2</sup> the jumper deploys a little further away on the circle so that when the other robot reaches the deployment point of the jumper, the two robots are at arc distance *β*. As a result, the time it takes both robots to complete searching the entire circle is 2*π* − *α* − *β*, as well as A2(*α*, 0) coincides with A2(*α*). Finally, note that even though A <sup>2</sup> will be eventually invoked for seemingly restricted values of *β* (*β* ≤ *β*<sup>0</sup> ≈ 0.04388), the deviation in the performance will be significant enough (e.g., *δβ*0/2 ≈ 0.977997) to account for its use in our upper bounds.

#### **5. Worst-Case Performance Analysis**

In this section, we perform worst-case analysis for all algorithmic families A1, A2, A <sup>2</sup> with respect to their parameters. Notably, results in this section are quantified formally and exactly by closed formulas. At a high level, each of A1, A2, A <sup>2</sup> will be invoked to solve 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* for different values of *w* ∈ [Wrs (B1),Wrs (B2)], and each of them will have competitive average-case performance for the corresponding worst-case performance *w*. As an easy warm-up, we analyze A1.

**Lemma 4** (Worst-Case Analysis for A1)**.** *Let α*¯ = 1 + 2*π* − *w*1*, where w*<sup>1</sup> = Wrs (B1)*. Then, for all α* ∈ [0, *π*]*, we have that*

$$\text{Wrs}\left(\omega\_1'(\mathfrak{a})\right) = \begin{cases} 1 + 2\pi - \mathfrak{a} & \text{, } \forall \mathfrak{a} \in [0, \mathfrak{a})\\ \text{Wrs}\left(\beta \mathbb{I}\_1\right) & \text{, } \forall \mathfrak{a} \in [\mathfrak{a}, \pi] \end{cases}.$$

**Proof.** First it is easy to show that the worst-case evacuation time is induced either when R<sup>1</sup> finds the exit while moving from cycle(0) to cycle(*α*), or while R1, R<sup>2</sup> are exploring the circle together (after having met). By Lemma 2, the cost in the first case would be

$$\max\_{0 \le x \le \pi} \{ 1 + \mathfrak{x} + 2\delta\_x \} = \begin{cases} 1 + \mathfrak{a} + 2\delta\_\mathfrak{a} & \text{, if } \mathfrak{a} \le \mathfrak{a}\_0 \\\ \text{Wrs}\left(\mathcal{B}\_1\right) & \text{, otherwise} \end{cases}$$

where the values of the piecewise function above follow from Lemma 3. In the other case, the worst placement of exit is obtained using instances cycle(*α* + ) for arbitrary small values of > 0 in which case the evacuation cost becomes 1 + 2*π* − *α*.

Overall, is is easy to see that 1 + *α*<sup>0</sup> + 2*δα*<sup>0</sup> ≤ 1 + 2*π* − *α*<sup>0</sup> showing that the dominant evacuation cost when *α* ≤ *α*¯ is 1 + 2*π* − *α*. For *α* > *α*¯ the evacuation cost becomes equal to *w*1.

In a similar fashion, we can easily analyze A2.

**Lemma 5** (Worst-Case Analysis for A2)**.** *For all α* ≤ *π* − 2*, we have* Wrs (A2(*α*)) = 1 + 2*π* − *α.*

**Proof.** We distinguish three cases as to where the exit is. If *x* ∈ [0, *α*), then the worst instance cycle(*x*) is when *x* = *α* − for arbitrarily small > 0, and the cost is 1 + *α* + 2*δα*/2. In the second case *x* ∈ [*α*, 2*α* + *δα*/2) and it is not difficult to see that the worst-case induced cost in this case is not more than that of the first case. Finally, in the third case *x* ∈ [2*α* + *δα*/2, 2*π*), and the two robots move together, so the total cost, in the worst-case, is 1 + 2*π* − *α*, when *x* = 2*π* − for arbitrarily small > 0. It is not difficult to see that the dominant case is actually the third one, and in fact the two cases induce the same cost when *π* = *α* + *δα*/2. By the definition of *δα*/2 we know that *δα*/2 <sup>=</sup> 2 sin *α*+*δα*/2 2 = 2 sin (*π*/2) = 2. Hence, the costs become equal when *α* = *π* − 2.

Next, we analyze A <sup>2</sup> (*α*, *β*), which requires more technical arguments. For this we will invoke A <sup>2</sup> only for special parameters, whose choice is motivated by the following observation pertaining to the performance of A<sup>2</sup> (whose generalization is A <sup>2</sup> ). From the proof of Lemma 5, it follows that among all algorithms A2(*α*), where *α* ≤ *γ*<sup>0</sup> (see discussion before Definition 5), the one with minimum worst-case evacuation cost is A2(*π* − 2), and the cost becomes 3 + *π*. In fact, for all *w* ∈ [3 + *π*, 1 + 2*π*] there are two different values of *α* for which Wrs (A2(*α*)) = *w*, and we restrict *α* ∈ [0, *π* − 2] so that we obtain evacuation algorithms with minimum average-case cost. Moreover, *α* = *π* − 2 is the only parameter for which Wrs (A2(*α*)) = 3 + *π* and as a byproduct, it is the algorithm in the family A<sup>2</sup> that minimizes the worst-case.

By Lemma 5 we know that as *β* → 0, the value of *α* that minimizes Wrs (A <sup>2</sup> (*α*, *β*)) approaches *π* − 2. That value of *α* is what made the evacuation cost of A2(*α*) attain the same value in two different (worst-case) exit placements. Motivated by this, and for values of *β* > 0 not too big, we still find the optimal choices of *α* that minimize the worst-case performance.

**Lemma 6** (Worst-Case Analysis for A <sup>2</sup> )**.** *Let β*<sup>0</sup> = 0.0438855*, and set αβ* := *π* − *β*/2 − 2 cos (*β*/4)*. Then for all β* ∈ [0, *β*0] *we have* Wrs A <sup>2</sup> (*αβ*, *β*) = 1 + *π* − *β*/2 + 2 cos (*β*/4).

**Proof.** Let *w*(*β*) = 1 + *π* − *β*/2 + 2 cos (*β*/4). First we show that *w*(*β*) is the worst-case performance of A <sup>2</sup> (*αβ*, *β*) for two specific placements of the exit.

We proceed by describing evacuation cost C(*x*) assuming two arbitrary *α*, *β* for two different instances cycle(*x*). Using Lemma 2, we see that

$$\lim\_{\varepsilon \to 0^{+}} \mathcal{E}(\mathfrak{a} - \mathfrak{e}) = 1 + \lim\_{\varepsilon \to 0^{+}} \mathcal{S}(\mathfrak{a} - \mathfrak{e}) + 2 \lim\_{\varepsilon \to 0^{+}} \mathcal{E}(\mathfrak{a} - \mathfrak{e}) = 1 + \mathfrak{a} + 2\delta\_{\mathfrak{a}/2}.\tag{3}$$

Since the total search time is 2*π* − *α* − *β*, we also see that

$$\lim\_{\varepsilon \to 0^{+}} \mathcal{C}(2\pi - \varepsilon) = 1 + 2\pi - a - \beta. \tag{4}$$

Now we claim that (3), (4) are equal when *α* = *αβ*. Indeed, equating (3), (4) gives

$$
\pi a + \delta\_{a/2} = \pi - \beta/2. \tag{5}
$$

However, then, using (2), we see that

$$\delta\_{a/2} = 2\sin\left(\frac{\pi + \delta\_{a/2}}{2}\right) = 2\sin\left(\frac{\pi - \beta/2}{2}\right) = 2\cos\left(\beta/4\right). \tag{6}$$

Substituting (6) into (5), we see that the value of *α* for which (3), (4) are equal satisfies *α* = *π* − *β*/2 − 2 cos (*β*/4), as promised. Substituting this special value of *α* = *αβ* either in (3) or in (4) induces evacuation cost *w*(*β*) = 1 + *π* − *β*/2 + 2 cos (*β*/4).

Next we show that as long as *β* is not too big, *w*(*β*) is indeed the worst-case evacuation cost. We consider the following cases *x* ∈ *Ii*, *i* = 1, . . . , 4 for possible instances cycle(*x*);

$$\begin{aligned} I\_1 &:= [0, \alpha), \\ I\_2 &:= [\alpha, 2\alpha + \beta + \delta\_{(\alpha+\beta)/2}), \\ I\_3 &:= [2\alpha + \beta + \delta\_{(\alpha+\beta)/2}, 2\alpha + 2\beta + \delta\_{(\alpha+\beta)/2} + \delta\_{\beta/2}), \\ I\_4 &:= [2\alpha + 2\beta + \delta\_{(\alpha+\beta)/2} + \delta\_{\beta/2}, 2\pi). \end{aligned}$$

Clearly, (3), (4) demonstrate the worst-case evacuation costs for instances in *I*1, *I*4, respectively, and the cost in both cases, for *α* = *αβ* is equal to *w*(*β*).

If *x* ∈ *I*<sup>2</sup> then C(*x*) = 1 + S(*x*) + 2E(*x*). It is easy to see that both S(*x*), E(*x*) are monotone in *I*2, so the worst-case evacuation in this case is

$$\lim\_{\varepsilon \to 0^{+}} \mathcal{C}(2a\_{\beta} + \beta + \delta\_{(a\_{\beta} + \beta)/2} - \varepsilon) = 1 + a\_{\beta} + \beta + \delta\_{(a\_{\beta} + \beta)/2} + 2\delta\_{\beta/2}.\tag{7}$$

Denote *δβ*/2 satisfying (2) by *δ <sup>β</sup>*. Using (2) and the definition of *αβ*, we see that

$$\delta\_{(a\_{\beta}+\beta)/2} = 2\sin\left(\frac{a\_{\beta}+\beta+\delta\_{(a\_{\beta}+\beta)/2}}{2}\right) = 2\cos\left(\cos\left(\beta/4\right) - \beta/4 - \delta\_{(a\_{\beta}+\beta)/2}\right).$$

For simplicity, we denote *δ*(*αβ*+*β*)/2 that satisfies the equation above by *δ <sup>β</sup>* . Then, continuing from (7), the worst-case evacuation cost when *x* ∈ *I*<sup>2</sup> becomes 1 + *π* + *β*/2 − 2 cos (*β*/4) + *δ <sup>β</sup>* + 2*δ β*, an expression that depends exclusively on *β*. The latter cost is no more than *w*(*β*) if and only if 4 cos (*β*/4) − *β* − *δ <sup>β</sup>* − 2*δ <sup>β</sup>* ≥ 0, and numerically we verify that this is satisfied as long as *β* ≤ *β*<sup>0</sup> (see also Figure 6).

**Figure 6.** The behavior of expression 4 cos (*β*/4) − *β* − *δ <sup>β</sup>* − 2*δ <sup>β</sup>*, for *β* = 0, . . . , 0.8.

Finally, it is easy to verify that *δβ*/2 and |*I*4| are increasing and decreasing, respectively, for *β* ≤ *β*0, and that *δβ*0/2 = 0.977997 ≤ 1.01099 = |*I*4| (for *β* = *β*0). As a result, the worst-case evacuation cost of case *x* ∈ *I*<sup>3</sup> cannot exceed that of case *x* ∈ *I*4, and hence the lemma follows.

It is important to note that the worst-case performance of A <sup>2</sup> (*αβ*, *β*) of Lemma 7 is decreasing in *β*. Indeed, *<sup>∂</sup> ∂β*Wrs A <sup>2</sup> (*αβ*, *β*) = <sup>1</sup> <sup>2</sup> <sup>−</sup> <sup>1</sup> <sup>2</sup> sin (*β*/4) < 0. For values of *β* close to 0, the derivative is nearly a constant. This also explains why in Figure 1, the performance of algorithm A <sup>2</sup> seems to have nearly invariant worst-case performance, which however is provably decreasing in *β*.

**Lemma 7** (Worst-Case Analysis for A <sup>2</sup> )**.** *Let β*<sup>0</sup> = 0.0438855*, and set αβ* := *π* − *β*/2 − 2 cos (*β*/4)*. Then for all β* ∈ [0, *β*0] *we have* Wrs A <sup>2</sup> (*αβ*, *β*) = 1 + *π* − *β*/2 + 2 cos (*β*/4).

#### **6. Average-Case Performance Analysis and the Efficient Frontier**

In this section, we perform average-case analysis for all algorithmic families A1, A2, A 2 , with respect to their parameters. For the sake of exposition of our results, we set *w*<sup>1</sup> = Wrs (B1) ≈ 5.73906, *w*<sup>2</sup> = Wrs (B2) = 1 + 2*π* ≈ 7.28319 and for *β*<sup>0</sup> ≈ 0.04388, as in Lemma 7, we set *w*<sup>0</sup> := Wrs A <sup>2</sup> (*αβ*<sup>0</sup> , *β*0) ≈ 6.11953. We also recall *α*¯ ≈ 1.54419 of Lemma 4. Finally, we set

$$\begin{aligned} \upsilon(\alpha) &:= 1 + 2\pi - \alpha \\ \upsilon\_2(\beta) &:= 1 + \pi - \beta/2 + 2\cos\left(\beta/4\right) \\ \upsilon\_1(\alpha) &:= 0.00889\alpha^3 - 0.16944\alpha^2 + 0.71518\alpha + 4.23089 \\ \upsilon\_2'(\beta) &:= 530.673\beta^3 - 78.5498\beta^2 + 7.36219\beta + 4.70493\alpha \\ \upsilon\_2(\alpha) &:= 0.093056\alpha^2 + 0.346659\alpha + 4.1719 \end{aligned}$$

Combined with our findings of Section 5, the main result of the current section is the following.

**Theorem 6.** *For every w* ∈ [*w*1, *w*2] *there is algorithm* A ∈ {A1, A <sup>2</sup> , A2} *and unique parameter(s) p such that* Wrs (A (*p*)) = *w. In particular,*


**Proof.** The claims for the worst-case performances of A1, A <sup>2</sup> , A<sup>2</sup> follow directly from Lemmata 4, 7 and 5, respectively. Next we argue that as the parameters vary in their specified range, we obtain the entire spectrum of *w* ∈ [*w*1, *w*2], and this for unique values of the parameters. For this, we will rely on that for all evacuation algorithm families, the worst-case cost is monotone in the parameters.

First, we argue about A1. We observe that by the definition of *α*¯, Wrs (A1(*α*¯)) = *w*1, and Wrs (A1(1)) = 1 + 2*π* − 1 = 2*π*. Together with the fact that *v*(*α*) is strictly decreasing, we see that Wrs (A1(*α*)) is 1-1 and onto to [*w*1, 2*π*] as *α* ranges in [1, *α*¯].

Second, we study A <sup>2</sup> whose worst-case cost *v*2(*β*) is strictly decreasing in *β*. Moreover, by definition of *β*0, we have Wrs A2(*αβ*<sup>0</sup> , *β*0) = *w*0. Then we note that for *β* = 0, A2(*αβ*, *β*) coincides with A2(*π* − 2), and in particular the induced worst-case cost becomes 3 + *π*. Therefore Wrs A <sup>2</sup> (*αβ*, *β*) is 1-1 and onto to [*w*0, 3 + *π*] as *β* ranges in [0, *β*0].

Third, we study A2, for which we know that Wrs (A2(*π* − 2)) = 3 + *π*. Again, the worst-case cost is monotone in *α* and A2(0) coincides with benchmark algorithm B2, which is Wrs (A2(0)) = *w*2. Hence, Wrs (A2(*α*)) is 1-1 and onto to [3 + *π*, *w*2] as *α* ranges in [0, *π* − 2].

Finally, we argue that

$$\begin{aligned} \text{Avg}\left(\omega\_1'(\mathfrak{a})\right) &\leq \mathfrak{u}\_1(\mathfrak{a}), \forall \mathfrak{a} \in [1, \bar{\mathfrak{a}}]\\ \text{Avg}\left(\omega\_2'(\mathfrak{a}\_{\mathfrak{f}}, \mathfrak{f})\right) &\leq \mathfrak{u}\_2'(\mathfrak{f}), \forall \mathfrak{f} \in [0, \mathfrak{f}\_0] \\ \text{Avg}\left(\omega\_2(\mathfrak{a})\right) &\leq \mathfrak{u}\_2(\mathfrak{a}), \forall \mathfrak{a} \in [0, \pi - 2] \end{aligned}$$

For this, we numerically compute Avg (A1(*α*)), Avg A <sup>2</sup> (*αβ*, *β*) , Avg (A2(*α*)) for various values of parameters *α*, *β*, and we heuristically choose *u*1, *u* <sup>2</sup>, *u*<sup>2</sup> so as to upper bound the average-case performance of A1, A <sup>2</sup> , A2, effectively verifying our claim numerically. For each evacuation algorithm, we use Corollary 1, which together with the analytic description of our evacuation algorithms (see Definitions 4, 6, and 5) allow us to compute their average-case performance using computer-assisted calculations. Our numerical calculations are depicted in Figure 7.

**Figure 7.** On the right *u*1(*α*) − Avg (A1(*α*)), for *α* ≤ *α* ≤ *α*¯. In the middle, *u* <sup>2</sup>(*β*) <sup>−</sup> Avg A <sup>2</sup> (*αβ*, *β*) , for 0 ≤ *β* ≤ *β*0. On the right *u*2(*α*) − Avg (A2(*α*)), for 0 ≤ *α* ≤ *π* − 2.

Finally, we aim to formally quantify the efficient frontier of our algorithms as depicted in Figure 1 (see Section 2.1). The parametric curves described in Theorem 6 provide, strictly speaking, an upper bound for the parametric curve of Figure 1. Next, we compute *<sup>g</sup>* : <sup>R</sup> → <sup>R</sup>, so that the parametric curves of Theorem <sup>6</sup> are written in the form {(*g*(*w*), *<sup>w</sup>*)}*w*∈[*w*1,*w*2]. That would also imply that there is a solution to 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* of cost at most *g*(*w*).

In that direction, we study each evacuation algorithm family A (*p*) with worst-case performance, say, *v*(*p*), and average-case upper bound, say, *u*(*p*). For each *w* ∈ [*w*1, *w*2] in the range of A (*p*), we set *p* = *v*−1(*w*) so that the average-case performance achieved becomes *u*(*v*−1(*w*)).

Recall that Wrs (A*i*(*α*)) <sup>=</sup> *<sup>v</sup>*(*α*), so that *<sup>v</sup>*−1(*w*) = <sup>1</sup> <sup>+</sup> <sup>2</sup>*<sup>π</sup>* <sup>−</sup> *<sup>w</sup>*, and hence for algorithms <sup>A</sup>*<sup>i</sup>* we can easily compute *ui*(*v*−1(*w*)), *i* = 1, 2. For A <sup>2</sup> we recall that Avg A <sup>2</sup> (*αβ*, *β*) is decreasing in *β*. Since *v*−<sup>1</sup> 2 does not admit a closed form, we need to observe that 2.999 + *π* − *β*/2 ≤ *v*2(*β*) ≤ 3 + *π* − *β*/2 for all *β* ∈ [0, *β*0] so that an upper bound for Avg A <sup>2</sup> (*αβ*, *β*) admitting worst-case performance *w* can be computed by *u* <sup>2</sup>(12.2812 − 2*w*).

Now for each *w* ∈ [*w*1, *w*2] we need to specify which of the evacuation algorithms we will invoke. Please note that in Theorem 6 we chose the range of *α* in A<sup>1</sup> to start from 1 so that as to guarantee that Wrs (A1(1)) ≥ *w*0. We note that *u* <sup>2</sup>(12.2812 − 2*w*) = *u*1(1 + 2*π* − *w*) for *w* ≈ 6.12851, so algorithm A<sup>1</sup> should be invoked for *w* ∈ [*w*1, *w* ] (and *w* is obtained for *α* := 1 + 2*π* − *w* ≈ 1.15468), then A 2

for *w* ∈ [*w* , 3 + *π*] (and *w* is obtained for *β* so that *v*2(*β* ) = *w* , where *β* ≈ 0.0241653), and A<sup>2</sup> for *w* ∈ [3 + *π*, *w*2]. We conclude with the next Theorem (for convenience, the values of all constants are summarized at the end of Section 2.3).

**Theorem 7.** *For every w* <sup>∈</sup> [*w*1, *<sup>w</sup>*2]*, the optimal solution to* 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup> is at most g*(*w*)*, where*

$$g(w) = \begin{cases} -0.00889w^3 + 0.0248026w^2 + 0.338241w + 3.88629 & , , w \in [w\_1, w'] \quad (\omega\_1'(a), \ a \in [a', \pi]) \\ -4245.38w^3 + 77893.3w^2 - 476397.w + 971235 & , , w \in [w', 3 + \pi] \quad (\omega\_2'(a\_\beta, \beta), \ \beta \in [0, \beta']) \\ 0.093056w^2 - 1.70215w + 11.6328 & , w \in [3 + \pi, w\_2] \quad (\omega\_2'(a), \ a \in [0, \pi - 2]) \end{cases}$$

#### **7. Conclusions and Open Problems**

We offered a new perspective to the well-studied problem of evacuating two robots from the disk, in the face-to-face model, first introduced in [1]. A series of results pertaining especially to the same domain have focused exclusively on deterministic algorithms and their worst-case (competitive) analyses. Our work can be understood as a first attempt to study the same problem in the realm of randomized algorithms. More specifically, in light of known positive results for the problem, we asked the question of minimizing the average-case performance of an evacuation algorithm, condition on that the worst-case performance remains bounded. We allowed that latter bound to range between the best known guarantee of a simple yet efficient evacuation algorithm (that was introduced in [1]) and that of a naive algorithm that simulates the optimal solution of one searcher. Our main contribution is the introduction of three new evacuation algorithms that perform well for different values of the worst-case bound, inducing a continuous bound of the efficient (pareto) frontier for the underlying multi-objective optimization problem (that of minimizing both the worst and the average-case performance). We also motivated our results by verifying, somehow surprisingly, that among the family of algorithms introduced in [27], which gave the second subsequent improvement of the worst-case performance, none of them could improve the average-case performance of the simple algorithm presented in [1]. In that sense our new algorithms outperform the best algorithms known for the problem, but in the new multi-objective setting. Our findings give rise to several open questions and directions that aim to better understand 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* as well as multi-objective optimization search-type problems.

Open questions specific to our problem 2EVAC*<sup>w</sup> <sup>F</sup>*2*<sup>F</sup>* are:


We conclude with some future directions that are inspired by our work and pertain to more general problems:


**Author Contributions:** Investigation, H.C. and P.S.; Supervision, K.G. All authors have read and agreed to the published version of the manuscript.

**Funding:** The second author and this research was supported in part by NSERC Discovery Grant.

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

#### **References**


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

© 2020 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 (http://creativecommons.org/licenses/by/4.0/).

MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel. +41 61 683 77 34 Fax +41 61 302 89 18 www.mdpi.com

*Information* Editorial Office E-mail: information@mdpi.com www.mdpi.com/journal/information

MDPI St. Alban-Anlage 66 4052 Basel Switzerland

Tel: +41 61 683 77 34 Fax: +41 61 302 89 18

www.mdpi.com

ISBN 978-3-0365-2843-4