Distrib. Comput. (2007) 19:361–371 DOI 10.1007/s00446-007-0021-5
Activating anonymous ad hoc radio networks Andrzej Pelc
Received: 12 July 2005 / Accepted: 19 December 2006 / Published online: 9 February 2007 © Springer-Verlag 2007
Abstract We consider the task of activating an anonymous ad hoc radio network from a single source, by a deterministic algorithm. In the beginning only the source is active and has to activate other nodes by disseminating messages throughout the network. Nodes of the network do not know its topology and they do not have distinct labels. In such networks some nodes are impossible to reach. A node in a network is accessible if it can be activated by some (possibly networkdependent) deterministic algorithm. We show that the problem of recognizing whether a given node of an anonymous radio network is accessible, can be solved in polynomial time for the synchronous scenario. A deterministic wake-up algorithm for ad hoc networks is universal if it activates all accessible nodes in all networks. We study the question of the existence of such a universal activating algorithm. For synchronous communication we design a universal activating algorithm, and for asynchronous communication we show that no such algorithm exists. Keywords Radio network · Anonymous · Ad hoc network · Algorithm · Synchronous · Asynchronous · Activating · Broadcasting Research partially supported by NSERC discovery grant and by the Research Chair in Distributed Computing at the Université du Québec en Outaouais. A preliminary version of this paper (with title “Waking up anonymous ad hoc radio networks”) appeared in the Proceedings of the 19th International Symposium on Distributed Computing (DISC 2005), September 2005, Cracow, Poland. A. Pelc (B) Département d’informatique, Université du Québec en Outaouais, Gatineau, QC J8X 3X7, Canada e-mail:
[email protected]
1 Introduction A radio network consists of stations, each of which can act in a given time step either as a transmitter or as a receiver. The network is modeled as an undirected connected graph whose nodes are the stations. Two nodes are joined by an edge if transmissions of one of them can reach the other. A node acting as a transmitter in a given time step sends a message which is delivered to all of its neighbors. In the synchronous scenario, a message sent by a node in a given step t is delivered to all neighbors in the same step. The asynchronous scenario is defined using the notion of an adversary that delivers messages. In the asynchronous scenario, a message sent by a node in step t is delivered to each neighbor in some step t ≥ t, and this choice is made by an adversary, for each neighbor. (For the sake of uniformity we may say that delivery is always done by the adversary but in the synchronous scenario the adversary always chooses t = t Such a restricted adversary is called synchronous). An important distinction at the receiving end is between a message being just delivered and being heard, i.e., received successfully by a node. A node acting as a receiver in a given step hears a message, if and only if, a message from exactly one of its neighbors is delivered in this step. The message heard in this case is the one that was delivered from the unique neighbor. If messages from at least two neighbors v and v of u are delivered simultaneously in a given step, none of the messages is heard by u in this step. In this case we say that a collision occurred at u. It is assumed that the effect at node u of a collision is the same as that of no message being delivered in this step, i.e., a node cannot distinguish a collision from silence. A standard assumption made when considering deterministic radio communication is that nodes have distinct
362
labels which can be used by a communication algorithm. Thus the algorithm can, e.g., instruct nodes with labels being integers divisible by 3 to transmit in a given step. However, in practice, the algorithm designer may not know the labels of all nodes, the labels may change over time, or be hidden due to security reasons. Thus it is important to design communication algorithms that do not depend on node labels. In this paper we drop the assumption of the existence of distinct node labels and consider anonymous networks. Another assumption sometimes made in the design of communication algorithms is that the topology of the network is known and can be used as an input to the algorithm (cf., e.g., [8, 18]). If this assumption is not made, the communication algorithm is said to work for ad hoc networks (cf. [9, 23]). In such algorithms, the instructions given to nodes in a given step do not depend on the topology of the network. This obliviousness is often useful because nodes may be (and often are) unaware of the topology of the network and still are able to use an algorithm for ad hoc networks. In this paper we use a very weak model: we study algorithms working for anonymous ad hoc radio networks. We assume that there is one distinguished node called the source. Nodes know only their status source/nonsource but they do not have any other a priori information (global or local) concerning the network: they know neither the topology of the network nor its size, nor even their own degree. They also do not have labels. Activating a radio network from a single source is the following basic task. In the beginning, the source is active and all other nodes are dormant. The source starts the activation process by sending a bit called the activating message, which is then relayed by active nodes (possibly concatenated with other control messages). Every node that hears a message becomes active and can send further messages. Dormant nodes do not send any messages, i.e. they act as receivers until being activated. All nodes have individual clocks that tick at the same rate, measuring time steps. The clock of a node starts in the step when the node is activated. Activating a radio network is closely related to broadcasting, which is one of the fundamental primitives in network communication. Its goal is to transmit a message from the source of the network, to all other nodes. Remote nodes get the source message via intermediate nodes, along paths in the network. The difference between activating a network from a single source and broadcasting is that, in activation, dormant nodes do not send any messages, and in broadcasting, such spontaneous transmissions, containing some control messages and sent before the source message reaches a given node, may be allowed. Activating a network from a single source is
A. Pelc
also related to waking up. In the latter task, some nodes spontaneously wake up and have to wake up other nodes by sending messages. Thus activating a network from a single source is equivalent to waking up when exactly one node (the source) wakes up spontaneously. We consider only deterministic activation algorithms. In our anonymous scenario, for some networks, not all nodes can be activated. For example, in the 4-cycle, the node at distance 2 from the source cannot be activated by any algorithm (even an algorithm knowing the topology of the network), due to the impossibility of breaking symmetry. We say that a node in a network is accessible if it can be activated by some algorithm (possibly specifically designed for this particular network). We are interested in activating ad hoc networks, hence we focus on activation algorithms that do not know the topology of the network. An activation algorithm for ad hoc networks is universal if it activates all accessible nodes in all networks. Such an algorithm, if it exists, is very general, in that – without knowing the network – it is still capable of disseminating source information in every possible network to all nodes that can be reached by some deterministic activation algorithm (even specifically designed for this particular network). 1.1 Our results We first show that the problem of recognizing whether a given node of an anonymous radio network is accessible, can be solved in polynomial time for the synchronous scenario. This is far from obvious, as accessibility of a node is defined as its reachability by some activation algorithm. In order to solve this decision problem in polynomial time, we establish a structural property equivalent to accessibility, and show that this property can be verified in polynomial time by a dynamic programming algorithm. (The running time of an algorithm verifying node accessibility should not be confused with the time of activating accessible nodes by some activation algorithm). Next we study the question of the existence of a deterministic universal activation algorithm. We focus our attention on the feasibility of universal activation. It turns out that the existence of a universal activation algorithm depends on the synchrony of communication. For synchronous communication we design a universal activation algorithm, and for asynchronous communication we show that no such algorithm exists. 1.2 Open problems Although in the synchronous scenario we show a polynomial algorithm for deciding if a given node of an
Activating anonymous ad hoc radio networks
anonymous radio network is accessible, the tractability of this decision problem for asynchronous networks remains open. As for universal activation algorithms, our results suggest two interesting problems. Since we show a universal activation algorithm in the synchronous scenario and refute its existence in the asynchronous scenario, it is natural to ask if a universal activation algorithm exists in the partially synchronous scenario, in which there is an upper bound t on the delay between sending and delivery of a message, and t can be used as an input to the algorithm. On the other hand, in this paper we focus attention on feasibility of universal activation and not on its efficiency. It remains open if there exists a universal activation algorithm (in the synchronous or partially synchronous scenario), which activates all accessible nodes in all networks in time polynomial in the size of the network. 1.3 Related work All previous results concerning deterministic algorithms for radio communication assume that nodes have distinct identities, and each node knows its identity. This is due to the fact that research in this area was focused on such tasks as broadcasting and gossiping (information exchange among nodes), which require transmitting information from one or all nodes to all other nodes in the network. As mentioned in the introduction, such demanding tasks cannot be accomplished in some anonymous networks even of very simple topology, like the 4-cycle. The literature about algorithmic aspects of radio communication can be divided into two parts: papers dealing with centralized communication, in which it is assumed that nodes have complete knowledge of the network topology (and hence can simulate a central monitor scheduling transmissions), and papers assuming only limited (usually local) knowledge of topology and studying distributed communication in such networks. Deterministic centralized broadcasting in radio networks, assuming complete knowledge of the network, was first studied in [7]. The authors also formulated the model of radio network subsequently used by many researchers. In [8], a O(D log2 n)-time broadcasting algorithm was given for all n-node networks of radius D. In [18], O(D + log5 n)-time broadcasting was proposed. This was improved to O(D + log4 n) in [17], then to O(D + log3 n) in [20], and very recently to O(D + log2 n) in [24]. The latter complexity is optimal. On the other hand, in [1] the authors proved the existence of a family of n-node networks of radius 2, for which any broadcast requires time (log2 n).
363
The first paper to study deterministic distributed broadcasting in radio networks whose nodes have only limited knowledge of the topology was [4]. The authors assumed that nodes know only their own label and labels of their neighbors. Many authors [6, 9, 10, 14, 15] studied deterministic distributed broadcasting in radio networks under the assumption that nodes know only their own label (but not labels of their neighbors), and that the topology of the network is unknown. Such networks are often called ad hoc. In [9] the authors gave a broadcasting algorithm working in time O(n) for arbitrary n-node networks, assuming that nodes can transmit spontaneously, before getting the source message. For this model, a matching lower bound (n) on deterministic broadcasting time was proved in [22] even for the class of networks of constant radius. On the other hand, in [6] a lower bound (D log n) was proved for n-node networks of radius D, if spontaneous transmissions are not allowed. In [9, 10, 14, 16] the model of directed graphs was used. The aim of these papers was to construct broadcasting algorithms working as fast as possible in arbitrary (directed) radio networks without knowing their topology. The currently fastest deterministic broadcasting algorithm for such networks is the O(n log2 D)-time algorithm from [16]. On the other hand, in [15] a lower bound (n log D) on broadcasting time was proved for directed n-node networks of radius D. The first papers to study randomized broadcasting algorithms in radio networks were [4, 26]. The authors do not assume that nodes know the topology of the network or that they have distinct labels. In [4] the authors showed a randomized broadcasting algorithm running in expected time O(D log n + log2 n). In [26] it was shown that for any randomized broadcasting algorithm and parameters D ≤ n, there exists an n-node network of radius D requiring expected time (D log(n/D)) to execute this algorithm. It should be noted that the lower bound (log2 n) from [1], for some networks of radius 2, holds for randomized algorithms as well. A randomized algorithm working in expected time O(D log(n/D) + log2 n), and thus matching the above lower bounds, was presented in [23] (cf. also [16]). The wake-up problem in radio networks was first studied in [19] for single-hop networks (modeled by complete graphs), and then in [11, 13] for arbitrary networks. In [21] the authors studied randomized wake-up algorithms for radio networks. In all these papers it was assumed that a subset of all nodes wake up spontaneously (possibly at different times) and have to wake up other (dormant) nodes. In all the above papers communication was carried out in the synchronous model, i.e., assuming that a
364
message is delivered to a neighbor in the time step in which it is sent. Asynchronous radio communication was first considered in [12], where the authors studied an efficiency measure of an asynchronous broadcasting algorithm called the work (the total number of messages sent). They used various adversaries to model asynchrony of radio communication. The model of asynchrony used in the present paper was called edge adversary in [12]. To the best of our knowledge, the present paper is the first to study deterministic communication algorithms for anonymous ad hoc radio networks. Various other computational tasks in anonymous networks were studied previously, starting from the pioneering paper [2], followed by many papers, including [3, 5, 25]. Computational tasks studied in these papers, such as leader election or computing Boolean functions, significantly differ from radio communication that is the object of our present study.
2 Algorithms and histories Since in our setting networks are anonymous (nodes do not have distinct labels) and nodes are not aware of the topology, the decision made by a node in a given step, whether it should transmit or not, can be based solely on the messages previously heard by this node. Hence a (deterministic) activation algorithm can be viewed as a function that takes the communication history of a node before the given step and returns a message to be sent in a given step, or the decision to send no message. From the point of view of node accessibility we can restrict attention to algorithms that instruct nodes to send a particular type of messages: when, according to its history, a node is supposed to send a message in a given step, the message is the entire history of the node before this step. Since the history is the only information based on which decisions are made, any activation algorithm can be simulated by an algorithm sending entire histories, and hence, if a node in a network is accessible by any algorithm, it is accessible by an algorithm whose messages are entire histories. In what follows we formally define the notions of history and of an activation algorithm that correspond to the above intuitions. The history of a node v in step i, denoted by H(i, v), is a finite sequence of symbols 1, [, ]. It corresponds to what the node heard until step i and is inductively defined as follows. H(0, v) is the sequence [1] (where 1 is the one-bit activation message of the source), if v is the source, and it is the sequence [ ] otherwise. The latter sequence is denoted by λ and is called the empty
A. Pelc
history. Suppose that H(j, w) is defined for all j < i and all nodes w. Consider a node v and step i > 0: • • •
If node v heard a message m in step i then H(i, v) is the concatenation of H(i − 1, v) and of the sequence [m]. If node v did not hear any message in step i and v is active then H(i, v) is the concatenation of H(i − 1, v) and of the sequence λ. If node v is dormant (i.e., it is not the source and did not hear any message in any step j ≤ i) then H(i, v) = λ.
In particular, this definition formalizes the intuition that nodes other than the source start counting steps from the time of their activation by the first message they hear, and the source starts counting steps from the beginning. Histories of dormant nodes are all the same in all steps, and equal to λ. An example of a history at a given node v is the sequence [1][ ][1[ ]] which corresponds to the following sequence of events: node v is activated by the message 1 in some time step t, then hears no message in time step t + 1, and then hears the message 1[ ] (which is the current history of the node transmitting this message) in time step t + 2. Let H denote the set of all histories. An activation algorithm is any function A : H −→ {0, 1}, such that A(λ) = 0. Intuitively A(H) = 1 means that algorithm A instructs a node with history H to act as a transmitter in a given step and send a message containing H, while A(H) = 0 means that algorithm A instructs a node with history H to act as a receiver and thus not send any message. In the above definitions, histories of nodes depend on messages heard, and algorithms give instructions about sending. The notion of an execution of an activation algorithm in a given communication environment gives the relation between the above. Fix an activation algorithm A and a network G with source s. In the case of asynchronous communication also fix an adversary A, which, for every step i, every node v, such that v sends a message in step i, and for every neighbor w of v, determines the step j ≥ i in which the message is delivered to w (not necessarily heard by w). Similarly as in [12] we do not allow amalgamating messages sent in different steps by a node, i.e., if two messages were sent by a node v in distinct steps, they must be delivered at each neighbor of v in distinct steps as well. In the present paper we restrict attention to such non-amalgamating adversaries and we use the term “adversary” to mean “non-amalgamating adversary”. In the case of synchronous communication we assume that the adversary always determines step
Activating anonymous ad hoc radio networks
j = i, i.e., it delivers a message in the step in which it is sent. (Of course, a synchronous adversary is nonamalgamating). The execution of algorithm A in (G, s), under adversary A, defines the message heard in any step i by any node. It is the notion of execution that captures both the role of collisions, and the role of the adversary in successful receiving of messages. Fix a node v and a step i, in which v acts as a receiver, according to A. If a message m from exactly one neighbor w of v is delivered at v in step i then v hears m in step i. Otherwise v hears nothing (i.e. it hears a message which is an empty sequence of bits). It follows from the above that if a node v hears a message in step i then this message must be H(j, w), for some j < i and some neighbor w of v, and in the case of synchronous communication it must be H(i − 1, w). A node other than the source is active when it already heard some message. Suppose that a network G with source s and an adversary are fixed. For any activation algorithm A, any time step i and any node v of this network, the execution of A defines a history of the algorithm A in node v at time i. This history is denoted by H(i, v, A).
3 Node accessibility A node of a network G with source s, for adversary A, is accessible if there exists an activation algorithm A such that the execution of A in this network, under adversary A, causes node v to hear a message in some step. This algorithm may be tailored specifically to activate this particular node, and thus may depend on the network and even on the specific node v. We consider two notions of accessibility: synchronous accessibility, i.e., accessibility for the synchronous adversary, and asynchronous accessibility, i.e., accessibility for every adversary. As mentioned in Sect. 1, some nodes in some networks are not accessible, even in the synchronous scenario, as shown in the example of the 4-cycle. Below we give a simple sufficient condition for inaccessibility of a node, exploiting the symmetry of the network. Consider a network G with source s. Nodes w and w are called similar if there exists a graph automorphism f of the graph G = (V, E) (i.e., a bijection f : V −→ V such that u is adjacent to v iff f (u) is adjacent to f (v)) for which f (s) = s and f (w) = w . A node v is called blocked if v is not the source and if, for every u adjacent to v, there exists a node u = u adjacent to v and similar to u. Proposition 1 In synchronous communication, every blocked node is inaccessible. Proof We first prove by induction on step i that similar nodes have identical histories in all steps i in the
365
synchronous execution of any activation algorithm. Fix an activation algorithm A. For i = 0 this property is obvious. Suppose that it holds for i ≥ 0 and let u and u be similar nodes. Let f : V −→ V be an automorphism of G, for which f (s) = s and f (u) = u . We want to prove H(i + 1, u, A) = H(i + 1, u , A). By the inductive hypothesis we have H(i, u, A) = H(i, u , A). If none of the nodes u, u hears any message in step i + 1, we are done. Hence we may assume, without loss of generality, that u hears a message in step i+1. Let v be the neighbor of u from which u heard this message. The node f (v) is a neighbor of u , similar to v. By the inductive hypothesis we have H(i, v, A) = H(i, f (v), A). Hence algorithm A causes f (v) to transmit the same message as v in step i+1. If u hears this message, we are done. Hence assume that u does not hear any message in step i + 1. This means that either u itself or some neighbor w = f (v) of u transmits in this step. In the first case u also transmits in this step because H(i, u, A) = H(i, u , A), which contradicts the assumption that u hears a message in step i + 1. In the second case, the neighbor f −1 (w) of node u is similar to w and, by the inductive hypothesis, we have H(i, w, A) = H(i, f −1 (w), A). Consequently, f −1 (w) transmits in step i + 1, since w does. However, node f −1 (w) is a neighbor of u different from v, which contradicts the fact that u hears the message from v in step i + 1. Thus we got a contradiction in both cases and the property is proved by induction. Suppose that a blocked node v = s is accessible, and let A be an activation algorithm whose synchronous execution causes v to hear a message for the first time in step j. Suppose that this message comes from neighbor u of v. Since v is blocked, there exists a neighbor u = u that is similar to u. Hence histories of u and u are identical up to step j − 1. Consequently, if u sends a message in step j, so does u . This prevents v from hearing any message in step j. Contradiction. The sufficient condition for node inaccessibility from Proposition 1 permits to establish this feature of nodes in many cases. For example, consider a square grid of odd size with the source in the center of the grid. Symmetries with respect to each of the diagonals are clearly automorphisms of the grid that fix the source. It follows that every node of the diagonal is blocked, and consequently it is inaccessible, for the synchronous adversary. However, the condition from Proposition 1 is not necessary for inaccessibility, even in the synchronous scenario. Consider the network from Fig. 1. It is easy to see that nodes u and v are not similar, and hence node t is not blocked. However, it is inaccessible for the following reason. Nodes w and w have identical histories in all steps in the synchronous execution of any
366
A. Pelc
t
z z’
w u
v
z’’
w’
Fig. 1 A network with a non-blocked inaccessible node
activation algorithm. The same property holds for nodes z, z and z . Consequently, v cannot hear any message from w or w , and u cannot hear any message from z, z or z , hence the symmetry between nodes u and v cannot be broken. These nodes have identical histories in all steps in the synchronous execution of any activation algorithm, hence no algorithm can activate node t. Since accessibility of a node in an anonymous radio network is defined in terms of some activation algorithm being able to reach this node, it is not at all clear if this property is efficiently decidable. More precisely, can the problem of deciding whether a given node in a given anonymous radio network is accessible, be solved in polynomial time? Below we show that this is indeed the case in the synchronous scenario. In order to establish this fact, we will use the notion of k-partitions of the set of nodes of the network. For each non-negative integer k, the classes of the k-partition are called k-classes: some of them are called awake k-classes and all others are called sleeping k-classes. Intuitively, two nodes in the same k-class must have the same history until step k, for any activation algorithm. Sleeping k-classes consist of those nodes that cannot be activated until step k by any activation algorithm. Fix a network G with source s and let k be a nonnegative integer. The k-partition of the set V of nodes of G is defined recursively as follows. The 0-partition consists of two classes: {s} and V \ {s}, where {s} is an awake 0-class and V \ {s} is a sleeping 0-class. Suppose that the k-partition, sleeping k-classes and awake k-classes are already defined. Let A1 , . . . , Ar be the awake k-classes, and S1 , . . . , St be the sleeping k-classes. The set SLEEPk is defined as the union of all sleeping k-classes. Let (x) denote the set of neighbors of node x. For every node v define two sets of indices: SINGLEk (v) = {i : ∃u ∈ (v)[((v) ∪ {v}) ∩ Ai = {u}]}; INTk (v) = {i : ((v) ∪ {v}) ∩ Ai = ∅}. Hence SINGLEk (v) is the set of indices of those awake k-classes that contain exactly one neighbor of v and do not contain v. INTk (v) is the set of indices of
those awake k-classes that contain either a neighbor of v, or v itself. Nodes x and y are in the same (k + 1)-class if x and y are in the same k-class and if one of the following conditions is satisfied: • •
SINGLEk (x) = SINGLEk (y) = ∅, SINGLEk (x) = SINGLEk (y) = ∅ and INTk (x) = INTk (y).
This defines the (k + 1)-partition. The set SLEEPk+1 is defined as the set of those nodes x that are in some sleeping k-class and for which SINGLEk (x) = ∅. It is easy to see that if v ∈ SLEEPk+1 and w is in the same (k+1)-class as v then w ∈ SLEEPk+1 . Hence SLEEPk+1 is the union of some (k + 1)-classes that are defined as the sleeping (k + 1)-classes. Each (k + 1)-class is a subset of some k-class and each sleeping (k + 1)-class is a subset of some sleeping k-class. However, some awake (k + 1)-classes are also subsets of a sleeping k-class. Hence the k-partition and the sleeping k-classes are defined recursively for all non-negative integers k. Observe that each (k + 1)-class is a subset of some k-class. Consequently, if n is the number of nodes of the network, the sequence of k-partitions must stabilize for some k ≤ n, which implies that, for any m ≥ n, the m-partition and the n-partition are identical. We first prove the following lemma. Lemma 1 Consider any anonymous radio network G with sources and assume the synchronous scenario. Then for any non-negative integer k the following properties hold: 1. 2.
v ∈ SLEEPk , if and only if, v cannot be activated by step k by any activation algorithm; v and w are nodes in the same k-class, if and only if, H(k, v, A) = H(k, w, A), for any activation algorithm A.
Proof We prove both properties by simultaneous induction on k. For k = 0 both properties hold. Suppose that they hold for k. Let A1 , . . . , Ar be the awake k-classes and let S1 , . . . , St be the sleeping k-classes. We prove both properties for k + 1. Property 1. Consider a node v ∈ SLEEPk+1 . Hence v ∈ SLEEPk and by the inductive hypothesis, v cannot be activated by step k by any activation algorithm. Suppose that v is activated by some algorithm A in step k + 1. Let u ∈ (v) be the neighbor that activates v. By the inductive hypothesis u cannot belong to SLEEPk because otherwise it could not transmit in step k + 1. Hence u ∈ Ai , for some
Activating anonymous ad hoc radio networks
i ≤ r. Since v ∈ SLEEPk+1 , we have SINGLEk (v) = ∅. Hence there must be another node u in ((v) ∪ {v}) ∩ Ai (in fact u must be in (v) ∩ Ai , as v ∈ SLEEPk ). By the inductive hypothesis, H(k, u, A) = H(k, u , A). Hence, if u transmits in step k + 1, according to algorithm A, then so does u . Consequently, v cannot be activated by u in step k + 1. Conversely, suppose that v ∈ SLEEPk+1 . If v ∈ SLEEPk then we are done by the inductive hypothesis. Hence suppose that v ∈ SLEEPk . By definition, SINGLEk (v) = ∅. Let i ∈ SINGLEk (v) and let u be a neighbor of v such that ((v) ∪ {v}) ∩ Ai = {u}. Since u ∈ Ai , by the inductive hypothesis there exists an activation algorithm A that activates u by step k. Modify the algorithm A in step k + 1 by imposing that all nodes in class Ai transmit, and all other nodes receive in this step. (Notice that nodes of class Ai are active by step k in both algorithms, so this behavior of the modified algorithm does not violate the requirement that only active nodes transmit.) Hence in the modified algorithm u is the only node in (v)∪{v} to transmit in step k+1. Consequently, v is activated in this step. Both implications shown above prove Property 1 for k + 1. Property 2. Fix an activation algorithm A. Let v and w be nodes in the same (k+1)-class. Hence they are in the same k-class and by the inductive hypothesis we have H(k, v, A) = H(k, w, A). If in step k + 1 none of the nodes v and w hears anything then H(k+1, v, A) = H(k+1, w, A). Suppose, without loss of generality, that v hears a message in step k+1 and let u ∈ (v) be the neighbor from which this message is obtained. By the inductive hypothesis, u cannot belong to SLEEPk . Hence u ∈ Ai , for some i ≤ r. If SINGLEk (v) = SINGLEk (w) = ∅ then there exists u ∈ ((v) ∪ {v}) ∩ Ai , such that u = u. Hence u and u are in the same k-class. By the inductive hypothesis, H(k, u, A) = H(k, u , A). Consequently, if u transmits in step k + 1, so does u , contradicting the fact that v hears the message from u in this step. Thus we may assume that X = SINGLEk (v) = SINGLEk (w) = ∅ and Y = INTk (v) = INTk (w). Hence u ∈ Ai , for some i ∈ X. On the other hand, ((w) ∪ {w}) ∩ Ai = {u }, for some node u . For every awake class Aj , the history H(k, a, A) is the same for all a ∈ Aj , by the inductive hypothesis. In particular, H(k, u, A) = H(k, u , A), and hence node u transmits in step k + 1 because u does. For all j ∈ Y \ {i}, every node a ∈ Aj must act as a receiver in step k + 1 because otherwise node v would not hear the message from u. Hence in step k + 1 node w hears the message from u . Consequently, H(k + 1, v, A) = H(k + 1, w, A). In order to show the other implication, suppose that v and w are in different (k + 1)-classes. If they are in different k-classes then we are done by the inductive
367
hypothesis. Hence we may assume that they are in the same k-class. Consider two cases. Case 1. SINGLEk (v) = SINGLEk (w). Suppose, without loss of generality, that i ∈ SINGLEk (v) \ SINGLEk (w) and let u be a neighbor of v such that ((v) ∪ {v}) ∩ Ai = {u}. Consider any activation algorithm A that makes all nodes in Ai transmit in step k + 1 and all other nodes receive in this step. (Again, nodes in Ai are active by step k, so they can transmit in step k + 1.) Then, in step k + 1, v hears the message sent by u since this is the only node in (v) ∪ {v} transmitting in this step. On the other hand, i ∈ SINGLEk (w). Hence w does not hear anything in step k + 1, according to this algorithm. Consequently, H(k + 1, v, A) = H(k + 1, w, A). Case 2. SINGLEk (v) = SINGLEk (w) = ∅ and INTk (v) = INTk (w). Without loss of generality, there exists j ∈ INTk (v) \ INTk (w). Let i ∈ SINGLEk (v) = SINGLEk (w). Clearly, i = j. Consider any algorithm A that makes all nodes in Ai and Aj transmit in step k + 1 and all other nodes receive in this step. Let u be a neighbor of w such that ((w) ∪ {w}) ∩ Ai = {u}. Then u transmits in step k + 1 and w hears the message sent by u since this is the only node in (w) ∪ {w} transmitting in this step. On the other hand, node v does not hear anything in step k + 1 because at least two nodes in (v) ∪ {v} transmit in this step: the unique neighbor of v from class Ai and some node in ((v) ∪ {v}) ∩ Aj . Consequently, H(k + 1, v, A) = H(k + 1, w, A). Hence in both cases we proved H(k+1, v, A) = H(k+ 1, w, A). This concludes the proof of Property 2 by induction. The following result establishes a characterization of node accessibility in the synchronous scenario, which will form the basis of a polynomial decision algorithm for this property. Theorem 1 Assume the synchronous scenario. Let G be an n-node anonymous radio network with source s, and let v be any node of G. Then v is inaccessible, if and only if, v ∈ SLEEPn . Proof Since k-partitions of the set of nodes of G have the property that any (k + 1)-class is included in some k-class, and SLEEPk+1 ⊆ SLEEPk , they must stabilize for some k≤n, which implies that, for any m ≥ n, the m-partition and the n-partition are identical and SLEEPm = SLEEPn . A node v is inaccessible, if and only if, it cannot be activated by any activation algorithm. By Lemma 1 this is equivalent to v ∈ SLEEPm for all m, and hence equivalent to v ∈ SLEEPn .
368
We now present the Algorithm Check-SynchronousAccessibility, which is a dynamic programming algorithm for checking accessibility of a node in a given anonymous radio network, in the synchronous scenario. Notions of sets SINGLEk (v) and INTk (v) and of awake and sleeping k-classes were defined previously. Algorithm Check-Synchronous-Accessibility INPUT: Graph G = (V, E), source s, node x. Set awake 0-class A1 = {s}, sleeping 0-class S1 = V \ {s}, SLEEP0 = S1 . for k = 1 to n do for all v ∈ V do compute SINGLEk (v) and INTk (v) for all v, w ∈ V do determine if v and w are in the same k-class compute awake k-classes and sleeping k-classes; set SLEEPk to the union of sleeping k-classes. if x ∈ SLEEPn then output: x inaccessible else output: x accessible. Theorem 2 Algorithm Check-Synchronous-Accessibility verifies node accessibility in anonymous synchronous radio networks in polynomial time. Proof The correctness of Algorithm Check-Synchronous-Accessibility follows directly from Theorem 1. As for its time complexity, the most time-consuming part of the algorithm is checking if v and w are in the same k-class. For every k and every pair of nodes v, w this can be done in time O(n), if all sets SINGLEk (u) and INTk (u) are already computed. Hence the running time of the algorithm is O(n4 ). It remains open whether accessibility in anonymous asynchronous radio networks is polynomially decidable as well.
4 A universal activation algorithm in the synchronous scenario In this section we consider the synchronous scenario, in which every message is delivered to neighbors of a sending node in the same step in which it is sent. In this scenario we can define the notion of time of any nonempty history H, denoted by T(H). This is the time step (counted from the start of the activation process), in which the history is considered. T(H) can be easily computed, given H. It is clear how to do it for time step 1.
A. Pelc
Suppose that it is computed for histories in time steps j < i, and consider a history H in step i. Consider the subsequence H of H corresponding to the first message forming H. The sequence H is some history at a time j < i, hence by induction T(H ) can be computed. Every step after j is reflected in the sequence H either by a subsequence [ ] if no message was heard in this step, or by a subsequence [m], where m is the message heard in this step. The number x of these subsequences (easy to identify by pairing parentheses [ and ]), added to T(H ), gives T(H). Example 1 Consider the history H = ([ ][H ][H1 ][ ][ ][H2 ][ ][H3 ]). The first segment [ ] codes the fact that the node is not the source. The next segment [H ] means that the first heard message was H . Suppose that T(H ), computed recursively, is 5. The end segment [H1 ][ ][ ][H2 ][ ][H3 ] of the sequence H means that the node heard message H1 in step 6, no message in steps 7 and 8, message H2 in step 9, no message in step 10, and message H3 in step 11. Thus T(H) = 11. Consider any activation algorithm A and any time step i. The truncation of A to i, denoted A|i, is the restriction of the function A to the set of those histories H for which T(H) ≤ i. Let i be the set of all truncations to i. For each integer i, i is a finite set. Enumerate all elements of all sets i by distinct positive integers (since truncations are functions from a set of sequences to {0, 1}, a canonical enumeration could be, e.g., the lexicographic ordering of these functions). For any truncation A|i, let (A|i) denote the positive integer associated to A|i in this enumeration. Call it the code of truncation A|i. By definition, distinct truncations have distinct codes. We now define projections of histories. Let pj denote the jth prime number. Let H be a history and j a positive integer. We define the jth projection of H, denoted j (H), by induction on T(H). We have j ([ ]) = ([ ]) and j ([1]) = ([1]). Suppose that j (H ) is defined for all histories with T(H ) < T(H). Let H ∗ be the subsequence of H corresponding to time steps that are powers of pj . Let H ∗ = ([H1 ][H2 ] . . . [Hr ]), where Ht are either histories or empty sequences. Now j (H) is defined as ([j (H1 )][j (H2 )] . . . [j (Hr )]). Intuitively, j (H) extracts from H the part that happened in time steps which are powers of pj . We are now ready to define Algorithm UniversalActivation. This algorithm will be proved universal in the synchronous scenario. The idea of the algorithm is the following. Consider any activation algorithm A and any step i. Let the truncation A|i have code j. Algorithm
Activating anonymous ad hoc radio networks
369
t
Universal-Activation simulates decisions of algorithm A made in steps k ≤ i by making identical decisions in steps pkj . According to Algorithm Universal-Activation, nodes do not transmit in steps other than pkj . In a step pkj a node transmits for input history H if and only if the truncation A|i with code j transmits for the input which is the projection j (H) of history H. It should be noted that powers of primes are used because they have the property that pkj = pkj , if ordered pairs (j, k) and (j , k ) are different. This idea is formalized as follows. As any activation algorithm, Algorithm Universal-Activation is a function U that takes as input a nonempty history H at a given node and outputs either 0 (meaning: don’t transmit) or 1 (meaning: transmit your entire history). Algorithm Universal-Activation INPUT: nonempty history H. if T(H) is not pkj − 1, for any j and k, then U(H) = 0; if T(H) = − 1, for some j and k, then let A|i be a truncation with code j; if k ≤ i then U(H) = A(j (H)) else U(H) = 0.
u
1
u
u
2
3
u
4
s Fig. 2 The network N(1,2,2,3)
pkj
Theorem 3 Algorithm Universal-Activation is universal in the synchronous scenario. Proof Consider an accessible node v in a network G with source s. Let u1 , u2 , . . . , um be neighbors of v. Denote v = u0 . Suppose that an activation algorithm A activates node v in step i. Hence v hears the message from some neighbor uq in step i. Let j be the code of truncation A|i. Consider the step t = pij . Let Hr , for r = 0, 1, . . . , m, be the history of node ur in time step t − 1, according to Algorithm Universal-Activation, i.e., Hr = H(t − 1, ur , U), and let Hˆ r be the history of node ur in time step i − 1, according to algorithm A, i.e., Hˆ r = H(i − 1, ur , A). Hence Hˆ r = j (Hr ). Since v was activated by uq according to algorithm A, we have A(Hˆq ) = 1 and A(Hˆ r ) = 0, for all r = q. By the definition of Algorithm Universal-Activation, we have U(Hr ) = A(j (Hr )) = A(Hˆ r ). Hence U(Hq ) = 1 and U(Hr ) = 0, for all r = q. Consequently, v hears the message from uq in time step t. It follows that all accessible nodes are activated by Algorithm Universal-Activation, and hence this algorithm is universal.
5 Impossibility of universal activation in the asynchronous scenario In this section we prove that a universal activation algorithm does not exist if communication is asynchronous.
In order to carry out our impossibility argument, we first define the following class of networks. Networks of this class are indexed by finite nondecreasing sequences. Let r = (r1 , . . . , rk ) be such a sequence, where r1 ≤ · · · ≤ rk . The network Nr is defined as follows. The source s has neighbors u1 , . . . , uk , which have another common neighbor t, at distance 2 from s. Moreover, to each node um a path of length rm is attached, and all paths are pairwise disjoint and do not contain s or t (see Fig. 2). A network Nr is called leading, if the largest term of the sequence r is unique (i.e., if rk > rk−1 ). Thus the network N(1,2,2,3) is leading and the network N(1,2,3,3) is not. We first prove the following fact. (Note that we refer to adversaries used in the definition of asynchronous radio communication).
Lemma 2 In every leading network every node is accessible, for any adversary.
Proof Let Nr be a leading network, and let rk be the unique largest term of r. We present an algorithm (called Algorithm Dedicated because it is specially tailored for the network Nr and depends on r = (r1 , . . . , rk )) that activates all nodes of Nr , for any adversary. The algorithm is described informally but it can be easily translated to correspond to our definition from Sect. 2.
370
Algorithm Dedicated – The source sends a message with counter −1; – a node that was woken up by a message with counter x in some step, sends a message with counter x + 1 in the next step; – a node that heard a message with counter rk in some step, sends the message elected in the next step; – a node that heard the message elected for the first time in some step, sends the message elected k − 1 times, in the k − 1 following steps. It is easy to see that all nodes of Nr , other than node t, are activated by messages with counters. The message elected is generated only in the unique longest path, and consequently only one neighbor of the source, namely node uk corresponding to this longest path, sends k messages: one message with counter 0 and k − 1 messages elected. Every other neighbor of the source sends only one message (with counter 0). There are at most k − 1 different steps in which messages from nodes u1 , . . . , uk−1 are delivered to t. Hence at least one of the k messages from node uk is delivered to t in a step in which it is the only message delivered to t. Consequently, node t is activated as well. In order to prove the impossibility of universal activation in the asynchronous scenario, it is now sufficient to show the following result. Lemma 3 For every activation algorithm A there exists a leading network and an adversary, for which node t is not activated by A. Proof Consider any activation algorithm A, a network Nr and a neighbor um of the source. Fix the following partial behavior of the adversary: all messages sent by the source and all messages sent along edges of the path of length rm attached to um are delivered in the time step in which they are sent (i.e., on this part of the network the adversary is synchronous). Any message sent by any neighbor uk of the source in step i is delivered at s and at t in the same step j ≥ i (j is to be specified later). Consider the part of the execution of A before node t is activated. The only messages um can hear during this part are either from its neighbor on the path of length rm attached to um , or from the source. Since during this part the source does not hear any message (otherwise node t would also hear a message in the same step), its history (possibly heard by um ) is of the form [1][ ][ ] . . . [ ]. Hence messages heard by um during this part of the execution of A (for the above partially described behavior of the adversary) depend only on rm (and not on the entire
A. Pelc
topology of Nr ). Consequently, the histories of um also depend only on rm during this part. In view of this property, the following function f : N −→ N ∪ {∞} is well defined (N denotes the set of natural numbers). Take any positive integer x and consider a neighbor um of the source s in a network Nr . Suppose that x = rm is the length of the path attached to um . Intuitively, f (x) is the number of messages sent by um before node t is activated. Since the value of f (x) can be also ∞, this has to be carefully defined as follows. Consider two cases. •
•
For any positive integer k there exists an integer i such that if node t of network Nr is not activated by step i then node um sends more than k messages by step i. Then define f (x) = ∞. Otherwise, there exists a positive integer k such that for any integer i, if node t is not activated by step i then node um sends at most k messages by step i. Let y be the smallest such integer k. Then define f (x) = y.
The rest of the proof is split in two cases. Case 1. f (x) = ∞, for some x. Consider the network N(x,x,x+1) . This is a leading network. Suppose that all messages sent by neighbors u1 and u2 of the source are delivered at t and at s in the step in which they are sent (hence the adversary is synchronous for these nodes). Let these be steps i1 , i2 , . . . , until t is activated. Let the jth message be sent by u3 in step zj , until t is activated. We complete the description of the behavior of the adversary by defining the step dj in which this jth message of u3 is delivered at t and at s: dj is the smallest step ik larger than all dj , for j < j and larger than zj . Hence none of the messages sent by u1 , u2 , u3 is heard by t, due to collisions. Consequently, t can never be activated. Case 2. f (x) is a positive integer, for all x. Subcase 2.1. f (x) ≤ f (1), for all positive integers x. In this case, there exist two positive integers x1 < x2 , such that c = f (x1 ) = f (x2 ). Consider the network N(x1 ,x2 ) . This is a leading network. Let i be a time step by which neighbors u1 and u2 of the source send their first c messages. Now we complete the description of the behavior of the adversary by defining steps when messages sent by u1 and u2 are delivered at t and at s: in both cases they are delivered in steps i+1, i+2, . . . , i+c. Hence none of these messages is heard by t, due to collisions. Consequently, t is not activated by any of these messages. However, u1 and u2 will not send any more messages, and hence t can never be activated.
Activating anonymous ad hoc radio networks
Subcase 2.2. f (x) > f (1), for some positive integer x. In this case denote f (1) = a and f (x) = b. Let c = b/a. Consider the network Nr , where r = (r1 , . . . , rc+1 ), with r1 = · · · = rc = 1 and rc+1 = x. Let i be a time step by which neighbors u1 , . . . , uc of the source send their first a messages and neighbor uc+1 of the source sends its first b messages. We complete the description of the behavior of the adversary by defining steps when messages sent by nodes um , for m ≤ c + 1, are delivered at t and at s. The b messages sent by node uc+1 are delivered in steps i + 1, i + 2, . . . , i + b. The a messages sent by node um , for m < c, are delivered in steps i + (m − 1)a + 1, i + (m − 1) a + 2, . . . , i + ma. Finally, the a messages sent by node uc are delivered in steps i + b − a + 1, i + b − a + 2, . . . , i + b. Hence none of these messages is heard by t, due to collisions. Consequently, t is not activated by any of these messages. However, none of the nodes um will send any more messages, and hence t can never be activated. Lemmas 2 and 3 imply the main result of this section: Theorem 4 There does not exist a universal activation algorithm in the asynchronous scenario. Acknowledgment Thanks are due to the anonymous referees whose detailed remarks enabled us to improve the readability of the paper.
References 1. Alon, N., Bar-Noy, A., Linial, N., Peleg, D.: A lower bound for radio broadcast. J. Comput. Syst. Sci. 43, 290–298 (1991) 2. Angluin, D.: Local and global properties in networks of processors. In: Proceedings of 12th Symposium on the Theory of Computing, pp. 82–93 (1980) 3. Attiya, H., Snir, M., Warmuth, M.: Computing on an anonymous ring. J. ACM 35, 845–875 (1988) 4. Bar-Yehuda, R., Goldreich, O., Itai, A.: On the time complexity of broadcast in radio networks: an exponential gap between determinism and randomization. J. Comput. Syst. Sci. 45, 104–126 (1992) 5. Boldi, P., Vigna, S.: Computing anonymously with arbitrary knowledge. In: Proceedings of 18th ACM Symposium on Principles of Distributed Computing (1999) 6. Bruschi, D., Del Pinto, M.: Lower bounds for the broadcast problem in mobile radio networks. Distrib. Comput. 10, 129– 135 (1997) 7. Chlamtac, I., Kutten, S.: On broadcasting in radio networks— problem analysis and protocol design. IEEE Trans. Commun. 33, 1240–1246 (1985) 8. Chlamtac, I., Weinstein, O.: The wave expansion approach to broadcasting in multihop radio networks. IEEE Trans. Commun. 39, 426–433 (1991)
371 9. Chlebus, B., Gasieniec, ¸ L., Gibbons, A., Pelc, A., Rytter, W.: Deterministic broadcasting in unknown radio networks. Distrib. Comput. 15, 27–38 (2002) 10. Chlebus, B., Gasieniec, ¸ L., Östlin, A., Robson, J.M.: Deterministic radio broadcasting. In: Proceedings of 27th International Colloquium on Automata, Languages and Programming (ICALP’2000). LNCS, vol. 1853, pp. 717–728 11. Chlebus, B., Kowalski, D.: A better wake-up in radio networks. In: Proceedings of 23rd Annual Symposium on Principles of Distributed Computing (PODC 2004) 12. Chlebus, B., Rokicki, M.: Asynchronous broadcast in radio networks. In: Proceedings of 11th International Collaboration on Structural Information and Communication Complexity, (SIROCCO’2004). LNCS, vol. 3104, pp. 57–68 13. Chrobak, M., Gasieniec, ¸ L., Kowalski, D.: The wake-up problem in multi-hop radio networks. In: Proceedings of 15th ACM-SIAM Symposium on Discrete Algorithms (SODA 2004), pp. 985–993 14. Chrobak, M., Gasieniec, ¸ L., Rytter, W.: Fast broadcasting and gossiping in radio networks. In: Proceedings of 41st Symposium on Foundations of Computer Science (FOCS’2000), pp. 575–581 15. Clementi, A.E.F., Monti, A., Silvestri, R.: Selective families, superimposed codes, and broadcasting on unknown radio networks. In: Proceedings of 12th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’2001), pp. 709–718 16. Czumaj, A., Rytter, W.: Broadcasting algorithms in radio networks with unknown topology. In: Proceedings of 44th Symposium on Foundations of Computer Science (FOCS’2003), pp. 492–501 17. Elkin, M., Kortsarz, G.: Improved broadcast schedule for radio networks. In: Proceedings of 16th ACM-SIAM Symposium on Discrete Algorithms (SODA 2005) 18. Gaber, I., Mansour, Y.: Centralized broadcast in multihop radio networks. J. Algorithms 46(1), 1–20 (2003) 19. Gasieniec, ¸ L., Pelc, A., Peleg, D.: The wakeup problem in synchronous broadcast systems. SIAM J. Discret. Math. 14, 207–222 (2001) 20. Gasieniec, ¸ L., Peleg, D., Xin, Q.: Faster communication in known topology radio networks. In: Proceedings of 24th Annual ACM Symposium on Principles Of Distributed Computing (PODC 2005) 21. Jurdzinski, T., Stachowiak, G.: Probabilistic algorithms for the wakeup problem in single-hop radio networks. In: Proceedings of 13th International Symposium on Algorithms and Computation (ISAAC 2002). LNCS, vol. 2518, pp. 535–549 22. Kowalski, D., Pelc, A.: Time complexity of radio broadcasting: adaptiveness vs. obliviousness and randomization vs. determinism. Theor. Comput. Sci. 333, 355–371 (2005) 23. Kowalski, D., Pelc, A.: Broadcasting in undirected ad hoc radio networks. Distrib. Comput. 18, 43–57 (2005) 24. Kowalski, D., Pelc, A.: Optimal deterministic broadcasting in known topology radio networks. Distrib. Comput. (to appear) 25. Kranakis, E., Krizanc, D., van der Berg, J.: Computing Boolean functions on anonymous networks. Inf. Comput. 114, 214–236 (1994) 26. Kushilevitz, E., Mansour, Y.: An (D log(N/D)) lower bound for broadcast in radio networks. SIAM J. Comput. 27, 702– 712 (1998)