This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Sister Nivedita University, West Bengal, [email protected][OrcidId:0000-0002-0546-3894] Indian Institute of Technology Guwahati, Assam, [email protected][OrcidId:0000-0003-1517-8779] Jadavpur University, West Bengal, [email protected][OrcidId:0009-0002-0161-5341] Indian Institute of Technology Guwahati, Assam, [email protected] \CopyrightJane Open Access and Joan R. Public \ccsdesc[100]Replace ccsdesc macro with valid one

Acknowledgements.
I want to thank …\EventEditorsSilvia Bonomi and Etienne Rivière \EventNoEds2 \EventLongTitleConference on Principles of Distributed Systems (OPODIS 2024) \EventShortTitleOPODIS 2024 \EventAcronymOPODIS \EventYear2024 \EventDateDecember 11–13, 2024 \EventLocationLucca, Italy \EventLogo \SeriesVolume \ArticleNo

Perpetual Exploration of a Ring in Presence of Byzantine Black Hole

Pritam Goswami    Adri Bhattacharya    Raja Das    Partha Sarathi Mandal
Abstract

Perpetual exploration stands as a fundamental problem in the domain of distributed mobile agent algorithms, where the objective is to ensure that each node within a graph is visited by at least one agent infinitely often. While this issue has received significant attention, particularly concerning ring topologies, the presence of malicious nodes, referred to as black holes, adds more complexity. A black hole can destroy any incoming agent without leaving any trace of its existence.

In [2, 18], the authors have considered this problem in the context of periodic data retrieval. They introduced a variant of black hole called gray hole (where the adversary chooses whether to destroy an agent or let it pass) among others, and showed that 4 asynchronous and co-located agents are necessary and sufficient to solve the periodic data retrieval problem (hence perpetual exploration) in the presence of such a gray hole if each of the nodes of the ring has a whiteboard.

This paper investigates the exploration of a ring by introducing a realistic variant of gray hole, termed as a “Byzantine black hole”. In addition to the capabilities of a gray hole, the adversary can also choose whether to erase any previously stored information on that node.

Note that in [2, 18], the authors only considered one particular initial scenario (i.e., agents are initially co-located) and one specific communication model (i.e., whiteboard). Now, there can be many other initial scenarios where all agents might not be co-located (i.e., they may be scattered). Also, there are many weaker communications models such as Face-to-Face, Pebble where this perpetual exploration problem is yet to be investigated, in presence of a Byzantine black hole.

The main results of our paper emphasize minimizing the number of agents while guaranteeing that they perform the perpetual exploration on a ring even in the presence of a Byzantine black hole under different communication models and for different starting scenarios. On the positive side, as a byproduct of our work, we achieved a better upper and lower bound result (i.e., 3 agents) for perpetual exploration in the presence of a Byzantine black hole (which is a more generalized version of a gray hole), by trading-off the scheduler capability, when the agents are initially co-located, and each node contains a whiteboard.

keywords:
Mobile Agents, Exploration, Ring, Black Hole, Malicious host, Byzantine Fault
category:
\relatedversion

1 Introduction

Exploring a set of nodes in a network is one of the fundamental tasks in the domain of distributed computing by mobile agents, formulated in the year of 1951 by Shannon [20]. Now, the security of these mobile agents while exploring these networks is one of the important issues that need to be addressed. Among all the possible security threats that are addressed yet in literature, two among them are the most prominent, i.e., the threats from a malicious agent [17] and the threats from a malicious host [13]. In this paper, we are interested in the latter case, where the threats are from a malicious host. This host is a stationary node in the network, which has the ability to destroy any incoming agents without leaving any trace of its existence. So, the first task of the mobile agents operating in the network must be to locate this malicious node. Note that the most trivial optimisation parameter to ensure while locating this malicious host (also termed as a black hole), is that a minimum number of agents gets destroyed by this node. This problem of locating the black hole by mobile agents is termed as black hole search (also termed as BHS problem) problem. BHS problem is studied from the year 2006, when Dobrev et al. [12] first introduced it. After which, till date, there have been many variations to this problem, some of them are [7, 8, 11, 13, 15]. This problem has various real life implications, such as the black hole can be a virus in the network or it can be some crash failure, such that this node resembles the characteristic of a black hole, after the failure.

Observe that, to detect the black hole, there needs to be some agent that has to visit that particular node. Further, since any agent visiting the node gets destroyed, there must be some communication tool, that can render this information to other alive agents, such that at least one agent remains alive, knowing the location of the black hole. Three such communication tools have been predominantly used in literature: a) whiteboard model [14], in which there is a storage capacity at each node, which an agent can use to leave a message by reading its contents and writing some new information, b) pebble model [16], an agent can carry a movable token from one node to another, c) face-to-face model [10], in this case, an agent can share and communicate with another agent when they are at the same node and at the same time. In addition to the communication tools, the initial locations of the agents (i.e., whether the agents are initially scattered [15] or they are co-located [10]) is also one of the important parameters, generally studied in the literature.

Further, the most studied version of a black hole has a fairly basic nature, i.e., only destroying any incoming agent. Note that, in reality black holes may not be so simple; they may have many ways to disrupt the movement or harm an agent. Considering this phenomenon, we in this paper have tried to consider a black hole that has more capabilities other than just destroying any incoming agent. In our case a black hole may or may not kill any incoming agent; it may do so based on an adversary, which decides when to destroy an incoming agent and when not to. Whenever it decides not to destroy an agent, it simply behaves like any other node in the network, disguising it from the rest of the nodes, and creating no anomaly for the visiting agent. In addition to this, we have also considered that the black hole has further capabilities; it can also choose whether to destroy the message (i.e., stored data in case of a whiteboard, and place the token in case of pebble) at that node along with the incoming agent. This choice is also maintained by an adversary as well. We call this kind of black hole a Byzantine black hole.

Our aim in this paper is to solve the problem of perpetual exploration in a network, i.e., visiting every node in the network infinitely often other than the Byzantine black hole, by the mobile agents. Previously, in [2, 18] the authors introduced a set of models for a black hole, which has more capabilities other than just destroying an agent, they term these malicious nodes as gray hole, gray+ hole and red hole, respectively based on their capabilities. They considered the following characteristics: they can fake agents, change the whiteboard contents, change the ports different from the requested ones, or can change the FIFO ordering as well. In this context, they solved perpetual exploration in a ring (which they term as periodic data retrieval problem) by a team of asynchronous mobile agents, under these aforementioned various black hole characteristics, in which the agents are initially co-located and each node in a network has a whiteboard. On the other hand, the results of above-mentioned papers only holds for the case, when initially the agents are co-located and each node of the ring has a whiteboard. Note that there can be many other initial positions for the agent to start with, and also, whiteboard is a very powerful communication tool in this domain of study of mobile agents. So, in this paper, we investigate these gaps in the context of perpetual exploration, considering the presence of one Byzantine black hole using synchronous agents. Also note that the position of a Byzantine black hole can be arbitrary (except the starting locations of the agent) but fixed. The Byzantine black hole we considered is a generalized version of the gray hole, as it also can choose whether to erase any previous data stored at that node, the moment it acts as a black hole.

1.1 Related Works

The black hole search (i.e., BHS) problem is a prominent variation of exploration problem studied in the literature. A survey of which can be found in [19]. This problem is investigated under various topologies (such as trees [8], rings [13], tori [5] and in arbitrary and unknown networks [7, 11]). All these discussed networks are static in nature. Recently, there has been a lot of interest in dynamic networks. The following papers [3, 4, 10], studied the BHS problem on dynamic ring, dynamic torus and dynamic cactus graph, where the underlying condition is that, irrespective of how many edges are dynamic in nature, the network must remain connected at any time interval (which is also termed as 1-interval connected). In rings, the BHS problem has been studied for different variants; the most predominant among them are choice of schedulers (i.e., synchronous [6] and asynchronous [1]), communication tools (i.e., face-to-face [7], pebble [16] and whiteboard [1]) and initial position of the agents (i.e., co-located [1] and scattered [6]).

The most relevant papers related to our work are the papers by Královič et al. [18] and by Bampas et al. [2]. The paper by Královič et al. [18] is the first to introduce a variant of this black hole, where the black hole has the ability to either choose to destroy an agent or let it pass (which they term as gray hole). Further they extended the notion of gray hole, where the gray hole has the following additional capabilities: it has the ability to alter the run time environment (i.e., changing the whiteboard information), or it has the ability to not to maintain communication protocol (i.e., do not maintain FIFO order). They solved this problem under an asynchronous scheduler on a ring, only when the agents are initially co-located and each node in the network has a whiteboard. The following results are obtained by them, they gave an upper bound of 9 agents for performing periodic data retrieval (i.e., which is equivalent to perpetual exploration) in the presence of a gray hole; further, in addition to gray hole, when the whiteboard is unreliable as well, they proposed an upper bound of 27 agents. Next, Bampas et al. [2] significantly improved the earlier results. They showed a non-trivial lower bound of 4 agents and 5 agents for gray hole case and for gray hole with unreliable whiteboard case, respectively. Further, with 4 agents as well, they obtained an optimal result for the gray hole case, whereas with 7 agents proposed a protocol for the case with gray hole and unreliable whiteboard. As far as we are aware, we are the first to investigate the perpetual exploration problem of a ring under different communication tools (i.e., face-to-face, pebble and whiteboard) as well as for different initial positions (i.e., co-located and scattered), for a variant of gray hole, where it can erase any previously stored information but can not alter it. We term this type of gray hole a Byzantine black hole. In the following part, we discuss the results we have obtained.
Our Contribution: In this paper, we investigate the perpetual exploration problem, by a team of synchronous mobile agents, of a ring RR of size nn, in the presence of a Byzantine black hole. First, we consider the case when the agents are initially co-located. We obtain the following results.
A: For Pebble model of communication, we obtain that 3 agents are necessary and sufficient to perpetually explore RR.
B: For Face-to-Face model of communication, we obtain that 5 agents are sufficient to perpetually explore RR.
C: For Whiteboard model as well, we achieve the same lower and upper bounds as mentioned in A. This result shows that, by considering the scheduler to be synchronous instead of asynchronous (as assumed in [2]), the tight bound on the number of agents to perpetually explore RR, reduces from 4 to 3.
Next, we consider the case, when the agents are initially scattered, and in this context, we obtain the following results:
D: For Pebble model of communication, we show that 4 agents are necessary and sufficient to explore RR perpetually .
E: For Whiteboard model of communication, we obtain an improved bound of 3 agents (in comparison to D), which is necessary and sufficient to explore the ring RR perpetually.
In the following Table 1, we have summarized the results.

Whiteboard Pebble Face-to-Face
Co-located Upper Bound 3 3 5
Lower Bound 3 3 3
Scattered Upper Bound 3 4
Lower Bound 3 4 Non-Constant [9]
Table 1: Summary of our results

Organisation: Rest of the paper is organised as follows. Section 2 presents model and preliminaries. In Section 3, we discuss some impossibility results. In Section 4 and 5, we propose perpetual exploration algorithms for the agents, when the agents are initially co-located and scattered, respectively. Lastly, we conclude in Section 6. Note that due to page restriction, detailed description of the algorithms and proofs of theorems and lemmas are referred to the Appendix.

2 Model and Preliminaries

In this paper, we consider the underlying topology of the network as an oriented ring R={v0,v1,,vn1}R=\{v_{0},v_{1},\dots,v_{n-1}\}. Each node viv_{i} (where i{0,1,,n1}i\in\{0,1,\dots,n-1\}) is unlabeled and has two ports connecting v(i1)modnv_{(i-1)\bmod{n}} and v(i+1)modnv_{(i+1)\bmod{n}}, labeled consistently as left and right. A set A={a0,a1,,ak1}A=\{a_{0},a_{1},\dots,a_{k-1}\} of kk agents operates in RR. We consider two types of initial positions for the set AA of agents. In the first type, each agent in AA is co-located at a node, which we term as their home. In the second type, the agents can start from several distinct nodes, which we term as scattered initial positions. Each agent has knowledge of the underlying topology RR and possesses some computational capabilities, thus requiring 𝒪(logn)\mathcal{O}(\log n) bits of internal memory. The agents have unique IDs of size 𝒪(logk)\mathcal{O}(\log k) bits taken from the set [0,kc][0,k^{c}] (cc is a constant), which are perceived by other agents when they are co-located. The agents are autonomous and execute the same set of rules (i.e., they execute the same algorithm).

We consider three types of communication that the agents have in order to communicate with other agents. Face-to-Face (F2F): In this model, an agent can communicate with another agent when they are co-located. Pebble: In this model, the agents are equipped with a movable token (also termed as “pebble”), which signifies a single bit of information. The agents can carry a pebble from one node in a fairly mutually exclusive way and also can drop it on any other node. Agents use this pebble to mark some special nodes, for other agents to distinguish it. Whiteboard: In this case, each node of RR contains 𝒪(logn)\mathcal{O}(\log n) bits of memory, which can be used to store and maintain information. Any agent can read the existing information or write any new information on the whiteboard of its current node. Note that fair mutual exclusion is maintained, i.e., concurrent access to the whiteboard data is not permitted.

The agents operate in synchronous rounds, and in each round, every agent becomes active and takes a local snapshot of its surroundings. For an agent at a node vv in some round rr, the snapshot contains two ports incident to vv, already stored data on the memory of vv (if any, only in the case of the whiteboard model of communication), the number of pebbles located at vv (if any, only in the case of the pebble model of communication), contents from its local memory, and IDs of other agents on vv. Based on this snapshot, an agent executes some action. This action includes a communication step and a move step. In a communication step, an agent can communicate implicitly or explicitly with other agents according to the communication models discussed above. In the move step, the agent can move to a neighbouring node by following a port incident to vv. Thus, if an agent at node vv in round rr decides to move during the move step, in round r+1r+1, it resides on a neighbour node of vv. All these actions are atomic, so an agent cannot distinguish another agent concurrently passing through the same edge; instead, it can only interact with another agent (based on its communication model) when it reaches another node.

A black hole is a stationary malicious node in an underlying graph, which has the ability to destroy any visiting agent without leaving any trace of its existence. Furthermore, the black hole nature of the node is controlled by an adversary. In addition to this, whenever the black hole nature is activated, the adversary can also choose to destroy any information stored at that node. We term this kind of node a Byzantine Black Hole.

In this paper, we assume that the underlying graph contains a single Byzantine black hole, while the other nodes are normal nodes, termed as safe nodes. It is assumed that the starting positions of each agent must be a safe node. This Byzantine black hole node is unknown to the agent. Here, we assume that if the adversary decides to activate the black hole nature of the Byzantine black hole node, it does so at the beginning of its corresponding round, and the node retains that nature until the end of this current round. Furthermore, we have considered that our Byzantine black hole has the ability always to destroy any incoming agent during its black hole nature and also choose to destroy any information present on that node. This paper aims to perpetually explore the ring RR with the minimum number of agents. Next, we formally define our problem:

Definition 2.1 (PerpExploration-BBH).

Given a ring network RR with nn nodes, where one node (vbv_{b}) is a Byzantine black hole, and with a set of agents AA positioned on RR, the PerpExploration-BBH, asks the agents in AA to move in such a way that each node of RR, except vbv_{b}, is visited by at least one agent infinitely often.

3 Impossibility Results

Here, at beginning, we state the first impossibility result which gives us a lower bound on minimum number of agents required to solve PerpExploration-BBH.

Theorem 3.1.

A set of two synchronous agents in a ring RR of size nn cannot solve PerpExploration-BBH, even in the presence of a whiteboard if number of possible consecutive black hole positions is at least 3.

The main idea of the proof of the above Theorem 3.1 is that we create a scenario using adversarial techniques, where after one agent is destroyed by the Byzantine black hole vbv_{b} (say), the other and only alive agent ends up with at least two possible choices for the position of the black hole, which in turn creates confusion for the agent. Hence it is unable to correctly detect the black hole node among these two sets of nodes. In this scenario it is impossible for the only alive agent to successfully explore the whole ring except vbv_{b} perpetually, either without correctly detecting the Byzantine black hole position, or without getting destroyed as well. As a direct implication of Theorem 3.1, we can have the following corollaries. (Please see Appendix in Section 7 for the detailed proof)

Corollary 3.2.

A set of three synchronous agents are required to solve the PerpExploration-BBH on a ring RR with nn nodes, where each node of RR has a whiteboard.

Note that this lower bound of 3 agents is also true for agents with the pebble model of communication, as the pebble model of communication can be easily simulated in the whiteboard communication model.

Corollary 3.3.

A set of two agents, each equipped with O(logn)O(\log n) pebbles, can not solve the PerpExploration-BBH problem on a ring RR with nn nodes.

Our next result further improves the lower bound for number of agents, when agents are scattered and have pebble model of communication.

Theorem 3.4.

A set of 3 scattered agents, each equipped with a pebble, can not solve the PerpExploration-BBH problem on a ring RR with nn nodes.

We have proved Theorem 3.4 using an adversarial technique. We created an instance of three copies of the same ring RR (i.e., R1R_{1}, R2R_{2} and R3R_{3}) in such a way that the position of Byzantine black hole (vb)v_{b}) are different in each of them but they are consecutive in RR. Also, in each case, the agents are initially placed at the nodes of RR, which are at a distance of equal length between each other. Now, when an agent is destroyed by vbv_{b}, the other two agents can not distinguish between these three copies (due to same information on nodes for each of them). So, the problem reduces to two agents with 3 pebbles solving PerpExploration-BBH where a number of possible consecutive black hole positions is at least three. Then by Corollary 3.3, we can have the desired result (For detailed proof, see Appendix in Section 8). Next, corollary is a direct consequence of Theorem 3.4.

Corollary 3.5.

A set of four scattered agents, each with a pebble, are required to solve PerpExploration-BBH on a ring RR with nn nodes.

4 Perpetual Exploration with Co-located Agents

In this section we assume that initially agents are co-located at a node which is termed as home. On the basis of this assumption here we investigate the sufficiency for the number of agents to solve PerpExploration-BBH problem under different model of communication.

4.1 Pebble Model of Communication

In this section, we consider the communication model, where the starting node has k1k-1 identical and movable tokens (termed as pebbles), where kk is the total number of agents deployed. A pebble can be carried by an agent from one node to another. This pebble acts as a mode of communication for the agents, as the agents can perceive the presence of a pebble at the current node. Moreover, an agent can also perceive the presence of other agents which are co-located at the current round (i.e., gather the IDs of the other co-located agents). Our main aim is to prove the following theorem in this section.

Theorem 4.1.

A team of 3 co-located, synchronous agents are necessary and sufficient to solve PerpExploration-BBH on a ring RR, with nn nodes under the pebble model of communication,with the presence of two pebbles initially co-located with the agents.

The necessary part follows from Corollary 3.3. For the sufficiency part we present an algorithm, PerpExplore-Coloc-Pbl. We have provided a very brief description of the algorithm. For detailed description and pseudo code see Appendix (Section 9).

Brief Description of the Algorithm: Given a ring RR with a Byzantine black hole node vbv_{b}, a set of agents, A={a1,a2,a3}A=\{a_{1},a_{2},a_{3}\} (where we assume, ID of a1<a_{1}\leavevmode\nobreak\ < ID of a2<a_{2}\leavevmode\nobreak\ < ID of a3a_{3}), are initially co-located at homehome. The agents have no knowledge about the position of the node vbv_{b}, the only set of knowledge the agents have are: the total number of nodes in the underlying topology RR (i.e., nn), and also the knowledge that the initial node, i.e., homehome is safe. So, the remaining arc of n1n-1 nodes in RR is a suspicious region (which we term as SS, where the cardinality of SS i.e., |S||S| denotes the length or size of the suspicious region) for each of the three agents.

The main idea of this algorithm is as follows: initially two agents a1a_{1} and a2a_{2} explores the ring perpetually, while a3a_{3} waits at the homehome. a1a_{1} and a2a_{2} explores the ring RR, executing the rule described as follows. If all the three agents are at homehome along with two pebbles, then in the rr-th round (r0r\geq 0), a1a_{1} moves clockwise with one pebble and it waits at round r+1r+1 for a2a_{2} to arrive. In round (r+1)(r+1), a2a_{2}, leaving the remaining pebble at homehome moves to the next node along clockwise direction to meet a1a_{1}. In the subsequent round, i.e., (r+2)(r+2)-th round, a1a_{1} after meeting a2a_{2} moves again to the next node in the clockwise direction and waits for 3 rounds (i.e., till (r+5)(r+5)-th round) for a2a_{2} if and only if a1a_{1} is not at homehome. In the mean time at (r+3)(r+3)-th round, a2a_{2} leaves its current node, moves one step in counter-clockwise direction, collects the left behind pebble. Then in (r+4)(r+4)-th round a2a_{2} moves again to the earlier node in clockwise direction. Subsequently, in (r+5)(r+5)-th round, a2a_{2} again leaves the pebble at its current node, and moves in a clockwise direction, to meet a1a_{1} (which is waiting at the current node for a2a_{2} to arrive), for better reference see Fig. 1. Note that, when a2a_{2} meets a1a_{1} outside homehome, the pebble it was carrying is left by a2a_{2} at the nearest counter-clockwise node of the meeting node (i.e., where a2a_{2} meets with a1a_{1}). Now from round (r+6)(r+6) onwards to (r+9)(r+9)-th round, the same execution repeats, as it has occurred between round (r+2)(r+2) to round (r+5)(r+5). The only difference is that, if both agents (i.e., a1a_{1} and a2a_{2}) at round r+2r+2 were at a node v1v_{1}, at round r+6r+6, they are on the nearest clockwise node of v1v_{1} (i.e., at v2v_{2}, say). This process continues until a1a_{1} reaches homehome. In this case a1a_{1} does not move clockwise, until a2a_{2} meets it with the pebble it was carrying, in that case, it waits further until a2a_{2} brings that pebble back at homehome. For this to happen after reaching homehome, 5 rounds are sufficient for waiting. When a2a_{2} reaches homehome with the pebble, then all 3 agents are again at the homehome with 2 pebbles. This way the 3 agents explore the ring. The exploration can hamper if either a1a_{1} or, a2a_{2}, or a pebble is destroyed by the Byzantine black hole vbv_{b} while the above mentioned procedure is executed by them.

Refer to caption
Figure 1: An execution of PerpExplore-Coloc-Pbl, starting from the configuration where a0a_{0} and a1a_{1} are together on a vertex, to the configuration where a0a_{0} and a1a_{1} are on the same vertex again, which is the clockwise neighbour of the earlier vertex. The red node is the byzantine black hole, the green node is the homehome and red boxes are pebbles.

Firstly, let only a1a_{1} is destroyed at some round tt. Then there must exists a round t<tt^{\prime}<t, when a2a_{2} was with a1a_{1} at some node v0v_{0} (say) for the last time. This means at round tt^{\prime}, a1a_{1} moved clockwise to the next node v1v_{1} along with the pebble it was carrying, and it must have been destroyed before or at the round when a2a_{2} reaches v1v_{1} again (in this case v1v_{1} is vbv_{b}). Now when a2a_{2} reaches v1v_{1} there can be two cases. Either a2a_{2} remains alive or (as the adversary may choose not to destroy a2a_{2}), it can get destroyed as well. For the initial case, a2a_{2} identifies the Byzantine black hole by not seeing a1a_{1} there and then it can leave that node and can explore the ring perpetually avoiding the node. The latter case is equivalent to both a1a_{1} and a2a_{2} are destroyed by the Byzantine black hole vb=v1v_{b}=v_{1}. Note that since outside homehome whenever a2a_{2} reaches the same node of a1a_{1}, it leaves behind a pebble at the nearest counter-clockwise node (here v0v_{0}). For this case, another agent (i.e., a3a_{3}) which was waiting at homehome, finds none of the two exploring agents returns at homehome, even after waiting for a sufficient number of rounds. This incident triggers a3a_{3} to move clockwise until it finds a pebble (one that is left behind by a2a_{2} at v0v_{0}). Whenever the pebble is found, a3a_{3} knows that the next clockwise node is the Byzantine black hole and it starts exploring RR avoiding that node.

Now, there can be two other cases that can hamper the above mentioned exploring procedure. For the first case, let only a2a_{2} is destroyed at some round t>0t>0. Let t<tt^{\prime}<t be the last round before tt when both a1a_{1} and a2a_{2} were together at a node v0v_{0}. At round tt^{\prime}, a1a_{1}, moves clockwise to the next node v1v_{1}. Now if a2a_{2} is not destroyed in the next 3 rounds, then it meets a1a_{1} at v1v_{1} again, contrary to our assumption. So, if only a2a_{2} is destroyed then it must be at any of the rounds t+1,t+2t^{\prime}+1,t^{\prime}+2 or t+3t^{\prime}+3. In this 3 round a2a_{2} can be either on v0v_{0} or v1v_{-1} where, v1v_{-1} is the counter-clockwise nearest node of v0v_{0}. In this case, when a1a_{1} finds a2a_{2} has not arrived at v1v_{1} even after waiting for 3 rounds, in which case, it understands that either v0v_{0} or v1v_{-1} is the Byzantine black hole. This knowledge triggers a1a_{1} to move clockwise until it meets a3a_{3} at homehome, leaving the pebble along with it behind at v1v_{1}. When a3a_{3} sees that even after certain round of waiting only a1a_{1} is able to arrive at homehome, and that too without the pebble it was supposed to be carrying, a3a_{3} understands that a1a_{1} must have detected an anomaly. In this case both a1a_{1} and a3a_{3} moves counter-clockwise together to find the pebble left by a1a_{1}. When they find it they declare v1v_{1} as homehome. After this they start exploring the ring in different directions in the following way. a1a_{1} moves clockwise until v1v_{-1} and a3a_{3} starts moving counter-clockwise until v0v_{0}. After that, they both move in opposite direction until they again reach homehome (which is the new homehome) and waits for sufficient number of rounds to meet each other. This way the exploration keeps going on until one among a1a_{1} or a3a_{3} is destroyed. Let a3a_{3} fails to reach homehome. In that case, a1a_{1} will detect that v0v_{0} must be the Byzantine black hole and it can start exploring the ring RR avoiding v0v_{0}. On the other hand if a1a_{1} fails to reach then it must be destroyed by the Byzantine black hole which is nothing but the node v1v_{-1}. Knowing this a3a_{3} then explores the ring avoiding that node. Now there can be another case when no agents but a pebble is destroyed at vbv_{b}. This pebble must be the pebble that is left behind at v1v_{-1} by the agent a2a_{2} when it reaches v0v_{0} to meet a1a_{1}. In this case, only the pebble can be destroyed before a2a_{2} reaches to collect the pebble back. So, when a2a_{2} reaches v1v_{-1}, it finds out that there is no pebble. This leads to a2a_{2}, knowing that v1v_{-1} is the Byzantine black hole and in which case it starts exploring the ring RR avoiding that node. If a2a_{2} is also destroyed while it reaches v1v_{-1} to collect the pebble, this case is similar to the case where we described the algorithm when only a2a_{2} is destroyed.

Sketch of Correctness: To prove the correctness of algorithm PerpExplore-Coloc-Pbl we prove the following Theorem. Here we just present a sketch of the proof, for details see Appendix (Section 9.7).

Theorem 4.2.

Algorithm PerpExplore-Coloc-Pbl solves PerpExploration-BBH on a ring RR with 3 co-located and synchronous agents under the pebble model of communication with the presence of two pebbles initially co-located with the agents.

We first prove that if no agents are destroyed then either the agents continue with the exploration of ring RR without knowing the exact location of the Byzantine black hole, or there exists at least one agent that knows the exact location of the Byzantine black hole which can then explore the ring indefinitely avoiding the Byzantine black hole (See Lemma 9.1 in Appendix). Next we proved that, if one agent is destroyed while exploring the ring, then either there exists one agent that identifies the Byzantine black hole uniquely and continues to indefinitely explore all nodes of the ring, except the Byzantine black hole or the exploration continues while the length of the suspicious region (i.e., |S||S|) decreases to 2 from n1n-1 (Lemma 9.3 in Appendix). For the later case we proved that the exploration continues until another agent is destroyed by the Byzantine black hole (Remark 9.5 in Appendix). In this case when two agents are destroyed by the Byzantine black hole, the only alive agent can uniquely identify the Byzantine black hole without moving on to it (Lemma 9.6 in Appendix). Thus it can then perform the exploration of RR avoiding the Byzantine black hole. This proves Theorem 4.2.

4.2 Face-to-Face Model of Communication

In this section, we consider the Face-to-Face (also termed as F2F) model and prove the following theorem.

Theorem 4.3.

A team of 5 co-located and synchronous agents are sufficient to solve PerpExploration-BBH on a ring RR with nn nodes under the F2F model of communication.

In order to prove Theorem 4.3, we discuss an algorithm with 5 co-located agents, where each agent can communicate among themselves at the same node at the same round (i.e., each agent have F2F model of communication). Initially 3 lowest ID agents, say, a1a_{1}, a2a_{2} and a3a_{3} are chosen, where fourth lowest ID agent say, a4a_{4}, is associated with a1a_{1} and the largest ID agent, say a5a_{5}, is associated with a2a_{2}. The idea of the algorithm resembles to that of the algorithm PerpExplore-Coloc-Pbl. Note that as in this case there is no existence of pebbles, hence, we configure the behaviour of the agents a4a_{4} and a5a_{5} in such a way that they act as pebbles, associated with a1a_{1} and a2a_{2} in PerpExplore-Coloc-Pbl, respectively. In PerpExplore-Coloc-Pbl when we say that an agent aia_{i} carries a pebble pp, in this case we mean that the agent aia_{i} communicates a message carry with its associated agent aia_{i^{\prime}} such that both these agents simultaneously move together until further new instruction is communicated. On the contrary as per PerpExplore-Coloc-Pbl when we say that an agent aia_{i} drops a pebble pp at a node vv, then in this case we mean that aia_{i} communicates a message drop with aia_{i^{\prime}}, which in turn instructs aia_{i^{\prime}} not to move further and remain stationary at the node vv until further instruction is communicated. Hence, with this terminology, a team of 5 agents can execute the algorithm PerpExplore-Coloc-Pbl, and the correctness also follows similarly. This shows that a team of 5 co-located and synchronous agents are sufficient to solve PerpExploration-BBH under F2F model of communication. This proves Theorem 4.3.

4.3 Whiteboard Model of Communication

The algorithm PerpExplore-Coloc-Pbl can be simulated in whiteboard model of communication. A pebble on a node can be simulated by a bit of information, which is marked on the whiteboard of that node. Note that, collecting a pebble from the node is simulated by erasing the same bit of information, on that node and dropping the pebble can be simulated by marking the node with a bit of information as well on the whiteboard of that node. From this we get the following result for whiteboard model of communication.

Theorem 4.4.

A team of 3 synchronous co-located agents are necessary and sufficient to solve PerpExploration-BBH on a ring RR if each node are equipped with a whiteboard having constant memory.

Previously in [2], for asynchronous scheduler the tight bound for number of agents to solve this problem was 4. Now from Theorem 4.4, we get a trade-off between reducing the optimal number of agents required vs the scheduler, in presence of a more generalized version of gray hole as well (i.e., Byzantine black hole).

5 Perpetual Exploration with Scattered Agents

Here in this section, we discuss the problem of PerpExploration-BBH, when the agents are initially scattered on more than one nodes, where each of these starting nodes are assumed to be safe. We investigate this problem, under different communication models. First, we discuss the pebble model of communication and subsequently we discuss the whiteboard model of communication.

5.1 Pebble Model of Communication

Our goal in this section is to prove the following theorem.

Theorem 5.1.

A team of 4 synchronous scattered agents with one pebble each is necessary and sufficient to solve the PerpExploration-BBH problem on a ring RR with nn nodes, when the agents are initially scattered on RR.

The necessary part follows from Corollary 3.5. For the sufficient part, we present an algorithm PerpExplore-Scat-Pbl, that can solve the PerpExploration-BBH problem in the above context. In this algorithm we assumed that 4 agents are initially scattered at 4 different nodes of RR. To include the remaining cases where the agents are initially scattered at less than or equal to 3 nodes, a slight modification of PerpExplore-Scat-Pbl is enough which we describe in Remark 10.7 in Appendix. Here we describe only the main idea of the algorithm. The detailed description and pseudocodes of the algorithm can also be found at the Appendix (Section 10.1).

Brief Idea of the Algorithm: Let us consider, the starting position of a0a_{0} to be the first, after which the starting position of a1,a2a_{1},a_{2} and a3a_{3}, respectively follows in clockwise order. Let hih_{i} be the starting node of an agent aia_{i} (i.e., homehome of aia_{i}), where i{0,1,2,3}i\in\{0,1,2,3\}. By Seg(ai)Seg(a_{i}) we define the clockwise arc starting from the node hih_{i} and ending at h(i+1)(mod4)h_{(i+1)\pmod{4}} (called segment of aia_{i}). If no agents are destroyed by the Byzantine black hole vbv_{b} then the exploration of RR goes as follows.

Agent aia_{i} moves clockwise along Seg(ai)Seg(a_{i}) leaving its pebble at hih_{i} until it reaches h(i+1)(mod4)h_{(i+1)\pmod{4}} (i.e., the end of Seg(ai)Seg(a_{i})). An agent can distinguish the node h(i+1)(mod4)h_{(i+1)\pmod{4}} by seeing the pebble left there by the agent a(i+1)(mod4)a_{(i+1)\pmod{4}}. When aia_{i} reaches h(i+1)(mod4)h_{(i+1)\pmod{4}} traversing Seg(ai)Seg(a_{i}) for the first time, it knows the length of the segment Seg(ai)Seg(a_{i}) and stores the length in its own memory. For further traversals it does not depend on seeing pebbles at the end nodes of the segment. It can simply use the length of the segment. After aia_{i} reaches h(i+1)(mod4)h_{(i+1)\pmod{4}}, it waits there for a certain number of rounds so that the other agents can in the meantime reach the endpoints of there corresponding segments, while moving along a clockwise direction. After this waiting, aia_{i} collects the pebble (if exists) from h(i+1)(mod4)h_{(i+1)\pmod{4}} (the pebble left by a(i+1)(mod4)a_{(i+1)\pmod{4}}) and starts moving counter-clockwise along with the collected pebble until it reaches its own homehome, i.e., hih_{i} along with the pebble it was carrying. The waiting time at h(i+1)(mod4)h_{(i+1)\pmod{4}} also ensures that all agents starts moving counter-clockwise at the same round. Also note that, if aia_{i} does not find any pebble to collect at h(i+1)(mod4)h_{(i+1)\pmod{4}} it starts moving counter-clockwise without any pebble (this case can only happen if a(i+1)(mod4)a_{(i+1)\pmod{4}} is destroyed at the Byzantine black hole node vbv_{b}, while it was returning back after collecting the pebble from h(i+2)(mod4)h_{(i+2)\pmod{4}} in some previous round). After aia_{i} reaches hih_{i} moving counter-clockwise, it again waits for another set of rounds before it repeats the whole process again. Again, the waiting time at hih_{i} is configured in such a way that, all agents start repeating the process at the same round (for details on the precise value of these waiting times, refer to the detailed description of the algorithm in Appendix in Section 10.1). Note that, since i=03Seg(ai)=R\cup_{i=0}^{3}Seg(a_{i})=R, if no agents are destroyed, the perpetual exploration of RR happens.

Refer to caption
Figure 2: (a) hih_{i}’s are homehome marked as green. Agent aia_{i} is on hih_{i} initially with a pebble. We name the pebble initially at hih_{i} as pip_{i}, but in reality they are anonymous. (a-b) Each agent moves clockwise until the next homehome (i.e., h(i+1)(mod4)h_{(i+1)\pmod{4}}) without carrying any pebble. The agents already reached ( here a1a_{1} and a3a_{3}) waits for others. (c-e) All agents are on their clockwise nearest homehome. They start moving counter clockwise together with the pebble present at their current location towards their initial homehome. The agents which already reaches their homehome, wait for others to reach their homehome.

The exploration can be hampered only if, an agent is destroyed at the Byzantine black hole node vbv_{b}. Note that, since Seg(ai)Seg(aj)Seg(a_{i})\cap Seg(a_{j}) is either empty or consists of a safe node and in addition to that, as a segment is explored by only one agent. Hence, at most one agent can be destroyed while exploring their respective segments, as described above. Without loss of generality, let vbSeg(aj)v_{b}\in Seg(a_{j}), for some j{0,1,2,3}j\in\{0,1,2,3\}. Now there are two cases.
Case-I: Let aja_{j} is destroyed while moving clockwise. For this case, aja_{j} fails to collect the pebble at h(j+1)(mod4)h_{(j+1)\pmod{4}} left by a(j+1)(mod4)a_{(j+1)\pmod{4}} and return hjh_{j}. So, when a(j+1)(mod4)a_{(j+1)\pmod{4}}, returns h(j+1)(mod4)h_{(j+1)\pmod{4}} after moving counter-clockwise along with the pebble it has collected from h(j+2)(mod4)h_{(j+2)\pmod{4}}, it finds two pebble at h(j+1)(mod4)h_{(j+1)\pmod{4}}. This is considered by a(j+1)(mod4)a_{(j+1)\pmod{4}} as an anomaly and it learns that vbv_{b} must be in the arc, which is in the counter-clockwise direction starting from h(j+1)(mod4)h_{(j+1)\pmod{4}}. In this scenario, a(j+1)(mod4)a_{(j+1)\pmod{4}} waits a certain number of rounds (if needed) to ensure that every other alive agents have reached their corresponding homehome. Then a(j+1)(mod4)a_{(j+1)\pmod{4}} starts moving clockwise with both the pebbles. The aim of this move is to meet and gather with the other alive agents. Note that the other alive agents wait at their corresponding homehome, after moving along the counter-clockwise direction. It is because, at their respective homehome they do not detect any anomaly. The waiting time is provided in such a way that it is enough for a(j+1)(mod4)a_{(j+1)\pmod{4}} to detect anomaly and meet both the remaining alive agents after moving clockwise, while the other agents are waiting at their homehome. The agent a(j+1)(mod4)a_{(j+1)\pmod{4}} first meets a(j+2)(mod4)a_{(j+2)\pmod{4}} at h(j+2)(mod4)h_{(j+2)\pmod{4}} while it moves clockwise after detecting anomaly. Then both of them moves together, while a(j+2)(mod4)a_{(j+2)\pmod{4}} carries the pebble, which it was earlier carrying back to homehome. They move until they meet with a(j+3)(mod4)a_{(j+3)\pmod{4}} at h(j+3)(mod4)h_{(j+3)\pmod{4}}. Note that at this moment 3 agents are at a node (which is h(j+3)(mod4)h_{(j+3)\pmod{4}}), with at least 3 pebbles (one carried by a(j+3)(mod4)a_{(j+3)\pmod{4}} and two carried by a(j+2)(mod4)a_{(j+2)\pmod{4}}). In this case they execute the algorithm PerpExplore-Coloc-Pbl and achieve PerpExploration-BBH of the ring RR.
Case-II: Let aja_{j} be destroyed at vbv_{b} while it was moving counter-clockwise along with the pebble it collected from h(j+1)(mod4)h_{(j+1)\pmod{4}}. Then in this case, when all alive agents return to their corresponding homehome, none of them finds any anomaly as all agent sees exactly one pebble at their homehome. So, they wait and start the exploration again at the same round. Note that in this scenario, all agents except aja_{j}, move clockwise to the end points of their corresponding segments, waits there and collects pebble (if any) and moves back to their corresponding homehome again. Now, since aja_{j} was destroyed earlier, the pebble left by a(j+1)(mod4)a_{(j+1)\pmod{4}} was picked by no agents and thus, while a(j+1)(mod4)a_{(j+1)\pmod{4}} returns back to h(j+1)(mod4)h_{(j+1)\pmod{4}} it finds two pebbles and does the same execution as explained in Case-I.

The basic idea of this algorithm is to gather three agents with at least 3 pebbles (refer Remark 10.1) in the expense of one agent and then execute PerpExplore-Coloc-Pbl to solve the PerpExplroation-BBH problem.
Sketch of Correctness: To proof the correctness of the algorithm PerpExplore-Scat-Pbl, we have to prove the following theorem. Here we only provide the proof idea. For details see Appendix (Section 10.2).

Theorem 5.2.

Algorithm PerpExplore-Scat-Pbl solves PerpExploration-BBH problem of a ring RR with 4 synchronous and scattered agents under the pebble model of communication where each agents are equipped with a pebble.

First in Corollary 10.4, we proved that algorithm PerpExplore-Scat-Pbl guarantees exploration if no agents are destroyed. This corollary is a direct consequence of the Lemma 10.2. Further we showed that if an agent is destroyed then exactly one agent detects anomaly and that agent gathers with the remaining two alive agents within finite rounds (Lemma 10.5 in Appendix). The rest of the proof follows from Theorem 4.2.

5.2 Whiteboard Model of Communication

The main aim of this section is to prove the following theorem.

Theorem 5.3.

A team of 3 synchronous agents are necessary and sufficient to solve the problem PerpExploration-BBH on a ring RR with nn nodes, when each node of RR has a whiteboard of O(logn)O(\log n) bits of memory, irrespective of their starting location.

The necessary part follows from Corollary 3.2. The sufficiency part for co-located initial situation follows from Theorem 4.4. For the other cases where the agents are initially scattered at more than one starting nodes, we propose an algorithm PerpExplore-Scat-Whitbrd. This algorithm is designed for the case when all the agents are starting at different nodes. Note that, this algorithm can be easily modified a bit to include the case where initially three agents are scattered at two distinct nodes (refer the modification in Appendix, Section 11.3). For detailed description and the pseudo code, see Appendix (Section 11.1).
Brief Description of the Algorithm: Let a0,a1a_{0},a_{1} and a2a_{2} be three agents starting from the nodes h0,h1h_{0},h_{1} and h2h_{2}, respectively, where these nodes are in a clockwise order. Let Seg(ai)Seg(a_{i}) (also called ‘Segment of aia_{i}’) be the clockwise arc starting from hih_{i} and ending at h(i+1)(mod3)h_{(i+1)\pmod{3}}. The algorithm first ensures that the ring is explored perpetually if no agents are destroyed. In order to do this, the algorithm goes as follows.

An agent, say aia_{i}, first erases all previously stored data (if any) at hih_{i}. Then it writes the message (home, ID(aia_{i})) at hih_{i} and starts moving clockwise. This type of message is called a home type message that indicates it is homehome of aia_{i}. aia_{i} moves clockwise until it reaches h(i+1)(mod3)h_{(i+1)\pmod{3}}. It distinguishes h(i+1)(mod3)h_{(i+1)\pmod{3}} by seeing the home type message left by a(i+1)(mod3)a_{(i+1)\pmod{3}}. When aia_{i} moves clockwise, it also marks each node of Seg(ai)Seg(a_{i}), except hih_{i} and h(i+1)(mod3)h_{(i+1)\pmod{3}}, by writing right, after erasing any previous such markings (if at all exists) at each such nodes. After aia_{i} reaches h(i+1)(mod3)h_{(i+1)\pmod{3}} it waits for a certain number of rounds (if needed), so that the other agents (say aja_{j}) gets enough time to reach endpoints of their corresponding segment (i.e.,h(j+1)(mod3)h_{(j+1)\pmod{3}}). After this waiting, each alive agent aia_{i} write the message (visited, ID(aia_{i})) at h(i+1)(mod3)h_{(i+1)\pmod{3}} at the same round. This type of messages is termed as a visited type message, which indicates that an agent with its corresponding ID, also mentioned in the visited type message, has visited the respective node. Then each aia_{i} waits for nn rounds at h(i+1)(mod3)h_{(i+1)\pmod{3}} and then starts moving counter-clockwise at the same round. aia_{i} moves counter-clockwise until it reaches hih_{i}, i.e., its own homehome. While moving counter-clockwise, aia_{i} erases previously written right marking (which it marked while moving along clockwise direction) from each nodes of Seg(ai)Seg(a_{i}) and writes left there upon arriving (except at hih_{i} and at h(i+1)(mod3)h_{(i+1)\pmod{3}}). When aia_{i} reaches its own homehome (i.e., hih_{i}), it waits again for a certain number of rounds, upon seeing the visited type message, left there by a(i1)(mod3)a_{(i-1)\pmod{3}}. This waiting period is enough for each of the other alive agents to reach their corresponding homehome. After this waiting period is over, all of the agents, starts repeating the same procedure again together, from the same round. This procedure ensures that, if no agent is destroyed at the Byzantine black hole node vbv_{b}, then the perpetual exploration of RR continues. This can only be hampered, only if an agent gets destroyed at the node vbv_{b}. Without loss of generality let vbSeg(aj)v_{b}\in Seg(a_{j}) for some, j{0,1,2}j\in\{0,1,2\}. So only aja_{j} can be destroyed at vbv_{b}, while performing this exploration. It is because aja_{j} is the only agent to visit each node uu of Seg(aj)Seg(a_{j}), where uSeg(aj)\{hj,h(j+1)(mod3)}u\in Seg(a_{j})\backslash\{h_{j},h_{(j+1)\pmod{3}}\}. There can be two cases.
Case-I: Let aja_{j} be destroyed while it is moving in clockwise direction along Seg(aj)Seg(a_{j}). This implies it fails to reach h(j+1)(mod3)h_{(j+1)\pmod{3}} and also fails to write a visited type message there. So, when a(j+1)(mod3)a_{(j+1)\pmod{3}} returns to its homehome (i.e., h(j+1)(mod3)h_{(j+1)\pmod{3}}), it finds no visited type message (as it should’ve, if aia_{i} was not destroyed). a(j+1)(mod3)a_{(j+1)\pmod{3}} interprets from this that, the segment which is adjacent to its own segment in counter-clockwise direction has the Byzantine black hole and an agent must have been destroyed there while moving clockwise. This information triggers it to move clockwise with the aim of gathering with the other agent (i.e., a(j+2)(mod3)a_{(j+2)\pmod{3}}). Note that, when a(j+1)(mod3)a_{(j+1)\pmod{3}} starts moving, the other agent is waiting and the waiting time is sufficient for the moving agent to meet it. After they meet, a(j+1)(mod3)a_{(j+1)\pmod{3}} shares the information about its direction of movement in the whiteboard of h(j+2)(mod3)h_{(j+2)\pmod{3}}. With this, they again start moving clockwise together until they reach hjh_{j}. The agents can distinguish hjh_{j} by the home type message written there by aja_{j} before it was destroyed. Note that in the clockwise direction each node after hjh_{j} up to the previous node of vbv_{b} were marked right by aja_{j} before it was destroyed. So from hjh_{j}, a(j+1)(mod3)a_{(j+1)\pmod{3}} and a(j+2)(mod3)a_{(j+2)\pmod{3}} starts moving cautiously clockwise. That is, while both agents (aLa_{L} and aHa_{H}, where aLa_{L} and aHa_{H} are the agent with lowest ID and highest ID among a(j+1)(mod3)a_{(j+1)\pmod{3}} and a(j+2)(mod3)a_{(j+2)\pmod{3}} respectively) are at a node v0v_{0}, aLa_{L} moves clockwise to the next node, say v1v_{1} while the other agent waits at v0v_{0}. If at v1v_{1}, aLa_{L} sees the right marking, it interprets v1v_{1} is safe. So, it comes back to v0v_{0}. At v0v_{0}, seeing that aLa_{L} has returned, aHa_{H} also interprets v1v_{1} to be safe. So, in the next round both aLa_{L} and aHa_{H} moves to v1v_{1} together and repeats the process from v1v_{1} again. When aLa_{L} reaches vbv_{b}, it sees no right marking there. aLa_{L} if alive, interprets this by determining the current node to be Byzantine black hole. So, it starts perpetual exploration of RR, except vbv_{b}. Otherwise, if aLa_{L} gets destroyed at vbv_{b}, it does not return to the previous node where aHa_{H} is waiting. Even after waiting, when aHa_{H} sees aLa_{L} has not returned, it interprets this incident as the next clockwise node is the Byzantine black hole and starts exploring the ring RR avoiding that node. Thus for this case the perpetual exploration continues.
Case-II: Let aja_{j} be destroyed at vbv_{b} while it is moving counter-clockwise. In this case both the alive agents a(j+1)(mod3)a_{(j+1)\pmod{3}} and a(j+2)(mod3)a_{(j+2)\pmod{3}} find visited type message after returning to their corresponding homehome. This is because, aja_{j} is destroyed at vbv_{b} after writing visited type message at h(j+1)(mod3)h_{(j+1)\pmod{3}}. So, all alive agents after waiting, starts repeating the exploration procedure again. The agents first erase the whiteboard content at their corresponding homehome and then writes the corresponding home type message before it starts moving clockwise until the end of their corresponding segment. Note that since aja_{j} was destroyed earlier (even before the repetition starts), a(j1)(mod3)a_{(j-1)\pmod{3}} finds the visited type message which was written there earlier by it, is still present (which was supposed to be erased if aja_{j} was alive). From this information, a(j1)(mod3)a_{(j-1)\pmod{3}} interprets that, vbv_{b} must be in the segment adjacent to its own segment in the clockwise direction. It also interprets that, an agent must have been destroyed at vbv_{b} while it was moving counter-clockwise. This is because, if the agent was destroyed while it was moving clockwise then it would have been detected by the other agents when they are at their homehome (as described in Case-I), which is before the start of the next clockwise move (note that the agents have already started next clockwise move). So, this information triggers a(j1)(mod3)a_{(j-1)\pmod{3}} to move counter-clockwise with the aim to gather with a(j2)(mod3)a_{(j-2)\pmod{3}}. Since a(j1)(mod3)a_{(j-1)\pmod{3}} starts its move while a(j2)(mod3)a_{(j-2)\pmod{3}} waits at homehome and also, since the waiting time is sufficient, a(j1)(mod3)a_{(j-1)\pmod{3}} meets a(j2)(mod3)a_{(j-2)\pmod{3}} during the waiting period at h(j1)(mod3)h_{(j-1)\pmod{3}}. So, after they meet, a(j1)(mod3)a_{(j-1)\pmod{3}}, communicates the direction of its move to a(j2)(mod3)a_{(j-2)\pmod{3}} on the whiteboard of h(j1)(mod3)h_{(j-1)\pmod{3}} and they move together until they reach h(j2)(mod3)(=h(j+1)(mod3))h_{(j-2)\pmod{3}}(=h_{(j+1)\pmod{3}}) together. They distinguish the node by the home type message left there by a(j2)(mod3)a_{(j-2)\pmod{3}} before the start of moving clockwise. Note that, in the counter-clockwise direction, the nodes in Seg(aj)Seg(a_{j}), starting from the next node of h(j+1)(mod3)h_{(j+1)\pmod{3}} up to the previous node of vbv_{b} are the only nodes those were marked left by aja_{j} before it was destroyed. So, from h(j+1)(mod3)h_{(j+1)\pmod{3}}, the alive agents a(j+1)(mod3)a_{(j+1)\pmod{3}} and a(j+2)(mod3)a_{(j+2)\pmod{3}} start moving cautiously in the counter-clockwise direction. Among a(j+1)(mod3)a_{(j+1)\pmod{3}} and a(j+2)(mod3)a_{(j+2)\pmod{3}}, an agent with lowest ID is denoted by aLa_{L} and the agent with highest ID is denoted by aHa_{H}. The cautious walk is same as described in Case-I, except for the fact that here after moving one node in the counter-clockwise direction, the agent aLa_{L} searches for the left marking. If it finds such marking it returns to aHa_{H} and then both moves counter-clockwise and repeats the process. On the other hand if aLa_{L} does not find any left marking (it must be vbv_{b}) and it stays alive, aLa_{L} moves out of that node and starts exploring RR avoiding that node. On the contrary, if aLa_{L} gets destroyed then aHa_{H} sees that aLa_{L} has not returned while it should have. From this incident it interprets next counter-clockwise node is vbv_{b} and it starts exploring RR avoiding that node.

Sketch of Correctness: Here we give a brief glimpse on how we proved the following theorem. For details see Appendix (Section 11.2)

Theorem 5.4.

Algorithm PerpExplore-Scat-Whitbrd solves PerpExploration-BBH problem of a ring RR with nn nodes and with 3 synchronous agents initially scattered under the whiteboard model of communication

In order to prove this theorem, we first define a cautious start node. Let aia_{i} be the agent destroyed at the Byzantine black hole first. We define cautious start node to be hih_{i}, if aia_{i} was moving clockwise when destroyed, otherwise it is h(i+1)(mod3)h_{(i+1)\pmod{3}}. We first prove that after one agent is destroyed, the remaining two agents gather at the cautious start node. This result can be found in details in Lemma 11.11 in Appendix. Note that aia_{i} marks each node on the arc between the cautious start node and the Byzantine black hole with either left or right markings depending on the direction it was moving before it was destroyed. We proved that the alive agent can know the direction of aia_{i} before it was destroyed. This can be found in details in Lemma 11.1 and Lemma 11.3 in Appendix. After the alive agents reach the cautious start node, they start moving cautiously looking for the marking based on the direction of aia_{i} before it was destroyed. We proved that at least an agent among the two moving cautiously will stay alive knowing the exact location of the Byzantine black hole (Lemma 11.13 in Appendix). Hence this agent can explore RR perpetually avoiding the Byzantine black hole. This proves Theorem 5.4.

6 Conclusion

The paper addresses perpetual exploration of a ring network in the presence of a malicious node, which we call as a Byzantine black hole. This problem, termed as PerpExploration-BBH, is explored under three communication models (Face-To-Face, Pebble, and Whiteboard) considering various initial scenarios (co-located or scattered agents) with the aim of minimizing number of agents. We proposed optimal results (in terms of number of agents), for Pebble and Whiteboard communication models, under both initial scenarios. Further, an upper bound of 5 agents and a lower bound of 3 agents is provided for Face-to-Face model, in case of co-located agents.

Future research could focus on proposing an optimal bound for Face-To-Face co-located scenario, whereas proposing constructive lower and upper bounds for Face-To-Face scattered scenario. Additionally, investigating this problem in different scheduler models can be another way of future direction.

References

  • [1] Balasingham Balamohan, Paola Flocchini, Ali Miri, and Nicola Santoro. Time optimal algorithms for black hole search in rings. Discrete Mathematics, Algorithms and Applications, 3(04):457–471, 2011.
  • [2] Evangelos Bampas, Nikos Leonardos, Euripides Markou, Aris Pagourtzis, and Matoula Petrolia. Improved periodic data retrieval in asynchronous rings with a faulty host. Theoretical Computer Science, 608:231–254, 2015.
  • [3] Adri Bhattacharya, Giuseppe F Italiano, and Partha Sarathi Mandal. Black hole search in dynamic cactus graph. In International Conference and Workshops on Algorithms and Computation, pages 288–303. Springer, 2024.
  • [4] Adri Bhattacharya, Giuseppe F Italiano, and Partha Sarathi Mandal. Black hole search in dynamic tori. arXiv preprint arXiv:2402.04746, 2024.
  • [5] Jérémie Chalopin, Shantanu Das, Arnaud Labourel, and Euripides Markou. Black hole search with finite automata scattered in a synchronous torus. In Distributed Computing: 25th International Symposium, DISC 2011, Rome, Italy, September 20-22, 2011. Proceedings 25, pages 432–446. Springer, 2011.
  • [6] Jérémie Chalopin, Shantanu Das, Arnaud Labourel, and Euripides Markou. Tight bounds for black hole search with scattered agents in synchronous rings. Theoretical Computer Science, 509:70–85, 2013.
  • [7] Jurek Czyzowicz, Dariusz Kowalski, Euripides Markou, and Andrzej Pelc. Complexity of searching for a black hole. Fundamenta Informaticae, 71(2-3):229–242, 2006.
  • [8] Jurek Czyzowicz, Dariusz Kowalski, Euripides Markou, and Andrzej Pelc. Searching for a black hole in synchronous tree networks. Combinatorics, Probability and Computing, 16(4):595–619, 2007.
  • [9] Giuseppe A Di Luna, Paola Flocchini, Giuseppe Prencipe, and Nicola Santoro. Black hole search in dynamic rings: The scattered case. In 27th International Conference on Principles of Distributed Systems (OPODIS 2023). Schloss-Dagstuhl-Leibniz Zentrum für Informatik, 2024.
  • [10] Giuseppe Antonio Di Luna, Paola Flocchini, Giuseppe Prencipe, and Nicola Santoro. Black hole search in dynamic rings. In 2021 IEEE 41st International Conference on Distributed Computing Systems (ICDCS), pages 987–997. IEEE, 2021.
  • [11] Stefan Dobrev, Paola Flocchini, Rastislav Královič, and Nicola Santoro. Exploring an unknown dangerous graph using tokens. Theoretical Computer Science, 472:28–45, 2013.
  • [12] Stefan Dobrev, Paola Flocchini, Giuseppe Prencipe, and Nicola Santoro. Searching for a black hole in arbitrary networks: Optimal mobile agents protocols. Distributed Computing, 19:1–99999, 2006.
  • [13] Stefan Dobrev, Paola Flocchini, Giuseppe Prencipe, and Nicola Santoro. Mobile search for a black hole in an anonymous ring. Algorithmica, 48:67–90, 2007.
  • [14] Stefan Dobrev, Paola Flocchini, Giuseppe Prencipe, and Nicola Santoro. Mobile search for a black hole in an anonymous ring. Algorithmica, 48:67–90, 2007.
  • [15] Stefan Dobrev, Nicola Santoro, and Wei Shi. Locating a black hole in an un-oriented ring using tokens: The case of scattered agents. In European Conference on Parallel Processing, pages 608–617. Springer, 2007.
  • [16] Paola Flocchini, David Ilcinkas, and Nicola Santoro. Ping pong in dangerous graphs: Optimal black hole search with pebbles. Algorithmica, 62:1006–1033, 2012.
  • [17] Wayne A Jansen. Intrusion detection with mobile agents. Computer Communications, 25(15):1392–1401, 2002.
  • [18] Rastislav Královič and Stanislav Miklík. Periodic data retrieval problem in rings containing a malicious host. In Structural Information and Communication Complexity: 17th International Colloquium, SIROCCO 2010, Şirince, Turkey, June 7-11, 2010. Proceedings 17, pages 157–167. Springer, 2010.
  • [19] Mengfei Peng, Wei Shi, Jean-Pierre Corriveau, Richard Pazzi, and Yang Wang. Black hole search in computer networks: State-of-the-art, challenges and future directions. Journal of Parallel and Distributed Computing, 88:1–15, 2016.
  • [20] Claude E Shannon. Presentation of a maze-solving machine. Claude Elwood Shannon Collected Papers, pages 681–687, 1993.

Appendix

7 Proof of Theorem 3.1

Statement: A set of two synchronous agents in a ring RR of size nn cannot solve
PerpExploration-BBH, even in presence of whiteboard if number of possible
consecutive Byzantine black hole positions is at least 3.
Proof: Let v1,v2v_{1},v_{2} and v3v_{3} be three possible consecutive Byzantine black hole positions in a ring RR. Let two agents a1a_{1} and a2a_{2} be sufficient to solve the PerpExploration-BBH problem on RR. Thus there exists an algorithm 𝒜\mathcal{A} such that a1a_{1} and a2a_{2} can solve PerpExploration-BBH by executing 𝒜\mathcal{A}. Without loss of generality let a1a_{1} explores v2v_{2} and it moves to v2v_{2} for the first time at round tt from vertex v1v_{1}. Then a1a_{1} must have been at the vertex v1v_{1} at round t1t-1. Let us take two copies R1R_{1} and R2R_{2} of the same ring RR. In R1R_{1}, v1v_{1} is the Byzantine black hole and in R2R_{2}, v2v_{2} is the Byzantine black hole. Let the adversary in R1R_{1} destroy a1a_{1} at round t1t-1 and in R2R_{2} destroy a1a_{1} at round tt. We claim that at round tt and t1t-1, a2a_{2} can not be on either of v1v_{1} or v2v_{2}. Note that at tt-th round a2a_{2} can not be on v2v_{2} otherwise, both a1a_{1} and a2a_{2} get destroyed at the same round and no other agent is left to explore further. Similarly, at round t1t-1, a2a_{2} can not be on v1v_{1}. Now consider the case when at tt- th round a2a_{2} is at v1v_{1}. Since at round t1t-1, a2a_{2} can not be on v2v_{2} there can be two cases either at round t1t-1, a2a_{2} was in u0u_{0} (u0u_{0} is another adjacent node of v1v_{1} except v2v_{2}) or was in v1v_{1} itself. We first argue that at round t1t-1, a2a_{2} can not be at u0u_{0}. Otherwise, since the whiteboard content at nodes except at v1v_{1} and v2v_{2} are the same in R1R_{1} and R2R_{2} at round tt (due to the same execution by a1a_{1} and a2a_{2} up to round t1t-1 and at round tt for a2a_{2} in both R1R_{1} and R2R_{2}). Now since at round tt, all previous data on the whiteboard except v1v_{1} and v2v_{2} does not help a2a_{2} to distinguish between R1R_{1} and R2R_{2}, the problem now can be thought of solving PerpExploration-BBH with one agent where the number of possible consecutive Byzantine black hole position is atleast two. Now this is impossible to solve. So, at t1t-1-th round a2a_{2} can not be on u0u_{0}. We now only have to prove that a2a_{2} can not be at v2v_{2} during round t1t-1. Let in R2R_{2}, adversary activates the Byzantine black hole at v2v_{2} at round t1t-1 which destroys a2a_{2} at round t1t-1. Now since the effect of this destruction of agent a2a_{2} does not affect the inputs of a1a_{1} at round t1t-1 on v1v_{1}, it moves to v2v_{2} at round tt where the Byzantine black hole is activated again by adversary destroying a1a_{1} too. Thus a2a_{2} must remain outside of v1v_{1} and v2v_{2} during round tt and t1t-1 while executing 𝒜\mathcal{A}. So, at round tt since all whiteboard content are same for R1R_{1} and R2R_{2} (except for nodes v1v_{1} and v2v_{2} whose content only differs after round t2t-2 for R1R_{1} and R2R_{2} which can not be known by a2a_{2} as it was not there during that rounds), they can not help a2a_{2} to distinguish between R1R_{1} and R2R_{2}. So the problem now can be thought of as solving PerpExploration-BBH with one agent where the number of possible consecutive Byzantine black hole positions is at least 2. And this is impossible. So there doesn’t exist any algorithm that solves PerpExploration-BBH with two agents on a Ring RR where the number of possible consecutive positions of the Byzantine black hole is at least 3.

8 Proof of Theorem 3.4

Statement: A set of 3 scattered agents, each equipped with a pebble can not solve the PerpExploration-BBH problem on a ring RR with nn nodes.
Proof: Let a1,a2a_{1},a_{2}, and a3a_{3} be three agents equipped with a pebble each. The agents are placed on three nodes h1,h2h_{1},h_{2} and h3h_{3} initially in such a way that the distance between hih_{i} and hjh_{j} is the same for all i,j{1,2,3}i,j\in\{1,2,3\}, where we consider hjh_{j} to be the nearest node of hih_{i} in the clockwise direction. Without loss of generality let this distance be sufficiently large. Further, let there exist an algorithm 𝒜\mathcal{A} that solves the PerpExploration-BBH problem in this setting. Let without loss of generality a1a_{1} be the first agent to explore the third node from its corresponding starting position (i.e., h1h_{1}) in any of the clockwise or counter-clockwise directions, when each agent starts executing the algorithm 𝒜\mathcal{A}. Suppose by following 𝒜\mathcal{A}, a1a_{1} can visit the third node in the clockwise direction (without loss of generality) first at a round say t>0t>0. Let v1,v2v_{1},v_{2} and v3v_{3} be those sets of three nodes from h1h_{1} in the clockwise direction. Let C1C_{1},C2C_{2} and C3C_{3} be three scenarios where in CiC_{i}, viv_{i} is the Byzantine black hole. We claim that a1a_{1} can not carry its pebble during any execution of 𝒜\mathcal{A}. Otherwise, in scenario C1C_{1}, it would be destroyed along with its pebble, and since the distances between two consecutive hih_{i} are sufficiently large, hence other agents would have no idea that an agent is already destroyed. This is equivalent to solving the PerpExploration-BBH with two agents having a pebble each and as nn is sufficiently large this is impossible due to Corollary 3.3. Now suppose the adversary chooses to activate the Byzantine black hole whenever a1a_{1} reaches there for the first time. In this case for all C1C_{1}, C2C_{2} and C3C_{3}, at round tt, agents a2a_{2} and a3a_{3} have no idea about where a1a_{1} is destroyed even if they know that a1a_{1} is destroyed, as the distances between two consecutive hih_{i} are sufficiently large so their exploration region does not intersect till round tt and timeout (or, waiting for other agents) strategy do not work as for all CiC_{i} an agent can get same timeout output. Also for all CiC_{i}s the position of the pebbles and alive agents will be the same at round tt. Now for the alive agents, the number of nodes for the possible position of the Byzantine black hole must be greater than or equal to 3 at round tt. So the situation at round tt is similar to the problem of solving PerpExploration-BBH on a ring RR with two agents having a total of 3 pebbles where the number of possible consecutive positions of the Byzantine black hole is greater or equal to 3. Since we have assumed 𝒜\mathcal{A} solves the problem thus, 𝒜\mathcal{A} can also solve the problem of PerpExploration-BBH with two agents where the number of possible positions of the Byzantine black hole is greater or equal to 3. But due to Theorem 3.1 it is impossible. Hence there can never exist any algorithm that solves PerpExploration-BBH with three scattered agents each of which is equipped with a pebble.

9 Algorithm PerpExplore-Coloc-Pbl

9.1 Detailed Description and Pseudocode

In the following part, we give a detailed description of our algorithm PerpExplore-Coloc-Pbl. Initially, all the agents are in state Initial. In this state, an agent first declares its CurrentNodeCurrent-Node as homehome, after which initializes the variable Ttime=0T_{time}=0 (where, TtimeT_{time} is the number of rounds passed since the agent has moved from state Initial) and gathers the ID of the remaining agents currently at homehome. Next, the agent with the lowest ID, i.e., a1a_{1} moves to state Leader, the agent with the second lowest ID, i.e., a2a_{2} moves to state Follower-Find, whereas the remaining agent, i.e., a3a_{3} moves to state Backup. We now define an iteration for this algorithm. An iteration is defined to be a collection of 4n+14n+1 consecutive rounds starting from the latest round where all 3 agents along with 2 pebbles are at homehome in state Initial. Note that, a new iteration fails to execute if either at least one pebble or an agent gets destroyed by the Byzantine black hole in the current iteration. More precisely, the meaning of failing an iteration implies that an agent after ending its current iteration does not again start a new iteration by moving into state Initial.

Suppose, all the 3 agents along with 2 pebbles successfully execute the ii-th iteration and reach homehome, i.e., neither any pebble nor any agent gets destroyed by the Byzantine black hole. In this situation, according to our algorithm, a1a_{1} being the lowest ID, follows the following sequence SEQ1SEQ1, whereas a2a_{2} being the second lowest ID follows SEQ2SEQ2, and the a3a_{3} follows the sequence SEQ3SEQ3. The above sequences are as follows:

  1. 1.

    SEQ1SEQ1: Initial \rightarrow Leader \rightarrow Initial.

  2. 2.

    SEQ2SEQ2: Initial \rightarrow (FollowerSEQ)n({Follower-SEQ})^{n} \rightarrow Initial.

    1. (a)

      FollowerSEQ{Follower-SEQ}: Follower-Find \rightarrow Follower-Collect \rightarrow Follower-Find.

  3. 3.

    SEQ3SEQ3: Initial \rightarrow Backup \rightarrow Initial.

Execution of sequence SEQ1SEQ1: a1a_{1} performs this sequence, in which it first changes to state Leader, after finding it as the lowest ID agent at homehome in state Initial. In state Leader, the agent performs the following checks: if the current node is homehome, then it checks that if the current node has the agent with the second lowest ID, whereas the number of pebbles at homehome is 2 and Ttime2T_{time}\geq 2. If all these conditions are satisfied, then the agent waits till Ttime=4nT_{time}=4n after which it moves to state Initial during Ttime=4n+1T_{time}=4n+1. Otherwise, if it finds that it is with the second lowest ID agent and the number of pebbles at homehome is also 2, but Ttime<2T_{time}<2, in this case, the agent initializes Wtime=0W_{time}=0 (where WtimeW_{time} is the waiting time of the agent) and then moves one hop along with the pebble to the next clockwise node. Otherwise, if the agent finds that neither it is with the second lowest ID agent nor the number of pebbles at homehome is 2, then it waits for 5 rounds (i.e., waits when Wtime<6W_{time}<6), after which if still the above condition persists, then concludes SlftS_{lft} as the node which is at a clockwise distance of n2n-2 from homehome and SrgtS_{rgt} the node at a clockwise distance of n1n-1. Further, it updates Wtime=0W_{time}=0 and moves to the next state Detection.

On the contrary, if the current node of a1a_{1} is not homehome, then also it performs the following checks: first, it checks whether it is with the second lowest ID agent (i.e., a2a_{2} in this case), and if so, then initializes Wtime=0W_{time}=0 and then moves one hop clockwise to the next node along with the pebble it is accompanying. Otherwise, if it is not with the second lowest ID agent, then wait for 3 rounds (i.e., waits when Wtime<4W_{time}<4), after which if still it is without the second lowest ID agent, then the agent moves to state Report-Leader while leaving the pebble (it is accompanying) at the current node and moving one hop to the clockwise node.

Note that until and unless there are no anomalies detected by the agent a1a_{1}, it ends an iteration, by changing to state Initial from Leader. Otherwise, if any anomaly is detected, then a1a_{1} ends the current iteration by either changing to state Detection or Report-Leader from the state Leader, in which case, it never changes to state either Leader or Initial.

Execution of sequence SEQ2SEQ2: a2a_{2} being the second lowest ID agent in state Initial, executes this sequence in an iteration. On successful completion of this iteration, an agent starting from Initial, performs the sub-sequence FollowerSEQ{Follower-SEQ}, nn times and then again changes to state Initial. The sub-sequence FollowerSEQ{Follower-SEQ} symbolizes the sequence Follower-Find \rightarrow Follower-Collect \rightarrow Follower-Find, which an agent performs nn times until it again changes to state Initial (i.e., FollowerSEQ{Follower-SEQ} is denoted by FollowerSEQn{Follower-SEQ}^{n}). While executing FollowerSEQ{Follower-SEQ}, the agent in state Follower-Find checks, whether the current node does not contain the lowest ID agent, and the MoveMove parameter is also set to 0 (the parameter MoveMove is either 0 or 1, when 1 it symbolizes that the current node must contain the lowest ID agent, when 0, it means the current node is the adjacent counter-clockwise node with respect to the node which contains the lowest ID agent), if so then it moves one hop clockwise leaving the pebble at the current node, while updating MoveMove to 1. Otherwise, if it finds MoveMove to be 1 whereas the current node does not contain the lowest ID agent, then it stops the current iteration, detects that the current node is a Byzantine black hole, and starts performing perpetual exploration, avoiding the Byzantine black hole node. On the other hand, if the current node contains the lowest ID agent, then a2a_{2} directly changes to state Follower-Collect. In state Follower-Collect, a2a_{2} first moves one hop counter-clockwise, then in the current node either finds a pebble or not. If it finds a pebble, then moves one hop clockwise along with the pebble. Now, if Ttime=4n+1T_{time}=4n+1 and the current node is homehome, then stops performing FollowerSEQFollower-SEQ and moves to state Initial. Otherwise, updates MoveMove to 0 and changes to state Follower-Find. If the pebble is not found, then it concludes the current node to be the Byzantine black hole and starts performing perpetual exploration avoiding this node.

Note that, the agent only changes to state Initial only when it reaches homehome again, which is after it performs FollowerSEQ{Follower-SEQ} for nn times starting from SEQ2SEQ2. If at any point, a2a_{2} finds any irregularities, based on whether a pebble is present or not, then only it directly concludes the Byzantine black hole position. In all other cases, it follows the FollowerSEQ{Follower-SEQ} sequence and changes to state Follower-Collect.

Exploration of sequence SEQ3SEQ3: This sequence is only performed by the highest ID agent, which is a3a_{3} in this case. In this sequence, after being in state Initial, it changes to state Backup, in which the agent first waits at homehome till Ttime=4nT_{time}=4n, after which it checks the following details, and accordingly either moves to state Initial if no irregularities are detected, otherwise moves to state Find-Pebble or Find-BH, based on the irregularity it detects.

  • The current node, i.e., homehome has only the lowest and highest ID agents, i.e., a1a_{1} and a3a_{3}, whereas the number of pebble at homehome is 0. If this condition is satisfied, then the agent changes its state to Find-Pebble. Note that, this condition is satisfied only when a2a_{2} fails to reach homehome while performing this iteration, i.e., enters the Byzantine black hole, while a1a_{1} has detected some anomalies, which instigates it to leave the pebble at the current position at which it detects the anomaly, and henceforth moves back to homehome while in the state Report-Leader.

  • homehome has only the highest and lowest ID agents, i.e., a1a_{1} and a3a_{3}, but the number of pebbles at homehome is 1, which implies that a2a_{2} has failed to return to homehome even when Ttime=4nT_{time}=4n. In this case, a3a_{3} concludes SlftS_{lft} to be the node which is at a clockwise distance of n2n-2 from homehome, whereas SrgtS_{rgt} to be the node which is at a clockwise distance of n1n-1 from homehome. Finally, it updates Wtime=0W_{time}=0 and then moves to state Detection.

  • homehome has all three agents and the number of pebbles present at homehome is 2. In this case, a3a_{3} changes to state Initial, completing the iteration without detecting any anomalies.

  • After 4n4n rounds, there is no other agent except a3a_{3} present at homehome. In this case, the agent moves one hop clockwise, and then changes to state Find-BH. This case arises only when both the agents a1a_{1} and a2a_{2} fail to reach homehome while performing this iteration.

Next we define the states Report-Leader, Find-Pebble, Find-BH, Detection. An agent moves to either of these states only when it detects some anomalies.

The state Report-Leader, is executed by only the lowest ID agent, i.e., a1a_{1}, while it is in state Leader. The anomaly detected is as follows, a1a_{1}, after reaching a new node that is not homehome, along with the pebble it is carrying, waits for at most 3 rounds, for the second lowest ID agent, i.e., a2a_{2} to arrive (which is in state Follower-Find). If a2a_{2} does not arrive even after the waiting, a1a_{1} concludes that the agent (i.e., a2a_{2}) has entered the Byzantine black hole, this triggers a1a_{1} to move to state Report-Leader. In this state, it moves clockwise until it finds the highest ID agent, i.e., a3a_{3} at homehome. Then waits until Ttime=4nT_{time}=4n, after which it changes its state to Find-Pebble.

The state Find-Pebble, is performed together by only a1a_{1} and a3a_{3}, i.e., the lowest and highest ID agent. This state can be reached by a1a_{1} only via Report-Leader state, whereas by a3a_{3} from the state Backup. The main idea for the agents in this state is to move counter-clockwise till they find the pebble left by a1a_{1} when it detects some anomaly (i.e., a2a_{2} has entered the Byzantine black hole) and move into state Report-Leader. This pebble acts as a marker which indicates that the Byzantine black hole is either the counter-clockwise neighbor of this node or, it is at a counter-clockwise distance of 2 hops from it. This node at which it finds the pebble is declared to be the new homehome, from which they conclude SlftS_{lft} and SrgtS_{rgt} to be the nodes which are at a clockwise distance of n2n-2 and n1n-1, respectively from this new homehome. Finally, they update Wtime=0W_{time}=0 and then change to state Detection. Note that, this state is performed by an agent during the last round of the current iteration, (i.e., when Ttimes=4n+1T_{times}=4n+1).

The state Find-BH, is only executed by the highest ID agent, i.e., a3a_{3}. This state is executed by a3a_{3}, only when it finds no other agent at homehome, at the last round of the current iteration. This situation can only occur, when both the agents a1a_{1} and a2a_{2} have entered the Byzantine black hole. So, this triggers a3a_{3} to change to state Find-BH, in which it moves along a clockwise direction until a pebble is found. Whenever a pebble is found, it concludes the next node to be the Byzantine black hole, and starts performing perpetual exploration avoiding this node.

Finally, the state Detection, is performed by an agent (i.e., a1a_{1} or a3a_{3}) only if they know the position of SlftS_{lft} and SrgtS_{rgt}, which are not only two consecutive nodes in a suspicious region SS. Moreover, these two nodes are exactly at a distance of clockwise n1n-1 and n2n-2 distance from homehome (the homehome can be the initial starting node, or it can be the updated homehome as well). In this state, the agent with the lowest ID, i.e., a1a_{1}, moves clockwise till it reaches SrgtS_{rgt}, and then again returns back to homehome. After returning back, if it finds a3a_{3}, then again it performs the same procedure.

1 Input: n,k=3n,\leavevmode\nobreak\ k=3;
2 States:{Initial, Leader, Follower-Find, Follower-Collect, Backup, Report-Leader,Find-Pebble, Detection, Find-BH}
3 In State Initial:
Ttime=0T_{time}=0 // TtimeT_{time} is the number of rounds elapsed since the agent has moved from state Initial
4 Declare CurrentNodeCurrent-Node as homehome.
5 Gather the IDs of the remaining agents at homehome.
6 if lowest ID then
7       Move to state Leader.
8      
9 else if second lowest ID then
10       Set Move=0Move=0.
11       Move to state Follower-Find.
12      
13 else
14       Move to state Backup.
15      
16In State Leader:
17 if CurrentNode=homeCurrent-Node=home then
18       if withSecondLowestID#Pebble=2Ttime2with\leavevmode\nobreak\ Second\leavevmode\nobreak\ Lowest\leavevmode\nobreak\ ID\wedge\#Pebble=2\wedge T_{time}\geq 2  then
19             Wait at the current node till Ttime=4nT_{time}=4n.
20             Move to state Initial.
21            
22       else if WithSecondLowestID#Pebble=2Ttime<2With\leavevmode\nobreak\ Second\leavevmode\nobreak\ Lowest\leavevmode\nobreak\ ID\wedge\#Pebble=2\wedge T_{time}<2 then
23             Wtime=0W_{time}=0.
24             Move one hop along with the pebble to the next node along clockwise direction.
25            
26       else if NotwithSecondLowestID#Pebble2Not\leavevmode\nobreak\ with\leavevmode\nobreak\ Second\leavevmode\nobreak\ Lowest\leavevmode\nobreak\ ID\lor\#Pebble\neq 2 then
27             if Wtime<6W_{time}<6 then
28                   Wtime=Wtime+1W_{time}=W_{time}+1
29            else
30                   Slft=S_{lft}= node at a clockwise distance of n2n-2 from homehome
31                   Srgt=S_{rgt}= node at a clockwise distance of n1n-1 from homehome
32                   Update Wtime=0W_{time}=0 then move to state Detection.
33                  
34            
35      
36else
37       if with second lowest ID then
38             Wtime=0W_{time}=0.
39             Move one hop along with the pebble to the next node along clockwise direction.
40            
41      else
42             if Wtime<4W_{time}<4 then
43                   Stay at the current node, Wtime=Wtime+1W_{time}=W_{time}+1.
44                  
45            else
46                   Move to state Report-Leader while moving one hop in clockwise direction along without pebble.
47                  
48            
49      
50In State Follower-Find:
51 if not with lowest ID \wedge Move=0Move=0 then
52       Move one hop clockwise, without pebble and update Move=1Move=1.
53 else if not with lowest ID \wedge Move=1Move=1 then
54       Detect the CurrentNodeCurrent-Node as Byzantine black hole and continue exploring the ring perpetually avoiding this node.
55      
56 else
57       Move to state Follower-Collect.
58      
59In State Follower-Collect:
60 Move one hop in counter-clockwise direction.
61 if pebble is found then
62       Collect the pebble, and move one hop clockwise along with the pebble.
63       if Ttime=4n+1CurrentNode=homeT_{time}=4n+1\wedge Current-Node=home then
64             Change to state Initial.
65            
66      Update Move=0Move=0 and change to state Follower-Find.
67      
68else
69       Detect the CurrentNodeCurrent-Node as Byzantine black hole and continue perpetually exploring the ring avoiding this node.
Algorithm 1 PerpExplore-Coloc-Pbl
54 In State Report-Leader:
55 if Ttime<4n+1T_{time}<4n+1 then
56       Move clockwise until finds the agent with highest ID.
57       Wait until Ttime=4nT_{time}=4n.
58      
59Change to state Find-Pebble.
60
61In State Backup:
62 Wait until Ttime=4nT_{time}=4n.
63 if CurrentNodeCurrent-Node has only the lowest and highest ID agents and #Pebble=0\#Pebble=0 then
64       Move to state Find-Pebble.
65      
66 else if CurrentNodeCurrent-Node has only the lowest and highest ID agents and #Pebble=1\#Pebble=1 then
67       Slft=S_{lft}= node at a clockwise distance of n2n-2 from homehome
68       Srgt=S_{rgt}= node at a clockwise distance of n1n-1 from homehome
69       Update Wtime=0W_{time}=0 home_away=1home\_away=1 and move to state Detection.
70      
71 else if CurrentNodeCurrent-Node has both lowest and second lowest ID agent and #Pebble=2\#Pebble=2 then
72       Change to state Initial.
73      
74 else if CurrentNodeCurrent-Node has no other agent then
75       Move in a clockwise direction and change to state Find-BH.
76      
77
78In State Find-BH:
79
80if a pebble is found then
81       Conclude the next node along clockwise direction is the Byzantine black hole, and continue perpetual exploration avoiding the Byzantine black hole node.
82      
83else
84       Move along a clockwise direction.
85      
86
87In State Find-Pebble:
88 Move in a counter-clockwise direction.
89 if a pebble is found then
90       Declare CurrentNodeCurrent-Node as homehome.
91       Slft=S_{lft}= node at a clockwise distance of n2n-2 from homehome
92       Srgt=S_{rgt}= node at a clockwise distance of n1n-1 from homehome
93       Update Wtime=0W_{time}=0 and move to state Detection.
94      
95else
96       Move along a counter-clockwise direction.
97
98In State Detection:
99
100if lowest ID then
101       Moves clockwise till the node at a distance n2n-2 from homehome then returns back to homehome along the same path and checks for the other agent.
102       If other agent is there it repeats the same procedure as stated in line 86 of Algorithm 1. Otherwise detects SrgtS_{rgt} as the Byzantine black hole and start exploring avoiding that node.
103else
104       Moves one hop counter-clockwise from homehome then returns back to homehome along the same path then waits for 2n62n-6 rounds and checks for the other agent.
105       If other agent is there it repeats the same procedure as stated in line 90 of Algorithm 1. Otherwise detects SlftS_{lft} as the Byzantine black hole and start exploring avoiding that node.

On the contrary, if it does not find a3a_{3}, then it understands that SrgtS_{rgt} is the Byzantine black hole node, and hence continues perpetual exploration avoiding this node.

On the other hand, a3a_{3} in this state moves counter-clockwise direction from homehome, i.e., reaches SlftS_{lft}, after which it returns back to homehome again following the same path and then waits for 2n62n-6 rounds at homehome and then checks for the other agent, i.e., a1a_{1}.

If it finds a1a_{1}, then again continues to perform the same movement, otherwise, it concludes that SlftS_{lft} is the Byzantine black hole node, and hence starts the perpetual exploration of the ring just by avoiding this Byzantine black hole node.

9.2 Correctness and Complexity

In this section, we discuss the correctness and complexity of our algorithm PerpExplore-Coloc-Pbl.

Lemma 9.1.

If no agent gets destroyed by the Byzantine black hole, while performing an iteration of Algorithm 1, then our algorithm ensures that in that iteration, either the ring RR is explored when no agent knows the exact Byzantine black hole location or, there is one agent that knows exactly the location of the Byzantine black hole.

Proof 9.2.

Suppose till the completion of ii-th iteration (i>0)(i>0) no agent is destroyed by the Byzantine black hole, then in any iteration 0<ji0<j\leq i, the agent a1a_{1} follows the sequence SEQ1SEQ1, whereas a2a_{2} follows the sequence SEQ2SEQ2, as instructed starting from the initial homehome node. Considering this scenario we have two cases:

  • No agents and no pebbles are destroyed: In this case, while executing the sequence SEQ1SEQ1, the agent after changing its state to Leader from Initial, visits a new node after every 4 rounds in the clockwise direction. Since no agent has been destroyed in this iteration as well, so a1a_{1} un-obstructively visits each node in a clockwise direction, and reaches homehome to finally end this sequence SEQ1SEQ1, while again changing its state to Initial. This shows that at least one agent visits each node of RR in an iteration completing exploration of RR.

  • No agent gets destroyed but some pebbles are destroyed by the Byzantine black hole: Note that, this situation can only occur when the Byzantine black hole consumes the pebble carried and released by a2a_{2}, while a2a_{2} is not at the node containing the pebble, executing the sequence SEQ2SEQ2. It is because, in an iteration, only a1a_{1} and a2a_{2} moves away from homehome while executing their respective sequences SEQ1SEQ1 and SEQ2SEQ2. And the pebble carried by a1a_{1} ( i.e., the agent with the smallest ID) cannot be destroyed without destroying a1a_{1}, as a1a_{1} always carries the pebble at each node while executing its respective sequence. So, in this situation, while a2a_{2} ( i.e., the agent with the second lowest ID) in the state Follower-Collect moves back to the adjacent node in the counter-clockwise direction, in order to collect the already released pebble, absence of which triggers a2a_{2} to conclude the current node to be the Byzantine black hole, and which leads the agent to immediately leave the Byzantine black hole node. In this case, the consumption of a pebble leads to the Byzantine black hole detection.

{observation}

If no agent gets destroyed by the Byzantine black hole while performing an iteration of Algorithm 1 but some pebbles are destroyed by the Byzantine black hole, then by Lemma 9.1, one agent (more precisely, the agent with second lowest ID, i.e., a2a_{2}) detects the exact location of the Byzantine black hole. Further, this agent continues to perpetually explore the ring RR by avoiding the Byzantine black hole node.

Lemma 9.3.

If exactly one agent enters the Byzantine black hole while performing an iteration of Algorithm 1, then within finite additional rounds any of the two following conditions hold:

  1. 1.

    The exact location of the Byzantine black hole is detected by at least one agent.

  2. 2.

    All alive agents become co-located and they agree about two consecutive nodes SlftS_{lft} and SrgtS_{rgt}, one among which is the Byzantine black hole.

Proof 9.4.

Note that the agent that has entered the Byzantine black hole is either a1a_{1} or a2a_{2}, based on which we have the following conditions:

  • a1a_{1} falls in to the Byzantine black hole: This situation can only occur when a1a_{1} following sequence SEQ1SEQ1 is in state Leader, visits the Byzantine black hole node along with its pebble. Now, based on the adversarial choice of the Byzantine black hole, the pebble may or may not be destroyed by the Byzantine black hole. Irrespective of which, a2a_{2} within 3 additional rounds reaches the Byzantine black hole node while in the state Follower-Find, and the absence of a1a_{1} triggers the agent a2a_{2} to determine the current node as the Byzantine black hole, and immediately leave the current node.

  • a2a_{2} falls in to the Byzantine black hole: This can only happen when a2a_{2} is not with a1a_{1} at the Byzantine black hole node. Otherwise, both agents will be destroyed, contradicting our claim. Note that, a2a_{2} can either be with the pebble or alone, while it is destroyed by the Byzantine black hole. Also note that, since a2a_{2} is executing the sequence SEQ2SEQ2, hence the distance between a1a_{1} and a2a_{2} can be at most 2. So during an iteration, if a2a_{2} is destroyed by a Byzantine black hole, then the Byzantine black hole must be any one of the two consecutive counter-clockwise nodes, from the current position of a1a_{1}. If the current node is not homehome, in this case, a1a_{1} gets to know about this fact, only when it finds the absence of a2a_{2} even after waiting for 3 rounds, at the current node. Now, according to our algorithm, it leaves the pebble accompanied by it and moves from the current node in the clockwise direction to homehome with state Report-Leader. After, reaching homehome, it waits until the end of this iteration, i.e., until 4n4n rounds from the start of this iteration and moves to state Find-Pebble. During the 4n+14n+1-th round from the start of the current iteration, a3a_{3} finds that it is only with a1a_{1}, whereas no pebble exits, this leads the agent to change its state to Find-Pebble. In this state, both the agents move counter-clockwise from homehome until they encounter a pebble. Note that, this pebble is the one left by a1a_{1} after determining the fact that a2a_{2} has entered the Byzantine black hole. So, now both these agents a1a_{1} and a3a_{3}, declare the node with the pebble as homehome, whereas also denote the adjacent counter-clockwise node from the current node as SlftS_{lft}, whereas the other node adjacent to SlftS_{lft} in the counter-clockwise direction as SrgtS_{rgt}. On the other hand, if the current node of a1a_{1} is homehome, while a2a_{2} is destroyed by the Byzantine black hole, then a2a_{2} can never reach homehome along with the pebble it was carrying by following the sequence SEQ2SEQ2. So, at the end of this iteration, both a1a_{1} and a3a_{3} find that there are two agents (i.e., a1a_{1} and a3a_{3}) and one pebble, respectively at homehome. This leads both of them to conclude that, the adjacent counter-clockwise node is SrgtS_{rgt}, whereas the adjacent counter-clockwise node of SrgtS_{rgt} is SlftS_{lft}.

So, in each case, we showed that either of our two conditions holds.

Remark 9.5.

Following from Lemma 9.3, if exactly one agent gets destroyed by the Byzantine black hole and the exact location of the Byzantine black hole is detected by at least one agent, then our algorithm ensures that the ring is perpetually explored by at least one alive agent while avoiding the Byzantine black hole node. On the contrary, all alive agents become co-located and they agree about two consecutive nodes SlftS_{lft} and SrgtS_{rgt}, among which one is a Byzantine black hole, then until and unless another agent falls into the Byzantine black hole, our algorithm ensures that the ring is perpetually explored, by the remaining alive agents. Note that, by Lemma 9.6 while anyone among them gets destroyed, then the other agent detects the exact Byzantine black hole node, and then further perpetually explores the ring RR, avoiding the Byzantine black hole node.

Lemma 9.6.

Algorithm PerpExplore-Coloc-Pbl ensures that if two among three agents get destroyed by the Byzantine black hole, then the remaining agent knows the exact location of the Byzantine black hole within some additional finite rounds without being destroyed.

Proof 9.7.

Let us suppose, by contradiction, there exists a round rr (>0>0), within which two agents get destroyed by the Byzantine black hole, whereas the alive agent is unable to detect the exact location. Now we have the following cases:

  • Both agents get destroyed by the Byzantine black hole in the same iteration: Note that in this case, the destroyed agents are a1a_{1} and a2a_{2}, respectively, which while executing the sequences SEQ1SEQ1 and SEQ2SEQ2 enters the Byzantine black hole. Also, note that a1a_{1} and a2a_{2} can only be together at a node when a2a_{2} has left the pebble it is carrying in the counter-clockwise node. So, now a3a_{3} after the end of this iteration, finds that no agent among a1a_{1} and a3a_{3} has reached homehome, which triggers a3a_{3} to change to state Find-BH. In this state, it moves clockwise, until it finds a pebble (this pebble is the one left by a2a_{2} in the counter-clockwise node of the Byzantine black hole). Whenever a pebble is found, a3a_{3} concludes that the next node is the Byzantine black hole, which contradicts our claim.

  • There exists an iteration where exactly one agent is destroyed and the other one is destroyed during round rr: Now, in this case, let r<rr^{\prime}<r be a round when exactly an agent is destroyed during an iteration, say i>0i>0. Then by Lemma 9.3, within finitely many additional rounds r0r_{0}, where r0+r<rr_{0}+r^{\prime}<r, both the alive agents become co-located and agree about two consecutive nodes SlftS_{lft} and SrgtS_{rgt}, one among which must be the Byzantine black hole. Observe that according to our algorithm, the node that is clockwise adjacent to SrgtS_{rgt} is determined to be the homehome (if not already so). Note that in the other case according to Lemma  9.3 where after exactly one agent is destroyed by the Byzantine black hole during an iteration at a round r<rr^{\prime}<r, there is an agent that knows the exact location of the Byzantine black hole within a finite additional round and the agent starts exploring the ring avoiding the Byzantine black hole and so even after round rr it stays alive knowing the exact location of the Byzantine black hole contradicting our assumption. Now, when both the agents are co-located during a round say r0+r<rr_{0}+r^{\prime}<r and know that the Byzantine black hole must be any of the two consecutive nodes SlftS_{lft} or SrgtS_{rgt}. In this case, they move into state Detection. After which one agent moves clockwise until it reaches SlftS_{lft} and the other one moves counter-clockwise until it reaches SrgtS_{rgt} and moves back to homehome. The agent that visits SrgtS_{rgt} waits for the other agent at homehome for 2n62n-6 rounds which is sufficient for the other agent to return back at homehome. Now when during round rr, another agent among these two gets destroyed, within at most (2n4)(2n-4) rounds (among the total 2n62n-6 rounds, within which both agents are to meet) they fail to meet at homehome. Which triggers the remaining alive agent to determine exactly which one among SlftS_{lft} or SrgtS_{rgt} is the Byzantine black hole. This also contradicts the claim we made earlier. Thus, the algorithm PerpExplore-Coloc-Pbl ensures that, if two among three agents get destroyed by the Byzantine black hole, the remaining agent must know the exact location of the Byzantine black hole in some finite additional rounds without getting destroyed.

10 Algorithm PerpExplore-Scat-Pbl

10.1 Detailed description and Pseudocode of the Algorithm

In this section, we discuss the model where the agents are placed arbitrarily along the nodes of the ring RR (note that each such node must be a safe node), where each agent has a movable token, which it can carry along with it, and acts as a mode of inter agent communication. Moreover, the agent can gather the IDs of other agents which are currently at the same node at the same round. With this context, in the following part we show that 4 scattered agents with a pebble each is sufficient to solve PerpExploration-BBH on RR, using our algorithm PerpExplore-Scat-Pbl.

If 4 agents are scattered in more than one nodes initially then there are 3 cases. Firstly, all four agents are at different nodes. Secondly, four agents are scattered in three different nodes nodes initially. For this case there exists exactly one node with two agents and remaining two nodes with exactly one agents each. In the third case, four agents are scattered in two nodes initially. In this case either each of the two nodes contains exactly two agents or, one node contains three agents and the other one has exactly one agent. We here describe and present the pseudocode considering the first case only. The case with 3 agents in one node can be dealt by instructing the co-located agents to execute PerpExplore-Coloc-Pbl when there are three agents on the current node (i.e., from the beginning). The algorithm we discuss here can also be used for the remaining cases with slight modifications. These modifications are described in the Remark 10.7

The main idea of the PerpExplore-Scat-Pbl algorithm is that 4 agents perpetually explore the ring, when no agents are destroyed by the Byzantine black hole. Our algorithm ensures that during this exploration at most one agent can be destroyed. In this scenario, the remaining agents within further finite time, gather at a single node (which is the starting node of either of these 4 agents, hence it is safe), and after which they together start executing the algorithm PerpExplore-Coloc-Pbl.

Remark 10.1.

As mentioned in PerpExplore-Coloc-Pbl requires, 3 agents and 2 pebbles to perform PerpExploration-BBH, but in this case we instruct the agents to perform PerpExplore-Coloc-Pbl, whenever three agents and at least three pebbles are able to gather at a node. These agents performs PerpExplore-Coloc-Pbl with a slight modification that the excess pebble (or pebbles) remain at their gathered node, which they term as homehome. So, all the conditions that are mentioned, remains same in this case as well, only the condition where an agent changes to certain state sis_{i} by observing tit_{i} (say) number of pebbles at homehome, transforms to the fact that the agent changes to state sis_{i} by observing ti+xt_{i}+x (where x=total # pebbles2x=\text{total \# pebbles}-2) number of pebbles at homehome.

At the beginning of the Algorithm 2 all agents are in state Initial1. In this state, the agents declare their current node as homehome, moreover they initialize the variables size=0size=0 and s=0s=0, where sizesize variable is used by the agents in order to store the length of the path between it’s own homehome and the nearest homehome of another agent in the clockwise direction. Further the variable ss indicates the state transition. If the agent is at state Forward and s=s= 0 then the agent moved from state Initial1 to its current state (i.e., state Forward), otherwise if the agent is at state Forward and s=1s=1 then this indicates it changes to state Forward from state Wait2. An agent a1a_{1} in state Forward, initializes Wtime=0W_{time}=0 (which stores the waiting time) and checks whether s=0s=0 or s=1s=1. Note that, if s=0s=0 and the current node is homehome, then the a1a_{1} is first instructed to leave the pebble at current node and then move clockwise direction, after increasing sizesize by 1. The next node where a1a_{1} has reached can either be homehome of another agent, say a2a_{2}, or it is not homehome for any other agents. For the first case a1a_{1} would find a pebble on its CurrentNodeCurrent-Node which was left by a2a_{2}. In this case a1a_{1} updates ss to 1 and moves into state Wait1. On the other hand, if the CurrentNodeCurrent-Node is not homehome of any other agents then a1a_{1} finds no pebble at the CurrentNodeCurrent-Node and thus moves clockwise after increasing the variable sizesize by 1. Note that, when s=0s=0 and an agent is in state Forward it always finds another pebble on some node, if it is not destroyed (this pebble must be left by another agent which is simultaneously executing Algorithm 2 and currently in state Forward). This node must be the clockwise nearest homehome (i.e., homehome of another agent which is clockwise nearest to own homehome). Now since during each move at state Forward, an agent increases the variable sizesize by 1, the sizesize variable must store the length between an agents own homehome and the clockwise nearest homehome when the agent finds another pebble. Beyond this point (i.e., when s=1s=1) the agents will use the sizesize variable as reference to calculate how much it should move, as after this, there is a possibility that the agent may not find a pebble at the clockwise nearest homehome.

On the contrary, if s=1s=1, this implies the agent already knows how much distance it should travel from its own homehome in order to reach the clockwise nearest homehome. So, now if the current node is homehome it just moves clockwise by initializing the variable distancedistance to 1 (where the variable distancedistance stores the amount of distance the agent has traversed from its own homehome). Otherwise, if current node is not homehome, then the agent continues to move clockwise while updating distancedistance by 1, until it reaches the clockwise nearest homehome (i.e., when distance=sizedistance=size), after which it further changes to state Wait1.

In state Wait1, the agent is instructed to wait at the current node (more specifically, the current node is the clockwise nearest homehome of the agent) for nsize1n-size-1 rounds. After which it changes to state Fetch. Note that, if each agent starts executing the state Forward at the same round, this implies that these agents change to state Fetch together at the same round (which is precisely at the n+1n+1-th round since the start of state Forward). Thus we have the following observation. {observation} If all agents moved into the Forward state together at a round tt then, all of them move to state Fetch together at the round t+n+1t+n+1.

In state Fetch, the agent first checks if the current node has a pebble, if so then it further checks whether current node is homehome or not. If the current node is not homehome, then it moves counter-clockwise with pebble, until it reaches homehome. Otherwise, if current node is homehome then it checks whether there are more than one pebble present at the current node or not. If so, then the agent changes its state to Gather1. Otherwise, if the current node does not have more than one pebble, then it initializes WtimeW_{time} to 0 and changes to state Wait2.

In state Wait2, the agent first checks whether Wtime<2nsizeW_{time}<2n-size, if so then it further checks whether #Agent\#Agent at current node is exactly 1. If these two conditions are satisfied then the agent just increments WtimeW_{time} by 1. On the other hand, if it finds that Wtime<2nsizeW_{time}<2n-size but #Agent\#Agent at the current node is 2, then it changes its state to Gather2 and moves clockwise and updates WtimeW_{time} to 0. Otherwise, if it finds Wtime<2nsizeW_{time}<2n-size but #Agent\#Agent at the current node is 3 then it updates WtimeW_{time} to 0, whereas changes its state to Coloc. Lastly, whenever it finds Wtime=2nsizeW_{time}=2n-size, it changes its state to Forward.

Note that if no agent gets destroyed by the Byzantine black hole, then our algorithm guarantees that an agent can neither changes its state to Gather1 or in state Gather2. It is because, an agent, say a1a_{1} can only find more than one pebble at its homehome node, only when another agent say a2a_{2}, which was supposed to fetch the pebble left by a1a_{1} at its homehome, is destroyed. In this case, whenever a1a_{1} returns while in state fetch with another pebble, it finds more than one pebble. So the first agent, which first finds this anomaly changes its state to Gather1 from the state Fetch. Now this agent must initiate gathering with the remaining two agents (as it is the one which has first detected the anomaly of more than one pebble at its homehome). Note that, while a1a_{1} starts its gathering phase, moving in a clockwise direction, there is a possibility that other agents are still moving either in clockwise or counter-clockwise direction. So, to address this challenge, the algorithm instructs a1a_{1} (i.e., the agent which is in state Gather1) to wait at the current node (i.e., its homehome) for precisely nsize1n-size-1 rounds, and then start moving in clockwise direction. An agent moves to state Gather1 at (n+2+size(n+2+size)-th round from the round when all agents changed state to Forward (n+1n+1 round to move into Fetch state, sizesize rounds to reach homehome and one round to change state to Gather1). Then waits for another nsize1n-size-1 before it starts moving. So it starts moving at (2n+2)(2n+2)-th round from the round when all agents changed state to Forward together the last time. Now, an agent reaches its homehome in state Fetch in round n+1+size(2n1<2n+2n+1+size(\leq 2n-1<2n+2, as sizen2size\leq n-2) after the round when all agents changed to state Forward together the last time. So, the waiting time of a1a_{1}, being in state Gather1 guarantees that all the other alive agents reach their respective homehome while in state Fetch. Now, in order to avoid further movement of remaining agents (since these agents are yet to detect any anomaly, they might change to state Forward and starts moving, which makes gathering a bit challenging), our algorithm instructs the remaining agents to wait at the current node for a certain number of rounds (i.e., more precisely, 2nsize12n-size-1). This waiting period is sufficient, for the agent a1a_{1} to meet with the other alive agents while in state Gather1. Note that, if no agent detects any anomaly, then they directly change their state to Wait2 from the state Fetch. If no such agent exists which encounters any anomaly and changes its state to Gather1 or Gather2 then this waiting time of 2nsize12n-size-1 rounds, also ensures that all of them must move to state Forward at the exact same round (i.e, (3n+23n+2)-th round from the previous time it moved to state Forward)111At (n+1)(n+1)-th round an agent moves to state Fetch after that it moves for sizesize rounds to reach its homehome in counter-clockwise direction and changes to state Wait2. So at round n+3+sizen+3+size an agent changes to state Wait2. After that waits for further 2nsize12n-size-1 rounds and changes to state forward, taking a total of 3n+23n+2 rounds . Now we have the following observation {observation} Let tt be a round when all alive agents moved into state Forward. If no agent detects any anomaly (i.e., no agent finds more than one pebble at home) then, at round t+3n+2t+3n+2 all the agents together move into state Forward again.

1 Input: nn
2 State:{Initial1, Forward, Fetch, Wait1, Wait2, Coloc, Gather}
3 In State Initial1:
4 Declare CurrentNodeCurrent-Node as homehome.
5 Initialize size=0size=0 and s=0s=0, then change to state Forward.
6 In State Forward:
7 Initialize Wtime=0W_{time}=0.
8 if s=0s=0 then
9      
10      if CurrentNodeCurrent-Node is not homehome and has a pebble then
11             update s=1s=1 and Change state to Wait1
12            
13       else if CurrentNodeCurrent-Node is homehome then
14             Leave the pebble at homehome.
15             Move in a clockwise direction and update size=size+1size=size+1.
16            
17       else
18             Move in a clockwise direction and update size=size+1size=size+1.
19            
20      
21else
22       if CurrentNodeCurrent-Node is homehome then
23             Initialize distance=1distance=1 and move in a clockwise direction leaving the pebble.
24            
25       else if distance<sizedistance<size then
26             Move in a clockwise direction and update distance=distance+1distance=distance+1.
27            
28       else if distance=sizedistance=size then
29             Change State to Wait1.
30            
31      
32In State Wait1:
33 if Wtime<nsizeW_{time}<n-size then
34       Wtime=Wtime+1W_{time}=W_{time}+1.
35      
36else
37       Change state to Fetch.
38      
39In State Fetch:
40 if CurrentNodeCurrent-Node has a pebble then
41       if CurrentNodeCurrent-Node is not homehome then
42             Move counter-clockwise with the pebble.
43            
44      else
45             if homehome has more than one pebble then
46                   Change to state Gather1.
47                  
48            else
49                   Initialize Wtime=0W_{time}=0 and change to state Wait2.
50                  
51            
52      
53else
54       if CurrentNodeCurrent-Node is not homehome then
55             Move in a counter-clockwise direction.
56            
57      else
58             Initialize Wtime=0W_{time}=0 and change to state Wait2.
59            
60      
61In State Wait2:
62 if Wtime<2nsize#AgentW_{time}<2n-size\wedge\#Agent at CurrentNodeCurrent-Node is 1 then
63       Wtime=Wtime+1W_{time}=W_{time}+1.
64      
65 else if Wtime<2nsize#AgentW_{time}<2n-size\wedge\#Agent at CurrentNodeCurrent-Node is 2 then
66       Initialize Wtime=0W_{time}=0 and change to state Gather2 and moves clockwise.
67      
68 else if Wtime<2nsize#AgentW_{time}<2n-size\wedge\#Agent at CurrentNodeCurrent-Node is 3 then
69       Initialize Wtime=0W_{time}=0 and change to state Coloc.
70      
71 else if Wtime=2nsizeW_{time}=2n-size then
72       Change to state Forward.
73      
74In State Gather1:
75 if Wtime<nsizeW_{time}<n-size then
76       Wtime=Wtime+1W_{time}=W_{time}+1
77else
78       if #Agent\#Agent at CurrentNode<Current-Node<3 then
79             Move in a clockwise direction with all the pebbles at the CurrentNodeCurrent-Node
80            
81      else
82             Change to state Coloc.
83      
84In State Gather2:
85 if #Agent\#Agent at CurrentNodeCurrent-Node < 3 then
86       Move in a clockwise direction with all the pebbles at the CurrentNodeCurrent-Node.
87      
88else
89       Change to state Coloc.
90      
91In State Coloc:
92 Declare CurrentNodeCurrent-Node as homehome.
Change state to Initial and execute PerpExplore-Coloc-Pbl.// State Initial is the state defined in PerpExplore-Coloc-Pbl algorithm
93
Algorithm 2 PerpExplore-Scat-Pbl

An agent in state Gather1, is the first agent to detect the anomaly, hence it is first instructed to wait at the current node, i.e., its homehome for the first nsize1n-size-1 rounds, and then start moving in a clockwise direction, while accompanying all the pebbles at the current node 222Note that we have considered that in this case an agent, while in state Gather1 or Gather2 can carry more than one pebble, which can be easily restricted to one agent can carry only one pebble, but in that case the agent needs to return and carry one pebble each time and reach back to its current node.

This movement in the clockwise direction continues until the number of agent at the current node is exactly 3, after which it changes to state Coloc.

An agent in state Gather2 (i.e., the alive agents which are not the first to detect the anomaly), first checks whether the current node has exactly 3 agents on it, if not then it moves in a counter-clockwise direction, while accompanying the pebbles present at its homehome, until it satisfies the condition, where it finds a node on which a total of 3 agents exists. After which they change their state to Coloc.

In state Coloc, an agent declares its current node as homehome, while also changes its state to Initial 333The state Initial is defined in Algorithm 1 and then executes algorithm PerpExplore-Coloc-Pbl.

10.2 Correctness and Complexity

In this section, we discuss the correctness and complexity of our algorithm PerpExplore-Scat-Pbl. Before that, let us define an iteration of the algorithm PerpExplore-Scat-Pbl. An iteration is a set of 3n+13n+1 consecutive rounds starting from the round in which all alive agents change to state Forward together. Next we prove the following lemma.

Lemma 10.2.

If no agents are destroyed by the Byzantine black hole until the completion of pp-th iteration, then for each jj-th iteration, every node of the ring RR is visited by at least one agent, where j+,andjpj\in\mathbb{N}^{+},\leavevmode\nobreak\ \text{and}\leavevmode\nobreak\ j\leq p.

Proof 10.3.

Let a0,a1,a2a_{0},a_{1},a_{2} and a3a_{3} be 4 agents initially located at h0,h1,h2h_{0},h_{1},h_{2} and h3h_{3} respectively where, h0,h1,h2,h3h_{0},h_{1},h_{2},h_{3} are in clockwise order starting from h0h_{0}. By Seg(ai)Seg(a_{i}) we denote the clockwise arc starting from hih_{i} and ending at h(i+1)(mod4)h_{(i+1)\pmod{4}}. Note that in any of the jj-th iteration (jpj\leq p), an agent aia_{i} (for all i{0,1,2,3}i\in\{0,1,2,3\}) moves clockwise along Seg(ai)Seg(a_{i}) starting from hih_{i} while in state Forward and reaches h(i+1)(mod4)h_{(i+1)\pmod{4}}. Then aia_{i} in the same iteration moves back to hih_{i} again while being in state Fetch. Thus each node of Seg(ai)Seg(a_{i}) is explored twice in jj-th iteration by aia_{i}, where jpj\leq p. Since for any vRv\in R, vSeg(aj),v\in Seg(a_{j}), for some j{0,1,2,3}j\in\{0,1,2,3\}, and in each iteration aja_{j} explores each node of Seg(aj)Seg(a_{j}) until pp-th iteration, the result follows.

Corollary 10.4.

If no agents are destroyed, the agents can perpetually explore a ring execuing the algorithm PerpExplore-Scat-Pbl.

Next we prove, after the consumption of one agent by the Byzantine black hole, during a subsequent iteration or at the current iteration, at most one agent can change its state to Gather1 and gathers with two more agents before that iteration ends.

Lemma 10.5.

In an iteration, at most one agent can change its state to Gather1 executing PerpExplore-Scat-Pbl. Furthermore, before the end of that iteration the agent gathers with two more agents at a safe node with at least 3 pebbles.

Proof 10.6.

Let a0,a1,a2a_{0},a_{1},a_{2} and a3a_{3} be 4 agents initially located at h0,h1,h2h_{0},h_{1},h_{2} and h3h_{3} respectively where, h0,h1,h2,h3h_{0},h_{1},h_{2},h_{3} are in clockwise order starting from h0h_{0}. By Seg(ai)Seg(a_{i}) we denote the clockwise arc starting from hih_{i} and ending at h(i+1)(mod4)h_{(i+1)\pmod{4}}. Without loss of generality, let the first agent that is destroyed by the Byzantine black hole be a0a_{0} during the pp-th iteration. So, the Byzantine black hole vbv_{b}, must be in Seg(a0)Seg(a_{0}). Since, no agents changes to state Gather1, before an agent is destroyed. Hence, until (p1)(p-1)-th iteration, there does not exist any agent, which changes its state to Gather1. Now, we have following two cases, which are based on the state a0a_{0} was in, before it gets destroyed by the Byzantine black hole.

Case-I: a0a_{0} was in state Forward when it was destroyed. So, a0a_{0} fails to reach h1h_{1} to bring the pebble, left by a1,a_{1}, back to h0h_{0} during pp-th iteration. So, when a1a_{1} reaches h1h_{1} at the pp-th iteration, along with the pebble it collected from h2h_{2}, it finds two pebble at the node h1h_{1}. This happens at (n+2+|Seg(a1)|)(n+2+|Seg(a_{1})|)-th round of pp-th iteration. In the same round a1a_{1} changes to state Gather1. Next it waits an additional n|Seg(a1)|1n-|Seg(a_{1})|-1 rounds and then in the (2n+2)(2n+2)- th round of the pp- th iteration, it starts moving clockwise along with both the pebbles. Note that, all other alive agents (i.e., a2a_{2} and a3a_{3}) reaches their home by the (2n+2)(2n+2)-th round of the pp-th iteration. Also upon reaching their respective homehome, a2a_{2} and a3a_{3} both sees exactly one pebble (i.e., the pebble they carried back to their homehome) so they change their state to Wait2. By Observation 1, from (2n+2)(2n+2)-th round of the iteration upto the end of the iteration (i.e., (3n+1)(3n+1)-th round of the iteration), both a2a_{2} and a3a_{3} stays at h2h_{2} and h3h_{3}, respectively in state Wait2. So, after a1a_{1} starts moving clockwise in the (2n+2)(2n+2)-th round, it first meets a2a_{2} in round 2n+1+|Seg(a1)|2n+1+|Seg(a_{1})| (which is 3n1\leq 3n-1 as |Seg(a1)|n2|Seg(a_{1})|\leq n-2) of the pp-th iteration. And then meets a3a_{3} at round 2n+1+|Seg(a1)|+|Seg(a2)|3n2n+1+|Seg(a_{1})|+|Seg(a_{2})|\leq 3n (as |Seg(a1)|+|Seg(a2)|n1)|Seg(a_{1})|+|Seg(a_{2})|\leq n-1) which is also in pp-th iteration. Now note that, the moment a1a_{1} meets a2a_{2}, it changes to state Gather2 and starts moving together with a1a_{1} along with its own pebble until they meet a3a_{3}. When all three of them gathers together at h3h_{3} there is atleast 3 pebbles at h3h_{3} (two pebbles carried by a1a_{1}, one pebble carried by a2a_{2}, and one pebble remains for a3a_{3}). In this scenario, they change their state to Coloc. Note that in pp-th iteration only a1a_{1} changes to state Gather1 as other agents can not change to state Gather1 from either from Wait2, or, Gather2, or, Coloc. So, for this case the claimed result holds.

Case-II: Let a0a_{0} was in state Fetch while it was destroyed by the Byzantine black hole node vbv_{b}. In this case, none of the alive agents see more than one pebble at their homehome after they return there in the pp-th iteration. This is because, here the the pebbles left by agents a0,a1,a2a_{0},a_{1},a_{2} and a3a_{3} has been collected by agents a3,a0,a1a_{3},a_{0},a_{1} and a2a_{2}, respectively and when they reach their corresponding homehome, the pebble they carried are the only one there. Thus all of them (except a0a_{0} as it was destroyed during pp-th iteration in state Fetch) moves to state Wait2 after reaching homehome at the pp-th iteration and after the end of the iteration moved to state Forward and starts the (p+1)(p+1)-th iteration. Since a0a_{0} was destroyed in the previous iteration it remains unavailable to collect the pebble from h1h_{1}, left by a1a_{1} in the (p+1)th(p+1)-th iteration. Note that here in this iteration both a1a_{1} and a2a_{2} collects pebble from h2h_{2} and h3h_{3} ( left by a2a_{2} and a3a_{3} respectively) and returns back to h1h_{1} and h2h_{2} respectively. But a3a_{3} upon reaching h0h_{0} does not find any pebble to collect. In this case it returns to h3h_{3} without any pebble. Note that here only a1a_{1} sees more than one pebble upon returning back to h1h_{1} in the (p+1)(p+1)-th iteration. So only a1a_{1} changes to state Gather1 at round n+2+|Seg(a1)|n+2+|Seg(a_{1})|. Now by similar argument as in Case-I, the rest follows.

After 3 agents gather at a safe node with at least 3 pebbles they execute the algorithm PerpExplore-Coloc-Pbl which solves the problem of PerpExploration-BBH on a ring RR for 3 co-located agents with at least one pebble each agent (refer, Theorem 4.2). Thus this proves Theorem 5.2. which is stated again below.

Statement of Theorem 5.2: Algorithm PerpExplore-Scat-Pbl solves PerpExploration-BBH problem of a ring RR with 4 synchronous and scattered agents under the pebble model of communication where each agents are equipped with a pebble.

10.3 Modification of PerpExplore-Scat-Pbl to include the cases where starting positions has multiplicity

Remark 10.7.

In the discussion of our Algorithm 2, we have considered that 4 agents are scattered along 4 distinct nodes (i.e., each node with multiplicity 1). Here we describe how our algorithm (Algorithm 2) works for the remaining cases, (i.e., when 4 agents are scattered among 3 or 2 nodes initially) by slight modification. Observe that, in these remaining cases there exists at least one node, where multiplicity is greater than 1 initially. Let there exists a node with multiplicity 33, in this case, these agents directly start executing PerpExplore-Coloc-Pbl. While execution of the algorithm, if they encounter the fourth agent somewhere along RR, they just ignore this agent (note that the IDs, of all the 3 initially co-located agents are already collected by each other) while executing their current algorithm. On the other hand, if initially there exists a node with multiplicity greater than 1 and less than 3, then in that case, only the lowest ID agent (say a1a_{1}) at the current node, changes its state Forward, whereas the other agent at the current node (say a2a_{2}) changes its state Backup-Wait at some round say t0t_{0} (>0)(>0). The agent in state Forward, continue executing the algorithm PerpExplore-Scat-Pbl, whereas the agent in state Backup-Wait, waits at the current node for 2n+12n+1 rounds (i.e., until t0+2n+1t_{0}+2n+1-th round) and then checks for anomaly in the next round (i.e., if the current node has more pebble than current number of agents). If such anomaly exists after t0+2n+1t_{0}+2n+1 round, then that implies that a1a_{1} is already in state Gather1. It is because, a1a_{1} while it returned back to its homehome carrying a pebble in state Fetch at round t0+n+size+2t_{0}+n+size+2 round (where sizesize is the length of Seg(a1)Seg(a_{1})), it encounters the first anomaly, i.e., the number of pebble is more than number agents. In that case, a1a_{1} directly changes its state to Gather1, and further waits at homehome for nsize1n-size-1 rounds, i.e., till t0+2n+1t_{0}+2n+1 rounds. After which it starts to move clockwise, and on the other hand a2a_{2} also starts moving clockwise, while changing its state to Gather2 from Backup-Wait. This guarantees that if the anomaly is detected at a multiplicity then both a1a_{1} and a2a_{2} moves together to gather with the third agent, which is in state Wait2. Now if the anomaly is not detected at the multiplicity, that is a2a_{2} at round t0+2n+1t_{0}+2n+1 finds no anomaly then it moves into state Backup whereas a1a_{1} is in state Wait2 at the same node. Both of them waits until round 3n+13n+1 and at round 3n+23n+2, a1a_{1} changes its state to Forward again (refer to Observation 1) and a2a_{2} changes its state to Backup-Wait again. If some other agent detects anomaly it must meet a1a_{1} and a2a_{2} at their homehome at some round tt where t0+2n+2tt0+3n+1t_{0}+2n+2\leq t\leq t_{0}+3n+1. In that case they find that there are 3 agents at their homehome and all of them change to state Coloc and executes algorithm PerpExplore-Coloc-Pbl.

11 Algorithm PerpExplore-Scat-Whitbrd

In this section, we discuss the algorithm PerpExplore-Scat-WhitBrd, which achieves PerpExploration-BBH, with the help of three agents on a ring RR with nn nodes, where each node has a whiteboard that can store O(logn)O(\log n) bits of data. Note that, in this model as well we have considered that the agents are placed arbitrarily placed along the nodes of the ring RR (each such node is a ‘safe node’). So, there can be two cases, first, all the three agents are initially placed at three different positions, second, two agents are together whereas the third agent is in a different position. We will provide algorithm for the first case only, as an algorithm for the second case can be easily designed by modifying and merging the algorithms for the first case and algorithm PerpExplore-Coloc-Pbl (as discussed in Remark 11.15 in Appendix, Section 11.3).

11.1 Detailed description and Pseudocode of the algorithm

Let us consider the three agents (say, a1a_{1}, a2a_{2} and a3a_{3}) are initially placed at three nodes of the ring RR, which are not only safe nodes but are also recognized as the homehome of these agents. Initially, the agents starting from their respective homehome are assigned the task to explore a set of nodes, which we term as a segment of the corresponding agents. More precisely, a segment for an agent aia_{i} is defined as the set of consecutive nodes, starting from its homehome and ending at the nearest clockwise homehome (i.e., the homehome of first clockwise placed agent), which is also termed as Seg(ai)Seg(a_{i}). Note that i=13Seg(ai)=R\cup^{3}_{i=1}Seg(a_{i})=R. So if none of the agents are ever destroyed the ring will still be perpetually explored.

Let us first discuss the case, in which we describe the possible movements of the agent and the respective state changes they perform, until one agent gets destroyed by the Byzantine black hole, and another agent gets to know that an agent is already destroyed by the Byzantine black hole. After which, we will describe all the possible movements and state changes performed by the remaining two alive agents, between getting to know that already one has been destroyed by the Byzantine black hole, and finally detecting the Byzantine black hole’s position.

Initially, all agents start from state Initial at their respective homehome. In state Initial, an agent ( without loss of generality, say a1a_{1}) first clear the already present data (if at all) at the whiteboards of their respective homehome, then initializes Ttime=0T_{time}=0 (TtimeT_{time} stores the number of rounds elapsed since the start of state Initial), and writes a message of the form (home, ID) at its homehome, where ID is the ID of the agent. This type of message is termed as “home" type message, which consists of two components, the first component stores the message home and the second component stores the ID of the agent writing, i.e., ID of the agent whose homehome is the CurrentNodeCurrent-Node. Further, it changes its state to Forward and moves in the clockwise direction.

In state Forward, the agent moves in the clockwise direction while erasing the earlier direction marking (if exists), i.e., left and then writes the new direction marking, i.e., right in each node. The agent also increases the TtimeT_{time} variable by one in each round. This process continues until the agent encounters a node that has a “home" type message. This “home" type message signifies that the agent has reached the end of segment Seg(a1)Seg(a_{1}), i.e., in other words, it has reached the nearest clockwise homehome, say vcv_{c}. Note that the length of a segment can be at most n2n-2, hence within Ttime=n1T_{time}=n-1, an agent a1a_{1} is bound to reach the last node of its own segment i.e., vcv_{c}. In any case irrespective of the current TtimeT_{time}, the agent waits at vcv_{c} until Ttime=n1T_{time}=n-1, after which in the next round, it checks for the following information at vcv_{c}. If the agent finds a message of type “visited" at vcv_{c}, the agent considers this as an anomaly and learns that an agent of which vcv_{c} is the home (from the ID component of home type message at vcv_{c}) must have entered Byzantine black hole while returning back from its clockwise nearest homehome (refer Lemma 11.1). Then in this case, the agent stores the message of type dir in its local memory, where dir=(Counter-clockwise, NULL). In a dir type message, the first component is called a direction component which indicates the direction of the agent that gets destroyed by the Byzantine black hole, along which it was moving just before it gets destroyed. On the other hand, the second component either stores ID of some agent or stores NULLNULL message. Both these components are useful for certain state transitions. Next, the agent changes its state to Gather. Otherwise, if no anomaly is detected, then the agent simply writes the message (Visited, self ID) at vcv_{c} and changes its state to Back-Wait.

Next, in state Back-Wait, an agent (here a1a_{1}) waits at vcv_{c} until Ttime=2n1T_{time}=2n-1. In this waiting time, a1a_{1} waits for the other agent to meet a1a_{1} if the other agent detects any anomaly during its state Forward. While waiting, if it finds that the #Agent\#Agent at vcv_{c} is more than 1, and the whiteboard at vcv_{c} has a message of type dir, then the agent performs the following task. After noticing this, the agent moves along the counter-clockwise direction, while changing its state to Gather2. Note that, our algorithm ensures that while in state Back-Wait, if a dir type message is seen by an agent, then the direction component of this message must be in a counter-clockwise direction (refer Lemma 11.7). Otherwise, if no such dir type message is seen by a1a_{1}, and also Ttime=2nT_{time}=2n, then in this round, the agent changes its state to Backtrack.

In state Backtrack, an agent (here a1a_{1}) starts to move in a counter-clockwise direction from vcv_{c}, and after each move erases the earlier direction, i.e., right, and writes the new direction, i.e., left, and also increments TtimeT_{time} by 1. This process continues until it reaches its own homehome, i.e., reads a home type message with ID same as its own ID. Again note that, since a segment can be of length at most n2n-2, hence within Ttime=3n1T_{time}=3n-1, the agent reaches its own homehome. After which it does not move until Ttime=3nT_{time}=3n. At Ttime=3nT_{time}=3n, it checks whether its homehome has visited type message, if so then directly changes its state to Initial-Wait. Otherwise, the absence of such visited type message, creates an anomaly for the agent. This only happens when another agent, say aja_{j}, (j1j\neq 1), for which Seg(a1)Seg(aj)=Seg(a_{1})\cap Seg(a_{j})= homehome of a1a_{1}, does not arrive at homehome of a1a_{1} during its Forward state because of getting destroyed at the Byzantine black hole (refer Lemma 11.3). This instigates the agent a1a_{1} to change its state to Gather and store the dir type message (clockwise, NULL) in its local memory.

In state Initial-Wait, the agent waits at its homehome until Ttime=4n1T_{time}=4n-1. This waiting period is enough for an anomaly finding agent in state Backtrack, to meet with it. If the agent finds that there is more than one agent at its homehome, and also there is a dir type message as well, then our algorithm ensures that the direction component of this dir type message must be in clockwise direction (refer Lemma 11.9). In this case, the agent starts moving clockwise and changes its state to Gather1. On the contrary, if Ttime=4nT_{time}=4n and no anomaly is detected, then the agent again moves back to state Initial.

An agent can change its state to Gather, either from state Forward or from state Backtrack. Note that in either case, it carries the stored message of type dir (which has a direction component and an ID component that is either NULLNULL or stores the ID of an agent). So, in this state if the direction component of dir is along clockwise (resp. counter-clockwise), then the agent moves along clockwise (resp. counter-clockwise) direction until it finds a node with #Agent\#Agent more than one. Next, in case of a counter-clockwise direction component, the agent updates the dir message to (Counter-clockwise, ID’) where ID’ is the ID of the other agent at the same node. Then the agent writes the updated dir message at the current node and changes state to Gather2. If the agent in the state Gather met the other agent when the dir type message has a clockwise direction component, the agent simply just writes the message at the current node and moves to state Gather1.

Also, note that exactly one agent can move into state Gather. This is because if an agent is destroyed during Forward state then the anomaly is first found by a single agent whose homehome is the clockwise nearest homehome of the destroyed agent. This agent changes its state to Gather. Now, before the other agent finds further anomaly the agent in state Gather meets the other agent and forces it to change into state Gather1. Similarly, If an agent a1a_{1} is destroyed by the Byzantine black hole during its Backtrack state, then the first anomaly is detected by a single agent (more precisely the agent for which the clockwise nearest homehome is the homehome of a1a_{1}). In this case, it changes its state to Gather and forces the other agent to move into state Gather2 by meeting it before it finds further anomaly. Thus we have the following observation. {observation} There is exactly one agent that changes its state to Gather throughout the execution of Algorithm PerpExplore-Scat-Whitbrd. Also, The agent which changes its state to Gather, is the first agent to understand that, an agent has already been destroyed by the Byzantine black hole.

An agent can change its state to Gather1, only from the states Initial-Wait or Gather. An agent changes its state to Gather1 from Gather, only when while moving along clockwise direction finds another agent present, in which case it writes the corresponding message of type dir and correspondingly changes its state to Gather1. on the other hand, an agent (here a1a_{1}) can only change its state to Gather1 from Initial-Wait, if it is waiting at its homehome, and within which it encounters another agent at its homehome along with it a message of type dir is written (in which the direction component of dir is along clockwise). Note that if a1a_{1} in state Initial-Wait finds more than one agent at the current node and dir type message at round tt then, the other agent must be in state Gather while written there at round t1t-1 and moved into state Gather1 in the same round. Then, during round tt, a1a_{1} first stores the dir type message before it moves to state Gather1 and moves according to the direction component of the dir type message (i.e., clockwise). Also, the other agent that changed its state to Gather1 from Gather in round t1t-1 also moves according to the dir type message during round tt. Thus we have another observation {observation} If two agents move to state Gather1, one moves from state Gather, and the other moves from state Initial-Wait. Furthermore, they change to state Gather1 at the same node and leave the node together at the same round and stay together.

In state Gather1, the agent which changes its state to Gather1 from Initial-Wait first stores the dir type message, as the other agent must already have stored this message in state Gather. Irrespective of which, the agent starts moving in a clockwise direction until it finds a node that has a home (i.e., of the form (home, ID)) type message, where the ID component this message does not match with the IDs of the agents present at the current node. Note that our algorithm ensures that the current node is the homehome of aja_{j} if aja_{j} is the agent to be destroyed by the Byzantine black hole (refer Lemma 11.11). Further, as there are two agents at the current node both in state Gather1 (Observation 11.1), so now the agent with the lowest ID, sets Move=0Move=0, also initializes the MarkingMarking variable to rightright, since the direction component of dir is clockwise, and further changes its state to Cautious-Leader. On the other hand, the other alive agent at the current node changes its state to Cautious-Follower, while initializing Move=0Move=0.

// Algorithm is written for an agent rr
1 Input: nn
2 States:{Initial,Forward,Back-Wait,BackTrack,Initial-Wait,Gather\{\textbf{Initial},\textbf{Forward},\textbf{Back-Wait},\textbf{BackTrack},\textbf{Initial-Wait},\textbf{Gather},
3              Gather1,Gather2,Cautious-Leader,Cautious-Follower}\textbf{Gather1},\textbf{Gather2},\textbf{Cautious-Leader},\textbf{Cautious-Follower}\}
4 In State Initial:
5 Clear Whiteboard at the CurrentNodeCurrent-Node
6 Ttime=0T_{time}=0
7 Write (home, ID(rr)) at the CurrentNodeCurrent-Node.
8 Change state to Forward and move clockwise
9
10In State Forward:
11 if Ttime<nT_{time}<n then
12       Ttime=Ttime+1T_{time}=T_{time}+1
13       if CurrentNodeCurrent-Node does not have any “home” type messages then
14            
15            Write at the CurrentNodeCurrent-Node right and erase left (if exists) and move clockwise.
16            
17      
18else
19       Ttime=Ttime+1T_{time}=T_{time}+1
20       if CurrentNodeCurrent-Node already have a “visited” type message then
21             Store the message of type dir, where dir=(Counter-clockwise,NULL)
22             and then change to state Gather.
23            
24      else
25             Write (Visited, ID(rr)) at the CurrentNodeCurrent-Node and change to state Back-Wait
26      
27
28In State Back-Wait:
29 if Ttime<2nT_{time}<2n then
30       Ttime=Ttime+1T_{time}=T_{time}+1
31       if #Agent\#Agent at the CurrentNode>1Current-Node>1 \wedge have a message of type ”dir" then
32             if direction component of dir message is of type “counter-clockwise" then
33                   Store the dir type message in local memory
34                   Move along direction counter-clockwise, and change to state Gather2.
35                  
36            
37      
38else
39       Move in counter-clockwise direction and change to state Backtrack.
40      
41In State Backtrack:
42 if Ttime<3nT_{time}<3n then
43       Ttime=Ttime+1T_{time}=T_{time}+1.
44       if CurrentNodeCurrent-Node does not have any “home" type message then
45             Write at the CurrentNodeCurrent-Node left and erase right and move counter-clockwise.
46            
47      
48else
49       Ttime=Ttime+1T_{time}=T_{time}+1
50       if CurrentNodeCurrent-Node already have a “visited" type message then
51             Change to state Initial-Wait.
52            
53      else
54             Store the message of type dir, where dir=(Clockwise,NULL) and then change to state Gather.
55            
56      
57In state Initial-Wait:
58 if Ttime<4nT_{time}<4n then
59       Ttime=Ttime+1T_{time}=T_{time}+1
60       if #Agent\#Agent at the CurrentNode>1Current-Node>1 \wedge have a message of type “dir" then
61             if direction component of dir message is of type “clockwise" then
62                   Store the dir type message in local memory
63                   Change to state Gather1 and move clockwise.
64                  
65            
66      
67else
68       Change to state Initial.
69      
70In State Gather:
71 if direction component of dir is clockwise then
72       if #Agents\#Agents at CurrentNodeCurrent-Node is 1 then
73             Move in a clockwise direction.
74      else
75             Write at CurrentNodeCurrent-Node dir and move to state Gather1.
76            
77      
78else
79       if #Agents\#Agents at CurrentNodeCurrent-Node is 1 then
80             Move in a counter-clockwise direction.
81      else
             Update dir= (counter-clockwise,ID’) // ID’ is the ID of the other agent
82             Write at CurrentNodeCurrent-Node dir and move to state Gather2.
83            
84      
85
Algorithm 3 PerpExplore-Scat-WhitBrd
61
62In State Gather1:
63 if CurrentNodeCurrent-Node has “home" type message with the ID component of the message does not match with IDs of the agent present at the CurrentNodeCurrent-Node 444IDs present at the CurrentNodeCurrent-Node implies the IDs of the agents present at the CurrentNodeCurrent-Node then
64       if ID is the lowest among the set of IDs at the CurrentNodeCurrent-Node then
65             Set Move=0Move=0.
66             if direction component of dir is clockwise then
67                  Set Marking=rightMarking=right.
68            else
69                   Marking=leftMarking=left
70            Change its state to Cautious-Leader.
71            
72      else
73             Set Move=0Move=0
74             Change to state Cautious-Follower.
75            
76      
77else
78       Move in a clockwise direction.
79      
80In State Gather2:
81 if CurrentNodeCurrent-Node has a “home" type message with ID component same as ID component of dir then
82       if ID is the lowest among the set of IDs at the CurrentNodeCurrent-Node then
83             Set Move=0Move=0.
84             if direction component of dir is clockwise then
85                  Set Marking=rightMarking=right.
86            else
87                   Marking=leftMarking=left
88            Change its state to Cautious-Leader.
89            
90      else
91             Set Move=0Move=0
92             Change to state Cautious-Follower.
93            
94      
95else
96       Move in a counter-clockwise direction.
97      
98In State Cautious-Leader:
99 if Move=0Move=0 then
100       Update Move=1Move=1 and move according to the direction component of dir.
101      
102else
103       if CurrentNodeCurrent-Node has exactly one agent then
104             if CurrentNodeCurrent-Node is already marked with MarkingMarking then
105                   Move=0Move=0 and move opposite to the direction component of dir
106            else
107                   Declare CurrentNodeCurrent-Node as the Byzantine black hole node and continue perpetual exploration avoiding this node.
108                  
109            
110      else
111             Update Move=0Move=0 and moves according to the dirction component of dir type message in its local memory
112      
113In State Cautious-Follower:
114 if Move=0Move=0 then
115       Set Wait=0Wait=0 and update Move=1Move=1.
116      
117else
118       if Wait<1Wait<1 then
119             Wait=Wait+1Wait=Wait+1.
120            
121       if #Agent\#Agent at CurrentNode>1Current-Node>1 then
122             Update Move=0Move=0 and move according to the direction component of dir.
123            
124      else
125             Declare the next node along the direction component of dir as the Byzantine black hole node and continue perpetual exploration avoiding this node.
126            
127      
128

An agent can change its state to Gather2, only from the states Back-Wait or Gather. An agent changes its state to Gather2 from Gather, only when while moving along counter-clockwise direction finds another agent present, in which case it updates the dir message and writes the corresponding message of type dir and correspondingly changes its state to Gather2.

On the other hand, an agent can only change its state to Gather2 from Back-Wait, if it is waiting at its corresponding segments nearest clockwise homehome, and within which it encounters another agent at its current node along with it a message of type dir is written (in which the direction component of dir is along counter-clockwise). After storing the dir type message in its local memory and changing its state to Gather2 from Back-Wait, an agent immediately moves counter-clockwise in the same round. This generates another observation similar to the Observation 11.1 as follows.

{observation}

If two agents move to state Gather2, one moves from state Gather, and the other moves from state Back-Wait. Furthermore, they change to state Gather2 at the same node and leave the node together at the same round and stay together.

In state Gather2, the agent moves in a counter-clockwise direction, until it finds a node which has a home (i.e., of the form (home, ID’)) type message, where ID’ matches with ID component of dir type message in its local memory. Note that our algorithm ensures that the current node is the nearest clockwise homehome of a1a_{1} if a1a_{1} is the agent to be destroyed by the Byzantine black hole (refer Lemma 11.11). Further, as there are two agents at the current node, both in state Gather2 (refer Observation 11.1), so now the agent with the lowest ID, sets Move=0Move=0, also initializes the MarkingMarking variable to leftleft, since the direction component of dir is counter-clockwise, and further changes its state to Cautious-Leader. On the other hand, the other alive agent at the current node, changes its state to Cautious-Follower, while initializing Move=0Move=0.

In state Cautious-Leader, an agent updates Move=1Move=1 and moves along the direction component of dir. After moving when it is alone on a node, it checks if the current node is marked with MarkingMarking (i.e., either leftleft or rightright). If the node is marked, then it moves in the opposite direction (i.e., the opposite of direction component of dir message) to meet with the agent in state Cautious-Follower. Otherwise, if there is no MarkingMarking at the current node then it identifies the current node as the Byzantine black hole node (only if it remains alive) and continues perpetual exploration avoiding this node. If an agent in the state Cautious-Leader with Move=1Move=1 meets with another agent (i.e., the agent in the state Cautious-Follower) it updates variable MoveMove to 0 and again moves according to the direction component.

In state Cautious-Follower, the agent after finding Move=0Move=0, initializes the variable Wait=0Wait=0 and updates Move=1Move=1. If Move=1Move=1, then the agent checks whether Wait<1Wait<1, if so then update Wait=Wait+1Wait=Wait+1. When Wait=1Wait=1, it checks if the current node has more than one agent (i.e., whether the agent in state Cautious-Leader has returned or not), if so then further update Move=0Move=0 and moves along the direction component of dir, along with the agent in state Cautious-Leader. Otherwise, if the agent in state Cautious-Leader does not return, that means the number of agents at the current node is 1 when Wait=1Wait=1, this symbolizes that the agent in state Cautious-Leader has been either destroyed by the Byzantine black hole or the agent in state Cautious-Leader finds that its current node (i.e., the next node along the direction component of dir for the agent in state Cautious-Follower) is the Byzantine black hole and continues to perpetually move in the same direction, further avoiding this node. In any case, the agent executing Cautious-Leader has not returned implies the next node along the direction component of dir for the agent executing Cautious-Follower is the Byzantine black hole node. So, in this case, the agent declares the next node along the direction component of dir is the Byzantine black hole node and continues perpetual exploration avoiding that node.

11.2 Correctness and Complexity

In the next two lemmas (Lemma 11.1 and Lemma 11.3) we first ensure that when we say an agent encounters an anomaly, is actually an anomaly. And what an agents interpret from these anomalies are true. Next in Lemma 11.5 we ensure that the agent that changes to state Gather can always identify the state of the destroyed agent at the time it gets destroyed at the Byzantine black hole.

Lemma 11.1.

Let aia_{i} and aja_{j} be two agents exploring the segments Seg(ai)Seg(a_{i}) and Seg(aj)Seg(a_{j}), such that Seg(ai)Seg(aj)=vcSeg(a_{i})\cap Seg(a_{j})=v_{c}, where vcv_{c} is also the homehome of aja_{j}. If during the execution of PerpExplore-Scat-Whitbrd, there exists a round t>0t>0, in which aia_{i} in state Forward finds a visited type message, then there exists a round 0<t<t0<t^{\prime}<t, in which aja_{j} has been destroyed by the Byzantine black hole while exploring the segment Seg(aj)Seg(a_{j}) in state Backtrack.

Proof 11.2.

Let us suppose, there does not exist any round t<tt^{\prime}<t in which aja_{j} has been destroyed by the Byzantine black hole in state Backtrack. This means that either aja_{j} is yet to be destroyed by the Byzantine black hole at round tt^{\prime}, for all t<tt^{\prime}<t or aja_{j} has been destroyed by the Byzantine black hole at round tt^{\prime}, while it is in state Forward.
Case I: Let aja_{j} is yet to be destroyed by the Byzantine black hole at round tt^{\prime}, for all t<tt^{\prime}<t. Note that since aia_{i} is at vcv_{c} and checks for the visited type message, this implies Ttime=nT_{time}=n. This means at (tn1)(t-n-1)-th, round aia_{i} changed its state to Forward from Initial. This also implies aja_{j} was also in state Initial at (tn1)(t-n-1)-th round at vcv_{c}. Hence, at this round, aja_{j} must have cleared any whiteboard data at vcv_{c} (as vcv_{c} is the homehome of aja_{j}) and also has moved clockwise after changing the state to Forward. Observe that, the node vcv_{c} can only be explored by aia_{i} and aja_{j}. So, these two agents have the possibility to write the visited type message at vcv_{c} after round tn1t-n-1 and before round tt. Further, note that in the next n+1n+1 rounds after (tn1)(t-n-1)-th round (i.e., until round tt), aja_{j} cannot return back to vcv_{c}. So, aja_{j} can not write anything on vcv_{c} after round tn1t-n-1 and before round tt. Also, aia_{i} can only write the visited type message at vcv_{c} at the tt-th round (i.e., when Ttime=nT_{time}=n). But, in this case, aia_{i} at tt-th round before writing a message, finds that there already exists a visited type message, and this a contradiction, to the fact that aja_{j} has not been destroyed by the Byzantine black hole at round tt^{\prime}, for all t<tt^{\prime}<t.
Case II: Let aja_{j} has been destroyed by the Byzantine black hole at some round t<tt^{\prime}<t, while in state Forward. This implies there exists a round 0<t′′<t0<t^{\prime\prime}<t^{\prime} in which aja_{j} was in state Initial (this is the last time aja_{j} was in state Initial before it gets destroyed by the Byzantine black hole). Thus this means, that tt′′+n2t^{\prime}\leq t^{\prime\prime}+n-2, as a segment can be of length at most n2n-2. Then at round t′′t^{\prime\prime}, aia_{i} was also in state Initial at its own homehome. Now, note that after t′′t^{\prime\prime}, aia_{i} can visit vcv_{c} within round t′′+1t^{\prime\prime}+1 and t′′+n+1t^{\prime\prime}+n+1 while in state Forward. Note that from round t′′+1t^{\prime\prime}+1 and before round t′′+n+1t^{\prime\prime}+n+1 no agent can write a visited type message at vcv_{c} (by a similar argument as in Case I). So during round t′′+n+1t^{\prime\prime}+n+1, aia_{i} can not see any visited type message at vcv_{c}. So, t>t′′+n+1t>t^{\prime\prime}+n+1. Also note that the next time after round t′′+n+1t^{\prime\prime}+n+1, aia_{i} visits vcv_{c} in state Forward, is earliest at round t′′+4n+1t^{\prime\prime}+4n+1. This implies tt′′+4n+1t\geq t^{\prime\prime}+4n+1. Now, let us consider the agent aka_{k} where Seg(ak)Seg(aj)=homeSeg(a_{k})\cap Seg(a_{j})=home of aka_{k} and Seg(aj)Seg(ai)=homeSeg(a_{j})\cap Seg(a_{i})=home of aia_{i}. Note that in round t′′+n+1t^{\prime\prime}+n+1 both aka_{k} and aia_{i} move into state Back-Wait (as none of them sees any visited type message). Next after waiting there up to round t′′+2nt^{\prime\prime}+2n, both of them change their state to Backtrack at round t′′+2n+1t^{\prime\prime}+2n+1. Next, they reach their corresponding homehome and check for a visited type message at round t′′+3n+1t^{\prime\prime}+3n+1. Note that aia_{i} finds the visited type message left by aka_{k} and changes to state Initial-Wait whereas, aka_{k} does not find any visited type message left by aja_{j} (as aja_{j} is destroyed at the Byzantine black hole at state Forward at round tt′′+n2<t′′+3n+1t^{\prime}\leq t^{\prime\prime}+n-2<t^{\prime\prime}+3n+1). So, aka_{k} changes to state Gather1 at round t′′+3n+1t^{\prime\prime}+3n+1 and moves clockwise with the message dir== (Clockwise, NULL) until it finds aia_{i} at it’s homehome in state Initial-Wait before round t′′+4nt^{\prime\prime}+4n (as length of a segment can be of length at most n2n-2). Thus before t′′+4n+1t^{\prime\prime}+4n+1-th round aia_{i} changes its state to Gather1. Since no agent moves to state Forward from state Gather1, aia_{i} can not be at vcv_{c} in state Forward during round tt. So we again arrive at a contradiction. This implies aja_{j} can not be in state Forward while it is destroyed at the Byzantine black hole at round t<tt^{\prime}<t.

Lemma 11.3.

Let aia_{i} and aja_{j} be two agents such that vc=Seg(ai)Seg(aj)=homev_{c}=Seg(a_{i})\cap Seg(a_{j})=home of aia_{i}. If there exists a round t>0t>0 such that aia_{i} checks and finds no visited type message on vcv_{c} while in state Backtrack, then there must be a round t<tt^{\prime}<t in which aja_{j} was destroyed by the Byzantine black hole while in state Forward.

Proof 11.4.

Let us consider that there does not exist any round t<tt^{\prime}<t where aja_{j} was destroyed by the Byzantine black hole in the state Forward. This implies that either aja_{j} is not destroyed by the Byzantine black hole for all rounds t<tt^{\prime}<t or it is destroyed by the Byzantine black hole at round t<tt^{\prime}<t while it was in state Backtrack.

Case-I: Let us consider that aja_{j} is yet to be destroyed by the Byzantine black hole at round t,t>t>0t^{\prime},\leavevmode\nobreak\ \forall t>t^{\prime}>0. Note that, at round tt, aia_{i} checks for a visited type message while in state Backtrack, and that means the current TtimeT_{time} for any alive agent must be equal 3n3n (at Ttime=nT_{time}=n every alive agent ends its state Forward, then until Ttime=2nT_{time}=2n every such agent is in state Back-Wait, and at Ttime=3nT_{time}=3n every alive agent checks for the message in state Backtrack). Note that, this means at time t3n1t-3n-1, both aia_{i} and aja_{j} were in state Initial at their respective homehome. Then at round t2n1t-2n-1, both of them must be in state Forward with Ttime=2nT_{time}=2n, while aja_{j} is at vcv_{c} and aia_{i} is at homehome of aka_{k} ( aka_{k} is the third agent exploring Seg(ak)Seg(a_{k}), such that Seg(ai)Seg(ak)=homeSeg(a_{i})\cap Seg(a_{k})=home of aka_{k} and Seg(ak)Seg(aj)=homeSeg(a_{k})\cap Seg(a_{j})=home of aja_{j}). So, at this point, both aia_{i} and aja_{j} must have written a visited type message at their respective current nodes (i.e., vcv_{c} and homehome of aka_{k}). Further observe that, within t2nt-2n round to tn1t-n-1 round aja_{j} remains at vcv_{c} while in state Back-Wait, and according to our algorithm no agent in state Back-Wait can alter the already stored information at their current node, i.e., within these rounds, aja_{j} cannot erase the visited type message at vcv_{c}. Next, within tnt-n to t1t-1 round, the only agent that can visit the node vcv_{c} is aia_{i}, while it is in state Backtrack. Note that, aia_{i} cannot alter any visited type message during state Backtrack. Thus, aia_{i} at round tt checks and finds a visited type message at vcv_{c}. This is a contradiction to the assumption that aia_{i} does not find any visited type message at round tt. Thus, aja_{j} must have been destroyed by the Byzantine black hole at time tt^{\prime} for some t<tt^{\prime}<t.

Case-II: Suppose aja_{j} has been destroyed by the Byzantine black hole at some round t<tt^{\prime}<t, while in state Backtrack. Let t′′t^{\prime\prime} be the round when aja_{j} was in state Initial for the last time where 0<t′′<t0<t^{\prime\prime}<t^{\prime}. Note that t>t′′+2n+1t^{\prime}>t^{\prime\prime}+2n+1 (because an agent changes its state to Backtrack at round t′′+2n+1t^{\prime\prime}+2n+1). So at the round, t′′+n+1t^{\prime\prime}+n+1 it was alive and at vcv_{c} in state Forward. During this round, it also writes a visited type message at vcv_{c}. Now as we discussed earlier in Case-I, from round t′′+n+1t^{\prime\prime}+n+1 till round t1t-1 no agent can erase or alter the visited type message at vcv_{c}. Thus at round tt, aia_{i} must find the visited type message at vcv_{c} upon checking while in state Backtrack. This is a contradiction to the fact that at round tt, aia_{i} checks and finds no visited type message at vcv_{c} while it is in state Backtrack. Thus if aja_{j} is destroyed by the Byzantine black hole at round tt^{\prime}, then it must be in state Forward.

Lemma 11.5.

The agent which changes its state to Gather, correctly identifies the state in which an agent was in, just before it gets destroyed by the Byzantine black hole.

Proof 11.6.

Let ai,aja_{i},a_{j}, and aka_{k} be three agents initially at three different nodes (i.e., three different homehome for three agents) of RR. Let Seg(ai)Seg(aj)=homeSeg(a_{i})\cap Seg(a_{j})=home of aia_{i}, Seg(ai)Seg(ak)=homeSeg(a_{i})\cap Seg(a_{k})=home of aka_{k} and Seg(ak)Seg(aj)=homeSeg(a_{k})\cap Seg(a_{j})=home of aja_{j}. Without loss of generality let aja_{j} be the agent that is destroyed by the Byzantine black hole at a round t>0t>0. Now we have two cases according to the state of aja_{j} at the time of getting destroyed.

Case-I: aja_{j} gets destroyed by the Byzantine black hole while in state Forward at round tt. Let t<tt^{\prime}<t be the round when aja_{j} was in state Initial for the last time. Note that at round tt^{\prime}, all agents are in state Initial. We claim that aia_{i} is the agent to change its state to Gather. If possible let aka_{k} change its state to Gather. Then first we show that it must change its state to Gather before round t+3n+1t^{\prime}+3n+1. Otherwise, since aja_{j}, fails to reach homehome of aia_{i} at round t+n+1t^{\prime}+n+1, it does not write any visited type message there but aia_{i} reaches homehome of aka_{k} at round t+n+1t^{\prime}+n+1 and writes a visited type message at homehome of aka_{k}. Also, since, aia_{i} and aja_{j} are the only two agents which visit homehome of aia_{i}., this implies, no message can be written at homehome of aia_{i} on and between rounds tt^{\prime} and t+3nt^{\prime}+3n. So, when aia_{i} returns homehome and finds no visited type message round t+3n+1t^{\prime}+3n+1 while in state Backtrack, it changes its state to Gather but aka_{k} doesn’t do so as it sees the visited type message at its homehome, left by aia_{i}. So, if aka_{k} is the agent to change state to Gather it must be before round t+3n+1t^{\prime}+3n+1. Thus aka_{k} must move into state Gather from state Forward at round t+n+1t^{\prime}+n+1. This can only occur if aka_{k} finds a visited type message at homehome of aja_{j} at round t+n+1t^{\prime}+n+1. But this is not possible as aja_{j} have already erased all previous data on its homehome at round tt^{\prime} while in state Initial, and there is no other agent which can visit homehome of aja_{j} and alter the data between tt^{\prime} and t+n+1t^{\prime}+n+1 rounds. Hence, at round t+n+1t^{\prime}+n+1 when aka_{k} visits the homehome of aja_{j} it does not find any visited type message. Thus aia_{i} must be the agent to change its state to Gather. Now to prove that aia_{i} stores the dir type message with direction component clockwise (which means aja_{j} was in state Forward while it was destroyed), we have to show that aia_{i} changes its state to Gather from Backtrack. If possible let aia_{i} change its state to Gather from state Forward. Then it must be at round t+n+1t^{\prime}+n+1 when aia_{i} checks and finds a visited type message at the homehome of aka_{k}. Now at round tt^{\prime}, aka_{k} which was in state Initial, cleared all previous data on its homehome. This implies the visited type message that aia_{i} finds at round t+n+1t^{\prime}+n+1 must be written there, after round tt^{\prime}. But as only aia_{i} can be there after tt^{\prime} and before t+n+1t^{\prime}+n+1, and since it can not alter any data on homehome of aka_{k} before round t+n+1t^{\prime}+n+1, it finds no visited type message at homehome of aka_{k} at round t+n+1t^{\prime}+n+1. Thus aia_{i} can not change its state to Gather from state Forward. Hence, it must change its state to Gather from state Backtrack at round t+3n+1t^{\prime}+3n+1 and according to the algorithm PerpExplore-Scat-WhitBrd, the dir type message that aia_{i} stores must have direction component clockwise.

Case-II: Let aja_{j} gets destroyed by the Byzantine black hole at round tt while in state Backtrack. We have to show that the agent that changes the state to Gather must store the dir type message with direction component counter-clockwise (as any agent can only move in the counter-clockwise direction, in state Backtrack). It will be enough to show that the agent that changes its state to Gather must have changed it from state Forward (as only in this case the state changing agent stores the dir type message having a counter-clockwise direction component in its local memory). Let tt^{\prime} be the round when aja_{j} was in state Initial for the last time. We claim that aia_{i} and aka_{k} can not change to state Gather before round t+3n+1t^{\prime}+3n+1. Note that at round tt^{\prime} both aia_{i} and aka_{k} are at their corresponding homehome in the state Initial. Now if any one of them changes to state Gather, the earliest it can happen is at round t+n+1t^{\prime}+n+1 when both of them are in state Forward. In this case, the agent that changes to state Gather must have found a visited type message at the current node (i.e., for aia_{i} it is homehome of aka_{k} and for aka_{k} it is homehome of aja_{j}) at round t+n+1t^{\prime}+n+1. Note that during round tt^{\prime} any previous messages are erased from both homehome of aka_{k} and homehome of aja_{j} by aka_{k} and aja_{j}, respectively, and no other agent can visit and alter data at these nodes before t+n+1t^{\prime}+n+1 round. Hence none of aia_{i} and aka_{k} finds any visited type message at their current nodes at round t+n+1t^{\prime}+n+1. Hence, none of these agents changes their state to Gather at round t+n+1t^{\prime}+n+1. Next, they can only change their state to Gather at the round t+3n+1t^{\prime}+3n+1 when both of them (i.e., aia_{i} and aka_{k}) are at their respective homehome. An agent among them changes its state to Gather at round t+3n+1t^{\prime}+3n+1 if it finds no visited type message at their current node (i.e., corresponding homehome). Note that t+3n+1>t>t+n+1t^{\prime}+3n+1>t>t^{\prime}+n+1 (as aja_{j} was in state Backtrack at round tt). So, at the round t+n+1t^{\prime}+n+1 all of ai,aja_{i},a_{j} and aka_{k} are at nodes homehome of ak,homea_{k},home of aia_{i} and homehome of aja_{j} in state Forward and writes a visited type message in the nodes, respectively. These messages can not be altered by any agent until round t+3n+1t^{\prime}+3n+1 (by a similar argument as in Case-I). Note that at round t+3n+1t^{\prime}+3n+1 both aia_{i} and aka_{k} are at their corresponding homehome and both of them find a visited type message at these nodes left by aja_{j} and aia_{i} respectively (at round t+n+1t^{\prime}+n+1). So, none of them changes to state Gather even at round t+3n+1t^{\prime}+3n+1. Next, they move into state Initial-Wait and wait at their homehome until t+4nt^{\prime}+4n round. Now, since no agent in state Initial-Wait can change its state to Gather2 until it meets with an agent in state Gather and all alive agents at round t+3n+2t^{\prime}+3n+2 are at state Initial-Wait all of them (i.e., aia_{i} and aka_{k}) waits and changes state to Initial again at round t+4n+1t^{\prime}+4n+1. Next at round t+4n+2t^{\prime}+4n+2 both aia_{i} and aka_{k} erase all previous data at their corresponding homehome. and changes status to Forward again. Note that the next time aia_{i} and aka_{k} can change the state to gather must be at the round t+5n+2t^{\prime}+5n+2 when both of them are in state Forward, and are currently at the homehome of aka_{k} and homehome of aja_{j}, respectively. Further, note that since homehome of aka_{k} does not have any visited type message at round t+5n+2t^{\prime}+5n+2 (as aka_{k} erased any data at round t+4n+2t^{\prime}+4n+2 and no other agent can alter data there, after t+4n+2t^{\prime}+4n+2 and before t+5n+2t^{\prime}+5n+2), so aia_{i} can not change to state Gather at round t+5n+2t^{\prime}+5n+2. Also observe that the visited type message at the homehome of aja_{j} written by aka_{k} during round t+3n+1t^{\prime}+3n+1 is still there at round t+5n+2t^{\prime}+5n+2 (after t+3n+1t^{\prime}+3n+1 before t+4n+2t^{\prime}+4n+2 since aja_{j} is already destroyed before t+3n+1t^{\prime}+3n+1, no agent is on homehome of aja_{j} to erase the data, also after t+4n+1t^{\prime}+4n+1 till t+5n+1t^{\prime}+5n+1 only aka_{k} can visit homehome of aja_{j} in state Forward and Back-Wait, but in these states it does not alter any data at the homehome of aja_{j}) aka_{k} finds it during the round t+5n+2t^{\prime}+5n+2 in state Forward and changes its state to Gather.

Lemma 11.7.

If an agent finds a dir type message while it is in state Back-Wait, the direction component of this message must be counter-clockwise.

Proof 11.8.

Suppose an agent aia_{i} in state Back-Wait gets a dir type message with clockwise direction component at some round tt. This implies there exists another agent aka_{k} that has changed its state to Gather after storing a dir type message having a direction component clockwise at some round t<tt^{\prime}<t. This can only happen if aka_{k} was in state Backtrack at the beginning of round tt^{\prime}. So at the beginning of round tt^{\prime}, aia_{i} was also in state Backtrack, and thus at round tt^{\prime}, aia_{i} changes its state to Initial-Wait. Note that aka_{k} meets and shares dir type message with aia_{i} while aia_{i} is still at state Initial-Wait. This contradicts our assumption that aia_{i} gets dir message at state Back-Wait. Thus, if aia_{i} finds a dir type message in the state Back-Wait then it must have the direction component counter-clockwise.

With a similar argument, we can also prove the following lemma.

Lemma 11.9.

If an agent finds a dir type message while it is in state Initial-Wait, the direction component of this message must be clockwise.

Definition 11.10 (Cautious start node).

Let aia_{i}, aja_{j}, and aka_{k} be three agents executing the algorithm PerpExplore-Scat-Whitbrd, and suppose aja_{j} be the first agent to enter the Byzantine black hole, while exploring the segment Seg(aj)Seg(a_{j}). Let v1v_{1} be the homehome of aja_{j} and v2v_{2} be the furthest node from v1v_{1} along the clockwise direction which is inside Seg(aj)Seg(a_{j}). We define the Cautious start node to be v1v_{1} if aja_{j} is destroyed by the Byzantine black hole during state Forward. Otherwise, if aja_{j} is destroyed by the Byzantine black hole in state Backtrack then, v2v_{2} is defined to be the Cautious start node.

Lemma 11.11.

Let the first agent be destroyed by the Byzantine black hole at some round t>0t>0, then there exists a round t>tt^{\prime}>t, at which the remaining alive agents reach the cautious start node and change their state to Cautious-Leader and Cautious-Follower.

Proof 11.12.

Let aia_{i}, aja_{j} and aka_{k} be three agents, exploring Seg(ai)Seg(a_{i}), Seg(aj)Seg(a_{j}) and Seg(ak)Seg(a_{k}), respectively, where Seg(ai)Seg(aj)=homeSeg(a_{i})\cap Seg(a_{j})=home of aia_{i}, Seg(ai)Seg(ak)=homeSeg(a_{i})\cap Seg(a_{k})=home of aka_{k} and Seg(ak)Seg(aj)=homeSeg(a_{k})\cap Seg(a_{j})=home of aja_{j}. Let aja_{j} be the agent that gets destroyed by the Byzantine black hole while exploring Seg(aj)Seg(a_{j}), and then we have the following cases:

Case-I: aja_{j} is destroyed by the Byzantine black hole while it is moving in a clockwise direction, i.e., in state Forward at round t>0t>0. Note that in this case, the cautious start node is the homehome of aja_{j}. This implies there exists a round 0<t0<t<t0+n0<t_{0}<t<t_{0}+n, where aja_{j} was in state Initial. Note that, aja_{j} can not write any visited type message at homehome of aia_{i}, as it gets destroyed before reaching that node. So, at round, t0+3n+1t_{0}+3n+1, when aia_{i} is at its own homehome in state Backtrack and checks any visited type message, it finds none exists. This triggers aia_{i} to change its state to Gather from Backtrack with the corresponding dir = (clockwise, NULL) (which is indeed the correct direction, refer Lemma 11.5). Further, the agent finds aka_{k}, which is currently waiting at its own homehome in state Initial-Wait (as it does not find any anomaly, so from Backtrack it changed to state Initial-Wait at round t0+3n+1t_{0}+3n+1). So, the moment aia_{i} reaches the homehome of aka_{k}, it takes one additional round to store the dir type message at the current node and then changes its state to Gather1. On the other hand, whenever aka_{k} finds a dir type message is written at its current node, it also changes its state to Gather1, i.e., at round t0+3n+1<t′′<t0+4nt_{0}+3n+1<t^{\prime\prime}<t_{0}+4n both agents change their state to Gather1. After which, they together start moving in a clockwise direction (11.1), until they reach a node which has a home type message with the ID component, different from the IDs of aia_{i} and aka_{k}. Note that this must be the homehome of aja_{j}, as the home type message aja_{j} has written at round t0t_{0}, cannot be erased by any other agent except aja_{j}. Also aja_{j} can only erase this in state Initial at round t0+4n+2t_{0}+4n+2 if it would have returned back, but since it is already destroyed between round t0+1t_{0}+1 and t0+n1t_{0}+n-1, hence this possibility never arises, so the home type message remains, when aia_{i} and aka_{k} together reaches this node. After which they change their state to Cautious-Leader and Cautious-Follower depending on their IDs.

Case-II: aja_{j} is destroyed by the Byzantine black hole while it is moving in a counter-clockwise direction, i.e., in state Backtrack at round t>0t>0. Note that in this case, the cautious start node is the homehome of aia_{i}. Let t0t_{0} be the round when aja_{j} was in state Initial the last time. This implies t0+2n<t<t0+3nt_{0}+2n<t<t_{0}+3n, now by similar argument as explained in Case-II of Lemma 11.5, aka_{k} changes its state to Gather while storing the dir = (counter-clockwise, NULL) message, at the homehome of aja_{j} from state Forward, and starts moving in a counter-clockwise direction. Note that at round t0+5n+2t_{0}+5n+2 as aia_{i} did not find any anomaly, so it changes its state to Back-Wait from Forward. Hence, at round t1t_{1}, where t1<t0+6nt_{1}<t_{0}+6n, aka_{k} finds aia_{i}, while aia_{i} is still in state Back-Wait. This triggers aka_{k} to change its state to Gather2 at round t1t_{1} while updating the dir type message to (Counter-clockwise, ID’), where ID’ is the ID of aia_{i}. Then at the same round, aka_{k} writes the updated message at the current node (i.e., homehome of aka_{k}). Whenever aia_{i} sees this dir type message (at round t1+1t_{1}+1) it also changes its state to Gather2. Next in state Gather2, both start to move counter-clockwise (from round t1+2t_{1}+2) and continue to move until they find a home type message with ID matching the ID of the dir type message. Note that, this node is nothing but the homehome of aia_{i} (as the ID component of dir type message stores the ID of aia_{i}). Note that at round t0+4n+2t_{0}+4n+2, aia_{i} written a home type message at its own homehome. This message can be erased only again at round t0+8n+2t_{0}+8n+2 (i.e., when aia_{i} reaches its homehome again in state Initial). But since aia_{i} changed its state to Gather2 before t0+6n+1t_{0}+6n+1 it cannot move back to state Initial again. So,when aka_{k} and aia_{i} reaches homehome of aia_{i}, they finds the home type message. Hence, both aka_{k} and aia_{i} reach the cautious start node within t0+7nt_{0}+7n and further change their states to Cautious-Leader and Cautious-Follower, depending on their IDs.

Lemma 11.13.

Let aia_{i} and aka_{k} be the two agents that start the states Cautious-Leader and Cautious-Follower from the cautious start node, then within finite rounds of executing algorithm PerpExplore-Scat-WhitBrd, at least one agent detects the location of the Byzantine black hole.

Proof 11.14.

Let aja_{j} be the agent that has been destroyed by the Byzantine black hole at round t>0t>0. Now there are two cases based on the state of aja_{j} at round tt.

Case-I: aja_{j} was in state Forward at round tt. In that case, the node v1=homev_{1}=home of aja_{j} is the cautious start node. Let v2v_{2} be the farthest node along the clockwise direction in Seg(aj)Seg(a_{j}) (i.e., the clockwise nearest homehome of aja_{j}). Now if there exists any round t<tt^{\prime}<t when aja_{j} was in the state Backtrack then it must have started its state Backtrack from v2v_{2} and moved counter-clockwise until v1v_{1} while erasing all right markings from each node in Seg(aj)Seg(a_{j}). So when aja_{j} started the state Forward at its homehome before being destroyed, all nodes in Seg(aj)Seg(a_{j}) are without any right marking. This case will happen also when there is no round t<tt^{\prime}<t where aja_{j} was in state Backtrack, i.e., there does not exist any round before tt^{\prime}, when aja_{j} was in state Forward. So before aja_{j} is destroyed at the Byzantine black hole, say vbv_{b}, at round tt, it has marked right at all nodes starting from the next node of v1v_{1} in the clockwise direction, up to the node just before vbv_{b} (vbv_{b} can not be marked as before marking it the agent aja_{j} is destroyed there). Let without loss of generality, aia_{i} is in state Cautious-Leader and aja_{j} is in state Cautious-Follower at v1v_{1} at some round t0>tt_{0}>t. Then aia_{i} always moves ahead alone in the clockwise direction to a new node vv.Then it moves back only if sees the right marking and brings aka_{k} to vv along with it. Note that aia_{i} always sees a right marking until vbv_{b}. Now when it moves to vbv_{b}, if it is not destroyed it must see no such right marking as aja_{j} failed to mark it at round tt. In this case, aia_{i} leaves the node in the clockwise direction to a new node. So here aia_{i} is able to detect the Byzantine black hole. On the other hand, if aia_{i} is destroyed while it visits vbv_{b}, then it can not return back to aka_{k}. When aka_{k} sees that aia_{i} has not returned it interprets that aia_{i} must have been destroyed at the Byzantine black hole which is the next node along the clockwise direction. Thus in this case also at least one agent can detect the Byzantine black hole.

Case-II: aja_{j} was in state Backtrack at round tt. In this situation, let without loss of generality, the node v2v_{2} be the homehome of aia_{i} and, it is also the cautious start node. Let v1v_{1} be the farthest node along counter-clockwise direction in Seg(aj)Seg(a_{j}) (i.e., the homehome of aja_{j}). Now, if there exists any round t<tt^{\prime}<t when aja_{j} was in state Forward, then it must have started this state from v1v_{1} and moved in a clockwise direction until it reaches the node v2v_{2} while erasing all the left markings from each node it traverses in Seg(aj)Seg(a_{j}). This means that, when aja_{j} started the state Backtrack from v2v_{2}, there does not exist any node in Seg(aj)Seg(a_{j}) with left markings. So before aja_{j} is destroyed by the Byzantine black hole node vbv_{b} (say) at round tt, it must have marked all the nodes with left, starting from the next counter-clockwise node of v2v_{2} to the adjacent clockwise neighbor of vbv_{b} (as before writing this message at vbv_{b}, the agent gets destroyed by the Byzantine black hole). Let without loss of generality, aia_{i} be the lowest ID agent among aia_{i} and aka_{k}, hence it starts in state Cautious-Leader, whereas aka_{k} starts in state Cautious-Follower, at some round t0>tt_{0}>t. This means aia_{i} is the first agent to move alone in the next counter-clockwise neighbor say, vv. After which, only if it sees a left message then only it moves back in the clockwise direction at the node of aka_{k}, and in the next round both these agents reach the node vv. Observe that, aia_{i} always finds a left message until the node vbv_{b}. Whenever it reaches vbv_{b}, either it gets destroyed by the Byzantine black hole, or it finds that no left marking is present at the current node. This triggers aia_{i} to detect the current node to be the Byzantine black hole and moves in the counter-clockwise direction to a new node. Otherwise, if it also gets destroyed by the Byzantine black hole, then in the next round it is unable to return to aka_{k}, which triggers aka_{k} to conclude that aia_{i} must have been destroyed by the Byzantine black hole as well, and it correctly detects the Byzantine black hole to be the next node in the counter-clockwise direction. Thus for each scenario, there exists at least one agent that is able to correctly detect the Byzantine black hole location.

Note that within at most 3n3n number of rounds after both alive agent starts cautious walk from the cautious start node, the Byzantine black hole will be detected by at least one agent. So from Lemma 11.11 and Lemma 11.13 within at most 10n10n rounds after the first agent is destroyed by the Byzantine black hole there exists at least one agent that knows the exact location of the Byzantine black hole which can now explore the ring RR perpetually avoiding the Byzantine black hole. So if all three agents start from three different nodes the PerpExploration-BBH will be solved if each node has a whiteboard of memory O(logn)O(\log n). This proves the Theorem 5.4. We state the theorem again here for convenience.
Statement of theorem 5.4: Algorithm PerpExplore-Scat-Whitbrd solves
PerpExploration-BBH problem of a ring RR with nn nodes and with 3 synchronous agents initially scattered under the whiteboard model of communication

11.3 Modification to the algorithm to include the cases where the initial starting nodes can have multiplicity

Remark 11.15.

Let ai,aja_{i},a_{j}, and aka_{k} be three agents that start from two initial nodes, say home1home_{1} and home2home_{2}. By Pigeon hole principle, exactly one of home1home_{1} and home2home_{2} initially must have two agents. Without loss of generality let home1home_{1} have two agents, say aia_{i} and aka_{k}, initially. In this case, the agents having multiplicity greater than one at the current node do not move. On the other hand the singleton agent, i.e., aja_{j} starting from home2home_{2} moves clockwise marking each node with message right. If aja_{j} reaches home1home_{1} before being destroyed by the Byzantine black hole, home1home_{1} now has three agents co-located. Thus from here the agents execute the whiteboard version of PerpExplore-Coloc-Pbl (refer Subsection 4.3). On the other hand, let us consider the case when aja_{j} gets destroyed before reaching home1home_{1}. Note that irrespective of the location of home2home_{2} it takes at most n1n-1 rounds for aja_{j} to reach home1home_{1} from the beginning. So aia_{i} and aja_{j} waits for nn rounds and finds that no one has arrived yet. In this case, both aia_{i} and aka_{k} move to home2home_{2} along the clockwise direction and start to perform the cautious walk, where the lowest ID agent among aia_{i} and aka_{k} changes its state to Cautious-Leader, whereas the other agent changes its state to Cautious-Follower. Next, the agent executing Cautious-Leader searches for the marking right. As argued earlier, within at most 4n4n rounds after an agent is destroyed, at least one of the remaining alive agents, detect the Byzantine black hole and continue to explore the ring avoiding that node.