Computing on a Partially Eponymous Ring∗ Marios Mavronicolas† Loizos Michael‡ Paul Spirakis§ (September 8, 2006) ∗ This work has been partially supported by the European Union under IST FET Integrated Project 015964 (AEOLUS). † Department of Computer Science, University of Cyprus, Nicosia CY-1678, Cyprus. Email: [email protected] ‡ Division of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138. Email: [email protected] § Department of Computer Engineering and Informatics, University of Patras, 265 00 Patras, Greece, & Research and Academic Computer Technology Institute, 265 00 Patras, Greece. Email: [email protected] Abstract We study a new model of distributed computation, which we call the partially eponymous model, that simultaneously generalizes the anonymous and the eponymous models. In this model, processors have identities, which, unlike the anonymous model, are not necessarily all identical, and which, unlike the eponymous model, are not necessarily unique; processors receive inputs and must reach outputs that respect a relation. Specifically, we focus on the partially eponymous ring R, and we are interested in the computation of circularly symmetric relations on it; such relations make the broadest class of relations that are natural to consider for rings. • We distinguish between solvability and computability: in solvability, processors are required to always reach outputs that respect the relation; in computability, processors must reach outputs that respect the relation whenever this is possible, and report impossibility otherwise. – We provide an efficient characterization of solvability of an arbitrary (circularly symmetric) relation on an arbitrary set of rings. The characterization is topological and can be expressed as a number-theoretic property that can be checked efficiently. – We present a universal distributed algorithm for computing any arbitrary (circularly symmetric) relation on any set of rings. The algorithm is comprised of any distributed algorithm for collecting views, followed by local steps. • Towards obtaining bounds on message complexity, we use as our chief algorithmic instrument a distributed algorithm tailored for a natural generalization of Leader Election, in which a (non-zero) number of leaders are elected; call it Multiple Leader Election. We use this algorithm as a subroutine for collecting views; hence, we prove, as our main result, an upper bound on the message complexity of the particular instance obtained this way of our universal algorithm to compute an arbitrary (circularly symmetric) relation on an arbitrary set of rings. The shown upper bound demonstrates a graceful degradation with a parameter indicating the degree of topological compatibility between the relation and the set of rings; this parameter will be called the Minimum Asymmetry Index. We employ this universal upper bound to identify two cases where an arbitrary relation can be computed with an efficient number of O(|R| · lg |R|) messages: – The set of rings is universal : that is, Leader Election is solvable on it. The efficient message complexity achieved (for all relations) on a universal set of rings implies that, surprisingly, Leader Election is either unsolvable on a given set of rings, or it can be computed on that given set with an efficient number of messages. – The set of rings is logarithmic: that is, each identity appears at most a logarithmic number of times (in the size of the ring). 2 1 Introduction 1.1 Motivation and Framework Two of the best studied models in Distributed Computing Theory are the eponymous model and the anonymous model. In both models, processors may receive inputs and must reach outputs, which are related to the inputs according to some (recursive) relation. • In the eponymous model, processors have unique identities. This availability enables the computability of all relations: processors first solve Leader Election [21] to elect a leader among them; then, the leader undertakes computation of the relation and communicates the solution to all other processors. • In the anonymous model, processors have no available identities (or, equivalently, they have identical identities) and they run the same local algorithm. The impossibility of breaking this initial symmetry retains many relations unsolvable in the anonymous model; the prime example is the impossibility of solving Leader Election on an anonymous ring [2], and the proof echoes symmetry arguments of the kind employed by Lewis Carroll back in 1872 [10, Chapter IX] (cf. [12, Section 4.1]). This long-known separation between the eponymous model and the anonymous model invites the investigation of an intermediate model, where there are identities available to the processors, but these are neither necessarily unique, nor necessarily all identical. Call this intermediate model the partially eponymous model. Studying the partially eponymous model is well motivated since it may be practically difficult to keep all identities distinct in a network with an increasing number of processors. We consider a particular case of the partially eponymous model, that of the (asynchronous) partially eponymous ring R with bidirectional communication and orientation. Which relations are solvable on the partially eponymous ring? For which message complexity can an arbitrary relation be computed? We focus on circularly symmetric relations, the broadest class of relations that are natural to consider for rings. Roughly speaking, in a circularly symmetric relation, shifting any output vector for a given input vector must yield a correct output vector for the correspondingly shifted input vector. Circularly symmetric relations were originally motivated by the known fact that a function is solvable on an (asynchronous) anonymous ring, if the function value does not change when the inputs are cyclically shifted [5]. An essential attribute of most previous work on anonymous networks has been the requirement that the distributed algorithm for a particular relation runs on all networks and 3 occasionally reports impossibility (exactly, of course, when it is impossible to return admissible outputs — ones that respect the relation). This concept will be called computability in this work. An orthogonal viewpoint is to actually isolate the subclass of networks on which it is always possible to return admissible outputs, in order to obtain tailored algorithms that are possibly more efficient (in terms of message complexity) than those running on all networks. This motivation leads to the concept of solvability: a relation is solvable on a set of networks if there is a distributed algorithm which, when run on any network in the set, leads all processors to reach admissible outputs (and never report impossibility). 1.2 Previous Work Computation on anonymous networks was first studied in the seminal work of Angluin [2], where the impossibility of solving Leader Election was first established. Yamashita and Kameda [23, 24] have considered the solvability of several representative distributed computing problems (such as Leader Election, Edge Election, Spanning Tree Construction and Topology Recognition) on anonymous networks. For all these problems, Yamashita and Kameda characterized the class of (anonymous) networks on which each problem is solvable under different assumptions on the network attributes (e.g., size, topology, etc.) that are made available to the processors. Yamashita and Kameda [23] have considered the computation of functions on anonymous networks. They characterized the class of computable functions and proved bounds on their message complexity. The bit complexity of such computations was studied by Kranakis et al. [19]. The more general model of an arbitrary partially eponymous network has been considered by Yamashita and Kameda [26]. They focused on Leader Election and provided a graph-theoretic characterization of its computability under different assumptions on the communication mode and the available (a)synchrony. Boldi and Vigna [8] have considered the more general solvability problem for an arbitrary relation on any arbitrary network and for any level of knowledge and anonymity (or eponymity) of the processors. (The detail of the level of processor anonymity is modelled in [8] by using colors on the nodes or on the edges.) Boldi and Vigna provided an effective (i.e., recursive) characterization of solvable relations on an arbitrary network. We quote the own words of Boldi and Vigna [8, page 1]: “Our results are mainly of theoretical interest, because of the large amount of information exchanged by the processors. Moreover, complexity issues are not taken 4 into consideration, as opposed, for instance, to [5, 1]. We rather concentrate on general decidability properties that hold under any assumption of knowledge, or of communication primitives (broadcast, point-to-point, etc.)” So, the work of Boldi and Vigna [8] has left open the possibility of deriving efficient characterizations of solvability on anonymous networks for particular topologies. We are interested, in this work, in investigating efficient characterizations of solvability for the case of the partially eponymous ring. Attiya et al. [5] initiated the study of computing functions on the asynchronous anonymous ring (see also [4]). Recognition of strings on the (a)synchronous anonymous ring has been studied in [3, 18]. Flocchini et al. [13] consider the problems of Leader Election, Edge Election and Multiset Sorting on the asynchronous anonymous ring R where processors are distinguished by input values that are not necessarily distinct. So, input values are treated in the partially eponymous model of Flocchini et al. [13] as either identities (e.g., when studying Leader Election) or as inputs (e.g., when studying Multiset Sorting). We emphasize that the partially eponymous model of Flocchini et al. [13] does not simultaneously consider identities and inputs. Under the assumptions that input values are binary and |R| is prime, Flocchini et al. [13, Theorems 4.1 and 4.2] provide lower and upper bounds on message complexity for these three problems. The lower and upper bounds are Ω( j (zj2 + t2j )) and O( j (zj2 + t2j ) + |R| · lg |R|), respectively, where zj and tj are the lengths of consecutive blocks of 1’s and 0’s, respectively, in the vector of binary inputs. Flocchini et al. [13, Section 3] characterize also the input vectors that suffice for the solvability of these three problems. The first efficient algorithm for Leader Election in the eponymous ring is based on the intuitive idea of domination in neighborhoods with progressively doubling size, which is due to Hirschberg and Sinclair [15]; it achieves an O(|R| · lg |R|) upper bound on message complexity. (We note that the similar |R| · lg |R| term in the bound in [13, Theorem 4.2] has nothing to do with the neighborhood doubling technique of Hirschberg and Sinclair; instead it relies heavily on the assumption of binary inputs.) A corresponding lower bound of Ω(|R| · lg |R|) has been established in [9]. The current record (with respect to constant factors) on message complexity for Leader Election on the eponymous ring appears in [14]. Further studies of the impact of knowledge and initial conditions on computability in anonymous networks appear in [7, 22], respectively. Issues of symmetry-breaking and similarity in distributed systems are discussed in [16, 17]. 5 1.3 Contribution We start with a treatment of solvability and computability. • We discover (Theorem 4.3) that (for circularly symmetric relations) solvability is equivalent to compatibility, a new abstract, topological concept we introduce to capture the possibility that symmetries initially present in the initial configuration, comprised of the identities and the inputs, persist to the reached outputs (which must respect the relation). To measure the initial configuration symmetry (rather asymmetry), we use the period of a vector consisting of the identities and the inputs; the smaller the symmetry, the longer the period, and we call this period the Asymmetry Index. It turns out that the Asymmetry Index enjoys an elegant number-theoretic expression allowing for its efficient evaluation. Similarly, we measure the final symmetry in an output vector using its period. The possibility of persistence of initial symmetries to the final symmetries amounts to demanding that the period of some admissible output vector divides that of the initial vector, and this is our definition of compatibility. We remark that compatibility can be checked efficiently (since it reduces to a number-theoretic property that can be checked efficiently); hence, our compatibility characterization of solvability is an efficient characterization. • We present a universal algorithm for computing any arbitrary (circularly symmetric) relation on any set of rings (Theorem 4.4). This universal algorithm is comprised of any (unspecified) distributed algorithm for collecting views at each processor; this is followed by local steps specific to the particular relation. • As an application of our characterization of solvability, we derive a particular characterization of solvability for (circularly symmetric) aperiodic relations (Theorem 4.5); Leader Election is an example of such relations. So, this determines a topological characterization of the class of relations that are equivalent to Leader Election with respect to solvability. We now proceed to study message complexity (with respect to computability). • As our chief algorithmic instrument, we present a distributed algorithm to solve a natural generalization of Leader Election in which a (non-zero) number of leaders must be elected; call it Multiple Leader Election (Proposition 5.3). This algorithm works correctly on a given configuration when advised with a lower bound k on the Asymmetry Index for that configuration. This distributed algorithm exploits the idea of doubling neighborhoods from the distributed algorithm of Hirschberg and Sinclair [15] for solving Leader Election on the eponymous ring; it achieves message complexity O(|R| · lg k) (Proposition 5.2) for any advice k. • In turn, we use the distributed algorithm for Multiple Leader Election to construct a universal algorithm to compute an arbitrary (circularly symmetric) relation Ψ on a set of 6 n2 + n · lg AI(ID, Ψ) , where AI(ID, Ψ) AI(ID, Ψ) is the Minimum Asymmetry Index — the minimum value of Asymmetry Index over all configurations with rings coming from ID and input vectors coming from the domain of rings ID. This algorithm has message complexity O Ψ (Theorem 5.4). Here, AI(ID, Ψ) is used as the advice k for the distributed algorithm to solve Multiple Leader Election. (Note that this is permissible when designing a distributed algorithm to compute the relation Ψ on the set of rings ID.) Interestingly, the established upper bound demonstrates that the message complexity on rings of size n degrades gracefully with the Minimum Asymmetry Index, ranging from O(n · lg n) for the eponymous ring to O(n2 ) for the anonymous ring. So, our universal upper bound is tight for these two extreme models. • We are finally interested in determining sets of rings on which the universal upper bound on message complexity from Theorem 5.4 is low. In particular, on which sets of rings (of size n) is an upper bound of O(n · lg n) possible? We identify two such classes of sets: – Say that a set of rings is universal if Leader Election is solvable on it. So, every relation is solvable on such a universal set. We prove that a (circularly symmetric) relation is computable with O(n · lg n) messages on a universal set of rings (Theorem 5.5). Hence, surprisingly, Leader Election is either unsolvable on a given set of rings, or it can be computed efficiently on the given set with O(n · lg n) messages on it. – Say that a set of rings is logarithmic if each identity appears ar most lg n times. The motivation for considering sets of rings where each identity appears only a small number of times comes from Yamashita and Kameda [26, Section 8]: “The anonymous network can be considered as a model of the worst case where the uniqueness [of processor identity numbers] is completely violated. In most practical situations only a small number of processors may have the same identity number as a result of some failure or design error, and algorithms for solving different problems could take advantage of the (non-unique) identity numbers.” We prove that each (circularly symmetric) relation is computable with O(n·lg n) messages on a logarithmic set of rings (Theorem 5.6) — note that this holds even if the relation is not solvable on that set of rings. We remark that the two particular sets of rings identified in Theorems 5.5 and 5.6, namely universal and logarithmic, are incomparable to each other. 7 1.4 Comparison to Directly Related Work Whereas Boldi and Vigna [8] provide an effective characterization of anonymous solvability for any arbitrary relation on any arbitrary network, our work provides the first efficient characterization of partially eponymous solvability for any arbitrary relation on the ring (Theorem 4.1). It is not evident how the effective graph-theoretic characterization from [8] (involving graph fibrations) could yield an efficient characterization for the special case of the partially eponymous ring. Theorem 5.4 improves [13, Theorem 4.2] in three fronts. First, it works for arbitrary ring size |R|, while [13, Theorem 4.2] assumes that |R| is prime. Second, [13, Theorem 4.2] assumes binary inputs, while Theorem 5.4 makes no assumption on either inputs or identities. (We stress that the assumption of binary inputs is responsible for the |R| · lg |R| term in the upper bound of [13, Theorem 4.2], while the |R| · lg |R| term in the upper bound of Theorem 5.4 is due to the application of the neighborhood doubling technique from [15].) Third, and most important, Theorem 5.4 applies to any arbitrary relation, while [13, Theorem 4.2] is tailored to three specific relations (Leader Election, Edge Election and Multiset Sorting). We remark, however, that the worst-case message complexity in both Theorem 5.4 and [13, Theorem 4.2] is Θ(|R|2 ). Note that [13, Theorem 5.1] is the special case of Theorem 4.5 where Ψ is the Leader Election Relation. For the case of the anonymous ring, Attiya et al. [5] defined the Symmetry Index to measure the symmetry in an initial configuration (containing only inputs); in contrast, our Asymmetry Index measures asymmetry, while taking identities into account as well. 2 Mathematical Preliminaries Denote N = {0, 1, 2, . . .}, Z+ = {1, 2, 3, . . .}, and [n] = {0, 1, . . . , n − 1} for each integer n ≥ 1. Denote GCD and LCM the functions mapping a set of integers to their Greatest Common Divisor and Least Common Multiple, respectively. We assume a global, possibly infinite set Σ (containing 0 and 1), and we consider a vector x = x0 , x1 , . . . , xn−1 ∈ Σn . λ denotes the empty vector, while x y denotes the concatenation of vectors x and y. With each vector x, we associate a multiset M(x) with the multiplicities of the entries of x. We use the function M to partition Σn into equivalence classes, where all vectors in an equivalence class have the same image under M. Denote X the equivalence class containing the vector x. By abuse of notation, M(X) will denote M(x) for any x ∈ X. 8 For any integer k ∈ [n], the (cyclic) shift σk (x) of vector x is the vector xk , xk+1 , . . . , xk+n−1 , where indices are taken modulo n; so, σk shifts the vector x k places anti-clockwise. The definition can be extended to all integers k in the natural way. The period T(x) of vector x is the least integer k, 0 < k ≤ n, such that σk (x) = x. Say that x is T(x)-periodic; x is aperiodic if T(x) = n, and x is uniperiodic if T(x) = 1. Say that x is eponymous if each entry of x is unique; clearly, an eponymous vector is aperiodic, but not vice versa. Say that x is anonymous if all entries of x are identical; so, a vector is anonymous if and only if it is uniperiodic. Clearly, the period of a vector is invariant under shifting. So, the period captures the degree of circular asymmetry of a vector: the smaller the period, the more circular symmetries the vector has. The following claim proves that the period of a vector is invariant under cyclic shifts. Lemma 2.1 Consider a vector x ∈ Σn . Then, T(x) = T(σk (x)) for every k ∈ N. Proof: Assume, by way of contradiction, that T(x) = T(σk (x)) for some k ∈ N. Without loss of generality, take that T(x) < T(σk (x)). By definition of period, σT(x) (x) = x; so, σk (σT(x) (x)) = σk (x). This implies that σT(x) (σk (x)) = σk (x). It follows that T(σk (x)) ≤ T(x), a contradiction. Lemma 2.2 For each vector x ∈ Σn , and l, m ∈ N, σl (x) = σm (x) if and only if l ≡ m (mod T(x)). Proof: Recall that for any p ∈ N there exists q ∈ N such that p = qT(x) + (p mod T(x)). Thus σp (x) = σqT(x)+(p mod T(x)) (x) = σqT(x) (σp mod T(x) (x)). By repeated application of the definition of period we get that σqT(x) (σp mod T(x) (x)) = σp mod T(x) (x). Hence σp (x) = σp mod T(x) (x). Setting p = l − m we get σl−m (x) = σ(l−m) mod T(x) (x). Assume first that σl (x) = σm (x). Then, σ(l−m) mod T(x) (x) = σl−m (x) = σ−m (σl (x)) = σ−m (σm (x)) = σ0 (x) = x . It follows that (l−m) mod T(x) is a (possibly zero) multiple of T(x). Since (l−m) mod T(x) < T(x), it follows that (l − m) mod T(x) = 0. Hence, l ≡ m (mod T(x)). Assume now that l ≡ m (mod T(x)). Then, σl−m (x) = σ(l−m) mod T(x) (x) = σ0 (x) = x. It follows that σl (x) = σm (x), as needed. ∈ X a min-period vector of X if it minimizes period among all vectors in X. Call a vector x 9 Lemma 2.3 Consider a vector x ∈ Σn . Then, (1) T(x) divides n, and (2) divides T(x). n GCD(M(X)) Proof: For condition (1), note that σ0 (x) = x = σn (x). By Lemma 2.2, 0 ≡ n (mod T(x)) and thus T(x) divides n. For condition (2), note that the multiplicity of every distinct element in x is divided by n . Hence, GCD(M(X)) is also divided by n ; the claim follows. T(x) T(x) Lemma 2.4 For each equivalence class X ⊆ Σn , (1) T( x) = vector x ∈ X, T( x) divides T(x). n , and (2) for each GCD(M(X)) Proof: We construct a vector in X as follows. We partition the elements in X into GCD(M(X)) n . We then fix any ordering on the elements within each chunks each containing GCD(M(X)) n . Concatenating GCD(M(X)) copies of this chunk and construct a vector of size GCD(M(X)) n . By Lemma 2.3, vector we obtain a vector in X, with a period of at most GCD(M(X)) n divides T(x) for each vector x ∈ X. Thus, the constructed vector is a min-period GCD(M(X)) n ; conditions (1) and (2) follow. vector x of X and T( x) = GCD(M(X)) Say that X is aperiodic if each vector x ∈ X is aperiodic; say that X is uniperiodic of if each vector x ∈ X is uniperiodic. Say that X is k-periodic if the min-period vector x X is k-periodic. (So, aperiodic and uniperiodic are identified with n-periodic and 1-periodic, respectively.) Say that X is anonymous if all vectors x ∈ X are anonymous; say that X is n -periodic. Thus eponymous if all vectors x ∈ X are eponymous. Clearly, X is GCD(M(X)) the equivalence class X is aperiodic if and only if GCD(M(X)) = 1; the equivalence class is uniperiodic if and only if GCD(M(X)) = n. We use the standard lexicographical ordering on Σn . We write x ≺ y to mean x y and x = y. Say that x ∈ Σn is shift-minimal if it is minimal (with respect to ) among all shifts of it; in other words, x is shift-minimal if x σk (x) for all k ∈ [n]. For each k ∈ [n + 1], the prefix of order k of x, denoted Pk (x), is given by Pk (x) = x0 , x1 , . . . , xk−1 , with P0 (x) = λ. Clearly, for k < l, Pk (x) ≺ Pk (y) implies that Pl (x) ≺ Pl (y) (and, in particular, x ≺ y). We prove a simple property of shift-minimal vectors: Lemma 2.5 For each shift-minimal vector x ∈ Σn and for each integer m ∈ [n] such that m ≡ 0 (mod T(x)), (1) Pl (x) Pl (σm (x)), and (2) Pl (x) ≺ Pl (σ−m (x)) for all l ∈ [n] with m ≤ l. 10 Proof: For condition (1), consider by way of contradiction m, l ∈ [n] for which Pl (x) Pl (σm (x)). Then Pl (σm (x)) ≺ Pl (x) which immediately implies that σm (x) ≺ x; a contradiction to the fact that x is shift-minimal. For condition (2), consider by way of contradiction m, l ∈ [n] such that m ≡ 0 (mod T(x)), m ≤ l, and Pl (x) ≺ Pl (σ−m (x)). Then, −m ≡ 0 (mod T(x)). From condition (1), we have that Pl (x) Pl (σ−m (x)), and since by assumption Pl (x) ≺ Pl (σ−m (x)), we get that Pl (x) = Pl (σ−m (x)). Since l ≥ m, then Pm (x) = Pm (σ−m (x)). From this and the fact that x ≺ σ−m (x) following from Lemma 2.2, we have that σm (x) ≺ σm (σ−m (x)), or equivalently σm (x) ≺ σ0 (x) = x; a contradiction to the fact that x is shift-minimal. Given two vectors x = x0 , x1 , . . . , xn−1 and y = y0 , y1 , . . . , yn−1 , we denote by x y the vector (x0 , y0 ), (x1 , y1 ), . . . , (xn−1 , yn−1 ); call it the shuffle of x and y. We observe: Lemma 2.6 For each pair of vectors x, y ∈ Σn , T(x y) = LCM(T(x), T(y)). Proof: First observe that σk (x y) = σk (x) σk (y) for any k ∈ N. When k = LCM(T(x), T(y)), σLCM(T(x),T(y)) (x y) = σLCM(T(x),T(y)) (x) σLCM(T(x),T(y)) (y). Since, LCM(T(x), T(y)) ≡ 0 (mod T(x)), and LCM(T(x), T(y)) ≡ 0 (mod T(y)), it follows by Lemma 2.2 that σLCM(T(x),T(y)) (x) = x, and σLCM(T(x),T(y)) (y) = y, and thus σLCM(T(x),T(y)) (x y) = x y. By the same lemma, this implies that T(x y) divides LCM(T(x), T(y)). Now, assume that T(x y) < LCM(T(x), T(y)). Then, either T(x) does not divide T(x y), or T(y) does not divide T(x y), and without loss of generality, let it be the former. By Lemma 2.2 this implies that σT(xy) (x) = x, which implies σT(xy) (x y) = σT(xy) (x) σT(xy) (y) = x y, a contradiction to the definition of period. This proves the claim. A (recursive) relation is a subset Ψ ⊆ Σn ×Σn . For a vector x ∈ Σn , Ψ(x) = {y | (x, y) ∈ Ψ}; every vector y ∈ Ψ(x) is an image of x under Ψ. The set Dom(Ψ) of all vectors x ∈ Σn with at least one image under Ψ is the domain of Ψ; the set of all images of all vectors x ∈ Σn is the image of Ψ, denoted as Im(Ψ). The relation Ψ is total if Dom(Ψ) = Σn . Given two relations Ψ1 , Ψ2 ⊆ Σn × Σn , their composition is the relation Ψ1 ◦ Ψ2 = {(x, y) | (x, z) ∈ Ψ2 and (z, y) ∈ Ψ1 for some z ∈ Σn }. For a relation Ψ ⊆ Σn × Σn , note that σ1 ◦ Ψ = {(x, y) | y = σ1 (z) for some z ∈ Ψ(x)}; note also that Ψ ◦ σ1 = {(x, y) | y ∈ Ψ(z) where z = σ1 (x)}. In other words, for a vector x, σ1 ◦ Ψ(x) = {y | y = σ1 (z) for some z ∈ Ψ(x)} and Ψ ◦ σ1 (x) = {y | y ∈ Ψ(σ1 (x))}. Thus, σ1 ◦ Ψ maps inputs to shifts of their images, while Ψ ◦ σ1 maps inputs to images of their shifts. The relation Ψ is circularly symmetric if σ1 ◦ Ψ ⊆ Ψ ◦ σ1 . Intuitively, in a circularly symmetric relation, shifts of images are always images of shifts. A 11 direct induction implies that σk ◦ Ψ ⊆ Ψ ◦ σk for any circularly symmetric relation Ψ and for all integers k ∈ N. The relation Ψ ⊆ Σn × Σn is aperiodic if each vector in Im(Ψ) is aperiodic; so, each image under Ψ has no circular symmetries. On the other extreme, the relation Ψ ⊆ Σn × Σn is uniperiodic if each vector in Im(Ψ) is uniperiodic; so, each image under Ψ is constant. In the middle, the relation Ψ ⊆ Σn × Σn is k-periodic if each vectors in Im(Ψ) is k-periodic. Thus, n-periodic and 1-periodic relations are precisely the aperiodic and uniperiodic relations, respectively. In the Leader Election Relation LE ⊆ Σn × Σn , the set of images of an input vector x is the set of all vectors with exactly one 1 and n − 1 0’s; 1 and 0 correspond to “elected” and “non-elected”, respectively. Clearly, the Leader Election Relation is both circularly symmetric and aperiodic. We now discuss a generalization of the Leader Election Relation. Consider a function Φ : Σn → {1, 2, . . . , n}. In the Φ-Leader Election Relation Φ-LE ⊆ Σn × Σn , the set of images of an input vector x is the set of all binary output vectors with the number of 1’s between 1 and Φ(x) (both inclusive). The special case where Φ(x) = 1 for all vectors x ∈ Σn is precisely the Leader Election Relation. A Multiple Leader Election Relation is a Φ-Leader Election Relation for some such function Φ. 3 The Partially Eponymous Ring 3.1 General We start with the standard model of an asynchronous, anonymous ring as studied, for example, in [4, 5, 13]. (See also [6, Sections 3.2 & 3.3] for a textbook discussion.) We assume that the ring is oriented and bidirectional. We augment this model so that processors have identities that are neither necessarily all identical, nor necessarily unique. Call it a partially eponymous ring. In the anonymous ring, identities are all identical; in the eponymous ring, identities are unique. A ring R is a cyclic arrangement of |R| identical processors 0, 1, . . . , |R|−1. Processor j has an identity idj and receives an input inj . The identity vector is id = id0 , id1 , . . . , id|R|−1 ; the input vector is in = in0 , in1 , . . . , in|R|−1 . Note that for the anonymous ring, T(id) = 1; for the eponymous ring, T(id) = |R|. The (initial) configuration of the ring R is the pair id, in. Each processor must reach an output outj by running a local algorithm and communicating with its two neighbors. The output vector is out = out0 , out1 , . . . , out|R|−1 . 12 There is a single local algorithm A run by all processors; A is represented as a state machine. Each computation step of A at processor j is dependent on the current state of j, the messages currently received at j and on the local identity idj and input inj . A distributed algorithm A is a collection of local algorithms, one for each processor. We restrict our attention to nonuniform distributed algorithms, where the size of the ring is “hard-wired” into the single local algorithm. So, we consider rings of a certain size n. The distributed algorithm A induces a set of (asynchronous) executions. Each identity vector id ∈ Σn specifies a single ring; by abuse of notation, denote id the specified ring. Naturally, an equivalence class ID ⊆ Σn induces a set of rings, each of size n and corresponding to some particular identity vector id ∈ ID; by abuse of notation, denote by ID the induced set of rings. 3.2 Solvability and Computability Consider a configuration id, in. Say that the distributed algorithm A solves the set of output vectors OU T on the configuration id, in if each execution of A on the ring id with input in results to an output vector out ∈ OU T . Say that the set of output vectors OU T is solvable on the configuration id, in if there is a distributed algorithm A that solves OU T on id, in. Say that the relation Ψ is solvable on the set of rings R if there is a distributed algorithm A such that for each configuration id, in ∈ ID × Dom(Ψ), A solves Ψ(in) on id, in. Say that the distributed algorithm A computes the set of output vectors OU T on the configuration id, in if the following holds: if OU T is solvable on the configuration id, in, then A solves OU T in id, in; else A solves {⊥n } on id, in (an unsolvability output). We now develop the notion of a distributed algorithm working for a set of rings and on the entire domain of the relation Ψ; intuitively, the set of rings represents the “knowledge” that the algorithm requires. Formally, the distributed algorithm A computes the relation Ψ on a set of rings R with g(n) messages if for each configuration id, in ∈ ID × Dom(Ψ), A computes Ψ(in) on the configuration id, in. The relation Ψ is computable on a set of rings R with g(n) messages if there is a distributed algorithm A that computes Ψ on ID with g(n) messages. Note that solvability of a relation Ψ on a set of rings ID implies computability of Ψ on ID (with some number of messages). However, the inverse does not necessarily hold. (Note that this is because there maybe a configuration id, in ∈ ID × Dom(Ψ) such that Ψ(∈) is not solvable on id, in.) 13 3.3 The Asymmetry Index The Asymmetry Index AI(id, in) of a configuration id, in is defined by AI(id, in) = T(id in). For a set of rings ID with a common input vector in, the Min-Period Asymmetry in), where id is the min-period vector Index AI(ID, in) is defined by AI(ID, in) = AI(id, n = of ID. Recall that T(id) . Hence, Lemma 2.6 implies that AI(ID, in) = GCD(M(ID)) n divides T(id) for each ring id ∈ ID. It , T(in) . By Lemma 2.4 (2), T(id) LCM GCD(M(ID)) follows that AI(ID, in) divides LCM(T(id), T(in)) for each ring id ∈ ID. Note that if ID is the set of anonymous rings, then AI(ID, in) = LCM(1, T(in)) = T(in); if ID is the set of eponymous T(in)) ≥ T(in). So, intuitively, the Asymmetry Index is rings, then AI(ID, in) = LCM(T(id), an indicator of computability. The Minimum Asymmetry Index AI(ID, Ψ) of a set of rings ID and a relation Ψ is defined by AI(ID, Ψ) = min{AI(id, in) | id, in ∈ ID × Dom(Ψ)}. 3.4 Views We conclude with a definition that extends a corresponding definition in [26, Section 3] in order to apply to the setting of a ring where processors receive inputs. Given a ring id with input vector in, the view of processor j is viewj (id, in) = σj (id in) = σj (id) σj (in). So, the view of processor j is obtained by traversing the ring in a clockwise direction, starting from processor j and ending at processor j − 1. Clearly, views of processors are cyclic shifts of each other. There is a direct, non-uniform distributed algorithm AGV with message complexity Θ(|R|2 ) that allows each processor to construct its own view on a ring R. Using a typical Lewis Carroll argument [10], it is simple to prove that in a synchronous execution of a distributed algorithm, processors with the same view reach the same output: Lemma 3.1 Consider a ring id with input in and two processors j and k with viewj (id, in) = viewk (id, in). Then, in a synchronous execution of a distributed algorithm with output vector out, outj = outk . 4 4.1 Solvability and Computability Preliminaries We provide a definition of compatibility between a set of output vectors OU T and a configuration id, in. The set of output vectors OU T is compatible with the configuration id, in if there is some output vector out ∈ OU T such that T(out) divides AI(id, in). We prove: 14 Lemma 4.1 Assume that a set of output vectors OU T is solvable on a configuration id, in. Then, OU T is compatible with id, in. Proof: By assumption, there is a distributed algorithm A that solves OU T on id, in. Fix a synchronous execution of A on id, in, and consider the associated vector out ∈ OU T . Recall that viewj (id, in) = σj (id in), so that also viewj+T(idin) (id, in) = σj+T(idin) (id in). By Lemma 2.2, σj (id in) = σj+T(idin) (id in). So viewj (id, in) = viewj+T(idin) (id, in), and Lemma 3.1 implies that outj = outj+T(idin) . Since j was chosen arbitrarily, this implies that σT(idin) (out) = out. By definition of period, Lemma 2.2 implies that T(out) divides T(id in) = AI(id, in), as needed. We now introduce the distributed (non-uniform) algorithm AΨ associated with an arbitrary circularly symmetric relation Ψ ∈ Σn × Σn ; the algorithm is described in Figure 1. AΨ: code for processor j with identity idj and input inj 1: Upon receiving message wake do 2: Construct viewj (id, in) = vidj vinj . \∗ vidj = σj (id) and vinj = σj (in) ∗\ 3: V iewsj [i] := σi (vidj ), σi (vinj ) for each i ∈ [|R|]. 4: Choices := {(x, y, z) | x, y ∈ V iewsj ; z ∈ Ψ(y); T(z) divides AI(x, y)}. 5: 6: If Choices = ∅ then outj := ⊥ and terminate. (a) (x, y, z) := min(Choices), and (b) kj := min{i ∈ [|R|] | V iewsj [i] = x, y}. 7: Set outj to be the first entry of σ−kj (z) and terminate. Figure 1. Algorithm AΨ: code for processor j. Note that the distributed algorithm AΨ does not specify how the views are constructed in Step 2. The views can be constructed by invoking, for example, the distributed algorithm AGV which collects the identities and inputs of processors using n2 messages. Algorithm AGV works by having each processor initiate a message that visits all processors and “collects” all the processor identities and inputs in a clockwise order. Every processor waits to forward the messages coming from all the processors before terminating. The algorithm will eventually terminate and each processor will have its own view of the ring. 15 AGV: code for processor j with identity idj and input inj 1: Upon receiving message wake do 2: received := 0. 3: Send message idj , inj , 1 to right. 4: Upon receiving message ids, ins, k do 5: 6: received := received + 1. If k < |R| then send message ids idj , ins inj , k + 1 to right. 7: If k = |R| then set outj to be ids ins. 8: If received = |R| then terminate. Figure 2. Algorithm AGV: code for processor j. All remaining steps are local. Steps 3–6 enable processors to choose a common output vector, while Step 6 enables processor j to output its individual coordinate in this vector. The set Choices contains all possible candidates for the common output vector. In Step 6, processors use a common function (e.g., min) to single out an output vector from the candidates. We prove: Lemma 4.2 For a configuration id, in, either AΨ solves Ψ(in) on id, in, or AΨ solves {⊥n } on id, in. Proof: Note that the configuration id, in determines the set of views {viewj (id, in) | j ∈ [n]} constructed in Step 2 at processors. Hence, by the algorithm, id, in also determines the set Choices computed at each processor, which is common. We proceed by case analysis: Assume first that Choices = ∅. Then, by the algorithm (Step 5), out = ⊥n . So, in this case AΨ computes {⊥n } on id, in. Assume now that Choices = ∅. We now prove that the chosen triple (x, y, z) from Choices and chosen integer kj (in Step 6) will lead to an output vector that is an image of in under Ψ. Since x and y are corresponding shifts of id and in, there is an index t ∈ [|R|] such that σt (id) = x and σt (in) = y. By the algorithm (Step 4), z ∈ Ψ(y). Hence, σ−t (z) ∈ σ−t ◦ Ψ(y). Since Ψ is a circularly symmetric relation, σ−t ◦ Ψ ⊆ Ψ ◦ σ−t . Hence σ−t (z) ∈ Ψ ◦ σ−t (y). Since σt (in) = y, it follows that Ψ ◦ σ−t (y) = Ψ(in). So, it suffices to prove that the output vector chosen by the processors is σ−t (z). By the choice of kj by the algorithm, x = σkj (σj (id)) = σkj +j (id). Since σt (id) = x, Lemma 2.2 implies that (kj + j) ≡ t (mod T(id)). By the choice of kj by the algorithm, y = σkj (σj (in)) = σkj +j (in). Since σt (in) = y, Lemma 2.2 implies that (kj + j) ≡ 16 t (mod T(in)). Hence, each of T(id) and T(in) divides kj + j − t. Number Theory implies now that LCM(T(id), T(in)) divides kj + j − t, or (kj + j) ≡ t (mod LCM(T(id), T(in))). By the algorithm, T(z) divides AI(x, y) = LCM(T(x), T(y)). Since x and y are cyclic shifts of id and in, respectively, it holds that T(x) = T(id) and T(y) = T(in). It follows that T(z) divides LCM(T(id), T(in)). This implies that (kj + j) ≡ t (mod T(z)), or −kj ≡ j − t (mod T(z)). By Lemma 2.2, σ−kj (z) = σj−t (z) = σj (σ−t (z)). Since processor j chooses the first entry of σ−kj (z) as its output, it chooses the j-th entry of σ−t (z). So, σ−t (z) is the output vector chosen by the processors, and we are done. We remark that the proof of Lemma 4.2 relies on the assumption that Ψ is a circularly symmetric relation. It is not evident whether this is an essential assumption for the partially eponymous ring, although it is known that it is an essential assumption for computing functions on the anonymous ring [5]. 4.2 Main Results Our first result concerns the solvability of an arbitrary (circularly symmetric) relation on an arbitrary set of rings ID. We provide a definition of compatibility between a relation Ψ ⊆ Σn × Σn and a set of rings ID ⊆ Σn . The relation Ψ is compatible with the set of rings ID if for each input vector in ∈ Dom(Ψ), there is some output vector out ∈ Ψ(in) such that T(out) divides AI(ID, in). Recall that AI(ID, in) can be computed efficiently (through its number-theoretic expression). This implies that compatibility can be checked efficiently (in polynomial time). We are now ready to prove: Theorem 4.3 (Partially Eponymous Solvability Theorem) A circularly symmetric relation Ψ is solvable on a set of rings ID if and only if Ψ is compatible with ID. Proof: Assume that Ψ is solvable on ID. By definition of solvability, there is a distributed algorithm A such that for each configuration id, in ∈ ID×Dom(Ψ), A solves the set of vectors in for an arbitrary vector in ∈ Dom(Ψ). Ψ(in) on id, in. So, fix the configuration id, in. By Lemma 4.1, this implies If follows that the set of vectors Ψ(in) is solvable on id, in. By definition of compatibility between a set of output that Ψ(in) is compatible with id, vectors and a configuration, it follows that there is some output vector out ∈ Ψ(in) such 17 in) = AI(ID, in) (by definition of Minimum Asymmetry Index). By that T(out) divides AI(id, definition of compatibility of a relation with a set of rings, this implies the claim. Assume now that Ψ is compatible with ID. By definition of compatibility between a relation and a set of rings, it follows that for each input vector in ∈ Dom(Ψ), there is some output vector out ∈ Ψ(in) such that T(out) divides AI(ID, in). Fix an arbitrary configuration id, in ∈ ID × Dom(Ψ). Recall that AI(ID, in) divides AI(id, in). Hence, it follows that there is some output vector out ∈ Ψ(in) such that T(out) divides AI(id, in). Recall the distributed algorithm AΨ. Clearly, id, in is an entry of V iewsj for each processor j ∈ [n]. Since, out ∈ Ψ(in) and T(out) divides AI(id, in), it follows that (id, in, out) ∈ Choices; so Choices = ∅. By the algorithm AΨ (Step 5), it follows that the algorithm does not solve {⊥n } on id, in. Hence, Lemma 4.2 implies that AΨ solves Ψ(in) on id, in. Since the configuration id, in ∈ ID × Dom(Ψ) was chosen arbitrarily, it follows that Ψ is solvable on ID. Since compatibility is efficiently checkable, Theorem 4.3 provides an efficient characterization of solvability for the partially eponymous ring. We continue to prove: Theorem 4.4 (Partially Eponymous Computability Theorem) The algorithm AΨ computes the circularly symmetric relation Ψ on a set of rings ID. Proof: Fix an arbitrary configuration id, in ∈ ID×Dom(Ψ). We will prove that AΨ computes Ψ(in) on id, in. We proceed by case analysis: Assume first that Ψ(in) is solvable on id, in. By Lemma 4.1 it follows that Ψ(in) is compatible with id, in. By definition of compatibility of a set of output vectors with a configuration, this implies that there is some output vector out ∈ Ψ(in) such that T(out) divides AI(id, in). From the distributed algorithm AΨ, id, in is an entry of V iewsj for each processor j ∈ [n]. Since, out ∈ Ψ(in) and T(out) divides AI(id, in), it follows that (id, in, out) ∈ Choices; so Choices = ∅. By the algorithm AΨ (Step 5), it follows that the algorithm does not solve {⊥n } on id, in. Hence, Lemma 4.2 implies that AΨ solves Ψ(in) on id, in, as needed. Assume now that Ψ(in) is not solvable on id, in. This implies that AΨ does not solve Ψ(in) on id, in. By Lemma 4.2 it follows that AΨ solves {⊥n } on id, in, and we are done. 4.3 Applications The definition of a uniperiodic relation implies that a circularly symmetric, uniperiodic relation is compatible with any set of rings ID. Hence, Theorem 4.3 immediately implies that every 18 circularly symmetric, uniperiodic relation is solvable on any set if rings ID. We now consider aperiodic relations. As a natural application of Theorem 4.3, we prove: Theorem 4.5 (Solvability of Aperiodic Relations) A total, circularly symmetric and aperiodic relation Ψ is solvable on a set of rings ID if and only if ID is aperiodic. Proof: Assume first that the total, circularly symmetric and aperiodic relation Ψ is solvable on the set of rings ID ⊆ Σn . Since Ψ is aperiodic, for each input in ∈ Dom(Ψ), for each output vector out ∈ Ψ(in), T(out) = n. Since Ψ is solvable on the set of rings ID, Theorem 4.3 implies that Ψ is compatible with ID. Fix any constant input vector in ∈ Dom(Ψ). (Such a vector exists since Ψ is total.) Since Ψ is compatible with ID, there is an output vector out ∈ Ψ(in) T(in)) = LCM(T(id), 1) = T(id). such that T(out) divides AI(ID, in) = LCM(T(id), Thus, n divides T(id). By definition of min-period vector, this implies that n ≤ T(id) for each ring id ∈ ID; since T(id) ≤ n, it follows that for each ring id ∈ ID, T(id) = n. So, each id ∈ ID is aperiodic, so that ID is aperiodic, as needed. is aperiodic; Assume now that the set of rings ID is aperiodic. Since ID is aperiodic, id = n. We now prove that Ψ is compatible with ID. Fix an arbitrary input vector thus, T(id) in ∈ Dom(Ψ). Consider an output vector out ∈ Ψ(in). Since Ψ is aperiodic, T(out) = n. Note T(in)) = LCM(n, T(in)) = n (since T(in) divides n). It follows that AI(ID, in) = LCM(T(id), that T(out) = AI(ID, in). Since in was chosen arbitrarily, this implies that Ψ is compatible with ID. Hence, Theorem 4.3 implies that Ψ is solvable on the set of rings ID, as needed. Theorem 4.5 applies to a circularly symmetric and aperiodic relation Ψ with at least one constant vector in Dom(Ψ), even if Ψ is not total. Many relations from the literature assume no inputs, and their domain can be modelled as consisting of a single, constant input vector. So, Theorem 4.5 applies to all such relations. Finally, we remark that we can generalize Theorem 4.5 to prove that a total, circularly symmetric, k-periodic relation is solvable on a set of rings ID if and only if ID is l-periodic for some integer l divisible by k. 5 5.1 Message Complexity Multiple Leader Election as a Tool We present an asynchronous distributed algorithm AMLE(k) with advice k. Here, k is an integer that is available to each processor (e.g., it is “hard-wired” into its local algorithm much in the 19 same way the ring size is in a non-uniform distributed algorithm). k will act as a parameter to AMLE(k): AMLE(k) will satisfy a particular correctness property for certain specific advices k; furthermore, the message complexity of AMLE(k) will depend on k. The algorithm AMLE(k) is similar in spirit to the well-known (neighborhood doubling) asynchronous distributed algorithm of Hirschberg and Sinclair [15] that computes Leader Election on the eponymous ring R. (Recall that the algorithm of Hirschberg and Sinclair uses O(|R| · lg |R|) messages.) So, each processor explores neighborhoods around it whose size doubles in each phase; in phase r, the processor collects identities of other processors in the neighborhood that are 2r to the left (counterclockwise) of it, or 2r+1 − 1 to the right (clockwise) of it. It then uses these identities to locally compute the prefixes of length 2r of the views of all processors that are 2r to the left or to the right of it. Then, the processor compares the prefix of length 2r of its own view to those prefixes it has computed; it survives the phase (so that it can proceed to the next phase) if and only if its own prefix is the lexicographically least among all 2r+1 prefixes of the views of its neighbors that it has computed. Note that by Step 21, r ≤ lg k − 1. Also, note that the major difference between our algorithm for the partially eponymous ring and the classical algorithm of Hirschberg and Sinclair to compute Leader Election on the eponymous ring is that our algorithm awards processors to proceed to the next phase on the basis of the computed prefixes of processors’ views (which change across phases), as opposed to processors’ identities (that remain constant across phases). Note that the lexicographic ordering provides the property that views and their corresponding prefixes are consistently ordered. Hence, the comparison of prefixes in Step 20 is essentially a comparison of views (hence, an efficient one since it avoids the full construction of views). This is an essential feature of our algorithm, and its achieved message efficiency is due to this feature. The distributed algorithm AMLE(k) appears in pseudocode in Figure 3. We proceed to prove certain message complexity and correctness properties of the algorithm AMLE(k). We start with a simple fact: Lemma 5.1 Consider all labels labell , where l ∈ [n], computed in Step 19 during phase r of AMLE(k). Fix a processor j ∈ [n]. Then, (1) labelj = P2r (viewj (id, in)), and (2) the checked condition at processor j in Step 20 holds if and only if for each i ∈ [2r ], labelj ≺ labelj−(2r −i) and labelj labelj+(i+1) . Proof: Upon receiving reply, s, r, d from right (in Step 14) such that d = 2r+1 − 1 (condition in Step 16), segmentj := P3·2r−1 (viewj−2r (id, in)) = P3·2r−1 (σ−2r (viewj (id, in))) in Step 18, and labelj := P2r (viewj (id, in)) in Step 19. By Step 20 of the algorithm, these imply that 20 AMLE(k): code for processor j with identity idj and input inj Initially, labelj = segmentj = lef t segmentj = right segmentj = λ. 1: Upon receiving message wake do 2: Send message probe, 0, 1 to left. 3: Upon receiving message probe, r, d from right do 4: 5: If d < 2r then send message probe, r, d + 1 to left. If d = 2r then send message reply, (idj , inj ), r, 1 to right. 6: Upon receiving message reply, s, r, d from left do 7: If d < 2r then send message reply, s (idj , inj ), r, d + 1 to right. 8: 9: 10: If d = 2r then do lef t segmentj := s. Send message probe, r, 1 to right. 11: Upon receiving message probe, r, d from left do 12: If d < 2r+1 − 1 then send message probe, r, d + 1 to right. 13: If d = 2r+1 − 1 then send message reply, (idj , inj ), r, 1 to left. 14: Upon receiving message reply, s, r, d from right do 15: If d < 2r+1 − 1 then send message reply, (idj , inj ) s, r, d + 1 to left. 16: 17: If d = 2r+1 − 1 then do right segmentj := s. 18: 19: segmentj := lef t segmentj (idj , inj ) right segmentj . labelj := P2r (σ2r (segmentj )). 20: If labelj ≺ P2r (σi (segmentj )) and labelj P2r (σ2r +i+1 (segmentj )), for all i ∈ [2r ] then do 21: If 2r+1 ≥ k then terminate as a leader. 22: 23: Else send message probe, r + 1, 1 to left. Else terminate as a non-leader. Figure 3. Algorithm AMLE(k): code for processor j. 21 processor j moves to phase r + 1 (in Step 22) if and only if for every i ∈ [2r ], labelj = P2r (viewj (id, in)) ≺ P2r (σi (segmentj )) = P2r (σi (P3·2r−1 (σ−2r (viewj (id, in))))) = P2r (σ−(2r −i) (viewj (id, in))) = P2r (viewj−(2r −i) (id, in)) = labelj−(2r −i) (the identity of processor j − (2r − i) in phase r) and labelj = P2r (viewj (id, in)) P2r (σ2r +(i+1) (segmentj )) = P2r (σ2r +(i+1) (P3·2r−1 (σ−2r (viewj (id, in))))) = P2r (σi+1 (viewj (id, in))) = P2r (viewj+(i+1) (id, in)) = labelj+(i+1) (the identity of processor j + (i + i) in phase r) Thus, for each for each i ∈ [2r ], labelj ≺ labelj−(2r −i) and labelj labelj+(i+1) , as needed. Using an analysis similar to the analysis of the message complexity for the algorithm of Hirschberg and Sinclair [15], we prove an upper bound on the message complexity of the distributed algorithm AMLE(k). Proposition 5.2 Algorithm AMLE(k) uses O(|R| · lg k) messages on the ring R. Proof: Clearly, the two conditions checked in Step 20 cannot simultaneously hold for any processor in the 2r -neighborhood of processor j when they are simultaneously holding for j. |R| This implies that at most 2r + 1 processors proceed to phase r + 1. By Step 21, the algorithm executes for phases 0 to lg k − 1. At phase r, each non-terminated processor initiates less right). The than 6 · 2r messages (2 · 2r to its left and 2 · (2r+1 − 1) to its total number of lg k−1 |R| · 6 · 2r = 6|R| + messages (with 6|R| messages from phase 0) is 6|R| + r=1 r−1 + 1 2 lg k−1 1 − 2r−11 +1 = O(|R| · lg k), as needed. 12|R| r=1 We continue with a correctness property of the algorithm AMLE(k) for specific advices k. Fix a set of rings ID ⊆ Σn . Consider the function ΦID that maps Σn to {1, 2, . . . , n} as follows: 2n for each input vector in ∈ Σn . We now prove: ΦID (in) = AI(ID, in) 22 Proposition 5.3 Consider a configuration id, in ∈ ID× Σn . Then, the distributed algorithm AMLE(k) with advice k, 1 ≤ k ≤ AI(ID, in) solves the set of output vectors ΦID -LE(in) on id, in. Proof: We first establish that at least one processor will be elected as a leader. Consider a processor j with the least (under the lexicographic ordering) view. Since each shift of viewj (id, in) is the view of some processor, it follows that viewj (id, in) is shift-minimal. Consider a phase r ≤ lg k − 1 ≤ lg AI(ID, in) − 1 ≤ lg LCM(T(id), T(in)) − 1 and a parameter i ∈ [2r ]; we will examine the processors j − (2r − i) and j + (i + 1) in the left and right part of the 2r -neighborhood of processor j. • Clearly, i + 1 ≡ 0 (mod LCM(T(id), T(in))). Use Lemma 2.5 with viewj (id, in) for x; clearly, T(x) = LCM(T(id), T(in)). Since viewj (id, in) is shift-minimal, the assumption of Lemma 2.5 holds. Choose i + 1 for m; since i + 1 ≡ 0 (mod LCM(T(id), T(in))), condition (1) holds. Choose 2r for l. Lemma 2.5 implies that P2r (viewj (id, in)) P2r (σi+1 (viewj (id, in))) = P2r (viewj+(i+1) (id, in)). By Lemma 5.1 (condition (1)), this implies that labelj labelj+(i+1) . • Clearly, 1 ≤ 2r − i < LCM(T(id), T(in)), so that −(2r − i) ≡ 0 (mod LCM(T(id), T(in))). Use Lemma 2.5 with viewj (id, in) for x; clearly, T(x) = LCM(T(id), T(in)). Since viewj (id, in) is shift-minimal, the assumption of Lemma 2.5 holds. Choose 2r − i for m; since −(2r − i) ≡ 0 (mod LCM(T(id), T(in))), condition (2) holds. Choose 2r for l. Lemma 2.5 implies that P2r (viewj (id, in)) ≺ P2r (σ−(2r −i) (viewj (id, in))) = P2r (viewj−(2r −i) (id, in)). By Lemma 5.1(condition (1)), this implies that labelj ≺ labelj−(2r −i) . By Lemma 5.1 (condition (2)), it now follows that the checked condition at processor j in Step 20 holds for the arbitrary phase r. Hence, processor j will survive until the last phase and become a leader. 2n processors will be elected as leaders. AI(ID, in) Consider the last phase r. Clearly, the two conditions checked in Step 20 cannot simultaneously We now establish that at most ΦID (in) = hold for any processor in the 2r -neighborhood of processor j when they are simultaneously holding for j. Since these conditions are simultaneously holding for all elected leaders, it follows that there are at most 2r n+ 1 leaders. Recall that for the last phase r, 2r+1 ≥ k (by Step 21). Thus, there are at most 2n leaders, as needed. k 5.2 A Universal Upper Bound on Message Complexity for Computability Recall that we only have established correctness guarantees for the algorithm AMLE(k) in the case where k ≤ AI(ID, in) on configuration id, in. So, if algorithm AMLE(k) is to be used for 23 electing a (non-zero) number of leaders, such an appropriate advice k must be “known” to the processors. This raises the natural question of what the value of such advice k is with respect to the message complexity of computing an arbitrary (circularly symmetric) relation. Recall that an arbitrary (circularly symmetric) relation Ψ ⊆ Σn × Σn is computable on an arbitrary set of rings R ⊆ Σn with O(n2 ) messages (Theorem 4.4). We prove: Theorem 5.4 (Partially Eponymous Message Complexity Theorem) The circularly symmetric relation Ψ is computable on a set of rings ID 2 n + n · lg AI(ID, Ψ) messages. O AI(ID, Ψ) with Proof: Here is a distributed algorithm A (which is an instantiation of AΨ) to compute Ψ on ID with that many messages. Consider an arbitrary configuration id, in ∈ ID × Σn . The algorithm A proceeds as follows: • On top, the distributed algorithm AΨ (see Figure 1) is invoked to compute Ψ on ID. Step 2 is implemented by the following steps: – First, the processors run the distributed algorithm AMLE(k) with advice k = AI(ID, Ψ) ≤ AI(ID, in) using O (n · lg AI(ID, Ψ)) messages (by 5.2); by Proposition 5.3, Proposition n leaders. there are now elected at least 1 and at most O AI(ID, Ψ) 4) to collect their views, – All elected leaders A GV (see Section run the algorithm 2 n n ·n = O messages. Then, the leaders for a total of O AI(ID, Ψ) AI(ID, Ψ) n ·n = communicate the collected views to all processors for a total of O AI(ID, Ψ) n2 messages. Now, each processor locally derives its view, which it O AI(ID, Ψ) returns to top. So, the message complexity of the distributed algorithm is O n2 + n · lg AI(ID, Ψ) , AI(ID, Ψ) as needed. 5.3 Applications For which sets of rings R is the upper bound on message complexity from Theorem 5.4 low? We identify two such classes of sets. 24 Say that a set of rings ID ⊆ Σn is universal if Leader Election is solvable on ID. Clearly, every (circularly symmetric) relation is solvable on a universal set of rings. Recall that Leader Election is both circularly symmetric and aperiodic. Hence, Theorem 4.5 implies that ID is aperiodic. Thus, for each id, in ∈ ID × Dom(LE), AI(id, in) = n. Hence, AI(ID, LE) = min{AI(id, in) | id, in ∈ ID × Dom(LE)} = n. Theorem 5.4 now immediately implies: Theorem 5.5 (Message Complexity on Universal Set of Rings) The circularly symmetric relation Ψ is computable on a universal set of rings ID with O(n · lg n) messages. Consider an arbitrary circularly symmetric relation Ψ. Consider a ring id ∈ Σn where each identity has multiplicity at most lg n; call it a logarithmic ring. The corresponding set of rings ID will be called a logarithmic set of rings. Lemma 2.4 (condition (1)) implies n in) = = ≥ n . Hence, for each input vector in ∈ Dom(Ψ), AI(id, that T(id) lg n GCD(M(ID)) T(in)) ≥ n . This implies that AI(ID, Ψ) ≥ n . Since, AI(ID, Ψ) ≤ n, TheoLCM(T(id), lg n lg n rem 5.4 immediately implies: Theorem 5.6 (Message Complexity on Logarithmic Set of Rings) The circularly symmetric relation Ψ is computable on a logarithmic set of rings ID with O(n · lg n) messages. We can obtain additional upper bounds on the message complexity of computing a circularly symmetric relation by further generalizing Theorem 5.6. Towards this end, we generalize the definition of a logarithmic set of rings to a set of rings with an upper bound K on the multiplicity of each identity in any ring from the set. The corresponding upper bound on message complexity is O(n · max{K, lg n}). 6 Epilogue We presented a comprehensive study of solvability, computability and message complexity for the partially eponymous ring. Several interesting questions remain. For example, is there a matching lower bound to the universal upper bound on message complexity from Theorem 5.4? Can we characterize the class of sets of rings of size n for which this (universal) upper bound becomes O(n · lg n)? (By Theorems 5.5 and 5.6, this class contains all universal and logarithmic sets of rings.) Finally, a challenging task is to extend our theory for the partially eponymous ring to other network architectures (such as hypercubes and tori). 25 Acknowledgements. [6, Exercise 3.3] is asking whether Leader Election is solvable on a set of rings where all but one processor have the same identity. That exercise triggered the present work. 26 References [1] N. Allenberg-Navony, A. Itai and S. Moran, “Average and Randomized Complexity of Distributed Problems,” SIAM Journal on Computing, Vol. 25, No. 6, pp. 1254–1267, December 1996. [2] D. Angluin, “Local and Global Properties in Networks of Processors,” Proceedings of the 12th Annual ACM Symposium on Theory of Computing, pp. 82–93, May 1980. [3] H. Attiya and Y. Mansour, “Language Complexity on the Synchronous Anonymous Ring,” Theoretical Computer Science, Vol. 53, No. 3, pp. 167–185, August 1987. [4] H. Attiya and M. Snir, “Better Computing on the Anonymous Ring,” Journal of Algorithms, Vol. 12, No. 2, pp. 204–238, June 1991. [5] H. Attiya, M. Snir and M. Warmuth, “Computing on an Anonymous Ring,” Journal of the ACM, Vol. 35, No. 4, pp. 845–875, October 1988. [6] H. Attiya and J. L. Welch, Distributed Computing: Fundamentals, Simulations, and Advanced Topics, Second Edition, John Wiley and Sons, Inc., 2004. [7] P. Boldi and S. Vigna, “Computing Anonymously with Arbitrary Knowledge,” Procedings of the 18th Annual ACM Symposium on Principles of Distributed Computing, pp. 181–188, May 1999. [8] P. Boldi and S. Vigna, “An Effective Characterization of Computability in Anonymous Networks,” Proceedings of the 15th International Symposium on Distributed Computing, Vol. 2180, pp. 33–47, LNCS, Springer-Verlag, October 2001. [9] J. E. Burns, “A Formal Model for Message Passing Systems,” Technical Report TR-91, Department of Computer Science, Indiana University, September 1980. [10] L. Carroll, Through the Looking Glass, and What Alice Found There, Macmillan, 1872. [11] P. Duris and Z.Galil, “Two Lower Bounds in Asynchronous Distributed Computation,” Journal of Computer and System Sciences, Vol. 42, pp. 245–266, June 1991. [12] F. Fich and E. Ruppert, “Hundreds of Imposssibility Results for Distributed Computing,” Distributed Computing, Vol. 16, No. 2-3, pp. 121–163, September 2003. [13] P. Flocchini, E. Kranakis, D. Krizanc, F. L. Luccio and N. Santoro, “Sorting and Election in Anonymous Asynchronous Rings,” Journal of Parallel and Distributed Computing, Vol. 64, No. 2, pp. 254–265, February 2004. 27 [14] L. Higham and T. M. Przytycka, “A Simple, Efficient Algorithm for Maximum Finding on Rings,” Information Processing Letters, Vol. 58, No. 6, pp. 319–324, June 1996. [15] D. Hirschberg and J. B. Sinclair, “Decentralized Extrema-Finding in Circular Configurations of Processes,” Communications of the ACM, Vol. 23, No. 11, pp. 627–628, November 1980. [16] A. Itai and M. Rodeh, “Symmetry Breaking in Distributed Networks,” Information and Computation, Vol. 88, No. 1, pp. 60–87, September 1990. [17] R. E. Johnson and F. B. Schneider, “Symmetry and Similarity in Distributed Systems,” Proceedings of the 4th Annual ACM Symposium on Principles of Distributed Computing, pp. 13-22, August 1985. [18] E. Kranakis, D. Krizanc and F. Luccio, “On Recognizing a String on an Anonymous Ring,” Theory of Computing Systems, Vol. 34, No. 1, pp. 3–12, January 2001. [19] E. Kranakis, D. Krizanc and J. van den Berg, “Computing Boolean Functions on Anonymous Networks,” Proceedings of the 17th International Colloquium on Automata, Languages and Programming, LNCS, Vol. 443, Springer-Verlag, pp. 254–267, July 1990. [20] S. Moran and M. K. Warmuth, “Gap Theorems for Distributed Computation,” SIAM Journal on Computing, Vol. 22, No. 2, pp. 379–394, April 1993. [21] G. LeLann, “Distributed Systems - Towards a Formal Approach,” Information Processing 77, Proceedings of the IFIP Congress, pp. 155–160, 1977. [22] N. Sakamoto, “Comparison of Initial Conditions for Distributed Algorithms on Anonymous Networks,” Proceedings of the 18th Annual ACM Symposium on Principles of Distributed Computing, pp. 173-179, May 1999. [23] M. Yamashita and T. Kameda, “Computing on Anonymous Networks, Part I: Characterizing the Solvable Cases,” IEEE Transactions on Parallel and Distributed Systems, Vol. 7, No. 1, pp. 69–89, January 1996. [24] M. Yamashita and T. Kameda, “Computing on Anonymous Networks, Part II: Decision and Membership Problems,” IEEE Transactions on Parallel and Distributed Systems, Vol. 7, No. 1, pp. 90–96, January 1996. [25] M. Yamashita and T. Kameda, “Computing Functions on Asynchronous Anonymous Networks,” Mathematical Systems Theory, Vol. 29, No. 4, pp. 331–356, July/August 1998. Erratum in Theory of Computing Systems, Vol. 31, No. 1, pp. 109, January 1998. 28 [26] M. Yamashita and T. Kameda, “Leader Election Problem on Networks in Which Processor Identity Numbers are not Distinct,” IEEE Transactions on Parallel and Distributed Systems, Vol. 10, No. 9, pp. 878–887, September 1999. 29
© Copyright 2026 Paperzz