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 \ArticleNoPerpetual Exploration of a Ring in Presence of Byzantine Black Hole
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 Faultcategory:
\relatedversion1 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 of size , 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 .
B: For Face-to-Face model of communication, we obtain that 5 agents are sufficient to perpetually explore .
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 , 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 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 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] |
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 . Each node (where ) is unlabeled and has two ports connecting and , labeled consistently as left and right. A set of agents operates in . We consider two types of initial positions for the set of agents. In the first type, each agent in 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 and possesses some computational capabilities, thus requiring bits of internal memory. The agents have unique IDs of size bits taken from the set ( 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 contains 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 in some round , the snapshot contains two ports incident to , already stored data on the memory of (if any, only in the case of the whiteboard model of communication), the number of pebbles located at (if any, only in the case of the pebble model of communication), contents from its local memory, and IDs of other agents on . 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 . Thus, if an agent at node in round decides to move during the move step, in round , it resides on a neighbour node of . 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 with the minimum number of agents. Next, we formally define our problem:
Definition 2.1 (PerpExploration-BBH).
Given a ring network with nodes, where one node () is a Byzantine black hole, and with a set of agents positioned on , the PerpExploration-BBH, asks the agents in to move in such a way that each node of , except , 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 of size 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 (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 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 with nodes, where each node of 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 pebbles, can not solve the PerpExploration-BBH problem on a ring with 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 with nodes.
We have proved Theorem 3.4 using an adversarial technique. We created an instance of three copies of the same ring (i.e., , and ) in such a way that the position of Byzantine black hole ( are different in each of them but they are consecutive in . Also, in each case, the agents are initially placed at the nodes of , which are at a distance of equal length between each other. Now, when an agent is destroyed by , 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 with 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 identical and movable tokens (termed as pebbles), where 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 , with 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 with a Byzantine black hole node , a set of agents, (where we assume, ID of ID of ID of ), are initially co-located at . The agents have no knowledge about the position of the node , the only set of knowledge the agents have are: the total number of nodes in the underlying topology (i.e., ), and also the knowledge that the initial node, i.e., is safe. So, the remaining arc of nodes in is a suspicious region (which we term as , where the cardinality of i.e., 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 and explores the ring perpetually, while waits at the . and explores the ring , executing the rule described as follows. If all the three agents are at along with two pebbles, then in the th round (), moves clockwise with one pebble and it waits at round for to arrive. In round , , leaving the remaining pebble at moves to the next node along clockwise direction to meet . In the subsequent round, i.e., th round, after meeting moves again to the next node in the clockwise direction and waits for 3 rounds (i.e., till th round) for if and only if is not at . In the mean time at th round, leaves its current node, moves one step in counter-clockwise direction, collects the left behind pebble. Then in th round moves again to the earlier node in clockwise direction. Subsequently, in th round, again leaves the pebble at its current node, and moves in a clockwise direction, to meet (which is waiting at the current node for to arrive), for better reference see Fig. 1. Note that, when meets outside , the pebble it was carrying is left by at the nearest counter-clockwise node of the meeting node (i.e., where meets with ). Now from round onwards to th round, the same execution repeats, as it has occurred between round to round . The only difference is that, if both agents (i.e., and ) at round were at a node , at round , they are on the nearest clockwise node of (i.e., at , say). This process continues until reaches . In this case does not move clockwise, until meets it with the pebble it was carrying, in that case, it waits further until brings that pebble back at . For this to happen after reaching , 5 rounds are sufficient for waiting. When reaches with the pebble, then all 3 agents are again at the with 2 pebbles. This way the 3 agents explore the ring. The exploration can hamper if either or, , or a pebble is destroyed by the Byzantine black hole while the above mentioned procedure is executed by them.

Firstly, let only is destroyed at some round . Then there must exists a round , when was with at some node (say) for the last time. This means at round , moved clockwise to the next node along with the pebble it was carrying, and it must have been destroyed before or at the round when reaches again (in this case is ). Now when reaches there can be two cases. Either remains alive or (as the adversary may choose not to destroy ), it can get destroyed as well. For the initial case, identifies the Byzantine black hole by not seeing there and then it can leave that node and can explore the ring perpetually avoiding the node. The latter case is equivalent to both and are destroyed by the Byzantine black hole . Note that since outside whenever reaches the same node of , it leaves behind a pebble at the nearest counter-clockwise node (here ). For this case, another agent (i.e., ) which was waiting at , finds none of the two exploring agents returns at , even after waiting for a sufficient number of rounds. This incident triggers to move clockwise until it finds a pebble (one that is left behind by at ). Whenever the pebble is found, knows that the next clockwise node is the Byzantine black hole and it starts exploring avoiding that node.
Now, there can be two other cases that can hamper the above mentioned exploring procedure. For the first case, let only is destroyed at some round . Let be the last round before when both and were together at a node . At round , , moves clockwise to the next node . Now if is not destroyed in the next 3 rounds, then it meets at again, contrary to our assumption. So, if only is destroyed then it must be at any of the rounds or . In this 3 round can be either on or where, is the counter-clockwise nearest node of . In this case, when finds has not arrived at even after waiting for 3 rounds, in which case, it understands that either or is the Byzantine black hole. This knowledge triggers to move clockwise until it meets at , leaving the pebble along with it behind at . When sees that even after certain round of waiting only is able to arrive at , and that too without the pebble it was supposed to be carrying, understands that must have detected an anomaly. In this case both and moves counter-clockwise together to find the pebble left by . When they find it they declare as . After this they start exploring the ring in different directions in the following way. moves clockwise until and starts moving counter-clockwise until . After that, they both move in opposite direction until they again reach (which is the new ) and waits for sufficient number of rounds to meet each other. This way the exploration keeps going on until one among or is destroyed. Let fails to reach . In that case, will detect that must be the Byzantine black hole and it can start exploring the ring avoiding . On the other hand if fails to reach then it must be destroyed by the Byzantine black hole which is nothing but the node . Knowing this then explores the ring avoiding that node. Now there can be another case when no agents but a pebble is destroyed at . This pebble must be the pebble that is left behind at by the agent when it reaches to meet . In this case, only the pebble can be destroyed before reaches to collect the pebble back. So, when reaches , it finds out that there is no pebble. This leads to , knowing that is the Byzantine black hole and in which case it starts exploring the ring avoiding that node. If is also destroyed while it reaches to collect the pebble, this case is similar to the case where we described the algorithm when only 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 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 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., ) decreases to 2 from (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 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 with 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, , and are chosen, where fourth lowest ID agent say, , is associated with and the largest ID agent, say , is associated with . 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 and in such a way that they act as pebbles, associated with and in PerpExplore-Coloc-Pbl, respectively. In PerpExplore-Coloc-Pbl when we say that an agent carries a pebble , in this case we mean that the agent communicates a message carry with its associated agent 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 drops a pebble at a node , then in this case we mean that communicates a message drop with , which in turn instructs not to move further and remain stationary at the node 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 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 with nodes, when the agents are initially scattered on .
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 . 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 to be the first, after which the starting position of and , respectively follows in clockwise order. Let be the starting node of an agent (i.e., of ), where . By we define the clockwise arc starting from the node and ending at (called segment of ). If no agents are destroyed by the Byzantine black hole then the exploration of goes as follows.
Agent moves clockwise along leaving its pebble at until it reaches (i.e., the end of ). An agent can distinguish the node by seeing the pebble left there by the agent . When reaches traversing for the first time, it knows the length of the segment 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 reaches , 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, collects the pebble (if exists) from (the pebble left by ) and starts moving counter-clockwise along with the collected pebble until it reaches its own , i.e., along with the pebble it was carrying. The waiting time at also ensures that all agents starts moving counter-clockwise at the same round. Also note that, if does not find any pebble to collect at it starts moving counter-clockwise without any pebble (this case can only happen if is destroyed at the Byzantine black hole node , while it was returning back after collecting the pebble from in some previous round). After reaches moving counter-clockwise, it again waits for another set of rounds before it repeats the whole process again. Again, the waiting time at 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 , if no agents are destroyed, the perpetual exploration of happens.

The exploration can be hampered only if, an agent is destroyed at the Byzantine black hole node . Note that, since 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 , for some . Now there are two cases.
Case-I: Let is destroyed while moving clockwise. For this case, fails to collect the pebble at left by and return . So, when , returns after moving counter-clockwise along with the pebble it has collected from , it finds two pebble at . This is considered by as an anomaly and it learns that must be in the arc, which is in the counter-clockwise direction starting from . In this scenario, waits a certain number of rounds (if needed) to ensure that every other alive agents have reached their corresponding . Then 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 , after moving along the counter-clockwise direction. It is because, at their respective they do not detect any anomaly. The waiting time is provided in such a way that it is enough for to detect anomaly and meet both the remaining alive agents after moving clockwise, while the other agents are waiting at their . The agent first meets at while it moves clockwise after detecting anomaly. Then both of them moves together, while carries the pebble, which it was earlier carrying back to . They move until they meet with at . Note that at this moment 3 agents are at a node (which is ), with at least 3 pebbles (one carried by and two carried by ). In this case they execute the algorithm PerpExplore-Coloc-Pbl and achieve PerpExploration-BBH of the ring .
Case-II: Let be destroyed at while it was moving counter-clockwise along with the pebble it collected from . Then in this case, when all alive agents return to their corresponding , none of them finds any anomaly as all agent sees exactly one pebble at their . So, they wait and start the exploration again at the same round. Note that in this scenario, all agents except , move clockwise to the end points of their corresponding segments, waits there and collects pebble (if any) and moves back to their corresponding again. Now, since was destroyed earlier, the pebble left by was picked by no agents and thus, while returns back to 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 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 with nodes, when each node of has a whiteboard of 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 and be three agents starting from the nodes and , respectively, where these nodes are in a clockwise order. Let (also called ‘Segment of ’) be the clockwise arc starting from and ending at . 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 , first erases all previously stored data (if any) at . Then it writes the message (home, ID()) at and starts moving clockwise. This type of message is called a home type message that indicates it is of . moves clockwise until it reaches . It distinguishes by seeing the home type message left by . When moves clockwise, it also marks each node of , except and , by writing right, after erasing any previous such markings (if at all exists) at each such nodes. After reaches it waits for a certain number of rounds (if needed), so that the other agents (say ) gets enough time to reach endpoints of their corresponding segment (i.e.,). After this waiting, each alive agent write the message (visited, ID()) at 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 waits for rounds at and then starts moving counter-clockwise at the same round. moves counter-clockwise until it reaches , i.e., its own . While moving counter-clockwise, erases previously written right marking (which it marked while moving along clockwise direction) from each nodes of and writes left there upon arriving (except at and at ). When reaches its own (i.e., ), it waits again for a certain number of rounds, upon seeing the visited type message, left there by . This waiting period is enough for each of the other alive agents to reach their corresponding . 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 , then the perpetual exploration of continues. This can only be hampered, only if an agent gets destroyed at the node . Without loss of generality let for some, . So only can be destroyed at , while performing this exploration. It is because is the only agent to visit each node of , where . There can be two cases.
Case-I: Let be destroyed while it is moving in clockwise direction along . This implies it fails to reach and also fails to write a visited type message there. So, when returns to its (i.e., ), it finds no visited type message (as it should’ve, if was not destroyed). 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., ). Note that, when starts moving, the other agent is waiting and the waiting time is sufficient for the moving agent to meet it. After they meet, shares the information about its direction of movement in the whiteboard of . With this, they again start moving clockwise together until they reach . The agents can distinguish by the home type message written there by before it was destroyed. Note that in the clockwise direction each node after up to the previous node of were marked right by before it was destroyed. So from , and starts moving cautiously clockwise. That is, while both agents ( and , where and are the agent with lowest ID and highest ID among and respectively) are at a node , moves clockwise to the next node, say while the other agent waits at . If at , sees the right marking, it interprets is safe. So, it comes back to . At , seeing that has returned, also interprets to be safe. So, in the next round both and moves to together and repeats the process from again. When reaches , it sees no right marking there. if alive, interprets this by determining the current node to be Byzantine black hole. So, it starts perpetual exploration of , except . Otherwise, if gets destroyed at , it does not return to the previous node where is waiting. Even after waiting, when sees has not returned, it interprets this incident as the next clockwise node is the Byzantine black hole and starts exploring the ring avoiding that node. Thus for this case the perpetual exploration continues.
Case-II: Let be destroyed at while it is moving counter-clockwise. In this case both the alive agents and find visited type message after returning to their corresponding . This is because, is destroyed at after writing visited type message at . So, all alive agents after waiting, starts repeating the exploration procedure again. The agents first erase the whiteboard content at their corresponding and then writes the corresponding home type message before it starts moving clockwise until the end of their corresponding segment. Note that since was destroyed earlier (even before the repetition starts), finds the visited type message which was written there earlier by it, is still present (which was supposed to be erased if was alive). From this information, interprets that, 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 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 (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 to move counter-clockwise with the aim to gather with . Since starts its move while waits at and also, since the waiting time is sufficient, meets during the waiting period at . So, after they meet, , communicates the direction of its move to on the whiteboard of and they move together until they reach together. They distinguish the node by the home type message left there by before the start of moving clockwise. Note that, in the counter-clockwise direction, the nodes in , starting from the next node of up to the previous node of are the only nodes those were marked left by before it was destroyed. So, from , the alive agents and start moving cautiously in the counter-clockwise direction. Among and , an agent with lowest ID is denoted by and the agent with highest ID is denoted by . 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 searches for the left marking. If it finds such marking it returns to and then both moves counter-clockwise and repeats the process. On the other hand if does not find any left marking (it must be ) and it stays alive, moves out of that node and starts exploring avoiding that node. On the contrary, if gets destroyed then sees that has not returned while it should have. From this incident it interprets next counter-clockwise node is and it starts exploring 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 with 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 be the agent destroyed at the Byzantine black hole first. We define cautious start node to be , if was moving clockwise when destroyed, otherwise it is . 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 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 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 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 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 of size cannot solve
PerpExploration-BBH, even in presence of whiteboard if number of possible
consecutive Byzantine black hole positions is at least 3.
Proof:
Let and be three possible consecutive Byzantine black hole positions in a ring . Let two agents and be sufficient to solve the PerpExploration-BBH problem on . Thus there exists an algorithm such that and can solve PerpExploration-BBH by executing . Without loss of generality let explores and it moves to for the first time at round from vertex . Then must have been at the vertex at round . Let us take two copies and of the same ring . In , is the Byzantine black hole and in , is the Byzantine black hole. Let the adversary in destroy at round and in destroy at round . We claim that at round and , can not be on either of or . Note that at -th round can not be on otherwise, both and get destroyed at the same round and no other agent is left to explore further. Similarly, at round , can not be on . Now consider the case when at th round is at . Since at round , can not be on there can be two cases either at round , was in ( is another adjacent node of except ) or was in itself. We first argue that at round , can not be at . Otherwise, since the whiteboard content at nodes except at and are the same in and at round (due to the same execution by and up to round and at round for in both and ). Now since at round , all previous data on the whiteboard except and does not help to distinguish between and , 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 -th round can not be on . We now only have to prove that can not be at during round . Let in , adversary activates the Byzantine black hole at at round which destroys at round . Now since the effect of this destruction of agent does not affect the inputs of at round on , it moves to at round where the Byzantine black hole is activated again by adversary destroying too. Thus must remain outside of and during round and while executing . So, at round since all whiteboard content are same for and (except for nodes and whose content only differs after round for and which can not be known by as it was not there during that rounds), they can not help to distinguish between and . 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 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 with nodes.
Proof: Let , and be three agents equipped with a pebble each. The agents are placed on three nodes and initially in such a way that the distance between and is the same for all , where we consider to be the nearest node of in the clockwise direction. Without loss of generality let this distance be sufficiently large. Further, let there exist an algorithm that solves the PerpExploration-BBH problem in this setting. Let without loss of generality be the first agent to explore the third node from its corresponding starting position (i.e., ) in any of the clockwise or counter-clockwise directions, when each agent starts executing the algorithm . Suppose by following , can visit the third node in the clockwise direction (without loss of generality) first at a round say . Let and be those sets of three nodes from in the clockwise direction. Let , and be three scenarios where in , is the Byzantine black hole. We claim that can not carry its pebble during any execution of . Otherwise, in scenario , it would be destroyed along with its pebble, and since the distances between two consecutive 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 is sufficiently large this is impossible due to Corollary 3.3. Now suppose the adversary chooses to activate the Byzantine black hole whenever reaches there for the first time. In this case for all , and , at round , agents and have no idea about where is destroyed even if they know that is destroyed, as the distances between two consecutive are sufficiently large so their exploration region does not intersect till round and timeout (or, waiting for other agents) strategy do not work as for all an agent can get same timeout output. Also for all s the position of the pebbles and alive agents will be the same at round . 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 . So the situation at round is similar to the problem of solving PerpExploration-BBH on a ring 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 solves the problem thus, 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 as , after which initializes the variable (where, is the number of rounds passed since the agent has moved from state Initial) and gathers the ID of the remaining agents currently at . Next, the agent with the lowest ID, i.e., moves to state Leader, the agent with the second lowest ID, i.e., moves to state Follower-Find, whereas the remaining agent, i.e., moves to state Backup. We now define an iteration for this algorithm. An iteration is defined to be a collection of consecutive rounds starting from the latest round where all 3 agents along with 2 pebbles are at 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 -th iteration and reach , i.e., neither any pebble nor any agent gets destroyed by the Byzantine black hole. In this situation, according to our algorithm, being the lowest ID, follows the following sequence , whereas being the second lowest ID follows , and the follows the sequence . The above sequences are as follows:
-
1.
: Initial Leader Initial.
-
2.
: Initial Initial.
-
(a)
: Follower-Find Follower-Collect Follower-Find.
-
(a)
-
3.
: Initial Backup Initial.
Execution of sequence : performs this sequence, in which it first changes to state Leader, after finding it as the lowest ID agent at in state Initial. In state Leader, the agent performs the following checks: if the current node is , then it checks that if the current node has the agent with the second lowest ID, whereas the number of pebbles at is 2 and . If all these conditions are satisfied, then the agent waits till after which it moves to state Initial during . Otherwise, if it finds that it is with the second lowest ID agent and the number of pebbles at is also 2, but , in this case, the agent initializes (where 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 is 2, then it waits for 5 rounds (i.e., waits when ), after which if still the above condition persists, then concludes as the node which is at a clockwise distance of from and the node at a clockwise distance of . Further, it updates and moves to the next state Detection.
On the contrary, if the current node of is not , then also it performs the following checks: first, it checks whether it is with the second lowest ID agent (i.e., in this case), and if so, then initializes 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 ), 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 , it ends an iteration, by changing to state Initial from Leader. Otherwise, if any anomaly is detected, then 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 : 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 , times and then again changes to state Initial. The sub-sequence symbolizes the sequence Follower-Find Follower-Collect Follower-Find, which an agent performs times until it again changes to state Initial (i.e., is denoted by ). While executing , the agent in state Follower-Find checks, whether the current node does not contain the lowest ID agent, and the parameter is also set to 0 (the parameter 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 to 1. Otherwise, if it finds 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 directly changes to state Follower-Collect. In state Follower-Collect, 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 and the current node is , then stops performing and moves to state Initial. Otherwise, updates 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 again, which is after it performs for times starting from . If at any point, 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 sequence and changes to state Follower-Collect.
Exploration of sequence : This sequence is only performed by the highest ID agent, which is in this case. In this sequence, after being in state Initial, it changes to state Backup, in which the agent first waits at till , 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., has only the lowest and highest ID agents, i.e., and , whereas the number of pebble at is 0. If this condition is satisfied, then the agent changes its state to Find-Pebble. Note that, this condition is satisfied only when fails to reach while performing this iteration, i.e., enters the Byzantine black hole, while 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 while in the state Report-Leader.
-
•
has only the highest and lowest ID agents, i.e., and , but the number of pebbles at is 1, which implies that has failed to return to even when . In this case, concludes to be the node which is at a clockwise distance of from , whereas to be the node which is at a clockwise distance of from . Finally, it updates and then moves to state Detection.
-
•
has all three agents and the number of pebbles present at is 2. In this case, changes to state Initial, completing the iteration without detecting any anomalies.
-
•
After rounds, there is no other agent except present at . In this case, the agent moves one hop clockwise, and then changes to state Find-BH. This case arises only when both the agents and fail to reach 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., , while it is in state Leader. The anomaly detected is as follows, , after reaching a new node that is not , along with the pebble it is carrying, waits for at most 3 rounds, for the second lowest ID agent, i.e., to arrive (which is in state Follower-Find). If does not arrive even after the waiting, concludes that the agent (i.e., ) has entered the Byzantine black hole, this triggers to move to state Report-Leader. In this state, it moves clockwise until it finds the highest ID agent, i.e., at . Then waits until , after which it changes its state to Find-Pebble.
The state Find-Pebble, is performed together by only and , i.e., the lowest and highest ID agent. This state can be reached by only via Report-Leader state, whereas by 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 when it detects some anomaly (i.e., 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 , from which they conclude and to be the nodes which are at a clockwise distance of and , respectively from this new . Finally, they update 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 ).
The state Find-BH, is only executed by the highest ID agent, i.e., . This state is executed by , only when it finds no other agent at , at the last round of the current iteration. This situation can only occur, when both the agents and have entered the Byzantine black hole. So, this triggers 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., or ) only if they know the position of and , which are not only two consecutive nodes in a suspicious region . Moreover, these two nodes are exactly at a distance of clockwise and distance from (the can be the initial starting node, or it can be the updated as well). In this state, the agent with the lowest ID, i.e., , moves clockwise till it reaches , and then again returns back to . After returning back, if it finds , then again it performs the same procedure.
On the contrary, if it does not find , then it understands that is the Byzantine black hole node, and hence continues perpetual exploration avoiding this node.
On the other hand, in this state moves counter-clockwise direction from , i.e., reaches , after which it returns back to again following the same path and then waits for rounds at and then checks for the other agent, i.e., .
If it finds , then again continues to perform the same movement, otherwise, it concludes that 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 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 -th iteration no agent is destroyed by the Byzantine black hole, then in any iteration , the agent follows the sequence , whereas follows the sequence , as instructed starting from the initial node. Considering this scenario we have two cases:
-
•
No agents and no pebbles are destroyed: In this case, while executing the sequence , 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 un-obstructively visits each node in a clockwise direction, and reaches to finally end this sequence , while again changing its state to Initial. This shows that at least one agent visits each node of in an iteration completing exploration of .
-
•
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 , while is not at the node containing the pebble, executing the sequence . It is because, in an iteration, only and moves away from while executing their respective sequences and . And the pebble carried by ( i.e., the agent with the smallest ID) cannot be destroyed without destroying , as always carries the pebble at each node while executing its respective sequence. So, in this situation, while ( 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 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.
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., ) detects the exact location of the Byzantine black hole. Further, this agent continues to perpetually explore the ring 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.
The exact location of the Byzantine black hole is detected by at least one agent.
-
2.
All alive agents become co-located and they agree about two consecutive nodes and , one among which is the Byzantine black hole.
Proof 9.4.
Note that the agent that has entered the Byzantine black hole is either or , based on which we have the following conditions:
-
•
falls in to the Byzantine black hole: This situation can only occur when following sequence 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, within 3 additional rounds reaches the Byzantine black hole node while in the state Follower-Find, and the absence of triggers the agent to determine the current node as the Byzantine black hole, and immediately leave the current node.
-
•
falls in to the Byzantine black hole: This can only happen when is not with at the Byzantine black hole node. Otherwise, both agents will be destroyed, contradicting our claim. Note that, can either be with the pebble or alone, while it is destroyed by the Byzantine black hole. Also note that, since is executing the sequence , hence the distance between and can be at most 2. So during an iteration, if 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 . If the current node is not , in this case, gets to know about this fact, only when it finds the absence of 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 with state Report-Leader. After, reaching , it waits until the end of this iteration, i.e., until rounds from the start of this iteration and moves to state Find-Pebble. During the -th round from the start of the current iteration, finds that it is only with , 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 until they encounter a pebble. Note that, this pebble is the one left by after determining the fact that has entered the Byzantine black hole. So, now both these agents and , declare the node with the pebble as , whereas also denote the adjacent counter-clockwise node from the current node as , whereas the other node adjacent to in the counter-clockwise direction as . On the other hand, if the current node of is , while is destroyed by the Byzantine black hole, then can never reach along with the pebble it was carrying by following the sequence . So, at the end of this iteration, both and find that there are two agents (i.e., and ) and one pebble, respectively at . This leads both of them to conclude that, the adjacent counter-clockwise node is , whereas the adjacent counter-clockwise node of is .
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 and , 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 , 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 (), 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 and , respectively, which while executing the sequences and enters the Byzantine black hole. Also, note that and can only be together at a node when has left the pebble it is carrying in the counter-clockwise node. So, now after the end of this iteration, finds that no agent among and has reached , which triggers to change to state Find-BH. In this state, it moves clockwise, until it finds a pebble (this pebble is the one left by in the counter-clockwise node of the Byzantine black hole). Whenever a pebble is found, 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 : Now, in this case, let be a round when exactly an agent is destroyed during an iteration, say . Then by Lemma 9.3, within finitely many additional rounds , where , both the alive agents become co-located and agree about two consecutive nodes and , one among which must be the Byzantine black hole. Observe that according to our algorithm, the node that is clockwise adjacent to is determined to be the (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 , 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 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 and know that the Byzantine black hole must be any of the two consecutive nodes or . In this case, they move into state Detection. After which one agent moves clockwise until it reaches and the other one moves counter-clockwise until it reaches and moves back to . The agent that visits waits for the other agent at for rounds which is sufficient for the other agent to return back at . Now when during round , another agent among these two gets destroyed, within at most rounds (among the total rounds, within which both agents are to meet) they fail to meet at . Which triggers the remaining alive agent to determine exactly which one among or 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 (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 , 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 . So, all the conditions that are mentioned, remains same in this case as well, only the condition where an agent changes to certain state by observing (say) number of pebbles at , transforms to the fact that the agent changes to state by observing (where ) number of pebbles at .
At the beginning of the Algorithm 2 all agents are in state Initial1. In this state, the agents declare their current node as , moreover they initialize the variables and , where variable is used by the agents in order to store the length of the path between it’s own and the nearest of another agent in the clockwise direction. Further the variable indicates the state transition. If the agent is at state Forward and 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 then this indicates it changes to state Forward from state Wait2. An agent in state Forward, initializes (which stores the waiting time) and checks whether or . Note that, if and the current node is , then the is first instructed to leave the pebble at current node and then move clockwise direction, after increasing by 1. The next node where has reached can either be of another agent, say , or it is not for any other agents. For the first case would find a pebble on its which was left by . In this case updates to 1 and moves into state Wait1. On the other hand, if the is not of any other agents then finds no pebble at the and thus moves clockwise after increasing the variable by 1. Note that, when 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 (i.e., of another agent which is clockwise nearest to own ). Now since during each move at state Forward, an agent increases the variable by 1, the variable must store the length between an agents own and the clockwise nearest when the agent finds another pebble. Beyond this point (i.e., when ) the agents will use the 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 .
On the contrary, if , this implies the agent already knows how much distance it should travel from its own in order to reach the clockwise nearest . So, now if the current node is it just moves clockwise by initializing the variable to 1 (where the variable stores the amount of distance the agent has traversed from its own ). Otherwise, if current node is not , then the agent continues to move clockwise while updating by 1, until it reaches the clockwise nearest (i.e., when ), 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 of the agent) for 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 -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 then, all of them move to state Fetch together at the round .
In state Fetch, the agent first checks if the current node has a pebble, if so then it further checks whether current node is or not. If the current node is not , then it moves counter-clockwise with pebble, until it reaches . Otherwise, if current node is 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 to 0 and changes to state Wait2.
In state Wait2, the agent first checks whether , if so then it further checks whether at current node is exactly 1. If these two conditions are satisfied then the agent just increments by 1. On the other hand, if it finds that but at the current node is 2, then it changes its state to Gather2 and moves clockwise and updates to 0. Otherwise, if it finds but at the current node is 3 then it updates to 0, whereas changes its state to Coloc. Lastly, whenever it finds , 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 can only find more than one pebble at its node, only when another agent say , which was supposed to fetch the pebble left by at its , is destroyed. In this case, whenever 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 ). Note that, while 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 (i.e., the agent which is in state Gather1) to wait at the current node (i.e., its ) for precisely rounds, and then start moving in clockwise direction. An agent moves to state Gather1 at )-th round from the round when all agents changed state to Forward ( round to move into Fetch state, rounds to reach and one round to change state to Gather1). Then waits for another before it starts moving. So it starts moving at th round from the round when all agents changed state to Forward together the last time. Now, an agent reaches its in state Fetch in round , as ) after the round when all agents changed to state Forward together the last time. So, the waiting time of , being in state Gather1 guarantees that all the other alive agents reach their respective 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, ). This waiting period is sufficient, for the agent 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 rounds, also ensures that all of them must move to state Forward at the exact same round (i.e, ()-th round from the previous time it moved to state Forward)111At -th round an agent moves to state Fetch after that it moves for rounds to reach its in counter-clockwise direction and changes to state Wait2. So at round an agent changes to state Wait2. After that waits for further rounds and changes to state forward, taking a total of rounds . Now we have the following observation {observation} Let 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 all the agents together move into state Forward again.
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 for the first 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 , 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 , 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 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 -th iteration, then for each th iteration, every node of the ring is visited by at least one agent, where .
Proof 10.3.
Let and be 4 agents initially located at and respectively where, are in clockwise order starting from . By we denote the clockwise arc starting from and ending at . Note that in any of the th iteration (), an agent (for all ) moves clockwise along starting from while in state Forward and reaches . Then in the same iteration moves back to again while being in state Fetch. Thus each node of is explored twice in -th iteration by , where . Since for any , for some , and in each iteration explores each node of until 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 and be 4 agents initially located at and respectively where, are in clockwise order starting from . By we denote the clockwise arc starting from and ending at . Without loss of generality, let the first agent that is destroyed by the Byzantine black hole be during the th iteration. So, the Byzantine black hole , must be in . Since, no agents changes to state Gather1, before an agent is destroyed. Hence, until 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 was in, before it gets destroyed by the Byzantine black hole.
Case-I: was in state Forward when it was destroyed. So, fails to reach to bring the pebble, left by back to during th iteration. So, when reaches at the th iteration, along with the pebble it collected from , it finds two pebble at the node . This happens at th round of th iteration. In the same round changes to state Gather1. Next it waits an additional rounds and then in the th round of the th iteration, it starts moving clockwise along with both the pebbles. Note that, all other alive agents (i.e., and ) reaches their home by the th round of the th iteration. Also upon reaching their respective , and both sees exactly one pebble (i.e., the pebble they carried back to their ) so they change their state to Wait2. By Observation 1, from -th round of the iteration upto the end of the iteration (i.e., th round of the iteration), both and stays at and , respectively in state Wait2. So, after starts moving clockwise in the th round, it first meets in round (which is as ) of the th iteration. And then meets at round (as which is also in th iteration. Now note that, the moment meets , it changes to state Gather2 and starts moving together with along with its own pebble until they meet . When all three of them gathers together at there is atleast 3 pebbles at (two pebbles carried by , one pebble carried by , and one pebble remains for ). In this scenario, they change their state to Coloc. Note that in th iteration only 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 was in state Fetch while it was destroyed by the Byzantine black hole node . In this case, none of the alive agents see more than one pebble at their after they return there in the th iteration. This is because, here the the pebbles left by agents and has been collected by agents and , respectively and when they reach their corresponding , the pebble they carried are the only one there. Thus all of them (except as it was destroyed during th iteration in state Fetch) moves to state Wait2 after reaching at the th iteration and after the end of the iteration moved to state Forward and starts the th iteration. Since was destroyed in the previous iteration it remains unavailable to collect the pebble from , left by in the iteration. Note that here in this iteration both and collects pebble from and ( left by and respectively) and returns back to and respectively. But upon reaching does not find any pebble to collect. In this case it returns to without any pebble. Note that here only sees more than one pebble upon returning back to in the th iteration. So only changes to state Gather1 at round . 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 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 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 , in this case, these agents directly start executing PerpExplore-Coloc-Pbl. While execution of the algorithm, if they encounter the fourth agent somewhere along , 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 ) at the current node, changes its state Forward, whereas the other agent at the current node (say ) changes its state Backup-Wait at some round say . 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 rounds (i.e., until -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 round, then that implies that is already in state Gather1. It is because, while it returned back to its carrying a pebble in state Fetch at round round (where is the length of ), it encounters the first anomaly, i.e., the number of pebble is more than number agents. In that case, directly changes its state to Gather1, and further waits at for rounds, i.e., till rounds. After which it starts to move clockwise, and on the other hand 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 and 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 at round finds no anomaly then it moves into state Backup whereas is in state Wait2 at the same node. Both of them waits until round and at round , changes its state to Forward again (refer to Observation 1) and changes its state to Backup-Wait again. If some other agent detects anomaly it must meet and at their at some round where . In that case they find that there are 3 agents at their 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 with nodes, where each node has a whiteboard that can store 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 (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, , and ) are initially placed at three nodes of the ring , which are not only safe nodes but are also recognized as the of these agents. Initially, the agents starting from their respective 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 is defined as the set of consecutive nodes, starting from its and ending at the nearest clockwise (i.e., the of first clockwise placed agent), which is also termed as . Note that . 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 . In state Initial, an agent ( without loss of generality, say ) first clear the already present data (if at all) at the whiteboards of their respective , then initializes ( stores the number of rounds elapsed since the start of state Initial), and writes a message of the form (home, ID) at its , 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 is the . 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 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 , i.e., in other words, it has reached the nearest clockwise , say . Note that the length of a segment can be at most , hence within , an agent is bound to reach the last node of its own segment i.e., . In any case irrespective of the current , the agent waits at until , after which in the next round, it checks for the following information at . If the agent finds a message of type “visited" at , the agent considers this as an anomaly and learns that an agent of which is the home (from the ID component of home type message at ) must have entered Byzantine black hole while returning back from its clockwise nearest (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 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 and changes its state to Back-Wait.
Next, in state Back-Wait, an agent (here ) waits at until . In this waiting time, waits for the other agent to meet if the other agent detects any anomaly during its state Forward. While waiting, if it finds that the at is more than 1, and the whiteboard at 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 , and also , then in this round, the agent changes its state to Backtrack.
In state Backtrack, an agent (here ) starts to move in a counter-clockwise direction from , and after each move erases the earlier direction, i.e., right, and writes the new direction, i.e., left, and also increments by 1. This process continues until it reaches its own , 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 , hence within , the agent reaches its own . After which it does not move until . At , it checks whether its 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 , (), for which of , does not arrive at of during its Forward state because of getting destroyed at the Byzantine black hole (refer Lemma 11.3). This instigates the agent 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 until . 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 , 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 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 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 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 is the clockwise nearest 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 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 is the of ). 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 ) can only change its state to Gather1 from Initial-Wait, if it is waiting at its , and within which it encounters another agent at its along with it a message of type dir is written (in which the direction component of dir is along clockwise). Note that if in state Initial-Wait finds more than one agent at the current node and dir type message at round then, the other agent must be in state Gather while written there at round and moved into state Gather1 in the same round. Then, during round , 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 also moves according to the dir type message during round . 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 of if 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 , also initializes the variable to , 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 .
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 , 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.
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 of if 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 , also initializes the variable to , 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 .
In state Cautious-Leader, an agent updates 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 (i.e., either or ). 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 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 meets with another agent (i.e., the agent in the state Cautious-Follower) it updates variable to 0 and again moves according to the direction component.
In state Cautious-Follower, the agent after finding , initializes the variable and updates . If , then the agent checks whether , if so then update . When , 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 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 , 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 and be two agents exploring the segments and , such that , where is also the of . If during the execution of PerpExplore-Scat-Whitbrd, there exists a round , in which in state Forward finds a visited type message, then there exists a round , in which has been destroyed by the Byzantine black hole while exploring the segment in state Backtrack.
Proof 11.2.
Let us suppose, there does not exist any round in which has been destroyed by the Byzantine black hole in state Backtrack. This means that either is yet to be destroyed by the Byzantine black hole at round , for all or has been destroyed by the Byzantine black hole at round , while it is in state Forward.
Case I: Let is yet to be destroyed by the Byzantine black hole at round , for all . Note that since is at and checks for the visited type message, this implies . This means at -th, round changed its state to Forward from Initial. This also implies was also in state Initial at th round at . Hence, at this round, must have cleared any whiteboard data at (as is the of ) and also has moved clockwise after changing the state to Forward. Observe that, the node can only be explored by and . So, these two agents have the possibility to write the visited type message at after round and before round . Further, note that in the next rounds after th round (i.e., until round ), cannot return back to . So, can not write anything on after round and before round . Also, can only write the visited type message at at the th round (i.e., when ). But, in this case, at th round before writing a message, finds that there already exists a visited type message, and this a contradiction, to the fact that has not been destroyed by the Byzantine black hole at round , for all .
Case II: Let has been destroyed by the Byzantine black hole at some round , while in state Forward.
This implies there exists a round in which was in state Initial
(this is the last time was in state Initial before it gets destroyed by the Byzantine black hole). Thus this means, that , as a segment can be of length at most . Then at round , was also in state Initial at its own . Now, note that after , can visit within round and while in state Forward. Note that from round and before round no agent can write a visited type message at (by a similar argument as in Case I). So during round , can not see any visited type message at . So, . Also note that the next time after round , visits in state Forward, is earliest at round . This implies . Now, let us consider the agent where of and of . Note that in round both and move into state Back-Wait (as none of them sees any visited type message). Next after waiting there up to round , both of them change their state to Backtrack at round . Next, they reach their corresponding and check for a visited type message at round . Note that finds the visited type message left by and changes to state Initial-Wait whereas, does not find any visited type message left by (as is destroyed at the Byzantine black hole at state Forward at round ). So, changes to state Gather1 at round and moves clockwise with the message dir (Clockwise, NULL) until it finds at it’s in state Initial-Wait before round (as length of a segment can be of length at most ). Thus before -th round changes its state to Gather1. Since no agent moves to state Forward from state Gather1, can not be at in state Forward during round . So we again arrive at a contradiction. This implies can not be in state Forward while it is destroyed at the Byzantine black hole at round .
Lemma 11.3.
Let and be two agents such that of . If there exists a round such that checks and finds no visited type message on while in state Backtrack, then there must be a round in which was destroyed by the Byzantine black hole while in state Forward.
Proof 11.4.
Let us consider that there does not exist any round where was destroyed by the Byzantine black hole in the state Forward. This implies that either is not destroyed by the Byzantine black hole for all rounds or it is destroyed by the Byzantine black hole at round while it was in state Backtrack.
Case-I: Let us consider that is yet to be destroyed by the Byzantine black hole at round . Note that, at round , checks for a visited type message while in state Backtrack, and that means the current for any alive agent must be equal (at every alive agent ends its state Forward, then until every such agent is in state Back-Wait, and at every alive agent checks for the message in state Backtrack). Note that, this means at time , both and were in state Initial at their respective . Then at round , both of them must be in state Forward with , while is at and is at of ( is the third agent exploring , such that of and of ). So, at this point, both and must have written a visited type message at their respective current nodes (i.e., and of ). Further observe that, within round to round remains at 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, cannot erase the visited type message at . Next, within to round, the only agent that can visit the node is , while it is in state Backtrack. Note that, cannot alter any visited type message during state Backtrack. Thus, at round checks and finds a visited type message at . This is a contradiction to the assumption that does not find any visited type message at round . Thus, must have been destroyed by the Byzantine black hole at time for some .
Case-II: Suppose has been destroyed by the Byzantine black hole at some round , while in state Backtrack. Let be the round when was in state Initial for the last time where . Note that (because an agent changes its state to Backtrack at round ). So at the round, it was alive and at in state Forward. During this round, it also writes a visited type message at . Now as we discussed earlier in Case-I, from round till round no agent can erase or alter the visited type message at . Thus at round , must find the visited type message at upon checking while in state Backtrack. This is a contradiction to the fact that at round , checks and finds no visited type message at while it is in state Backtrack. Thus if is destroyed by the Byzantine black hole at round , 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 , and be three agents initially at three different nodes (i.e., three different for three agents) of . Let of , of and of . Without loss of generality let be the agent that is destroyed by the Byzantine black hole at a round . Now we have two cases according to the state of at the time of getting destroyed.
Case-I: gets destroyed by the Byzantine black hole while in state Forward at round . Let be the round when was in state Initial for the last time. Note that at round , all agents are in state Initial. We claim that is the agent to change its state to Gather. If possible let change its state to Gather. Then first we show that it must change its state to Gather before round . Otherwise, since , fails to reach of at round , it does not write any visited type message there but reaches of at round and writes a visited type message at of . Also, since, and are the only two agents which visit of ., this implies, no message can be written at of on and between rounds and . So, when returns and finds no visited type message round while in state Backtrack, it changes its state to Gather but doesn’t do so as it sees the visited type message at its , left by . So, if is the agent to change state to Gather it must be before round . Thus must move into state Gather from state Forward at round . This can only occur if finds a visited type message at of at round . But this is not possible as have already erased all previous data on its at round while in state Initial, and there is no other agent which can visit of and alter the data between and rounds. Hence, at round when visits the of it does not find any visited type message. Thus must be the agent to change its state to Gather. Now to prove that stores the dir type message with direction component clockwise (which means was in state Forward while it was destroyed), we have to show that changes its state to Gather from Backtrack. If possible let change its state to Gather from state Forward. Then it must be at round when checks and finds a visited type message at the of . Now at round , which was in state Initial, cleared all previous data on its . This implies the visited type message that finds at round must be written there, after round . But as only can be there after and before , and since it can not alter any data on of before round , it finds no visited type message at of at round . Thus can not change its state to Gather from state Forward. Hence, it must change its state to Gather from state Backtrack at round and according to the algorithm PerpExplore-Scat-WhitBrd, the dir type message that stores must have direction component clockwise.
Case-II: Let gets destroyed by the Byzantine black hole at round 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 be the round when was in state Initial for the last time. We claim that and can not change to state Gather before round . Note that at round both and are at their corresponding in the state Initial. Now if any one of them changes to state Gather, the earliest it can happen is at round 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 it is of and for it is of ) at round . Note that during round any previous messages are erased from both of and of by and , respectively, and no other agent can visit and alter data at these nodes before round. Hence none of and finds any visited type message at their current nodes at round . Hence, none of these agents changes their state to Gather at round . Next, they can only change their state to Gather at the round when both of them (i.e., and ) are at their respective . An agent among them changes its state to Gather at round if it finds no visited type message at their current node (i.e., corresponding ). Note that (as was in state Backtrack at round ). So, at the round all of and are at nodes of of and of in state Forward and writes a visited type message in the nodes, respectively. These messages can not be altered by any agent until round (by a similar argument as in Case-I). Note that at round both and are at their corresponding and both of them find a visited type message at these nodes left by and respectively (at round ). So, none of them changes to state Gather even at round . Next, they move into state Initial-Wait and wait at their until 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 are at state Initial-Wait all of them (i.e., and ) waits and changes state to Initial again at round . Next at round both and erase all previous data at their corresponding . and changes status to Forward again. Note that the next time and can change the state to gather must be at the round when both of them are in state Forward, and are currently at the of and of , respectively. Further, note that since of does not have any visited type message at round (as erased any data at round and no other agent can alter data there, after and before ), so can not change to state Gather at round . Also observe that the visited type message at the of written by during round is still there at round (after before since is already destroyed before , no agent is on of to erase the data, also after till only can visit of in state Forward and Back-Wait, but in these states it does not alter any data at the of ) finds it during the round 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 in state Back-Wait gets a dir type message with clockwise direction component at some round . This implies there exists another agent that has changed its state to Gather after storing a dir type message having a direction component clockwise at some round . This can only happen if was in state Backtrack at the beginning of round . So at the beginning of round , was also in state Backtrack, and thus at round , changes its state to Initial-Wait. Note that meets and shares dir type message with while is still at state Initial-Wait. This contradicts our assumption that gets dir message at state Back-Wait. Thus, if 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 , , and be three agents executing the algorithm PerpExplore-Scat-Whitbrd, and suppose be the first agent to enter the Byzantine black hole, while exploring the segment . Let be the of and be the furthest node from along the clockwise direction which is inside . We define the Cautious start node to be if is destroyed by the Byzantine black hole during state Forward. Otherwise, if is destroyed by the Byzantine black hole in state Backtrack then, 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 , then there exists a round , 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 , and be three agents, exploring , and , respectively, where of , of and of . Let be the agent that gets destroyed by the Byzantine black hole while exploring , and then we have the following cases:
Case-I: is destroyed by the Byzantine black hole while it is moving in a clockwise direction, i.e., in state Forward at round . Note that in this case, the cautious start node is the of . This implies there exists a round , where was in state Initial. Note that, can not write any visited type message at of , as it gets destroyed before reaching that node. So, at round, , when is at its own in state Backtrack and checks any visited type message, it finds none exists. This triggers 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 , which is currently waiting at its own in state Initial-Wait (as it does not find any anomaly, so from Backtrack it changed to state Initial-Wait at round ). So, the moment reaches the of , 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 finds a dir type message is written at its current node, it also changes its state to Gather1, i.e., at round 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 and . Note that this must be the of , as the home type message has written at round , cannot be erased by any other agent except . Also can only erase this in state Initial at round if it would have returned back, but since it is already destroyed between round and , hence this possibility never arises, so the home type message remains, when and together reaches this node. After which they change their state to Cautious-Leader and Cautious-Follower depending on their IDs.
Case-II: is destroyed by the Byzantine black hole while it is moving in a counter-clockwise direction, i.e., in state Backtrack at round . Note that in this case, the cautious start node is the of . Let be the round when was in state Initial the last time. This implies , now by similar argument as explained in Case-II of Lemma 11.5, changes its state to Gather while storing the dir = (counter-clockwise, NULL) message, at the of from state Forward, and starts moving in a counter-clockwise direction. Note that at round as did not find any anomaly, so it changes its state to Back-Wait from Forward. Hence, at round , where , finds , while is still in state Back-Wait. This triggers to change its state to Gather2 at round while updating the dir type message to (Counter-clockwise, ID’), where ID’ is the ID of . Then at the same round, writes the updated message at the current node (i.e., of ). Whenever sees this dir type message (at round ) it also changes its state to Gather2. Next in state Gather2, both start to move counter-clockwise (from round ) 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 of (as the ID component of dir type message stores the ID of ). Note that at round , written a home type message at its own . This message can be erased only again at round (i.e., when reaches its again in state Initial). But since changed its state to Gather2 before it cannot move back to state Initial again. So,when and reaches of , they finds the home type message. Hence, both and reach the cautious start node within and further change their states to Cautious-Leader and Cautious-Follower, depending on their IDs.
Lemma 11.13.
Let and 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 be the agent that has been destroyed by the Byzantine black hole at round . Now there are two cases based on the state of at round .
Case-I: was in state Forward at round . In that case, the node of is the cautious start node. Let be the farthest node along the clockwise direction in (i.e., the clockwise nearest of ). Now if there exists any round when was in the state Backtrack then it must have started its state Backtrack from and moved counter-clockwise until while erasing all right markings from each node in . So when started the state Forward at its before being destroyed, all nodes in are without any right marking. This case will happen also when there is no round where was in state Backtrack, i.e., there does not exist any round before , when was in state Forward. So before is destroyed at the Byzantine black hole, say , at round , it has marked right at all nodes starting from the next node of in the clockwise direction, up to the node just before ( can not be marked as before marking it the agent is destroyed there). Let without loss of generality, is in state Cautious-Leader and is in state Cautious-Follower at at some round . Then always moves ahead alone in the clockwise direction to a new node .Then it moves back only if sees the right marking and brings to along with it. Note that always sees a right marking until . Now when it moves to , if it is not destroyed it must see no such right marking as failed to mark it at round . In this case, leaves the node in the clockwise direction to a new node. So here is able to detect the Byzantine black hole. On the other hand, if is destroyed while it visits , then it can not return back to . When sees that has not returned it interprets that 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: was in state Backtrack at round . In this situation, let without loss of generality, the node be the of and, it is also the cautious start node. Let be the farthest node along counter-clockwise direction in (i.e., the of ). Now, if there exists any round when was in state Forward, then it must have started this state from and moved in a clockwise direction until it reaches the node while erasing all the left markings from each node it traverses in . This means that, when started the state Backtrack from , there does not exist any node in with left markings. So before is destroyed by the Byzantine black hole node (say) at round , it must have marked all the nodes with left, starting from the next counter-clockwise node of to the adjacent clockwise neighbor of (as before writing this message at , the agent gets destroyed by the Byzantine black hole). Let without loss of generality, be the lowest ID agent among and , hence it starts in state Cautious-Leader, whereas starts in state Cautious-Follower, at some round . This means is the first agent to move alone in the next counter-clockwise neighbor say, . After which, only if it sees a left message then only it moves back in the clockwise direction at the node of , and in the next round both these agents reach the node . Observe that, always finds a left message until the node . Whenever it reaches , either it gets destroyed by the Byzantine black hole, or it finds that no left marking is present at the current node. This triggers 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 , which triggers to conclude that 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 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 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 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 . 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 with 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 , and be three agents that start from two initial nodes, say and . By Pigeon hole principle, exactly one of and initially must have two agents. Without loss of generality let have two agents, say and , 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., starting from moves clockwise marking each node with message right. If reaches before being destroyed by the Byzantine black hole, 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 gets destroyed before reaching . Note that irrespective of the location of it takes at most rounds for to reach from the beginning. So and waits for rounds and finds that no one has arrived yet. In this case, both and move to along the clockwise direction and start to perform the cautious walk, where the lowest ID agent among and 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 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.