# Deterministic Rendezvous with Detection Using Beeps

## Abstract

Two mobile agents, starting at possibly different times from arbitrary nodes of an unknown network, have to meet at some node. Agents move in synchronous rounds. They have different positive integer labels. Each agent knows its own label but not the label of the other agent. In traditional formulations of the rendezvous problem, meeting is accomplished when agents get to the same node in the same round. We seek a more demanding goal, called *rendezvous with detection*: agents must become aware that the meeting is accomplished, simultaneously declare this and stop. This awareness depends on how agents communicate. We use two variations of a very weak communication model, called the *beeping model*, introduced in [8]. In each round an agent either listens or beeps. In the *local beeping model*, an agent hears a beep if it listens in this round and if the other agent is at the same node and beeps. In the *global beeping model*, an agent hears a *loud* (resp. a *soft*) beep if it listens in this round and if the other agent is at the same node (resp. at another node) and beeps.

We first present a deterministic algorithm of rendezvous with detection working, even for the local beeping model, in an arbitrary unknown network in time polynomial in the size of the network and in the length of the smaller label (i.e., in the logarithm of this label). However, in this algorithm, agents spend a lot of energy: the number of moves that an agent must make, is proportional to the time of rendezvous. It is thus natural to ask if *bounded-energy agents*, i.e., agents that can make at most *c* moves, for some integer *c*, can always achieve rendezvous with detection as well, in bounded size networks. We prove that the answer to this question is positive, even in the local beeping model but, perhaps surprisingly, this ability comes at a steep price of time: the meeting time of bounded-energy agents is *exponentially* larger than that of unrestricted agents. By contrast, we show an algorithm for rendezvous with detection in the global beeping model that works for bounded-energy agents (in bounded-size networks) as fast as for unrestricted agents.

### Keywords

Algorithm Rendezvous Detection Synchronous Deterministic Network Graph Beep## 1 Introduction

**The Background and the Problem.** Two mobile agents, starting at arbitrary, possibly different times from arbitrary nodes of an unknown network, have to meet at some node of it. This task is known as rendezvous [2]. The network is modeled as a simple undirected connected graph, and agents move in synchronous rounds: in each round an agent can either stay at the current node or move to one of its neighbors. Hence in each round an agent is at a specific node. Agents are mobile entities with unlimited memory; from the computational point of view they are modeled as Turing machines. In applications, these entities may represent mobile robots navigating in a labyrinth or in corridors of a building, or software agents moving in a communication network. The purpose of meeting might be to exchange data previously collected by the agents at nodes of the network, or to coordinate future network maintenance tasks, for example checking functionality of websites or of sensors connected in a network.

Agents have different labels which are positive integers. Each agent knows its own label, but not the label of the other agent. Agents do not know the topology of the network. They do not know the starting node or activation time of the other agent. They cannot mark the visited nodes in any way. Each agent appears at its starting node at the time of its activation by the adversary.

We seek rendezvous algorithms that do not rely on the knowledge of node labels, and can work in anonymous networks as well (cf. [2]). The importance of designing such algorithms is motivated by the fact that, even when nodes are equipped with distinct labels, agents may be unable to perceive them because of limited sensory capabilities, or nodes may refuse to reveal their labels to agents, e.g., due to security or privacy reasons. On the other hand, we assume that edges incident to a node *v* have distinct labels in \(\{0,\dots ,d-1\}\), where *d* is the degree of *v*. Thus every undirected edge \(\{u,v\}\) has two labels, which are called its *port numbers* at *u* and at *v*. Port numbering is *local*, i.e., there is no relation between port numbers at *u* and at *v*. An agent entering a node learns the port of entry and the degree of the node. Note that, in the absence of port numbers, rendezvous is usually impossible, as all ports at a node look identical to an agent and the adversary may prevent the agent from taking some edge incident to the current node.

In traditional formulations of the rendezvous problem, meeting is accomplished when agents get to the same node in the same round. We want to achieve a more demanding goal, called *rendezvous with detection*: agents must become aware that the meeting is accomplished, simultaneously declare this and stop. This awareness depends on how an agent can communicate to the other agent its presence at a node. We use two variations of the *beeping model* of communication. In each round an agent can either listen, i.e., stay silent, or beep, i.e., emit a signal. In the *local beeping model*, an agent hears a beep in a round if it listens in this round and if the other agent is at the same node and beeps. In the *global beeping model*, an agent hears a *loud* beep in a round if it listens in this round and if the other agent is at the same node and beeps, and it hears a *soft* beep in a round if it listens in this round and if the other agent is at some other node and beeps. The beeping model was introduced in [8] for vertex coloring and used in [1] to solve the MIS problem. In the variant from [1, 8] the beeping entities were nodes rather than agents, and beeps of a node were heard at adjacent nodes. The beeping model is widely applicable, as it makes small demands on communicating devices, relying only on carrier sensing. In the case of mobile agents, the local and the global beeping models are applicable in different settings. The local model is applicable even for agents having very weak transmissions capabilities, limiting reception of a beep to the same node. The global model is applicable for more powerful agents, that can beep sufficiently strongly to be heard in the entire network, and having a listening capability of differentiating a beep emitted at the same node from a beep emitted at a different node.

It should be noted that our local beeping model is an extremely weak way of communication between agents: they can communicate only when residing simultaneously at the same node, they cannot hear when they beep, and messages are the simplest possible. In fact, as mentioned in [8], beeps are an even weaker way of communicating than using one-bit messages, as the latter ones allow three different states (0,1 and no message), while beeps permit to differentiate only between a signal and its absence. Clearly, without any communication, rendezvous with detection is impossible, as agents cannot become aware of each other’s presence at a node. Notice also that in the global beeping model it would not be possible to remove the distinction between hearing a loud beep when the beeping agent is at the same node and hearing a soft beep when the beeping agent is at a different node. Indeed, the same strength of beep reception would make it impossible for an agent *A* to inform the other agent *B* of the presence of *A* at the same node, and hence rendezvous with detection would be impossible. The global beeping model is at least as strong as the local one, in the sense that any algorithm of rendezvous with detection working in the local model works also in the global model, by simply ignoring soft beeps. We will see that the converse is not true.

For a given network, the execution time of an algorithm of rendezvous with detection, for agents with given labels starting in given rounds from given initial positions, is the number of rounds from the activation of the later agent to the declaration of rendezvous. For a given class of networks, the *time* of an algorithm of rendezvous with detection is its worst-case execution time, over all networks in the class, all initial positions, all pairs of distinct labels and all starting times.

**Our Results.** Our first result answers the basic question: Is it possible to achieve rendezvous with detection in arbitrary networks, and if so, how fast it can be done? We present a deterministic algorithm of rendezvous with detection working, even for the local beeping model, in an arbitrary unknown network in time polynomial in the size of the network and in the length of the smaller label (i.e., in the logarithm of this label). We do not assume the knowledge of any upper bound on the size of the network. The time complexity of our algorithm matches that of the fastest, known to date, rendezvous algorithm without detection, constructed in [21].

However, in this algorithm, agents spend a lot of energy: the number of moves of an agent is proportional to the time of rendezvous. On the other hand, in many applications, e.g., when agents are mobile robots, they are battery-powered devices, and hence the energy that an agent can spend on moves is limited. It is thus natural to ask if *bounded-energy agents*, i.e., agents that can make at most *c* moves, for some integer *c*, can always achieve rendezvous with detection as well. This is impossible for some networks of unbounded size. Hence we rephrase the question: Can bounded-energy agents always achieve rendezvous with detection in bounded-size networks? We prove that the answer to this question is positive, even in the local beeping model but, perhaps surprisingly, this ability comes at a steep price of time: the meeting time of bounded-energy agents is *exponentially* larger than that of unrestricted agents. By contrast, we show an algorithm for rendezvous with detection in the global beeping model that works for bounded-energy agents (in bounded-size networks) as fast as for unrestricted agents. Since algorithms for bounded-energy agents can work only for networks of bounded size, in these algorithms we assume knowledge of some such upper bound. Due to space constraints, proofs will appear in the journal version of the paper.

**Related Work.** The vast literature on rendezvous can be divided according to the mode in which agents move (deterministic or randomized) and the environment where they move (a network modeled as a graph or a terrain in the plane). An extensive survey of randomized rendezvous in various scenarios can be found in [2], cf. also [3, 16]. Rendezvous of two or more agents in the plane has been considered e.g., in [12, 13].

Our paper is concerned with deterministic rendezvous in networks, surveyed in [19]. In this setting a lot of effort has been dedicated to the study of the feasibility of rendezvous, and to the time required to achieve this task, when feasible. For instance, deterministic rendezvous with agents equipped with tokens used to mark nodes was considered, e.g., in [17]. Time of deterministic rendezvous of agents equipped with unique labels was discussed in [10, 21]. Memory required by the agents to achieve deterministic rendezvous has been studied in [4, 14] for trees and in [9] for general graphs. In [18] the authors studied tradeoffs between the time of rendezvous and the total number of edge traversals by both agents until the meeting.

Apart from the synchronous model used in this paper, several authors have investigated asynchronous rendezvous in the plane [7, 12, 13] and in network environments [5, 11]. In the latter scenario the agent chooses the edge which it decides to traverse but the adversary controls the speed of the agent. Under this assumption rendezvous in a node cannot be guaranteed even in very simple graphs, and hence the rendezvous requirement is relaxed to permit the agents to meet inside an edge.

## 2 Preliminaries

In the rest of the paper the word “graph” means a simple connected undirected graph modeling a network. The *size* of a graph is the number of its nodes. In this section we recall two procedures known from the literature, that will be used as building blocks in our algorithms. The aim of the first procedure is graph exploration, i.e., visiting all nodes of a graph by a single agent. The procedure, called *EXP*(*m*), is based on universal exploration sequences (UXS) [15], and follows from the result of Reingold [20]. Given any positive integer *m*, it allows the agent to visit all nodes of any graph of size at most *m*, starting from any node of this graph, using *R*(*m*) edge traversals, where *R* is some polynomial. After entering a node of degree *d* by some port *p*, the agent can compute the port *q* by which it has to exit; more precisely \(q=(p+x_i)\mod d\), where \(x_i\) is the corresponding term of the UXS.

The second procedure, due to Ta-Shma and Zwick [21], guarantees rendezvous (without detection) in an arbitrary graph. Below we briefly sketch this procedure, which will be used in our algorithm of rendezvous with detection for unrestricted agents.

Let \(\mathbb {Z}^+\) denote the set of positive integers and let \(\mathbb {Z}^*\) denote the set of integers greater or equal than \(-1\). For any positive integer *L*, Ta-Shma and Zwick define a function \(\varPhi _L: \mathbb {Z}^+ \times \mathbb {Z}^+ \times \mathbb {Z}^* \longrightarrow \mathbb {Z}^*\). The function \(\varPhi _L\) is *applied* by an agent with label *L* in a graph *G* at a node *v* of *G* as follows. Let \(v_0=v\) and let \(v_1\) be the node adjacent to \(v_0\), such that the edge \(\{v_0,v_1\}\) has port number 1 at \(v_0\). Suppose that nodes \(v_0,v_1,\dots , v_{t-1}\) are already constructed, so that \(v_{i+1}\) either equals \(v_i\) or is adjacent to \(v_i\). The node \(v_t\) is defined as follows. In the case when \(v_{t-1}=v_{t-2}\) and the degree of \(v_{t-1}\) is *d*, then \(v_t=v_{t-1}\) if \(\varPhi _L(t,d,-1)=-1\); if \(\varPhi _L(t,d,-1)=q\ge 0\) then \(v_t\) is the node adjacent to \(v_{t-1}\) such that the port number at \(v_{t-1}\) corresponding to edge \(\{v_{t-1},v_t\}\) is *q*. In the case when \(v_{t-1}\ne v_{t-2}\), the port number at \(v_{t-1}\) corresponding to edge \(\{v_{t-1},v_{t-2}\}\) is *p* and the degree of \(v_{t-1}\) is *d*, then \(v_t=v_{t-1}\) if \(\varPhi _L(t,d,p)=-1\); if \(\varPhi _L(t,d,p)=q>0\) then \(v_t\) is the node adjacent to \(v_{t-1}\) such that the port number at \(v_{t-1}\) corresponding to edge \(\{v_{t-1},v_t\}\) is *q*. Hence the application of function \(\varPhi _L\) at node *v* defines an infinite walk of the agent with label *L* in the graph *G*. This walk starts at *v* and in each round *t* the agent either stays at the current node or moves to an adjacent node by a port determined by the function \(\varPhi _L\) on the basis of the degree of the current node and of the port by which the agent entered it. A round *t* is called *active* for the agent if \(v_t \ne v_{t-1}\) and it is called *passive* if \(v_t=v_{t-1}\).

The following result, proved in [21], guarantees rendezvous without detection in polynomial time, if two agents apply functions \(\varPhi _L\) corresponding to their labels, in an unknown graph.

**Theorem 1**

There exists a polynomial *P* in two variables, with the following property. Let *G* be an *n*-node graph and consider two agents with distinct labels \(L_1\), \(L_2\) respectively, starting at nodes *v* and *w* of the graph in rounds \(t_1 \ge t_2\). Let \(t\ge t_1\) and let \(\ell \) be the smaller label. If agent with label \(L_i\) applies function \(\varPhi _{L_i}\) at its starting node, for \(i=1,2\), then agents are simultaneously at the same node in some round of the time interval \([t,t+P(n,\log \ell )]\). Moreover, rendezvous occurs in a round which is active for one of the agents and passive for the other. The same property remains true if one of the agents is inert and the other agent applies its function \(\varPhi _{L_i}\).

## 3 Rendezvous with Detection of Unrestricted Agents

In this section we describe and analyze an algorithm of rendezvous with detection which works for unrestricted agents, i.e., for agents that can spend an arbitrary amount of energy on moves. It works even for the weaker of our two models, i.e., for the local beeping model. Our algorithm uses the following procedure which describes an infinite walk of an agent with label *L*, based on the above described application of the function \(\varPhi _L\).

**Procedure**Beeping walk. Consider an agent with label *L* starting at node *v* of a graph *G*. Let *W* be the walk resulting from the application of \(\varPhi _L\) in graph *G* at node *v*. Each round of *W* is replaced by 2 consecutive rounds as follows. If round *t* of *W* is passive, i.e., \(v_t=v_{t-1}\), then this round is replaced by two rounds in which the agent stays at \(v_t\) and listens. If round *t* of *W* is active, i.e., \(v_t\ne v_{t-1}\), then this round is replaced by the following two rounds: in the first of these rounds the agent goes to \(v_t\) and beeps, and in the second of these rounds the agent stays at \(v_t\) and listens.

We now show that Algorithm RV-with-detection correctly accomplishes rendezvous with detection and works in time polynomial in the size of the graph and in the logarithm of the smaller label. The agent that starts later will be called the *later* agent and the other one the *earlier* agent. If agents start simultaneously, these qualifiers are attributed arbitrarily.

**Theorem 2**

Consider two agents with distinct labels \(L_1\), \(L_2\) respectively, starting at nodes *v* and *w* of an *n*-node graph in possibly different rounds. Let \(\ell \) be the smaller label. If both agents execute Algorithm RV-with-detection, then they meet and simultaneously declare rendezvous in time \(O(P(n,\log \ell ))\), i.e., polynomial in *n* and in \(\log \ell \), after the start of the later agent.

## 4 Rendezvous with Detection of Bounded-Energy Agents

In this section we study rendezvous with detection of agents that can perform a bounded number of moves. Let *c* be a positive integer. A *c*-*bounded agent* is defined as an agent that can perform at most *c* moves. (Notice that we do not restrict the number of beeps; indeed, the amount of energy required to make a move is usually so much larger than the amount of energy required to beep that ignoring the latter seems to be a reasonable approximation of reality in many applications.) Can *c*-bounded agents, for some integer *c*, perform rendezvous with detection in arbitrary graphs? The answer to this question is, of course, negative, even if detection is not required. For any integer *c*, *c*-bounded agents starting at distance larger than 2*c* cannot meet because at least one of them would have to make more than *c* steps. Even if we assume that the initial distance between the agents is 1, meeting of *c*-bounded agents is impossible in some graphs. Indeed, consider two *n*-node stars whose centers are linked by an edge, with agents starting at the centers of the stars. In the worst case, at least one of the agents must make at least \(n-1\) steps before meeting (to find the connecting edge), which is impossible for *c*-bounded agents, when *n* is large.

Thus, we rephrase the question: Can *c*-bounded agents always achieve rendezvous with detection in bounded-size graphs? More precisely, for any integer *n*, does there exist an integer *c*, such that *c*-bounded agents can achieve rendezvous with detection in all graphs of size at most *n*? (Notice that, for example, Algorithm RV-with-detection cannot be used here. In this algorithm, the number of steps performed by an agent with label *L* is proportional to \(P(n,\log L)\), and hence, even when the size *n* of the graph is bounded, this number can be arbitrarily large.) The answer to our question turns out to be positive, even in the local beeping model. Below we describe an algorithm that performs this task.

### 4.1 Bounded-Energy Agents in the Local Beeping Model

Our algorithm uses the following procedure, for an integer parameter *n*.

**Procedure**Beeping exploration (*n*). Let *EXP*(*n*) be the procedure described in Sect. 2 that permits exploration of all graphs of size at most *n*. Replace each round *r* of *EXP*(*n*) by three consecutive rounds as follows. If in round *r* of *EXP*(*n*) the agent takes port *p* to move to node *w*, then in the first of the three replacing rounds the agent takes port *p* to move to *w* and beeps, and in the second and third of the replacing rounds it stays at *w* and listens.

Hence, in each of the three rounds replacing a round *r* of *EXP*(*n*), the agent is at the same node in Procedure Beeping exploration (*n*) as it is in Procedure *EXP*(*n*) in round *r*.

We now describe our algorithm for rendezvous with detection of bounded-energy agents, executed by an agent with label *L* in a graph of size at most *n*. Recall that *R*(*n*) is the execution time of *EXP*(*n*). The idea of the algorithm is the following. Its main block consists of two executions of Procedure Beeping exploration (*n*) between which a long *waiting period* is inserted, during which the agent is silent (it listens) and inert. The length of this period depends on the label of the agent. We will prove that, regardless of the delay between the starting times of the agents, an entire execution of Procedure Beeping exploration (*n*) of one of the agents must either fall within the waiting period of the other agent, or must be executed after both executions of this procedure by the other agent. This main block of the algorithm executed by a given agent is interrupted in one of the two cases: either when (a) the agent hears a beep during its waiting period or after completing its main block, or when (b) it hears beeps in two consecutive rounds during one of the executions of Procedure Beeping exploration (*n*). In case (a) the agent responds by beeps in two consecutive rounds, declares rendezvous in the next round and stops. In case (b) it declares rendezvous in the next round and stops.

*L*in a graph of size at most

*n*. During the executions of Procedure Beeping exploration (

*n*), a boolean variable

*waiting*is set to false, and during the waiting period and after the second execution of Procedure Beeping exploration (

*n*) it is set to true. We use a boolean valued function condition which takes the variable

*waiting*as input, and returns, after each round, the boolean value of the expression (

*waiting*

**and**you hear a beep)

**or**(\(\lnot waiting\)

**and**you hear beeps in two consecutive rounds)

**Theorem 3**

For any positive integer constant *n* there exists a positive integer *c*, such that Algorithm Bounded-energy-RV-with-detection can be executed by *c*-bounded agents in any graph of size at most *n*. If two such agents with distinct labels execute this algorithm in such a graph, then they meet and simultaneously declare rendezvous in time \(O(\ell ^*)\) after the start of the later agent, where \(\ell ^*\) is the larger label.

It is interesting to compare the time sufficient to complete the task of rendezvous with detection, given by Algorithm RV-with-detection for unrestricted agents, with the time given by Algorithm Bounded-energy-RV-with-detection for bounded-energy agents. This comparison is meaningful on the class of graphs for which both types of agents can achieve rendezvous with detection, i.e., for graphs of bounded size. Consider the class \(C_n\) of graphs of size at most *n*, for some constant *n*, and consider *c*-bounded agents for some integer *c* large enough to achieve rendezvous with detection on the class \(C_n\) using Algorithm Bounded-energy-RV-with-detection. By Theorem 2, unrestricted agents can accomplish rendezvous with detection in time \(O(P(n,\log \ell ))\), i.e., since *n* is constant, in time *polylogarithmic in the smaller label*. By contrast, by Theorem 3, bounded-energy agents can accomplish rendezvous with detection in time \(O(\ell ^*)\), i.e., *linear in the larger label*. It is natural to ask if this exponential gap in time, due to energy restriction, is unavoidable. The following lower bound shows that the answer to this question is yes. In fact, this lower bound holds even for the two-node graph, even with simultaneous start of the agents, and even for rendezvous without detection.

**Theorem 4**

Let *c* be a positive constant. In the local beeping model, the time of rendezvous on the two-node graph of *c*-bounded agents with labels from the set \(\{1,\dots , M\}\) is \(\varOmega (\root c \of {M})\).

Theorem 4 implies that in the local beeping model, any rendezvous algorithm for bounded-energy agents must have time at least \(\varOmega (\root c \of {\ell ^*})\), where \(\ell ^*\) is the larger label and *c* is some constant. Theorems 2, 3 and 4 imply the following corollary.

**Corollary 1**

Rendezvous with detection of bounded-energy agents is feasible in the class of bounded-size graphs in the local beeping model, but its time must be exponentially larger than the best time of rendezvous with detection of unrestricted agents in this class of graphs.

### 4.2 Bounded-Energy Agents in the Global Beeping Model

Our final result shows that in the stronger of our two models, i.e., the global beeping model, the lower bound on time proved in Theorem 4 does not hold anymore. In fact, we show that in this model, bounded-energy agents can meet with detection in the class of bounded-size graphs in time logarithmic in the smaller label. We will also prove that this time is optimal even in the two-node graph.

The high-level idea of the algorithm is to first break symmetry between the agents in time logarithmic in the smaller label, without making any moves, using the possibility of hearing the beeps of the other agent, wherever it is in the graph. Then one of the agents remains idle and the other agent finds it using a bounded number of moves. Correct declaration of rendezvous is possible due to the distinction between hearing *loud* and *soft* beeps.

The main conceptual difference between Algorithm RV-with-detection (that works even for the local model) and our present algorithm for the global model is that the former breaks symmetry between agents *while they move*, which results in the number of moves polynomial in two parameters: *n* (which can be neglected for bounded *n*) *and in the logarithm of the smaller label*. Thus the total number of moves can be arbitrarily large even for bounded-size networks, and hence impossible for bounded-energy agents. By contrast, our present algorithm uses the possibility of hearing the other agent regardless of its position in the graph to break symmetry between the agents *with no moves*, then fixes one agent and uses an exploration algorithm for the other agent, instead of using a rendezvous algorithm. In bounded-size networks this makes a crucial difference because, unlike rendezvous, exploration can be performed using a bounded number of moves, and hence can be executed by bounded-energy agents.

We first define the following transformations of the label *L* of an agent. Let \((c_1\dots c_k)\) be the binary representation of the label *L*. Let \(T_1(L)\) be the binary sequence \((01c_1c_1c_2c_2\dots c_kc_k01)\), and let \(T_2(L)\) be the result of replacing each bit 0 of \(T_1(L)\) by the string (00) and each bit 1 by the string (10). Note that the length of the binary string \(T_2(L)\) is \(2(2k+4)\in O(\log L)\).

*L*and called upon the activation of the agent, does not involve any moves and permits to break symmetry between any two agents with different labels.

**Lemma 1**

Upon completion of Procedure Symmetry-breaking, both agents declare the same round to be *red*. For one of the agents round *red* is the next round after it heard a beep for the first time, and this agent sets \(role:=waiting\). For the other agent round *red* is two rounds after it heard a beep for the first time, and this agent sets \(role:=walking\). The round declared *red* is \(O(\log \ell )\) rounds after the activation of the later agent, where \(\ell \) is the smaller label.

We will also use a modified version of Procedure Beeping-exploration, described at the beginning of this section, for an integer parameter *n*.

**Procedure**Modified-beeping-exploration (*n*). Let *EXP*(*n*) be the procedure described in Sect. 2 that permits exploration of all graphs of size at most *n*. Replace each round *r* of *EXP*(*n*) by two consecutive rounds as follows. If in round *r* of *EXP*(*n*) the agent takes port *p* to move to node *w*, then in the first of the two replacing rounds the agent takes port *p* to move to *w* and beeps, and in the second replacing round it stays at *w* and listens.

Hence, in each of the two rounds replacing a round *r* of *EXP*(*n*), the agent is at the same node in Procedure Modified-beeping-exploration (*n*) as it is in Procedure *EXP*(*n*) in round *r*.

*L*in a graph of size at most

*n*.

**Theorem 5**

For any positive integer constant *n* there exists a positive integer *c*, such that Algorithm Fast-bounded-energy-RV-with-detection can be executed by *c*-bounded agents in any graph of size at most *n*, in the global beeping model. If two such agents with distinct labels execute this algorithm in such a graph, then they meet and simultaneously declare rendezvous in time \(O(\log \ell )\) after the start of the later agent, where \(\ell \) is the smaller label. This time is optimal, even in the two-node graph.

## 5 Conclusion

We presented three algorithms of rendezvous with detection. The first two of them work even in the local beeping model: one for unrestricted agents in arbitrary graphs, and the other for bounded-energy agents in bounded-size graphs. We showed that in the latter case the meeting time of bounded-energy agents must be exponentially larger than the best time of rendezvous with detection of unrestricted agents. More precisely, in order to meet in bounded-size graphs, bounded-energy agents must use time polynomial in the larger label, while unrestricted agents can meet in time polylogarithmic in the smaller label. The third algorithm works for bounded-energy agents only in the global beeping model, but it is much faster: it enables such agents to perform rendezvous with detection in bounded-size graphs in time logarithmic in the smaller label, which is optimal.

Rendezvous with detection may be considered as a preprocessing procedure for other important tasks in graphs. One of them is the task of constructing a map of an unknown graph by an agent. It is well known that this task cannot be accomplished by a single agent operating in a graph, if it cannot mark nodes (e.g., a single agent cannot learn the size of an oriented ring). For the same reason it cannot be accomplished by two non-communicating agents, as they would not be aware of the presence of each other, and thus each of them would act as a single agent. By contrast, our algorithms of rendezvous with detection in the beeping model can serve, with a simple addition, to achieve map construction by the agents: the algorithm working for arbitrary agents can be used to accomplish this task in arbitrary graphs, and the algorithms working for bounded-energy agents can be used to accomplish this task in bounded-size graphs. This addition can be described as follows. Note that, in all our algorithms, at the time when agents declare rendezvous, symmetry between them is broken: in the case of algorithms in the local model, one of the agents heard two beeps at the meeting node, and the other agent heard only one beep, and in the case of the algorithm in the global model, one of the agents has *role* set to *waiting* and the other to *walking*. Hence agents can start simultaneously the following procedure in the round after rendezvous declaration. The first agent stays inert and acts as a stationary token, beeping in every second round, while the second agent silently executes exploration with a stationary token (at the end of which it acquires the map of the graph), cf. e.g., [6], replacing each exploration round by two rounds, in the first of which it moves as prescribed and in the second it stays inert. Beeps of the inert agent allow the circulating silent agent to recognize the token at each visit and complete exploration and map construction. At the end of the exploration, the second agent is with the first one and can inform it of the end of the exploration by beeping in the last round, in which the first agent is silent (listens). Then the roles of the agents may change to allow the previously inert agent to acquire the map in its turn. (Note that an agent cannot efficiently communicate the already acquired map due to the restrictive communication model.)

### References

- 1.Afek, Y., Alon, N., Bar-Joseph, Z., Cornejo, A., Haeupler, B., Kuhn, F.: Beeping a maximal independent set. In: Peleg, D. (ed.) Distributed Computing. LNCS, vol. 6950, pp. 32–50. Springer, Heidelberg (2011)CrossRefGoogle Scholar
- 2.Alpern, S., Gal, S.: The Theory of Search Games and Rendezvous. International Series in Operations Research and Management Science. Kluwer Academic Publisher, Dordrecht (2002)Google Scholar
- 3.Anderson, E., Fekete, S.: Two-dimensional rendezvous search. Oper. Res.
**49**, 107–118 (2001)MATHMathSciNetCrossRefGoogle Scholar - 4.Baba, D., Izumi, T., Ooshita, F., Kakugawa, H., Masuzawa, T.: Space-optimal rendezvous of mobile agents in asynchronous trees. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 86–100. Springer, Heidelberg (2010)CrossRefGoogle Scholar
- 5.Bampas, E., Czyzowicz, J., Gąsieniec, L., Ilcinkas, D., Labourel, A.: Almost optimal asynchronous rendezvous in infinite multidimensional grids. In: Lynch, N.A., Shvartsman, A.A. (eds.) DISC 2010. LNCS, vol. 6343, pp. 297–311. Springer, Heidelberg (2010)CrossRefGoogle Scholar
- 6.Chalopin, J., Das, S., Kosowski, A.: Constructing a map of an anonymous graph: applications of universal sequences. In: Lu, C., Masuzawa, T., Mosbah, M. (eds.) OPODIS 2010. LNCS, vol. 6490, pp. 119–134. Springer, Heidelberg (2010)CrossRefGoogle Scholar
- 7.Cieliebak, M., Flocchini, P., Prencipe, G., Santoro, N.: Distributed computing by mobile robots: gathering. SIAM J. Comput.
**41**, 829–879 (2012)MATHMathSciNetCrossRefGoogle Scholar - 8.Cornejo, A., Kuhn, F.: Deploying wireless networks with beeps. In: Lynch, N.A., Shvartsman, A.A. (eds.) DISC 2010. LNCS, vol. 6343, pp. 148–162. Springer, Heidelberg (2010)CrossRefGoogle Scholar
- 9.Czyzowicz, J., Kosowski, A., Pelc, A.: How to meet when you forget: log-space rendezvous in arbitrary graphs. Distrib. Comput.
**25**, 165–178 (2012)MATHCrossRefGoogle Scholar - 10.Dessmark, A., Fraigniaud, P., Kowalski, D., Pelc, A.: Deterministic rendezvous in graphs. Algorithmica
**46**, 69–96 (2006)MATHMathSciNetCrossRefGoogle Scholar - 11.Dieudonné, Y., Pelc, A., Villain, V.: How to meet asynchronously at polynomial cost. In: Proceedings of the 32nd ACM Symposium on Principles of Distributed Computing (PODC 2013), pp. 92–99 (2013)Google Scholar
- 12.Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Gathering of asynchronous robots with limited visibility. Theor. Comput. Sci.
**337**, 147–168 (2005)MATHMathSciNetCrossRefGoogle Scholar - 13.Flocchini, P., Santoro, N., Viglietta, G., Yamashita, M.: Rendezvous of two robots with constant memory. In: Moscibroda, T., Rescigno, A.A. (eds.) SIROCCO 2013. LNCS, vol. 8179, pp. 189–200. Springer, Heidelberg (2013)CrossRefGoogle Scholar
- 14.Fraigniaud, P., Pelc, A.: Delays induce an exponential memory gap for rendezvous in trees. ACM Trans. Algorithms, 9 (2013). Article 17Google Scholar
- 15.Koucký, M.: Universal traversal sequences with backtracking. J. Comput. Syst. Sci.
**65**, 717–726 (2002)MATHCrossRefGoogle Scholar - 16.Kranakis, E., Krizanc, D., Morin, P.: Randomized Rendez-Vous with limited memory. In: Laber, E.S., Bornstein, C., Nogueira, L.T., Faria, L. (eds.) LATIN 2008. LNCS, vol. 4957, pp. 605–616. Springer, Heidelberg (2008)CrossRefGoogle Scholar
- 17.Kranakis, E., Krizanc, D., Santoro, N., Sawchuk, C.: Mobile agent rendezvous in a ring. In: Proceedings of the 23rd International Conference on Distributed Computing Systems (ICDCS 2003), pp. 592–599 (2003)Google Scholar
- 18.Miller, A., Pelc, A.: Time versus cost tradeoffs for deterministic rendezvous in networks. In: Proceedings of 33rd Annual ACM Symposium on Principles of Distributed Computing (PODC 2014), pp. 282–290 (2014)Google Scholar
- 19.Pelc, A.: Deterministic rendezvous in networks: a comprehensive survey. Networks
**59**, 331–347 (2012)MathSciNetCrossRefGoogle Scholar - 20.Reingold, O.: Undirected connectivity in log-space. J. ACM
**55**, 1–24 (2008)MathSciNetCrossRefGoogle Scholar - 21.Ta-Shma, A., Zwick, U.: Deterministic rendezvous, treasure hunts and strongly universal exploration sequences. In: Proceedings of 18th ACM-SIAM Symposium on Discrete Algorithms (SODA 2007), pp. 599–608 (2007)Google Scholar