Lecture Notes in Computer Science Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen TU Dortmund University, Germany Madhu Sudan Microsoft Research, Cambridge, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max Planck Institute for Informatics, Saarbruecken, Germany
6796
Adrian Kosowski Masafumi Yamashita (Eds.)
Structural Information and Communication Complexity 18th International Colloquium, SIROCCO 2011 Gda´nsk, Poland, June 26-29, 2011 Proceedings
13
Volume Editors Adrian Kosowski INRIA, Bordeaux Sud-Ouest Research Center 351 cours de la Libération, 33400 Talence cedex, France E-mail:
[email protected] Masafumi Yamashita Kyushu University Department of Computer Science and Communication Engineering 744, Motooka, Fukuoka, 819-0395, Japan E-mail:
[email protected]
ISSN 0302-9743 e-ISSN 1611-3349 e-ISBN 978-3-642-22212-2 ISBN 978-3-642-22211-5 DOI 10.1007/978-3-642-22212-2 Springer Heidelberg Dordrecht London New York Library of Congress Control Number: 2011930410 CR Subject Classification (1998): F.2, C.2, G.2, E.1 LNCS Sublibrary: SL 1 – Theoretical Computer Science and General Issues
© Springer-Verlag Berlin Heidelberg 2011 This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India Printed on acid-free paper Springer is part of Springer Science+Business Media (www.springer.com)
Preface
The 18th Colloquium on Structural Information and Communication Complexity (SIROCCO 2011) took place during June 26–29, 2011 in Gdansk, Poland. SIROCCO is devoted to the study of communication and knowledge in distributed systems from both the qualitative and quantitative viewpoints. Special emphasis is given to innovative approaches and fundamental understanding, in addition to efforts to optimize current designs. The typical areas include distributed computing, communication networks, game theory, parallel computing, social networks, mobile computing (including autonomous robots), peer-to-peer systems, communication complexity, fault-tolerant graph theories, and randomized/probabilistic issues in networks. This year, 57 papers were submitted in response to the call for papers, and for each paper, its scientific and presentation quality was evaluated by at least three reviewers. The Program Committee selected 1 survey and 24 regular papers for presentation at the colloquium and publication in this volume, after in-depth discussion. The SIROCCO Prize for Innovation in Distributed Computing was given to David Peleg (Weizmann Institute of Science) this year for his many and important innovative contributions to distributed computing. These contributions include local computing, robot computing, and the design and analysis of dynamic monopolies, sparse spanners, and compact routing and labeling schemes. Responding to our request, David Peleg gave an invited talk. The Program Committee also invited Colin Cooper (King’s College London) as an invited speaker. These two invited talks are included in this volume. We would like to express our appreciation to the invited speakers, the authors of all the submitted papers, the Program Committee members, and the external reviewers. We also express our gratitude to the SIROCCO Steering Committee, and in particular to Pierre Fraigniaud for his invaluable support throughout the preparation of this event. We are also grateful to the organizing team from the Gdansk University of Technology (ETI Faculty), and the Publicity Chair David Ilcinkas. We gratefully acknowledge the financial support of the Gdansk University of Technology, and the resources provided free of charge by Sphere Research Labs. Finally, we acknowledge the use of the EasyChair system for handling the submission of papers, managing the review process, and generating these proceedings. June 2011
Adrian Kosowski Masafumi Yamashita
Conference Organization
Program Committee Amotz Bar-Noy J´er´emie Chalopin Wei Chen Leszek Gasieniec Sun-Yuan Hsieh Taisuke Izumi Ralf Klasing Adrian Kosowski Zvi Lotker Bernard Mans Alberto Marchetti-Spaccamela Mikhail Nesterenko Jung-Heum Park Andrzej Pelc Joseph Peters Andrzej Proskurowski Sergio Rajsbaum Christian Scheideler Ichiro Suzuki Masafumi Yamashita
City University of New York CNRS and Aix Marseille University Microsoft Research Asia University of Liverpool National Cheng Kung University Nagoya Institute of Technology CNRS and University of Bordeaux INRIA Bordeaux Sud-Ouest Ben-Gurion University Macquarie University University of Rome “La Sapienza” Kent State University The Catholic University of Korea University of Qu´ebec in Outaouais Simon Fraser University University of Oregon Universidad Nacional Autonoma de Mexico University of Paderborn University of Wisconsin at Milwaukee Kyushu University
Steering Committee Tınaz Ekim Pascal Felber Paola Flocchini Pierre Fraigniaud Lefteris Kirousis Rastislav Kr´aloviˇc Evangelos Kranakis Danny Krizanc Shay Kutten Bernard Mans Boaz Patt-Shamir David Peleg Nicola Santoro Alex Shvartsman Pavlos Spirakis ˇ Janez Zerovnik
Bogazi¸ci University University of Neuchˆatel University of Ottawa CNRS and University Paris Diderot University of Patras Comenius University Carleton University Wesleyan University Technion Macquarie University Tel Aviv University Weizmann Institute Carleton University University of Connecticut CTI and University of Patras University of Ljubljana
VIII
Conference Organization
Additional Reviewers Luca Becchetti Xiaohui Bei Petra Berenbrink Vincenzo Bonifaci Peter Boothe Chun-An Chen Chia-Wen Cheng David Coudert Jurek Czyzowicz Shantanu Das Bilel Derbel Yoann Dieudonn´e Robert Elsaesser Paola Flocchini Josep F`abrega Frantisek Galcik Cyril Gavoille Emmanuel Godard Won Sin Hong Martina H¨ ullmann
Tomoko Izumi Emmanuel Jeandel Colette Johnen Hyunwoo Jung Sayaka Kamei Chi-Ya Kao Yoshiaki Katayama Hee-Chul Kim Jae-Hoon Kim Sook-Yeon Kim Sebastian Kniesburges Andreas Koutsopoulos L ukasz Kuszner Oh-Heum Kwon Arnaud Labourel Hyeong-Seok Lim Laszlo Liptak Zhenming Liu Aleardo Manacero Euripides Markou
Russell Martin Alessia Milani Luca Moscardelli Alfredo Navarra Nicolas Nisse Rizal Nor Fukuhito Ooshita Merav Parter Igor Potapov Tomasz Radzik Adele Rescigno Chan-Su Shin Cheng-Yen Tsai Yann Vax`es Chia-Chen Wei Tai-Lung Wu Yukiko Yamauchi Tai-Ling Ye Jialin Zhang
Organizers Institutional organizer
Gda´ nsk University of Technology
Cooperating institutions
INRIA Bordeaux Sud-Ouest Sphere Research Labs Sp. z o.o.
Organizing team
Robert Janczewski Adrian Kosowski L ukasz Kuszner Michal Malafiejski Dominik Pajak Zuzanna Stamirowska
Table of Contents
Invited Talks Random Walks, Interacting Particles, Dynamic Networks: Randomness Can Be Helpful . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Colin Cooper SINR Maps: Properties and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . David Peleg
1
15
Survey Talk A Survey on Some Recent Advances in Shared Memory Models . . . . . . . . Sergio Rajsbaum and Michel Raynal
17
Fault Tolerance Consensus vs. Broadcast in Communication Networks with Arbitrary Mobile Omission Faults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Emmanuel Godard and Joseph Peters
29
Reconciling Fault-Tolerant Distributed Algorithms and Real-Time Computing (Extended Abstract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Heinrich Moser and Ulrich Schmid
42
Self-stabilizing Hierarchical Construction of Bounded Size Clusters . . . . . Alain Bui, Simon Clavi`ere, Ajoy K. Datta, Lawrence L. Larmore, and Devan Sohier
54
The Universe of Symmetry Breaking Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . Damien Imbs, Sergio Rajsbaum, and Michel Raynal
66
Routing Determining the Conditional Diagnosability of k -Ary n-Cubes under the MM* Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sun-Yuan Hsieh and Chi-Ya Kao Medium Access Control for Adversarial Channels with Jamming . . . . . . . Lakshmi Anantharamu, Bogdan S. Chlebus, Dariusz R. Kowalski, and Mariusz A. Rokicki
78
89
X
Table of Contents
Full Reversal Routing as a Linear Dynamical System . . . . . . . . . . . . . . . . . Bernadette Charron-Bost, Matthias F¨ ugger, Jennifer L. Welch, and Josef Widder
101
Partial is Full . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bernadette Charron-Bost, Matthias F¨ ugger, Jennifer L. Welch, and Josef Widder
113
Mobile Agents/Robots (I) Convergence with Limited Visibility by Asynchronous Mobile Robots . . . Branislav Katreniak Energy-Efficient Strategies for Building Short Chains of Mobile Robots Locally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Philipp Brandes, Bastian Degener, Barbara Kempkes, and Friedhelm Meyer auf der Heide Asynchronous Mobile Robot Gathering from Symmetric Configurations without Global Multiplicity Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sayaka Kamei, Anissa Lamani, Fukuhito Ooshita, and S´ebastien Tixeuil
125
138
150
Mobile Agents/Robots (II) Gathering Asynchronous Oblivious Agents with Local Vision in Regular Bipartite Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Samuel Guilbault and Andrzej Pelc
162
Gathering of Six Robots on Anonymous Symmetric Rings . . . . . . . . . . . . . Gianlorenzo D’Angelo, Gabriele Di Stefano, and Alfredo Navarra
174
Tight Bounds for Scattered Black Hole Search in a Ring . . . . . . . . . . . . . . J´er´emie Chalopin, Shantanu Das, Arnaud Labourel, and Euripides Markou
186
Improving the Optimal Bounds for Black Hole Search in Rings . . . . . . . . . Balasingham Balamohan, Paola Flocchini, Ali Miri, and Nicola Santoro
198
Probabilistic Methods The Cover Times of Random Walks on Hypergraphs . . . . . . . . . . . . . . . . . Colin Cooper, Alan Frieze, and Tomasz Radzik
210
Routing in Carrier-Based Mobile Networks . . . . . . . . . . . . . . . . . . . . . . . . . . Bronislava Brejov´ a, Stefan Dobrev, Rastislav Kr´ aloviˇc, and Tom´ aˇs Vinaˇr
222
Table of Contents
On the Performance of a Retransmission-Based Synchronizer . . . . . . . . . . Thomas Nowak, Matthias F¨ ugger, and Alexander K¨ oßler
XI
234
Distributed Algorithms on Graphs Distributed Coloring Depending on the Chromatic Number or the Neighborhood Growth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Johannes Schneider and Roger Wattenhofer
246
Multiparty Equality Function Computation in Networks with Point-to-Point Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Guanfeng Liang and Nitin Vaidya
258
Network Verification via Routing Table Queries . . . . . . . . . . . . . . . . . . . . . . Evangelos Bampas, Davide Bil` o, Guido Drovandi, Luciano Gual` a, Ralf Klasing, and Guido Proietti
270
Social Context Congestion Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vittorio Bil` o, Alessandro Celi, Michele Flammini, and Vasco Gallotti
282
Ad-hoc Networks Network Synchronization and Localization Based on Stolen Signals . . . . . Christian Schindelhauer, Zvi Lotker, and Johannes Wendeberg Optimal Time Data Gathering in Wireless Networks with Omni–Directional Antennas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jean–Claude Bermond, Luisa Gargano, Stephane Per´ennes, Adele A. Rescigno, and Ugo Vaccaro Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
294
306
319
Random Walks, Interacting Particles, Dynamic Networks: Randomness Can Be Helpful Colin Cooper Department of Informatics, King’s College, London, U.K.
1
Introduction
The aim of this article is to discuss some applications of random processes in searching and reaching consensus on finite graphs. The topics covered are: Why random walks?, Speeding up random walks, Random and deterministic walks, Interacting particles and voting, Searching changing graphs. As an introductory example consider the self-stabilizing mutual exclusion algorithm of Israeli and Jalfon [35], based on the random walk of tokens on a graph G. Initially each vertex emits a token which makes a random walk on G. On meeting at a vertex, tokens coalesce. Provided the graph is connected, and not bipartite, eventually only one token will remain, and the vertex with the token has exclusive access to some resource. The token makes a random walk on G, so in the long run it will visit all vertices of G. Typical questions are: how long before only one token remains (coalescence time), how long before every vertex has been visited by the token (cover time), what proportion of the time does each vertex have the token in the long run (stationary distribution of the random walk), how long before the walk approaches the stationary distribution (mixing time), how long before the number of visits to each vertex approximates the frequency given by the stationary distribution (blanket time). If these quantities can be understood and manipulated, then we can tune the random walk to perform efficiently on a given network. For example, in Fair Circulation of a Token [33], the transition probability of the walk is modified, so that each vertex has the same probability of holding the token in the long run, i.e. the stationary distribution is uniform. The questions asked in [33] are, how can this modification be achieved, and what is its effect on the quantities above. The walk proposed in [34] is reversible, so the relationship between the the blanket and cover times holds (see (1), below). Thus after a time of the order of the coalescence time plus cover time, all vertices get an acceptable share of the token. The aim is to choose transition probabilities for the walk which minimize coalescence and cover time subject to the fairness condition.
2
Terminology
There is a substantial literature dealing with discrete random walks. For an overview see e.g. [2,40]. We review some definitions and results. A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 1–14, 2011. c Springer-Verlag Berlin Heidelberg 2011
2
C. Cooper
Given a graph G = (V, E), let |V | = n, |E| = m, and let d(v) = dG (v) denote the degree of vertex v for all v ∈ V . A simple random walk Wv = (Wv (t), t = 0, 1, . . .) is defined as follows: Wv (0) = v and given x = Wv (t), Wv (t + 1) is a randomly chosen neighbour of x. A simple random walk on a graph G defines a Markov chain on the vertices V . If G is a finite, connected and non-bipartite graph, then this chain has a stationary distribution π given by (t) (t) π(v) = dG (v)/(2|E|). Thus if Pv (w) = Pr(Wv (t) = w), then limt→∞ Pv (w) = π(w), independent of the starting vertex v. A weighted random walk, assumes each undirected edge e = {u, v} has a weight (or conductance) we = wv,u = wu,v. Thus we = 1/re , where re is resistance of the edge. The vertex weight wv = u∈N(v) wv,u , and the transition probability of the random walk at v is p(v, u) = wv,u /wv = we /wv . The total weight of the network is w = edges e we , each edge being counted at each vertex. The stationary distribution of the walk, for vertices is π(v) = wv /w, and for directed transitions e = (u, v), π(e) = we /w. For simple walks, wu,v = ru,v = 1, wv = d(v) the degree of vertex v, and p(u, v) = 1/d(v); the total weight w = 2m, and so π(v) = d(v)/2m and π(e) = 1/2m. A Markov chain is reversible if π(u)p(u, v) = π(v)p(v, u). For a weighted walk and edge e = {u, v}, as π(u)p(u, v) = we /w = π(v)p(v, u), weighted walks are always reversible. Its fair to say that reversible random walks are usually easier to analyze than non-reversible walks. Examples of non-reversible walks are walks on digraphs and Google page rank computation. Cover Time. For v ∈ V let Cv be the expected time taken for a random walk W on G starting at v, to visit every vertex of G. The vertex cover time C(G) of G is defined as C(G) = maxv∈V Cv . Cover Time of a simple random walk. The vertex cover time of simple random walks on connected graphs has been extensively studied. It is a classic result of Aleliunas, Karp, Lipton, Lov´ asz and Rackoff [4] that C(G) ≤ 2m(n−1). It was shown by Feige [27], [28], that for any connected graph G, the cover time 4 3 satisfies (1 − o(1))n log n ≤ C(G) ≤ (1 + o(1)) 27 n . As an example of a graph achieving the lower bound, the complete graph Kn has cover time determined by the Coupon Collector problem. The lollipop graph consisting of a path of length n/3 joined to a clique of size 2n/3 gives the asymptotic upper bound for the cover time. Blanket Time. Let Nv (t) be the number of times a random walk visits vertex v in t steps. Then for a walk in stationarity, ENv (t) = tπv . The blanket time τB (δ) is the first t ≥ 1 such that for all vertices u, v ∈ V Nu (t)/π(u) ≥ δ. Nv (t)/π(v) Let tB (G, δ) = maxv∈V Ev τB (δ), then Ding, Lee and Peres [21] prove that for any reversible random walk and 0 < δ < 1 tB (G, δ) = A(δ)C(G)
(1)
for some constant A(δ) ≥ 1. In other words the blanket time tB (G, δ) is a constant multiple of C(G).
Random Walks, Interacting Particles, Dynamic Networks
3
Mixing Time. For > 0 let TG () = max min t : ||Pv(t) − π||T V ≤ , v
where ||Pv(t) − π||T V =
1 (t) |Pv (w) − π(w)| 2 w (t)
is the Total Variation distance between Pv and π. We say that a random walk on G is rapidly mixing if TG (1/4) is poly(log |V |). The choice of 1/4 is somewhat arbitrary, any constant strictly less than 1/2 will suffice. Rapidly mixing Markov chains are extremely useful, as the process soon converges to stationary behavior. Many random graphs are expanders, and walks on expanders are rapidly mixing. This expansion property also leads to logarithmic diameter, and good connectivity, explaining the attractiveness of random graphs as network models.
3
Speeding Up Random Walks
As previously mentioned, for a simple random walk, the cover time C(G) of a connected n vertex graph G satisfies the bounds n log n ≤ C(G) ≤ (4/27)n3 . There are several strategies that can be used to speed-up the cover time of a random walk on an undirected connected graph. In this section, the approach we consider, is to modify the behavior of the walk. The price of the speed up is some extra work performed locally by the walk, or by the vertices of the graph. Another approach, considered in Section , is to use multiple random walks. Biased transitions. Use weighted transition probabilities derived from a knowledge of the local structure of the graph. The general theory of reversible weighted random walks is given in [2]. Ikeda, Kubo, Okumoto, and Yamashita [34] studied the speed up in the worst case cover time of any connected graph obtained by using transition probabilities which are a function of the degree of neighbour vertices (β-walks). For example, they found that if edge e = {u, v} is given a weight wu,v = 1/ d(u)d(v), then this gives a C(G) = O(n2 log n) upper bound on cover time for any connected n vertex graph G, (as opposed to Θ(n3 ) bound for simple random walks). The following proof that the cover time of any reversible random walk is Ω(n log n), is due to T. Radzik. The expected first return time ETu+ to u is ETu+ = 1/π(u). Also, ETu+ is at most the commute time K(u, v) between u and v (K(u, v) ≥ ETu+ ). Why? We either visit v on way back to u or we do not. For at least half the vertices π(u) ≤ 2/n. Why? u∈V π(u) = 1. Let S be this set of vertices, all with K(u, v) ≥ ETu+ ≥ n/2. Let KS = mini,j∈S K(i, j) then [36] C(G) ≥ (max KS log |S|)/2. S⊆V
Thus C(G) ≥ (n/4) log(n/2).
4
C. Cooper
Local exploration. At each step the walk uses look-ahead probing to a fixed distance, or marks an unmarked neighbour. A look-ahead-k walk can see all vertices at edge distance less than or equal to k from its current position. A simple random walk is look-ahead-0. Look-ahead walks were studied by [29]. For graphs of large minimum degree, using look-ahead can substantially improve cover time. For example, for finite k, look-ahead-k random walks on the hypercube reduce the cover time to O(n/(log n)k−1 ). However for regular graphs of constant degree, it is shown in [17] that look-ahead-k does not reduce cover time below Θ(n log n). In [1], Adler, Halperin, Karp, and Vazirani introduce a sampling process based on coupon collecting on a network. At each step the process chooses a random vertex v. If v is unseen then it is marked as seen. If v is seen but has unseen neighbours, pick an unseen neighbour u.a.r. and mark it. The authors show that, e.g. for the n vertex hypercube Hn , the time to mark all vertices is O(n). The random walk version of this marking process of [1] was studied in [12]. Depending on the degree and the expansion of the graph, the authors prove several upper bounds similar to [1]. In particular, when G is the hypercube or a random graph of minimum degree Ω(log n), the process marks all vertices in time O(n), improving the Θ(n log n) cover time of standard random walks. Previous history. Modify the walk transitions using previous history of the walk to avoid repetitions. Non-backtracking walks are fast O(n) on a n-cycle, but seem to lead to little improvement on expanders. Alon et al. [6] considered non-backtracking random walks on r-regular expanders. A non-backtracking walk X(t + 1) does not return over the edge (X(t − 1), X(t)) unless no other move is possible. They establish that these walks are rapidly mixing. However, this mixing result can be used to show that this process has a cover time of Ω(n log n) for r-regular expanders. Avin and Krishnamachari [9] considered Random Walks with Choice. Instead of moving to a random neighbour at each step, the walk selects d neighbours uniformly at random and then chooses to move to the least visited vertex among them. Edge processes. In [13] the authors investigate a random process which prefers unvisited edges. An edge-process (E-process) acts as follows: If there are unexplored edges incident with the current vertex pick one according to a rule A and make a transition along this edge. If there are no unexplored edges incident with the current vertex, move to a random neighbour using a simple random walk. Thus the walk uses unvisited edges whenever possible, and makes a random walk otherwise. The rule A could be determined on-line by an adversary; alternatively it could be a random choice over unvisited edges incident with the current walk position. We use the expression with high probability (whp) to mean with probability tending to one asymptotically, as the size n of the vertex set tends to infinity. For random regular graphs of even degree, whp the E(A)-process explores the graph in expected time linear in the size of the vertex set, irrespective of the choices made by rule A.
Random Walks, Interacting Particles, Dynamic Networks
5
Theorem 1. [13] Let Gr (n) be the set of n vertex r-regular graphs of constant even degree, r ≥ 4. Let G be chosen uniformly at random from Gr . Let A be an arbitrary rule for choosing unvisited edges, and let CE (G) denote the cover time of the E(A)-process on G. Then whp CE (G) = O(n), irrespective of the choice of rule A. The whp term in the theorem above depends on the u.a.r. choice of graph G, not on the expected performance of the E-process, and is asymptotic in the size n of the vertex set. The cover time of a random regular graph of degree r ≥ 3 is (r − 1)/(r − 2) n log n whp [17]. Thus Theorem 1 offers an Θ(log n) speed up. However, as usual, there is a caveat. For odd degree regular graphs, the experiments below show that performance is same order as simple random walk. Thus, as in the case of the β-walk of [34], improvement in performance depends on exploiting the topology of the graph. The experimental plot (Figure 1) (from [13]) gives the normalised cover time of the E-process, i.e. the actual cover time divided by n. The curves drawn behind the experimental data in the figure are of the form cn log n, where c was determined by inspection. In the experiments, unvisited edges are chosen u.a.r. by the E-process. It would appear the plots for even degrees 4 and 6 are constant, i.e. the cover time is O(n). The experimental evidence suggests e.g. that the normalised cover time of 3-regular graphs is 0.93n log n. 14
12
E d=3 [0.93 n ln(n)]
covertime / n
10
8
6
E d=5 [0.41 n ln(n)]
4
E d=7 [0.38 n ln(n)] E d=6
2 E d=4 0 100000
200000
300000
400000
500000
n = |V|
Fig. 1. Normalised cover time of E-process as function of size and degree d
Using Randomness in Deterministic Walks In the context of robotics the exploration of graphs is often done using the rotorrouter model, or Propp machine. The process works as follows. Each undirected edge {u, v} is replaced by a pair of directed edges (u, v), (v, u). All edges adjacent
6
C. Cooper
to a vertex are assigned labels in some order. In the beginning a pointer points to the first edge in this order which is used to determine the next edge to be traversed if v is visited. The walk starts at an arbitrary vertex. It moves over the edge to which the pointer points. After this edge is traversed, the pointer moves on to the edge with the next label, in a cyclic way. Since the number of configurations (direction of the rotors and the position of the walk) is bounded, the walk must be locked-in a loop eventually. The authors of [43] proved that the walk gets locked-in an Euler tour. In [11,44] the authors proved that the lock-in time is bounded by O(|V | · |E|). This bound was further improved in [45] to 2|E| · D, where D is the diameter of G. In [30] the authors consider a deterministic walk, the basic walk. The idea of the walk is based on an observation that one can cover the symmetric digraph counterpart of a graph by a collection of directed cycles. The cycles are formed according to a simple rule. At any node v with the degree d, the incoming edge incident via a port i becomes the predecessor of the outgoing arc incident via port (i + 1) mod d. A certain arrangement of the edge of the nodes of the graph leads to a cycle that visits every node. In [20] the authors show that there exists an edge order that leads to a cycle of length 4.33n that visits every node. In [13], a variant of this basic walk was used to overcome the problems encountered by the edge-process (E-process) on odd-degree regular graphs. The E-process was defined as follows. Firstly, replace the graph G with a symmetric r-regular digraph, D(G). Thus each edge {u, v} of G is replaced by a pair of directed edges (u, v), (v, u). Edges are initially distinguished as unvisited in each direction. As with the E-process, the E-process starts from some arbitrary vertex v, and makes a transition along an unvisited out-edge chosen according to some rule A. On returning to v, another unvisited out-edge is chosen, until all out-edges incident with v have been inspected. The walk then moves at random until a vertex u with unvisited out-edges is encountered, and u becomes the new start vertex. Transitions along unvisited edges to vertices x other than the current start vertex v, are handled as follows. Let a0 , ..., ar−1 be the neighbours of x in some fixed order. On entering a vertex x along unvisited directed edge (ai , x), we exit along (x, ai+1 ) (addition modulo r). The purpose of this is to stop the walk turning back on itself at any vertex, and is the same idea as the basic walk of [30], except it is applied only to unvisited edges. Theorem 2. Let Gr (n) be the set of n vertex r-regular graphs of constant degree E (G) denote the cover time of the r ≥ 3. Let G be chosen u.a.r. from Gr . Let C E(A)-process on G. Then whp CE (G) = O(n). This O(n) cover time is to be compared to an O(|E|D) = O(n log n) upper bound for Propp machines on random regular graphs. The following experiments for the E-process are from [13]. The results for the undirected E-process for degree-3, and degree-5 graphs are taken from Figure 1, and compared with the E-process in Figure 2. The directed processes appear linear, whereas the undirected processes appear to have ω(n) growth. The experiments of [13] indicated that although the time spent on the random walk
Random Walks, Interacting Particles, Dynamic Networks
7
14
12
E d=3 [0.93 n ln(n)]
covertime / n
10
8
6
E d=5 [0.41 n ln(n)]
4
E-dir d=5 E-dir d=3
2
0 100000
200000
300000
400000
500000
n = |V|
Fig. 2. Directed E-process vs E-process for d = 3 and d = 5
in the E-process is a small constant proportion of the total (less than 1/20%), it was still necessary for O(n) cover time. The experiments thus raise many interesting questions; and in particular the role of randomness as a catalyst to assist rapid completion of otherwise deterministic search processes.
4
Multiple and Interacting Particles
We distinguish three main types of process, namely particles which walk independently but coalesce on meeting, and those which walk independently but remain distinct, and either interact (e.g. exchange information) on meeting, or have no interaction. 4.1
Coalescing Particle Systems
In a coalescing random walk, a set of particles make independent random walks in an undirected connected graph. Whenever one or more particles meet at a vertex, then they become a single particle which continues with the random walk. The expected time for all initial particles to coalesce to a single particle depends on the starting positions of the walks. For a connected graph G, let Ck (i1 , ..., ik ), 2 ≤ k ≤ n, be the coalescence time when there are initially k particles starting from distinct vertices i1 , ..., ik . The worst case expected coalescence time is C(k) = maxi1 ,...,ik E(Ck (i1 , ..., ik )). A system of coalescing particles where initially one particle is located at each vertex, corresponds to the voter model, which is defined as follows. Initially each
8
C. Cooper
vertex has a distinct opinion, and at each step each vertex changes its opinion to that of a random neighbour. Let E(CV ) be the expected time for voting to be completed, i.e. for a unique opinion to emerge. (E(CV ) is also called the voting time, trapping time or the consensus time.) It is known that the expected time for a unique opinion to emerge, is the same as the expected time C(n) for all the particles to coalesce (see [2]). Thus, by establishing the expected coalescence time C(n), as E(CV ) = C(n), we also obtain the expected time for voting to be completed. If the graph G is bipartite, then for coalescence to complete, it is assumed that the walk pauses with some fixed probability at each step. Equivalently, for voting, that vertices may choose their own opinion with this probability. We summarize some of what is known about these problems for finite graphs. Cox [19] considered coalescence time of random walks and the consensus time of the voter model for d-dimensional tori. In a variant of the voter model, the two-party model, initially there are only two opinions A and B. The two-party model was considered by Donnelly and Welsh [24]. Hassin and Peleg [31] and Nakata et al. [41] also consider the two-party model, and discuss its application to agreement problems in distributed systems. These papers focus on analysing the probability that all vertices will eventually adopt the opinion which is initially held by a given group of vertices. The central result is that the probability that opinion A wins is d(A)/(2m), where d(A) is the sum of the degrees of vertices initially holding opinion A, and m is the number of edges in G. The case where there are more than two opinions, can be reduced to the two opinion case by forming two groups A and Not A. The time to complete voting in the two-party model depends on the way the opinions are initially distributed in the graph. For the class of expanders we study, our result that C(n) = O(n) implies that voting completes in O(n) expected time irrespective of the number of opinions. Let Hu,v denote the hitting time of vertex v starting from vertex u, that is, the random variable which gives the time taken by a random walk starting from vertex u to reach vertex v; and let hmax = maxu,v E(Hu,v ). Aldous [3] showed that C(2) = O(hmax ), which implies that C(n) = O(hmax log n) (since the number of particles halves in O(hmax ) steps), and conjectured that C(n) is actually O(hmax ). Cox’s results [19] imply that the conjecture C(n) = O(hmax ) is true for constant dimension tori and grids. In the same paper [3], Aldous also states a lower bound for C(2). For graphs, this bound can be simplified to C(2) = Ω(m/Δ), where Δ is the maximum degree of a vertex in G. For the class of expanders we study in this paper, this gives C(2) = Θ(n). However, the bounds C(2) = Ω(m/Δ) and C(2) = O(hmax ) can be far apart. For example, for a star graph (with loops), C(2) = Θ(1) whereas the bounds give Ω(1) ≤ C(2) = O(n). Aldous and Fill [2] showed that for regular graphs C(n) ≤ e(log n + 2)hmax , 2 for d-regular s-edge connected graphs C(n) ≤ dn , and for complete graphs 4s C(n) ∼ n (where f (n) ∼ g(n) means that f (n) = (1 ± o(1))g(n)). Cooper et al. [18] showed that the conjecture C(n) = O(hmax ) is true for the family of random regular graphs. They proved that for r-regular random graphs,
Random Walks, Interacting Particles, Dynamic Networks
9
C(n) = E(CV ) ∼ 2((r − 1)/(r − 2))n, whp. Such graphs are classic expanders in the sense of [32], and rapidly mixing (mixing time T = O(log n)). As noted above, voting processes can be viewed as consensus or aggregation. There is a large amount of research focusing on distributed selection and aggregation in different scenarios and various settings (see e.g. [37,39] or [7] for a survey). If two or more opinions are canvassed at each step then the time to complete voting can reduce from O(n) to O(log n). As an example, we mention the result of [22]. At the beginning each vertex of a complete graph has an own opinion. Then, in each step every vertex contacts two neighbours uniformly at random, and changes its opinion to the median of the opinions of these two vertices and its own opinion. It is shown that in time O(log n) all nodes will have the same opinion, whp. Cover time of multiple random walks The simplest application of multiple particle walks, is to the speed-up of cover time of a graph G. Using k independent random walks to improve s-t connectivity testing was initially studied by Broder et al. [14]. They proved that for k random walks starting from (positions sampled from) the stationary distribution, the cover time of an m edge graph is O((m2 log3 n)/k 2 ). In the case of r-regular graphs, Aldous and Fill [2] give an upper bound on the cover time of Ck ≤ (25 + o(1))n2 log2 n/k 2 , which holds for k ≥ 6 log n. Subsequent to this, the value of Ck (G) was studied by Alon et al. [5] for general classes of graphs. They found that for expanders the speed-up was Ω(k) for k ≤ n particles. They also give an example, the barbell graph (two cliques joined by a long path), and a starting position, for which a speed-up exponential in k is obtained, provided k ≥ 20 log n. In the case of random r-regular graphs, [18] establish the k-particle cover time. C(G)(k) ∼ C(G)/k independently of any arbitrary choice of k starting positions; i.e., the speedup is exactly linear, as is the case for the complete graph. If we consider k particles as starting from the same vertex, the speed-up is defined as the ratio of the cover time of a single random walk, to the cover time of the k random walks, i.e. from the worst case starting position. General results for seed-up in this model, were obtained by [26] and [25]. For example [26] present a lower bound on speed-up that depends on the mixing time, and give a Ω(k) speed-up for many graphs, even when k is as large as n. They prove that the speed-up is O(k log n), [26] on any graph, or O(k log n, k2 ) [25]. For a large class of graphs [26] improve this bound to O(k), matching a conjecture of Alon et al. [5] Multiple random walks with information passing We consider the problem of passing messages between particles moving randomly on a graph. We assume that when particles meet at a vertex, they exchange all messages which they know. We refer to such particles as agents to distinguish them from non-communicating particles. If initially one agent has a message it
10
C. Cooper
wants to pass to all the others, we refer to this process as broadcasting (among the agents). Formally, there are two sets I(t), U (t) of informed and uninformed vertices, respectively. Initially I = {ρ1 }, where ρ1 is the agent with the message, and U = {ρ2 , . . . , ρk }. If a member of I meets a member ρ of U , then ρ becomes informed and is moved from U to I. The broadcast time is the step at which U = ∅. Dimitriou et al. [23] obtained a general bound of O(M log k) for broadcasting among k particles where M = max(Mi,j ) is the expected meeting time of two random walks staring from worst case positions i, j. Pettarin et al. [42] studied problem for the n-vertex toroidal grid, They √ prove that with k agents, broad˜ ˜ casting and gossiping complete in Θ(n/ k), where the Θ(.) notation allows poly(log n) error terms. The problem was studied in detail for random regular graphs in [18], where the following whp results were obtained for k ≤ n agents (for a sufficiently small positive constant ) starting from general position; i.e. if there is a pairwise separation d(vi , vj ) ≥ Ω(ln ln n + ln k) between the starting positions. Let Bk be the time taken for a given agent to broadcast to all other agents. Then E(Bk ) ∼ 2(r − 1)/(r − 2) Hk−1 · n/k, where Hk is the k-th harmonic number. An alternative and less efficient way to pass on a message is for the originating agent to tell it directly to all the others. In this case message passing completes in time D(k) where E(Dk ) ∼ (r−1)/(r−2)Hk−1 ·n. Compared to this, broadcasting improves the expected time for everybody to receive the message by a multiplicative factor of k/2. Finally, suppose each agent has a message it wants to pass to all other agents, a process of gossiping. Let k → ∞; then whp gossiping among the agents can be completed in time O(n(log k)2 /k).
5
Searching Dynamic Graphs
In this section we consider random walks on dynamic graphs. There are two cases, either the number n(t) of vertices in the graph varies over time t, or n is fixed, but the structure alters. In both cases there are many possible models. In the model of Avin et al. [8], an evolving graph G(t) is a graph sampled at each step from a given space of graphs, using an agreed probability distribution. For any d-regular connected non-bipartite evolving graph G the cover time of the simple random walk on G is O(d2 n3 log2 n). The general case is C(G(t)) = O(Δ2 n3 log2 n). A more restrictive model G(t) is one in which non-edges are inserted with probability p, and existing edges removed with probability q, at any step. The starting graph G(0) is an Erd¨os-Renyi graph Gn,p , with p = p/(p+q). With these conditions, G(t) is in Gn,p for all t. Indeed Pr(e(t)) = (1 − p)p + p(1 − q) = p, for any edge e(t). Clementi et al. [15] investigated flooding in this model, and Baumann et al [10] refined this analysis for fixed depth flooding. Koba et al. [38] studied two types of random walks on a related process, for random subgraphs of arbitrary connected graphs H (i.e. H = Kn for Gn,p ). Each existing edge is retained with probability p at each step. In the case of p constant, they consider the following strategies, CBC: choose destination before
Random Walks, Interacting Particles, Dynamic Networks
11
checking, and CAC: choose destination after checking. For CBC they proved C(H(t)) = C(H)/p among other results. Let q = 1 − p then for CAC, they prove that C(H)/(1 − q Δ ) ≤ C(H(t)) ≤ C(H))/(1 − q δ ), where C(H) is cover time of H and δ, Δ are minimum and maximum degrees of H respectively. Thus, when H is d-regular, C(H)/(1 − q d ) = C(H(t)). If we consider a random graph process (G(t), t = 0, 1, ...) in which the graph evolves at each step by the addition of new vertices and edges then the random walk is searching a growing graph, so we cannot hope to visit all vertices of the graph. For example, consider a simple model of search, on e.g. the WWW, in which a particle (which we call a spider) makes a random walk on the nodes of an undirected graph process. As the spider is walking the graph is growing, and the spider makes a random transition to whatever neighbours are available at the time. For simplicity, we assume that the growth rate of the process and the transition rate of the random walk are similar, so that the spider has at least a chance of crawling a constant proportion of the process. Although the edges of the WWW graph are directed, the idea of evaluating models of search on an undirected process has many attractions, not least its simplicity. In [16] a study was made of the success of the spider’s search on comparable graph processes of two distinct types: a random graph process and a web graph process. At each step a new vertex is added which directs m edges towards existing vertices, either choosing vertices randomly (giving a random graph process) or preferentially according to vertex degree (giving a web graph process). Once a vertex has been added the direction of the edges is ignored. We consider the following models for the graph process G(t). Let m ≥ 1 be a fixed integer. Initially G(1) consists of a single vertex v1 plus m loops. For t ≥ 2, G(t + 1) is obtained from G(t) by adding the vertex vt+1 and m randomly chosen edges {vt+1 , vi }, i = 1, 2, . . . , m, as follows. Model 1: Random graph. Vertices v1 , v2 , . . . , vm are chosen independently and uniformly with replacement from {1, ..., t}. Model 2: Web-graph. Vertices v1 , v2 , . . . , vm are chosen proportional to their degree after step t. Thus if d(v, τ ) denotes the degree of vertex v in G(τ ) then for v ∈ {1, ..., t} and i = 1, 2, . . . , m, d(v, t) Pr(vi = v) = . 2mt While vertex t is being added, the spider S is sitting at some vertex Xt−1 of G(t−1). After the addition of vertex t, and before the beginning of step t+1, the spider now makes a random walk of length , where is a fixed positive integer independent of t. Let η,m (t) be the expected proportion of vertices which have not been visited by the spider at step t, when t is large. If we allow m → ∞ we can get precise asymptotic values. Let η = limm→∞ η,m , then (a) For Model 1, η =
2 (+2)2 /(4) e
∞ √ (+2)/ 2
e−y
2
/2
dy,
η1 = 0.57 · · · , and η ∼ 2/ as → ∞.
12
C. Cooper
(b) For Model 2
η = e 2
∞
2
y −3 e−y dy,
η1 = 0.59 · · · , and η ∼ 2/ as → ∞.
So for large m, t and = 1 it is slightly harder for the spider to crawl on a web-graph whose edges are generated by a copying process (Model 2) than on a uniform choice random graph (Model 1).
References 1. Adler, M., Halperin, E., Karp, R.M., Vazirani, V.V.: A stochastic process on the hypercube with applications to peer-to-peer networks. In: Proc. of STOC 2003, pp. 575–584 (2003) 2. Aldous, D., Fill, J.: Reversible Markov Chains and Random Walks on Graphs (2001), http://stat-www.berkeley.edu/users/aldous/RWG/book.html 3. Aldous, D.: Meeting times for independent Markov chains. Stochastic Processes and their Applications 38, 185–193 (1991) 4. Aleliunas, R., Karp, R.M., Lipton, R.J., Lov´ asz, L., Rackoff, C.: Random Walks, Universal Traversal Sequences, and the Complexity of Maze Problems. In: Proc. of FOCS 1979, pp. 218–223 (1979) 5. Alon, N., Avin, C., Kouch´ y, M., Kozma, G., Lotker, Z., Tuttle, M.: Many random walks are faster than one. In: Proc. of SPAA 2008, pp. 119–128 (2008) 6. Alon, N., Benjamini, I., Lubetzky, E., Sodin, S.: Non-backtracking random walks mix faster. Communications in Contemporary Mathematics 9, 585–603 (2007) 7. Aspnes, J.: Randomized protocols for asynchronous consensus. Distributed Computing 16, 165–176 (2003) ´ M., Lotker, Z.: How to Explore a Fast-Changing World (Cover 8. Avin, C., Koucky, Time of a Simple Random Walk on Evolving Graphs). In: Aceto, L., Damgρard, I., Goldberg, L.A., Halld´ orsson, M.M., Ing´ olfsd´ ottir, A., Walukiewicz, I. (eds.) ICALP 2008, Part I. LNCS, vol. 5125, pp. 121–132. Springer, Heidelberg (2008) 9. Avin, C., Krishnamachari, B.: The Power of Choice in Random Walks: An Empirical Study. In: Proc. of MSWiM 2006, pp. 219–228 (2006) 10. Baumann, H., Crescenzi, P., Fraigniaud, P.: Parsimonious Flooding in Dynamic Graphs. In: Proc. of PODC 2009, pp. 260–269 (2009) 11. Bhatt, S.N., Even, S., Greenberg, D.S., Tayar, R.: Traversing directed Eulerian mazes. Journal of Graph Algorithms and Applications 6(2), 157–173 (2002) 12. Berenbrink, P., Cooper, C., Els¨asser, R., Radzik, T., Sauerwald, T.: Speeding up random walks with neighborhood exploration. In: Proc. of SODA 2010, pp. 1422– 1435 (2010) 13. Berenbrink, P., Cooper, C., Friedetzky, T.: Random walks which prefer unexplored edges can cover in linear time (preprint, 2011) 14. Broder, A., Karlin, A., Raghavan, A., Upfal, E.: Trading space for time in undirected s−t connectivity. In: Proc of STOC 1989, pp. 543–549 (1989) 15. Clementi, A., Macci, C., Monti, A., Pasquale, F., Silvestri, R.: Flooding Time in Edge- Markovian Dynamic Graphs. In: Proc. of PODC 2008, pp. 213–222 (2008) 16. Cooper, C., Frieze, A.: Crawling on simple models of web-graphs. Internet Mathematics 1, 57–90 (2003)
Random Walks, Interacting Particles, Dynamic Networks
13
17. Cooper, C., Frieze, A.: The cover time of random regular graphs. SIAM Journal on Discrete Mathematics 18, 728–740 (2005) 18. Cooper, C., Frieze, A.M., Radzik, T.: Multiple Random Walks in Random Regular Graphs. SIAM J. Discrete Math. 23(4), 1738–1761 (2009) 19. Cox, J.T.: Coalescing random walks and voter model consensus times on the torus in Zd . The Annals of Probability 17(4), 1333–1366 (1989) 20. Czyzowicz, J., Dobrev, S., Gasieniec, L., Ilcinkas, D., Jansson, J., Klasing, R., Lignos, I., Martin, R., Sadakane, K., Sung, W.: More Efficient Periodic Traversal in Anonymous Undirected Graphs. In: Proceedings of the Sixteenth International Colloquium on Structural Information and Communication Complexity, pp. 167– 181 (2009) 21. Ding, J., Lee, J., Peres, Y.: Cover times, blanket times, and majorizing measures http://arxiv.org/abs/1004.4371v3 22. Doerr, B., Goldberg, L.A., Minder, L., Sauerwald, T., Scheideler, C.: Stabilizing Consensus with the Power of Two Choices (2010); full version available at www.upb.de/cs/scheideler (manuscript) 23. Dimitriou, T., Nikoletseas, S., Spirakis, P.: The infection time of graphs. Discrete Applied Mathematics 154, 2577–2589 (2006) 24. Donnelly, P., Welsh, D.: Finite particle systems and infection models. Math. Proc. Camb. Phil. Soc. 94, 167–182 (1983) 25. Efremenko, K., Reingold, O.: How well do random walks parallelize? In: Dinur, I., Jansen, K., Naor, J., Rolim, J. (eds.) APPROX 2009. LNCS, vol. 5687, pp. 376–389. Springer, Heidelberg (2009) 26. Els¨ asser, R., Sauerwald, T.: Tight Bounds for the Cover Time of Multiple Random Walks. In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W. (eds.) ICALP 2009. LNCS, vol. 5555, pp. 415–426. Springer, Heidelberg (2009) 27. Feige, U.: A tight upper bound for the cover time of random walks on graphs. Random Structures and Algorithms 6, 51–54 (1995) 28. Feige, U.: A tight lower bound for the cover time of random walks on graphs. Random Structures and Algorithms 6, 433–438 (1995) 29. Gkantsidis, C., Mihail, M., Saberi, A.: Random walks in peer-to-peer networks: algorithms and evaluation. Perform. Eval. 63(3), 241–263 (2006) 30. Gasieniec, L., Radzik, T.: Memory Efficient Anonymous Graph Exploration. In: Broersma, H., Erlebach, T., Friedetzky, T., Paulusma, D. (eds.) WG 2008. LNCS, vol. 5344, pp. 14–29. Springer, Heidelberg (2008) 31. Hassin, Y., Peleg, D.: Distributed probabilistic polling and applications to proportionate agreement. Information & Computation 171, 248–268 (2002) 32. Hoory, S., Linial, N., Wigderson, A.: Expander Graphs and their Applications. Bulletin of the American Mathematical Society 43, 439–561 (2006) 33. Ikeda, S., Kubo, I., Okumoto, N., Yamashita, M.: Fair circulation of a token. IEEE Transactions on Parallel and Distributed Systems 13(4) (2002) 34. Ikeda, S., Kubo, I., Okumoto, N., Yamashita, M.: Impact of Local Topological Information on Random Walks on Finite Graphs. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 1054– 1067. Springer, Heidelberg (2003) 35. Israeli, A., Jalfon, M.: Token management schemes and random walks yeild self stabilizing mutual exclusion. In: Proc. of PODC 1990, pp. 119–131 (1990) 36. Kahn, J., Kim, J.H., Lovasz, L., Vu, V.H.: The cover time, the blanket time, and the Matthews bound. In: Proc. of FOCS 2000, pp. 467–475 (2000)
14
C. Cooper
37. Kempe, D., Dobra, A., Gehrke, J.: Gossip-based computation of aggregate information. In: Proc. of FOCS 2003, pp. 482–491 (2003) 38. Koba, K., Kijima, S., Yamashita, M.: Random walks on dynamic graphs. preprint (2010) (in Japanese) 39. Kuhn, F., Locher, T., Wattenhofer, R.: Tight bounds for distributed selection. In: Proc. of SPAA 2007, pp. 145–153 (2007) 40. Lov´ asz, L.: Random walks on graphs: A survey. Bolyai Society Mathematical Studies 2, 353–397 (1996) 41. Nakata, T., Imahayashi, H., Yamashita, M.: Probabilistic local majority voting for the agreement problem on finite graphs. In: Asano, T., Imai, H., Lee, D.T., Nakano, S.-i., Tokuyama, T. (eds.) COCOON 1999. LNCS, vol. 1627, pp. 330–338. Springer, Heidelberg (1999) 42. Pettarin, A., Pietracaprina, A., Pucci, G., Upfal, E.: Infectious Random Walks, http://arxiv.org/abs/1007.1604v2 43. Priezzhev, V.B., Dhar, D., Dhar, A., Krishnamurthy, S.: Eulerian walkers as a model of self organized criticality. Physics Review Letters 77, 5079–5082 (1996) 44. Wagner, I.A., Lindenbaum, M., Bruckstein, A.M.: Distributed Covering by AntRobots Using Evaporating Traces. IEEE Transactions on Robotics and Automation 15(5), 918–933 (1999) 45. Yanovski, V., Wagner, I.A., Bruckstein, A.M.: A Distributed Ant Algorithm for Efficiently Patrolling a Network. Algorithmica 37, 165–186 (2003)
SINR Maps: Properties and Applications David Peleg Department of Computer Science and Applied Mathematics, The Weizmann Institute of Science, Rehovot, Israel
[email protected]
Most algorithmic studies in wireless networking to date employ simplified graphbased models such as the unit disk graph (UDG) model. These models conveniently abstract away complications stemming from interference and attenuation, and thus make it easier to deal with algorithmic issues. On the negative side, the simplifying assumptions adopted by the graph-based models result in network representations that fail to capture accurately some of the essential aspects of wireless communication. In contrast, physical models for wireless communication networks, such as the signal-to-interference & noise ratio (SINR) model, which is widely used by the Electrical Engineering community, aim at describing the quality of signal reception at the receivers while faithfully representing phenomena such as attenuation and interference, at the cost of somewhat increased complexity. In the SINR model, a receiver at point p ∈ Rd successfully receives a signal transmitted by the station si if and only if ψi · dist(si , p)−α ≥ β, −α + N j=i ψj · dist(sj , p)
SIN R(si , p) =
where N is the background noise, the constant β ≥ 1 denotes the minimum signal to interference & noise ratio required for a signal to be successfully received, α is the path-loss parameter, S = {s1 , . . . , sn } is the set of concurrently transmitting stations, and ψ is the assignment of transmission powers. Given a collection of simultaneously transmitting stations, it is possible to employ the fundamental SINR formula in order to identify a reception zone for each station, consisting of the points where its transmission is received correctly. The resulting SINR map partitions the plane into a reception zone per station and the remaining area where none of the stations are heard. SINR diagrams have been recently studied from topological and geometric standpoints [1,2], and they appear to provide improved understanding on the behavior of wireless networks. It is conceivable that such maps may play a significant role in the development and analysis of algorithms for basic wireless communication problems, similar to the role of Voronoi diagrams in the study of computational geometry. One application where SINR maps turn out to play a major role involves developing an efficient approximation algorithm for the point location problem in wireless networks.
Supported by a grant of the Israel Science Foundation.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 15–16, 2011. c Springer-Verlag Berlin Heidelberg 2011
16
D. Peleg 1.5 10
1.0
S1
5
0.5
S4
S3
S5
0
S2
S1
0.0
S3
S4 0.5
5
S2
1.0
10
1.5 10
5
0
(a)
5
10
0
5
10
15
(b)
Fig. 1. (a) An SINR map of a 4-station uniform power network. (b) An SINR map of a 5-station non-uniform power network. The reception zone of s1 is disconnected, and includes the small dark gray ellipse at the middle of the white no-reception zone.
A key feature of SINR systems is the ability to control the transmission power of stations. It turns out that there are significant differences between SINR networks that allow different stations to transmit with different powers, and ones where all stations transmit with uniform power. Those differences manifest themselves also in the corresponding SINR maps. In particular, for the uniform case, it is shown in [1] that the reception zones are convex (hence connected) and “fat”, or well-rounded (see Fig. 1(a)), leading in particular to more efficient algorithms for approximate point location. In contrast, in the more general case where transmission energies are arbitrary (or non-uniform), the reception zones are not necessarily convex or even connected (see Figure 1(b)), making it more challenging to answer point location queries. This problem is addressed in [2] through studying the geometry of SINR diagrams for non-uniform networks, e.g., bounding the maximal number of connected components they might have and establishing certain weaker forms of convexity for such systems. The talk will review recent studies of SINR maps, discuss some of their basic properties and describe some algorithmic applications.
References 1. Avin, C., Emek, Y., Kantor, E., Lotker, Z., Peleg, D., Roditty, L.: SINR diagrams: Towards algorithmically usable SINR models of wireless networks. In: Proc. 28th ACM Symp. on Principles of Distributed Computing (2009) 2. Kantor, E., Lotker, Z., Parter, M., Peleg, D.: The topology of wireless communication. In: Proc. 43rd ACM Symp. on Theory of Computing (2011)
A Survey on Some Recent Advances in Shared Memory Models Sergio Rajsbaum1, and Michel Raynal2 1
2
Instituto de Matem´aticas, UNAM, Mexico City, D.F. 04510, Mexico
[email protected] Institut Universitaire de France and IRISA, Universit´e de Rennes 1, France
[email protected]
Abstract. Due to the advent of multicore machines, shared memory distributed computing models taking into account asynchrony and process crashes are becoming more and more important. This paper visits models for these systems and analyses their properties from a computability point of view. Among them, the base snapshot model and the iterated model are particularly investigated. The paper visits also several approaches that have been proposed to model failures (mainly the wait-free model and the adversary model) and gives also a look at the BG simulation. The aim of this survey is to help the reader to better understand the power and limits of distributed computing shared memory models. Keywords: Adversary, Agreement, Asynchronous system, BG simulation, Concurrency, Core, Crash failure, Distributed computability, Distributed computing model, Fault-Tolerance, Iterated model, Liveness, Model equivalence, Progress condition, Recursion, Resilience, Shared memory system, Snapshot, Survivor set, Task, Topology, Wait-freedom.
1 Introduction Sequential computing vs distributed computing. Modern computer science was born with the discovery of the Turing machine, that captures the nature and the power of sequential computing and is equivalent to all other known models (e.g., Post systems, Church’s lambda calculus, etc.), or more powerful than simpler models (such as pushdown automata). This means that the same functions can be computed in all these models: these models are defined by the same set of computable functions. An asynchronous distributed computing model consists of a set of processes (individual state machines) that communicate through some communication medium and satisfy some failure assumptions. Asynchronous means that the speed of processes is entirely arbitrary: each one proceeds at its own speed which can vary and is independent of the speed of other processes. Other timing assumptions are also of interest. In a synchronous model, processes progress in a lock-step manner, and in a partially synchronous model the speed of processes is not as tightly related. If the components (processes and communication media) cannot fail, and each process is a Turing machine, then the distributed system is equivalent to a sequential Turing
Partially supported by UNAM PAPIIT and PAPIME grants.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 17–28, 2011. c Springer-Verlag Berlin Heidelberg 2011
18
S. Rajsbaum and M. Raynal
machine, from the computability point of view. Namely, processes can communicate to each other everything they know and locally compute any (Turing-computable) function. It follows that the power of failure-free distributed computing is the same as the one of sequential computing. Unfortunately the situation is different when processes are prone to failures. Asynchronous distributed computing in presence of failures. We consider here the case of the most benign process failure model, namely, the crash failure model. This means that, in addition to proceeding asynchronously, a process may crash in an unpredictable way (premature stop). Moreover, crashes are stable: a crashed process does not recover. The net effect of asynchrony and process crashes gives rise to a fundamental feature of distributed computing: a process may always have uncertainty about the state of other processes. Processes cannot compute the same global state of the system in order to simulate a sequential computation. Actually, in distributed computing we are interested in focusing on distributed aspects of computation, and thus we eliminate any restrictions on local sequential computations. That is, when studying distributed computability (and disregard complexity issues), we model each process by an infinite state machine. We get models whose power is orthogonal to the power of a Turing machine. Namely, each process can compute even functions that are not Turing-computable but the system as a whole cannot solve problems that are easily solvable by a Turing machine. The decision problems encountered in distributed systems, called tasks, are indeed distributed: each process has only part of the input to the problem. After communicating with each other, each process computes a part of the solution to the problem. A task specifies the possible inputs, and which part of the input gets each process. The input/output relation of the task, specifies the legal outputs for each input, and which part of the output can be produced by each process. A distributed system where even a single process may crash cannot solve tasks that are easily solvable by a Turing machine. The multiplicity of distributed computing models. Even in the case of crash failures, several models have been considered in the past, by specifying how many processes can fail, whether these failures are independent or not and whether the shared memory can also fail or not. The underlying communication model can also take many forms. The most basic is when processes communicate by reading and writing to a shared memory, but stronger communication objects are needed to be able to compute certain tasks. Also, some systems are better modeled by message passing channels. Plenty of distributed computing models are encountered in the literature, with combination of these and other assumptions. A “holy grail” quest is the discovery of a basic distributed model that could be used to study essential computability properties, and then generalize or extrapolate results to other models, by systematic reductions and simulations. This would be great because we would be able to completely depart from the situation of early distributed computing research and, instead of specific results suited only to appropriate models, it would allow us to have more general positive (algorithms and lower bounds) or negative (impossibility) results. This short survey considers processes that communicate by atomically reading and writing a shared memory. This base model is motivated by the following reasons. First, the asynchronous read/write communication model is the least powerful non-trivial
A Survey on Some Recent Advances in Shared Memory Models
19
shared memory model. Second, it is possible to simulate an atomic read/write register on top of a message-passing system as soon as less than half of the processes may crash [3,32] (but if more than half of the processes may crash, a message passing system is less powerful). Also, techniques used to analyze the read/write model can be extended to analyze models with more powerful shared objects. Safety an liveness properties. As far as safety an liveness properties are concerned, the paper considers mainly linearizability and wait-freedom. Linearizability means that the shared memory operations appear as if they have been executed sequentially, each operation appearing as being executed between its start event and its end event [21] (linearizability generalizes the atomicity notion associated with shared read/write registers). Wait-freedom means that any operation on a shared object invoked by a non-faulty process (a process that does not crash) does terminate whatever the behavior of the other processes, i.e., whatever their asynchrony and failure pattern [18] (wait-freedom can be seen as starvation-freedom despite any number of process crashes). Content of the paper. This survey is on the power and limits of shared memory distributed computing models. It first defines what is a task (the distributed counterpart of a function in sequential computing) in Section 2. Then, Section 3 presents and investigates the base asynchronous read/write distributed computing model and its associated snapshot abstraction that makes programs easier to write, analyze and prove. Next, Section 4 considers the iterated write-snapshot model that is more structured than the base write/snapshot model. Interestingly, this model has a nice mathematical structure that makes it very attractive to study properties of shared memory-based distributed computing. Section 5 considers the case where the previous models are enriched with failure detectors. It shows that there is a tradeoff between the computational structure of the model and the power added by a failure detector. Section 6 considers the case of a very general failure model, namely the adversary failure model. Section 7 presents the motivation and the benefit of the BG simulation. Finally, Section 8 concludes the paper.
2 What Is a Task? A task is the distributed counterpart of the notion of a function encountered in sequential computing. In a task T , each of the n processes starts with an input value and each process that does not crash has to decide on an output value such the set of output values has to be permitted by the task specification. More formally we have the following where all vectors are n-dimensional (n being the number of processes) [20]. Definition. A task T is a triple (I, O, Δ) where I is a set of input vectors, O is a set of output vectors, and Δ is a relation that associates with each I ∈ I at least one O ∈ O. The vector I ∈ I is the input vector where, for each entry i, I[i] is the private input of process pi . Similarly O describes the output vector where O[i] is the output that should be produced by process pi . Δ(I) defines which are the output vectors legal for the input vector I. Solving a task. Roughly speaking, an algorithm A wait-free solves a task T if the following holds. In any run of A, each process pi starts with an input value ini such
20
S. Rajsbaum and M. Raynal
that ∃I ∈ I with I[i] = ini (we say “pi proposes ini ”) and each non-faulty process pj eventually computes an output value outj (we say “pj decides outj ”) such that ∃O ∈ Δ(I) with O[j] = outj for all processes pj that have computed an output value. Examples of tasks. The most famous task is consensus. Each input vector I defines the values proposed by the processes. An output vector O is a vector whose entries contain the same value and Δ is such that Δ(I) contains all vectors whose single value is a value of I. The k-set agreement task relaxes consensus allowing up to k different values to be decided [11]. Other examples of tasks are renaming [5] (see [9] for an introductory survey), weak symmetry breaking, and k-simultaneous consensus [2].
3 Base Shared Memory Model The base wait-free read/write model. The computational model is defined by n sequential asynchronous processes p1 , ..., pn that communicate by reading and writing one-writer/multi-reader (1WMR) reliable atomic registers (for the interested reader the case of an unreliable shared memory is investigated in [17]). Moreover up to n − 1 processes may crash. Given a run of an algorithm, a process that crashes is faulty in that run, otherwise it is non-faulty (or correct). This is the well-know wait-free shared memory distributed model. As processes are asynchronous and the only means they have to communicate is reading and writing atomic registers, it follows that the main feature of this model is the impossibility for a process pi to know if another process pj is slow or has crashed. This “indistinguishability” feature lies at the source of several impossibility results (e.g., the consensus impossibility [27]). The snapshot abstraction. Designing correct distributed algorithms is hard. Thus, it is interesting to construct out of read/write registers communication abstractions of higher level. A very useful abstraction (which can be efficiently constructed out of read/write registers) is a snapshot object [1] (more developments on snapshot objects can be found in [4,22]). A snapshot abstracts an array of 1WMR atomic registers with one entry per process and provides them with two operations denoted X.write(v) and X.snapshot() where X is the corresponding snapshot object [1]. The former assigns v to X[i] (and is consequently also denoted X[i] ← v). Only pi can write X[i]. The latter operation, X.snapshot(), returns to the invoking process pi the current value of the whole array X. The fundamental property of a snapshot object is that all write and snapshot operations appear as if they have been executed atomically, which means that a snapshot object is linearizable [21]. These operations can be wait-free built on top of atomic read/write registers (the best implementation known so far has O(n log n) time complexity). Hence, a snapshot object provides the programmer with a high level shared memory abstraction but does not provide her/him with additional computational power.
A Survey on Some Recent Advances in Shared Memory Models
21
4 The Iterated Write-Snapshot Model 4.1 The Iterated Write-Snapshot Model Attempts at unifying different read/write distributed computing models have restricted their attention to a subset of round-based executions. The approach introduced in [7] generalizes these attempts by proposing an iterated model in which processes execute an infinite sequence of rounds, and in each round communicate through a specific object called one-shot write-snapshot object. This section presents this shared memory distributed computing model. One-shot write-snapshot object. A one-shot write-snapshot object abstracts an array WS [1..n] that can be accessed by a single operation denoted write snapshot() that each process invokes at most once. That operation pieces together the write() and snapshot() operations presented previously [6]. Intuitively, when a process pi invokes write snapshot(v) it is as if it instantaneously executes a write WS [i] ← v operation followed by an WS .snapshot() operation. If several IS .write snapshot() operations are executed simultaneously, then their corresponding writes are executed concurrently, and then their corresponding snapshots are also executed concurrently (each of the concurrent operations sees the values written by the other concurrent operations): they are set-linearizable. WS [1..n] is initialized to [⊥, . . . , ⊥]. When invoked by a process pi , the semantics of the write snapshot() operation is characterized by the following properties, where vi is the value written by pi and smi , the value (or view) it gets back from the operation. A view smi is a set of pairs (k, vk ), where vk corresponds to the value in pk ’s entry of the array. If W S[k] = ⊥, the pair (k, ⊥) is not placed in smi . Moreover, we assume that smi = ∅, if the process pi never invokes WS .write snapshot(). These properties are: – – – –
Self-inclusion. ∀i : (i, vi ) ∈ smi . Containment. ∀i, j : smi ⊆ smj ∨ smj ⊆ smi . Immediacy. ∀i, j : [(i, vi ) ∈ smj ∧ (j, vj ) ∈ smi ] ⇒ (smi = smj ). Termination. Any call of WS .write snapshot() by a correct process terminates.
The self-inclusion property states that a process sees its write, while the containment properties states that the views obtained by processes are totally ordered. Finally, the immediacy property states that if two processes “see each other”, they obtain the same view (the size of which corresponds to the concurrency degree of the corresponding write snapshot() invocations). The iterated model. In the iterated write-snapshot model (IWS) the shared memory is made up of an infinite number of one-shot write-snapshot objects WS [1], WS [2], . . . These objects are accessed sequentially and asynchronously by each process, according to the round-based pattern described below where ri is pi ’s current round number. ri ← 0; loop forever ri ← ri + 1; local computations; compute vi ; smi ← WS [ri ].write snapshot(vi ); local computations end loop.
22
S. Rajsbaum and M. Raynal
A fundamental result. Let us observe that the IWS model requires each correct process to execute an infinite number of rounds. However, it is possible that a correct process p1 is unable to receive information from another correct process p2 . Consider a run where both execute an infinite number of rounds, but p1 is scheduled before p2 in every round. Thus, p1 never reads a value written to a write-snapshot object by p2 . Of course, in the usual (non-iterated read/write shared memory) asynchronous model, two correct processes can always eventually communicate with each other. Thus, at first glance, one could intuitively think that the base read/write model and the IWS model have different computability power. The fundamental result associated with the IWS model is captured by the following theorem that shows that the previous intuition is incorrect. Definition 1. A task is bounded if its set of input vectors I is finite. Theorem 1. [7] A bounded task can be wait-free solved in the 1WMR shared memory model if and only if it can be wait-free solved in the IWS model. Why the IWS model? The interest of the IWS model comes from its elegant and simple round-by-round iterative structure. It restricts the set of interleavings of the shared memory model without restricting the power of the model. Its runs have an elegant recursive structure: the structure of the global state after r + 1 rounds is easily obtained from the structure of the global state after r rounds. This implies a strong correlation with topology (see the next section) and allows for an easier analysis of wait-free asynchronous computations. 4.2 A Mathematical View The properties that characterize the write snapshot() operation are represented in Figure 1 for the case of three processes. In the topology parlance, this picture represents a simplicial complex,, i.e., a family of sets closed under containment. Each set, which is called a simplex, represents the views of the processes after accessing a writesnapshot object. The vertices are 0-simplexes (size one); edges are 1-simplexes (size two); triangles are 2-simplexes (size three) and so on. Each vertex is associated with a process pi and is labeled with its name.
p2 p1 p2
p3
p3
p1
p2
p2 p1
p3
p1
p3
Fig. 1. First and second rounds in the iterated write-snapshot (IWS) model
A Survey on Some Recent Advances in Shared Memory Models
23
The highlighted 2-simplex in the left figure represents a run where p1 and p3 access the object concurrently, both get the same views seeing each other, but not seeing p2 , which accesses the object later, and gets back a view with the 3 values written to the object. But p2 can’t tell the order in which p1 and p3 access the object; the other two runs are indistinguishable to p2 , where p1 accesses the object before p3 and hence gets back only its own value or the opposite. These two runs are represented by the 2-simplexes at the bottom corners of the left picture. Thus, the vertices at the corners of the complex represents the runs where only one process pi accesses the object, and the vertices in the edges connecting the corners represent runs where only two processes access the object. The triangle in the center of the complex represents the run where all three processes access the object concurrently, and get back the same view. Hence, the state of an execution after the first round (with which is associated the write-snapshot object WS [1]) is represented by one of the internal triangles of the left picture (e.g., the one discussed previously that is represented by the bold triangle in the pictures). Then, the state of that execution after the second round (with which is associated the write-snapshot object WS [2]) is represented by one of the small triangles inside the bold triangle in the right picture. Etc. More generally, as shown in Figure 1, one can see that, in the IWS model, at every round, a new complex is constructed recursively by replacing each simplex by a one-round complex. (More developments can be found in [19].) 4.3 A Recursive Write-Snapshot Algorithm Figure 2 presents a read/write algorithm that implements the write snapshot() operation. Interestingly, this algorithm is recursive [9,16]. A proof can be found in [9]. To allow for a recursive formulation, an additional recursion parameter is used. More precisely, in a round r, a process invokes MS .write snapshot(n, v) where the initial value of the recursion parameter is n and SM stands for WS [r]. SM is a shared array of size n (initialized to [⊥, . . . , ⊥] and such that each SM [x] is an array of n 1WnR atomic registers. The atomic register SM [x][i] can be read by all processes but written only by pi . Let us consider the invocation SM .write snapshot(x, v) issued by pi . Process pi first writes SM [x][i] and reads (not atomically) the array SM [x][1..n] that is associated operation SM .write snapshot(x, v): % x (n ≥ x ≥ 1) is the recursion parameter % (01) SM [x][i] ← v; (02) for 1 ≤ j ≤ n do auxi [j] ← SM [x][j] end for ; (03) pairs i ← {(j, v ) | ∃j such that auxi [j] = v = ⊥}; (04) if (|pairs i | = x) (05) then smi ← pairs i (06) else smi ← SM .write snapshot(x − 1, v) (07) end if; (08) return(smi ). Fig. 2. Recursive write-snapshot algorithm (code for pi )
24
S. Rajsbaum and M. Raynal
with the recursion parameter x (lines 01-02). Then, pi computes the set of processes that have already attained the recursion level x (line 03; let us note that recursion levels are decreasing from n to n − 1, etc.). If the set of processes that have attained the recursion level x (from pi ’s point of view) contains exactly x processes, pi returns this set as a result (lines 04-05). Otherwise less than x processes have attained the recursion level x. In that case, pi recursively invokes SM .write snapshot(x − 1) (line 06) in order to attain and stop at the recursion level y attained by y processes. The cost of a shared memory distributed algorithm is usually measured by the number of shared memory accesses, called step complexity. The step complexity of pi ’s invocation is O(n(n − |smi | + 1)).
5 Enriching a System with a Failure Detector The concept of a failure detector. This concept has been introduced and investigated by Chandra, Hadzilacos and Toueg [10] (see [31] for an introductory survey). Informally, a failure detector is a device that provides each process pi with information about process failures, through a local variable fdi that pi can only read. Several classes of failure detectors can be defined according to the kind and the quality of the information on failures that has to be delivered to the processes. Of course, a non-trivial failure detector requires that the system satisfies additional behavioral assumptions in order to be implemented. The interested reader will find such additional behavioral assumptions and corresponding algorithms implementing failure detectors of several classes in chapter 7 of [32]. An example. One of the most known failure detectors is the eventual leader failure detector denoted Ω [10]. This failure detector is fundamental because it encapsulates the weakest information on failures that allows consensus to solved in a base read/write asynchronous system. The output provided by Ω to each (non crashed) process pi is such that fdi always contains a process identity (validity). Moreover, there is a finite time τ after which all local failure detector outputs fdi contains forever the same process identity and it is the identity of a correct process (eventual leadership). The time τ is never explicitly know by the processes. Before τ , there is an anarchy period during which the local failure detector outputs can be arbitrary. A result. As indicated, the consensus problem cannot be solved in the base read read/ write system [27] while it can be solved as soon as this system is enriched with Ω. On another side (see Theorem 1), the base shared memory model and the IWS model have the same wait-free computability power for bounded tasks. Hence a natural question: Is this computability power equivalence preserved when both models are enriched with the same failure detector? Somehow surprisingly, the answer to this question is negative. More precisely, we have the following. Theorem 2. [29] For any failure detector FD and bounded task T , if T is wait-free solvable in the model IWS enriched with FD, then T is wait-free solvable in the base shared memory model without failure detector. Intuitively, this negative result is due to the fact that the IWS model is too much structured to benefit from the help of a failure detector.
A Survey on Some Recent Advances in Shared Memory Models
25
How to circumvent the previous negative result. A way to circumvent this negative result consists in “embedding” (in some way) the failure detector inside the write snapshot() operation. More precisely, the infinite sequence of invocations WS [1]. write snapshot(), WS [2].write snapshot(), etc., issued by any process pi has to satisfy an additional property that depends on the corresponding failure detector. This approach has given rise to the IRIS model described in [30].
6 From the Wait-Free Model to the Adversary Model Adversaries are a very useful abstraction to represent subsets of executions of a distributed system. The idea is that, if one restricts the set of possible executions, the system should be able to compute more tasks. Various adversaries have been considered in the past to model failure restrictions, as we shall now describe. In the wait-free model, any number of process can crash. In practice one sometimes estimates a bound t on how many processes can be expected to crash. However, often the crashes are not independent, due to processes running on the same core, or on the same subnetwork, for example. Wait-freedom. It is easy to see that wait-freedom is the least restrictive adversary, i.e., the adversary that contains all the (non-empty) subsets of processes. Hence, a wait-free algorithm has to work whatever the number of process crashes. t-Faulty process resilience. The t-faulty process resilient failure model (also called tthreshold model) considers that, in any run, at most t processes may crash. Hence, the corresponding adversary is the set of all the sets of (n−t) processes plus all their supersets. Cores and survivor sets. The notion of t-process resilience is not suited to capture the case where processes fail in a dependent way. This has motivated the introduction of the notions of core and survivor set [26]. A core C is a minimal set of processes such that, in any run, some process in C does not fail. A survivor set S is a minimal set of processes such that there is a run in which the set of non-faulty processes is exactly S. Let us observe that cores and survivor sets are dual notions (any of them can be obtained from the other one). Adversaries. The most general notion of adversary with respect to failure dependence has been introduced in [12]. An adversary A is a set of sets of processes. It states that an algorithm solving a task must terminate in all the runs whose the corresponding set of correct processes is (exactly) a set of A. As an example, Let us considers a system with four processes denoted p1, ..., p4 . The set A = {{p1 , p2 },{p1 , p4 },{p1 , p3 , p4 }} defines an adversary. An algorithm A-resiliently solves a task if it terminates in all the runs where the set of correct processes is exactly either {p1 , p2 } or {p1 , p4 } or {p1 , p3 , p4 }. This means that in an execution in which the only correct processes are p3 and p4 an A-resilient algorithm is not required to terminate. Adversaries are more general than the notion of survivor sets (this is because when we build the adversary corresponding to a set of survivor sets, due the “minimality” feature of each survivor set, we have to include all its supersets in the corresponding adversary). On progress conditions. It is easy to see that an adversary can be viewed as a liveness property that specifies the crash patterns in which the correct processes must progress. The interested reader will find more developments on progress conditions in [15,25,33].
26
S. Rajsbaum and M. Raynal
7 Adversary Models vs. Wait-Free Model: The BG Simulation It would be nice to reduce questions about task solvability under any adversary to the wait-free case. This is exactly what the BG simulation [8] and its variants [14,23,24] do when considering the adversaries defined by t-resilience. BG simulation: motivation and aim. Let us consider an algorithm A that is assumed to solve a task T in an asynchronous read/write shared memory system made up of n processes, and where any subset of at most t processes may crash. Given algorithm A as input, the BG simulation is an algorithm that solves T in an asynchronous read/write system made up of t + 1 processes, where up to t processes may crash. Hence, the BG simulation is a wait-free algorithm. The BG simulation has been used to prove solvability and unsolvability results in crash-prone read/write shared memory systems. It works only for a particular class of tasks called colorless tasks. These are the tasks where, if a process decides a value, any other process is allowed to decide the very same value and, if a process has an input value v, then any other processes can exchange its own input by v. Thus, for colorless tasks, the BG simulation characterizes t-resilience in terms of wait-freedom, and it is not hard to see that the same holds for any other adversary defined by survivor sets. As an example, let us assume that A solves consensus, despite up to t = 1 crash, among n processes in a read/write shared memory system. Taking A as input, the BG simulation builds a (t + 1)-process (i.e., 2-process) algorithm A that solves consensus despite t = 1 crash, i.e., wait-free. But, we know that consensus cannot be wait-free solved in a crash-prone asynchronous system where processes communicate by accessing shared read/write registers only [18,27] in particular if it is made up of only two processes. It then follows that, whatever the number n of processes the system is made up of, there is no 1-resilient consensus algorithm. The BG simulation algorithm has been extended to work with general tasks (called colored tasks) [14,23] and for algorithms that have access to more powerful communication objects (e.g., [24] that extends the BG simulation to objects with any consensus number x). BG simulation: how does it work? Let A be an algorithm that solves a colorless decision task in the t-resilient model for n processes. The basic aim is to design a wait-free algorithm A that simulates A in a model with t + 1 processes. A simulated process is denoted pj , while a simulator process is denoted qj , with 1 ≤ j ≤ n. Each simulator qj is given the code of every simulated process p1 , . . . , pn . It manages n threads, each one associated with a simulated process, and locally executes these threads in a fair way (e.g., using a round-robin mechanism). It also manages a local copy memi of the snapshot memory mem shared by the simulated processes. The code of a simulated process pj contains invocations of mem[j].write() and of mem.snapshot(). These are the only operations used by the processes p1 , . . . , pn to cooperate. So, the core of the simulation is the design of algorithms that describe how a simulator qi simulates these operations. These simulation algorithms are denoted sim writei,j (), and sim snapshoti,j () whose implemention relies on the following object type. The safe agreement object type. This object type is at the core of the BG simulation. It provides each simulator qi with two operations, denoted sa propose(v) and sa decide(),
A Survey on Some Recent Advances in Shared Memory Models
27
that qi can invoke at most once, and in that order. The operation sa propose(v) allows qi to propose a value v while sa decide() allows it to decide a value. The properties satisfied by an object of the type safe agreement are the following (different implementations of the safe agreement object type can be found in [8,28]). – Termination. If no simulator crashes while executing sa propose(v), then any correct simulator that invokes sa decide() returns from that invocation. – Agreement. At most one value is decided. – Validity. A decided value is a proposed value.
8 Conclusion This paper has presented an introductory survey of recent advances in asynchronous shared memory models where processes can commit unexpected crash failures. To that end the base snapshot model and iterated models have been presented. As far as resilience is concerned, the wait-free model and the adversary model has been analyzed. It is hoped that this survey will help a larger audience of the distributed computing community to understand the power, subtleties and limits of crash-prone asynchronous shared memory models. The interested reader will find more developments in [28].
References 1. Afek, Y., Attiya, H., Dolev, D., Gafni, E., Merritt, M., Shavit, N.: Atomic Snapshots of Shared Memory. Journal of the ACM 40(4), 873–890 (1993) 2. Afek, Y., Gafni, E., Rajsbaum, S., Raynal, M., Travers, C.: The k-Simultaneous Consensus Problem. Distributed Computing 22(3), 185–195 (2010) 3. Attiya, H., Bar-Noy, A., Dolev, D.: Sharing Memory Robustly in Message Passing Systems. Journal of the ACM 42(1), 121–132 (1995) 4. Anderson, J.: Multi-writer Composite Registers. Distributed Computing 7(4), 175–195 (1994) 5. Attiya, H., Bar-Noy, A., Dolev, D., Peleg, D., Reischuk, R.: Renaming in an Asynchronous Environment. Journal of the ACM 37(3), 524–548 (1990) 6. Borowsky, E., Gafni, E.: Immediate Atomic Snapshots and Fast Renaming. In: Proc. 12th ACM Symposium on Principles of Distributed Computing PODC 193, pp. 41–51 (1993) 7. Borowsky, E., Gafni, E.: A Simple Algorithmically Reasoned Characterization of Wait-free Computations. In: Proc. 16th ACM Symposium on Principles of Distributed Computing, PODC 1997, pp. 189–198. ACM Press, New York (1997) 8. Borowsky, E., Gafni, E., Lynch, N., Rajsbaum, S., The, B.G.: Distributed Simulation Algorithm. Distributed Computing 14(3), 127–146 (2001) 9. Casta˜neda, A., Rajsbaum, S., Raynal, M.: The Renaming Problem in Shared Memory Systems: an Introduction. Computer Science Review (to appear, 2011) 10. Chandra, T., Hadzilacos, V., Toueg, S.: The Weakest Failure Detector for Solving Consensus. Journal of the ACM 43(4), 685–722 (1996) 11. Chaudhuri, S.: More Choices Allow More Faults: Set Consensus Problems in Totally Asynchronous Systems. Information and Computation 105(1), 132–158 (1993) 12. Delporte-Gallet, C., Fauconnier, H., Guerraoui, R., Tielmann, A.: The Disagreement Power of an Adversary. In: Keidar, I. (ed.) DISC 2009. LNCS, vol. 5805, pp. 8–21. Springer, Heidelberg (2009)
28
S. Rajsbaum and M. Raynal
13. Gafni, E.: The 01-Exclusion Families of Tasks. In: Baker, T.P., Bui, A., Tixeuil, S. (eds.) OPODIS 2008. LNCS, vol. 5401, pp. 246–258. Springer, Heidelberg (2008) 14. Gafni, E., The Extended, B.G.: Simulation and the Characterization of t-Resiliency. In: Proc. 41th ACM Symposium on Theory of Computing (STOC 2009), pp. 85–92. ACM Press, New York (2009) 15. Gafni, E., Kuznetsov, P.: Turning Adversaries into Friends: Simplified, Made Constructive and Extended. In: Lu, C., Masuzawa, T., Mosbah, M. (eds.) OPODIS 2010. LNCS, vol. 6490, pp. 380–394. Springer, Heidelberg (2010) 16. Gafni, E., Rajsbaum, S.: Recursion in Distributed Computing. In: Dolev, S., Cobb, J., Fischer, M., Yung, M. (eds.) SSS 2010. LNCS, vol. 6366, pp. 362–376. Springer, Heidelberg (2010) 17. Guerraoui, R., Raynal, M.: From Unreliable Objects to Reliable Objects: the Case of atomic Registers and Consensus. In: Malyshkin, V.E. (ed.) PaCT 2007. LNCS, vol. 4671, pp. 47–61. Springer, Heidelberg (2007) 18. Herlihy, M.P.: Wait-Free Synchronization. ACM Transactions on Programming Languages and Systems 13(1), 124–149 (1991) 19. Herlihy, M.P., Rajsbaum, S.: The Topology of Shared Memory Adversaries. In: Proc. 29th ACM Symposium on Principles of Distributed Computing PODC 2010, pp. 105–113 (2010) 20. Herlihy, M.P., Shavit, N.: The Topological Structure of Asynchronous Computability. Journal of the ACM 46(6), 858–923 (1999) 21. Herlihy, M.P., Wing, J.L.: Linearizability: a Correctness Condition for Concurrent Objects. ACM Transactions on Programming Languages and Systems 12(3), 463–492 (1990) 22. Imbs, D., Raynal, M.: Help when Needed, but no More: Efficient Read/Write Partial Snapshot. In: Keidar, I. (ed.) DISC 2009. LNCS, vol. 5805, pp. 142–156. Springer, Heidelberg (2009) 23. Imbs, D., Raynal, M.: Visiting Gafni’s Reduction Land: from the BG Simulation to the Extended BG Simulation. In: Guerraoui, R., Petit, F. (eds.) SSS 2009. LNCS, vol. 5873, pp. 369–383. Springer, Heidelberg (2009) 24. Imbs, D., Raynal, M.: The Multiplicative Power of Consensus Numbers. In: Proc. 29th ACM Symp. on Principles of Distributed Computing PODC 2010, pp. 26–35. ACM Press, New York (2010) 25. Imbs, D., Raynal, M., Taubenfeld, G.: On Asymmetric Progress Conditions. In: Proc. 29th ACM Symp. on Principles of Distributed Computing PODC 2010, pp. 55–64 (2010) 26. Junqueira, F., Marzullo, K.: Designing Algorithms for Dependent Process Failures. In: Schiper, A., Shvartsman, M.M.A.A., Weatherspoon, H., Zhao, B.Y. (eds.) Future Directions in Distributed Computing. LNCS, vol. 2584, pp. 24–28. Springer, Heidelberg (2003) 27. Loui, M.C., Abu-Amara, H.H.: Memory Requirements for Agreement Among Unreliable Asynchronous Processes. Par. and Distributed Computing 4, 163–183 (1987) 28. Rajsbaum, S., Raynal, M.: Power and Limits of Distributed Computing Shared Memory Models. Tech Report #1974, IRISA, Universit´e de Rennes, France (2011) 29. Rajsbaum, S., Raynal, M., Travers, C.: An Impossibility about Failure Detectors in the Iterated Immediate Snapshot Model. Information Processing Letters 108(3), 160–164 (2008) 30. Rajsbaum, S., Raynal, M., Travers, C.: The Iterated Restricted Immediate Snapshot (IRIS) Model. In: Hu, X., Wang, J. (eds.) COCOON 2008. LNCS, vol. 5092, pp. 487–496. Springer, Heidelberg (2008) 31. Raynal, M.: Failure Detectors for Asynchronous Distributed Systems: an Introduction. Wiley Encyclopdia of Computer Science and Engineering 2, 1181–1191 (2009) 32. Raynal, M.: Communication and Agreement Abstractions for Fault-Tolerant Asynchronous Distributed Systems, p. 251. Morgan & Claypool Pub. (2010); ISBN 978-1-60845-293-4 33. Taubenfeld, G.: The Computational Structure of Progress Conditions. In: Lynch, N.A., Shvartsman, A.A. (eds.) DISC 2010. LNCS, vol. 6343, pp. 221–235. Springer, Heidelberg (2010)
Consensus vs. Broadcast in Communication Networks with Arbitrary Mobile Omission Faults Emmanuel Godard1,2 and Joseph Peters2, 1
Pacific Institute for Mathematical Sciences, CNRS UMI 3069 2 School of Computing Science, Simon Fraser University
Abstract. We compare the solvability of the Consensus and Broadcast problems in synchronous communication networks in which the delivery of messages is not reliable. The failure model is the mobile omission faults model. During each round, some messages can be lost and the set of possible simultaneous losses is the same for each round. We investigate these problems for the first time for arbitrary sets of possible failures. Previously, these sets were defined by bounding the numbers of failures. In this setting, we present a new necessary condition for the solvability of Consensus that unifies previous impossibility results in this area. This condition is expressed using Broadcastability properties. As a very important application, we show that when the sets of omissions that can occur are defined by bounding the numbers of failures, counted in any way (locally, globally, etc.), then the Consensus problem is actually equivalent to the Broadcast problem.
1
Introduction
We consider synchronous communication networks in which some messages can be lost during each round. These omission faults can be permanent or not; a faulty link can become reliable again after an unpredictable number of rounds, and it can continue to alternate between being reliable and faulty in an unpredictable way. This model is more general than other models, such as component failure models, in which failures, once they appear somewhere, are located there permanently. The model that we use, called the mobile faults or dynamic faults model, was introduced in [11] and is discussed further in [12]. An important property of these systems is that the set of possible simultaneous omissions is the same for each round. In some sense, the system has no “memory” of the previous failures. Real systems often exhibit such memory-less behaviour. In previous research, the sets of possible simultaneous omissions were defined by bounding the numbers of omissions. Recent work on this subject includes [12], in which omissions are counted globally, and [13], in which the number of omissions is locally bounded. It has also been shown to be good for layered analysis [7]. In this paper we consider the most general case of such systems, i.e. systems in which the set of possible simultaneous omissions is arbitrary. This
Research supported by NSERC of Canada.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 29–41, 2011. c Springer-Verlag Berlin Heidelberg 2011
30
E. Godard and J. Peters
allows the modelling of any system in which omissions can happen transiently, in any arbitrary pattern, including systems with non-symmetric communications. We investigate two fundamental problems of Distributed Computing in these networks: the Consensus problem and the Broadcast problem. While it has long been known that solvability of the Broadcast problem implies solvability of the Consensus problem, we prove here that these problems are actually equivalent (from both the solvability and complexity points of view) when the sets of possible omissions are defined by bounding the number of failures, for any possible way of counting them (locally, globally, any combination, etc.). The Consensus Problem. The Consensus problem is a very well studied problem in the area of Distributed Algorithms. It is defined as follows. Each node of the network starts with an initial value, and all nodes of the network have to agree on a common value, which is one of the initial values. Many versions of the problem concern the design of algorithms for systems that are unreliable. The Consensus problem has been widely studied in the context of shared memory systems and message passing systems in which any node can communicate with any other node. Surprisingly, there have been few studies in the context of communication networks, where the communication graph is not a complete graph. In one of the first thorough studies [12], Santoro and Widmayer investigate some k−Majority Problems that are defined as follows. Each node starts with an initial value, and every node has to compute a final decided value such that there exists a value (from the set of initial values) that is decided by at least k of the nodes. The Consensus problem (called the Unanimity problem in [12]1 ) is the n−Majority problem where n is the number of nodes in the network. In their paper, Santoro and Widmayer give results about solving the Consensus problem in communication networks with various types of faults including omission faults. For simplicity, we focus here only on omission faults. We believe that our results can be quite easily extended to other fault models, using [12]. The Broadcast Problem. Two of the most widely studied patterns of information propagation in communication networks are broadcasting and gossiping. A broadcast is the distribution of an initial value from one node of a network to every other node of the network. A gossip is a simultaneous broadcast from every node of the network. The Broadcast problem that we study in this paper is to find a node from which a broadcast can be successfully completed. There are close relationships between broadcasting and gossiping, and the Consensus problem. Indeed, the Consensus problem can be solved by first gossiping and then applying a deterministic function at each node to the set of initial values. But a gossip is not actually necessary. If there exists a distinguished node v0 in the network, then a Consensus algorithm can be easily derived from an algorithm that broadcasts from v0 . However the Broadcast problem and the Consensus problem are not equivalent, as will be made clearer in Section 3. 1
Note that some of the terminology that we use in this paper is different from the terminology of Santoro and Widmayer.
Consensus vs. Broadcast in Communication Networks
31
Our Contributions. In this paper, we investigate systems in which the pattern of omission failures is arbitrary. A set of simultaneous omissions is called a communication event. We characterize the solvability of the Broadcast and Consensus problems subject to an arbitrary family of possible communication events. A node from which it is possible to broadcast if the system is restricted to a given communication event is called a source for the communication event. We prove that the Broadcast problem is solvable if and only if there exists a common source for all communication events. To study the Consensus problem, we define an equivalence relation on a family of communication events based on the collective local observations of the events by the sources. We prove in Theorem 3 that the Consensus problem is not solvable for a family of communication events if the Broadcast problem is not solvable for one class of the equivalence relation. For Consensus to be solvable, the sources of a given event must be able to collectively distinguish communication events with incompatible sources. We conjecture that this is actually a sufficient condition. It is very simple to characterize Broadcastability (see Theorem 1), so we get very simple and efficient impossibility proofs for solving Consensus subject to arbitrary omission failures. These impossibility conditions are satisfied by the omission schemes of [12] and [13]. This means that our results encompass all previous known results in the area. Furthermore, we prove that under very general conditions, in particular when the possible simultaneous omissions are defined by bounding the number of omissions, for any way of counting omissions, there is actually only one equivalence class when the system is not broadcastable. An important application is that, the Consensus problem is exactly the same as the Broadcast problem for most omission fault models. Therefore, it is possible to deduce complexity results for the Consensus problem from complexity results about broadcasting with omissions. Other Related Work. In [1], the authors present a model that can describe benign faults. This model is called the “Heard-Of” model. It is a round-based model for an omission-prone environment in which the set of possible communication events is not necessarily the same for each round. However, they require a time-invariance property. It is worth noting that, although all of [12], [4], and [13] use the classic bivalency proof technique, it is not possible to derive any of the results of [12] or [4] (global bound on omissions) from the results of [13] (local bound) as the omission schemes are not comparable. Our results consolidate these previous results. Furthermore, our approach is more general than these previous approaches and is more suitable for applications to new omission metrics.
2
Definitions and Notation
Communication Networks and Omission Schemes. We model a communication network by a digraph G = (V, E) which does not have to be symmetric. If we are given an undirected graph G, we consider the corresponding symmetric digraph. We always assume that nodes have unique identities. Given a set of
32
E. Godard and J. Peters
arcs E, we define h(E) = {t | (s, t) ∈ E}, the set of nodes that are heads of arcs in E. All sub-digraphs that we consider in this paper are spanning subgraphs. Since all spanning subgraphs of a digraph have the same set of nodes, we will use the same notation to refer to both the set of arcs of a sub-digraph and the sub-digraph with that set of arcs when the set of nodes is not ambiguous. In this section, we introduce our model and the associated notation. Communication in our model is synchronous but not reliable, and communication is performed in rounds. Communication with omission faults is described by a spanning sub-graph of G with semantics that are specified later in this section. Throughout this paper, the underlying graph G = (V, E) is fixed, and we define the set Σ = {(V, E ) | E ⊆ E}. This set represents all possible simultaneous communications given the underlying graph G. Definition 1. An element of Σ is called a communication event ( event for short). An omission scenario ( scenario for short) is an infinite sequence of communication events. An omission scheme over G is a set of omission scenarios. A natural way to describe communications is to consider Σ to be an alphabet, with communication events as letters of the alphabet, and scenarios as infinite words. We will use standard concatenation notation when describing sequences. If w and w are two sequences, then ww is the sequence that starts with the ordered sequence of events w followed by the ordered sequence of events w . This notation is extended to sets in an obvious way. The empty word is denoted ε. We will use the following standard notation to describe our communication schemes. Definition 2 ([9]). Given R ⊂ Σ, R∗ is the set of all finite sequences of elements of R, and Rω is the set of all infinite ones. The set of all possible scenarios on G is then Σ ω . A given word w ∈ Σ ∗ is called a partial scenario and |w| is the length of this partial scenario. An omission scheme is then a subset S of Σ ω . A mobile omission scheme is a scheme that is equal to Rω for some subset R ⊆ Σ. In this paper, we consider only mobile omission schemes. Note that we do not require G to belong to R. A formal definition of an execution subject to a scenario will be given later in this section. Intuitively, the r-th letter of a scenario will describe which communications are reliable during round r. Finally, we recall some standard definitions for infinite words and languages over an alphabet Σ. Given w = (a1 , a2 , . . .) ∈ Σ ω , a subword of w is a (possibly infinite) sub-sequence (aσ(1) , aσ(1) , . . .), where σ is a strictly increasing function. A word u ∈ Σ ∗ is a prefix of w ∈ Σ ∗ (resp. w ∈ Σ ω ) if there exists v ∈ Σ ∗ (resp. v ∈ Σ ω ) such that w = uv (resp. w = uv ). Given w ∈ Σ ω and r ∈ N, w|r is the finite prefix of w of length r. Definition 3. Let w ∈Σ ω and L ⊂ Σ ω . Then Pref (w) = {u ∈ Σ ∗ |u is a prefix of w}, and Pref (L) = w∈L Pref (w). A word w is an extension of w in L, if ww ∈ L.
Consensus vs. Broadcast in Communication Networks
33
Examples. We do not restrict our study to regular sets, however all omission schemes known to us are regular, including the following examples, so we will use the notation for regular sets. We present examples for systems with two processes but they can be easily extended to any arbitrary graph. The set Σ = {◦•, ◦←•, ◦→•, ◦ •} is the set of directed graphs with two nodes ◦ and •. The subgraphs in Σ describe what can happen during a given round with the following interpretation: – ◦• : all messages that are sent are correctly received; – ◦←• : the message from process ◦, if any, is not received; – ◦→• : the message from process •, if any, is not received; – ◦ • : no messages are received. Example 1. The set {◦•}ω corresponds to a reliable system. The set O1 = {◦•, ◦←•, ◦→•}ω is well studied and corresponds to the situation in which there is at most one omission per round. Example 2. The set H = {◦←•, ◦→•}ω describes a system in which at most one message can be successfully received in any round, and if only one message is sent, it might not be received. The examples above are examples of mobile omission schemes. The following is a typical example of a non-mobile omission scheme. Example 3. Consider a system in which at most one of the processes can crash. From the communications point of view, this is equivalent to a system in which it is possible that no messages are transmitted by one of the processes after some arbitrary round. The associated omission scheme is the following: C1 = {◦•ω } ∪ {◦•}∗ ({◦←•ω } ∪ {◦→•ω }). Reliable Execution of a Distributed Algorithm Subject to Omissions. Given an omission scheme S, we define what is a successful execution of a given algorithm A with a given initial configuration ι. Every process can execute the following communication primitives: – send(v, msg) to send a message msg to an out-neighbour v, – recv(v) to receive a message from an in-neighbour v. An execution, or run, of an algorithm A subject to scenario w ∈ S is the following. Consider process u and one of its out-neighbours v. During round r ∈ N, a message msg is sent from u to v, according to algorithm A. The corresponding recv(v) will return msg only if E , the r-th letter of w, is such that (u, v) ∈ E . Otherwise the returned value is null. All messages sent in a round can only be received in the same round. After sending and receiving messages, all processes update their states according to A and the messages they received. Given u ∈ Pref (w), let sx (u) denote the state of process x at the end of the |u|-th round of algorithm A subject to scenario w. The initial state of x is ι(x) = sx (ε). A configuration corresponds to the collection of local states at the end of a given round. An execution of A subject to w is the (possibly infinite) sequence of such message exchanges and corresponding configurations.
34
E. Godard and J. Peters
Remark 1. With this definition of execution, the environment is independent of the actual behaviour of the algorithm, so communication failures do not depend upon whether or not messages are sent. This model is not suitable for modelling omissions caused by congestion. See [5] for examples of threshold-based models. Definition 4. A algorithm A solves a problem P subject to omission scheme S with initial configuration ι, if, for any scenario w ∈ S, there exists u ∈ Pref (w) such that the state sx (u) of each process x ∈ V satisfies the specifications of P for initial configuration ι. In such a case, A is said to be S-reliable for P. Definition 5. If there exists an algorithm that solves a problem P subject to omission scheme S, then we say that P is S−solvable.
3
The Problems
The Binary Consensus Problem. A set of synchronous processes wishes to agree about a binary value. This problem was first identified and formalized by Lamport, Shostak and Pease [8]. Given a set of processes, a consensus protocol must satisfy the following properties for any combination of initial values [6]: – Termination: every process decides some value; – Validity: if all processes initially propose the same value v, then every process decides v; – Agreement : if a process decides v, then every process decides v. Consensus with these termination and decision requirements is more precisely referred to as Uniform Consensus (see [10] for a discussion). Given a fault environment, the natural questions are: is Consensus solvable, and if it is solvable, what is the minimum number of rounds to solve it? The Broadcast Problem. Let G = (V, E) be a graph. There is a broadcast algorithm from u ∈ V , if there exists an algorithm that can successfully transmit any value stored in u to all nodes of G. The Broadcast problem on graph G is to find a u ∈ V and an algorithm A such that A is a broadcast algorithm from u. Given an omission scheme S on G, G is S-broadcastable if there exists a u ∈ V such that there is an S-reliable broadcast algorithm A from u. First Reduction. This is quite well known but leads to interesting questions. Proposition 1. Let G be a graph and S an omission scheme for G. If G is S-broadcastable, then Consensus is S-solvable on G. We now present an example that shows that the converse is not always true. Example 4. The omission scheme H = {◦←•, ◦→•}ω of Example 2 is a system for which there is a Consensus algorithm but no Broadcast algorithm. It is easy to see that it is not possible to broadcast from ◦ (resp. •) subject to H because ◦←•ω (resp. ◦→•ω ) is a possible scenario. However, the following one-round algorithm (the same for both processes) is an H−reliable Consensus algorithm:
Consensus vs. Broadcast in Communication Networks
35
– send the initial value; – if a value is received, decide this value, otherwise decide the initial value. This algorithm is correct, as exactly one process will receive a value, but it is not possible to know in advance whose value will be received. We propose to study the following: when is the solvability of Consensus equivalent to the solvability of Broadcast? Given a graph G, what are the schemes S on G such that Consensus is S-solvable and G is S-broadcastable. In the process, we give a simple characterization of the solvability of Broadcast and a necessary condition for the solvability of Consensus subject to mobile omission schemes.
4
Broadcastability
Flooding Algorithms. We start with a basic definition and lemma. Definition 6. Consider a sub-digraph H of G and a node u ∈ V . A node v ∈ V is reachable from u in H if there is a directed path from u to v in H. Node u is a source for H if every v ∈ V is reachable from u in H. The set of sources of an event H ∈ Σ is B(H) = {u ∈ V | u is a source for H}. In a flooding algorithm, one node repeatedly sends a message to its neighbours, and each other node repeatedly forwards any message that it receives to its neighbours. The following useful lemma (from folklore) about synchronous flooding algorithms is easily extended to the omission context. Let Fur denote a flooding algorithm that is originated by u ∈ V and that halts after r rounds. Lemma 1. A node u ∈ V is a source for H if and only if for all r ≥ |V |, Fur is H ω −reliable for the Broadcast problem. Characterizations of Broadcastability with Arbitrary Omissions We have the following obvious but fundamental lemma. We say that a node is informed if it has received the value from the originator of a broadcast. Lemma 2. Let u ∈ V, r ∈ N, and let Inform(w) be the set of nodes informed by Fur under the partial execution subject to w ∈ Σ ∗ . Then for any subword w of w, Inform(w ) ⊆ Inform(w). Theorem 1. Let G be a graph and R a set of communication events for G. Then G is Rω −broadcastable if and only if there exists u ∈ V that is a source for all H ∈ R. Proof. In the first direction, suppose that we have a broadcast algorithm from a given u that is Rω −reliable. Then an execution subject to H ω is successful for any H ∈ R, so u is a source for H by Lemma 1. |R|×|V | to be the broadIn the other direction, choose the flooding algorithm Fu |R|×|V | cast algorithm and consider a scenario w ∈ R . There is an event H ∈ R that appears at least |V | times in w, hence H |V | is a subword of w. As u is a source for H by Lemma 1, Inform(H |V | ) = V . By Lemma 2, Inform(w) = V , and the flooding algorithm is Rω −reliable.
36
E. Godard and J. Peters
Definition 7. Let H1 , . . . , Hq ∈ Σ. Then the set {H1 , . . . , Hq } is source-incompatible if ∀1 ≤ i ≤ q, B(Hi ) = ∅, and 1≤i≤q B(Hi ) = ∅. With these definitions we can restate Theorem 1: Theorem 2. Let G be a graph and R a set of communication events for G. Then G is Rω −broadcastable if and only if every event in R has a source, and R is not source-incompatible. A Converse Reduction. This relation describes how some communication events are collectively indistinguishable to nodes of U . Definition 8. Given U ⊂ V , and H, H ∈ Σ, we define the following relation αU on Σ: HαU H if U ∩ h ((H ∪ H )\(H ∩ H )) = ∅. Next, we define the equivalence relation βR . This relation is the transitive closure of the relation between communication events that are indistinguishable from the point of view of the set of sources of a communication event. Definition 9. Let R ⊂ Σ and H, H ∈ R. Then HβR H if there exist H1 , . . . , Hq ∈ R and A1 , . . . , Aq+1 ∈ R such that ∀i, 0 ≤ i ≤ q, Hi αB(Ai+1 ) Hi+1 , where H0 = H and Hq+1 = H .2 Example 5. In O1 from Example 1, there is only one equivalence class. Let’s see why. The sets of sources are B(◦←•) = {•}, B(◦→•) = {◦}, and B(◦•) = {◦, •}. We have ◦←• α{◦} ◦• and ◦→• α{•} ◦•. Therefore, all communication events are βO1 −equivalent. In Example 2, βH has two equivalence classes, and every node can distinguish immediately which communication event happened. As will be seen later in Section 6, the omission schemes in [12] and [13], and more generally, all schemes that are defined by bounding the number of omissions in some way, have only one β−class when they are source-incompatible. Finally, Theorem 3. Let G a graph and R a set of communication events for G. If Consensus is Rω −solvable then for every βR −class C, G is C ω −broadcastable.
5
Proof of Main Theorem
Preliminaries. First we consider the cases in which there are events without sources. The proof of the following proposition is straightforward. Proposition 2. If there is an H ∈ R that has no source, then Consensus is not Rω −solvable. The proof of the main theorem uses an approach that is similar to the adjacency and continuity techniques of [12]. So, we will first prove these two properties. What should be noted is that the adjacency and continuity properties are mainly consequences of the fact that the scheme is a mobile scheme. 2
If the set of events R is clear from the context, we will write β instead of βR .
Consensus vs. Broadcast in Communication Networks
37
Lemma 3. Let H be a subgraph of G, and let (s, t) ∈ H. If t ∈ B(H) then s ∈ B(H). Proposition 3 (Adjacency Property). Let H ∈ R and w, w ∈ Rω such that sp (w) = sp (w ) for all p ∈ B(H). Then for all k ∈ N and all p ∈ B(H), sp (wH k ) = sp (w H k ). Proof. The proof relies upon Lemma 3 which implies that processes from B(H) can only receive information from B(H) under scenario H k , for any k ∈ N.
Lemma 4. Let H, H ∈ R such that HαB(A) H for some A ∈ R. Then for all w ∈ Rω and all p ∈ B(A), sp (wH) = sp (wH ). Proof. By definition of αU relations, processes in B(A) cannot distinguish H from H meaning they are receiving the exact same messages from exactly the same nodes in both scenarios. Hence they end in the same states.
Proposition 4 (Continuity Property). Let Then for every w ∈ Rω , there exist H1 , . . . , Hq and A0 , . . . , Aq ∈ R, such that for every 0 ≤ sp (wHi ) = sp (wHi+1 ), where H0 = H and Hq+1 Proof. By Lemma 4 and definition of β.
H, H ∈ R such that HβH . in the β−class of H and H , i ≤ q and every p ∈ B(Ai ), = H .
End of Proof of Theorem 3. We will use a standard bivalency technique. We suppose that we have an algorithm that solves Consensus. A configuration is said to be 0−valent (resp. 1−valent) if all extensions decide 0 (resp. 1). A configuration is said to be bivalent subject to L if there exists an extension in L that decides 0 and another extension in L that decides 1. Lemma 5 (Restricted Initial Bivalent Configuration). If there exists a source-incompatible set D, then there exists an initial configuration that is bivalent subject to Dω . Proof. Suppose that {H1 , . . . , Hq } is a source-incompatible set in D. There exist disjoint non-empty sets of nodes M1 , . . . , Mk such that ∀i, ∃I ⊂ [1, k], B(Hi ) = j∈I Mj . Consider ι0 (resp. ιk ) in which all nodes of 1≤j≤k Mj have initial value 0 (resp. 1). The initial configuration ι0 is indistinguishable from the configuration in which all nodes have initial value 0 for the nodes of B(Hi ) under scenario Hiω , for every i. Hence ι0 is 0−valent. Similarly ιk is 1−valent. We consider now the initial configurations ιl , 1 ≤ l ≤ k − 1 in which all nodes from 1≤j≤k−l Mj have initial value 0, and all other nodes have initial value 1. Suppose now that all initial configurations are univalent. Then there exists 1 ≤ l ≤ k such that ιl−1 is 0−valent and ιl is 1−valent. As the set is sourceincompatible, there must exist i ∈ [1, q] such that Ml ∩ B(Hi ) = ∅. So, we can apply Proposition 3 to Hi . This means that all nodes in B(Hi ) decide the same value for both initial configurations, ιl−1 and ιl , under scenario Hiω , and this is a contradiction.
38
E. Godard and J. Peters
Lemma 6 (Restricted Extension). Let C be a β−class. Every bivalent configuration in C ω has a succeeding bivalent configuration in C ω . Proof. Consider a bivalent configuration obtained after a partial execution subject to w ∈ C ∗ . By way of contradiction, suppose that all succeeding configurations in C ω are univalent. Then there exist succeeding configurations wH and wH that are respectively 0−valent and 1−valent, as w is bivalent. By Proposition 4, there exist H1 , . . . , Hq in C and A0 , . . . , Aq ∈ R such that sp (wHi ) = sp (wHi+1 ) for every 0 ≤ i ≤ q and every p ∈ B(Ai ), where H0 = H and Hq+1 = H . By hypothesis, all succeeding configurations wHi are univalent. As HαB(A0 ) H1 , we get that processes in B(A0 ) are in the same state after H and after H1 . Hence, by Proposition 3, they are also in the same state after HAk0 and after H1 Ak0 , so they decide the same value and wH1 is 0−valent. We can repeat this for any 1 ≤ i ≤ q. Hence wH is also 0−valent, a contradiction.
Suppose that we have a source-incompatible set in the same β−class C. Also suppose that there exists an Rω −reliable Consensus algorithm for G. By Lemma 5, there exists an initial configuration that is bivalent in C ω . From Lemma 6, we deduce that the algorithm does not satisfy the Termination property for Consensus on some execution subject to C ω ⊂ Rω , which is a contradiction. Using Proposition 2 and Theorem 2, we conclude the proof of Theorem 3.
6
Solvability of Consensus vs. Broadcast
Now we prove that the Consensus and Broadcast problems are equivalent for the large family of omission schemes that are defined over convex sets of events. These are the sets of communication events R such that, for every H, H ∈ R and every a ∈ H , H ∪ {a} ∈ R. Basically, this says that a convex set of communication events R is closed under the operation of adding a reliable communication event a from one event H to another event H. This is an important subfamily because sets of events that are defined by bounding the number of omissions, for any way of counting them, are convex. Stated differently, adding links to an event H with a bounded number of omissions cannot result in an event with more omissions. The convexity property does not depend upon the way that omissions are counted. Theorem 4. Let R ⊂ Σ be a convex set of communication events over a graph G. Then Consensus is Rω −solvable if and only if G is Rω −Broadcastable. Proof. By Theorem 3, we only have to show that there is no source-incompatible set in R. We will show that if there is such a set {H1 , . . . , Hq }, then there is only one βR class. There exist disjoint, non-empty sets of nodes M1 , . . . , Mk such that ∀i, ∃I ⊂ [1, k], B(Hi ) = j∈I M j . The Mj are “generators” for the sets of sources. We use MJ to denote j∈J Mj for any J ⊂ [1, k]. Note that, as the intersection of the Hi is empty (Definition 7), for each j ∈ [1, k], there exists ij such that Mj ∩ B(Hij ) = ∅.
Consensus vs. Broadcast in Communication Networks
39
Now, consider H1 = H2 ∈ R. We will show that H1 β (H1 ∪ H2 ). Using the decomposition into Mj s, there exist three mutually disjoint (possibly empty) subsets J1 , J, J2 of [1, k], such that B(H1 ) = MJ1 ∪J and B(H2 ) = MJ2 ∪J . Let H1 = H1 ∪ {(s, t) ∈ H2 | t ∈ MJ1 }. As the intersection of B(H2 ) with MJ1 is empty, we have H1 αB(H2 ) H1 . Similarly, letting H1 = H1 ∪ {(s, t) ∈ H1 | t ∈ MJ2 }, we have H1 αB(H1 ) H1 . To obtain H1 ∪ H2 , we need to add to H1 thearcs with heads in B(H1 ) ∩ B(H2 ) = MJ . Let J = {j1 , . . . , jq } and Kk = H1 l≤k Mjl . For each l ∈ J, there exists il such that Ml ∩ B(Hil ) = ∅. Therefore, for all k, Kk−1 αB(Hik ) Kk . So, H1 β (H1 ∪ H2 ). And H2 β (H1 ∪ H2 ), so H1 βH2 .
Let Of (G) denote the set of communication events with at most f omissions from the underlying graph G. An upper bound on f for solvability of Consensus subject to Of (G)ω was given in [12], and it was proved to be tight with an ad hoc technique in [4]. This result is now an immediate corollary of Theorem 4. Corollary 1. Let f ∈ N. Consensus is solvable subject to Of (G)ω if and only if f < c(G), where c(G) is the connectivity of the graph G. Proposition 5. Let R ⊂ Σ be a convex set of events. Then Consensus is solvable with exactly the same number of rounds as Broadcast subject to Rω . Proof. We only have to show that Consensus cannot be solved in fewer rounds than Broadcast. Due to space limitations, we only present a sketch of the proof. We use the same bivalency technique as in Section 5. So, suppose that Consensus is solvable in rc rounds while Broadcast needs more than rc rounds for any originator. First, we show that there must be a bivalent initial configuration. Let V = {v1 , . . . , vn } and let ιl be the initial configuration in which vi has initial value 0 if i ≤ l. If all initial configurations ιl , 1 ≤ l ≤ n are univalent, then there exists l such that ιl−1 is 0−valent and ιl is 1−valent. As a Broadcast from vl needs strictly more than rc rounds, there exists a vertex v that does not receive the value from vl , so no executions of length rc of the Consensus algorithm from initial configurations ιl−1 and ιl can be distinguished by v. Consequently v will decide the same value for both initial configurations, a contradiction. Now we show that if all extensions of a bivalent configuration are univalent, then the Consensus algorithm needs more than rc rounds to conclude. Indeed, if we have an extension, starting with communication event H0 , that is 0−valent, and another extension, starting with communication event H1 , that is 1−valent, we can repeat the above technique by adding arcs to H0 to obtain H0 ∪ H1 . The addition of arcs can be done by grouping them according to their heads. If only one node has a different state for two events, then it would need more than rc rounds to inform all other nodes.
There are many results concerning the Broadcast problem in special families of networks. Based on the results in [2,3], we get the following bounds for Consensus in hypercubes.
40
E. Godard and J. Peters
Corollary 2. In hypercubes of dimension n, if the global number of omissions is at most f per round, then 1. if f ≥ n, then Consensus is not solvable, 2. if f = n − 1, Consensus is solvable in exactly n + 2 rounds, 3. if f = n − 2, Consensus is solvable in exactly n + 1 rounds, 4. if f < n − 2, Consensus is solvable in exactly n rounds. c a
c b
a
b
d
d
Fig. 1. Event H1
Fig. 2. Event H2
Example 6. This example shows that there are mobile schemes that are broadcastable but for which Consensus is solvable in fewer rounds than Broadcast. Let R = {H1 , H2 } where H1 (resp. H2 ) is given by Fig. 1 (resp. Fig. 2). One can see that d needs two rounds to broadcast in H1 , and c needs two rounds to broadcast in H2 . Nodes a and b need more than two rounds. However there is a Consensus algorithm that finishes in one round. Notice that every node can detect which of the communication events actually happened, so the Consensus algorithm in which every node decides the value from c if H1 happened and the value from d if H2 happened uses only one round.
7
Conclusion
We have presented a new necessary condition for solving Consensus on communication networks subject to arbitrary mobile omission faults. We conjecture that this condition is actually sufficient, therefore leading to a complete characterization of the solvability of Consensus in environments with arbitrary mobile omissions. For a large class of environments that includes any environment defined by bounding the number of omissions during any round, for any way of counting omissions, we proved that the Consensus problem is actually equivalent to the Broadcast problem. We also gave examples (Ex. 2 and Ex. 6) showing how Consensus can differ from Broadcast for some environments. Finally, by factoring out the broadcastability properties required to solve Consensus, we think that it is possible to extend this work to other kinds of failures, such as byzantine communication faults.
References 1. Charron-Bost, B., Schiper, A.: The heard-of model: computing in distributed systems with benign faults. Distributed Computing 22(1), 49–71 (2009)
Consensus vs. Broadcast in Communication Networks
41
2. Dobrev, S., Vrto, I.: Optimal broadcasting in hypercubes with dynamic faults. Information Processing Letters 71, 81–85 (1999) 3. Dobrev, S., Vrto, I.: Dynamic faults have small effect on broadcasting in hypercubes. Discrete Applied Mathematics 137(2), 155–158 (2004) 4. Fevat, T., Godard, E.: About minimal obstructions for the coordinated attack problem. In: IPDPS 2011 (2011) 5. Kr´ aloviˇc, R., Kr´ aloviˇc, R., Ruziˇcka, P.: Broadcasting with many faulty links. Proceedings in Informatics 17, 211–222 (2003) 6. Lynch, N.A.: Distributed Algorithms. Morgan Kaufmann, San Francisco (1996) 7. Moses, Y., Rajsbaum, S.: A layered analysis of consensus. SIAM Journal on Computing 31(4), 989–1021 (2002) 8. Pease, L., Shostak, R., Lamport, L.: Reaching agreement in the presence of faults. Journal of the ACM 27(2), 228–234 (1980) 9. Pin, J., Perrin, D.: Infinite Words. Elsevier, Amsterdam (2004) 10. Raynal, M.: Consensus in synchronous systems:a concise guided tour. IEEE Pacific Rim International Symposium on Dependable Computing 0, 221 (2002) 11. Santoro, N., Widmayer, P.: Time is not a healer. In: Cori, R., Monien, B. (eds.) STACS 1989. LNCS, vol. 349, pp. 304–313. Springer, Heidelberg (1989) 12. Santoro, N., Widmayer, P.: Agreement in synchronous networks with ubiquitous faults. Theor. Comput. Sci. 384(2-3), 232–249 (2007) 13. Schmid, U., Weiss, B., Keidar, I.: Impossibility results and lower bounds for consensus under link failures. SIAM Journal on Computing 38(5), 1912–1951 (2009)
Reconciling Fault-Tolerant Distributed Algorithms and Real-Time Computing (Extended Abstract) Heinrich Moser and Ulrich Schmid Embedded Computing Systems Group (E182/2), Technische Universit¨ at Wien, 1040 Vienna, Austria {moser,s}@ecs.tuwien.ac.at
Abstract. We present generic transformations, which allow to translate classic fault-tolerant distributed algorithms and their correctness proofs into a real-time distributed computing model (and vice versa). Owing to the non-zero-time, non-preemptible state transitions employed in our real-time model, scheduling and queuing effects (which are inherently abstracted away in classic zero step-time models, sometimes leading to overly optimistic time complexity results) can be accurately modeled. Our results thus make fault-tolerant distributed algorithms amenable to a sound real-time analysis, without sacrificing the wealth of algorithms and correctness proofs established in classic distributed computing research. By means of an example, we demonstrate that real-time algorithms generated by transforming classic algorithms can be competitive even w.r.t. optimal real-time algorithms, despite their comparatively simple real-time analysis.
1
Introduction
Executions of distributed algorithms are typically modeled as sequences of zerotime state transitions (steps) of a distributed state machine. The progress of time is solely reflected by the time intervals between steps. Owing to this assumption, it does not make a difference, for example, whether messages arrive at a processor simultaneously or nicely staggered in time: Conceptually, the messages are processed instantaneously in a step at the receiver when they arrive. The zero step-time abstraction is hence very convenient for analysis, and a wealth of distributed algorithms, correctness proofs, impossibility results and lower bounds have been developed for models that employ this assumption [3]. In real systems, however, computing steps are neither instantaneous nor arbitrarily preemptible: A computing step triggered by a message arriving in the middle of the execution of some other computing step is delayed until the current computation is finished. This results in queuing phenomenons, which depend not only on the actual message arrival pattern, but also on the queuing/scheduling discipline employed. Real-time systems research has established powerful techniques for analyzing those effects [11], such that worst-case response times and even end-to-end delays [12] can be computed. A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 42–53, 2011. c Springer-Verlag Berlin Heidelberg 2011
Reconciling Fault-Tolerant Distributed Algorithms
43
Our real-time model for message-passing systems introduced in [8,9] reconciles the distributed computing and the real-time systems perspective: By replacing zero-time steps by non-zero time steps, it allows to reason about queuing effects and puts scheduling in the proper perspective. In sharp contrast to the classic model, the end-to-end delay of a message is no longer a model parameter, but results from a real-time analysis based on job durations and communication delays. In view of the wealth of distributed computing results, determining the properties which are preserved when moving from the classic zero step-time model to the real-time model is important: This transition should facilitate a real-time analysis without invalidating classic distributed computing analysis techniques and results. In [6,5], we developed powerful general transformations: We showed that a system adhering to some particular instance of the real-time model can simulate a system that adheres to some instance of the classic model (and vice versa). All the transformations presented in [6] were based on the assumption of a fault-free system, however. Contributions: In this paper, we generalize our transformations to the faulttolerant setting: Processors are allowed to either crash or even behave arbitrarily (Byzantine) [2]. We define (mild) conditions on problems, algorithms and system parameters, which allow to re-use classic fault-tolerant distributed algorithms in the real-time model, and to employ classic correctness proof techniques for faulttolerant distributed algorithms designed for the real-time model. As our transformations are generic, i.e., work for any algorithm adhering to our conditions, proving their correctness has already been a non-trivial exercise in the fault-free case [6], and became definitely worse in the presence of failures. We apply our transformation to the well-known problem of Byzantine agreement and analyze the timing properties of the resulting real-time algorithm. The full paper version of this extended abstract—including all proofs and more detailed explanations—can be found in an accompanying research report [10]. Related Work: We are not aware of much existing work that is similar in spirit to our approach. In order to avoid repeating the overview of related work already presented in [8] and [6], we relegated it to the research report as well.
2
System Models
A distributed system consists of a set of processors and some means for communication. In this paper, we will assume that a processor is a state machine running some kind of algorithm and that communication is performed via message-passing over point-to-point links between pairs of processors. The algorithm specifies the state transitions the processor may carry out. In distributed algorithms research, the common assumption is that state transitions are performed in zero time. Thus, transmission delay bounds typically represent end-to-end delay bounds: All kinds of delays are abstracted away in one system parameter.
44
H. Moser and U. Schmid
sending p 0
1
2
3
m
4
5
6
7
8
9
10 11 12
0
1
2
3
m
4
5
6
7
8
9
10 11 12
enqueuing q 0
1
2
3
4
5
6
7
8
9
10 11 12
δ
processing
ω μ Δ 0
(a) Timing parameters for some msg. m
1
2
3
4
5
6
7
8
9
10 11 12
(b) Enqueuing shown explicitly
Fig. 1. Real-time model
The transformations introduced in this paper will relate two different distributed computing models. In both models, processors are equipped with hardware clocks and connected via reliable links. Classic model: In what we call the classic synchronous model, processors execute zero-time steps (called actions) and the only model parameters are lower and upper bounds on the end-to-end delays [δ − , δ + ]. Real-time model: In this model, the zero-time assumption is dropped, i.e., the end-to-end delay bounds are split into bounds on the transmission time of a message (which we will call message delay) [δ − , δ + ] and on the actual processing time [μ− , μ+ ]. In contrast to the actions of the classic model, we call the nonzero-time computing steps in the real-time model jobs. Figure 1 shows the major timing-related parameters, namely, message delay (δ, measured from the beginning of the sending job), queuing delay (ω), end-toend delay (Δ = δ + ω), and processing delay (μ) for the message m represented by the dotted arrows. The bounds on the message delay δ and the processing delay μ are part of the system model (but need not be known to the algorithm). Bounds on the queuing delay ω and the end-to-end delay Δ, however, are not parameters of the system model—in sharp contrast to the classic model. Rather, those bounds (if they exist) must be derived from the system parameters [δ − , δ + ], [μ− , μ+ ] and the message pattern of the algorithm, by performing a real-time analysis. These system parameters may depend on the number of messages sent + in the sending job: For example, δ(3) is the upper bound on the message delay of messages sent by a job sending three messages in total. Running an algorithm will result in an execution in a classic system and a realtime run (rt-run) in a real-time system. An execution is a sequence of zero-time actions (which encapsulate both message reception and processing), whereas an rt-run is a sequence of receive events, jobs, and drop events. On non-faulty processors, every incoming message causes a receive event and either a job—if the
Reconciling Fault-Tolerant Distributed Algorithms
45
message is accepted by the (non-idling, non-preemptive) scheduling/admission policy—or a drop event. 2.1
Failures and Admissibility
A failure model indicates whether a given execution or rt-run is admissible w.r.t. a given system running a given algorithm. In this work, we restrict our attention to the f -f -ρ failure model, which is a hybrid failure model ([4,13,1]) that incorporates both crash and Byzantine faulty processors. Of the n processors in the system, – at most f ≥ 0 may crash and – at most f ≥ 0 may be arbitrarily faulty (“Byzantine”). All other processors are called correct. A given execution (resp. rt-run) conforms to the f -f -ρ failure model, if all message delays are within [δ − , δ + ] (resp. [δ − , δ + ]) and the following conditions hold: – All timers set by a processor trigger an action (resp. a receive event) at their designated hardware clock time. For notational convenience, expiring timers are modeled as incoming timer messages. – On all non-Byzantine processors, clocks drift by at most ρ. – All correct processors make state transitions as specified by the algorithm. In the real-time model, they obey the scheduling/admission policy, and all of their jobs take between μ− and μ+ time units. – A crashing processor behaves like a correct one until it crashes. In the classic model, all actions after the crash do not change the state and do not send any messages. In the real-time model, after a processor has crashed, all messages in its queue are dropped, and every new message arriving will be dropped immediately rather than being processed. Unclean crashes are allowed: the last action/job on a processor might execute only a prefix of its state transition sequence. In the analysis and the transformation proofs, we will examine given executions and rt-runs. Therefore, we know which processors behaved correct, crashing or Byzantine faulty. Note, however, that this information is only available during analysis; the algorithms themselves, including the simulation algorithms presented in the following sections, do not know which of the other processors are faulty. The same holds for timing information: While, during analysis, we can say that an event occurred at some exact real time t, the only information available to the algorithm is the local hardware clock reading at the beginning of the action or the job. 2.2
State Transition Traces
The global state of a system is composed of the current real-time t and the local state of every processor sp . Rt-runs do not allow a well-defined notion of global
46
H. Moser and U. Schmid
states, since they do not fix the exact time of state transitions in a job. Thus, we use the “microscopic view” of state-transition traces (st-traces) to assign real-times to all atomic state transitions. Example 1. Let J be a job in a real-time run ru, which starts in state oldstate, sends some message, then switches to some state s and finally to state newstate. If tr is an st-trace of ru, it contains the following state transition events (stevents) ev and ev : – ev = (transition : t , p, oldstate, s) – ev = (transition : t , p, s, newstate) t ≤ t , and both must be between the start and the end time of J. In addition, every input message m arriving at some time t∗ is represented by an st-event (input : t∗ , m). Input messages are messages from outside the system that can be used, for example, to start an algorithm. Clearly, there are multiple possible st-traces for a single rt-run. Executions in the classic model have corresponding st-traces as well, with the st-events having the same time as the corresponding action. A problem P is defined as a set of (or a predicate on) st-traces. An execution or an rt-run satisfies a problem if tr ∈ P holds for all its st-traces. If all st-traces of all admissible rt-runs (or executions) of some algorithm in some system satisfy P, we say that this algorithm solves P in the given system.
3
Transformation Real-Time to Classic Model
As the real-time model is a generalization of the classic model, the set of systems covered by the classic model is a strict subset of the systems covered by the realtime model. More precisely, every system in the classic model can be specified in terms of the real-time model with [δ − = δ − , δ + = δ + ] and [μ− = 0, μ+ = 0]. Intuition tells us that impossibility results also hold for the general case, i.e., that an impossibility result for some classic system holds for all real-time systems with [δ − ≤ δ − , δ + ≥ δ + ] and arbitrary [μ− , μ+ ], because the additional delays do not provide the algorithm with any useful information. As it turns out, this conjecture is true: There is a simulation that allows to use an algorithm designed for the real-time model in the classic model—and, thus, to transfer impossibility results from the classic to the real-time model—provided the following conditions hold: Cond1. Problems must be simulation-invariant. [6] Informally speaking, the problem only cares about a subset of the processors’ state variables and their hardware clock values. Cond2. The delay bounds in the classic system must be at least as restrictive − + as those in the real-time system. As long as δ() ≤ δ − and δ() ≥ δ + holds (for all ), any message delay of the simulating execution (δ ∈ [δ − , δ + ]) can be directly mapped to a message delay in the simulated rt-run (δ = δ), such
Reconciling Fault-Tolerant Distributed Algorithms m1
m2
m4
m3
(fin.proc.) m1
m2
(fin.proc.)
m4
m3
proc. m1
47
proc. m3 drop m2
drop m4
Fig. 2. Example: Execution ex of S A,pol,µ and corresponding rt-run ru of A
− + that δ ∈ [δ() , δ() ] is satisfied. Thus, a simulated message corresponds directly to a simulation message with the same message delay. [10] shows how this − + requirement can be weakened to δ(1) ≤ δ − ∧ δ(1) ≥ δ+. Cond3. Hardware clock drift must be reasonably low. Assume a system with very inaccurate hardware clocks, combined with very accurate processing delays: In that case, timing information might be gained from the processing delay, for example, by increasing a local variable by (μ− + μ+ )/2 during each computing step. If ρ is very high and μ+ − μ− is very low, the precision of this simple “clock” might be better than the one of the hardware clock. Thus, algorithms might in fact benefit from the processing delay, as opposed to the zero step-time situation. To avoid such effects, the hardware clock must be “accurate enough” to define (time-out) a time span which is guaranteed to lie within μ− and μ+ .
The complete proof is contained in [10]. Note that it is technically very different from the proof in the fault-free setting [8,6], since (Byzantine) failures may not only affect the simulated algorithm, but also the simulation algorithm. Roughly, the proof proceeds as follows: Let A be a real-time algorithm that solves some problem P in some real-time system s under failure model f -f -ρ. Simulation: We run algorithm S A,pol,μ in a classic system s. S A,pol,μ consists of algorithm A on top of an algorithm that simulates a real-time system with scheduling (according to some scheduling policy pol) and queueing effects. It simulates jobs with a duration between μ− and μ+ by setting a timer—denoted (fin.proc.), i.e., “finished processing” in Fig. 2—and enqueuing all messages that arrive before the timer has expired. Transformation: As a next step, we transform every execution ex of S A,pol,μ into a corresponding rt-run ru of A (see Figure 2): The jobs simulated by (fin.proc.) messages are mapped to “real” jobs in the rt-run. Note that, on Byzantine processors, every action in the execution can simply be mapped to a corresponding receive event and a zero-time job, since jobs on Byzantine nodes do not need to obey any timing restrictions. It can be shown that ru is an admissible rt-run of A conforming to failure model f -f -ρ.
48
H. Moser and U. Schmid
State transition argument: Since (a) ru is an admissible rt-run of algorithm A in s, and (b) A is an algorithm solving P in s, it follows that ru satisfies P. Choose any st-trace trru of ru where all state transitions are performed at the beginning of the job. Since ru satisfies P, trru ∈ P. The transformation ensures that exactly the same state transitions are performed in ex and ru (omitting the variables required by the simulation algorithm). Since (i) P is a simulationinvariant problem, (ii) trru ∈ P, and (iii) every st-trace trex of ex performs the same state transitions on algorithm variables as some trru of ru at the same time, it follows that trex ∈ P and, thus, ex satisfies P. By applying this argument to every admissible execution ex of S A,pol,μ in s, we see that every such execution satisfies P. Thus, S A,pol,μ solves P in s under failure model f -f -ρ.
4
Transformation Classic to Real-Time Model
When running a real-time model algorithm in a classic system, as shown in the previous section, the st-traces of the simulated rt-run and the ones of the actual execution are very similar: Ignoring variables solely used by the simulation algorithm, it turns out that the same state transitions occur in the rt-run and in the corresponding execution. Unfortunately, this is not the case for transformations in the other direction, i.e., running a classic model algorithm in a real-time system: The st-traces of a simulated execution are usually not the same as the st-traces of the corresponding rt-run. While all state transitions of some action ac at time t always occur at this time, the transitions of the corresponding job J take place at some arbitrary time between the beginning and the end of the job. Thus, there could be algorithms that solve some problem in the classic model, but fail to do so in the real-time model. Fortunately, however, it is possible to show that if some algorithm solves some problem P in some classic system, the same algorithm can be used to solve a variant of P, denoted Pμ∗+ , in some corresponding real-time system, where the end-to-end delay bounds Δ− and Δ+ of the real-time system equal the message delay bounds δ − and δ + of the simulated classic system. For the fault-free case, this has been shown in [6]. Definition 2. [6] Let tr be an st-trace. A μ+ -shuffle of tr is constructed by moving transition st-events in tr at most μ+ () time units into the future without violating causality. Every st-event may be shifted by a different value v, 0 ≤ v ≤ μ+ () . In addition, input st-events may be moved arbitrarily far into the past. Pμ∗+ is the set of all μ+ -shuffles of all st-traces of P. A typical example for μ+ -shuffles is the Mutual Exclusion problem: If P is 5second gap mutual exclusion (no processor may enter the critical section for 5 seconds after the last processor left it), then Pμ∗+ with μ+ = 2 is 3-second gap mutual exclusion. If P is causal mutual exclusion (there is a causal chain between consecutive exit and enter operations), then P = Pμ∗+ . [6]
Reconciling Fault-Tolerant Distributed Algorithms
49
Formally, the following conditions must be satisfied for the transformation to work in the fault-tolerant case: Cond1. There is a feasible end-to-end delay assignment [Δ− , Δ+ ] = [δ − , δ + ]. Finding such an assignment might require a (non-trivial) real-time analysis to break the circular dependency: On the one hand, the (classic) algorithm might need to know δ − and δ + . On the other hand, the (real-time) end-to-end delay bounds Δ− and Δ+ involve the queuing delay and are thus dependent on the message pattern of the algorithm and, hence, on δ − and δ + . Cond2. The scheduling/admission policy (a) only drops irrelevant messages and (b) schedules input messages in FIFO order. “Irrelevant messages” that do not cause an algorithmic state transition could be, for example, messages that obviously originate from a faulty sender or, in round-based algorithms, late messages from previous rounds. Cond3. The algorithm tolerates late timer messages, and the scheduling policy ensures that timer messages get processed soon after being received. In the classic model, a timer message scheduled for hardware clock time T gets processed at time T . In the real-time model, on the other hand, the message arrives when the hardware clock reads T , but it might get queued if the processor is busy. Still, an algorithm designed for the classic model might depend on the message being processed exactly at hardware clock time T . Thus, either (a) the algorithm must be tolerant to timers being processed later than their designated arrival time or (b) the scheduling policy must ensure that timer messages do not experience queuing delays—which might not be possible, since we assume a non-idling and non-preemptive scheduler. Combining both options yields the following condition: The algorithm tolerates timer messages being processed up to α real-time units after the hardware clock read T , and the scheduling policy ensures that no timer message experiences a queuing delay of more than α. Options (a) and (b) outlined above correspond to the extreme cases of α = ∞ and α = 0. These requirements can be encoded in failure models: f -f -ρ+latetimersα , a failure model on executions in the classic model, is weaker than f -f -ρ (i.e., ex ∈ f -f -ρ ⇒ ex ∈ f -f -ρ+latetimersα ), since timer messages may arrive late by at most α seconds in the former. On the other hand, f -f -ρ+precisetimersα , a failure model on rt-runs in the real-time model that restricts timer message queuing by the scheduler to at most α seconds, is stronger than the unconstrained f -f -ρ (i.e., ru ∈ f -f -ρ+precisetimersα ⇒ ru ∈ f -f -ρ). Again, the complete proof is contained in [10], and it follows the same line of reasoning as the one in the previous section. This time, no simulation is required (SA := A), and the transformation is straight-forward by mapping each job to an action occurring at the begin time of the job.
5
Example: The Byzantine Generals
We consider the Byzantine Generals problem [2]: A commanding general must send an order to his n − 1 lieutenant generals such that
50
H. Moser and U. Schmid
IC1. All loyal lieutenants obey the same order. IC2. If the commanding general is loyal, then every loyal lieutenant obeys the order he sends. In the context of computer science, generals are processors, orders are binary values and loyal means fault-free. It is well-known that f Byzantine faulty processors can be tolerated if n > 3f . The challenge lies in the fact that a faulty processor might send out asymmetric information: The commander might send value 0 to the first lieutenant, value 1 to the second lieutenant and no message to the remaining lieutenants. Thus, the lieutenants (some of which might be faulty as well) need to exchange information afterwards to ensure that IC1 is satisfied. [2] presents an “oral messages” algorithm, which we will call A: Initially (round 0), the value from the commanding general is broadcast. Afterwards, every round basically consists of broadcasting all information received in the previous round. After round f , the non-faulty processors have enough information to make a decision that satisfies IC1 and IC2. What makes this algorithm interesting in the context of this paper is the fact that (a) it is a synchronous round-based algorithm and (b) the number of messages exchanged during each round increases exponentially: After receiving v from the commander in round 0, each lieutenant p sends “p : v” to all other lieutenants in round 1. In round 2, it relays the messages received in the previous round, e.g., processor q would send “q : p : v”, meaning: “processor q says: (processor p said: (the commander said: v))”, to all processors except p, q and the commander. More generally, in round r ≥ 2, every processor multicasts #S = (n − 2) · · · (n − r) messages, each sent to n − r − 1 recipients, and receives #R = (n − 2) · · · (n − r − 1) messages. Implementing synchronous rounds in the classic model is straightforward when the clock skew is bounded; for simplicity, we will hence assume that the hardware clocks are perfectly synchronized. At the beginning of a round (at some hardware clock time t), all processors perform some computation, send their messages and set a timer for time t + δ + , after which all messages for the current round have been received and processed and the next round can start. We model these rounds as follows: The round start is triggered by a timer message. The triggered action, labeled as C, (a) sets a timer for the next round start and (b) initiates the broadcasts (using a timer message that expires immediately). The broadcasts are modeled as #S actions on each processor (labeled as S), connected by timer messages that expire immediately. Likewise, the #R actions receiving messages are labeled R. To make this algorithm work in the real-time model, one would need to determine the longest possible round duration W , i.e., the maximum time required for any one processor to execute all its C, S and R jobs, and replace the delay of the “start next round” timer from δ + to this value. Let us take a step back and examine the problem from a strictly formal point of view: Given algorithm A, we will try to satisfy Cond1, Cond2 and Cond3, so that the transformation of Sect. 4 can be applied. For this example, let us restrict our failure model to a set of f processors that produce only benign message patterns, i.e., a faulty processor may crash or
Reconciling Fault-Tolerant Distributed Algorithms
51
modify the message contents arbitrarily, but it must not send additional messages or send the messages at a different time (than a fault-free or crashing processor would). We will denote this restricted failure model as f ∗ and claim (proof omitted) that the result established in Sect. 4 also holds for this model, i.e., that a classic algorithm conforming to model f ∗ +latetimersα can be transformed to a real-time algorithm in model f ∗ +precisetimersα. Let us postpone the problem of determining a feasible assignment (Cond1) until later. Cond2 can be satisfied easily by choosing a suitable scheduling/admission policy. Cond3 deals with timer messages, and this needs some care: Timer messages must arrive “on time” or the algorithm must be able to cope with late timer messages or a little bit of both (which is what factor α in Cond3 is about). In A, we have two different types of timer messages: (a) the timer messages initiating the send actions and (b) those starting a new round. How can we ensure that A still works under failure model f ∗ +latetimersα (in the classic model)? If the timers for the S jobs each arrive α time units later, the last send action occurs #S · α time units after the start of the round instead of immediately at the start of the round. Likewise, if the timer for the round start occurs α time units later, everything is shifted by α. To take this shift into account, we just have to set the round timer to δ + + (#S + 1)α. As soon as we have a feasible assignment, the transformation of Sect. 4 will guarantee that SA solves P = Pμ∗+ = IC1 + IC2 under failure model f ∗ +precisetimersα. For the time being, we choose α = μ+ (n−1) , so the round + + timer in SA waits for Δ + (#S + 1)μ(n−1) time units. This is a reasonable choice: Since the S jobs are chained by timer messages expiring immediately, these timer messages are delayed at least by the duration of the job setting the timer. We will later see that μ+ suffices. (n−1) Returning to Cond1, the problem of determining Δ+ can be solved by a + very conservative estimate: Choose Δ+ = δ(n−1) + μ+ + #fS · μ+ + (#fR − (0) (n−1) f f 1)μ+ (0) , with #S and #R denoting the maximum number of send and receive jobs (= the number of such jobs in the last round f ); this is the worst-case time required for one message transmission, one C, all S and all R except for one (= the one processing the message itself). Clearly, the end-to-end delay of one round r message—consisting of transmission plus queuing but not processing— cannot exceed this value if the algorithm executes in a lock-step fashion and no rounds overlap. This is ensured by the following lemma: For all rounds r, the following holds: (a) The round timer messages on all processors start processing simultaneously. (b) As soon as the round timer messages starting round r arrive, all messages from round r − 1 have been processed. Since, for our choice of Δ+ , f + + the round timer waits for δ(n−1) + (#fS + #S + 1)μ+ (n−1) + #R · μ(0) time units, it is plain to see that this is more than enough time to send, transmit and process all pending round r messages by choosing a scheduling policy that favors C jobs before S jobs before R jobs. Formally, this can be shown by a simple induction on r. Considering this scheduling policy and this lemma, it becomes apparent
52
H. Moser and U. Schmid
p1
C
S
S
S
R
R
p2
C
S
S
S
R
R
#S · μ+ (n−r−1)
#R · μ+ (0)
Fig. 3. Example rt-run of a Byzantine Generals round
that α = μ+ (n−1) was indeed sufficient (see above): A timer for an S job is only delayed until the current C or S job has finished. Thus, we end up with an algorithm SA satisfying IC1 and IC2, with syn+ chronous round starts and a round duration of δ(n−1) + (#fS + #S + 1)μ+ (n−1) + #fR · μ+ . (0) Competitive Factor: Since the transformation is generic and does not exploit the round structure, the round duration is considerably larger than necessary: Our transformation requires one fixed “feasible assignment” for Δ+ ; thus, we had to choose #fS and #fR instead of #S and #R , which are much smaller for early rounds. Since the rounds are disjoint—no messages cross the “round barrier”—and δ + /Δ+ are only required for determining the round duration, the transformation results still hold if α and Δ+ are fixed per round. This allows us to choose + + + + + α = μ+ (n−r−1) and Δ = δ(n−r−1) + μ(0) + #S · μ(n−r−1) + (#R − 1)μ(0) , resulting in a round duration of + + + W est = μ+ (0) + (2#S + 1)μ(n−r−1) + δ(n−r−1) + (#R − 1)μ(0) .
Even though the round durations are quite large—they increase exponentially with the round number—it turns out that this bound obtained by our model transformation is only a constant factor away from the optimal solution, i.e., from the round duration W opt determined by a precise real-time analysis [7]: W est ≤ 4W opt [10]. In conjunction with the fact that the transformed algorithm is much easier to get and to analyze, this reveals that our generic transformations are indeed a powerful tool for obtaining real-time algorithms.
6
Conclusions
We introduced a real-time model for message-passing distributed systems with processors that may crash or even behave Byzantine, and established simulations that allow to run an algorithm designed for the classic zero-step-time model in some instance of the real-time model (and vice versa). Precise conditions that guarantee the correctness of these transformations are also given. The real-time model thus indeed reconciles fault-tolerant distributed and real-time computing,
Reconciling Fault-Tolerant Distributed Algorithms
53
by facilitating real-time analysis without sacrificing classic distributed computing knowledge. In particular, our transformations allow to re-use existing classic fault-tolerant distributed algorithms and proof techniques in the real-time model, resulting in solutions which are competitive w.r.t. optimal real-time algorithms.
References 1. Biely, M., Schmid, U., Weiss, B.: Synchronous consensus under hybrid process and link failures. Theoretical Computer Scienc (in Press, Corrected Proof, 2010) 2. Lamport, L., Shostak, R., Pease, M.: The Byzantine generals problem. ACM Transactions on Programming Languages and Systems 4(3), 382–401 (1982) 3. Lynch, N.: Distributed Algorithms. Morgan Kaufman Publishers, Inc., San Francisco (1996) 4. Meyer, F.J., Pradhan, D.K.: Consensus with dual failure modes. In: Digest of Papers of the 17th International Symposium on Fault-Tolerant Computing, pp. 48–54 (July 1987) 5. Moser, H.: A Model for Distributed Computing in Real-Time Systems. Ph.D. thesis, Technische Universit¨ at Wien, Fakult¨ at f¨ ur Informatik (May 2009) 6. Moser, H.: Towards a real-time distributed computing model. Theoretical Computer Science 410(6-7), 629–659 (2009) 7. Moser, H.: The byzantine generals’ round duration. Research Report 9/2010, Technische Universit¨ at Wien, Institut f¨ ur Technische Informatik, Treitlstr. 1-3/182-2, 1040 Vienna, Austria (2010) 8. Moser, H., Schmid, U.: Optimal clock synchronization revisited: Upper and lower bounds in real-time systems. In: Shvartsman, M.M.A.A. (ed.) OPODIS 2006. LNCS, vol. 4305, pp. 95–109. Springer, Heidelberg (2006) 9. Moser, H., Schmid, U.: Reconciling distributed computing models and real-time systems. In: Proceedings Work in Progress Session of the 27th IEEE Real-Time Systems Symposium (RTSS 2006), Rio de Janeiro, Brazil, pp. 73–76 (December 2006) 10. Moser, H., Schmid, U.: Reconciling fault-tolerant distributed algorithms and realtime computing. Research Report 11/2010, Technische Universit¨ at Wien, Institut f¨ ur Technische Informatik, Treitlstr. 1-3/182-1, 1040 Vienna, Austria (2010), http://www.vmars.tuwien.ac.at/documents/extern/2770/RR.pdf 11. Sha, L., Abdelzaher, T., Arzen, K.E., Cervin, A., Baker, T., Burns, A., Buttazzo, G., Caccamo, M., Lehoczky, J., Mok, A.K.: Real time scheduling theory: A historical perspective. Real-Time Systems Journal 28(2/3), 101–155 (2004) 12. Tindell, K., Clark, J.: Holistic schedulability analysis for distributed hard real-time systems. Microprocess. Microprogram. 40(2-3), 117–134 (1994) 13. Widder, J., Schmid, U.: Booting clock synchronization in partially synchronous systems with hybrid process and link failures. Distributed Computing 20(2), 115– 140 (2007), http://www.vmars.tuwien.ac.at/documents/extern/2282/journal. pdf
Self-stabilizing Hierarchical Construction of Bounded Size Clusters Alain Bui1 , Simon Clavi`ere1 , Ajoy K. Datta2 , Lawrence L. Larmore2, and Devan Sohier1 1
PRiSM (UMR CNRS 8144), Universit´e de Versailles St-Quentin-en-Yvelines {alain.bui,simon.claviere,devan.sohier}@prism.uvsq.fr 2 School of Computer Science, University of Nevada, Las Vegas, NV 89154 {ajoy.datta,lawrence.larmore}@unlv.edu
Abstract. We present a self-stabilizing clustering algorithm for asynchronous networks. Our algorithms works under any scheduler and is silent. The sizes of the clusters are bounded by a parameter of the algorithm. Our solution also avoids constructing a large number of small clusters. Although the clusters are disjoint (no node belongs to more than one cluster), the clusters are connected to form a tree so that the resulting overlay graph is connected. The height of the tree of clusters is bounded by the diameter of the network. Keywords: clustering, distributed algorithm, self-stabilization, silent algorithm, unfair daemon.
1 Introduction Large-scale networks are becoming very common in distributed systems. In order to efficiently manage these networks, various techniques are being developed in the distributed and networking research community. In this paper, we focus on one of those techniques, the clustering of networks, i.e., the partition of a system in disjoint connected subsystems. In this paper, we present a self-stabilizing [10, 11] (that is, starting from an arbitrary configuration, the network will eventually reach a legitimate configuration) and silent (that is, at some point, the network will be in a legitimate state and no further computation is performed) asynchronous cluster construction algorithm. Given two integers, Cluster Safe ≤ Cluster Max, our goal is to design clusters of size between those two bounds. Some graphs cannot be clustered in such a way, such as a star graph with a sufficiently large number of processes. Instead, we impose a slightly weaker condition: if a cluster has size less than Cluster Safe, it cannot be adjacent to any other cluster whose size is less than Cluster Max. We also want the communication links to connect the entire network, and thus, we need links between clusters. For this, we design a tree structure, called cluster tree, whose nodes are the clusters themselves.
This research was partially funded by the Foundation for Scientific Cooperation Digiteo.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 54–65, 2011. c Springer-Verlag Berlin Heidelberg 2011
Self-stabilizing Hierarchical Construction of Bounded Size Clusters
55
Related Work. The algorithms of [2, 13, 14, 15] produce clusters with radius one. Each cluster has a process called a clusterhead, and all other processes in that cluster are neighbors of the clusterhead. The solution in [15] is based on the algorithm in [2]. Clusters can be built using a hierarchical method, where the clustering algorithm can be iterated on the overlay network obtained by considering clusters as processes, until a single cluster is obtained [12, 18, 19, 20]. The algorithms in [3, 5, 6] are based on random walks. In [6], the clusters are built around bounded-size connected dominating sets. In [5], the clusters are of size greater than 2 and less than a bound (except for star graphs). In [3], the algorithm recursively breaks the network into two clusters as long as every cluster satisfies a lower bound. The solution given in [1] builds k-hop clusters (clusters of radius k). In [7, 8], selfstabilizing k-clustering algorithms are given. The solution in [8] uses unweighted edges, whereas the algorithm in [7] considers weighted edges. A self-stabilizing algorithm for cluster formation is also given in [17], where a density criterion (defined in [16]) is used to select clusterheads. A self-stabilizing and robust solution of bounded size cluster of radius one was presented in [14]. A robust self-stabilizing algorithm was defined in [14] as one that, starting in an arbitrary configuration, will reach a safe configuration quickly (constant number of rounds in the solution presented in [14]), and from there on, will maintain a safety predicate while converging to the legitimate configuration. In [9], an O(n)-time algorithm is given for computing a minimal k-dominating set; this set can then be used as the set of clusterheads for a k-clustering. To the best of our knowledge, we propose the first self-stabilizing distributed clustering algorithm based on cluster size. Our algorithm also provides a global inter-cluster communication structure, a cluster tree, which makes the clustering readily usable. We give detailed formal algorithm for both cluster construction and cluster tree. Due to lack of space, the detailed proof is available in the technical report [4]. Outline. The model and some additional definitions are given in Section 2. In Section 3, we give a formal specification of the clustering problem. In Section 4, we give an outline of our algorithm, HC. In Section 5, we give the cluster construction module, CC. In Section 6, we give the cluster tree module, CT.
2 Preliminaries We assume that we are given a network of processes, each of which has a unique ID which cannot be changed by our algorithm. (By an abuse of notation, we shall identify a process with its ID whenever convenient.) Each process x has a set of neighbors N (x). A self-stabilizing [10, 11] system is guaranteed to converge to the intended behavior in finite time, regardless of the initial state of the system. In particular, a self-stabilizing distributed algorithm will eventually reach a legitimate state within finite time, regardless of its initial configuration, and will remain in a legitimate state forever. An algorithm is called silent if all execution halts eventually. In the composite atomicity model of computation, each process can read the values of its own and its neighbors’ variables, but can write only to its own variables. We assume
56
A. Bui et al.
that each transition from a configuration to another, called a step of the algorithm, is driven by a scheduler, also called a daemon. The program of each process consists of a finite set of actions. Each action has two components: a guard and a statement. The guard of an action in the program of a process x is a Boolean expression involving the values of the variables of x and its neighbors. The statement of an action of x updates one or more variables of x. An action can be executed only if it is enabled, i.e., its guard evaluates to true. A process is said to be enabled if at least one of its actions is enabled. A step γi → γi+1 consists of one or more enabled processes executing an action. Evaluation of all guards and execution of all statements of an action are presumed to take place in one atomic step. A distributed algorithm is called uniform if every process has the same program. We use the distributed daemon. If one or more processes are enabled, the daemon selects at least one of these enabled processes to execute an action. We also assume that daemon is unfair, i.e., that it need never select a given enabled process unless it becomes the only enabled process.
3 Problem Specification Given a network G with unique IDs, and two integers Cluster Max, the problem is to construct clustering of G, where each cluster has at most Cluster Max members. We will say that a cluster is small or unsafe if its cardinality is less than another given constant Cluster Safe; otherwise we say it is large. There is no actual upper bound on the number of small clusters, but no two small clusters can be adjacent. For intra-cluster communication, we build a local spanning tree inside every cluster, and for inter-cluster communication, we build a cluster tree, a tree where the nodes are the clusters. The height of the cluster tree will be at most the diameter of G. There will be an overall leader of G, and C0 , the cluster that contains the leader, will be the root of the cluster tree. We require each cluster to have a designated process called its clusterhead, as well as a local spanning tree connected all processes of the cluster and rooted at that clusterhead, One process in each cluster C will be designated as its out-gate. If C = C0 , there is a cluster link from the out-gate of C to a neighboring process which belongs to another cluster, which we call the parent cluster of C; the parent of C in the cluster tree. We further specify that our algorithm be self-stabilizing and silent, and that it works under the unfair daemon.
4 Basic Idea of Our Solution Our algorithm, Hierarchical Clustering (HC), consists of three modules; leader election (LE), cluster construction (CC), and cluster tree construction (CT). For LE, we can use any existing self-stabilizing silent leader election algorithm, which we treat as a black box. The output of LE is a distinguished process called the leader, as well as a variable x.level for each process x, whose value is the distance from x to the leader. In CC any process can start a cluster. This process becomes the clusterhead of the cluster that it initiates, and tries to recruit adjacent processes.
Self-stabilizing Hierarchical Construction of Bounded Size Clusters
57
As a cluster C grows, and before it reaches maximum size, one process of C is its designated recruiter. To avoid bias in the pattern of growth, the role of recruiter is passed around among the current processes of C in a round-robin fashion. Each recruited process links to the local spanning tree of the cluster by choosing the process that recruited it as its parent. Each cluster has an assigned priority. If a cluster is large, but of size less than Cluster Max, it has priority over any small cluster, and if a cluster is small, its priority is the ID of its clusterhead. The recruiter of a process can “kill” a neighboring small cluster of lower priority, causing its processes to revert to, free, i.e., unclustered. The module CT constructs the cluster tree. The nodes of the cluster tree are the clusters themselves, and the root is the cluster which contains the leader. We define the level of a cluster C to be the minimum value of x.level for all x ∈ C. The parent of each cluster C = C0 is chosen to be a cluster adjacent to C which has a smaller level. Thus, the height of the cluster tree is at most the diameter of the network.
5 Cluster Construction We now give the formal definition of the module CC. We can classify the actions of CC into the three categories; initialization of a cluster, deletion of a cluster, and recruitment of processes to the cluster. Any free process can initiate a cluster. It then becomes the clusterhead, and sole member, of that cluster. The size of the cluster is initialized to 1. We write STN(x) for the set of all spanning tree neighbors of x, namely all processes connected to x by an edge of the local spanning tree. If the predicate Cluster Error(x) (which we define later) holds, and x ∈ C, then x will initiate deletion of Cluster(x). Also if x is recruited by a process in another cluster, then x initiates deletion of that Cluster(x). The deletion message moves through the cluster along the edges of the local spanning tree, and each process y ∈ Cluster(x) reverts to free status as soon as y is assured that all z ∈ STN(y) have received the deletion message. To eliminate bias in the growth of clusters, the processes of each cluster C take turns trying to recruit other processes in a round robin. A virtual “recruiting token” moves along the virtual loop of the cluster, a directed cycle which visits every process of C, which traverses every edge of the local spanning tree twice. If a process x ∈ C has d spanning tree neighbors, the recruiting token visits x d times. We counteract the resulting bias toward processes of high degree by permitting a process to recruit during only one of the d visits of the token. If x is the current recruiter of C, then x selects a process y ∈ N (x) which is not in C, and which is either free or belongs to a cluster of lower priority than C, if any. Then y is enabled to join C. If y belongs to another cluster, it initiates a deletion wave, ordering all members of its cluster to revert to free. If x recruits y, the spanning tree of C grows by the addition of the edge {x, y}, and y.local pntr ← x. The size of C is incremented by 1, and value of the new size is transmitted to all processes in C. We say that a cluster C is blocked if no neighbor of any process of C is enabled to join C. More specifically, C is blocked if every neighbor of every process of C is a
58
A. Bui et al.
member of a cluster of equal or higher priority. (That includes processes already in C, of course.) If C is blocked, it can recruit no processes, and all recruiting actions will eventually cease. We remark that a blocked cluster might become unblocked if one of its neighbor clusters is deleted. Should that occur, actions related to recruiting will once again be enabled. An example of recruiting is presented in the technical report [4]. Variables of CC. Each process x has the following variables. 1. x.status ∈ {free, clustered, dead}, the status of x. If x.status = dead, then x is still clustered, but will become free the next time it is selected. In the following list, we let C = Cluster(x). 2. x.cluster id, the ID of the leader of C. 3. x.loc level, the length of the unique path from x to the clusterhead of C. 4. Pointer variables x.local pntr, x.rec pntr, x.invite, x.next recruiter ∈ N (x)∪{⊥}; the parent pointer of x, the direction of the recruiter of C, the neighbor x is currently recruiting, and the successor to x in the virtual loop of C, respectively. 5. x.recruiting status ∈ {0, 1, 2, 3}, the recruiting status of x. (a) If x.recruiting status = 2, it means that x is the recruiter, the sole process within its cluster that is enabled to recruit free processes into the cluster. (b) If x.recruiting status = 3, then x is the recruiter, but has finished its job, and is waiting for its successor recruiter to change its recruiting status to 1. (c) If x.recruiting status = 0, then x is waiting for its next turn to be the recruiter. (d) If x.recruiting status = 1, it means that x is getting ready to become the recruiter. 6. x.blocked, Boolean, meaning that x has no further role to play in recruiting unless it becomes unblocked. 7. x.subtree cluster size, integer. Let R be the recruiting tree of C, the tree whose root is the recruiter and whose processes are the same as those of C. Then x.subtree cluster size is the number of processes in Rx , the subtree of R rooted at x. The values of subtree cluster size are computed in a convergecast wave of R. 8. x.cluster size, integer, the size of C. The recruiter computes the cluster size from subtree cluster size, and then broadcasts that value to all processes in C. Functions of CC. Each process is able to compute each of these functions, using its own and its neighbors’ variables. 1. Clean(x), Boolean, means that all variables of x have their default values. That is, x.status = free, x.recruiting status = 0, x.cluster id = ⊥, x.local pntr = ⊥, x.rec pntr = ⊥, x.invite = ⊥, x.loc level = 0, x.subtree cluster size = 0, and x.cluster size = 0. 2. STN(x), the set of spanning tree neighbors of x. Formally, STN(x) is the set of all y ∈ N (x) such that y.local pntr = x or x.local pntr = y. 3. Loc Chldrn(x) = {y : y.local pntr = x}, the set of local spanning tree children of x.
Self-stabilizing Hierarchical Construction of Bounded Size Clusters
59
4. Rec Chldrn(x) = {y : y.rec pntr = x and x.rec pntr = y}, the set of recruiting tree children of C. 5. Subtree Cluster Size(x) = 1 + {y.subtree cluster size : y ∈ Rec Chldrn(x)}, the correct value of⎧ x.subtree cluster size. x.subtree cluster size if x.rec pntr = ⊥ ⎪ ⎪ ⎨ x.subtree cluster size + x.rec pntr.subtree cluster size 6. Cluster Size(x) = if x.rec pntr.rec pntr = x ⎪ ⎪ ⎩ x.rec pntr.cluster size otherwise the correct value of x.cluster size. 7. Cluster Valid(x), Boolean, which is true if x.status = clustered and the following conditions hold: (a) x.cluster id = ⊥ (b) x.local pntr ∈ N (x) ∪ {⊥} (c) x.cluster id = x ⇐⇒ x.local pntr = ⊥ (d) If x.local pntr = y then y.cluster id = x.cluster id (e) If x.local pntr = ⊥, then x.loc level = 0. Else, x.loc level = x.local pntr.loc level + 1. (f) x.rec pntr ∈ STN(x) ∪ {⊥} (g) x.rec pntr = ⊥ ⇐⇒ x.recruiting status ∈ {2, 3} (h) If y ∈ STN(x) then x.local pntr = y or y.local pntr = x. (i) If x.recruiting status = 1 then x.rec pntr.recruiting status is in {0, 3} (j) If x.rec pntr.rec pntr = x then x.recruiting status = 1 or x.rec pntr.recruiting status = 1. (k) x.invite ∈ N (x) ∪ {⊥} (l) x.next recruiter ∈ STN(x) ∪ {x, ⊥} (m) x.next recruiter = ⊥ ⇐⇒ x.recruiting status = 0 (n) If x.recruiting status = 2 and y ∈ STN(x) then y.recruiting status = 0 (o) Subtree Cluster Size(x) = x.subtree cluster size + 1 if x.recruiting status = 2, x.invite = ⊥, and x.invite.rec pntr = x; and x.subtree cluster size otherwise. (p) x.cluster size ≤ Cluster Size(x) (q) If x.recruiting status ∈ {1, 2, 3}, then x.cluster size = Cluster Size(x) (r) If x.recruiting status = 0 and x.rec pntr.rec pntr = x, then x.cluster size = Cluster Size(x) This can only happen if x.rec pntr.recruiting status = 1. (s) x.cluster size ≤ Cluster Max 8. Cluster Error(x), Boolean, which is true if x.status = clustered and ¬Cluster Valid(x). 9. Key(x) = ∞ if x.status = clustered, −∞ if x.status = clustered and x.cluster size ≥ Cluster Safe, and x.cluster id otherwise. Key(x) is the priority of Cluster(x). 10. Recruits(x) is the set of all processes which might be recruited by x. Formally ∅ if x.cluster size ≥ Cluster Max or x.status = clustered Recruits(x) = {y ∈ N (x) : x.cluster id < Key(y)} otherwise 11. Blocked(x) ≡ (Recruits(x) = ∅) ∧ (∀y ∈ Rec Chldrn(x) : y.blocked) 12. Unblocked Nbrs(x) = {y ∈ STN(x) : ¬y.blocked}
60
13. 14. 15. 16. 17. 18. 19. 20.
A. Bui et al.
⎧ ⎨ x if Unblocked Nbrs(x) = ∅ Unblocked Successor(x, y) = the successor of y in the circular ordering of ⎩ Unblocked Nbrs(x) ∪ {y} otherwise My Turn(x), Boolean, which is true if and only if x.next recruiter is the successor of x in the circular ordering of Unblocked Nbrs(x) ∪ {x}. Can Recruit(x) ≡ (Recruits(x) = ∅) ∧ My Turn(x), Boolean. Best Recruit(x) = min{y ∈ Recruits(x)} if Can Recruit(x), ⊥ otherwise. Inviters(x) = {y ∈ N (x) : y.invite= x, Key(x) > y.cluster id, y.status= clustered}. Invited(x), Boolean, meaning that Inviters(x) = ∅. Best Invitation = min {y.cluster id : y ∈ Inviters(x)} If ¬Invited(x), define Best Invitation(x) = ∞. Best Inviter(x) = min{y ∈ Inviters(x) : y.cluster id = Best Invitation(x)}. If ¬Invited(x), then Best Inviter(x) = ⊥ (undefined).
Actions of CC. The actions of CC are listed in priority order. No action is enabled if any action of listed earlier is enabled. For example, if Action 1 is enabled, no other action can execute. We first list the deletion actions of CC. 1. Error: If x.status = clustered and ¬Cluster Valid(x), then x.status ← dead. This causes the entire cluster that x belongs to, if any, to be deleted eventually. 2. Deletion Wave: If x.status = clustered and there is some y such that y ∈ STN(x) and y.status = dead; then x.status ← dead, x.next recruiter ← ⊥, and x.invite ← ⊥. 3. Delete: If x.status = dead and y.status = dead for all y ∈ STN(x), or if x.status = free and ¬Clean(x), then (a) x.status ← free (b) x.recruiting status ← 0 (c) x.cluster id ← ⊥ (d) x.local pntr ← ⊥ (e) x.rec pntr ← ⊥ (f) x.invite ← ⊥ (g) x.loc level ← 0 (h) x.subtree cluster size ← 0 (i) x.cluster size ← 0 We next list the recruitment actions of CC. 4. Update Cluster Size: If x.status = clustered and x.cluster size = Cluster Size(x) then x.cluster size ← Cluster Size(x). 5. Update Blocked: If x.status = clustered, x.recruiting status ∈ {0, 1}, and x.blocked = Blocked(x) then x.blocked ← Blocked(x). 6. Invite: If x.status = clustered, x.recruiting status = 2, x.invite = ⊥, and Can Recruit(x), then x.invite ← Best Recruit(x). 7. Kill Cluster: If x.status = clustered and Best Invitation(x) < Key(x), then x.status ← dead and x.invite ← ⊥. If a member of a cluster is recruited by another cluster, it must initiate deletion of its own cluster before accepting the invitation.
Self-stabilizing Hierarchical Construction of Bounded Size Clusters
61
8. Attach: If x.status = free and y = Best Inviter(x), and if y.cluster id = x, then (a) (b) (c) (d) (e) (f)
x.status ← clustered x.cluster id ← y.cluster id x.local pntr ← y x.blocked ← FALSE x.loc level ← y.loc level + 1 x.rec pntr ← y
(g) (h) (i) (j) (k)
x.next recruiter ← ⊥ x.invite ← ⊥ x.recruiting status ← 0 x.subtree cluster size ← 1 x.cluster size ← y.cluster size
9. Recruitment Done: If x.invite = y, x.recruiting status = 2, y.status = clustered, and either y.cluster id ≤ x.cluster id or y.cluster size ≥ Cluster Safe, then (a) x.invite ← ⊥. (b) x.cluster size ← x.subtree cluster size ← Subtree Cluster Size(x). (c) x.recruiting status ← 3. Whether the invitation to y is accepted or rejected, x does not send out another invitation, but lets the next process in the virtual loop have a turn at being recruiter. 10. No Recruits: If x.status = clustered, x.recruiting status = 2, x.invite = ⊥, and ¬Can Recruit(x), then (a) x.recruiting status ← 3. (b) x.cluster size ← x.subtree cluster size ← Subtree Cluster Size(x). 11. Invitation Error: If x.invite = ⊥ and x.recruiting status = 2, then x.invite ← ⊥. 12. Anticipate Recruiting: If x.status = clustered, x.recruiting status = 0, x.rec pntr.next recruiter = x, x.rec pntr.recruiting status = 3, and x.cluster size = Cluster Size(x) < Cluster Max, then (a) x.recruiting status ← 1 (b) x.next recruiter ← Unblocked Successor(x, y) 13. Start Recruiting: If x.status = clustered, x.recruiting status = 1, and y.recruiting status=0 for all y ∈ STN(x), then (a) x.recruiting status ← 2 (b) x.rec pntr ← ⊥ (c) x.subtree cluster size ← Subtree Cluster Size(x) 14. Pass Recruitment Token: If x.status = clustered, x.recruiting status = 3, x.next recruiter = x, and x.next recruiter.recruiting status = 1, then (a) x.recruiting status ← 0 (b) x.rec pntr ← x.next recruiter (c) x.next recruiter ← ⊥ (d) x.subtree cluster size ← Subtree Cluster Size(x) 15. Keep Recruitment Token: If x.status = clustered, x.recruiting status = 3, x.next recruiter = x, x.invite = ⊥, and Can Recruit(x), then (a) x.recruiting status ← 2 (b) x.next recruiter ← Unblocked Successor(x, x) 16. Unblocked Restart: If x.recruiting status = 3, x.next recruiter = x, and Unblocked Successor(x, x) = x, then x.next recruiter ← Unblocked Successor(x, x). This action is needed for some situations where previously blocked neighbors of x become unblocked.
62
A. Bui et al.
Finally, we give the one initialization action of CC. 17. Initialize Cluster: If x.status = free and y.local pntr = x for all y ∈ N (x), then (a) (b) (c) (d) (e) (f)
x.status ← clustered x.recruiting status ← 2 x.cluster id ← x x.local pntr ← ⊥ x.blocked ← FALSE x.rec pntr ← ⊥
(g) (h) (i) (j) (k)
x.next recruiter ← x x.invite ← ⊥ x.loc level ← 0 subtree cluster size ← 1 cluster size ← 1
Legitimate Configurations of CC. We say that a configuration of CC is legitimate if the following criteria hold. 1. For each process x, x.status = clustered, and x.invite = ⊥. 2. Each cluster C has the following properties. (a) There is one process ∈ C, which we call the clusterhead of C, such that x.cluster id = for all x ∈ C. (b) .local pntr = ⊥, and the pointers x.local pntr, for x ∈ C, define a rooted tree structure on C with root , which we call the rooted spanning tree of C. (c) x.loc level is the length of the path in C from x to , for all x ∈ C. (d) There is one process r ∈ C, which we call the recruiter of C, such that the pointers x.rec pntr define a rooted tree structure on C with root r, which we call the recruiting tree of C. In particular, r.rec pntr = ⊥, and x.rec pntr is the first link of the path in C from x to r, for all x ∈ C other than r. Note that the recruiting tree is topologically identical to the local spanning tree; it simply has a possibly different root. (e) r.recruiting status = 3, and x.recruiting status = 0 for all x ∈ C other than r. (f) If x ∈ C, then x.subtree cluster size is the cardinality of the subtree of the recruiting tree rooted at x. (g) For all x ∈ C, x.cluster size = |C| ≤ Cluster Max. (h) r.next recruiter = r, and x.next recruiter = ⊥ for all x ∈ C other than r. (i) x.blocked for all x ∈ C other than r. 3. If C1 , C2 are adjacent clusters whose clusterheads are 1 and 2 , respectively, and if 1 < 2 , then either |C2 | ≥ Cluster Safe or |C1 | = Cluster Max.
6 Construction of the Cluster Tree The third phase of HC, which we call CT, constructs the cluster tree of G, making use of the level variables computed by the first phase as well as the clusters computed by the second phase. In this section, we assume that both LE and CC are in legitimate configurations. Any calculations made by CT before LE and CC are done can be ignored, since we simply take the configuration at the point when LE and CC are done as the arbitrary start configuration of CT. Each cluster is an independent rooted tree, where the edges of the tree are the spanning tree edges and the root is the clusterhead. Let C0 be the cluster that contains the
Self-stabilizing Hierarchical Construction of Bounded Size Clusters
63
leader. If C is any cluster other than C0 , CT constructs a cluster link from some process of C, the out-gate of C, to some process of a neighboring cluster, which we call the parent cluster of C. (We shall see how CT avoids creating a cycle of clusters.) For each cluster, CT constructs a spanning tree of C rooted at its out-gate. The arcs of these spanning trees, together with the cluster links, form a rooted spanning tree of the network G. The two rooted spanning trees of a cluster C, the one constructed by CC and the one constructed by CT, are the same as undirected graphs, i.e., use the same set of edges. A given edge of the undirected tree will be used in each rooted tree, possibly oriented in the same direction, and possibly oriented in opposite directions. Outline of CT. Recall that Cluster(x) denotes the cluster containing x, as computed by CC. LE computes x.level for each process x, the distance from x to the leader. Let MT be a distributed. algorithm that computes the minimum value of any given function F on the processes of any tree network T , and broadcasts that value to all processes of T . We also require that MT construct pointers which give T the structure of a rooted tree with root the process which has the minimum value of F , and that MT is self-stabilizing and silent. We do not give a detailed construction of MT, rather, we will treat it as a black box. Variables. We now describe our implementation of CT. CT makes use of the following variables for each process x. 1. x.level, which is computed by the leader election algorithm LE, and whose value is the distance from x to the elected leader. 2. x.local pntr, the pointer from x to a spanning tree neighbor, pointing toward the clusterhead of the cluster that x belongs to. If x is the clusterhead, then x.local pntr = ⊥; otherwise, x.local pntr points to the second process in the path through the spanning tree of the cluster from x to the clusterhead. The values of x.local pntr are computed by CC. 3. x.cluster level, whose correct value is the minimum of y.level over all y in the cluster containing x. The values of x.cluster level are computed by the black box algorithm MT, using local pntr, loc level, and Level as inputs. We define Min Nbr Clstr Level(x) to be the minimum value of y.cluster level among all y ∈ N (x) ∪ {x}. 4. x.is gate, Boolean, which is true if and only if x has been selected to be the outgate of its cluster. Exactly one process in each cluster will be selected to be the out-gate. 5. x.min pntr, a pointer which will be ⊥ if x is the out-gate, and otherwise will be the second process in the path through the spanning tree of the cluster from x to the out-gate of the cluster. The values of x.is gate and x.min pntr will be computed by the black box algorithm MT, using the values of Min Nbr Clstr Level as inputs. 6. x.global pntr, the global pointer of x. The global pointers define a spanning tree of the entire network, rooted at the the clusterhead of the cluster which contains the leader. This spanning tree contains the spanning tree of each cluster as a subgraph.
64
A. Bui et al.
Functions. CT makes use of the following functions, which can each be computed locally by a process x. 1. Tree Valid(x), Boolean, which is true if and only if (a) x.status = clustered, (b) x.loc level = 0 ⇐⇒ x.local pntr = ⊥, (c) x.local pntr = y ⇒ x.loc level = y.loc level + 1, and (d) y.local pntr = x ⇒ y.loc level = x.loc level + 1. If ¬Tree Valid(x) for any x, then CC is not in a legitimate configuration. 2. Min Nbr Clstr Level(x) = min {y.cluster level : y ∈ N (x) ∪ {x}} ⎧ ⎨ min {y ∈ N (x) : y.cluster level = Min Nbr Clstr Level(x)} if x.is gate ∧ (x.cluster level > 0) 3. Global Pntr(x) = ⎩ x.min pntr otherwise Actions. First of all, no process x is enabled to execute any action of CT if that process is enabled to execute any action of either LE or CC, or if Tree Valid(x) is false. We list the actions of CT in priority order. 1. Cluster Level: If enabled to do so, x executes an action of the copy of MT which computes x.cluster level. When MT is silent, x.cluster level has its correct value for every x, provided both LE and CC are in legitimate configurations. We require that MR be designed so that a process x cannot execute any action of MR if Tree Valid(x) is false. 2. Out-Gate: If enabled to do so, x executes an action of the copy of MT which computes the out-gate of its cluster, as well as the pointers min pntr. We insist that no action of this copy of MT execute if Tree Valid(x) is false. 3. Global Pointer: If Tree Valid(x) and x.global pntr = Global Pntr(x), then x.global pntr ← Global Pntr(x).
7 Conclusion We have presented a self-stabilizing cluster construction algorithm, using cluster size as the main parameter. Clusters are linked together to form a cluster tree, whose height does not exceed the diameter of the network. Each cluster also has a local spanning tree. These local trees can be joined together, using the links of the cluster tree, to form a global spanning tree, whose stretch factor does not exceed the maximum size of any cluster. Our solution can be extended to design hierarchical clustering to reduce the size of routing tables. The design of routing protocols adapted to this new clustering technique (based on cluster size) is a topic of future research. Extension of this work to give an efficient solution for a dynamic environment should also be explored.
Self-stabilizing Hierarchical Construction of Bounded Size Clusters
65
References 1. Amis, A.D., Prakash, R., Huynh, D., Vuong, T.: Max-min d-cluster formation in wireless ad hoc networks. In: IEEE INFOCOM, pp. 32–41 (2000) 2. Basagni, S.: Distributed clustering for ad hoc networks. In: International Symposium on parallel Architectures, Algorithms and Networks (ISPAN), pp. 310–315 (1999) 3. Bernard, T., Bui, A., Pilard, L., Sohier, D.: A distributed clustering algorithm for large-scale dynamic networks. International Journal of Cluster Computing, doi:10.1007/s10586-0110153-z 4. Bui, A., Clavi`ere, S., Datta, A.K., Sohier, D., Larmore, L.L.: Self-stabilizing hierarchical construction of bounded size clusters. Technical Report, http://www.prism.uvsq.fr/rapports/2011/document_2011_30.pdf 5. Bui, A., Clavi`ere, S., Sohier, D.: Distributed construction of nested clusters with inter-cluster routing. IEEE Advances in Parallel and Distributed Computing Models (2011) 6. Bui, A., Kudireti, A., Sohier, D.: A fully distributed clustering algorithm based on random walks. In: International Symposium on Parallel and Distributed Computing (ISPDC 2009), pp. 125–128. IEEE CS Press, Los Alamitos (2009) 7. Caron, E., Datta, A.K., Depardon, B., Larmore, L.L.: A self-stabilizing k-clustering algorithm for weighted graphs. J. Parallel and Distributed Comp. 70, 1159–1173 (2010) 8. Datta, A.K., Larmore, L.L., Vemula, P.: A self-stabilizing O(k)-time k-clustering algorithm. The Computer Journal 53(3), 342–350 (2010) 9. Datta, A.K., Devismes, S., Larmore, L.L.: A random walk based clustering with local recomputations for mobile ad hoc networks. In: IPDPS, pp. 1–8 (2010) 10. Dijkstra, E.W.: Self stabilizing systems in spite of distributed control. Communications of the Association of Computing Machinery 17, 643–644 (1974) 11. Dolev, S.: Self-Stabilization. The MIT Press, Cambridge (2000) 12. Dolev, S., Tzachar, N.: Empire of colonies: Self-stabilizing and self-organizing distributing algorithm. Theoretical Computer Science 410, 514–532 (2009) 13. Ephremides, A., Wieselthier, J.E., Baker, D.J.: A design concept for reliable mobile radio networks with frequency hopping signaling. IEEE 75(1), 56–73 (1987) 14. Johnen, C., Mekhaldi, F.: Robust self-stabilizing construction of bounded size weight-based clusters. In: D’Ambra, P., Guarracino, M., Talia, D. (eds.) Euro-Par 2010. LNCS, vol. 6271, pp. 535–546. Springer, Heidelberg (2010) 15. Johnen, C., Nguyen, L.: Robust self-stabilizing weight-based clustering algorithm. Theoretical Computer Science 410(6-7), 581–594 (2009) 16. Mitton, N., Busson, A., Fleury, E.: Self-organization in large scale ad hoc networks. In: Mediterranean ad hoc Networking Workshop, MedHocNet (2004) 17. Mitton, N., Fleury, E., Guerin Lassous, I., Tixeuil, S.: Self-stabilization in self-organized multihop wireless networks. In: Second International Workshop on Wireless Ad Hoc Networking. IEEE Computer Society, Los Alamitos (2005) 18. Sucec, J., Marsic, I.: Location management handoff overhead in hierarchically organized mobile ad hoc networks. Parallel and Distributed Processing Symp. 2, 194 (2002) 19. Sung, S., Seo, Y., Shin, Y.: Hierarchical clustering algorithm based on mobility in mobile ad hoc networks. In: Gavrilova, M.L., Gervasi, O., Kumar, V., Tan, C.J.K., Taniar, D., Lagan´a, A., Mun, Y., Choo, H. (eds.) ICCSA 2006. LNCS, vol. 3982, pp. 954–963. Springer, Heidelberg (2006) 20. Yang, S.-J., Chou, H.-C.: Design issues and performance analysis of location-aided hierarchical cluster routing on the manet. In: International Conference on Communications and Mobile Computing, pp. 26–33. IEEE Computer Society, Los Alamitos (2009)
The Universe of Symmetry Breaking Tasks Damien Imbs1 , Sergio Rajsbaum2, , and Michel Raynal1,3 1
IRISA, Campus de Beaulieu, 35042 Rennes Cedex, France Instituto de Matem´aticas, UNAM, Mexico City, Mexico 3 Institut Universitaire de France {damien.imbs,raynal}@irisa.fr,
[email protected] 2
Abstract. Processes in a concurrent system need to coordinate using a shared memory or a message-passing subsystem in order to solve agreement tasks such as, for example, consensus or set agreement. However, coordination is often needed to “break the symmetry” of processes that are initially in the same state, for example, to get exclusive access to a shared resource, to get distinct names or to elect a leader. This paper introduces and studies the family of generalized symmetry breaking (GSB) tasks, that includes election, renaming and many other symmetry breaking tasks. Differently from agreement tasks, a GSB task is “inputless”, in the sense that processes do not propose values; the task only specifies the symmetry breaking requirement, independently of the system’s initial state (where processes differ only on their identifiers). Among various results characterizing the family of GSB tasks, it is shown that (non adaptive) perfect renaming is universal for all GSB tasks. Keywords: Agreement, Coordination, Decision task, Election, Disagreement, Distributed computability, Renaming, k-Set agreement, Symmetry Breaking, Universal construction, Wait-freedom.
1 Introduction Processes of a distributed system coordinate through a communication medium (shared memory or message-passing subsystem) to solve problems. If no coordination is ever needed in the computation, we then have a set of centralized, independent programs rather than a global distributed computation. Agreement coordination is one of the main issues of distributed computing. As an example, consensus is a very strong form of agreement where processes have to agree on the input of some process. It is a fundamental problem, and the cornerstone when one has to implement a replicated state machine (e.g.,[10,22,24]). We are interested here in coordination problems modeled as tasks [23]. A task is defined by an input/output relation Δ, where processes start with private input values forming an input vector I and, after communication, individually decide on output values forming an output vector O, such that O ∈ Δ(I). Several specific agreement tasks have been studied in detail, such as consensus [13] and set agreement [11]. Indeed, the importance of agreement is such that it has been studied deeply, from a more general
Partially supported by UNAM PAPIIT and PAPIME grants.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 66–77, 2011. c Springer-Verlag Berlin Heidelberg 2011
The Universe of Symmetry Breaking Tasks
67
perspective, defining families of agreement tasks, such as loop agreement [19], approximate agreement [12] and convergence [18]. Motivation. While the theory of agreement tasks is pretty well developed e.g. [17], the same substantial research effort has not yet been devoted to understanding symmetry breaking in general. This form of coordination is needed to “break symmetry” among the processes that are initially in a similar state. Indeed, specific forms of symmetry breaking have been studied, most notably election, mutual exclusion and renaming. It is easy to come up with more natural situations related to symmetry breaking. As a simple example, consider n persons (processes) such that each one is required to participate in exactly one of m distinct committees (process groups). Each committee has predefined lower and upper bounds on the number of its members. The goal is to design a distributed algorithm that allows these persons to choose their committees in spite of asynchrony and failures. Generalized symmetry breaking tasks. This paper introduces generalized symmetry breaking (GSB) tasks, a family of tasks that includes election, renaming [4], weak symmetry breaking (called reduced renaming in [20]), and many other symmetry breaking tasks. A GSB task for n processes is defined by a set of possible output values, and for each value v, a lower bound and an upper bound (resp., v and uv ) on the number of processes that have to decide this value. When these bounds vary from value to value, we say it is an asymmetric GSB task, otherwise we simply say it is a GSB task. For example, we can define the election asymmetric GSB task by requiring that exactly one process outputs 1 and exactly n − 1 processes output 2 (in this form of election, processes are not required to know which process is the leader). In the symmetric case, we use the notation n, m, , u-GSB to denote the task on n processes, for m possible output values, [1..m], where each value has to be decided at least and at most u times. In the m-renaming task, the processes have to decide new distinct names in the set [1..m]. Thus, m-renaming is nothing else than the n, m, 0, 1GSB task. In the k-weak symmetry breaking task a process has to decide one of two possible values, and each value is decided by at least k and at most (n − k) processes. This is the n, 2, k, n − k-GSB task. Let us notice that 1-WSB is the weak symmetry breaking task [20]. Symmetry breaking tasks seem more difficult to study than agreement tasks, because in a symmetry breaking task we need to find a solution given an initial situation that looks essentially the same to all processes. For example, lower bound proofs (and algorithms) for renaming are substantially more complex than for set agreement (e.g., [8,20]). At the same time, if processes are completely identical, it has been known for a long time that symmetry breaking is impossible [3] (even in failure-free models). Thus, as in previous papers, we assume that processes can be identified by initial names, which are taken from some large space of possible identities (but otherwise they are initially identical). Thus, in an algorithm that solves a GSB task, the outputs of the processes can depend only on their initial identities and on the interleaving of the execution. The symmetry of the initial state of a system fundamentally differentiates GSB tasks from agreement tasks. Namely, the specification of a symmetry breaking task is given simply by a set of legal output vectors denoted O that the processes can produce: in any execution, any of these output vectors can be produced for any input vector I
68
D. Imbs, S. Rajsbaum, and M. Raynal
(we stress that an input vector only defines the identities of the processes), i.e., ∀I we have Δ(I) = O. For example, for the election GSB task, O consists of all binary output vectors with exactly one entry equal to 1 and n − 1 equal to 2. In contrast, an agreement task typically needs to relate inputs and outputs, where processes should agree not only on closely related values, but in addition the values agreed upon have to be somehow related to the input values given to the processes. Notice that the n, m, 0, 1-GSB renaming task is different from the adaptive renaming task, where the size of the new name space depends on the number of processes that participate. Similarly, the classic test-and-set task looks similar to the election GSB task: in both cases exactly one process outputs 1. But test-and-set is adaptive: there is the additional requirement that in every execution, even if less than n processes participate (i.e., take steps), at least one process outputs 1. That is, election GSB is a non-adaptive form of test-and-set (where the winning process may start after a loosing process has terminated). Contributions. This paper investigates the family of GSB tasks in a shared memory, wait-free setting (where any number of processes can crash). Its main contributions are: – The introduction of the GSB tasks, and a formal setting to study them. It is shown that several tasks that were previously considered separately actually belong to the same family and can consequently be compared and analyzed within a single conceptual framework. It is shown that properties that were known for specific GSB tasks actually hold for all of them. Moreover, new GSB tasks are introduced that are interesting in themselves, notably the k-slot GSB task, the election GSB task and the k-weak symmetry breaking task. – The structure of the GSB family of tasks is characterized, identifying when two GSB tasks are actually the same task, giving a unique representation for each one. – Computability and complexity properties associated with the GSB task family are studied. First it is noticed that renaming is a GSB task. It is then shown that perfect renaming (i.e., when the n processes have to rename in the set [1..n]) is a universal GSB task. This means that any GSB task can be solved given a solution to perfect renaming. At the other extreme, (2n − 1)-renaming can be trivially solved without communication. Weak symmetry breaking and election are in between these two tasks: they are not solvable without communication. Moreover, election is strictly stronger than weak symmetry breaking. – As far as the k-slot task is concerned, a simple algorithm is presented that solves the (n + 1)-renaming task from the (n − 1)-slot GSB task. There is also a simple algorithm that solves the (2n − 2)-renaming task from the 2-slot GSB task. Some of the many interesting questions that remain open are listed in Section 7. Roadmap. The paper is made up of 7 sections. Section 2 presents the computation model. Section 3 defines the GSB tasks. Section 4 investigates the structure of the GSB task family and Section 5 addresses its computability and complexity issues. Section 6 presents a simple algorithm solving (n+1)-renaming from the (n−1)-slot task. Finally Section 7 lists open challenging problems. Due to page limitation, the reader will find in [21] more developments on GSB tasks, all proofs and a discussion with respect to related works (e.g., [14,15]). Relations between GSB tasks and k-set agreement are investigated in [7].
The Universe of Symmetry Breaking Tasks
69
2 Computation Model This paper considers the usual asynchronous, wait-free shared memory system where at most n − 1 out of n processes can fail by crashing, and the memory is made of singlewriter/multi-reader registers. Due to space limitations and the fact that this model is widely used in the literature, we do not explain it in detail here. A detailed description of this model is given in e.g. [21]. Nevertheless, we restate carefully some aspects of this model because we are interested in a comparison-based and an index-independent (called anonymous in [4]) solvability notion that are not as common. Indexes. The subscript i (used in pi ) is called the index of pi . Indexes are used only for addressing purposes. Namely, when a process pi writes a value to the array of 1WnR registers A, its index is used to deposit the value in A[i]. Also, when pi reads A, it gets back a vector of n values, where the j-th entry of the vector is associated with pj . However, we assume that the processes cannot use indexes for computation; we formalize this restriction below. System model. Each process pi has two specific local variables denoted inputi and outputi , respectively. The participating processes in a run are processes that take at least one step in that run. Those that take a finite number of steps are faulty (sometimes called crashed), the others are correct (or non-faulty). That is, the correct processes of a run are those that take an infinite number of steps. Moreover, a non-participating process is a faulty process. A participating process can be correct or faulty. This system model is denoted ASMn,t [∅], where up to t processes may crash. When 1 ≤ t ≤ n − 1, the model is called the t-resilient model. In the extreme case where t = n − 1, the system is called the wait-free system model [17]. In Section 5 and Section 6, processes are allowed to cooperate through certain objects, in addition to registers. When the objects implement some task T , the resulting model will be denoted ASMn,t [T ]. It is easy to extend the formal model to include these objects. Identities. Each process pi has an identity denoted idi that is kept in inputi. In this paper, we assume identities are the only possible input values. An identity is an integer value in [1..N ], where N > n (two identities can be compared with <, = and >). We assume that in every initial configuration of the system, the identities are distinct: i = j ⇒ inputi = inputj . No process “knows” the identity of the other processes. More precisely, every input configuration where identities are distinct and in [1..N ] is possible. Thus, processes “know” N and that no two processes have the same identity. Index-independent algorithm. We say that an algorithm A is index-independent if the following holds, for every run r and every permutation of the process indexes, π(). Let rπ be the run obtained from r by permuting the input values according to π(), and for each step, the index i of the process that executes the step is replaced by π(i). Then rπ is a run of A. For example, if in a run r process pi runs solo with idi = x, there is a permutation π() such that in run rπ there is a process pj that runs solo with idj = x. If the algorithm is index-independent, pj should behave in rπ exactly as pi behaves in r: it decides (writes in outputj ) the same value, and in the same step.
70
D. Imbs, S. Rajsbaum, and M. Raynal
Let us observe that, if outputi = v in a run r of an an index-independent algorithm, then outputπ(i) = v in run rπ . This formalizes the fact that indexes are only an addressing mechanism: the output of a process does not depend on indexes, it depends only on the inputs (ids) and on the interleaving. That is, all local algorithms are identical. Comparison-based algorithm. Intuitively, an algorithm A is comparison-based if processes use only comparisons (<, =, >) on their inputs. More formally, let us consider the ordered inputs i1 < i2 < · · · in < of a run r of A and any other ordered inputs j1 < j2 < · · · < jn . The algorithm A is comparison-based if the run r obtained by replacing in r each i by j , 1 ≤ ≤ n (in the corresponding process), is a run of A. Notice that each process decides the same output in both runs, and at the same step. 2.1 Decision Tasks Task. A one-shot decision problem is specified by a task (I, O, Δ), that consists of a set of input vectors I, a set of output vectors O, and a relation Δ that associates with each I ∈ I at least one O ∈ O (e.g. see Section 2.1 of [20]). All vectors are n-dimensional. A task is bounded if I is finite. Solving a task. An algorithm A solves a task T if the following holds: each process pi starts with an input value (stored in inputi ) and each non-faulty process eventually decides on an output value by writing it to its write-once register outputi . The input vector I ∈ I is such that I[i] = inputi and we say “pi proposes I[i]” in the considered run. Moreover, the decided vector J is such that (1) J ∈ Δ(I), and (2) each pi decides J[i] = outputi . More formally, Definition 1. Let 1 ≤ t < n. An n-process algorithm A solves a task (I, O, Δ) in ASMn,t [∅] if the following conditions hold in every run r with input vector I ∈ I where at most t processes fail: – Termination. There is a finite prefix of r, denoted dec prefix (r ) in which, for every non-faulty process pi , outputi = ⊥ in the last configuration of dec prefix (r ). – Validity. In every extension of dec prefix (r ) to a run r where every process pj (1 ≤ j ≤ n) is non-faulty (executes an infinite number of steps), the values oj eventually written into outputj , are such that [o1 , . . . , on ] ∈ Δ(I). Examples of tasks. The most famous task is the consensus problem [13]. Each input vector I defines the values proposed by the processes. An output vector is a vector whose all entries contain the same value. Δ is such that Δ(I) contains all vectors whose single value is a value of I. The k-set agreement task relaxes consensus allowing up to k different values to be decided [11]. Other examples of tasks are renaming [4], weak symmetry breaking e.g. [20] and k-simultaneous consensus [1]. The tasks considered in this paper. As already mentioned, this paper considers only tasks where I consists of all the vectors with distinct entries in the set of integers [1..N ]. That is, the inputs are the identities. Thus our tasks are bounded. Moreover, we consider only algorithms that are index-independent and comparison-based. When we consider the system model ASMn,t [∅] and an algorithm solving a task, for each input vector I, there is an initial configuration whose input values correspond to I. As mentioned before, two processes initially differ only in their identities.
The Universe of Symmetry Breaking Tasks
71
3 The Family of Generalized Symmetry Breaking (GSB) Tasks 3.1 Definition and Basic Properties As already indicated, it is assumed that, in every run, processes start with distinct ids between 1 and N and at most t processes fail. Informally, a generalized symmetry breaking (GSB) task for n processes, n, m, , u-GSB, = [1 , . . . , m ], u = [u1 , . . . , um ], is defined by the following requirements. Let us emphasize that parameters n, m, and u of a GSB task are statically defined. This means that the GSB tasks are non-adaptive. – Termination. Each correct process decides a value. – Validity. A decided value belongs to [1..m]. – Asymmetric agreement. Each value v ∈ [1..m] is decided by at least v and at most uv processes. When all lower bounds v are equal to some value , and all upper bounds uv are equal to some value u, the task is a symmetric GSB, and is denoted n, m, , u-GSB, with the corresponding requirement replaced by – Symmetric agreement. Each value v ∈ [1..m] is decided by at least and at most u processes. To define formally a task, let IN be the set of all the n-dimensional vectors with distinct entries in 1, . . . N . Moreover, given a vector V , let #x (V ) denote the number of entries in V that are equal to x. Definition 2 (GSB Task). For m, and u, n, m, , u-GSB is the task (IN , O, Δ), where O consists of all vectors O such that ∀ v ∈ [1..m] : v ≤ #v (O) ≤ uv , and for each I ∈ IN , Δ(I) = O. We say that the GSB task is feasible if O is not empty. Lemma 1 is easy to prove. m m Lemma 1. A GSB task is feasible if and only if v=1 v ≤ n ≤ v=1 uv . For the case of symmetric GSB tasks, the previous lemma can be re-stated as follows. Lemma 2. If ∀ v ∈ [1..m] : v = and ∀ v ∈ [1..m] : uv = u, then the GSB task is feasible if and only if m × ≤ n ≤ m × u. We fix for this paper N = 2n − 1. Thus, all the GSB tasks considered have the same set of input vectors, I2n−1 , denoted henceforth simply as I. The following lemma says that considering a set of identities of size larger than 2n − 1 is useless. Theorem 1. Consider two n, m, , u-GSB tasks, (IN , O, Δ), N ≥ 2n − 1, and (I, O, Δ) (whose only difference is in the set of input vectors). Then (IN , O, Δ) is wait-free solvable if and only if (I, O, Δ) is wait-free solvable. (Proof in [21]) Recall that an algorithm is comparison-based if processes use only comparison operations on their inputs. The following lemma generalizes another known (e.g., [9]) property about renaming and weak symmetry breaking. It states that we can assume without loss of generality that a GSB algorithm is comparison-based. This is useful for proving impossibility results (e.g., [5,8]). Theorem 2. Consider an n, m, , u-GSB task, T = (I, O, Δ). There exists a waitfree algorithm for T if and only if there exist a comparison-based wait-free algorithm for T . (Proof in [21])
72
D. Imbs, S. Rajsbaum, and M. Raynal
3.2 Instances of Generalized Symmetry Breaking Tasks Let us recall that parameters n, m, and u that define a GSB task are statically defined. Election. We can define the election asymmetric GSB task, by requiring that exactly one process outputs 1 and exactly n − 1 processes output 2. While election is a GSB task with asymmetric agreement, in this paper, we consider mostly GSB tasks with symmetric agreement. This means that the m values are equal with respect to decision. If in a correct run r, v is decided by x processes and w is decided by y processes, then the run r in which v is decided by y processes and w is decided by x processes (and the other values are decided as in r), is a correct run. The following are examples of symmetric GSB tasks. k-Weak symmetry breaking with k ≤ n/2 (k-WSB). This is the n, 2, k, n − k-GSB task which has a pretty simple formulation. A process has to decide one of two possible values, and each value is decided by at least k and at most (n − k) processes. Let us notice that 1-WSB is the well-known weak symmetry breaking (WSB) task. m-Renaming. In the m-renaming task the processes have to decide new distinct names in the set [1..m]. It is easy to see that m-renaming is the n, m, 0, 1-GSB task.1 Perfect renaming. The perfect renaming task is the renaming task instance whose size m of the new name space is “optimal” in the sense that there is no solution with m < m whatever the system model. This means that m = n. It is easy to see that this is the n, n, 1, 1-GSB task. k-Slot. This is a new task, defined as follows. Each process has to decide a value in [1..k] and each value has to be decided at least once. This is the n, k, 1, n-GSB task, or its synonym, the n, k, 1, n−k+1-GSB task. As we can see the WSB task is nothing else than the 2-slot task. Section 5 studies the difficulty of solving GSB tasks, their relative power, and discusses the difficulty of each one of the previous GSB tasks. As we shall see, some GSB tasks are solved trivially (i.e., with no communication at all). As an example, this is the case of m-renaming, m = 2n − 1, namely the n, 2n − 1, 0, 1-GSB task (as processes have identities between 1 and 2n − 1, a process can directly decide its own identity). In contrast, some GSB tasks are not wait-free solvable, such as perfect renaming. In fact, we shall see that perfect renaming is universal among GSB tasks.
4 The Structure of Symmetric GSB Tasks This section studies the combinatorial structure of symmetric GSB tasks, to analyze the following two issues: synonyms and containment of output vectors. This analysis is not distributed. Distributed complexity and computability issues are addressed in Section 5. Notice that G1 = n, m, 1 , u1 -GSB and G2 = n, m, 2 , u2 -GSB may actually be the same task T (i.e., both have the same set of output vectors). In this case we write 1
If m depends on the number of participating processes, the problem is called adaptive mrenaming task which is not a GSB task.
The Universe of Symmetry Breaking Tasks
73
G1 ≡ G2 , and say that G1 and G2 are synonyms. For example, n, 2, 1, n − 1-GSB, n, 2, 0, n − 1-GSB, and n, 2, 1, n-GSB are synonyms. Also, if the set S(T1 ) of the outputs vectors of a GSB task T1 is contained in the set S(T2 ) of the outputs vectors of a GSB task T2 , then clearly T2 cannot be more difficult to solve than T1 . As S(T1 ) ⊂ S(T2 ), any algorithm solving T1 also solves T2 . In this case, we write T1 ⊂ T2 . 4.1 The Structural Results Lemma 3. Let T be any n, m, , u-GSB task. Let u ≥ u and T be the n, m, , u GSB task. We have S(T ) ⊆ S(T ). (Proof in [21]) Lemma 4. Let T be any n, m, , u-GSB task. Let ≤ and T be the n, m, , uGSB task. We have S(T ) ⊆ S(T ). (Proof in [21]) The next theorem characterizes the hardest task of the sub-family of n, m, −, −-GSB tasks. Let us remember that T1 is harder than T2 if S(T1 ) ⊂ S(T2 ). n n Theorem 3. The n, m, m , m -GSB task T is the hardest task of the family of feasible n, m, −, −-GSB tasks. (Proof in [21])
Theorem 4. Let T be a feasible n, m, , u-GSB task, T 1 be the n, m, , u-GSB task where = n−u(m−1) and T 2 be the n, m, , u -GSB task where u = n−(m−1). We have the following: (i) ( ≥ ) ⇒ S(T 1) ⊆ S(T ) and (ii) (u ≤ u) ⇒ S(T 2) ⊆ S(T ). (Proof in [21]) Theorem 5 identifies the canonical representative of any feasible n, m, , u-GSB task. Theorem 5. Let T be a feasible n, m, , u-GSB task and f () be the function f (, u) = ( , u ) where = max(, n − u(m − 1)) and u = min(u, n − (m − 1)). The canonical representative of T is the n, m, fp , ufp -GSB task Tfp where the pair (fp , ufp ) is the fixed point of f (, u). (Proof in [21])
5 Complexity and Computability Recall that for an n, m, , u-GSB task T = (I, O, Δ), we have that Δ(I) = Δ(I ) = O, for any two input vectors I, I . Thus, at first sight, it could seem that a trivial solution for T could be to simply pick a predefined output vector O ∈ O, and always decide it without any communication, whatever the input vector. This is not the case (processes cannot access their indexes). In fact, there are GSB tasks that are not wait-free solvable (with any amount of communication). This section investigates the difficulty of solving GSB tasks. In particular, it considers wait-free solvable GSB tasks, i.e., for which there exists an algorithm in the model ASMn,n−1 [∅]. The following definition is used to study their relative power. Definition 3. A task T 1 is stronger than a task T 2 (denoted T 1 T 2) if there is an algorithm that solves T 2 in ASMn,n−1 [T 1] (ASMn,n−1 [∅] enriched with an object solving T 1). As we shall see, GSB tasks includes trivial tasks that can be solved without accessing the shared memory and universal tasks that can be used to solve any other GSB task. In between, there are wait-free solvable as well as non-wait-free solvable tasks.
74
D. Imbs, S. Rajsbaum, and M. Raynal
5.1 Hardest GSB Tasks: Universality of the n, n, 1, 1-GSB Task When considering the GSB family of tasks, an interesting question is the following: is there a universal GSB task? In other words, is there a GSB task that allows all other GSB tasks on n processes to be solved? The answer is “yes”. We show in the following that the perfect renaming n, n, 1, 1-GSB task allows any task of the family to be solved. Hence, perfect renaming is universal for the family of n, −, −, −-GSB tasks. As we will see with Corollary 4, the n, n, 1, 1-GSB task (perfect renaming) is not a wait-free solvable task. Theorem 6. Any (feasible) n, m, , u-GSB task can be solved from any solution to the n, n, 1, 1-GSB task. (Proof in [21]) 5.2 Easiest GSB Tasks: Solvability of GSB Tasks with No Communication This section identifies the easiest of all the GSB tasks, namely those that are solvable with no communication at all. This is under the assumption that the domain of possible identities is of size 2n − 1 (see Theorem 1). It is easy to see that any feasible GSB task where m = 1 is solvable without any communication (a single value can be decided). The next theorem characterizes the communication-free GSB tasks when m > 1. Theorem 7. Consider an n, m, , u-GSB task T where m > 1. Then, T is solvable with no communication if and only if ( = 0) ∧ ( 2n−1 m ≤ u). (Proof in [21]) Let us call x-bounded homonymous renaming the n, 2n−1 x , 0, x-GSB task. This task can easily be solved, namely for any i, process pi decides the value idxi . Corollary 1. The x-bounded renaming n, 2n−1 , 0, x-GSB task is solvable with no x communication. Corollary 2 is an immediate consequence of Theorem 7 when m = 2 and = 1. Corollary 2. The WSB n, 2, 1, n−1-GSB task is not solvable without communication. When m = 2n − 1 in Theorem 7, we have the trivial n, 2n − 1, 0, 1-GSB, which is actually the classical (non-adaptive) (2n − 1)-renaming problem for which many solutions have been proposed (e.g., [2,6]; see [9] for an introductory survey). In our setting (where according to Theorem 1, we have ∀i : idi ∈ [1..2n − 1]), to solve n, 2n − 1, 0, 1-GSB task each process has only to output its own identity. Interestingly, as mentioned later, when considering m = 2n − 2 and the n, 2n − 2, 0, 1-GSB task, things become much more interesting. This task may or may not be wait-free solvable, depending on the value of n. The proof of the following corollary is obtained by replacing (2n − 1) by 2(n − k) in the proof of Theorem 7. Corollary 3. The k-WSB n, 2, k, n − k-GSB task is solvable without communication from 2(n − k)-renaming.
The Universe of Symmetry Breaking Tasks
75
5.3 Hierarchy Results, GSB Tasks of Intermediate Difficulty While the renaming n, 2n − 1, 0, 1-GSB task is solvable with no communication, the renaming n, 2n − 2, 0, 1-GSB task is not wait-free solvable, except for some special values of n [8]. Interestingly, [16] shows that n, 2n − 2, 0, 1-GSB and the WSB n, 2, 1, n − 1-GSB task are wait-free equivalent: both n, 2, 1, n − 1-GSB and n, 2n − 2, 0, 1-GSB can be solved in the model ASMn,n−1 [∅] enriched with a solution to the other task. Let us recall that a set of integers {ni } is prime if gcd{ni } = 1. Theorem 8. Let m > 1. If the set { ni : 1 ≤ i ≤ n2 } is not prime, then n, m, 1, uGSB is not wait-free solvable, ∀u. (Proof in [21]) Now, consider the election asymmetric GSB task: one process decides 1, while n − 1 processes decide 2. The output vectors of this task are contained in the output vectors of the WSB n, 2, 1, n−1-GSB task, and hence, election trivially solves WSB. Moreover, election is strictly stronger than WSB because election is not wait-free solvable (see below), while WSB is solvable for (infinitely many) values of n [8]. Theorem 9. The election GSB task is not wait-free solvable. (Proof in [21]) The next corollary follows from the fact that leader election is not wait-free solvable and perfect renaming is universal for the family of GSB tasks. Corollary 4. The perfect renaming GSB task is not wait-free solvable.
6 From a Slot Task to a Renaming Task This section presents a simple algorithm that solves the (n + 1)-renaming task (n, n + 1, 0, 1-GSB task) in the system model ASMn,n−1 [n, n−1, 1, n-GSB]. The underlying object solving the n, n−1, 1, n-GSB task is denoted KS . It provides the processes with a single operation denoted slot requestn−1 () whose semantics has been described in Section 3.2 (namely, each value x, 1 ≤ x ≤ n− 1, is decided by at least one process). Shared objects. In addition to KS , the processes cooperate through a snapshot object denoted STATE [1..n]. Each register STATE [i] is initialized to ⊥ and can be written only by pi . Process pi writes into it a pair of integers my sloti , idi (where my sloti is the slot number it obtains from KS and idi (its identity). A process obtains the value of the snapshot object by invoking STATE .snapshot(). Process behavior. Each process pi manages two local arrays denoted sloti [1..n] and idsi [1..n]. These arrays are used to keep the values read from the two fields of the snapshot object STATE . The algorithm for process pi is depicted in Figure 1. It is made up of two parts. – A process pi first acquires a slot number (line 01). Then it writes its attributes (slot number and identity) in STATE [i] and reads the snapshot object to obtain an “atomic” global view of all the attributes that have been posted (line 02 where the read is denoted snapshot()).
76
D. Imbs, S. Rajsbaum, and M. Raynal operation new name(): (01) my sloti ← KS .slot requestn−1 (); (02) STATE [i] ← my sloti , idi ; (sloti [1..n], idsi [1..n]) ← STATE .snapshot(); (03) if (∀j = i : sloti [j] = my sloti ) (04) then return(my sloti ) (05) else let j = i such that sloti [j] = my sloti ; (06) if (idi < idsi [j]) then return(n) else return(n + 1) end if (07) end if. Fig. 1. Solving (n + 1)-renaming in ASMn,n−1 [n, n − 1, 1, n-GSB] (code for pi )
– Then process pi determines its new name which is its slot number if it sees no other process with the same slot number (lines 03-04). In the other case, it follows from the properties of the KS object that there is a single process pj that has obtained the same slot number s (line 05). Processes pi and pj are consequently competing for a new name. Moreover, it is possible that pj has already considered slot s as its new name. Process pi solves this conflict according to the order on its identity and pj ’s identity: if pi ’s identity is smaller, it considers n as its new name, otherwise it considers n + 1 as its new name (line 06). Theorem 10. The algorithm described in Figure 1 solves the (n + 1)-renaming task from any solution to the (n − 1)-slot task. (Proof in [21]) Towards a general algorithm. It is well-known that the (2n − 2)-renaming task and the weak symmetry breaking task are equivalent (e.g., [9]). As the weak symmetry breaking task and the 2-slot task are the same task, it follows that the (2n − 2)-renaming task and the 2-slot task are equivalent. More generally, when considering the more general problem of finding an algorithm that solves the (2n−k)-renaming task from any solution to the k-slot task, the algorithm in Figure 1 is a specific answer for k = n − 1, while the equivalence between weak symmetry breaking and the 2-slot task is a specific answer for k = 2. As indicated in the Introduction, answering the question “Is there a general algorithm that solves (2n − k)renaming from the k-slot task and more generally are the (2n − k)-renaming task and the k-slot task equivalent?” constitutes a difficult but promising challenge.
7 To Conclude: A Few GSB-Related Open Problems In addition to the previous question, many interesting questions concerning the family of GSB tasks remain open. Here are a few. Is perfect renaming the only universal GSB task? What is the structure of the hierarchy of GSB tasks? Namely, is it a partial order, a total order? Are there incomparable tasks? Which ones? Etc.
References 1. Afek, Y., Gafni, E., Rajsbaum, S., Raynal, M., Travers, C.: The k-Simultaneous Consensus Problem. Distributed Computing 22, 185–195 (2010)
The Universe of Symmetry Breaking Tasks
77
2. Afek, Y., Merritt, M.: Fast, Wait-Free (2k − 1)-Renaming. In: Proc. 18th ACM Symposium on Principles of Distributed Computing (PODC 1999), pp. 105–112. ACM Press, New York (1999) 3. Angluin, D.: Local and Global Properties in Networks of Processors. In: Proc. 12th ACM Symposium on Theory of Computing (STOC 1980), pp. 82–93. ACM Press, New York (1980) 4. Attiya, H., Bar-Noy, A., Dolev, D., Peleg, D., Reischuk, R.: Renaming in an Asynchronous Environment. Journal of the ACM 37(3), 524–548 (1990) 5. Attiya, H., Rajsbaum, S.: The Combinatorial Structure of Wait-Free Solvable Tasks. SIAM Journal of Computing 31(4), 1286–1313 (2002) 6. Borowsky, E., Gafni, E.: Immediate Atomic Snapshots and Fast Renaming. In: Proc. 12th ACM Symp. on Principles of Distr. Computing (PODC 1993), pp. 41–51. ACM Press, New York (1993) 7. Casta˜neda, A., Imbs, D., Rajsbaum, S., Raynal, M.: Enriching the Reduction Map of Subconsensus Tasks. Tech Report, IRISA, Universit´e de Rennes (F), Submitted (1976) 8. Casta˜neda, A., Rajsbaum, S.: New Combinatorial Topology Upper and Lower Bounds for Renaming. In: Proc. 27th ACM Symposium on Principles of Distributed Computing (PODC 2008), pp. 295–304. ACM Press, New York (2008) 9. Casta˜neda, A., Rajsbaum, S., Raynal, M.: The Renaming Problem in Shared Memory Systems: an Introduction (to appear in Computer Science Review) 10. Chandra, T., Toueg, S.: Unreliable Failure Detectors for Reliable Distributed Systems. Journal of the ACM 43(2), 225–267 (1996) 11. Chaudhuri, S.: More Choices Allow More Faults: Set Consensus Problems in Totally Asynchronous Systems. Information and Computation 105(1), 132–158 (1993) 12. Dolev, D., Lynch, N., Pinter, S., Stark, E., Weihl, W.: Reaching Approximate Agreement in the Presence of Faults. Journal of the ACM 33(3), 499–516 (1986) 13. Fischer, M.J., Lynch, N.A., Paterson, M.S.: Impossibility of Distributed Consensus with One Faulty Process. Journal of the ACM 32(2), 374–382 (1985) 14. Gafni, E.: The 01-Exclusion Families of Tasks. In: Baker, T.P., Bui, A., Tixeuil, S. (eds.) OPODIS 2008. LNCS, vol. 5401, pp. 246–258. Springer, Heidelberg (2008) 15. Gafni, G., Most´efaoui, A., Raynal, M., Travers, C.: From Adaptive Renaming to Set Agreement. Theoretical Computer Science 410(14-15), 1328–1335 (2009) 16. Gafni, E., Rajsbaum, S., Herlihy, M.: Subconsensus Tasks: Renaming is Weaker Than Set Agreement. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 329–338. Springer, Heidelberg (2006) 17. Herlihy, M.P.: Wait-Free Synchronization. ACM Transactions on Programming Languages and Systems 13(1), 124–149 (1991) 18. Herlihy, M., Rajsbaum, S.: The Decidability of Distributed Decision Tasks. In: Proc. 29th ACM Symposium on Theory of Computing (STOC 1997), pp. 589–598. ACM Press, New York (1997) 19. Herlihy, M., Rajsbaum, S.: A Classification of Wait-Free Loop Agreement Tasks. Theoretical Computer Science 291(1), 55–77 (2003) 20. Herlihy, M.P., Shavit, N.: The Topological Structure of Asynchronous Computability. Journal of the ACM 46(6), 858–923 (1999) 21. Imbs, D., Rajsbaum, S., Raynal, M.: The Universe of Symmetry Breaking Tasks. Tech Report 1965, IRISA, Universit´e de Rennes (F), 16 pages (2010) 22. Lamport, L.: The Part-time Parliament. ACM Trans. on Comp. Systems 16(2), 133–169 (1998) 23. Moran, S., Wolfsthal, Y.: An extended Impossibility Result for Asynchronous Complete Networks. Information Processing Letters 26, 141–151 (1987) 24. Raynal, M.: Communication and Agreement Abstractions for Fault-Tolerant Asynchronous Distributed Systems. In: Morgan & Claypool Pub, 251 pages. Morgan & Claypool Pub (2010); ISBN 978-1-60845-293-4
Determining the Conditional Diagnosability of k-Ary n-Cubes Under the MM* Model Sun-Yuan Hsieh and Chi-Ya Kao Department of Computer Science and Information Engineering, National Cheng Kung University, No. 1, University Road, Tainan 701, Taiwan
[email protected]
Abstract. Processor fault diagnosis plays an important role for measuring the reliability of multiprocessor systems, and the diagnosability of many well-known interconnection networks has been investigated widely. Conditional diagnosability is a novel measure of diagnosability, which is introduced by Lai et al., by adding an additional condition that any faulty set cannot contain all the neighbors of any vertex in a system. The class of k-ary n-cubes contains as special cases many topologies important to parallel processing, such as rings, hypercubes, and tori. In this paper, we study some topological properties of the k-ary n-cube, denoted by Qkn . Then we apply them to show that the conditional diagnosability of Qkn under the comparison diagnosis model is tc (Qkn ) = 6n − 5 for k ≥ 4 and n ≥ 4. Keywords: Interconnection networks, system’s reliability, comparison diagnosis model, conditional diagnosability, diagnosability, k-ary n-cubes.
1
Introduction
With the rapid development of VLSI technology, a multiprocessor system may incorporate a large number of processors (vertices). As the number of processors in a system increases, the possibility that processors in it become faulty increases. Since it is almost impossible to build such systems without defects, the most important issue concerning multiprocessor systems is the reliability of these systems. In order to maintain the reliability of a system, the system should be able to discriminate the faulty processors from the fault-free ones, and then faulty processors can be replaced by fault-free ones. The process of identifying faulty processors is called the diagnosis of the system; and the diagnosability of the system is the maximum number of faulty processors that can be identified by the system. The problem of fault diagnosis in multiprocessor systems has been widely studied in the literature [1,4,7,10,11,12,19,27,28,31,32,33,34]. Among the proposed models for system-level dianosis, two of which, namely the PMC model
Corresponding author.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 78–88, 2011. c Springer-Verlag Berlin Heidelberg 2011
Conditional Diagnosability of k-Ary n-Cubes
79
(Preparata, Metze, and Chiens model [31]) and the MM model (Maeng and Maleks model [27,28]), are well-known and widely used. The PMC model was first introduced by Preparata et al. [31]. Under the PMC model, it uses test-based diagnosis approach: every vertex u is capable of testing whether another vertex v is faulty if there exists a communication link (edge) between them. It is assumed that a test result is reliable (respectively, unreliable) if the vertex that initiates the test is fault-free (respectively, faulty). The PMC model was also adopted in [1,2,4,8,9,10,13,20,21,22,36,38,39]. Another major diagnosis model was first introduced by Maeng and Malek [27,28], also known as the comparison diagnosis model. In the MM model, on the other hand, it uses comparison-based diagnosis approach: the diagnosis is performed by sending the same input (or task) from a vertex w to each pair of distinct neighbors, u and v, and then comparing their responses. We use (u, v)w to represent a comparison (or test) in which vertices u and v are compared by w. Thus, vertex w is called the comparator of vertices u and v. The result of a comparison is either that the two responses agree or the two responses disagree. Based on the results of all the comparisons, one needs to decide the faulty or non-faulty (fault-free) status of the processors in the system. The method of MM model takes advantage of the homogeneity of multiprocessor systems in which comparisons can be made easily. Sengupta and Dahbura [33] suggested a further modification of the MM model, called the MM* model in which each node has to test another two nodes if they are adjacent to it. The MM* model might be lead the way toward a polynomial-time diagnosis algorithm for the more general MM self-diagnosable systems, and complexity results on determining the level of diagnosability of systems. Some researches about the diagnosability of multiprocessor systems under the MM model or the MM* model have been demonstrated in [3,4,11,12,15,16,18,26,37,40]. Throughout this paper, we base our diagnosability analysis on the comparison diagnosis model. The interconnection network considered in this paper is the k-ary n-cube, denoted by Qkn , which is one of the most common multiprocessor systems for parallel computer/communication system. Qkn is regular of degree 2n with k n nodes, edge symmetric, and vertex symmetric. The three most popular instances of k-ary n-cubes are the ring (n = 1), the hypercubes (k = 2), and the torus (n = 2 and n = 3). A number of distributed memory multiprocessors have been built with a k-ary n-cube forming the underlying topology, such as the Cray T3D [23] and the Cray T3E [30]. Many topological properties of k-ary n-cubes have been described in the literature [5,6,14,17,29,35]. In classical measures of system-level diagnosability for multiprocessor systems, if all the neighbors of some processor u are faulty simultaneously, it is not possible to determine whether processor u is fault-free or faulty. So the diagnosability of a system is limited by its minimum degree. Relative to the classical diagnosability of a system, Lai et al. proposed a novel measure of diagnosability, called conditional diagnosability, by restricting that, for each processor u in a system, not all the processors which are directly connected to u fail at the same time. The probability that all faulty processors are neighbors of one processor is very small, clearly, in some large-scale multiprocessor systems like hypercubes or in
80
S.-Y. Hsieh and C.-Y. Kao
some heterogenous environment, we can safely assume that all the neighbors of any node cannot fail at the same time. Reviewing some previous papers [11,12], it has been shown that, under the comparison diagnosis model, the conditional diagnosability of Qn is 3(n − 2) + 1 for n ≥ 5, the conditional diagnosability of n-dimensional BC Networks is 3(n − 2) + 1 for n ≥ 5. In this paper, we establish the conditional diagnosability of k-ary n-cube Qkn under the comparison diagnosis model. And we show that the conditional diagnosability of Qkn is 6n − 5 for k ≥ 4, n ≥ 4.
2
Preliminaries
In this section, we will define some graph terms and notations. The underlying topology of an interconnection network is often modeled as an undirected graph, where vertices (nodes) represents the set of all processors and edges represents the set of all communication links between the processors in the network. In this paper, we only consider undirected and simple graphs which is without loops or multiple edges. An undirected graph (graph for short) G = (V, E) is comprised of a vertex set V and an edge set E, where V is a finite set and E is a subset of {(u, v)| (u, v) is an unordered pair of V }. We also use V (G) and E(G) to denote the node set and edge set of G respectively. The cn-number of a graph G, denoted by cn(G), is the number of the most common neighbors for any two vertices of G. For an edge (u, v), we call u and v the endpoints of the edge. A subgraph of G = (V, E) is a graph G = (V , E ) such that V is a subset of V and E is a subset of E. The neighborhood of a node v ∈ V (G), denoted by NG (v) (or simply N (v)), is the set of all vertices adjacent to v in G. The cardinality of NG (v) is called the degree of v, denoted by dG (v) (or simply d(v)). In an undirected graph G, two vertices u and v are called connected if G contains a path from u to v. Otherwise, they are called disconnected. For a subset of nodes V ⊆ V G , the neighborhood set of V in G is defined as NG (V ) = u∈V NG (u) − V . For a set of nodes S, the notation G − S denotes the graph obtained from G by deleting all the vertices in S from G. The connectivity of a graph G, denoted by κ(G), is the minimum size of a vertex set S such that the resulting graph obtained by deleting the nodes in S from G is disconnected or has only one node. Maximal connected subgraphs of G are components of G. A component is trivial if it has no edges; otherwise, it is nontrivial. The comparison diagnosis model , also called the MM model, deals with the faulty diagnosis by sending the same task from a node w to some pairs of its distinct neighbors, u and v, and then comparing their responses. In this model, a self-diagnosable system can be modeled by a multigraph M (V, C), called a comparison graph, where V is the same vertex set defined in G and C is the labeled edge set. Let (u, v)w be a labeled edge for any (u, v)w ∈ C, in which w is a label on the edge. Then, (u, v)w implies that the vertex u and v are being compared by vertex w. The same pair of vertices may be compared by different comparators, so M is a multigraph. The collection of all comparison
Conditional Diagnosability of k-Ary n-Cubes
81
results in M (V, C) can be defined as a function σ : C → {0, 1}, which is called the syndrome of the diagnosis. For (u, v)w ∈ C, we use σ((u, v)w ) to denote the result of comparing nodes u and v by w. In this model, a disagreement of the outputs is denoted by σ((u, v)w ) = 1. Otherwise, σ((u, v)w ) = 0. If σ((u, v)w ) = 0 and w is faultfree, then both u and v are fault-free. If σ((u, v)w ) = 1, then at least one of the three nodes u, v, w must be faulty. If comparator w is faulty, then the result of the comparison is unreliable, which means both σ((u, v)w ) = 0 and σ((u, v)w ) = 1 are possible outputs, and it outputs only one of these two possibilities. The MM* model is a special case of the MM model which considers a complete diagnosis that means each node diagnoses all pairs of distinct neighboring nodes. Given a syndrome σ, a faulty subset F ⊆ V (G) is said to be consistent with σ if σ can arise from the circumstance that all vertices in F are faulty and all vertices in V − F are fault-free. A system is said to be diagnosable if, for every syndrome σ, there is a unique F ⊆ V that is compatible with σ. The diagnosability of a system is the maximal number of faulty processors that the system can guarantee to diagnose. Let σ(F ) represent the set of all syndromes which could be produced if F is the set of faulty vertices. Twodistinct faulty subsets F1 , F2 ⊆ V (G) are said to be distinguishable if σ(F1 ) σ(F2 ) = ∅; otherwise, F1 and F2 are said to be indistinguishable. (F1 , F2 ) is said to be an indistinguishable (respectively, distinguishable) pair if F1 and F2 are indistinguishable (respectively, distinguishable). The symmetric difference of the two sets F1 and F2 is defined as the set F1 ΔF2 = (F1 − F2 ) ∪ (F2 − F1 ). Some of the previous results about the definition of a t-diagnosable system are listed as follows. Definition 1. [31] A system G is said to be t-diagnosable if all faulty processors in G can be unambiguously identified, provided the number of faulty processors does not exceed t. Definition 2. [25] A faulty set F ⊆ V is called a conditional faulty set if N (v) F for any vertex v ∈ V . A system G(V, E) is conditionally t-diagnosable if F1 and F2 are distinguishable, for each pair of conditional faulty sets F1 , F2 ⊆ V , and F1 = F2 , with |F1 |, |F2 | ≤ t. The conditional diagnosability of a system G, written as tc (G) is defined to be the maximum value of t such that G is conditionally t-diagnosable. Lemma 1. Let G be a system. Then, tc (G) ≥ t(G). The following theorem given by Sengupta and Dahbura [33] is a necessary and sufficient condition for two distinct sets being distinguishable: Theorem 1. [33] Let G = (V, E) be a graph. For any two distinct subsets F1 , F2 of V (G), (F1 , F2 ) is a distinguishable pair if and only at least one of the following conditions is satisfied: 1. ∃ u, v ∈ F1 \ F2 and ∃ w ∈ V (G) \ (F1 F2 ) such that (u, v)w ∈ C; 2. ∃ u, v ∈ F2 \ F1 and ∃ w ∈ V (G) \ (F1 F2 ) such that (u, v)w ∈ C; or 3. ∃ u, w ∈ V (G) \ (F1 F2 ) and ∃ v ∈ F1 ΔF2 such that (u, v)w ∈ C.
82
3
S.-Y. Hsieh and C.-Y. Kao
Properties of k-Ary n-Cubes
In this section, we study some useful properties of the k-ary n-cube Qkn , which can be defined recursively as follows. Definition 3. [14] The k-ary n-cube Qkn, where k ≥ 2 and n ≥ 1 are integers, has N = k n nodes, each of which has the form x = xn xn−1 . . . x1 where xi ∈ {0, 1, . . . , k − 1} for 1 ≤ i ≤ n. Two nodes x = xn xn−1 . . . x1 and y = yn yn−1 . . . y1 in Qkn are adjacent if and only if there exists an integer j, 1 ≤ j ≤ n, such that xj = yj ± 1 (mod k) and xl = yl for all l ∈ {1, 2, . . . , n} − {j}. For clarity of presentation, we omit writing “(mod k)” in similar expressions for the remainder of this paper. Note that each node has degree 2n when k ≥ 3, and n when k = 2. Obviously, Qk1 is a cycle of length k, Q2n is an n-dimensional hypercube, and Qk2 is a k × k wrap-around mesh. We can partition Qkn along the i-dimension, 0 ≤ i ≤ n − 1 , by deleting all the i-dimensional edges, into k disjoint subcubes, Qkn−1 [0], Qkn−1 [1], . . . , Qkn−1 [k − 1] (abbreviated as Q[0], Q[1], . . . , Q[k − 1], if there are no ambiguities). Note that each Q[i] is a subcube of Qkn and Q[i] is isomorphic to a k-ary (n − 1)-cube for 0 ≤ i ≤ k − 1. For any integer i, 0 ≤ i ≤ k − 1, there exists an edge set M ⊂ E(Qkn ) such that M is a perfect matching between Q[i] and Q[i + 1]. We call Q[i] and Q[i + 1] adjacent subcubes, and the edges between two adjacent subcubes bridges or matching edges. Obviously, each vertex u ∈ V (Qkn ) is incident with two bridges. We call another endpoint of a bridge a crossing neighbor. For convenience, the right crossing neighbor of u for any vertex u ∈ Q[i], denoted by uR , is the unique neighbor of u in Q[i + 1]. The left crossing neighbor of u for any vertex u ∈ Q[i], denoted by uL , is the unique neighbor of u in Q[i − 1]. Definition 4. [29] A k-ary n-cube contains k composite subcubes; each of which is a k-ary (n − 1)-cube; and the number of edges with endpoints in different composite subcubes is k n−1 for k = 2 and k n for k ≥ 3. Property 1. [5] κ(Qkn ) = 2n for k ≥ 3, n ≥ 1. Property 2. cn(Qkn ) = 2 for k ≥ 3, n ≥ 1.
4
Main Results
In this section, we present our main results as follows. Definition 5. A faulty set F ⊆ V (G) is called a conditional faulty set if NG (u) F for every node u ∈ V (G). Lemma 2. [24] Let G be a graph with δ(G) ≥ 2, and let F1 and F2 be any two distinct conditional faulty subsets of V (G) with F1 ⊂ F2 . Then (F1 , F2 ) is a distinguishable conditional pair under the comparison diagnosis model. Now, we give an example to show that the conditional diagnosability of the k-ary n-cube Qkn is not more than 6n − 5 (k ≥ 4 and n ≥ 2) as follows.
Conditional Diagnosability of k-Ary n-Cubes
83
Theorem 2. tc (Qkn ) ≤ 6n − 5 for k ≥ 4, n ≥ 3. Proof. We take a cycle C4 of length four in Qkn . Let u1 , u2 , u3 , u4 be the four consecutively vertices on C4 , and choose a path P = u2 , u1 , u4 of length two. Assume that Qkn is split into k disjoint copies of Qkn−1 so that u1 , u2 , u3 , u4 ∈ V (Q[i]) and (u1 , u2 ), (u2 , u3 ), (u3 , u4 ), (u4 , u1 ) ∈ E(Q[i]) for some i = 0, 1, . . . , k− 1. Let F1 = NQkn (P ) ∪ {u2 } and F2 = NQkn (P ) ∪ {u4 }. It is straightforward to verify that F1 and F2 are indistinguishable by Theorem 1. We can show our result by proving that F1 and F2 are two conditional faulty subsets, and |F1 | = |F2 | = 6n − 4. Lemma 3. Let Qkn be a k-ary n-cube and let S be a conditional faulty subset with |S| ≤ 6n − 6 in Qkn (k ≥ 4, n ≥ 4). Then there exists no K1 and at most one K2 in Qkn − S. Lemma 4. Let Qkn be divided into k disjoint copies of Qkn−1 , namely, Q[0], Q[1], Q[2], . . . , Q[k − 1]. Let S be a conditional faulty set with |S| ≤ 6n − 6 of Qkn and Si = V (Q[i]) ∩ S, i = 0, 1, 2, . . . , k − 1. If both Q[i] − Si and Q[i + 1] − Si+1 are connected, then every vertex in Q[i] − Si is connected to some vertex in Q[i + 1] − Si+1 for 0 ≤ i ≤ k − 1. Lemma 5. Let S be a conditional faulty subset with |S| ≤ 6n − 6 of Qkn for k ≥ 4 and n ≥ 1, and let H = Qkn − S − V (the union of all K2 s in Qkn − S) be the maximum component of Qkn − S. For any vertex in Hi , there exists a path of length not more than 4 that can connect it to a vertex in Hi−1 or a vertex in Hi+1 for i = 0, 1, 2, . . . , k − 1, where Hi−1 = Q[i − 1] ∩ H, Hi = Q[i] ∩ H and Hi+1 = Q[i + 1] ∩ H. Lemma 6. Let Qkn be the k-ary n-cube (k ≥ 4, n ≥ 4), and S be a conditional faulty subset with |S| ≤ 6n − 6, i.e., NQkn (u) S for every vertex u ∈ V (Qkn ). Then Qkn − S is connected; or Qkn − S is disconnected and Qkn − S has two connected components, one of which is K2 . Proof. Since NQkn (u) S for every vertex u ∈ V (Qkn ), every component of Qkn − S is nontrivial. Let H = Qkn − S − V (the union of all K2 in Qkn ). We shall show the result of this lemma by proving that H is connected. Note that there is at most one K2 in Qkn − S by Lemma 3. Since |V (H)| ≥ k n − (6n − 6) − 2 ≥ 4n − (6n − 6) − 2 > 0 for n ≥ 1, V (H) is not empty. We can divide Qkn into k disjoint subcubes along some dimension, denoted by Q[0], Q[1], Q[2], . . . , Q[k−1]. Suppose that Si = V (Q[i]) ∩ S and Hi = Q[i] ∩ H, where 0 ≤ i ≤ k − 1. Before proceeding to our main proof, we first claim that at most three of Q[i] − Si , 0 ≤ i ≤ k − 1, are disconnected. Suppose, by contradiction, that at least four Q[i] − Si for 0 ≤ i ≤ k − 1 are disconnected. Thus for each i such that Q[i] − Si is disconnected, we have |Si | ≥ 2n − 2, since κ(Qkn−1 ) = 2n − 2. Therefore, |S| ≥ 4 × (2n − 2) = 8n − 8 > 6n − 6 for n ≥ 2, which is contrary to |S| ≤ 6n − 6. So we get that at most three of Q[i] − Si are disconnected. Then, we continue to prove that H is connected, in the following we consider four cases:
84
S.-Y. Hsieh and C.-Y. Kao
Case 1: Exactly three of Q[i] − Si are disconnected, where 0 ≤ i ≤ k − 1. Assume that Q[i1 ] − Si1 , Q[i2 ] − Si2 , Q[i3 ] − Si3 are disconnected, where 0 ≤ i1 < i2 < i3 ≤ k − 1. We first have |Si1 | ≥ 2n − 2, |Si2 | ≥ 2n − 2 and |Si3 | ≥ 2n−2. Also, because |S| ≤ 6n−6, we get |Si1 | = 2n−2, |Si2 | = 2n−2, |Si3 | = 2n − 2, and |Si | = 0 for 0 ≤ i ≤ k − 1 and i = i1 , i2 , i3 . Case 1.1: Three disconnected Q[i] − Si are consecutive. Due to the space limitation, the proof is omitted. Case 1.2: Three disconnected Q[i] − Si are not consecutive. Due to the space limitation, the proof is omitted. Case 1.3: Two of three disconnected Q[i] − Si are consecutive. Due to the space limitation, the proof is omitted. Case 2: Exactly two of Q[i] − Si are disconnected, where 0 ≤ i ≤ k − 1. Assume that Q[i1 ]−Si1 and Q[i2 ]−Si2 are disconnected, where 0 ≤ i1 < i2 ≤ k − 1. We first have |Si1 | ≥ 2n− 2 and |Si2 | ≥ 2n− 2, since κ(Qkn−1 ) = 2n− 2. k−1 Also, because |S| ≤ 6n − 6, we get i=0,i=i1 ,i2 |Si | ≤ 2n − 2. Case 2.1: Two disconnected Q[i] − Si are consecutive. Without loss of generality, assume that two consecutive disconnected Q[i] − Si are Q[1] − S1 and Q[2] − S2 . By Lemma 4, we know that Q[i] − Si is connected to Q[i + 1] − Si+1 , where i = 3, 4, 5, . . . , k − 1. Next, we need to check that each vertex in H1 and each vertex in H2 can be connected to H0 or H3 , then H is connected. Without loss of generality, we check that each vertex in H1 can be connected to H0 or H3 . Note that, by Lemma 5, for each vertex u in H1 , there is a path of length at most four from u to a vertex in H0 or in H2 . If u ∈ H1 is connected to H0 by a path of length at most four, then we are done. Otherwise, by Lemma 5, u can be connected to H2 by a path of length at most four. Let P be a shortest path from u ∈ H1 to v ∈ H2 , then |P | ≤ 4. This case is further divided into the following four subcases: Case 2.1.1: |P | = 1. Due to the space limitation, the proof is omitted. Case 2.1.2: |P | = 2. Due to the space limitation, the proof is omitted. Case 2.1.3: |P | = 3. Due to the space limitation, the proof is omitted. Case 2.1.4: |P | = 4. Due to the space limitation, the proof is omitted. Case 2.2: Two disconnected Q[i] − Si are not consecutive. There are the following two scenarios. Case 2.2.1: There exists one connected Q[i] − Si (i = i1 , i2 ) between Q[i1 ] − Si1 and Q[i2 ] − Si2 . Without loss of generality, assume that two disconnected Q[i] − Si are Q[1] − S1 and Q[3] − S3 . By Lemma 4, we know that every vertex in Q[i]−Si is connected to some vertex in Q[i+1]−Si+1 in H, where i = 4, 5, 6, . . . , k − 1. By Lemma 5, there exists a path of length not more than 4 connecting a vertex in H1 to a vertex in H0 or a vertex
Conditional Diagnosability of k-Ary n-Cubes
85
in H2 . Similarly, by Lemma 5, there exists a path of length not more than 4 connecting a vertex in H3 to a vertex in H2 or a vertex in H4 . Therefore, in this subcase, we just need to check that there exists a / S and uR ∈ / S, then vertex u in H1 (respectively, H3 ) such that uL ∈ we can conclude that H is connected. Without loss of generality, we prove that there exists a vertex u in H1 such that uL ∈ / S and uR ∈ / S. We use contradiction to prove this subcase. Suppose, on the contrary, that there does not exist a vertex u in H1 which has uL ∈ / S and uR ∈ / S. There are at least k n−1 − |S1 | − 2 vertices in S0 and S2 . Note that |S3 | ≥ 2n − 2. So |S| ≥ |S0 | + |S1 | + |S2 | + |S3 | ≥ (k n−1 − |S1 | − 2) + |S1 | + (2n − 2) ≥ 4n−1 + 2n − 4 > 6n − 6 for n ≥ 3. We will reach a contradiction, so H is connected. Case 2.2.2: There exist at least two connected Q[i] − Si (i = i1 , i2 ) between Q[i1 ] − Si1 and Q[i2 ] − Si2 . Due to the space limitation, the proof is omitted. Case 3: Exactly one of Q[i] − Si is disconnected, where 0 ≤ i ≤ k − 1. Without loss of generality, assume that one disconnected Q[i]−Si is Q[1]−S1 . k−1 We first have |S1 | ≥ 2n−2. Since |S| ≤ 6n−6, we have i=0,i=1 |Si | ≤ 4n−4. By Lemma 4, we get a connected subgraph Qkn − (Q[1] − S1 ) − S in H. With a method similar to Lemma 5, we can show that there exists a path of length not more than 4 connecting a vertex in H1 to a vertex in H0 or a vertex in H2 . So, H is connected. Case 4: None of Q[i] − Si is disconnected, where 0 ≤ i ≤ k − 1. k−1 Since |S| ≤ 6n−6, we have i=0 |Si | ≤ 6n−6. All of Q[i]−Si for 0 ≤ i ≤ k−1 is connected. By Lemma 4, Qkn − S is connected. So, H is connected. In each of the above cases, we can conclude that H is connected. Hence, by Lemma 3 and the above cases, if there is no K2 in Qkn − S, then Qkn − S is connected. Otherwise, if there is one K2 in Qkn − S, then Qkn − S is disconnected and Qkn − S has two components, one of which is K2 . Thus, we have completed the proof of this lemma. Lemma 7. Let Qkn be a k-ary n-cube, and let F1 and F2 be any two distinct conditional faulty subsets of Qkn with |F1 |, |F2 | ≤ 6n − 5. Denote by H the maximum component of Qkn − F1 ∩ F2 . Then u ∈ H for every vertex u ∈ F1 ΔF2 . Theorem 3. Let Qkn be a k-ary n-cube, and let F1 and F2 be any two distinct conditional faulty subsets of Qkn (k ≥ 4 and n ≥ 4) with |F1 |, |F2 | ≤ 6n − 5. Then (F1 , F2 ) is a distinguishable conditional pair under the comparison diagnosis model. Corollary 1. tc (Qkn ) = 6n − 5 for k ≥ 4 and n ≥ 4.
86
S.-Y. Hsieh and C.-Y. Kao
5
Concluding Remarks
In this paper, we use the k-ary n-cube Qkn graph as a network topology and have studied the conditional diagnosability of the k-ary n-cubes Qkn under the comparison diagnosis model. We give a complete proof to support our claims and finally obtain that the conditional diagnosability of Qkn is 6n − 5 for k ≥ 4, n ≥ 4. In the future, we will consider the conditional diagnosability of more different topologies.
References 1. Armstrong, J.R., Gray, F.G.: Fault diagnosis in a boolean n cube array of multiprocessors. IEEE Transactions on Computers 30(8), 587–590 (1981) 2. Araki, T., Shibata, Y.: Diagnosability of networks represented by the Cartesian product. IEICE Transactions on Fundamentals E83-A(3), 465–470 (2000) 3. Chang, C.P., Lai, P.L., Tan, J.J.M., Hsu, L.H.: Diagnosabilities of t-connected networks and product networks under the comparison diagnosis model. IEEE Transactions on Computers 53(12), 1582–1590 (2004) 4. Chang, G.Y., Chang, G.J., Chen, G.H.: Diagnosabilities of regular networks. IEEE Transactions on Parallel and Distributed Systems 16(4), 314–323 (2005) 5. Day, K., Ai-Ayyoub, A.E.: Fault diameter of k-ary n-cube networks. IEEE Transactions on Parallel and Distributed Systems 8, 903–907 (1997) 6. Day, K.: The conditional node connectivity of the k-ary n-cube. Journal of Interconnection Networks 5(1), 13–26 (2004) 7. Friedman, A.D., Simoncini, L.: System-level fault diagnosis. The Computer Journal 13(3), 47–53 (1980) 8. Fujiwara, H., Kinoshita, K.: On the computational complexity of system diagnosis. IEEE Transactions on Computers 27(10), 881–885 (1978) 9. Fan, J.: Diagnosability of crossed cubes under the two strategies. Chinese Journal of Computers 21(5), 456–462 (1998) 10. Fan, J.: “Diagnosability of the M¨ obius cubes,”. IEEE Transactions on Parallel and Distributed Systems 9(9), 923–928 (1998) 11. Hsu, G.H., Chiang, C.F., Shih, L.M., Hsu, L.H., Tan, J.J.M.: Conditional diagnosability of hypercubes under the comparison diagnosis model. Journal of Systems Architecture 55(2), 140–146 (2009) 12. Hsu, G.H., Tan, J.J.M.: Conditional diagnosability of the BC Networks under the comparison diagnosis model. International Computer Symposium 1, 269–274 (2008) 13. Hakimi, S.L., Amin, A.T.: Characterization of connection assignment of diagnosable systems. IEEE Transactions on Computers 23, 86–88 (1974) 14. Hsieh, S.Y., Lin, T.J.: Embedding cycles and paths in a k-ary n-cube. In: Proceedings of International Conference on Parallel and Distributed Systems, vol. 2, pp. 1–7 (2007) 15. Hsieh, S.Y., Chen, Y.S.: Strongly diagnosable product networks under the comparison diagnosis model. IEEE Transactions on Computers 57(6), 721–732 (2008) 16. Hsieh, S.Y., Chen, Y.S.: Strongly diagnosable systems under the comparison diagnosis model. IEEE Transactions on Computers 57(12), 1720–1725 (2008) 17. Hsieh, S.Y., Lin, T.J.: Panconnectivity and Edge-Pancyclicity of k-Ary n-Cubes. Networks (SCI EI) 54(1), 1–11 (2009)
Conditional Diagnosability of k-Ary n-Cubes
87
18. Hsieh, S.Y., Lee, C.W.: Diagnosability of two-matching composition networks under the MM* model. IEEE Transactions on Dependable and Secure Computing 8(2), 246–255 (2011) 19. Ishida, Y., Adachi, N., Tokumaru, H.: Diagnosability and distinguishability analysis and its applications. IEEE Transactions on Reliability 36(5), 531–538 (1987) 20. Kavianpour, A.: Sequential diagnosability of star graphs. Computers and Electrical Engineering 22(1), 37–44 (1996) 21. Kavianpour, A., Kim, K.H.: Diagnosability of hypercubes under the pessimistic one-step diagnosis strategy. IEEE Transactions on Computers 40(2), 232–237 (1991) 22. Kavianpour, A., Kim, K.H.: A comparative evaluation of four basic system-level diagnosis strategies for hypercubes. IEEE Transactions on Reliability 41(1), 26–37 (1992) 23. Kessler, R.E., Schwarzmeier, J.L.: Cray T3D: a new dimension for Cray research, in. In: Proceedings of the 38th IEEE Computer Society International Conference, pp. 176–182 (1993) 24. Lin, C.K., Tan, J.J.M., Hsu, L.H., Cheng, E., Lipt´ ak, L.: Conditional diagnosability of Cayley Graphs generated by transposition trees under the comparison diagnosis model. Journal of Interconnection Networks 9(1-2), 83–97 (2008) 25. Lai, P.L., Tan, J.J.M., Chang, C.P., Hsu, L.H.: Conditional diagnosability measures for large multiprocessor systems. IEEE Transactions on Computers 54(2), 165–175 (2005) 26. Lai, P.L., Tan, J.J.M., Tsai, C.H., Hsu, L.H.: The diagnosability of the matching composition network under the comparison diagnosis model. IEEE Transactions on Computers 53, 1064–1069 (2004) 27. Maeng, J., Malek, M.: A comparison connection assignment for self-diagnosis of multiprocessors systems. In: Proceedings of the 11th International Symposium on Fault-Tolerant Computing, pp. 173–175 (1981) 28. Malek, M.: A comparison connection assignment for diagnosis of multiprocessor systems. In: Proceedings of the 7th International Symposium on Computer Architecture, pp. 31–36 (1980) 29. Mao, W., Nicol, D.M.: On k-ary n-cubes: theory and applications. Discrete Applied Mathematics 129, 171–193 (2003) 30. Najjar, W., Gaudiot, J.L.: Network resilience: a measure of network fault tolerance. IEEE Transactions on Computers 39, 174–181 (1990) 31. Preparata, F.P., Metze, G., Chien, R.T.: On the connection assignment problem of diagnosable systems. IEEE Transactions on Electronic Computers 16(6), 848–854 (1967) 32. Pan, Y.: Fault tolerance in the block-shift network. IEEE Transactions on Reliability 50(1), 85–91 (2001) 33. Sengupta, A., Dahbura, A.T.: On self-diagnosable multiprocessor systems: diagnosis by the comparison approach. IEEE Transactions on Computers 41(11), 1386– 1396 (1992) 34. Somani, A.K., Agarwal, V.K., Avis, D.: A generalized theory for system level diagnosis. IEEE Transactions on Computers 36(5), 538–546 (1987) 35. Sarbazi-Azad, H., Ould-Khaoua, M., Mackenzie, L.M., Akl, S.G.: On some properties of k-ary n-cubes. In: Proceedings of the Eighth International Conference on Parallel and Distributed Systems (ICPADS), pp. 517–524. IEEE Computer Society, Los Alamitos (2001)
88
S.-Y. Hsieh and C.-Y. Kao
36. Wang, D.: Diagnosability of enhanced hypercubes. IEEE Transactions on Computers 43(9), 1054–1061 (1994) 37. Wang, D.: Diagnosability of hypercubes and enhanced hypercubes under the comparison diagnosis model. IEEE Transactions on Computers 48(12), 1369–1374 (1999) 38. Xu, M., Thulasiraman, K., Hu, X.D.: Conditional diagnosability of matching composition networks under the PMC model. IEEE Transactions on Circuits and Systems 56(11), 875–879 (2009) 39. Zhao, J., Meyer, F.J., Park, N., Lombardi, F.: Sequential diagnosis of processor array systems. IEEE Transactions on Reliability 53(4), 487–498 (2004) 40. Zhou, S.: The conditional diagnosability of hypercubes under the comparison model. In: Proceedings of the 2009 WASE International Conference on Information Engineering, pp. 459–462 (2009)
Medium Access Control for Adversarial Channels with Jamming Lakshmi Anantharamu1 , Bogdan S. Chlebus1 , Dariusz R. Kowalski2, and Mariusz A. Rokicki2 1
Department of Computer Science and Engineering, U. of Colorado Denver, USA 2 Department of Computer Science, University of Liverpool, UK
Abstract. We study broadcasting on multiple access channels with dynamic packet arrivals and jamming. The presented protocols are for the medium-access-control layer. The mechanisms of timing of packet arrivals and determination of which rounds are jammed are represented by adversarial models. Packet arrivals are constrained by the average rate of injections and the number of packets that can arrive in one round. Jamming is constrained by the rate with which the adversary can jam rounds and by the number of consecutive rounds that can be jammed. Broadcasting is performed by deterministic distributed protocols. We give upper bounds on worst-case packet latency of protocols in terms of the parameters defining adversaries. Experiments include both deterministic and randomized protocols. A simulation environment we developed is designed to represent adversarial properties of jammed channels understood as restrictions imposed on adversaries. Keywords: multiple access channel, medium access control, jamming, adversarial queuing, packet latency.
1
Introduction
Multiple access channel is a communication model proposed to capture the essential properties of the implementation of local-area networks by the Ethernet suite of technologies. Every terminal/station has direct access to the communication medium. What makes it multiple-access channel are the following two properties: (i) a transmission is successful when precisely one terminal transmits, which results in every connected terminal receiving the transmitted packet; and (ii) multiple overlapping transmissions interfere with one another, so that none of them is successfully received by any terminal. We consider multiple access channels with jamming. A ‘jammed’ round has the same effect as a collision in how it is perceived by the stations attached to the channel. Stations cannot distinguish a jammed round from a round with collision. This property of jamming allows to capture a situation in which jamming
The first and second authors are supported by the NSF Grant 1016847. The third author is supported by the Engineering and Physical Sciences Research Council [grant numbers EP/G023018/1, EP/H018816/1].
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 89–100, 2011. c Springer-Verlag Berlin Heidelberg 2011
90
L. Anantharamu et al.
occurs because groups of stations execute their independent communication protocols so that for each group an interference caused by ‘foreign’ transmissions is logically equivalent to jamming. A similar motivation comes from a scenario in which a degradation-of-service attack produces dummy packets that interfere with legitimate packets transmitted by the executed protocol. We consider medium-access-control on multiple-access channels against adversaries that control both injections of packets into stations and jamming of the communication medium. Protocols are deterministic and executed with no centralized control. The goal is to study stability and packet latency. Previous work on multiple access channels with jamming. We know of two papers on jamming in multiple-access channels closely related to this work. Awerbuch et al. [6] studied jamming in multiple access channels in an adversarial setting with the goal to estimate saturation throughput of randomized protocols. Another paper, by Bayraktaroglu et al. [7], investigated the performance of the IEEE 802.11 CSMA/CA MAC protocol, as specified in [16], under various jammers. Previous work on adversarial multiple-access channels. Adversity in multiple access channels was first studied by Bender et al. [8] with respect to the throughput of randomized back-off for multiple-access channels in the queue-free model. Chlebus et al. [12] proposed to apply adversarial queuing to deterministic distributed broadcast protocols for multiple-access channels in the model with queues at stations. Maximum throughput defined as the maximum rate for which stability is achievable was investigated by Chlebus et al. [13]. Anantharamu et al. [3] continued work on the global injection rate 1 by studying the impact of limiting the adversary by assigning independent individual rates of injecting data for each station. Anantharamu et al. [2] studied packet latency of broadcasting on multiple access channels by deterministic distributed protocols with data arrivals governed by an adversary. Related work on wireless networks. Gilbert et al. [15] studied single-hop multichannel networks with jamming controlled by adversaries. Meier et al. [17] considered multi-channel single-hop networks in scenarios when an adversary can disrupt some t channels out of m in a round, when m is known while t is not. Gilbert et al. [14] considered a multi-channel where the adversary can control information flow on a subset of channels. Bhandari and Vaidya [9,10] considered broadcast protocols in multi-hop networks where nodes are prone to failures. Related work on adversarial queuing. The methodology to approach queuing through adversarial settings has been studied with the goal to capture the notion of stability of communication protocols without resorting to randomness. This allows to give worst-case bounds on performance metrics. The approach was proposed by Borodin et al. [11] for contention-resolution routing protocols in store-and-forward networks. It was followed by the work by Andrews et al. [4] who emphasized the notion of universality in adversarial settings. The versatility of this methodology has been confirmed in multiple papers over the years, see ´ for instance those by Alvarez et al. [1] and Andrews and Zhang [5]. Worst-case
Adversarial Channels with Jamming
91
packet latency under adversarial queuing packet injection was studied since the introduction of this approach, see [4,11].
2
Technical Preliminaries
There are n stations attached to the channel. Each station has a unique integer name in the interval [1, n]. A transmitting station receives an instantaneous feedback through which it can hear its own successful transmissions. Stations’ perception of the channel sensed as either busy or not depends on the availability of a mechanism of collision detection. By collision detection we mean that the feedback from a busy channel due to multiple simultaneous transmissions is different from one received when no station attempts to transmit. In this paper we study channels without collision detection. Jamming. Jamming considered herein occurs in a relatively mild form: it is perceived by stations as artificial collisions. Stations cannot distinguish between a real collision, caused by multiple simultaneous transmissions, and one caused by the adversary to jam the channel for the round, in the sense that the channel is sensed as busy in both cases. Categorizing rounds. We use the following categorization of rounds determined by feedback from the channel as obtained by stations. A round when no message is heard on the channel is called void. Rounds are categorized into jammed or clear, depending on whether the adversary jams them or not. A round when no station transmits is called silent. In particular, each jammed round is void and each collision results in a void round. Stations have no means to sense whether a round is void because jammed, or void due to a collision, or clear but silent. Protocols. We adapt deterministic distributed protocols, as introduced in [12,13]. They are understood in exactly the same way as for the adversarial model without jamming, as jamming is not recognizable as a special form of feedback from the channel. We consider two classes of protocols: full sensing protocols and adaptive ones, these definitions were introduced for deterministic protocols in [12,13]. A message transmitted on the channel consists of a packet and control bits. Packets are provided by the transport layer represented by the adversary. We treat packets as abstract tokens, in the sense that their contents do not affect how protocols handle transmissions. On the other hand, control bits may be added by stations, in a way specified by the code of an executed protocol, to facilitate distributed control of the channel. A protocol is called full sensing when control bits are not sent in messages, which is in contrast to general protocols referred to as adaptive. Adversaries. We extend the adversarial model to incorporate jamming. We recall the definition of an adversary without jamming, as used in [2,12,13]. A leaky-bucket adversary of type (ρ, b) may inject at most ρ|τ | + b packets in any contiguous segment τ of |τ | rounds. For such an adversary, the parameter ρ is called the injection rate.
92
L. Anantharamu et al.
In this paper we consider an adversary that controls both packet injections and jamming. An adversary is subject to two independent rates for injection and jamming: A leaky-bucket jamming adversary of type (ρ, λ, b) can inject at most ρ|τ | + b packets and, independently, it can jam at most λ|τ | + b rounds in any contiguous segment τ of |τ | rounds. For this adversary, we refer to ρ as the injection rate, and to λ as the jamming rate. If λ = 1 then any round could be jammed. Therefore we assume that the jamming rate λ satisfies λ < 1. Stability is not achievable by a jamming adversary with injection rate ρ and the jamming rate λ satisfying ρ + λ > 1: this is equivalent to ρ > 1 − λ, so when the adversary is jamming with the maximum capacity, then the bandwidth remaining for transmissions is 1 − λ, while the injection rate is more than 1 − λ. It is possible to achieve stability in the case ρ + λ = 1, similarly as it was shown for ρ = 1 in [13], but packet latency is then unbounded. We assume throughout that ρ + λ < 1. The number of packets that the adversary can inject in one round is called its injection burstiness. This parameter equals ρ + b for a leaky bucket adversary. The maximum number of contiguous rounds that an adversary can jam together is called its jamming burstiness. A leaky-bucket adversary of type (ρ, λ, b) can jam at most b/(1 − λ) consecutive rounds, as the inequality λx + b ≥ x needs to hold for any such a number x of rounds. Performance. The basic quality for a protocol in a given adversarial environment is stability, understood to mean that the number of packets in the queues at stations stays bounded at all times. The corresponding upper bound on the number of packets waiting in queues is a natural performance metric, see [12,13]. A sharper performance metric is that of packet latency: it means an upper bound on time spent by a packet waiting in a queue, counting from the round of injection through the round when it is heard on the channel.
3
Specific Protocols
We review all the considered protocols. They are deterministic and distributed. Protocol Round-Robin-Withholding (RRW) is designed for a channel without jamming. It was introduced and investigated by Chlebus et al. [12]. The protocol operates as follows. The n stations are arranged in a fixed cycle by their names. This defines a cyclic ordering of names; in particular, the unique next station in this order is determined for any given station. One station is distinguished as a leader, it is the station of, say, the smallest name. There is a conceptual token which traverses the stations in the given cyclic order, starting from the leader. The token in implemented by each station by maintaining a private list of names of stations with a pointer indicating the token’s location: moving the token means advancing the pointer to the next entry on the list. When a station receives the token, then the station unloads its queue by way of transmissions, a packet per round, in a contiguous time interval. When the queue of a transmitting station becomes empty, the station pauses, which is interpreted by all stations to mean that the token is moved to the next station. All stations
Adversarial Channels with Jamming
93
are initiated simultaneously and they listen to the channel in all rounds. The protocol is full sensing, as messages carry only the packets with no control bits. Protocol Old-First-Round-Robin-Withholding, abbreviated OF-RRW, is designed for a channel without jamming. It was introduced and investigated by Anantharamu et al. [2]. The protocol operates similarly to RRW, the differences are as follows. An execution is structured as a sequence of conceptual phases, which are contiguous segments of rounds, of possibly varying length, one phase representing a full cycle of the token passing through all the stations, starting from the leader. There are two categories of packets: old ones are defined as those that have been injected in the previous phase, and new ones have been injected in the current phase. The new packets that have been injected in a current phase are to be transmitted in the next phase. After the old packets have been transmitted by a station, the control moves to the next station. When a token leaves a station, then all the packets currently held in the station along with those injected in the course of this phase acquire the status of old ones, they will be transmitted when the token visits the station again. We introduce protocol Jamming-Round-Robin-Withholding(J), abbreviated as JRRW(J), designed for a channel with jamming. The overall structure of the protocol is as in RRW, the difference is in how the token is transferred from a station to the next one. Just one void round should not trigger a transfer of the token, as it is the case in RRW, because not hearing a message may be caused by jamming. The protocol has a parameter J interpreted as an upper bound on the jamming burstiness of the adversary. This parameter J is used to facilitate transfer of control from a station to the next one, in the cyclic order of stations, by way of moving the conceptual token. This occurs by hearing silence for precisely J + 1 contiguous rounds, after the last heard packet, or a sequence of J + 1 silences heard indicating transfer of control in the case when the current station did not have any packets to transmit. More precisely, every station maintains a private counter of void rounds. The counters show the same value across the system, as they are updated in exactly the same way determined by the feedback from the channel. When a packet is heard or the token is moved then the counter is zeroed. A void round results in incrementing the counter by 1. The token is moved to the next station when the counter reaches J + 1. Protocol Old-First-Jamming-Round-Robin-Withholding(J), abbreviated OF-JRRW(J), is obtained from JRRW(J) similarly as OF-RRW is obtained from RRW. An execution is structured into phases, and packets are categorized into old and new, with the same rule to graduate new packets to old ones. When a token visits a station, then only the old packets could be transmitted while the new ones will obtain this status during the next visit by the token. Protocol Move-Big-To-Front, abbreviated MBTF, was proposed by Chlebus et al. [13]. The protocol was designed for a channel without jamming to operate as follows. Each station maintains a list of all the stations. The lists are identical across all stations, as manipulation of a list is determined by feedback from the channel. The list is initialized as sorted on the names of the stations. There is a token initially assigned to the leader. A station that holds at least
94
L. Anantharamu et al.
n packets considers itself big otherwise it is small. A station that holds the token transmits its packet, if it has any, along with a control bit that indicates if the station is big or small; this means that protocol MBTF is adaptive. In particular, a station with the token but without packets transmits one control bit indicating being small. A big station is moved to the front of the list after a transmission along with the token. The token visiting a small station is moved to the next station after one transmission. We say that a protocol designed for a channel without jamming is a token protocol if it uses a virtual token to avoid collisions: the token is always held by some station and only the station that holds the token can transmit. Protocols RRW, OF-RRW, JRRW, OF-JRRW, MBTF are token ones. We can take any token protocol for the model without jamming and adapt it to the model with jamming in the following manner: a station with the token transmits in each round when it holds the token. If a packet is to be transmitted then this is done in the modified protocol as well, otherwise just a marker bit is transmitted. A round in which only a marker bit is transmitted by a modified token protocol is called control round otherwise it is a packet round. The effect of sending marker bits in control rounds is that if no rounds are jammed then a message is heard in each round. This approach creates virtual collisions in jammed rounds: when a void round occurs then this round is jammed as otherwise a message would have been heard. Once a protocol can identify jammed rounds, we may ignore their impact on the flow of control. The resulting protocol is adaptive. We will consider such modified version of the full-sensing protocols RRW and OF-RRW, denoting them by C-RRW and OF-C-RRW, respectively. Note that protocol MBTF works by having a station with the token send a message even if the station does not have a packet, so enforcing additional control rounds is not needed for this protocol to convert it into one creating virtual collisions.
4
Packet Latency of Full Sensing Protocols
We show that a bounded worst-case packet latency is achievable by full sensing protocols against adversaries for whom jamming burstiness is at most a given bound J, while J is a part of code. Lemma 1. Consider an execution of protocol OF-JRRW(J) against a leakybucket adversary of jamming rate λ, burstiness b, and of jamming burstiness at most J. If in any round there are x old packets in the system, then at least x packets are transmitted within the next (x + n(J + 1) + b)/(1 − λ) rounds. Proof. It takes n time intervals for the token, each interval of J +1 void rounds, to make a full cycle and so to visit every station with old packets. It is advantageous for the adversary not to jam the channel during these rounds. Therefore at most n(J + 1) + x clear rounds are needed to hear the x packets. Consider a time segment of z contiguous rounds in which some x packets are heard. At most zλ+b of these z rounds can be jammed. Therefore the inequality z ≤ n(J +1)+x+zλ+b holds. Solving for z we obtain
Adversarial Channels with Jamming
95
x + n(J + 1) + b 1−λ as the bound on the length of a time interval in which at least x packets are heard. z≤
bn Theorem 1. Packet latency of protocol OF-JRRW(J) is O( (1−λ)(1−ρ−λ) ) for a jamming adversary of type (ρ, λ, b) and such that its jamming burstiness is at most J, for ρ + λ < 1.
Proof. Let ti be the duration of phase i and qi be the number of old packets in the beginning of phase i, for i ≥ 1. The following two estimates lead to a recurrence for the numbers ti . One is qi+1 ≤ ρti + b ,
(1)
which follows from the definitions of old packets and of type (ρ, λ, b) of the adversary. The other estimate is ti+1 ≤
n(J + 1) + qi+1 + b , 1−λ
(2)
which follows from Lemma 1. Denote n(J + 1) = a and substitute (1) into (2) to obtain ti+1 ≤
a + qi+1 + b a b ρti + b a 2b ρ ≤ + + = + + ti ≤ c+dti , 1−λ 1−λ 1−λ 1−λ 1−λ 1−λ 1−λ
ρ for c = a+2b and d = 1−λ . Note that d < 1 as ρ < 1 −λ. We find an upper bound 1−λ on the duration of a phase by iterating the recurrence ti+1 ≤ c + dti . To this end, it is sufficient to inspect the sequence of consecutive bounds t1 ≤ c, t2 ≤ c + dc, t3 ≤ c + dc + d2 c, and so on, on the lengths of the initial phases, to discover the following general pattern:
ti+1 ≤ c + dc + d2 c + . . . di c ≤ After substituting c = ti ≤
a+2b 1−λ
and d =
ρ 1−λ
c . 1−d
(3)
into (3), one obtains
a + 2b 1 a + 2b 1−λ a + 2b · ≤ · ≤ . ρ 1 − λ 1 − 1−λ 1−λ 1−ρ−λ 1−ρ−λ
(4)
Now replace a by n(J + 1) in (4) to expand it into ti ≤
n(J + 1) + 2b . 1−ρ−λ
(5)
Apply the estimates J ≤ b/(1 − λ) to (5) to obtain ti ≤
b n( 1−λ + 1) + 2b
1−ρ−λ
≤
2(bn + (n + b)(1 − λ)) , (1 − λ)(1 − ρ − λ)
(6)
96
L. Anantharamu et al.
which is a bound on the duration of a phase; it happens to depend only on the type of the adversary without involving J. The bound on packet latency we seek is twice that in (6), as a packet stays queued for at most two consecutive phases. bn Theorem 2. Packet latency of protocol JRRW(J) is O (1−λ)(1−ρ−λ)2 against a jamming adversary of type (ρ, λ, b) such that its jamming burstiness is no more than J and ρ + λ < 1. Proof. We compare packet latency of protocol JRRW(J) to that of protocol OFJRRW(J). To this end, consider an execution of protocols JRRW(J) and OFJRRW(J) determined by some injection and jamming pattern of the adversary. Let si and ti be bounds on the length of phase i of protocols OF-JRRW(J) and JRRW(J), respectively, when run against the considered adversarial pattern of injections and jamming. Phase i of OF-JRRW(J) takes si rounds. When protocol JRRW(J) is executed, the total length ti of phase i is at most si + si (ρ + λ) + si (ρ + λ)2 + . . . =
si 1 − (ρ + λ)
(7)
rounds. We obtain that the phase’s length of protocol JRRW(J) differs from 1 that of protocol OF-JRRW(J) by at most a factor of 1−ρ−λ . Protocols JRRW(J) and OF-JRRW(J) share the property that a packet is transmitted in at most two consecutive phases, the first one determined by the injection of the packet. The bound on packet latency given in Theorem 1 is for twice the length of a phase of protocol OF-JRRW(J). Similarly, a bound on twice the length of a phase of protocol JRRW(J) is a bound on packet latency. It follows that a bound on packet latency of protocol J-RRW(J) can be obtained 1 by multiplying the bound given in Theorem 1 by 1−ρ−λ . Knowledge of jamming burstiness. We have shown that a full-sensing protocol achieves bounded packet latency for ρ+λ < 1 when an upper bound on jamming burstiness is a part of code. We hypothesize that this is unavoidable and reflects the limited power of full sensing protocols: Conjecture 1. No full sensing protocol can be stable against all jamming adversaries with rates ρ + λ < 1.
5
Packet Latency of Adaptive Protocols
We consider three adaptive protocols C-RRW, OF-C-RRW, and MBTF, and give upper bounds on their packet latencies. The bounds are similar to those obtained in Theorems 1 and 2 for their full sensing counterparts: the apparent relative strength of adaptive protocols is reflected in their bounds missing the factor 1 − λ in the denominators. Each of the adaptive protocols considered is stable for any jamming burstiness, unlike their full sensing counterparts which have jamming burstiness that they can handle as parts of their codes.
Adversarial Channels with Jamming
97
n+b Theorem 3. Packet latency of protocol OF-C-RRW is O 1−ρ−λ against a jamming adversary of type (ρ, λ, b) such that ρ + λ < 1. n+b Theorem 4. Packet latency of protocol C-RRW is O (1−ρ−λ) against a jam2 ming adversary of type (ρ, λ, b) such that ρ + λ < 1. Protocol Move-Big-To-Front. Next we estimate packet latency of protocol MBTF against jamming. The analysis we give resorts to estimates of the number of packets stored in the queues at all times. Lemma 2. If protocol MBTF is executed by n stations against a leaky-bucket adversary of type (ρ, λ, b), then the number of packets stored in queues in any 2ρn(n+b) round is bounded from above by (1−λ)(1−ρ−λ) + O(bn). When big stations get discovered then the regular round-robin pattern of token traversal is disturbed. Suppose a station i is discovered as big, which results in moving the station up to the front. The clear rounds that follow before the token either moves to position i + 1 or a new big station is discovered, whichever occurs first, are called delay rounds. These rounds are spent first on transmissions by the new first station, to bring the number of packets in its queue down to n − 1, and next the token needs i additional clear rounds to move to the station at position i + 1. Given a round t in which a packet p is injected, let us take a snapshot of the queues in this round. Let qi be the number of packets in a station i in this snapshot, for 1 ≤ i ≤ n. We associate credit in the amount of max{0, qi − (n − i)} with station i at this round. A station i has a positive credit when the inequality qi ≥ n − i + 1 holds. In particular, a big station i has credit qi + i − n ≥ i. Let C(n, t) denote the sum of all the credits of the stations in round t. We consider credit only with respect to the packets already in the queues in round t, unless stated otherwise. Lemma 3. If discovering a big station in round t results in a delay of the token by some x rounds, excluding jammed rounds, then the amount of credit satisfies C(n, t + x) = C(n, t) − x. bn 3n(n+b) Theorem 5. Packet latency of protocol MBTF is (1−λ)(1−ρ−λ) + O 1−λ . Proof. Let a packet p be injected in some round t into station i. Let S(n, t) be an upper bound on the number of rounds that packet p spends waiting in the queue at i to be heard when no big station is discovered by the time packet p is eventually transmitted. Some additional waiting time for packet p is contributed by discoveries of big stations and the resulting delays: denote by T (n, t) the number of rounds by which p is delayed this way. The total delay of p is at most S(n, t) + T (n, t). First we find upper bounds on the expression S(n, t) + T (n, t) that does not depend on t but only on n. The inequality S(n, t) ≤
n(n − 1) 1−λ
(8)
98
L. Anantharamu et al.
holds because there are at most n − 1 packets in the queue of i and each pass of n the token takes at most 1−λ rounds. The inequality T (n, t) ≤
C(n, t) 1−λ
(9)
holds because of Lemma 3 and the fact that iterated delays due to jamming contribute the factor 1/(1 − λ). Observe that C(n, t) is upper bounded by the number of packets in the queues in round t, by the definition of credit. Therefore we obtain that 2ρn(n + b) C(n, t) ≤ + O(bn) (1 − λ)(1 − ρ − λ) by Lemma 2. This combined with the estimate (9) implies the inequality T (n, t) ≤
bn 2ρn(n + b) +O . 2 (1 − λ) (1 − ρ − λ) 1−λ
(10)
Combine the estimates (8) and (10) to obtain that a packet waits for at most bn bn n(n − 1) 2ρn(n + b) 3n(n + b) + + O ≤ + O 1−λ (1 − λ)2 (1 − ρ − λ) 1−λ (1 − λ)(1 − ρ − λ) 1−λ rounds, where we used the inequalities ρ < 1 − λ and 1 − ρ − λ < 1.
6
Simulations
We performed experiments to compare packet latency of deterministic broadcast protocols among themselves and also with that of randomized backoff protocols. In an attempt to capture the worst case behavior and burstiness of broadcast demands, where typically some stations are actively receiving packets while others stay idle, two parameters α and β were used. The parameter α defines the number of active stations αn in any round; α satisfies the inequality 0 < α ≤ 12 ; stations that are not active are called passive. The parameter β defines the volatility understood as the rate of change of status of station between active and passive; β satisfies the inequality 0 ≤ β ≤ 1. An adversary controls both injection and jamming and injects packet only into stations active in a round. We implemented the five deterministic protocols specified in Section 3 and next considered in Sections 4 and 5; these are two full-sensing protocols JRRW(J) and OF-JRRW(J) and three adaptive protocols C-RRW, OF-C-RRW, and MBTF. For the two full sensing protocols, the jamming burstiness J was implemented as J = b/(1−λ)+1. Note that while the jamming rate changes in the experiments, the jamming burstiness also changes accordingly. In addition to deterministic protocols, we implemented two back-off protocols: the exponential back-off, denoted ExpBackoff, and the quadratic polynomial back-off, denoted PolyBackoff. Windowed versions of the back-off protocols were implemented, in which the round of a transmission was drawn from a suitable window uniformly at random. The
Adversarial Channels with Jamming
99
-"&,&%+'.
-)$
(%.$
'#+"('+&&"'!+"'#+"('*+#&&"'!*+
Fig. 1. Observed values of maximum packet latency for varying injection and jamming rates with these parameters: rounds = 5 million, number of stations = 64, burstiness = 30, ρ = λ
ith window size was determined as 2min(10,i) for the exponential back-off, for 0 ≤ i ≤ 10. For the quadratic polynomial back-off, the ith window size was defined as (min(i, 32))2 , for 1 ≤ i ≤ 32. The maximum size of the window for the binary exponential back-off is similar to what is used in the Ethernet. The maximum size of a window was the same in both back-off protocols. Figure 1 contains a chart that presents a comparison of all the seven protocols, including the back-off ones. The horizontal axis of rates in a figure represents the sum ρ + λ, which is considered with increments 0.05. The vertical axis represents the maximum packet latency recorded for the corresponding values of the sum ρ + λ. A logarithmic scale is used for packet latency. Amongst the deterministic protocols, the order of best performance for maximum packet latency was OFC-RRW, C-RRW, MBTF, OF-JRRW(J) through JRRW(J). Deterministic protocols outperformed the two back-off protocols for higher injection and jamming rates, although the back-off protocols did better than some deterministic protocols for smaller injection and jamming rates. We can observe a jump in packet latency of back-off protocols around the combined rates of 0.5, this jump is by two or three orders of magnitude. We can also see that the old-first protocols performed better than the regular protocols, which is consistent with the corresponding theorems of Sections 4 and 5. The adaptive regular and old-first protocols, namely JRRW(J) and OF-JRRW(J), were very close to each other in terms of the maximum packet latency, with the old-first protocol performing slightly better. For the full sensing protocols, old-first protocol OF-C-RRW outperformed regular protocol C-RRW by an order of magnitude.
100
L. Anantharamu et al.
References ` 1. Alvarez, C., Blesa, M.J., D´ıaz, J., Serna, M.J., Fern´ andez, A.: Adversarial models for priority-based networks. Networks 45(1), 23–35 (2005) 2. Anantharamu, L., Chlebus, B.S., Kowalski, D.R., Rokicki, M.A.: Deterministic broadcast on multiple access channels. In: Proceedings of the 29th IEEE International Conference on Computer Communications (INFOCOM), pp. 1–5 (2010) 3. Anantharamu, L., Chlebus, B.S., Rokicki, M.A.: Adversarial multiple access channel with individual injection rates. In: Abdelzaher, T., Raynal, M., Santoro, N. (eds.) OPODIS 2009. LNCS, vol. 5923, pp. 174–188. Springer, Heidelberg (2009) 4. Andrews, M., Awerbuch, B., Fern´ andez, A., Leighton, F.T., Liu, Z., Kleinberg, J.M.: Universal-stability results and performance bounds for greedy contentionresolution protocols. Journal of the ACM 48(1), 39–69 (2001) 5. Andrews, M., Zhang, L.: Routing and scheduling in multihop wireless networks with time-varying channels. ACM Transactions on Algorithms 3(3), 33 (2007) 6. Awerbuch, B., Richa, A., Scheideler, C.: A jamming-resistant MAC protocol for single-hop wireless networks. In: Proceedings of the 27th ACM Symposium on Principles of Distributed Computing (PODC), pp. 45–54 (2008) 7. Bayraktaroglu, E., King, C., Liu, X., Noubir, G., Rajaraman, R., Thapa, B.: On the performance of IEEE 802.11 under jamming. In: Proceedings of the 27th IEEE International Conference on Computer Communications (INFOCOM), pp. 1265– 1273 (2008) 8. Bender, M.A., Farach-Colton, M., He, S., Kuszmaul, B.C., Leiserson, C.E.: Adversarial contention resolution for simple channels. In: Proceedings of the 17th Annual ACM Symposium on Parallel Algorithms (SPAA), pp. 325–332 (2005) 9. Bhandari, V., Vaidya, N.H.: Reliable broadcast in wireless networks with probabilistic failures. In: Proceedings of the 26th IEEE International Conference on Computer Communications (INFOCOM), pp. 715–723 (2007) 10. Bhandari, V., Vaidya, N.H.: Reliable broadcast in radio networks with locally bounded failures. IEEE Transactions on Parallel and Distributed Systems 21(6), 801–811 (2010) 11. Borodin, A., Kleinberg, J.M., Raghavan, P., Sudan, M., Williamson, D.P.: Adversarial queuing theory. Journal of the ACM 48(1), 13–38 (2001) 12. Chlebus, B.S., Kowalski, D.R., Rokicki, M.A.: Adversarial queuing on the multipleaccess channel. ACM Transactions on Algorithms (to appear); A preliminary version in Proceedings of the 25th ACM Symposium on Principles of Distributed Computing (PODC), pp. 92-101 (2006) 13. Chlebus, B.S., Kowalski, D.R., Rokicki, M.A.: Maximum throughput of multiple access channels in adversarial environments. Distributed Computing 22(2), 93–116 (2009) 14. Gilbert, S., Guerraoui, R., Kowalski, D.R., Newport, C.: Interference-resilient information exchange. In: Proceedings of the 28th IEEE International Conference on Computer Communications (INFOCOM), pp. 2249–2257 (2009) 15. Gilbert, S., Guerraoui, R., Newport, C.C.: Of malicious motes and suspicious sensors: On the efficiency of malicious interference in wireless networks. Theoretical Computer Science 410(6-7), 546–569 (2009) 16. IEEE. Medium access control (MAC) and physical specifications. IEEE P802.11/D10 (January 1999) 17. Meier, D., Pignolet, Y.A., Schmid, S., Wattenhofer, R.: Speed dating despite jammers. In: Krishnamachari, B., Suri, S., Heinzelman, W., Mitra, U. (eds.) DCOSS 2009. LNCS, vol. 5516, pp. 1–14. Springer, Heidelberg (2009)
Full Reversal Routing as a Linear Dynamical System Bernadette Charron-Bost1, Matthias F¨ ugger2, , 3, Jennifer L. Welch , and Josef Widder3, 1
CNRS, LIX, Ecole polytechnique, 91128 Palaiseau 2 TU Wien 3 Texas A&M University
Abstract. Link reversal is a versatile algorithm design paradigm, originally proposed by Gafni and Bertsekas in 1981 for routing, and subsequently applied to other problems including mutual exclusion and resource allocation. Although these algorithms are well-known, until now there have been only preliminary results on time complexity, even for the simplest link reversal scheme for routing, called Full Reversal (FR). In this paper we tackle this open question for arbitrary communication graphs. Our central technical insight is to describe the behavior of FR as a dynamical system, and to observe that this system is linear in the min-plus algebra. From this characterization, we derive the first exact formula for the time complexity: Given any node in any (acyclic) graph, we present an exact formula for the time complexity of that node, in terms of some simple properties of the graph. These results for FR are instrumental in analyzing a broader class of link reversal routing algorithms, as we show in a companion paper that such algorithms can be reduced to FR. In the current paper, we further demonstrate the utility of our formulas by using them to show the previously unknown fact that FR is time-efficient when executed on trees.
1
Introduction
Link reversal is a versatile algorithm design paradigm, originally proposed by Gafni and Bertsekas in 1981 [1] for the problem of routing to a destination node in a wireless network subject to link failures. It has been used in solutions to resource allocation [2,3,4], distributed queuing [5,6], and various problems in mobile ad-hoc networks as routing [7,8], mutual exclusion [9,10,11], and leader election [12,13,14]. Essentially, link reversal is a way to change the orientation of links in a directed graph in order to accomplish some goal. In this paper, we focus on the problem of routing to a destination; the goal is to ensure that, starting from an arbitrary initial directed graph, ultimately every node in the graph has a (directed) path to the destination. Nodes that are sinks (that is, have no outgoing links) reverse the
Supported in part by projects P21694 and P20529 of the Austrian Science Fund (FWF). Supported in part by NSF grant 0964696.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 101–112, 2011. c Springer-Verlag Berlin Heidelberg 2011
102
B. Charron-Bost et al.
direction of some subset of their incident links. Different link reversal algorithms correspond to different choices of which incident links to reverse. The original paper by Gafni and Bertsekas [1] focused on two schemes: Full Reversal (FR), in which all links incident on a sink are reversed, and Partial Reversal (PR), in which, roughly speaking, sinks only reverse those incident links that have not been reversed since the last time this node was a sink. The mechanism employed in [1] was to assign to each node a unique value called a height , to consider the link between two nodes as directed from the node with larger height to the node with smaller, and to reverse the direction of a link by increasing the height of a sink. The authors showed that this general height-based algorithm is guaranteed to terminate with the desired property. Surprisingly, there was no systematic study of the complexity of link reversal algorithms until that of Busch et al. [15,16]. In these papers, the authors considered the height-based implementations of FR and PR, and analyzed the work complexity measure, which is the total number of reversals done by all the nodes. For FR, an exact formula was derived for the work complexity of any node in any graph, implying that the total work complexity in the worst case is at most quadratic in the number of nodes; a family of graphs was presented to demonstrate that this worst-case quadratic bound is tight. Similar results were given for PR with asymptotically tight bounds. The other natural complexity measure for link reversal algorithms is time, which is the number of iterations required until termination in “greedy” executions [3], where, in each iteration, all sinks take steps. Clearly, global work complexity is the number of iterations in completely sequential executions, and so is at least equal to global time complexity. For both FR and PR, this implies a quadratic upper bound on global time complexity. Concerning time complexity, Busch et al. [15,16] only obtained limited results: for each of FR and PR, they described a family of graphs on which the algorithm achieves quadratic global time complexity. However, no more precise results were given, and in particular no insights into the local time complexity of individual nodes in arbitrary graphs were provided. Recently, Charron-Bost et al. [17] took a different approach to implementing link reversal, which does not use node heights. Instead, they consider an initial directed graph, assign binary labels to the links of the graph, and use the labels on the incident links to decide which links to reverse and which labels to change. This generalized algorithm, called LR, can be specialized to different specific algorithms, including FR and PR, through different initial labelings of the links. This approach allowed an exact analysis of the work complexity of each node in LR for arbitrary link-labeled graphs. In particular, the exact work complexities for each node in FR and PR were obtained. An analysis of the work-complexity tradeoffs between FR and PR based on game theory appears in [18]. In this paper, we address the open problem of the time complexity of LR, and focus on the behavior of FR. We prove that FR can be described as a linear dynamical system in the min-plus algebra. This insight allows us to characterize exactly the FR time complexity of an arbitrary node in an arbitrary acyclic
Full Reversal Routing as a Linear Dynamical System
103
graph, solely as a function of properties of the initial directed graph. Furthermore, in a companion paper [19] we demonstrate how to reduce the general LR algorithm to FR, thus showing FR is actually the fundamental algorithm. Another application of our general formula is demonstrating that FR is timeefficient on tree networks, as its time complexity on trees is linear in the number of nodes. Full proofs of our results may be found in [20].
2 2.1
Preliminaries Notation and Definitions
We consider directed graphs of the form G = V ∪ {0}, E: graph G has N + 1 nodes, one of which is a special destination node; for convenience, we refer to the destination as node 0 and let V = {1, 2, . . . , N } be the remaining nodes. E is the set of links. The link (i, j) is said to be incident on both i and j, and to be outgoing from i and incoming to j. A node i is a sink if and only if all its incident links are incoming to i. A chain is a sequence c of nodes i0 , . . . , ik , k ≥ 0, such that for all m, 0 ≤ m < k, either (im , im+1 ) or (im+1 , im ) is a link in E; the length of the chain c, which we denote by λ(c), is defined to be k. A chain c = i0 , . . . , ik , where k ≥ 1, is closed if ik = i0 . We denote by C(i, j, G) the set of all chains of finite length in G that start with node i and end with node j; we denote by C(→ j, G) the set of all chains of finite length in G that end with node j (no matter where they start). When restricting the set of chains to a certain length t ≥ 0, we write C [t] (i, j, G) or C [t] (→ j, G) accordingly. The graphs are supposed to be connected, i.e., for any pair of nodes i, j, the set C(i, j, G) is non-empty. A path is a chain i0 , . . . , ik such that (im , im+1 ) is a link in E for 0 ≤ m < k. The notation P(i, j, G) is analogous to C(i, j, G) but referring to paths from i to j instead of chains, and analogously for the notations P(→ j, G), P [t] (i, j, G), and P [t] (→ j, G). A node i is good in G if there is a path from i to 0 in G, otherwise i is bad. We say that G is 0-oriented (or destination-oriented) if every node is good in G. Given two graphs G1 = V1 ∪ {0}, E1 and G2 = V2 ∪ {0}, E2 , G2 is called a reorientation of G1 , if G1 and G2 have the same undirected support, in the sense that V1 = V2 , and there is a bijection f from E1 to E2 such that f ((i, j)) is either (i, j) or (j, i). Then we consider the Routing Problem [1]: Given a graph G with a destination node 0, find a reorientation of G that is 0-oriented. As shown in [1], if G is acyclic, 0-orientation can be characterized by the set of sinks in G: Proposition 1. Let G be a directed, connected and acyclic graph with a specific node 0. The following conditions are equivalent: (i) G is 0-oriented, (ii) node 0 is the sole sink of G. In a distributed setting, Proposition 1 leads to a promising strategy to solve the Routing problem: it consists in “fighting” sinks — that is, changing the direction
104
B. Charron-Bost et al.
of links incident to sinks — while maintaining acyclicity. Such a strategy requires us to work under the assumption that a process is associated with each node of the graph, and for each node i, the process associated with i can both (a) determine the direction of all the links incident to i, and (b) change the direction of all incoming links incident to i. In this case, any process associated with a sink can locally detect that the graph is not destination-oriented, and then it reverses some of its incoming links in order to be no more a sink. It remains to verify that this scheme maintains acyclicity and terminates. In the sequel, we shall work within the context of (a) and (b), and we shall identify a node i with the process associated with i. 2.2
The Full Reversal Algorithm
Following the above strategy, Gafni and Bertsekas [1] provided several solutions. The simplest, called Full Reversal (F R), consists of the following rule which can be applied by any node i other than 0 that is a sink: FR: All the links incident on i are reversed. An execution of the FR algorithm from a directed graph G0 is a sequence G0 , S1 , . . ., Gt−1 , St , . . . of alternating directed graphs and sets of nodes satisfying the following conditions: 1. For each t ≥ 1, St is a nonempty subset of V that are sinks in Gt−1 . 2. For each t ≥ 1, Gt is obtained from Gt−1 by requiring each node i in St to apply the FR rule. 3. If the sequence is finite, then it ends with a graph that contains no sinks other than 0. Note that condition 2 leads to well-defined graphs Gt since two neighboring nodes cannot both be in St , for all t ≥ 1. For each t ≥ 1, the transition from Gt−1 to Gt is called iteration t, and node i in St is said to take a step at iteration t. As each St can be any nonempty subset of the sink nodes in Gt−1 other than 0, there are multiple possible FR executions starting from the same initial graph; the flexibility for the sets St captures asynchronous behaviors of the nodes. We may thus model a range of situations, with one extreme being the maximally parallel situation in which all sinks take a step at each iteration, and the other extreme being a single node taking a step in each iteration. An FR execution G0 , S1 , . . ., Gt−1 , St , . . . that exhibits the maximal amount of parallelism is called greedy, i.e., each set St consists of all the sinks in Gt−1 other than 0. Since the algorithm is deterministic, there is exactly one greedy FR execution for a given initial graph G0 . The following theorem gives the basic properties of the FR algorithm, shown in [1] for the height-based implementation, on which our work builds. Theorem 1. Let G be a directed connected graph with a destination. (a) Any FR execution from G is finite.
Full Reversal Routing as a Linear Dynamical System
105
(b) Each node takes the same number of steps in every FR execution from G. Moreover, the final graph only depends on the initial graph G. (c) If G is acyclic, then the final graph in any FR execution from G is 0-oriented. In other words, the FR algorithm solves the Routing problem if it starts with a directed connected acyclic graph. A directed graph G with a destination node is thus defined to be routable if it is connected and acyclic. 2.3
Complexity Measures
Given any FR execution G0 , S1 , . . ., Gt−1 , St , . . ., where G0 is routable, we know from Theorem 1.a that the execution is finite, and thus ends with Gk for some k. The work complexity of node i in the execution, denoted wi , is the number of steps taken by i; formally, wi = |{1 ≤ t ≤ k : i ∈ St }|. Since the execution is finite, so is each wi . By Theorem 1.b, wi depends only on the initial routable graph and not on the order in which nodes take steps. We define the work complexity to be the sum, over all nodes i, of wi . For convenience we define St to be ∅ for all t > k. The number of steps taken by any node i, up to and including iteration t, for any t ≥ 0, may thus be defined i (t) = |{t : 1 ≤ t ≤ t and i ∈ St }|. For each t ≥ 0, we denote by W (t) as: W the (N + 1)-dimensional vector whose i-th component is Wi (t), and we call it the work vector at t. Note that wi , the work complexity of node i, is equal to i (t) : t ≥ 0}. max{W (t))t≥0 which An FR execution then induces a sequence of work vectors (W satisfies the following immediate properties: initially, no node has taken a step (0) = 0. Moreover, since node 0 never takes a step, W 0 (t) = 0 for any t. and so W We further observe: i (t + 1) ∈ {W i (t), W i (t) + 1}. Observation 1. For any node i and t ≥ 0, W i (t))t≥0 is non-decreasing for any It follows that the sequence of work vectors (W node i. For each n ≥ 1, let Ti (n) be the iteration at which i takes its n-th step; if i takes fewer than n steps, let Ti (n) be equal to +∞. Thus Ti (n) = min{t : i (t) = n}, where min ∅ = +∞. For each n ≥ 1, we denote by T (n) the (N + 1)W dimensional vector whose i-th component is Ti (n), and we call it the n-th time vector. Observe that the number of steps taken by a node at the iteration at which it takes its n-th step is n. Similarly, the number of steps taken by a node at the iteration immediately before it takes its n-th step is n − 1. We obtain the i and Ti : following equations relating W Observation 2. For any node i with wi > 0 and n, 1 ≤ n ≤ wi : i (Ti (n)) = n W i (Ti (n) − 1) = n − 1. W
(WT1) (WT2)
106
B. Charron-Bost et al.
As in Busch et al. [15,16], we measure the time complexity of the FR algorithm by counting the number of iterations in greedy executions: assuming that between any two consecutive iterations in a greedy FR execution one time unit elapses, the time complexity of node i ∈ V ∪ {0}, denoted by θi , is the last iteration when i takes a step. More precisely, θi = 0 if i is a good node, and θi = max{t : i ∈ St } otherwise. Note that in the latter case, θi = Ti (wi ). We define the time complexity to be θ = max{θi : i ∈ V ∪ {0}}.
3
Full Reversal as a Linear Dynamical System
In this section, we consider a fixed graph G = V ∪ {0}, E that is routable, and the FR executions from G. First, we provide exact expressions for the work vector in terms of the initial graph G. To do that, we prove that the behavior of FR with respect to work corresponds to a linear dynamical system in min-plus algebra. Thanks to this expression for the work vector, we are able to compute the time complexity of FR executions. We can also use the work vector expression to obtain the (previously known) work complexity of FR in a fresh way. 3.1
Interleaving of FR Steps
We start by characterizing the interleaving of steps in any FR execution. For each node i, define Ini as the set of nodes j in V ∪ {0} such that (j, i) is a link in the initial graph G: these are the initially incoming neighbors of i. Similarly, for each node i in V , define Outi as the set of nodes j in V ∪ {0} such that (i, j) is a link in G: these are the initially outgoing neighbors of i. Proposition 2. In any FR execution from G, between two consecutive steps by a node i each neighbor of i takes exactly one step. Proposition 3. In any FR execution from G in which a node i takes a step, before the first step by i, each node j ∈ Ini takes no step and each node k ∈ Outi takes exactly one step. Corollary 1. In any FR execution from G, node i other than 0 and t ≥ 0, j (t) ∈ {W i (t)−1, W i (t)}, and ∀k ∈ Outi , W k (t) ∈ {W i (t), W i (t)+1}. ∀j ∈ Ini , W Moreover, i is a sink in Gt if and only if j (t) = W i (t) and W k (t) = W i (t) + 1. ∀j ∈ Ini , ∀k ∈ Outi , W 3.2
Work Vector of Greedy FR Executions
We establish a recurrence relation for the work vector in greedy FR executions. Theorem 2. In the greedy FR execution from a routable graph G, for any node i i (t + 1) = min{W j (t) + 1, W k (t) : j ∈ Ini , k ∈ Outi }. other than 0 and t ≥ 0, W
Full Reversal Routing as a Linear Dynamical System
107
Interestingly, the recurrence relation in Theorem 2 corresponds to a discrete linear dynamical system in min-plus algebra [21,22]. Let A be the (N +1, N +1)matrix defined by: ⎧ if i ∈ V ∪ {0} ∧ j ∈ Ini ⎨1 if (i ∈ V ∪ {0} ∧ j ∈ Outi ) ∨ (i = j = 0) (W) Ai,j = 0 ⎩ +∞ otherwise As the initial graph is supposed to be routable, it contains no self-loop and no cycle of length two, and thus the matrix A is well-defined by (W). In analogy to classical matrix multiplication, one defines a matrix multiplication ⊗ in min-plus algebra as follows: let M and P be an (m, p)-matrix and a (p, q)-matrix, respectively; Q = M ⊗ P is the (m, q)-matrix defined by Qi,j = min{Mi,k + Pk,j : 0 ≤ k < p}, for any pair (i, j) for 0 ≤ i < m and 0 ≤ j < q. Theorem 2 can then be rephrased as follows: in the greedy FR exe is a solution of the cution from a routable graph, the work vector function W (t + 1) = A ⊗ W (t). As the initial work vector W (0) is difference equation W equal to the null vector 0, the above discrete difference equation has trivially a (t) = At ⊗ 0. unique solution given by W Corollary 2. In the greedy FR execution from a routable graph G, the work (t) = At ⊗ 0, where A is the (N + 1, N + 1)-matrix vector at t ≥ 0 is equal to W defined from G by (W). 3.3
Dynamical Systems and Graph Properties
We can interpret A as the adjacency matrix of the directed and weighted graph whose set of nodes is V ∪ {0}, and which has a link from j to i if and only if Ai,j = +∞, the weight of this link being defined as ω(j, i) = Ai,j . Note that the self-loop at node 0 is always a link of this graph with ω(0, 0) = 0. The so-defined graph, which we call the in-out graph of G, is entirely determined by the initial graph G, and will be denoted by Gω . Except for the loop (0, 0), Gω is quite similar to G: if (i, j) is a link of G, then both (i, j) and (j, i) are links of Gω with ω(i, j) = 1 and ω(j, i) = 0; if there is no link in G between i and j in either direction, then neither (i, j) nor (j, i) is a link of Gω . Now, we express the work vector in terms of the weights of paths in the in-out graph Gω , where the weight of path c in graph Gω , denoted ωGω (c), is defined to be the sum of the weights of the links in c. Note that the weight is 0 if the length is 0. Theorem 3. In the greedy FR execution from a routable graph G, for any node i (t) = min{ωGω (c) : c ∈ P [t] (→ i, Gω )}. i and any t ≥ 0, it holds that W We would like to translate the above formula into a formula that depends on the original graph G. For that, we introduce the graph G∗ , which is the same as G except for the addition of the self-loop (0, 0), and we investigate links between chains in G, G∗ , and paths in Gω . As G is a routable graph, it contains no self-loop and no two-cycle; thus we can define unambiguously the number of pairs of consecutive nodes in a chain c
108
B. Charron-Bost et al.
in G that are in the “right” order, i.e., form a link of G. We denote this number by rG (c), and call it the routing failure of chain c since it quantifies the failure for the last node of c to route information to the first node along c. For a chain c of length 0, rG (c) = 0. Given a chain c in G∗ , we define c to be the chain identical to c except all subsequences of repeated 0’s in c are replaced by a single 0. Now we extend the definition of rG (c) for the routable graph G to the (non-routable) graph G∗ by letting rG∗ (c) = rG (c). Since a sequence of nodes is a path in Gω if and only if it is a chain in G∗ , and since ωGω (c) = rG∗ (c), we get: Corollary 3. In the greedy FR execution from a routable graph G, for any node i (t) = min{rG∗ (c) : c ∈ C [t] (→ i, G∗ )}. i and any t ≥ 0 it holds that W 3.4
Work Complexity
We next use the results we have developed so far to prove the exact work complexity of any node in any acyclic graph. Although the resulting formula has already been established in previous work [15,16,17], we believe our new proof— based on work vectors and their limit—is interesting for two reasons. First, the new proof is arguably more intuitive than the previous proofs; for instance, the proof in [17] presents rG out of the blue as a chain potential and shows that it decreases regularly during an execution. In addition, the new proof reveals the power of the approach based on work (and time) vectors, as it can be used to derive exact formulas for both work and time complexity, whereas the previous approaches for work complexity were not sufficient for analyzing the exact time complexity. Corollary 3 is used to prove the next result: Theorem 4. In any FR execution from routable graph G, for any node i, the i (t))t≥0 is stationary, and its limit is equal to wi = min{rG (c) : c ∈ sequence (W C(0, i, G)}. It is straightforward to see that a good node does no work (i.e., wi = 0); the converse can be shown thanks to Theorem 4: Corollary 4. A node i is good in a routable graph G if and only if in any FR execution from G, wi = 0. 3.5
Time Complexity
Now we seek an expression for the time vector T in greedy FR executions. For in Corollary 3, and the basic that, we use the expression for the work vector W and T . Thus we get the following timeduality relations (WT1-2) between W counterpart to Corollary 3: Theorem 5. In the greedy FR execution from the routable graph G, for any bad node i and any integer n, 1 ≤ n ≤ wi , it holds that Ti (n) = max{λ(c) : c ∈ C(→ i, G∗ ) ∧ rG∗ (c) = n − 1} + 1.
Full Reversal Routing as a Linear Dynamical System
109
We immediately obtain a formula in terms of G∗ for the termination time θi of a bad node i, by specializing n to wi in Theorem 5. Next from Theorem 4, we observe that chains in C(→ i, G∗ ) with routing failure wi − 1 cannot contain node 0 and therefore are chains in the original routable graph G. For any bad node i, we thus define a chain in C(→ i, G) to be a time-critical chain of i if it is a “realizer” of Ti (wi )−1, i.e., its routing failure is wi −1, and is of maximum length. This yields a formula in terms of the original graph G for time complexity: Theorem 6. The termination time θi of any node i in the greedy FR execution from the routable graph G is equal to 0 if i is a good node, and is equal to one plus the length of any time-critical chain of i if i is a bad node, i.e., θi = max{λ(c) : c ∈ C(→ i, G) ∧ rG (c) = wi − 1} + 1. Theorem 6 shows that the time complexity of a node depends not only on the work complexity of the node, but also on the length of chains that have a certain value of the routing failure. This indicates that considering work complexity alone cannot lead to an accurate understanding of the time complexity, as a node can have small work complexity but large time complexity.
4
Applications
In this section, we discuss some applications of the exact time complexity formula just obtained. One application is to show that, in contrast to the worst-case quadratic time complexity for arbitrary graphs, FR has linear time complexity on trees. Perhaps the major application, though, is the use of the formula to obtain the exact time complexity for a generalization of FR, which includes PR. 4.1
Time Complexity Bounds on Trees
In the following let G be an arbitrary routable graph whose undirected support is a tree. Such a directed graph is also called a tree. Consider an FR execution from G. After a node i of G takes a step, all links incident to i are directed away from i. Therefore, if i is not a leaf, then after i’s step, there exists a leaf that does not have a path to the destination 0, and we obtain: Proposition 4. In any FR execution G0 , . . ., Sk , Gk from a tree, Sk only contains leaves. In any tree, two nodes are connected by a single simple chain. In particular, for each node i, there is a single chain from 0 to i. If i is different from 0, the neighbor of i that occurs in this chain just before i, is called the 0-father of i. We now show how the time complexity in a tree changes when one flips the direction of one link in the initial graph. Lemma 1. Let i be any node other than 0 in a tree G, and let j denote its 0-father. Suppose that (i, j) is a link of G. Let H be the graph which is identical to G except that link (i, j) is replaced by link (j, i). Then, θ(G) ≤ θ(H), where θ(G) and θ(H) are the FR time complexities for graphs G and H, respectively.
110
B. Charron-Bost et al.
By repeatedly applying Lemma 1, it follows that among all trees with the same support, the tree with all links directed away from 0 has the worst time complexity. We say such trees are rooted in 0. In the following let i be the length of the unique simple chain from 0 to i. Theorem 7. Any leaf i in a tree G rooted in 0 is a bad node, and for a timecritical chain c of i in G, (i) c starts in some leaf j, and (ii) the length of c is i + j − 2. As for any node i, i ≤ N , Theorem 7 implies that a time-critical chain of i must have length at most 2N − 2. Together with Theorem 6 this leads to: Corollary 5. In any tree with N + 1 nodes, the FR time complexity is at most equal to 2N − 1. In view of Theorem 7, we deduce that there is exactly one “worst tree” with N + 1 nodes, namely the chain from 0 with length N , and all links pointing away from 0 which achieves the worst FR time complexity of 2N − 1. 4.2
Generalization
The results obtained in this paper for FR can be extended to the more general link reversal algorithm LR presented in [17] which realizes both FR and PR executions. Indeed, in a companion paper [19] we demonstrate that FR is actually the paradigm of LR executions, and generalize Theorems 4 and 6 to any LR execution. In particular, we obtain the work and time complexity of the Partial Reversal algorithm [1] by specializing the general formulas.
5
Discussion
In this paper we take a new approach to the analysis of link reversal algorithms introduced by Gafni and Bertsekas. By capturing the dynamic behavior of Full Reversal (FR) as a linear system in min-plus algebra, we exactly characterize the time complexity of every node in every (acyclic) graph. Viewing the algorithm in this way also provides a new, more intuitive, proof of the (previously known) exact work complexity. The idea to model executions of distributed algorithms as dynamical systems is not new. For instance, Malka and Rajsbaum [23] applied max-plus algebra and recurrence relations to analyze the time behavior of distributed algorithms, including the link-reversal-based algorithm for resource allocation by Barbosa and Gafni [3]. However, the recurrence relations in [23] are not linear in general. Compared to [23], our major contribution is the description of the behavior of FR using min-plus algebra, instead of max-plus, which notably produces linear recurrences for FR. This linearity allows us to represent the recurrences as a matrix that is very similar to the initial graph. Thus, we can easily compute the iterated matrix, and so obtain exact expressions for work and time complexity of FR as simple properties of the initial graph.
Full Reversal Routing as a Linear Dynamical System
N 0
1
···
111
···
j ···
Fig. 1. Bad graph for time complexity of FR
Theorem 6 sheds new light on how to evaluate an initial graph regarding its time complexity, and how to design graphs that have good or bad time complexity. The previous work by Busch et al. [16,15] focused primarily on a quantitative assessment, with the main goal being to show quadratic upper bounds on the work and time complexity that hold for all graphs. Theorems 4 and 6 allow us to establish more fine-grained results for specific families of graphs. For instance, we showed that the time complexity of FR on trees is linear in the number of nodes, a significant discrepancy with the quadratic upper bound. Our formulas provide insight into an unstable aspect of the behavior of FR: there is a family of graphs with quadratic time complexity such that the removal of a single link produces a family of graphs with linear time complexity. We first describe the graph family with quadratic time complexity (cf. Figure 1). For simplicity, assume N is even. Construct a chain 0, 1, . . . , N2 = j of nodes, with all links pointing away from 0. Node j has work complexity N2 . Then add a closed chain c = j, j + 1, . . . , N, j of length N2 in which all links but one point in the same direction. The chain c consisting of N2 copies of c has length ( N2 )2 and routing failure N2 − 1. It follows that the time complexity of node j is quadratic in N which, by the way, demonstrates a quadratic lower bound on the time complexity in general. Now notice that if we remove any link in the closed chain, the result is a tree with N + 1 nodes, and by Theorem 5, its time complexity is linear in N . Acknowledgments. We thank Hagit Attiya and Antoine Gaillard for helpful discussions.
References 1. Gafni, E., Bertsekas, D.P.: Distributed algorithms for generating loop-free routes in networks with frequently changing topology. IEEE Transactions on Communications 29, 11–18 (1981) 2. Chandy, K.M., Misra, J.: The drinking philosopher’s problem. ACM Transactions on Programming Languages and Systems 6(4), 632–646 (1984) 3. Barbosa, V.C., Gafni, E.: Concurrency in heavily loaded neighborhood-constrained systems. ACM Trans. Program. Lang. Syst. 11(4), 562–584 (1989) 4. Malka, Y., Moran, S., Zaks, S.: A lower bound on the period length of a distributed scheduler. Algorithmica 10(5), 383–398 (1993) 5. Tirthapura, S., Herlihy, M.: Self-stabilizing distributed queuing. IEEE Transactions on Parallel and Distributed Systems 17(7), 646–655 (2006)
112
B. Charron-Bost et al.
6. Attiya, H., Gramoli, V., Milani, A.: A provably starvation-free distributed directory protocol. In: 12th International Symposium on Stabilization, Safety, and Security of Distributed Systems, pp. 405–419 (2010) 7. Park, V.D., Corson, M.S.: A highly adaptive distributed routing algorithm for mobile wireless networks. In: 16th Conference on Computer Communications (Infocom), apr 1997, pp. 1405–1413 (1997) 8. Ko, Y.-B., Vaidya, N.H.: Geotora: a protocol for geocasting in mobile ad hoc networks. In: Proceedings of the 2000 International Conference on Network Protocols, ICNP 2000, pp. 240–250 (2000) 9. Raymond, K.: A tree-based algorithm for distributed mutual exclusion. ACM Transactions on Computer Systems 7(1), 61–77 (1989) 10. Naimi, M., Trehel, M., Arnold, A.: A log(n) distributed mutual exclusion algorithm based on path reversal. Journal on Parallel and Distributed Computing 34(1), 1–13 (1996) 11. Walter, J.E., Welch, J.L., Vaidya, N.H.: A mutual exclusion algorithm for ad hoc mobile networks. Wireless Networks 7(6), 585–600 (2001) 12. L., J., Malpani, N.V.N., Welch: Leader election algorithms for mobile ad hoc networks. In: Proceedings of the 4th International Workshop on Discrete Algorithms and Methods for Mobile Computing and Communication (2000) 13. Derhab, A., Badache, N.: A self-stabilizing leader election algorithm in highly dynamic ad hoc mobile networks. IEEE Trans. Parallel Distrib. Syst. 19(7), 926–939 (2008) 14. Ingram, R., Shields, P., Walter, J.E., Welch, J.L.: An asynchronous leader election algorithm for dynamic networks. In: Proceedings of the IEEE International Parallel & Distributed Processing Symposium, pp. 1–12 (2009) 15. Busch, C., Surapaneni, S., Tirthapura, S.: Analysis of link reversal routing algorithms for mobile ad hoc networks. In: Proceedings of the 15th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 210–219 (2003) 16. Busch, C., Tirthapura, S.: Analysis of link reversal routing algorithms. SIAM Journal on Computing 35(2), 305–326 (2005) 17. Charron-Bost, B., Gaillard, A., Welch, J.L., Widder, J.: Routing without ordering. In: Proceedings of the 21st ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 145–153 (2009) 18. Charron-Bost, B., Welch, J.L., Widder, J.: Link reversal: How to play better to work less. In: Dolev, S. (ed.) ALGOSENSORS 2009. LNCS, vol. 5804, pp. 88–101. Springer, Heidelberg (2009) 19. Charron-Bost, B., F¨ ugger, M., Welch, J.L., Widder, J.: Partial is full. In: Kosowski, A., Yamashita, M. (eds.) SIROCCO 2011. LNCS, vol. 6796, pp. 111–123. Springer, Heidelberg (2011) 20. Charron-Bost, B., F¨ ugger, M., Welch, J.L., Widder, J.: Full reversal routing as a linear dynamical system. Research Report 7/2011, Technische Universit¨ at Wien, Institut f¨ ur Technische Informatik, Treitlstr. 1-3/182-2, 1040 Vienna, Austria (2011) 21. Heidergott, B., Olsder, G.J., von der Woude, J.: Max plus at work. Princeton Univ. Press, Princeton (2006) 22. Baccelli, F., Cohen, G., Olsder, G.J., Quadrat, J.-P.: Synchronization and Linearity. John Wiley & Sons, Chichester (1993) 23. Malka, Y., Rajsbaum, S.: Analysis of distributed algorithms based on recurrence relations (preliminary version). In: Toueg, S., Kirousis, L.M., Spirakis, P.G. (eds.) WDAG 1991. LNCS, vol. 579, pp. 242–253. Springer, Heidelberg (1992)
Partial is Full Bernadette Charron-Bost1, Matthias F¨ ugger2, , 3, Jennifer L. Welch , and Josef Widder3, 1
CNRS, LIX, Ecole polytechnique, 91128 Palaiseau 2 TU Wien 3 Texas A&M University
Abstract. Link reversal is the basis of several well-known routing algorithms [1,2,3]. In these algorithms, logical directions are imposed on the communication links and a node that becomes a sink reverses some of its incident links to allow the (re)construction of paths to the destination. In the Full Reversal (FR) algorithm [1], a sink reverses all its incident links. In other schemes, a sink reverses only some of its incident links; a notable example is the Partial Reversal (PR) algorithm [1]. Prior work [4] has introduced a generalization, called LR, of link-reversal routing, including FR and PR. In this paper, we show that every execution of LR on any link-labeled input graph corresponds, in a precise sense, to an execution of FR on a transformed graph. Thus, all the link reversal schemes captured by LR can be reduced to FR, indicating that “partial is full.” The correspondence preserves the work and time complexities. As a result, we can, for the first time, obtain the exact time complexity for LR, and by specialization for PR.
1
Introduction
Gafni and Bertsekas [1] proposed a family of distributed algorithms for routing to a destination node in a wireless network subject to communication link failures. In these networks, virtual directions are assigned to the links, and messages are sent over the links according to the virtual directions. If the directed graph induced by the virtual directions has no cycles and has the destination as the only sink, then such a scheme ensures that forwarded messages reach the destination. To accommodate link failures, it might be necessary to reverse the virtual directions of some of the links in order to reestablish the properties that will ensure proper routing. The algorithms in [1] identified the formation of sinks as a detriment to achieving routing; whenever a node other than the destination becomes a sink, the node takes action so that it is no longer a sink. In the first algorithm in [1], called Full Reversal (FR), a sink node reverses all its incident links. However, other reversal schemes are also possible in which just some links incident on a sink are reversed. One particular such partial reversal scheme, called Partial Reversal (PR), is proposed in [1]; roughly speaking, in PR
Supported by projects P21694 and P20529 of the Austrian Science Fund (FWF). Supported in part by NSF grant 0964696.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 113–124, 2011. c Springer-Verlag Berlin Heidelberg 2011
114
B. Charron-Bost et al.
a sink reverses only those incident links that have not been reversed since the last time the node was a sink. Implementations of these two algorithms assigned unbounded height values to the nodes, viewed a link as directed from the node with higher height to the node with lower one, and brought about link reversal by having a sink node increase its heights relative to its neighbors’ heights according to some rule. The height-based approach to link reversal was used for routing in mobile ad hoc networks [2,3], leader election [5,6,7], resource allocation [8,9], distributed queuing [10], and mutual exclusion [11,12,13]. Recently, Charron-Bost et al. [4] have taken a different approach, which does not use node heights. Instead, they considered an initial directed graph, assigned binary labels to the links of the graph, and used the labels on the incident links to decide which links to reverse and which labels to change. This generalized algorithm, called LR, can be specialized to different specific algorithms, including FR and PR, through different initial labelings of the links; the two initial labelings that are globally uniform correspond to FR and PR, and non-uniform initial labelings correspond to other partial reversal schemes. In this paper, we address the open problem of the exact time complexity of LR. In [14], we used the fact that FR executions can be modeled as linear dynamical systems, in order to obtain an exact expression for the time complexity of FR. The behavior of LR in general is not linear, and the method in [14] cannot directly work for LR. We overcome this difficulty by establishing a general reduction of LR to FR: we show that every execution of LR from any link-labeled input graph G† corresponds to an execution of FR from a transformed graph T (G† ). The main point in the reduction is that the correspondence preserves the work and time complexities. Thus, the time complexity of LR (and in particular, of PR) from a graph G† can be obtained by transforming G† into T (G† ) and then applying the FR time complexity results from [14] to T (G† ). From [15,16,4,14] follows that the key quantity for work and time complexity of FR is the number r of links in a chain that are directed toward the last node in the chain. For LR, we introduce a new chain potential in link-labeled graphs, called the routing failure, which is a generalization of the quantity r for FR. We establish formulas for the time and work complexity of LR which are analogous to those for FR when replacing r with the routing failure of the chain. In this way, we provide a general expression for the time complexity of LR, and thus also of PR, as a function of characteristics of the input graph G† only. Hence, all the link reversal schemes captured by LR, in which a sink’s incident edges are only partially reversed, can be reduced to FR, indicating that “partial is full.” The proofs and other details that had to be omitted due to space restrictions can be found in [17].
2
Preliminaries
We consider directed graphs with N + 1 nodes, one of which is a specific node called the destination, and a set E of directed links. For convenience, we refer to the destination as node 0 and we let V = {1, 2, . . . , N } be the remaining nodes.
Partial is Full
115
The link (i, j) in E is said to be incident on both i and j, and to be outgoing from i and incoming to j. A node i is said to be a sink if and only if all its incident links are incoming to i. A chain is a sequence c of nodes i0 , . . . , ik , k ≥ 0, such that for all m, 0 ≤ m < k, either (im , im+1 ) is in E or (im+1 , im ) is in E; the length of the chain c, which we denote by λ(c), is defined to be k. We denote by C(i, j, G) the set of all chains of finite length in G that start with node i and end with node j; we denote by C(→ j, G) the set of all chains of finite length in G that end with node j (no matter where they start). A path is a chain i0 , . . . , ik such that for all m, 0 ≤ m < k, (im , im+1 ) is in E. G is connected if for any two nodes i and j, there is a chain from i to j. A node i is good in G if there is a path from i to 0, otherwise i is bad. We say that G is 0-oriented if every node is good in G. A chain c = i0 , . . . , ik , where k ≥ 1, is closed if ik = i0 . A cycle is the subgraph of G induced by a simple closed chain that is a path; in a cycle, all the links point in the same direction. If G has no cycles, then it is acyclic. A directed graph G = V ∪ {0}, E is defined to be routable if it is connected, it has no self-loops, and for each (i, j) in E, (j, i) is not in E. We only consider input graphs that are routable. Given two routable graphs G1 = V1 ∪ {0}, E1 and G2 = V2 ∪ {0}, E2 , G2 is called a reorientation of G1 if G1 and G2 have the same undirected support, in the sense that V1 = V2 , and there is a bijection f from E1 to E2 such that f ((i, j)) is either (i, j) or (j, i). Being a reorientation is symmetric, in that G1 is a reorientation of G2 iff G2 is a reorientation of G1 . Then we consider the Routing Problem [1]: given a routable graph (to 0) G, find a reorientation of graph G that is 0-oriented. Interestingly, if G is acyclic, 0-orientation can be characterized by the set of sinks in G [1]: Proposition 1. Let G be an acyclic routable graph with a specific node 0. The graph G is 0-oriented if and only if node 0 is the sole sink of G. 2.1
The LR Algorithm
Proposition 1 leads to the link reversal strategy to solve the Routing problem: it consists in “fighting” sinks — that is, changing the direction of links incident to sinks — while maintaining acyclicity. Following this strategy, Charron-Bost et al. [4] proposed a general algorithm for the routing problem, called LR for Link Reversal , in which binary labels are assigned to the links; when a node takes a step, it uses a local rule to update the directions and labels on the incident links. The LR algorithm unifies the FR and PR [1] just by varying the input binary labeling of LR, while the local rule is always the same. We consider a graph G = V ∪ {0}, E and a function μ from E to { , 1l}, which assigns the label or 1l to each link of G. We denote the resulting linklabeled graph as G† = G, μ, and G is called the support of G† . The dagger superscript will be used throughout to indicate such a link-labeled graph. If the support of G† is routable, then G† is said to be a link-labeled routable graph. Each sink i other than 0 can apply the following (mutually exclusive) rules:
116
B. Charron-Bost et al.
R1: If at least one link incident on i is labeled with , then all the links incident on node i that are labeled with are reversed, the other incident links are not reversed, and the labels on all the incident links are flipped. R2: If all the links incident on node i are labeled with 1l, then all the links incident on i are reversed, but none of their labels is changed.
When node i applies R1 or R2, then i is said to take a step. Given a link-labeled routable graph G† , any nonempty set S of sinks in G† is said to be applicable to G† , as each node in S may “simultaneously” take a step. Since two neighboring nodes cannot both be sinks, the resulting graph depends only on S and G† , and is denoted by S.G† . In case S = {i}, we write i.G. By induction, we easily generalize the notion of applicability to G† for a sequence S of nonempty sets of nodes, and we denote the resulting graph by S.G† . An execution of the LR algorithm from a link-labeled routable graph G†0 is a sequence G†0 , S1 , . . . G†t−1 , St , . . . of alternating link-labeled routable graphs and sets of nodes satisfying: 1. For each t ≥ 1, St is applicable to G†t−1 . 2. For each t ≥ 1, G†t equals St .G†t−1 . 3. If the sequence is finite, it ends with a graph containing no sinks other than 0. The transition from G†t−1 to G†t is called iteration t, and node i in St is said to take a step at iteration t. Since each St can be any nonempty subset of the sink nodes in G†t−1 other than 0, there are multiple possible LR executions starting from the same initial graph: the flexibility for the sets St captures asynchronous behaviors of the nodes. An LR execution G†0 , S1 , . . . , G†t−1 , St , . . . that exhibits the maximal parallelism is called greedy, i.e., each St consists of all the sinks in G†t−1 . Since the algorithm is deterministic, there is exactly one greedy LR execution for a given initial link-labeled routable graph G†0 . We now review the basic properties of the LR algorithm shown in [4]. Theorem 1. Let G† be a link-labeled routable graph, and G its support. (a) Any LR execution from G† is finite. If the support of the final graph is acyclic, then 0 is the sole sink in the final graph. (b) Each node takes the same number of steps in every LR execution from G† . Moreover, the final graph depends on G† only. (c) If all links are labeled with 1l in G† , then the LR executions from G† are the executions from G of the Full Reversal algorithm. (d) If all links are labeled with in G† , then the executions from G† are the executions from G of the Partial Reversal algorithm.
In an LR execution in which all links are initially labeled with 1l, links remain labeled with 1l and a sink can execute only R2, i.e., it makes a full reversal of its incident links. Otherwise, some links are initially labeled with , and certain nodes may apply R1, and then make a partial reversal as they reverse a strict subset of their incident links. This leads to Theorems 1.c and 1.d that assert that the Full and Partial Reversal algorithms from [1] correspond to two specific link labeling initializations for the LR algorithm, namely the globally uniform labelings with 1l and with . Therefore, the LR executions with such initial labelings are called FR executions and PR executions, respectively.
Partial is Full
2.2
117
Complexity Measures
Given any LR execution G†0 , S1 , G†1 , S2 , . . . , we know from Theorem 1.a that the execution is finite, and thus ends with G†k for some k. The work complexity of node i in the execution, denoted wi , is the number of steps taken by i; formally, wi = |{1 ≤ t ≤ k : i ∈ St }|. Since the execution is finite, so is each wi . Moreover, by Theorem 1.b, wi depends only on the initial link-labeled routable graph. We define the work complexity to be w = N i=0 wi . The time complexity is measured by counting the number of iterations in greedy executions: assuming that between any two consecutive iterations in a greedy LR execution G†0 , S1 , . . . Sk , G†k one time unit elapses, the time complexity of node i, denoted by θi , is the last iteration when i takes a step. Formally, θi = 0 if wi = 0, and θi = max{t : i ∈ St } otherwise. We define the time complexity to be θ = max{θi : i ∈ V ∪ {0}}. 2.3
The FR Executions
Theorem 1.a shows that starting with any link-labeled routable graph, the LR algorithm converges, i.e., reaches a graph with no sink other than 0. By Proposition 1, the LR algorithm is a solution to the Routing Problem when the final graphs are acyclic. Moreover, one easily observes that acyclicity of the graph is maintained in FR executions. Consequently, LR solves the Routing Problem for the globally uniform labeling with 1l when the initial routable graph is acyclic. In a companion paper [14], we have analyzed work and time complexity for FR. The formulas we obtained are stated in terms of an important characteristic of the input graph G: for any chain c in G, let r(c) be the number of links in c that are directed the “right” way, that is, the number of consecutive nodes ik and ik+1 in c such that (ik , ik+1 ) is a link of G. We have shown that: Theorem 2. In any execution of Full Reversal from any acyclic routable graph G, for any node i, the work complexity of node i is wi = min{r(c) : c ∈ C(0, i, G)}. Theorem 3. If wi is the work of some node i in executions of Full Reversal from any routable graph G, then the time complexity θi of node i is 0 if wi = 0, and otherwise θi = max{λ(c) : c ∈ C(→ i, G) ∧ r(c) = wi − 1} + 1. Theorem 2 has been previously proved by Busch et al. [15,16], using a node layering specific to the Full Reversal algorithm. In [4], Charron-Bost et al. gave a general formula for the work complexity of LR, which also provides the expression in Theorem 2 when specializing it to FR executions.
3
Reduction to FR Executions
In this section, we explain how to transform any routable link-labeled graph G† into a routable (unlabeled) graph H such that any LR execution from G† is equivalent to an FR execution from H. The proof of the execution equivalence uses diagram-chasing arguments.
118
3.1
B. Charron-Bost et al.
The Graph Transformation
By inspection of the LR algorithm, we observe that each node in V which initially has at least one incoming link labeled with , and at least one link which either is outgoing or is incoming and labeled with 1l always execute R1, and thus reverses only a proper subset of its incoming links when it is a sink. The incident links of such a node can be partitioned into two sets, where the links in one set are reversed at odd steps and the others at even steps. These nodes are called double nodes. In contrast, every other node in V either initially is a sink with all incoming links labeled with , or initially has all its incoming links labeled by 1l, and always reverses the direction of all its incident links. Such a node is called a single node. For convenience, the destination node 0 is supposed to be a single node. We thus partition the set of nodes into the two disjoint subsets of nodes S(G† ) and D(G† ), which are the set of single nodes and the set of double nodes in G† , respectively. In [4] it was shown that:
Theorem 4. For any LR execution G†0 , S1 . . . G†k from any link-labeled routable graph G†0 , and any t, 0 ≤ t ≤ k, D(G†t ) = D(G†0 ) and S(G†t ) = S(G†0 ). In the FR case, we easily check that D is empty. The exclusive use of R2 in this case leads to a regular interleaving given in [14]: Proposition 2. Consider any routable graph G, any FR execution from G, and any node i in G. Let Ini and Outi denote the set of incoming and outgoing neighbors of i in G, respectively. (a) Between two consecutive steps by a node i other than 0, each neighbor of i takes exactly one step. (b) If i takes at least one step, then before the first step by i, each node j ∈ Ini takes no step and each node k ∈ Outi takes exactly one step. The point in general LR executions is to cope with the double nodes: between two steps of a double node i, not all i’s neighbors take steps. From the viewpoint of one of i’s neighbors j that is a single node, i takes two steps between two steps of j. Hence Proposition 2 does not hold anymore in the general LR case. However, the LR interleaving is always regular. To see that, we distinguish between odd and even steps of each double node i, and hence introduce two types of steps by i which alternate. We consider only one type of steps for single nodes. We then observe for any two neighbors i and j that between two steps of a certain type by node i there is exactly one step of each type by node j. That yields an alternating pattern of typed steps of neighbors, similar to the alternating pattern of the FR interleaving, and an initial offset of typed steps is similar to the FR initial offset. This leads to the idea of simulating an LR execution from a routable linklabeled graph G† with an FR execution from a directed graph H which is obtained from G† by splitting each double node into two distinct nodes, and by connecting the resulting nodes with directed links so that the FR interleaving given by Proposition 2 corresponds to the regular interleaving in the LR executions from G† described just above.
Partial is Full
[i] i
1l
[j]
j
i −
[i]
−
[j]
[i]
119
[j]
j −
[i]
−
[j]
Fig. 1. Transformation of link (i, j) in G† to a collection of links in T (G† )
Formally, we consider the graph transformation T that maps any link-labeled routable graph G† to a directed graph H = T (G† ). In order not to confuse nodes from G† with the nodes from T (G† ), we keep the convention that nodes in G† are from {0, . . . , N } and introduce the convention that nodes in T (G† ) are strings of the form [i] or − [i], where i is in IN. For a set S ⊆ IN, we define [S] = {[i] : i ∈ S}. Definition 1. Given a routable link-labeled graph G† = V ∪ {0}, E, μ, we define T (G† ) = V T ∪ {[0]}, E T to be the routable graph with destination node [0], V T = {[i] : i ∈ V } ∪ {− [i] : i ∈ D(G† )}, and E T defined as follows: for any link e = (i, j) in E labeled with μ = μ(e), 1. ([i], [j]) is in E T ; 2. if i ∈ D(G† ), then (− [i], [j]) is in E T ; 3. if j ∈ D(G† ), then if μ = , then (− [j], [i]) is in E T , else ([i], − [j]) is in E T ; 4. if both i ∈ D(G† ) and j ∈ D(G† ), then if μ = , then (− [j], − [i]) is in E T , else (− [i], − [j]) is in E T .
Figure 1 illustrates the transformation of a link (i, j) in G† . Links drawn with dashed arrows only exist if the incident nodes − [i] or − [j] exist, i.e., if i or j is a double node. Through the transformation T , each labeled link e in E is mapped into a set of links in E T which we denote by T (e). If e is a link in G† and i is a sink in G† , then we denote by i.e the corresponding link in i.G† . Similarly, we denote by [i].T (e) the set of links in [i].T (G† ) corresponding to link e ∈ G† . From the very definition of T (G† ), we easily establish that: Proposition 3. A node i is a sink in G† if and only if [i] is a sink in T (G† ). Moreover, if j ∈ D(G† ), then the node − [j] is not a sink in T (G† ). 3.2
Dynamics in LR Executions
To show that the dynamics in any LR execution from G† are equivalent to the dynamics in an FR execution from T (G† ), we use graph isomorphisms: given two directed graphs G = V, E and G = V , E , and a bijection α, from V to V , we denote by G α G that α is an isomorphism from G to G . Recall that if G α G and G β G , then G β◦α G . First we easily check: Proposition 4. For any two graphs G and G routable to destinations u and v, respectively, such that G α G and v = α(u), it holds that if set S is applicable to G, then α(S) is applicable to G and S.G α α(S).G .
120
B. Charron-Bost et al.
G†0
S1 applicable
/ S1 .G† 0
S2 applicable
/ S2 .(S1 .G† ) 0 T
T (S2 .S1 .G†0 )
T T
O
[S2 ] applicable
O O
O
τ † G0 ,S2
/ [S2 ].T (S1 .G† ) 0 OO τ † τ † O O G0 ,S1 O G0 ,S1 Σ2 =τ † ([S2 ]) applicable G ,S1 0 / Σ .T (G† ) / Σ .Σ .T (G† ) 1 2 1 0 0 T (S1 .G†0 )
OO O
T (G†0 )
Σ1 =[S1 ] applicable
Fig. 2. Relation of the first two iterations in an LR execution and its corresponding FR execution
For proving that for any set of sinks S in G† , the graphs [S].T (G† ) and T (S.G† ) are isomorphic, we need some additional notation. Given any routable graph G† and any node i in G† , we define the permutation of the set of nodes in T (G† ), denoted τG† ,i , as the identity function if i is a single node, and as just permuting [i] and − [i] if i is a double node. Obviously, τG† ,i is bijective. Moreover, for any graph G† , any two functions τG† ,i and τG† ,j commute, and we may thus unambiguously define τG† ,S for a set S of nodes in G† by the composition of the functions τG† ,i , i in S, irrespective of the order. From this, and since for each i in S, (τG† ,i )−1 = τG† ,i , we deduce that (τG† ,S )−1 = τG† ,S . Note that τG† ,i depends on G† only in the partitioning of nodes into single and double nodes. By Theorem 4, this bi-partitioning is constant during any LR execution. Hence τS.G† ,i = τG† ,i . We begin with the case S is a singleton {i}. Proposition 3 ensures that if i is a sink in G† , then {i} is applicable to G† , and {[i]} is applicable to T (G† ). Lemma 1. If i is a sink in G† and τ = τG† ,i , then [i] is applicable to T (G† ) and [i].T (G† ) τ T (i.G† ). Lemma 2. If S is a nonempty set of sinks in G† and τ = τG† ,S , then [S] is applicable to T (G† ) and [S].T (G† ) τ T (S.G† ). To combine iterations of Lemma 2, let S = (St )1≤t≤k be a sequence of k, k ≥ 1, sets of nodes applicable to some G† . Let Σ = (Σt )1≤t≤k be the sequence of k sets of nodes in T (G† ) defined by: Σ1 = [S1 ] Σt = τG† ,S1 ◦ · · · ◦ τG† ,St−1 ([St ]) ,
2 ≤ t ≤ k.
(1)
Lemma 3. If S is a sequence of length k applicable to G† , and τ = τG† ,S1 ◦ · · · ◦ τG† ,Sk , then Σ is applicable to T (G† ), and Σ.T (G† ) τ T (S.G† ). Figure 2 depicts the relationship between an LR execution and its corresponding FR execution for the first two iterations, and it shows how graph isomorphisms combine in the involved commutative diagrams.
Partial is Full
121
Theorem 5. If G†0 , S1 , . . . , G†k is an LR execution from some link-labeled graph G†0 routable to 0, then there is an FR execution H0 , Σ1 , . . . , Hk from the graph H0 = T (G†0 ) routable to [0], where each Ht is isomorphic to T (G†t ), and where for each node i in G0 , the steps by [i] and − [i] alternate. Moreover, the execution H0 , Σ1 , . . . , Hk is greedy if and only if G†0 , S1 , . . . , G†k is greedy.
4
The Routing Failure
From Theorems 2, 3, and 5 we can in principle derive the work and time complexity for LR executions from any routable link-labeled graph. However, we would like to define a generalization of the chain potential r for link-labeled graphs that can provide simple expressions of the work and time complexity in terms of the initial link-labeled graph. In this section, we study how any chain in G† is transformed by the mapping T in Definition 1. For that, we introduce some notation. Let c = i0 , . . . , in be any chain in G† , and let first(c) = i0 and last(c) = in denote the first and the last node in c, respectively. In the directed graph T (G† ), we consider the sequences of nodes u0 , . . . , un in T (G† ) such that for all k, 0 ≤ k ≤ n, uk ∈ {[ik ], − [ik ]}. Such sequences are chains in T (G† ). If in is a double node, we denote by T + (c) and T − (c) the sets of such chains ending in [in ] and − [in ], respectively. Further T (c) = T + (c) ∪ T − (c). Otherwise in is a single node, T + (c), T − (c), and T (c) are all equal and denote the set of such chains ending in [in ]. Any chain in T (c) has the same length as c. Besides, let us recall some notation from [4]. A node i in G† is a -sink in c, if it occurs in c between two consecutive links in c which are incoming to i and labeled with . We denote by s (c) the number of -sinks in c. A link which is labeled with 1l and directed toward the end of the chain is called a 1l-right link, and the number of such links in c is denoted by r1l (c). Hence in the FR case r1l (c) = r(c). Similarly we define -right links. The residue Res(c) is defined to be 1 if c’s last link is a -right link, and otherwise Res(c) = 0. In particular, for a chain c of length 0, Res(c) = 0. We define the chain potential (c) as (c) = r1l (c) + s (c) + Res(c), and the routing failure Φ(c) by Φ(c) = (c) if last(c) ∈ S, and Φ(c) = 2(c) − Res(c) if last(c) ∈ D. Next, we relate Φ to the FR potential r in T (G† ):
Theorem 6. For any chain c in G† , min{r(γ) : γ ∈ T (c)} Φ(c) = min{r(γ) : γ ∈ T + (c)} + min{r(γ) : γ ∈ T − (c)}
5 5.1
if last(c) ∈ S, if last(c) ∈ D.
Application The Acyclicity Issue
As explained in Section 2, acyclicity of the graph is maintained in FR executions. Unfortunately, this may be not the case in LR executions, and this is why we
122
B. Charron-Bost et al.
are now looking for a property of the initial link-labeled graph G† that ensures acyclicity during the whole LR executions from G† . First, we characterize the link-labeled graphs that are transformed into acyclic graphs by T . Theorem 7. Let G† be a link-labeled routable graph. Then the following are equivalent: (i) the graph T (G† ) is acyclic, and (ii) for any closed chain c in G† , (c) > 0. Since acyclicity is maintained in FR executions, and is preserved under graph isomorphisms, by combining Theorems 5 and 7, we derive that condition (ii) is maintained in LR executions. Obviously, condition (ii) for a link-labeled graph implies acyclicity of its support. Thereby, if (ii) initially holds, then the support of the final graph is acyclic, and by Theorem 1 and Proposition 1, is 0-oriented. One can show that (ii) is actually equivalent to a simple condition, called (AC), being satisfied on all circuits (i.e., subgraphs induced by simple closed chains). As defined in [4], a circuit satisfies (AC) if it contains links labeled with 1l in opposite directions, or if it contains a node that is a sink relative to the circuit where both incoming links are labeled with . The mentioned equivalence combined with Theorem 7 reveals (AC) to be the counterpart of acyclicity for FR. The benefit of (AC) over (ii) is that it allows us to check just simple closed chains instead of all closed chains.
5.2
Exact Complexity of the LR Algorithm
We now develop for the first time an exact expression for the time complexity of LR (and thus PR). To this end, we require an exact expression for the work complexity of each node beforehand. We note that from Theorems 2 and 5, we derive a new proof that the LR algorithm terminates, i.e., each node i takes a finite number wi of steps. More precisely, either i is a single node in G† , there is one corresponding node [i] in the routable graph T (G† ), and wi = w[i] , or else i is a double node, [i] and − [i] are the two corresponding nodes in T (G† ), and wi = w[i] + w− [i] where w[i] and w− [i] denote the work by [i] and − [i] in any FR execution from the routable graph T (G† ). In the case each circuit in the initial link-labeled graph satisfies (AC), we show in [17] that wi is equal to the minimum routing failure of the chains from 0 to i. This work complexity result has already been established in [4], but the proof in [17] is based on Theorem 6 and is interesting on its own as it illustrates how to use our reduction to translate a result previously established for FR, namely Theorem 2, into a general result for LR. Theorem 8. Let G† be a link-labeled routable graph where all circuits satisfy the (AC) property. In any LR execution from G† , the number of steps taken by any node i is equal to wi = min{Φ(c) : c ∈ C(0, i, G† )}. We use the same technique to generalize Theorem 3 to LR greedy executions. In this way, we establish a new result, namely the exact time complexity.
Partial is Full
0
1
2
3
4
N 2
123
N
Fig. 3. Chain family with quadratic time complexity of PR
Theorem 9. If wi is the work of some node i from the link-labeled routable graph G† , then the termination time θi in the greedy LR execution is 0 if wi = 0, and otherwise θi = max{λ(c) : c ∈ C(→ i, G† ) ∧ Φ(c) = wi − 1} + 1. By Theorem 1.d, PR executions are those where all links are initially labeled with . In such graphs, a node other than 0 is a single node if and only if it is a source or a sink. Denoting by s(c) the number of sinks relative to c, we obtain:
Corollary 1. If wi is the work of node i in executions of Partial Reversal from the routable graph G, then the termination time θi in the greedy execution is 0 if wi = 0, and otherwise θi is equal to s(c) + Res(c) if i is a source or sink max λ(c) : c ∈ C(→ i, G) ∧ wi − 1 = + 1. 2s(c) + Res(c) otherwise
In trees the time complexity of FR is linear in the number of nodes [14]. Applying our transformation to a labeled tree does not in general result in a tree, which indicates that the time complexity of PR on trees may be nonlinear. Indeed, based on Corollary 1, one can design a family of chains in which the time complexity of PR is quadratic in the number of nodes (cf. Figure 3). Hence, when considering time instead of work, we arrive at the conclusion opposite to [18] that PR is not better than FR. The discrepancy stems from FR allowing more concurrency, thus possibly compensating nodes for additional work.
6
Conclusions
In a companion paper [14], we prove that the dynamic behavior of Full Reversal (FR) from a directed graph G can be captured by a linear dynamical minplus system of order equal to the number of nodes in G, and so derive the work and time complexity of FR. It can be easily shown that unlike FR, the dynamic behavior of Partial Reversal (PR) cannot in general be described by such a system of the same order. Hence, we have been led to develop a different approach for the complexity of LR, namely by a reduction to FR. Incidentally, the reduction reveals FR as the paradigm of the link reversal algorithmic scheme. From a more technical viewpoint, this approach proved to be efficient: First, it provides a direct method for establishing a condition on the link-labeled graph that is the exact counterpart to acyclicity for FR, a condition that is central to the routing problem. Second, it allows us to compute the exact work, and — for the first time — time complexity in terms of the initial labeled graph. Interestingly, the reduction also works when there is no destination node. This is precisely the context in which [9] and [8] proposed to run FR for scheduling and resource allocation. In light of our reduction to FR, the general LR scheme (and in particular PR) turns out to be adequate for both problems, leading to new distributed solutions worthy of further studies.
124
B. Charron-Bost et al.
References 1. Gafni, E., Bertsekas, D.P.: Distributed algorithms for generating loop-free routes in networks with frequently changing topology. IEEE Transactions on Communications 29, 11–18 (1981) 2. Park, V.D., Corson, M.S.: A highly adaptive distributed routing algorithm for mobile wireless networks. In: 16th Conference on Computer Communications (Infocom), pp. 1405–1413 (1997) 3. Ko, Y.B., Vaidya, N.H.: Geotora: a protocol for geocasting in mobile ad hoc networks. In: Proceedings of the 2000 International Conference on Network Protocols, ICNP 2000, pp. 240–250 (2000) 4. Charron-Bost, B., Gaillard, A., Welch, J.L., Widder, J.: Routing without ordering. In: Proceedings of the 21st ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 145–153 (2009) 5. Malpani, N., Welch, J.L., Vaidya, N.: Leader election algorithms for mobile ad hoc networks. In: Proceedings of the 4th International Workshop on Discrete Algorithms and Methods for Mobile Computing and Communication (2000) 6. Derhab, A., Badache, N.: A self-stabilizing leader election algorithm in highly dynamic ad hoc mobile networks. IEEE Trans. Parallel Distrib. Syst. 19, 926–939 (2008) 7. Ingram, R., Shields, P., Walter, J.E., Welch, J.L.: An asynchronous leader election algorithm for dynamic networks. In: Proceedings of the IEEE International Parallel & Distributed Processing Symposium, pp. 1–12 (2009) 8. Chandy, K.M., Misra, J.: The drinking philosopher’s problem. ACM Transactions on Programming Languages and Systems 6, 632–646 (1984) 9. Barbosa, V.C., Gafni, E.: Concurrency in heavily loaded neighborhood-constrained systems. ACM Trans. Program. Lang. Syst. 11, 562–584 (1989) 10. Tirthapura, S., Herlihy, M.: Self-stabilizing distributed queuing. IEEE Transactions on Parallel and Distributed Systems 17, 646–655 (2006) 11. Raymond, K.: A tree-based algorithm for distributed mutual exclusion. ACM Transactions on Computer Systems 7, 61–77 (1989) 12. Naimi, M., Trehel, M., Arnold, A.: A log(n) distributed mutual exclusion algorithm based on path reversal. J. Parallel and Distributed Computing 34, 1–13 (1996) 13. Walter, J.E., Welch, J.L., Vaidya, N.H.: A mutual exclusion algorithm for ad hoc mobile networks. Wireless Networks 7, 585–600 (2001) 14. Charron-Bost, B., F¨ ugger, M., Welch, J.L., Widder, J.: Full reversal routing as a linear dynamical system. In: Kosowski, A., Yamashita, M. (eds.) SIROCCO 2011. LNCS, vol. 6796, pp. 99–110. Springer, Heidelberg (2011) 15. Busch, C., Surapaneni, S., Tirthapura, S.: Analysis of link reversal routing algorithms for mobile ad hoc networks. In: Proceedings of the 15th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 210–219 (2003) 16. Busch, C., Tirthapura, S.: Analysis of link reversal routing algorithms. SIAM Journal on Computing 35, 305–326 (2005) 17. Charron-Bost, B., F¨ ugger, M., Welch, J.L., Widder, J.: Partial is full. Research Report 10/2011, Technische Universit¨ at Wien, Institut f¨ ur Technische Informatik, Treitlstr. 1-3/182-2, 1040 Vienna, Austria (2011) 18. Charron-Bost, B., Welch, J.L., Widder, J.: Link reversal: How to play better to work less. In: Dolev, S. (ed.) ALGOSENSORS 2009. LNCS, vol. 5804, pp. 88–101. Springer, Heidelberg (2009)
Convergence with Limited Visibility by Asynchronous Mobile Robots Branislav Katreniak Department of Computer Science, Faculty of Mathematics, Physics and Informatics, Comenius University, Bratislava
[email protected]
Abstract. Consider a community of simple autonomous robots freely moving in the plane. The robots are decentralized, asynchronous, deterministic without the common coordination system, identities, direct communication, memory of the past, but with the ability to sense the positions of the other robots. This paper presents a distributed algorithm for the convergence problem with limited visibility in 1-bounded asynchrony. The presented algorithm also solves the convergence problem with unlimited visibility in full asynchrony without the need for the multiplicity detection.
1
Introduction
This paper deals with the study of the asynchronous distributed system of autonomous mobile robots called CORDA. The robots are anonymous, have no common knowledge, no common sense of the direction (e.g. compass), no central coordination and no means of direct communication. Behavior of these robots is quite simple. Each of them idles, observes, computes and moves in a cycle. In particular, each robot is capable of sensing the positions of the other robots with respect to its local coordination system, performing local computations on the observed data and moving toward the computed destination. The movement may stop before robot gets to the destination or the robot may not move at all. The robots’ cycles and their phases are not synchronized and they can take arbitrary long time bounded only by a constant unknown to the algorithm. Local computation is done according to a deterministic algorithm that takes the sensed robots positions as the only input and returns the destination point toward which the executing robot moves. All robots perform the same algorithm. The main research in this area is focused on understanding conditions necessary to complete given tasks, e.g. exploring the plane ([CP06]), forming particular patterns ([FPSW08], [SY99b], [Kat05], [DP07]), converge to a single point ([CP05]), gathering in a single point([CFPS03], [Pre05], [FPSW01], [Ka06]), flocking [YSDT09], etc. We are interested in algorithms with the correctness proof, not only justified by simulations.
Supported in part by VEGA 1/0671/11.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 125–137, 2011. c Springer-Verlag Berlin Heidelberg 2011
126
B. Katreniak
The simplest studied problem in this model is the convergence problem: the robots must converge together to any point on the plane. This problem was solved in [CP05] with unlimited visibility in the full asynchrony. Every robot chooses as its destination the center of gravity of all observed robots positions. This algorithm is simple and correct. But it requires the strong multiplicity detection: when more robots are at the same place, the robots sensors must tell how many robots share the place. We found an alternative algorithm for this problem that does not require the multiplicity detection: every robot finds the furthest observed robot and moves halfway toward it. This algorithm is also very simple and we prove its correctness in this paper. And it does not require the multiplicity detection. According to the CORDA model definition, our algorithm is better. It does not require the multiplicity detection. On the other side, we can argue that to implement the center of gravity algorithm, the sensors can be simpler and directly return the destination point. And it is possible to argue that our algorithm requires sensors to return only the position of the furthest robot. The main focus is on the convergence problem with limited visibility: the robots only see those other robots that are within a fixed distance and they must converge together to any point on the plane, provided that the visibility graph is initially connected. Paper [FPSW01] shows that the robots can converge with limited visibility in full asynchrony when they are equipped with the compass. Even more, they are able to gather at one point in finite time. The convergence problem with limited visibility is much more difficult without the compass. Paper [SY99a] provides an algorithm and proves its correctness in pseudosynchronous settings, where the observation phases of all robots are globally synchronized1. Every pair of mutually visible robots maintains the mutual visibility. They restrict their destination to be inside the circle with the center at their middle and with the radius equal to half of the visibility distance. In pseudosynchronous settings, both robots will be again within the visibility distance in the next observation phase. We aim to solve this problem with more asynchrony and we present an algorithm for the convergence problem with limited visibility in k-bound asynchrony with k = 1. Robots are asynchronous in that one robot may begin an activation cycle while another robot finishes one. We assume that the scheduler is k-bounded: from the moment one robot observes the current situation to the moment it finishes its movement, no other robot performs more than k observations. Compared to definition in [YSDT09] where the k-bounded asynchrony was introduced, the robots are allowed to spend an arbitrary long time in their idle phase. In this paper we prove, that the convergence problem with limited visibility is solvable in 1-bound asynchrony. In section 3 we present the restrictions on robots movements that ensure that the visibility graph stays connected. In section 4 we 1
The paper talks about asynchronous settings, but it provides only the simulation results.
Convergence with Limited Visibility by Asynchronous Mobile Robots
127
present an algorithm respecting these restrictions. In section 5 we prove that robots executing the proposed algorithm converge toward a point. In appendix we prove that the algorithm in [SY99a] is not correct in 1-bound asynchrony. Full paper with appendixes is in [Kat11].
2
Model and Definitions
Each robot is viewed as a point in a plane equipped with sensors. It can observe the set of all points which are occupied by at least one other robot. Note that the robot only knows whether there are any other robots at a specific point, but it has no knowledge about their number (i.e. it cannot tell how many robots are at a given location). The local view of each robot consists of a local unit of length, an origin (w.l.o.g. the position of the robot in its current observation), an orientation of angles and the coordinates of the observed points. No kind of agreement on the unit of length, the origin and the orientation of angles is assumed among the robots. They are used only locally between observation, calculation and movement phases. A robot is initially in the waiting phase. Asynchronously and independently from the other robots, it observes the environment (Observe phase) by activating its sensors. The sensors return a snapshot of the world, i.e. the set of all points occupied by at least one other robot, with respect to the local coordinate system. Then, based only on its local view of the world, the robot calculates its destination point (Compute phase) according to its deterministic algorithm (the same for all robots). After the computation the robot moves toward its destination point (Move phase); if the destination point is the current location, the robot stays on its place. The movement may stop before the robot reaches its destination (e.g. because of limits to the robot’s motion energy). The robot then returns to the waiting state. The sequence Wait – Observe – Compute – Move forms a cycle of a robot. To ensure progress, the model provides progress condition: Every robot moves at least a fixed distance θ once per a fixed number of cycles Q; constants θ and Q are unknown for the algorithm. The robots are oblivious: they do not remember any previous observations nor computations performed in any previous cycles. The robots are anonymous: they are indistinguishable by their appearance, and they do not have any kind of identifiers that can be used during the computation. The robots have no means of direct communication: any communication occurs in a totally implicit manner by observing the other robots positions. The robot’s sensors have limited visibility: robot observes only those other robots that are within a global fixed radius r. The robots don’t know r, but they can compute its lower bound as the distance as the distance to the furthest observed robot. We set, w.l.o.g., the local unit 1R for robot R as the distance to the furthest observed robot in the last observation.
128
B. Katreniak
The full activation cycle for any robot: the interval from the snapshot in the observation phase (included) to the next snapshot in the next observation phase (excluded). The scheduler is k-bounded : from the moment one robot observes the current situation to the moment it finishes its movement, no other robot performs more than k starts of the full activation cycles (snapshots). We say that two robots R1 and R2 are initially connected by the visibility edge, when the initial distance |R1 R2 | ≤ r. The visibility graph is the graph of the visibility edges. Convergence problem with limited visibility: Find an algorithm for robots such that for any given group of robots in the plane with a the initial visibility graph being connected and any correct scheduler, the convex hull of all robots converges toward a point. text OV (b) denotes closed neighborhood of point V : OV (b) = In further v ∈ R2 ; |V v| ≤ b .
3
Connectivity Preservation with 1-Bounded Asynchrony
If the initial distance of two robots A, B is not more than the visibility distance r (i.e. robots see each other), we put between them a visibility edge. The problem definition guarantees that the visibility graph is initially connected. If we preserve all visibility edges, the visibility graph stays connected indefinitely. Robots connected with the visibility edge have to restrict their movements in order to preserve their mutual visibility. We are looking for such restrictions on robots movements that preserve the local visibility edges and that allow robots to converge together globally. 3.1
Connectivity Invariant
We introduce the invariant : if two robots A, B are preserving the visibility, their destinations AT , BT must always be inside 12 radius from C = A+B . 2 The invariant initially holds for all initial visibility edges: AT = A, BT = B and |AB| ≤ 1. If the invariant holds indefinitely for any initial edge, the visibility graph stays connected indefinitely. 3.2
Invariant Preservation
Idea from article [SY99b]. Let A, B be two robots at points A0 , B0 preserving 0 the visibility. Let C = A0 +B , d = |A0 B0 |. Refer to Figure 1. W.l.o.g. we set the 2 coordinate system to origin in C; C = [0, 0]. and the unit of distance to r; r = 1. Robots positions are A0 = [− d2 , 0], B0 = [ d2 , 0]. When robot B observes robot A, robot B does not know the destination AT of robot A. Robot B only knows from the invariant: |CAT | ≤
1 2
Convergence with Limited Visibility by Asynchronous Mobile Robots
129
Fig. 1. Connectivity invariant
AT = [t cos(γ), t sin(γ)]; 0 ≤ t ≤
1 ; 0 ≤ γ ≤ 2π 2
Robot A may finish its movement before it gets to AT , but this case is covered by considering any AT . Robot B chooses its target at some point BT ; BT = [x, y] and starts the movement toward BT . Robot B may finish its movement before it gets to BT , but this case is covered by considering any BT . If robot A does no observation during the movement of robot B, robot A must be idling at end of the movement of robot B (1-bound asynchrony). If we restrict |CBT | ≤ 12 , both AT and BT are inside the circle at center C and radius 1. Thus, both robots are idling within the distance 1 and the invariant holds. If robot A observes robot B during the movement of robot B, it calculates new destination based on this observation. We have to ensure, that the invariant holds at the moment of the observation. Because of the 1-bound asynchrony, robot A can perform the observation only once until robot B finishes its movement to BT . Refer to Figure 1. Robot A observes robot B at B = B0 +α(BT −B0 ); 0 ≤ α ≤ 1. To prove the invariant preservation, we have to show that the invariant now holds from robot’s A perspective: C1 = AT 2+B , |C1 BT | ≤ 1. d B = [ , 0]; BT = [x, y] 2 0 ≤ α ≤ 1; 0 ≤ d ≤ 1 B = [x , y ] = B + α(BT − B) =
d d +α x− , αy 2 2
We are looking for a condition for BT ensuring that the invariant holds for robot A at the moment of the observation. Let’s fix B to B = [x , y ] and watch possible positions of C1 for different AT . We want to find AT with maximal |C1 BT |.
130
B. Katreniak
AT + B x t y t 1 C1 = = + cos(γ), + sin(γ) ; 0 ≤ t ≤ ; 0 ≤ γ ≤ 2π 2 2 2 2 2 2
It means that points of C1 belong to circle with center B2 and radius 14 . How far can be point inside this circle from BT ? It is BT B2 + 14 . Thus, if robot B chooses such destination BT that BT B2 ≤ 14 , the invariant holds. 2 2 BT B ≤ 1 2 4 2 2 d(1 − α) 1 x− + y2 ≤ 2(2 − α) 2(2 − α)
(1)
Inequality 1 (calculated in appendix) together with inequality |CBT | ≤ 12 are sufficient to preserve the invariant. We introduce two independent restrictions fulfilling the inequalities: move toward and move around. They provide two options how the robots can move in order to preserve the invariant. 3.3
Move Toward
d Theorem 1. Let robot B calculate its destination BT ; | C+B 2 BT | ≤ 4 . The invariant is then preserved.
Proof. Theorem 1 allows robot B to move to any point inside the circle over diameter CB. Refer to Figure 2(a).
(a) Move toward
(b) Move around
(c) Combined move
(d) Combined move
Fig. 2.
Inequality 2 expresses the circle over diameter CB. We need to prove that inequality 2 implies inequality 1. As both inequalities 2 and 1 specify a circle, we show that the first circle is inside the second one. As both centers are on the horizontal axis, it is sufficient to compare the leftmost and the rightmost points. Both comparisons easily hold. 2 d d2 x− + y2 ≤ 4 16
(2)
Convergence with Limited Visibility by Asynchronous Mobile Robots
d(1 − α) 1 d d − ≤ − 2(2 − α) 2(2 − α) 4 4 d(1 − α) 1 d d + ≥ + 2(2 − α) 2(2 − α) 4 4 3.4
131
Move Around
Theorem 2. Let robot B calculate its destination BT ; |BBT | ≤ l; l = invariant is then preserved.
1−d 4 .
The
Proof. Theorem 2 allows robot B to move to any point inside the circle with center B and radius l (circle is passing B+[0.5,0] ). Refer to Figure 2(b). 2 Inequality 3 expresses the circle with center B and radius l. We need to prove that inequality 3 implies inequality 1. Both equations again specify circles with the centers on the horizontal axis. We compare the leftmost and the rightmost points. Both comparisons easily hold. l=
1−d ; 4
x−
d 2
2 + y2 ≤ l2
d(1 − α) 1 d 1−d − ≤ − 2(2 − α) 2(2 − α) 2 4 d(1 − α) 1 d 1−d + ≥ + 2(2 − α) 2(2 − α) 2 4
(3)
The calculation of BT for move around uses the visibility radius r = 1 unknown for the robot’s algorithm. If robot B uses the distance to the furthest observed robot 1B instead of r = 1 for the calculation of l, the robot may be allowed to move less because 1R ≤ 1, but the Theorem 2 holds.
4
Algorithm
When robot R observes other robots, it receives a set of robots positions {R1 ..Rn } excluding R. Robot R cannot distinguish whether it maintains the visibility edge with particular robot Ri or not. We restrict robot’s movements to maintain the visibility with all observed robots. Every robot Ri specifies the set of allowed target points Ti as the union of allowed targets in move toward and in move around. Refer to figures 2(c), 2(d). Let S be the global convex hull of all robots at the time of the observation. Let SR be the convex hull of all robots observed by R including R; SR = {R1 ..Rn } ∪ R. From the global point of view, robots inside S can move wherever they like, they just should not move toward the boundary of S. The robots at the boundary of S should move inside S. Robot R does not know the global S. But it knows
132
B. Katreniak
the local subset SR ; SR ⊆ S. We express the global goal as another set of allowed target points TS . Let TS be the set of points that are not further than halfway toward the boundary of SR : TS = v ∈ R2 ; R + 2(v − R) )∈ SR }. We have the list of sets with allowed
n target points and all of them must apply. Let T be their intersection: T = i=1 Ti ∩ TS . Robot R chooses as its destination RT the point in T that is furthest from R. If more than one point apply, it chooses point with the smallest local angle. The robot simply moves that direction, where it is allowed to move furthest. 4.1
Algorithm with Unlimited Visibility
When the robots have the unlimited visibility, they don’t need to maintain the visibility edges. They see each other all the time. The set of allowed target points T becomes TS and the algorithm becomes simple: Robot R finds the furthest m observed robot Rm and moves halfway toward it: R+R . 2
5
Convergence
We are going to prove that the constructed algorithm is correct and solves the convergence problem with limited visibility. We have to prove that the robots converge toward a point for any initial configuration and for any scheduler. The model is asynchronous. But with the fixed initial situation and with the fixed scheduler, the whole sequence of robot’s activations, observations and movements is fixed. We are interested in those time instants, when one or more robots performed the observation snapshot. We mark the initial time as t0 and the times of the observations as t1 , t2 , . . . When a robot calculates its new destination, the result of the calculation is a pure function of the observed input. We hide the calculation’s duration to the asynchrony of the movement phase and we say that the destination is calculated and applied immediately at the time of the observation. Let S(t) be the convex hull of all robots positions and of all robots destinations at time t. Let SR (t) be the convex hull of robots positions observed by robot R at time t including robot R; SR (t) ⊆ S(t). The value SR (t) is defined only when robot R performs an observation at time t. We are going to prove that S(t) converges toward a point. Theorem 3. Convex hull S(t) never grows: ∀i; S(ti ) ⊇ S(ti+1 ) Proof. Consider any robot at position R with destination RT . Because both points R and RT are in S(t), also the whole line segment RRT is in S(t). The robot’s movement cannot enlarge S(t). The new destination for robot R is calculated inside SR (t); SR (t) ⊆ S(t). Since convex hull S(t) never grows, it converges to some shape. Theorem 4. Convex hull S(t) converges uniformly toward a convex polygon S of at most 2n points.
Convergence with Limited Visibility by Asynchronous Mobile Robots
133
Proof. We know that S(t
+ 1) ⊆ S(t) and that every convex hull S(t) is a closed ∞ convex shape. Then S = t=0 S(t) is again a closed convex shape. Uniform convergence: ∀ε > 0; ∃t1 ; ∀t2 ≥ t1 ; S(t2 ) ⊆ S + ε. By contradiction, let every S(t) contain point wt ∈ S + ε. Sequence wt is an infinite sequence of points bounded by an initial convex hull S(0) and must contain an infinite subsequence of points converging toward a point w; w ∈ S + ε. But ∀t; w ∈ S(t); S(t) is closed; S(t + 1) ⊆ S(t), thus w ∈ S. Contradiction. S is polygon of at most 2n points: Every S(t) is the convex hull of at most 2n points, thus it is a polygon of at most 2n points. We choose a point V inside S. We define function ft (α) as the distance from V to the intersection of S(t) with ray from V with angle α. Polygon S(t) of at most 2n points maps to polyline ft of at most 2n lines. As sequence S(t) is converging uniformly, sequence of ft is uniformly converging too. Thus ft converges uniformly to a polyline of at most 2n lines and also S is polygon of at most 2n lines. Consider an angle α; α < π based at a vertex V . Suppose that all robots are inside α and stay inside α forever. This corresponds to the situation at any vertex of any convex hull S(t). Consider a robot R ”close” to the vertex V . The following theorem says that robot R moves ”away” of V and stays ”away” of V . Since the robot R has no idea about any global unit of distance, it measures the distances ”close” and ”away” in its local unit 1R set to the distance of the furthest observed robot. Theorem 5. Let all robot positions and destinations be inside an angle at vertex 1 V of size α; α < π. We find value c; 0 < c ≤ 12 such that no robot R ever chooses its destination inside OV (c1R ) Proof. We set the unit of distance for this proof to 1 = 1R , i.e. the distance to the furthest robot observed by R. 1 Let e = 24 cos α2 . Suppose that robot R is inside OV (e) (i.e. |V R| ≤ e), it performs an observation and calculates the destination RT . We analyze the lower bound for |RRT |. Let p be the ray starting at R and parallel with axis of α. Refer to Figure 3(a). We analyze how far robot R can move in direction p. Let Ri be any robot observed by R. – If |V Ri | ≤ 14 , then |RRi | ≤ |V Ri | + |V R| ≤ 14 + e ≤ 13 . Robot Ri allows robot R to move around in direction p at least 16 . – If |V Ri | > 14 , then |RRi | ≥ |V Ri | − |V R| ≥ 14 − e ≥ 16 . Let βi be the angle between p and RRi . Robot Ri allows R to move toward in direction p at 1 least 12 |RRi| cos βi ≥ 12 cos βi . Let β; β < π2 (calculated in appendix) be an upper bound for any βi ; βi ≤ β and also for α2 ; α2 ≤ β. Robot Ri allows robot R to move in direction p either 1 1 1 1 6 or 12 cos βi . We mark this allowed distance as fi ; fi = min( 6 , 12 cos βi ) = 1 1 1 cos βi ≥ 12 cos β ≥ 24 cos β. We mark the lower bound for fi as f ; f = 12 1 cos β. Any observed robot allows robot R to move in the direction p at least 24 1 1 the distance f . Note that f = 24 cos β ≤ 24 cos α2 = e.
134
B. Katreniak
(a)
(b) Fig. 3. Setup in Theorem 5
If the restriction to move only halfway toward the local convex hull SR (t) allows R to move in the direction p at least the distance f , we have the lower for |RRT |; |RRT | ≥ f . Otherwise refer to Figure 3(b). Let Rm be a robot at distance 1. W.l.o.g, let Rm be bellow the axis of α. Construct line q perpendicular to the axis of α at distance 3e from V . Construct line p0 parallel to the axis of α at distance e sin α2 (upper bound for p). Because the restriction to move only halfway toward the local convex hull SR (t) applies, the points at p further than 2f from R are not in SR (t). Thus there is no robot at both sides of p further than 2f < 2e. Thus there is no robot behind q on the upper side of p0 (figure’s gray area). Let p be the ray from R to Rm . We analyze how far R can move in direction p . Let Ri be any robot observed by R. – If |V Ri | ≤ 14 , then |RRi | ≤ |V Ri | + |V R| ≤ 14 + e ≤ 13 . Robot Ri allows robot R to move around in direction p at least 16 . – If |V Ri | > 14 , then |RRi | ≥ |V Ri | − |V R| ≥ 14 − e ≥ 16 . Let βi be the angle between p and RRi . Robot Ri allows R to move toward in direction p at 1 least 12 |RRi| cos βi ≥ 12 cos βi . The angle β is again an upper bound for any βi ; βi ≤ β. Thus, any observed robot allows robot R to move in the direction p again at least the distance f . The convex hull restriction does not apply in the direction p , because there is robot Rm on ray p at distance 1. We proved that when |V R| ≤ e, then robot’s R destination is at least at the distance f . We set the value c asked in the theorem to c = 14 f cos α2 . Note that c ≤ f4 < f ≤ e. – If |V R| ≤ c, robot chooses its destination outside of OV (f − c) ⊇ OV (f (1 − 3f 1 α 3c 4 cos 2 )) ⊇ OV ( 4 ) ⊇ OV ( cos(α/2) ) ⊇ OV (c).
Convergence with Limited Visibility by Asynchronous Mobile Robots
135
– If |V R| ≤ f2 , R moves at least f and its destination will be outside OV ( f2 ) ⊃ OV (c). – If |V R| > f2 , R moves at most |V R| toward V and its destination cannot be inside OV ( f4 ) ⊇ OV (c). From the Theorem 4 we know that S is a convex polyline of at most 2n lines. For every ε > 0 exists such t that S ⊆ S(t) ⊆ S + ε. Consider any vertex A of S with an angle α and with an axis p. Angle α is an angle in the convex hull, thus α < π. Refer to Figure 4. Construct line q perpendicular to p at A. Points on the convex hull’s side of q are before q, points on the other side of q are behind q. b Theorem 6. For every b > 0 exists ε; 0 < ε ≤ 12 such that if any robot R1 observes robot R2 ∈ OA (b), R1 chooses its destination before q. b Proof. Consider an upper bound ε1 for ε; ε ≤ ε1 = 12 . If R1 behind q observes 11b R2 ∈ OA (b); 1R1 ≥ |R1 R2 | ≥ b − ε ≥ 12 . Refer to Figure 4. We use Theorem 5 ε with vertex V on p behind q at distance |V A| = sin(α/2) , bounding angle parallel to α, robot R = R1 . We get c.
Fig. 4. Setup in Theorem 7
Let ε = min(c cos α2 sin α2 , ε1 ); ε ≤ ε1 ; ε ≤ c cos α2 sin α2 . If robot R1 is behind |V A| q, |V R1 | ≤ cos(α/2) = cos(α/2)εsin(α/2) ≤ c, R1 ∈ OV (c). From Theorem 5 we get that robot R1 chooses its destination outside of OV (c) and before q. Now we are ready to prove the final Theorem. Theorem 7. Convex hull S(t) converges toward point. Proof. By contradiction. Suppose that S(t) converges toward a shape S that is not a point. We are going to find such ε that all robots with destinations behind q move before q in finite time. This will be the contradiction with the assumption that robots converge toward non-point S.
136
B. Katreniak
1 Consider an upper bound b1 for b; 0 < b ≤ b1 = 12 . We use Theorem 6 with b 1 declared b and get ε; ε ≤ 12 ≤ 144 . We let the robots execute till S ⊆ S(t) ⊆ S + ε. Refer to Figure 4. While a robot R1 behind q observes a robot R2 ∈ OA (b), R1 moves before q in finite time and stays before q. If a robot R1 behind q does not observe a robot R2 ∈ OA (b), there is no robot in OR1 (1) and thus no robot in OA (1 − ε). We know that the visibility graph is connected. Either all robots are in OA (b) or there must be a robot R3 in OA (b) that preserves mutual visibility with a robot R4 ∈ OA (1 − ε). Suppose the existence of R4 ∈ OA (1 − ε). Robot R3 sees R4 , 1R3 ≥ 1 − b − ε ≥ 10 . We use Theorem 5 with robot R = R3 , V and α as in Theorem 6, we get c. 12 Let dS be the diameter of S. Let b = min( 11c , d2S , b1 ); b ≤ d2S ; b ≤ b1 . 12 If robot R4 stays out of OA (1 − ε), robot R3 moves in finite time (progress condition) out of OA (b) and stays there. Robot R3 observed all robots behind q and maintains with them visibility. Robots behind q see R3 ∈ OA (b), move before q in finite time (progress condition) and stay there. If robot R4 ever moves into OA (1 − ε), it observes robots behind q and maintains with them visibility. If robot R4 stays out of OA (b), robots behind q see R4 ∈ OA (b), move before q (progress condition) in finite time and stay there. If robot R4 ever moves into OA (b), we have at least one more robot in OA (b). We repeat this proof again from the point where R1 behind q observes or does not observe some robot out of OA (b). Either all robots behind q get and stay before q or all robots get into OA (b). But all robots cannot be in OA (b), it is contradiction with b ≤ d2S .
The convergence proof never uses restrictions imposed by the k-bound scheduler. It uses only the progress condition present also in the basic asynchronous model.
6
Conclusions and Open Questions
We proposed an algorithm for the convergence problem with limited visibility and we proved that it is correct when the asynchrony is limited to 1. Compared to algorithm in [SY99a], our algorithm works in more asynchronous model. We concluded that the proposed algorithm solves the convergence problem also in asynchronous settings with unlimited visibility with no need for the multiplicity detection. Compared to the algorithm in [CP05], our algorithm does not require the multiplicity detection. The convergence problem with limited visibility is open with asynchrony limited to a general constant a and in asynchronous settings.
References [CFPS03] Cieliebak, M., Flocchini, P., Prencipe, G., Santoro, N.: Solving the gathering problem. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 1181–1196. Springer, Heidelberg (2003)
Convergence with Limited Visibility by Asynchronous Mobile Robots [CP05]
137
Cohen, R., Peleg, D.: Convergence properties of the gravitational algorithm in asynchronous robot systems. SIAM J. Comput. 34(6), 1516–1528 (2005) [CP06] Cohen, R., Peleg, D.: Local algorithms for autonomous robot systems. In: L. (eds.) SIROCCO 2006. LNCS, vol. 4056, pp. Flocchini, P., Gasieniec, 29–43. Springer, Heidelberg (2006) [DP07] Dieudonne, Y., Petit, F.: Swing words to make circle formation quiescent. In: Prencipe, G., Zaks, S. (eds.) SIROCCO 2007. LNCS, vol. 4474, pp. 166–179. Springer, Heidelberg (2007) [FPSW01] Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Gathering of asynchronous mobile robots with limited visibility. In: Ferreira, A., Reichel, H. (eds.) STACS 2001. LNCS, vol. 2010, pp. 247–258. Springer, Heidelberg (2001) [FPSW08] Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Arbitrary pattern formation by asynchronous, anonymous, oblivious robots. Theor. Comput. Sci. 407, 412–447 (2008) [Ka06] Katreniak, B., Katreniakov´ a, J.: On the inability of gathering by asynchronous mobile robots with initial movements. In: ECAI 2006, pp. 255–259. IOS Press, Amsterdam (2006) [Kat05] Katreniak, B.: Biangular circle formation by asynchronous mobile robots. In: Pelc, A., Raynal, M. (eds.) SIROCCO 2005. LNCS, vol. 3499, pp. 185–199. Springer, Heidelberg (2005) [Kat11] Katreniak, B.: Convergence with Limited Visibility by Asynchronous Mobile Robots (2011), http://www.archive.org/details/Sirocco2011Katreniak [Pre05] Prencipe, G.: On the feasibility of gathering by autonomous mobile robots. In: Pelc, A., Raynal, M. (eds.) SIROCCO 2005. LNCS, vol. 3499, pp. 246– 261. Springer, Heidelberg (2005) [SY99a] Suzuki, I., Yamashita, M.: Distributed memoryless point convergence algorithm for mobile robots with limited visibility. IEEE Transactions on Robotics and Automation 28(4), 1347–1363 (1999) [SY99b] Suzuki, I., Yamashita, M.: Distributed anonymous mobile robots: Formation of geometric patterns. SIAM Journal on Computing 28(4), 1347–1363 (1999) [YSDT09] Yang, Y., Souissi, S., D´efago, X., Takizawa, M.: Fault-tolerant flocking of mobile robots with whole formation rotation. In: The IEEE 23rd International Conference on Advanced Information Networking and Applications, AINA 2009, Bradford, United Kingdom, pp. 830–837. IEEE Computer Society, Los Alamitos (2009)
Energy-Efficient Strategies for Building Short Chains of Mobile Robots Locally Philipp Brandes, Bastian Degener, Barbara Kempkes, and Friedhelm Meyer auf der Heide Heinz Nixdorf Institute, CS Department, University of Paderborn, 33098 Paderborn, Germany {pbrandes,degener,barbaras,fmadh}@mail.uni-paderborn.de
Abstract. We are given a winding chain of n mobile robots between two stations in the plane, each of them having a limited viewing range. It is only guaranteed that each robot can see its two neighbors in the chain. The goal is to let the robots converge to the line between the stations. We use a discrete and synchronous time model, but we restrict the movement of each mobile robot to a distance of δ in each round. This restriction fills the gap between the previously used discrete time model with an unbounded step length and the continuous time model which was introduced in [1]. We adapt the strategy by Dynia et al. [2]: In each round, each robot first observes the positions of its neighbors and then moves towards the midpoint between them until it reaches the point or has moved a distance of δ . The main energy consumers in this scenario are the number observations of positions of neighbors, which equals the number of rounds, and the distance to be traveled by the robots. We analyze the strategy with respect to both quality measures and provide asymptotically tight bounds. We show that the best choice for δ for this strategy is δ ∈ Θ ( 1n ), since this minimizes (up to constant factors) both energy consumers, the number of rounds as well as the maximum traveled distance, at the same time.
1 Introduction We envision a scenario where two stationary devices (stations) and n mobile robots are placed in the plane. Each mobile robot has two neighbors (mobile robot or station) such that they form a chain between the stations, which can be arbitrarily winding. Assuming that the mobile robots have only a limited viewing range, the goal is to design and analyze strategies for them in order to minimize the length of the chain. Each robot has to base its decision where to move solely on the current position of the neighbors in the chain— no global view, communication or long term memory is provided. Our objective is to achieve this goal in an energy-efficient way. The major energy consumers are the energy that is needed to move and the energy that is needed to observe positions of neighboring robots. State of the art work either does not restrict the step length and counts the number of rounds, neglecting the distance that the robots
Partially supported by the EU within FP7-ICT-2007-1 under contract no. 215270 (FRONTS) and DFG-project “Smart Teams” within the SPP 1183 “Organic Computing” and International Graduate School Dynamic Intelligent Systems.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 138–149, 2011. c Springer-Verlag Berlin Heidelberg 2011
Energy-Efficient Strategies for Building Short Chains
139
travel, or optimizes the traveled distance by allowing the robots to observe the positions of neighbors continuously at all times. We want to consider both quality measures at the same time. To the best of our knowledge, we are the first to consider two quality measures at once for a robot formation problem. As a base we use the G O -T O -T HE -M IDDLE strategy as proposed in [2]. In this intuitive and simple strategy, in each round, each robot computes the current midpoint between its neighbors in the chain and then moves to this point. It is shown that using this strategy, the robots converge to positions on the line between the two stations. It takes Θ (n2 log n) rounds in the worst case until all robots are within distance 1 of the positions they converge to (compare [2] for the upper bound and [3] for the lower bound). This is also the total number of position measurements per robot. Here, the robots possibly move long distances between two measurements and maybe waste movement energy. Another approach was taken in [1]. The same problem is investigated, but a continuous time and movement model is used. In this model each robot measures the positions of its neighbors continuously and all the time. It bases its decision in which direction to move on this input. This means that the number of position measurements is infinite. On the other hand, it is shown that using a simple and intuitive strategy called M OVE -O N B ISECTOR, where each robot always moves in direction of the current bisector of the angle between its neighbors, the robots move at most a distance of Θ (n) until all robots have reached the line between the stations, which is asymptotically optimal. This model thus makes sense if a robot is able to move and measure positions of neighbors at the same time and if measuring does not take much energy. Since M OVE -O N -B ISECTOR is similar to G O -T O -T HE -M IDDLE , this rises hope that G O -T O -T HE -M IDDLE might also perform well in this model. In this paper we want to investigate the performance of G O -T O -T HE -M IDDLE in the range between the discrete model with an unlimited step length and the continuous model. We compare the number of position measurements (= number of rounds) and the maximum distance traveled. In order to trade between the two energy consumers, we introduce a new class of strategies parameterized by a value δ ∈ (0, 1], the δ -Bounded G O -T O -T HE -M IDDLE Strategy (δ -GTM). Here, each robot computes the midpoint between its neighbors and moves towards this point until it is reached or until the robot has moved a distance of δ , whichever occurs first. The G O -T O -T HE -M IDDLE strategy is therefore a special case of δ -GTM with δ set to the viewing range (which we normalize to 1). For δ tending to 0 we get the Continuous G O -T O -T HE -M IDDLE Strategy (continuous-GTM), which uses the same model as the M OVE -O N -B ISECTOR strategy [1]. In this paper we analyze δ -GTM thoroughly for any δ ∈ (0; 1] with respect to both quality measures and continuous-GTM with respect to the maximum traveled distance (the number of rounds tends to infinity). We provide (almost) tight bounds for their worst case performance. As our main result,we show that for δ ∈ Θ ( 1n ), the combined worst-case energy consumption is asymptotically optimal for δ -GTM: The number of measurements is bounded by O(n2 log n) and Ω (n2 ), and the distance traveled is Θ (n). Thus, no trade-off between the two energy consumers is required. For an overview of the results confer to table 1. Related work. Another strategy for the same problem was introduced in [5]. This strategy achieves a linear runtime, but in exchange the robots need to know global coordinates as well as the position of one station. In [6], the more complicated and faster
140
P. Brandes et al.
Table 1. Results overview 1-bounded GTM number of time steps maximum distance
Θ (n2 log n) Θ (n2 )
[4,3]
Cor. 1
δ -bounded GTM Ω (n2 + δn ) O(n2 log n + δn ) Θ (δ n2 + n)
continuous GTM Thm. 1 Thm. 1
Thm. 2
—
Θ (n)
Thm. 4
H OPPER-strategy is introduced. The idea is to let the robots hop over the midpoint between their two neighbors. This operation combined with the possibility to switch off robots and with G O -T O -T HE -M IDDLE -steps leads to a runtime of Θ (n) rounds until the sum of the distances between the robots is at most three times the distance between the stations. The strategy does not guarantee that the robots converge to the line between the stations, but its runtime is asymptotically optimal. For an overview refer to [4]. Similar are robot formation problems: Given n robots in the plane, the goal is to let them build a formation. Considered problems are to let the robots converge to a not-predefined point in the plane (the Convergence Problem, [7,8]), to let them gather in such a point (the Gathering Problem, [9,10,11,12,13]) or more complex tasks like forming a circle ([14,15]). Most of the related work considers very simple robots but with a global view. Exceptions are for example [16,17] for the gathering problem and [7,18] for the convergence problem. Moreover, many authors focus on which formations can be achieved in finite time in a given robot and time model, or differently, which robot abilities are crucial to be able to build a formation. Some work also exists with the focus on runtime bounds. [8] gives a runtime bound for the convergence problem of O(n2 ) for halving the length of the convex hull in each dimension. The algorithm uses very simple robots but with a global view. Local algorithms for the gathering problem are analyzed in [16,17]. See [19] for a long version of this paper. Organization of the paper. In Section 2 we introduce our model, the strategies which we consider and the two quality measures. Section 3 is devoted to the δ -GTM strategy, with 1-GTM being a special case. In Section 4 we analyze continuous-GTM. Section 3 gives lower and upper bounds for the worst-case number of rounds and both sections for the maximum distance traveled by a robot when using the respective strategy. Finally we give a conclusion and an outlook.
2 Problem Description, Model and Notation We consider a set of n +2 robots v0 , v1 , . . . , vn+1 in the two-dimensional Euclidean plane R2 . The robots v0 and vn+1 are stationary and will be referred to as stations, while we can control the movement of the remaining n robots v1 , v2 , . . . , vn . In the beginning, the robots form a chain, where each robot vi is neighbor of the robots vi−1 (its left neighbor) and vi+1 (its right neighbor). The chain may be arbitrarily winding in the beginning. The goal is to optimize the length of the robot chain in a distributed way, where the length refers to the sum of the distances between neighboring robots. We are constrained in that the robots have a limited viewing range, which we set to 1. The robot chain is therefore
Energy-Efficient Strategies for Building Short Chains
141
connected if and only if for each two neighbors in the chain, the distance between them is less than or equal to 1. We assume that the chain is connected in the beginning. We say that a strategy for the robots is valid if it keeps the chain connected. The robot strategies in this paper are based on the synchronous LCM computation model (Look-Compute-Move, see [20]). That is, for a given round t, first all robots observe their environment (determine the positions of their neighbors) at the same time, then they use this information for computing a point to which they want to move and then all robots move to this previously computed point at the same time. The robots only continue when all robots have finished their movement. Notions & Notation. Given a round t ∈ N0 , the global position of robot vi at the beginning of the round is denoted by vi (t) ∈ R2 . If not stated otherwise, we will assume v0 (0) = (0, 0) and vn+1 (0) = (d, 0), d ∈ R≥0 denoting the distance of the two stations. To refer to the x- or y- coordinate of robot vi at the beginning of round t, we will use xi (t) and yi (t) respectively. We say that a robot vi is in k hops from a robot v j , if |i − j| = k. A fixed placement of the robots (their positions at the beginning of round t) is called a configuration. The configuration at time 0 is called start configuration. We define di (t) := ||vi (t) − vi (t − i)|| to be the distance covered by robot vi in the i-th round. ∞ Furthermore we set di := ∑t=1 di (t) to the overall distance traveled by robot vi . Strategies. Our strategies are variants of the G O -T O -T HE -M IDDLE-strategy (see [5]) for optimizing the chain length.
δ -GTM: We use the synchronous LCM model. In each round, each robot computes the midpoint between its two neighbors as its target point. The robot moves towards its target point. However, we bound the distance the robots cover in one round to δ ∈ (0, 1]. This implies that a robot vi will reach its target point only if it is within distance δ of its old position. Otherwise, the robot will move exactly a distance of δ towards it. 1-GTM: This strategy is the original GTM-strategy from [5] and a special case of δ GTM with δ = 1. The robots always reach their target points. This strategy has already been intensively studied with respect to the number of rounds (for an overview, see [4]), but the traveled distance has not been investigated before. continuous-GTM: This strategy arises from δ -GTM when δ → 0. As a result, we do no longer have discrete rounds, but time (and robot movement) is continuous, i.e. t ∈ R≥0 . As long as a robot vi has not yet reached its target point, it moves towards it with velocity 1. Once it has reached its target point, it adapts its velocity vector to stay in between its two neighbors. The underlying continuous time and movement model has been investigated in [1] for a different strategy for the robot chain problem. We will show that with all of the considered strategies, the robots converge towards or even reach a configuration with all robots being positioned on the line between the two stations. This position a robot converges to or reaches will be called its end position. All our strategies are simple in the sense that they do not require the robots to have many abilities. More precisely, the robots use only information from the current round (they are oblivious), share no common sense of direction and communicate only by
142
P. Brandes et al.
observing each others position. These observations are bounded to a local viewing range with radius 1 around the position of a robot. However, we require that the robots are able to distinguish their left and right neighbors from the remaining robots. Quality Measures. To measure the quality of the strategies, we consider the number of rounds until all robots are in distance 1 from their end positions (1-GTM and δ -GTM, equal to the number of measurements per robot) and the maximum distance any of the robots traveled before it reached its end position (all strategies). With continuous-GTM, the robots reach their end positions and therefore the maximum traveled distance for one specific start configuration is a fixed value. With 1-GTM and δ -GTM, the robots only converge to their end positions. In order to have comparable measures, we will upper bound the maximum traveled distance for these strategies by the distance traveled in an infinite number of rounds, but as a lower bound we will give the maximum traveled distance until all robots are in distance at most 1 from their end position. We will see that these bounds match asymptotically.
3 The δ -Bounded G O -TO -T HE -M IDDLE Strategy In this section, we consider the 1-Bounded G O -T O -T HE -M IDDLE Strategy and the δ -Bounded G O -T O -T HE -M IDDLE Strategy. With 1-GTM being a special case of the δ -GTM, we will limit the analysis to δ -GTM, whose results can be easily adapted. The validity for δ -GTM is a straightforward adaption of the validity proof for 1-GTM [4]. A major observation for the sake of analysis is the fact that for δ -GTM, we can divide the movement of the robots into two phases. In the first phase at least one of the robots is not able to reach its target point. In the second phase, the target point of every robot lies within distance δ of its current position. Thus, every robot reaches its target position, while the target position moves a distance of at most δ . Therefore every robot is still able to reach it in the next round, and we stay in the second phase once we have reached it. As every robot reaches its target point, the second phase is indistinguishable from the 1-Bounded G O -T O -T HE -M IDDLE Strategy. We will now start by analyzing the number of rounds and then investigate the maximum traveled distance. 3.1 The Worst-Case Number of Rounds In this subsection we analyze the number of rounds and therefore the number of measurements per robot. The number of rounds can be divided into the number of rounds of the two phases. Thus, we first analyze the first phase. We start with a lower bound, before presenting a matching upper bound. The lower bound only holds for δ ≤ 1n . We will see that only in this case the number of rounds is dominated by the first phase. Lemma 1. There is a start configuration for which the number of rounds in the first phase of δ -GTM is Ω ( δn ) for δ ≤ 1n . Proof. Consider a configuration in which the robots are positioned in a triangle with 1 n robot v n+1 at the top (see Figure 1). We will show that after 16 · d rounds at least one 2
Energy-Efficient Strategies for Building Short Chains
143
v n+1 2
y m Δx v0
0
x
vn+1
Fig. 1. Start configuration which is formed like a triangle
robot still is in distance greater than δ to its target point. We will do so by showing that 1 n the distance of v n+1 to its end position (its height) after 16 · d rounds is greater than its 2 height if the target point of every robot is within a δ distance from the robot itself. First 7 n+1 7 we calculate its height in the start configuration: m · n+1 2 = 8 · 2 where m := 8 is the constant y-distance between two neighbors. Note that we can choose m ≤ 1 arbitrarily, 1 n since we can choose the x-distance between two neighbors arbitrarily small. After 16 ·δ 7 n+1 1 3 rounds with step length δ its remaining height is at least 8 · 2 − 16 · n ≥ 8 n. Now consider the maximum height v n+1 can have if every robot is within a δ distance 2 of its target point. The neighbors of v n+1 must not be more than δ below it. In the long 2 version of this paper [19] we show that a robot with k hops to v n+1 can have a maximum 2
y-distance from v n+1 of δ · k2 . Since the stations are in n+1 , v n+1 can 2 hops from v n+1 2 2 2 n+1 2 n2 have a height of at most 2 ·δ ≤ 4 ·δ +n·δ. 2 But since 38 n ≥ 14 + 1n · n ≥ n4 δ + δ · n ≥ n4 · δ + n · δ with δ ≤ 1n and n ≥ 8, there must be at least one robot which has a distance greater than δ from its target point. n 1 After having shown a lower bound of Ω d for δ ≤ n , we will now prove an upper n n bound of O d and thus Θ d for the first phase. Lemma 2. The number of rounds in the first phase of δ -GTM is O( δn ).
√ Proof. Assume for the sake of contradiction that there is a robot vi which moves 2 · 5 · δn rounds with step length δ without reaching its target point. We will show that this requires the robots v1 and vn to move more than they are able to. We first show that the maximum distance traveled by v1 and vn , which have a station as neighbor, is limited. The target point of those robots moves at most with step length δ2 . Because of that they will only move with step length δ2 after having reached their target point for the first time. Moreover, before having reached their target point for the first time, the distance between v1 and vn and their target point decreases by δ2 in each round. Thus, after δ2 rounds and a traveled distance of 2 they have definitely reached their target points. This results in an upper bound for the traveled distance of v1 and vn after t rounds of 2 +t · δ2 . Now √ we show that the distance v1 or vn travel, if vi does not reach its target point after 2 · 5 δn rounds, is larger than that. If vi does not reach its target point, it travels √ a distance of 2 · 5n. W.l.o.g. let vi move a larger distance in y-direction than in xdirection, and assume that vi is in closer hop distance to vn than to v1 . Now let s j be the
144
P. Brandes et al.
√ y-distance traveled by robot vi+ j , which is in j hops from vi , in the first 2 ·5 · δn rounds. √ That is, as vi travels a total distance of 2 · 5n, its movement in y-direction is s0 ≥ 5n. Let there be k robots with a larger index than vi , meaning that vn travels distance sk . Proposition 1. Let Δl be the y-distance of robot vi+l to its target point in the start configuration. Then sk ≥ 5n − 2 · ∑k−1 l=0 (k − l) · Δ l . The proof of the proposition is in the long version of the paper [19]. The idea is that if vi moves a y-distance of 5n without reaching its target point, the target point must move a distance of at least 5n − Δ 0 . But the movement of vi ’s target point results from the movement of vi ’s neighbors, such that their movement can be lower bounded. This kind of argumentation propagates through the complete chain. As vn is closer to vi than v1 , we know that k ≤ n2 . Plugging this in, we get sk ≥ 5n − 2 ·
n −1 2
n −1
n −1
2 2 n ∑ ( 2 − l) · Δl = 5n − n ∑ Δl + 2 ∑ l · Δl l=0 l=0 l=0
We now use one further structural property of the robot chain, saying that −1 ≤ ∑ki= j Δi ≤ 1 for arbitrary 1 ≤ j ≤ k ≤ n (see the long version of the paper [19]), getting that sk ≥ 5n − n
n 2 −1
n 2 −1
n n 2 −1 2 −1
n 2 −1
l=0
l=0
l=1 i=l
l=1
∑ Δl + 2 ∑ l · Δl ≥ 5n − n + 2 ∑ ∑ Δi ≥ 4n + 2 ∑ −1 ≥ 3n.
Thus, vn must move a distance of 3n to allow vi to move a y-distance of 5n. But the movement distance of vn is upper bounded by 2 + t · δ2 = 2 + 5 δn · δ2 = 2 + 52 n, a contradiction for n ≥ 8. No robot can move 5 δn rounds without reaching its target point. We have now analyzed the number of rounds of the first phase. In order to state the overall number of rounds, we now analyze the second phase as well. Lemma 3. There is a start configuration such that δ -GTM needs Ω (n2 ) rounds in the second phase until each robot is in distance at most 1 from its end position. Proof. The complete proof can be found in the long version of the paper [19]. We give a sketch here. The proof is divided into two parts. For δ ≤ 1n , there is a start configuration for which one robot is in distance Ω (δ n2 ) from its end point. Since the robot can move at most a distance of δ in each round, Ω (n2 ) rounds are required. For δ > 1n , this is not possible for a connected chain of robots. To show that Ω (n2 ) rounds are required, we need another progress measure. For this, we use the sum of the distances from the robots to their end position. We construct a configuration for which this sum is Ω (n2 ), and we use that it decreases by at most 1 in each round [4]. It follows that Ω (n2 ) rounds are required until the sum is at most n, which is a necessary condition for the robots being in distance at most 1 from their end position. Theorem 1. For a worst-case start configuration, the number of rounds for δ -GTM until each robot is in distance 1 from its end position is Ω (n2 + δn ) and O(n2 log n + δn ).
Energy-Efficient Strategies for Building Short Chains
145
Proof. According to Lemma 1, the number of rounds in the first phase when starting in a worst-case configuration is Ω ( δn ), if δ ≤ 1n . Moreover, Lemma 3 gives a lower bound for the second phase of Ω (n2 ), which is independent of δ . Combined, we get a lower bound of max{Ω (n2 ), Ω ( δn )} = Ω (n2 + δn ), because δn ≥ n2 only for δ ≤ 1n . The upper bound consists of O( δn ) rounds in the first phase (Lemma 2), and O(n2 log n) rounds in the second phase [4], since in the second phase δ -GTM does not differ from 1-GTM. Combined we get an upper bound of O(n2 log n + δn ). Interpreting this result, we can see that the second phase takes longer if δ ∈ Ω ( 1n ) and 1 the first phase if δ ∈ O( n log n ). For the triangle configuration in Figure 1, even an opti1 mal global strategy needs time δn and thus for δ ∈ O( n log n ), δ -GTM is asymptotically optimal compared to an optimal global algorithm. To minimize the number of posi1 tion measurements, δ ∈ Ω ( n log n ) should be chosen, since then the resulting number of 2 measurements is O(n log n). We will now see that similar results hold for the maximum traveled distance. 3.2 Maximum Distance Traveled by a Robot We start with an upper bound for the distance traveled in the second phase in an infinite number of rounds, before showing a lower bound for the maximum distance traveled in the second phase until all robots are at most in distance 1 from their end positions. We will see that these bounds match asymptotically. Lemma 4. In an infinite number of rounds in the second phase, a robot can move at most distance 14 δ n2 + 12 δ n + 14 δ when using δ -GTM. ∞ Proof. Let di (t) be the distance traveled by robot vi in round t and let di = ∑t=1 di (t). Every robot can move at most the distance which its target point travels plus its distance δ to its target point. Thus, di ≤ δ + 12 di−1 + 12 di+1 (1). Moreover, both stations do not move and thus d0 = dn+1 = 0. Plugging this into (1), we get that d1 ≤ δ + 12 d2 . We can continue this for d2 , ..., dn and get the following proposition for odd n: i Proposition 2. 1. For 1 ≤ i < n2 , di ≤ δ i + i+1 di+1 2. d n2 ≤ δ + d 2n −1 n−i 3. For n2 + 1 < i ≤ n, di ≤ δ (n − i) + n−i+1 di−1 .
The proof can be found in [19]. It follows that the middle robot v n2 can move the furthest. With Proposition 2 we can upper bound d n2 : Proposition 3. If n is odd, d n2 ≤ δ4 n2 + δ2 n + δ4 . The proof is again in [19]. If n is even, we have two middle relays. We can compute an upper bound for the movement distance equivalently to Proposition 2 and 3, giving that d 2n ≤ δ4 n2 + δ2 n. Thus, no robot can move further than a distance of δ4 n2 + δ2 n + δ4 . Lemma 5. There is a start configuration and a robot r such that when using δ -GTM and δ ≥ 7n , the distance traveled by r in the second phase before all robots are at most δ 2 δ in distance 1 from their end positions is at least 56 n + 28 n.
146
P. Brandes et al. vn/2
6 n
v0
1 δ 7
≤ 67 δ
vn+1
Fig. 2. Example configuration of a tower
Proof. Consider a start configuration in which the two stations are d apart. The n robots, n even, form a tower of height 3 (see Figure 2): The robots are placed alternatingly above the stations with an increase in height of 6n for the first n2 and a decrease in height of 6n for the last n2 robots, such that each robot has a y-distance of 6n to one or both of its neighbors. We assume that v0 is positioned at (0, 0) and vn+1 at (d, 0). Now we can define d as δ7 (which is at least 1n ). Apparently, every robot can reach its target point. Let di (t) denote the distance traveled in x-direction by robot i in round t. We now show that for this configuration, di (t) = 12 di−1 (t − 1) + 12 di+1 (t − 1) for all rounds t and for all 1 ≤ i ≤ n: In odd rounds, all robots with an odd index move in negative x-direction and robots with an even index in positive x-direction. In even rounds, the robots move in the respective other direction. This is obvious for the first round. Moreover, if for a robot vi both neighbors move in the same direction in round t, vi ’s target point also moves in this direction and thus vi will equally move in this direction in round t + 1. So for each robot vi , both neighbors always move in the same direction giving that di (t) = 12 di−1 (t − 1) + 12 di+1 (t − 1). Analogously to the proof for Theorem 3.6 in [4] it can be shown that k = Ω (n2 ) rounds are required until every robot has a y-distance k k of at most 1 from its end point. Now we define di := ∑t=1 di (t), di := ∑t=2 di (t) and k−1 1 1 . Since in di := ∑t=1 di (t). With the observation above we obtain di = 2 di−1 + 2 di+1 the first round every robot travels in x-direction a distance of d, we know di = di + d. If there is a robot in the last round which moves a distance of at least d2 , since the distance traveled is monotonically decreasing, it is obvious that this robots moves a distance of Ω (n2 · d) = Ω (n2 · δ ) and we are done. So assume that in the last round every robot moves at most d2 . This yields di ≤ di + d2 . We can combine this to obtain di = d + 12 di−1 + 12 di+1 ≥ d + 12 di−1 + 12 di+1 − d2 = d2 + 12 di−1 + 12 di+1 (2). Similar to Proposition 2, we can use this to obtain lower bounds for the movement of each robot which only depends on the neighbor which is further apart from a station: i Proposition 4. 1. For 1 ≤ i < n2 , di ≥ d2 i + i+1 di+1 n d n−i 2. For 2 + 1 < i ≤ n, di ≥ 2 + n−i+1 di−1 .
The proof is again in [19]. Now fix one of the robots at the top: we show that this robot has to travel a long distance, plugging in the results from Proposition 4. The proof is similar to the proof of Proposition 3 and can again be found in [19].
Energy-Efficient Strategies for Building Short Chains
Proposition 5. d n2 ≥
dn2 8
147
+ dn 4
Since d = δ7 , this yields the lemma.
We can now combine the obtained lemmas to prove the claim of the total distance traveled for the discrete strategies. Theorem 2. For a worst-case start configuration, the maximum distance traveled by a robot is Θ (δ n2 + n), when using δ -GTM. Proof. According to Lemma 1 and Lemma 2, the first phase takes Θ ( δn ) rounds. Due to the definition of the first phase, there exists a robot which moves a distance of δ in each round of the first phase, while all other robots travel at most a distance of δ in each round. Thus, this robot travels a distance of Θ (n), all others of O(n). Since the distance traveled in the second phase is Θ (δ n2 ) according to Lemma 4 and Lemma 5 for δ ≥ 7n , we get an overall traveled distance D of max{Θ (n), Θ (δ n2 )} ≤ D ≤ O(δ n2 + n) and therefore D ∈ Θ (δ n2 + n) (note that the distance traveled in the second phase is longer only if δ ≥ 7n ). Corollary 1. For a worst-case start configuration, when using 1-GTM, the maximum distance traveled by a robot is Θ (n2 ). To interprete the results, we can see that similar to the number of rounds, the traveled distance is longer in the first phase if δ ∈ O( 1n ). If δ ∈ Ω ( 1n ), the traveled distance in the second phase phase is longer. Again, for worst case instances no optimal global strategy can become better than Θ (n) and thus for δ ∈ O( 1n ), the traveled distance is asymptotically optimal compared to a global strategy. While the number of rounds 1 are minimized for δ ∈ Ω ( n log n ), the maximum traveled distance is minimized for δ ∈ 1 O( n ). So the next theorem follows. Theorem 3. For δ ∈ Θ ( 1n ), the number of rounds is O(n2 log n) and the traveled distance is O(n). Thus both energy consumers are minimized for this strategy and the combined worst case energy consumption is minimal.
4 The Continuous G O -TO -T HE -M IDDLE Strategy In this section we investigate the Continuous G O -T O -T HE -M IDDLE Strategy, where δ → 0. A detailed model description can be found in [1]. Shortly summarizing the main properties, at each point of time, the robots perform an LCM-cycle to compute a target point. If a robot is not positioned on its target point, it moves in direction towards this target point with speed 1. It follows that robots move in curves with speed 1 as long as they have not reached their target point and when fixing a time t, the derivative of the movement curve at time t is the velocity vector which points from the robot to its target point with length (speed) 1. If a robot has already reached its target point, it stays on this target point following its movement with speed at most 1. The robots stop moving as soon as all of them have reached their target point. Then they have also reached their end position (they do not only converge to it). For bounding the maximum traveled distance, we start with the easy observation that no strategy can be faster than Ω (n) in the worst case.
148
P. Brandes et al.
Lemma 6. There are start configurations for which the maximum distance traveled by a robot is Ω (n) using an optimal algorithm. Proof. When starting in a triangle configuration (see Figure 1), the middle robot is in distance Ω (n) of the line between the two stations, and thus it must travel at least this distance to reach its end position. The following theorem shows that continuous-GTM reaches this bound: it is asymptotically optimal compared to a global algorithm. Theorem 4. When using continuous-GTM, the maximum distance traveled by a robot is Θ (n) for a worst-case start configuration. Proof. The lower bound follows from Lemma 6. So we need to show that when using continuous-GTM, no robot moves more than for a distance of O(n). According to Lemma 2, in the discrete setting the first phase takes c· δn rounds. Since in each round the robots move at most a distance of δ , the distance traveled in the first phase is bounded by c δn · δ ≤ cn = O(n). Let us now consider the limit δ → 0, yielding continuous-GTM. Since the upper bound on the traveled distance in the first phase is independent of δ , it remains valid. On the other hand, continuous-GTM does not have a second phase, since the robots reach their end positions exactly when the last robot reaches its target point. Therefore, the overall distance traveled by the robots is O(n). According to Lemma 6 and Theorem 4, continuous-GTM is asymptotically optimal regarding the traveled distance.
5 Conclusion and Outlook We have extended the analysis of the simple and intuitive G O -T O -T HE -M IDDLEstrategy in several ways. First, we introduced the maximum traveled distance of the robots as a second quality measure. Second, we reduced the step length per round and showed that for a step length of Θ ( 1n ), the number of rounds as well as the traveled distance is minimal. Third, we derived that G O -T O -T HE -M IDDLE performs well in the continuous time and movement model which was introduced in [1]. Thus the approach is promising and next steps include applying the developed techniques to further algorithms for the same problem or to different problems. An interesting starting point would be the problem of gathering a group of robots in one point, since there already exist algorithms with runtime bounds. Another open problem is to close the gap which is left in the number of rounds: So far it is only known that the robots take between Ω (n2 ) and O(n2 log n) rounds for the second phase.
References 1. Degener, B., Kempkes, B., Kling, P., Meyer auf der Heide, F.: A continuous, local strategy for constructing a short chain of mobile robots. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 168–182. Springer, Heidelberg (2010)
Energy-Efficient Strategies for Building Short Chains
149
2. Dynia, M., Kutylowski, J., Lorek, P.: Meyer auf der Heide, F.: Maintaining communication between an explorer and a base station. In: IFIP 19th World Computer Congress, TC10: 1st IFIP International Conference on Biologically Inspired Computing, pp. 137–146 (2006) 3. Kling, P.: Unifying the Analysis of Communication Chain Strategies. Master’s thesis, University of Paderborn, masters thesis (2010) 4. Kutylowski, J.: Using Mobile Relays for Ensuring Connectivity in Sparse Networks. Dissertation, International Graduate School of Dynamic Intelligent Systems (2007) 5. Dynia, M., Kutyłowski, J., Meyer auf der Heide, F., Schrieb, J.: Local strategies for maintaining a chain of relay stations between an explorer and a base station. In: SPAA 2007: Proc. of the 19th annual ACM symposium on Parallel algorithms and architectures, pp. 260–269 (2007) 6. Kutyłowski, J., Meyer auf der Heide, F.: Optimal strategies for maintaining a chain of relays between an explorer and a base camp. Theoretical Computer Science 410(36), 3391–3405 (2009) 7. Ando, H., Suzuki, Y., Yamashita, M.: Formation agreement problems for synchronous mobile robotswith limited visibility. In: Proc. IEEE Syp. of Intelligent Control, pp. 453–460 (1995) 8. Cohen, R., Peleg, D.: Convergence properties of the gravitational algorithm in asynchronous robot systems. SIAM Journal on Computing 34(6), 1516–1528 (2005) 9. Dieudonn´e, Y., Petit, F.: Self-stabilizing deterministic gathering. In: Algorithmic Aspects of Wireless Sensor Networks, pp. 230–241 (2009) 10. Souissi, S., D´efago, X., Yamashita, M.: Gathering asynchronous mobile robots with inaccurate compasses. Principles of Distributed Systems, 333–349 (2006) 11. Izumi, T., Katayama, Y., Inuzuka, N., Wada, K.: Gathering autonomous mobile robots with dynamic compasses: An optimal result. Distributed Computing, 298–312 (2007) 12. Prencipe, G.: Impossibility of gathering by a set of autonomous mobile robots. Theoretical Computer Science 384(2-3), 222–231 (2007); Structural Information and Communication Complexity (SIROCCO 2005) 13. Agmon, N., Peleg, D.: Fault-tolerant gathering algorithms for autonomous mobile robots. In: SODA 2004: Proc. of the 15th annual ACM-SIAM symposium on Discrete algorithms, pp. 1070–1078 (2004) 14. D´efago, X., Konagaya, A.: Circle formation for oblivious anonymous mobile robots with no common sense of orientation. In: International Workshop on Principles of Mobile Computing, POMC, pp. 97–104 (2002) 15. Chatzigiannakis, I., Markou, M., Nikoletseas, S.: Distributed circle formation for anonymous oblivious robots. In: Ribeiro, C.C., Martins, S.L. (eds.) WEA 2004. LNCS, vol. 3059, pp. 159–174. Springer, Heidelberg (2004) 16. Degener, B., Kempkes, B., Meyer auf der Heide, F.: A local O(n2 ) gathering algorithm. In: SPAA 2010: Proc. of the 22nd ACM symposium on parallelism in algorithms and architectures, pp. 217–223 (2010) 17. Degener, B., Kempkes, B., Langner, T., auf der Heide, F.M., Pietrzyk, P., Wattenhofer, R.: A tight runtime bound for synchronous gathering of autonomous robots with limited visibility. In: SPAA 2011: Proc. of the 23rd annual ACM symposium on parallel algorithms and architectures (accepted for publication) 18. Ando, H., Oasa, Y., Suzuki, I., Yamashita, M.: Distributed memoryless point convergence algorithm for mobile robots with limited visibility. IEEE Transactions on Robotics and Automation 15(5), 818–828 (1999) 19. Brandes, P., Degener, B., Kempkes, B., auf der Heide, F.M.: Energy-efficient strategies for building short chains of mobile robots locally (2011), http://wwwhni.uni-paderborn.de/alg/publikationen 20. Cohen, R., Peleg, D.: Robot convergence via center-of-gravity algorithms. In: Kralovic, R., S´ykora, O. (eds.) SIROCCO 2004. LNCS, vol. 3104, pp. 79–88. Springer, Heidelberg (2004)
Asynchronous Mobile Robot Gathering from Symmetric Configurations without Global Multiplicity Detection Sayaka Kamei1 , Anissa Lamani2 , Fukuhito Ooshita3 , and S´ebastien Tixeuil4 1
3
Dept. of Information Engineering, Hiroshima University, Japan 2 MIS, Universit´e of Picardie Jules Verne, France Graduate School of Information Science and Technology, Osaka University, Japan 4 Universit´e Pierre et Marie Curie - Paris 6, LIP6-CNRS 7606, France
Abstract. We consider a set of k autonomous robots that are endowed with visibility sensors (but that are otherwise unable to communicate) and motion actuators. Those robots must collaborate to reach a single vertex that is unknown beforehand, and to remain there hereafter. Previous works on gathering in ringshaped networks suggest that there exists a tradeoff between the size of the set of potential initial configurations, and the power of the sensing capabilities of the robots (i.e. the larger the initial configuration set, the most powerful the sensor needs to be). We prove that there is no such trade off. We propose a gathering protocol for an odd number of robots in a ring-shaped network that allows symmetric but not periodic configurations as initial configurations, yet uses only local weak multiplicity detection. Robots are assumed to be anonymous and oblivious, and the execution model is the non-atomic CORDA model with asynchronous fair scheduling. Our protocol allows the largest set of initial configurations (with respect to impossibility results) yet uses the weakest multiplicity detector to date. The time complexity of our protocol is O(n2 ), where n denotes the size of the ring. Compared to previous work that also uses local weak multiplicity detection, we do not have the constraint that k < n/2 (here, we simply have 2 < k < n − 3). Keywords: Gathering, Discrete Universe, Local Weak Multiplicity Detection, Asynchrony, Robots.
1 Introduction We consider autonomous robots that are endowed with visibility sensors (but that are otherwise unable to communicate) and motion actuators. Those robots must collaborate to solve a collective task, namely gathering, despite being limited with respect to input from the environment, asymmetry, memory, etc. The area where robots have to gather is modeled as a graph and the gathering task requires every robot to reach a single vertex that is unknown beforehand, and to remain there hereafter. Robots operate in cycles that comprise look, compute, and move phases. The look phase consists in taking a snapshot of the other robots positions using its visibility sensors. In the compute phase a robot computes a target destination among its neighbors,
This work is supported in part by ANR R-DISCOVER, SHAMAN and Grant-in-Aid for Young Scientists ((B)22700074) of JSPS.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 150–161, 2011. c Springer-Verlag Berlin Heidelberg 2011
Asynchronous Mobile Robot Gathering from Symmetric Configurations
151
based on the previous observation. The move phase simply consists in moving toward the computed destination using motion actuators. We consider an asynchronous computing model, i.e., there may be a finite but unbounded time between any two phases of a robot’s cycle. Asynchrony makes the problem hard since a robot can decide to move according to an old snapshot of the system and different robots may be in different phases of their cycles at the same time. Moreover, the robots that we consider here have weak capacities: they are anonymous (they execute the same protocol and have no mean to distinguish themselves from the others), oblivious (they have no memory that is persistent between two cycles), and have no compass whatsoever (they are unable to agree on a common direction or orientation in the ring). Related Work. While the vast majority of literature on coordinated distributed robots considers that those robots are evolving in a continuous two-dimensional Euclidean space and use visual sensors with perfect accuracy that permit to locate other robots with infinite precision, a recent trend was to shift from the classical continuous model to the discrete model. In the discrete model, space is partitioned into a finite number of locations. This setting is conveniently represented by a graph, where nodes represent locations that can be sensed, and where edges represent the possibility for a robot to move from one location to the other. Thus, the discrete model restricts both sensing and actuating capabilities of every robot. For each location, a robot is able to sense if the location is empty or if robots are positioned on it (instead of sensing the exact position of a robot). Also, a robot is not able to move from a position to another unless there is explicit indication to do so (i.e., the two locations are connected by an edge in the representing graph). The discrete model permits to simplify many robot protocols by reasoning on finite structures (i.e., graphs) rather than on infinite ones. However, as noted in most related papers [16,14,6,5,15,1,9,7,11,12], this simplicity comes with the cost of extra symmetry possibilities, especially when the authorized paths are also symmetric. In this paper, we focus on the discrete universe where two main problems have been investigated under these weak assumptions. The exploration problem consists in exploring a given graph using a minimal number of robots. Explorations come in two flavours: with stop (at the end of the exploration all robots must remain idle) [6,5,15] and perpetual (every node is visited infinitely often by every robot) [1]. The second studied problem is the gathering problem where a set of robots has to gather in one single location, not defined in advance, and remain on this location [9,7,11,12]. The gathering problem was well studied in the continuous model with various assumptions [3,2,8,18]. In the discrete model, deterministic algorithms have been proposed to solve the gathering problem in a ring-shaped network, which enables many problems to appear due to the high number of symmetric configurations. In [16,14,4], symmetry was broken by enabling robots to distinguish themselves using labels, in [7], symmetry was broken using tokens. The case of anonymous, asynchronous and oblivious robots was investigated only recently in this context. It should be noted that if the configuration is periodic and edge symmetric, no deterministic solution can exist [12]. The first two solutions [12,11] are complementary: [12] is based on breaking the symmetry whereas [11] takes advantage of symmetries. However, both [12] and [11] make the assumption that robots are endowed with the ability to distinguish nodes that host
152
S. Kamei et al.
one robot from nodes that host two robots or more in the entire network (this property is referred to in the literature as global weak multiplicity detection). This ability weakens the gathering problem because it is sufficient for a protocol to ensure that a single multiplicity point exists to have all robots gather in this point, so it reduces the gathering problem to the creation of a single multiplicity point. Investigating the feasibility of gathering with weaker multiplicity detectors was recently addressed in [9]. In this paper, robots are only able to test that their current hosting node is a multiplicity node (i.e. hosts at least two robots). This assumption (referred to in the literature as local weak multiplicity detection) is obviously weaker than the global weak multiplicity detection, but is also more realistic as far as sensing devices are concerned. The downside of [9] compared to [11] is that only rigid configurations (i.e. non symmetric configuration) are allowed as initial configurations (as in [12]), while [11] allowed symmetric but not periodic configurations to be used as initial ones. Also, [9] requires that k < n/2 even in the case of non-symmetric configurations. Our Contribution. We propose a gathering protocol for an odd number of robots in a ring-shaped network that allows symmetric but not periodic configurations as initial configurations, yet uses only local weak multiplicity detection. Robots are assumed to be anonymous and oblivious, and the execution model is the non-atomic CORDA model with asynchronous fair scheduling. Our protocol allows the largest set of initial configurations (with respect to impossibility results) yet uses the weakest multiplicity detector to date. The time complexity of our protocol is O(n2 ), where n denotes the size of the ring. By contrast to [9], k may be greater than n/2, as our constraint is simply that 2 < k < n − 3 and k is odd. Outline. The paper is organized as follow: we first define our model in Section 2, we then present our algorithm and prove its correctness in section 3. Note that due to the lack of space, some proves are omitted. The complete proofs can be found in [10]. We conclude in section 4.
2 Preliminaries System Model. We consider here the case of an anonymous, unoriented and undirected ring of n nodes u0 ,u1 ,..., u(n−1) such as ui is connected to both u(i−1) and u(i+1) . Note that since no labeling is enabled (anonymous), there is no way to distinguish between nodes, or between edges. On this ring, k robots operate in distributed way in order to accomplish a common task that is to gather in one location not known in advance. We assume that k is odd. The set of robots considered here are identical; they execute the same program using no local parameters and one cannot distinguish them using their appearance, and are oblivious, which means that they have no memory of past events, they can’t remember the last observations or the last steps taken before. In addition, they are unable to communicate directly, however, they have the ability to sense the environment including the position of the other robots. Based on the configuration resulting of the sensing, they decide whether to move or to stay idle. Each robot executes cycles infinitely many times, (1) first, it catches a sight of the environment to see the position of the other
Asynchronous Mobile Robot Gathering from Symmetric Configurations
153
robots (look phase), (2) according to the observation, it decides to move or not (compute phase), (3) if it decides to move, it moves to its neighbor node towards a target destination (move phase). At instant t, a subset of robots are activated by an entity known as the scheduler. The scheduler can be seen as an external entity that selects some robots for execution, this scheduler is considered to be fair, which means that, all robots must be activated infinitely many times. The CORDA model [17] enables the interleaving of phases by the scheduler (For instance, one robot can perform a look operation while another is moving). The model considered in our case is the CORDA model with the following constraint: the Move operation is instantaneous i.e. when a robot takes a snapshot of its environment, it sees the other robots on nodes and not on edges. However, since the scheduler is allowed to interleave the different operations, robots can move according to an outdated view since during the Compute phase, some robots may have moved. During the process, some robots move, and at any time occupy nodes of the ring, their positions form a configuration of the system at that time. We assume that, at instant t = 0 (i.e., at the initial configuration), some of the nodes on the ring are occupied by robots, such as, each node contains at most one robot. If there is no robot on a node, we call the node empty node. The segment [u p , uq ] is defined by the sequence (u p , u p+1 , · · · , uq−1 , uq ) of consecutive nodes in the ring, such as all the nodes of the sequence are empty except u p and uq that contain at least one robot. The distance Dtp of segment [u p , uq ] in the configuration of time t is equal to the number of nodes in [u p , uq ] minus 1. We define a hole as the maximal set of consecutive empty nodes. That is, in the segment [u p , uq ], (u p+1 , · · · , uq−1 ) is a hole. The size of a hole is the number of free nodes that compose it, the border of the hole are the two empty nodes who are part of this hole, having one robot as a neighbor. We say that there is a tower at some node ui , if at this node there is more than one robot (Recall that this tower is distinguishable only locally). When a robot takes a snapshot of the current configuration on node ui at time t, it has a view of the system at this node. In the configuration C(t), we assume [u1 , u2 ],[u2 , u3 ], · · ·, [uw , u1 ] are consecutive segments in a given direction of the ring.Then, the view of a robot on node u1 at C(t) is represented by (max{(Dt1 , Dt2 , · · · , Dtw ), (Dtw , Dtw−1 , · · · , Dt1 )}, mt1 ), where mt1 is true if there is a tower at this node, and sequence (ai , ai+1 , · · · , a j ) is larger than (bi , bi+1 , · · · , b j ) if there is h(i ≤ h ≤ j) such that al = bl for i ≤ l ≤ h − 1 and ah > bh . It is stressed from the definition that robots don’t make difference between a node containing one robot and those containing more. However, they can detect mt of the current node, i.e. whether they are alone on the node or not (they have a local weak multiplicity detection). When (Dt1 , Dt2 , · · · , Dtw ) = (Dtw , Dtw−1 , · · · , Dt1 ), we say that the view on ui is symmetric, otherwise we say that the view on ui is asymmetric. Note that when the view is symmetric, both edges incident to ui look identical to the robot located at that node. In the case the robot on this node is activated we assume the worst scenario allowing the scheduler to take the decision on the direction to be taken. Configurations that have no tower are classified into three classes in [13]. Configuration is called periodic if it is represented by a configuration of at least two copies of a sub-sequence. Configuration is called symmetric if the ring contains a single axis
154
S. Kamei et al.
of symmetry.Otherwise, the configuration is called rigid. For these configurations, the following lemma is proved in [12]. Lemma 1. If a configuration is rigid, all robots have distinct views. If a configuration is symmetric and non-periodic, there exists exactly one axis of symmetry. This lemma implies that, if a configuration is symmetric and non-periodic, at most two robots have the same view. We now define some useful terms that will be used to describe our algorithm. We denote by the inter-distance d the minimum distance taken among distances between each pair of distinct robots (in term of the number of edges). Given a configuration of inter-distance d, a d.block is any maximal elementary path where there is a robot every d edges. The border of a d.block are the two external robots of the d.block. The size of a d.block is the number of robots that it contains. We call the d.block whose size is biggest the biggest d.block. A robot that is not in any d.block is said to be an isolated robot. We evaluate the time complexity of algorithms with asynchronous rounds. An asynchronous round is defined as the shortest fragment of an execution where each robot performs a move phase at least once. Problem to be solved. The problem considered in our work is the gathering problem, where k robots have to agree on one location (one node of the ring) not known in advance in order to gather on it, and that before stopping there forever.
3 Algorithm To achieve the gathering, we propose the algorithm composed of two phases. The first phase is to build a configuration that contains a single 1.block and no isolated robots without creating any tower regardless of their positions in the initial configuration (provided that there is no tower and the configuration is aperiodic.) The second phase is to achieve the gathering from any configuration that contains a single 1.block and no isolated robots. Note that, since each robot is oblivious, it has to decide the current phase by observing the current configuration. To realize it, we define a special configuration set Csp which includes any configuration that contains a single 1.block and no isolated robots. We give the behavior of robots for each configuration in Csp , and guarantee that the gathering is eventually achieved from any configuration in Csp without moving out of Csp . We combine the algorithms for the first phase and the second phase in the following way: Each robot executes the algorithm for the second phase if the current configuration is in Csp , and executes one for the first phase otherwise. By this way, as soon as the system becomes a configuration in Csp during the first phase, the system moves to the second phase and the gathering is eventually achieved. 3.1 First Phase: An Algorithm to Construct a Single 1.Block In this section, we provide the algorithm for the first phase, that is, the algorithm to construct a configuration with a single 1.block. The strategy is as follows; In the initial
Asynchronous Mobile Robot Gathering from Symmetric Configurations
155
configuration, robots search the biggest d.block B1 , and then robots that are not on B1 move to join B1 . Then, we can get a single d.block. In the single d.block, there is a robot on the axis of symmetry because the number of robots is odd. When the nearest robots from the robot on the axis of symmetry move to the axis of symmetry, then we can get a (d − 1).block B2 , and robots that are not on B2 move toward B2 and join B2 . By repeating this way, we can get a single 1.block. We will distinguish three types of configurations as follows: – Configuration of type 1. In this configuration, there is only a single d.block such as d > 1, that is, all the robots are part of the d.block. Note that the configuration is in this case symmetric, and since there is an odd number of robots, we are sure that there is one robot on the axis of symmetry. If the configuration is this type, the robots that are allowed to move are the two symmetric robots that are the closest to the robot on the axis. Their destination is their adjacent empty node towards the robot on the axis of symmetry. (Note that the inter-distance has decreased.) – Configuration of type 2. In this configuration, all the robots belong to d.blocks (that is, there are no isolated robots) and all the d.blocks have the same size. If the configuration is this type, the robots neighboring to hole and with the maximum view are allowed to move to their adjacent empty nodes. If there exists such a configuration with more than one robot and two of them may move face-to-face on the hole on the axis of symmetry, then they withdraw their candidacy and other robots with the second maximum view are allowed to move. – Configuration of type 3. In this configuration, the configuration is not type 1 and 2, i.e., all the other cases. Then, there is at least one biggest d.block whose size is the biggest. • If there exists an isolated robot that is neighboring to the biggest d.block, then it is allowed to move to the adjacent empty node towards the nearest neighboring biggest d.block. If there exist more than one such isolated robots, then only robots that are closest to the biggest d.block among them are allowed to move. If there exist more than one such isolated robots, then only robots with the maximum view among such isolated robots are allowed to move. The destination is their adjacent empty nodes towards one of the nearest neighboring biggest d.blocks. • If there exist no isolated robot that is neighboring to the biggest d.block, the robot that does not belong to the biggest d.block and is neighboring to the biggest d.block is allowed to move. If there exists more than one such a robot, then only robots with the maximum view among them are allowed to move. The destination is their adjacent empty node towards one of the nearest neighboring biggest d.blocks. (Note that the size of the biggest d.block has increased.) Correctness of the algorithm. In the followings, we prove the correctness of our algorithm. We first prove that starting from any non-periodic configuration without tower, the algorithm does not reach a periodic configuration. The proof is by contradiction.
156
S. Kamei et al.
We assume that, after a robot A moves, the system reaches a periodic configuration C∗ , taking in account the configuration C from which A observed and decided to move. One important remark is that, since we assume an odd number of robots, any periodic configuration should have at least three d.blocks with the same size or at least three isolated robots. It is easy to see that in the case where A is the only one allowed to move (the configuration is not symmetric) then the configuration reached is not periodic. In the other case there will be exactly one robot B that will be allowed to move with A. A contradiction is then reached. Thus we have the following Lemma: Lemma 2. From any non-periodic initial configuration without tower, the algorithm does not create a periodic configuration. We then prove that starting from any configuration that does not contain a tower, no tower is created before reaching a configuration with a single 1.block for the first time. Thus we have the following Lemma: Lemma 3. No tower is created before reaching a configuration with a single 1.block for the first time. From Lemmas 2 and 3, the configuration is always non-periodic and does not have a tower starting from any non-periodic initial configuration without tower. Since the configurations are not periodic, we are sure that there will be one or two robots that will be allowed to move while the configuration does not contain a single 1.block. We have the following lemmas: Lemma 4. Let C be a configuration such that its inter-distance is d and the size of the biggest d.block is s (s ≤ k − 1). From configuration C, the configuration becomes such that the size of the biggest d.block is at least s + 1 in O(n) rounds. Proof. From configurations of type 2 and type 3, at least one robot neighboring to the biggest d.block is allowed to move. Consequently, the robot moves in O(1) rounds. If the robot joins the biggest d.block, the lemma holds. If the robot becomes an isolated robot, the robot is allowed to move toward the biggest d.block by the configurations of type 3 (1). Consequently the robot joins the biggest d.block in O(n) rounds, and thus the lemma holds. Lemma 5. Let C be a configuration such that its inter-distance is d. From configuration C, the configuration becomes such that there is only single d.block in O(kn) rounds. Proof. From Lemma 4, the size of the biggest d.block becomes larger in O(n) rounds. Thus, the size of the biggest d.block becomes k in O(kn) rounds. Since the configuration that has a d.block with size k is the one such that there is only single d.block. Therefore, the lemma holds. Lemma 6. Let C be a configuration such that there is only single d.block (d ≥ 2). From configuration C, the configuration becomes one such that there is only single (d − 1).block in O(kn) rounds.
Asynchronous Mobile Robot Gathering from Symmetric Configurations
157
Proof. From the configuration of type 1, the configuration becomes one such that there is (d − 1).block in O(1) rounds. After that, the configuration becomes one such that there is only single (d − 1).block in O(kn) rounds by Lemma 5. Therefore, the lemma holds. Lemma 7. From any non-periodic initial configuration without tower, the configuration becomes one such that there is only single 1.block in O(n2 ) rounds. Proof. Let d be the inter-distance of the initial configuration. From the initial configuration, the configuration becomes one such that there is a single d.block in O(kn) rounds by Lemma 5. Since the inter-distance becomes smaller in O(kn) rounds by Lemma 6, the configuration becomes one such that there is only single 1.block in O(dkn) rounds. Since d ≤ n/k holds, the lemma holds. 3.2 Second Phase: An Algorithm to Achieve the Gathering In this section, we provide the algorithm for the second phase, that is, the algorithm to achieve the gathering from any configuration with a single 1.block. As described in the beginning of this section, to separate the behavior from the one to construct a single 1.block, we define a special configuration set Csp that includes any configuration with a single 1.block. Our algorithm guarantees that the system achieves the gathering from any configuration in Csp without moving out of Csp . We combine two algorithms for the first phase and the second phase in the following way: Each robot executes the algorithm for the second phase if the current configuration is in Csp , and executes one for the first phase otherwise. By this way, as soon as the system becomes a configuration in Csp during the first phase, the system moves to the second phase and the gathering is eventually achieved. Note that the system moves to the second phase without creating a single 1.block if it reaches a configuration in Csp before creating a single 1.block. The strategy of the second phase is as follows. When a configuration with a single 1.block is reached, the configuration becomes symmetric. Note that since there is an odd number of robots, we are sure that there is one robot R1 that is on the axis of symmetry. The two robots that are neighbor of R1 move towards R1. Thus R1 will have two neighboring holes of size 1. The robots that are neighbor of such a hole not being on the axis of symmetry move towards the hole. By repeating this process, a new 1.block is created (Note that its size has decreased and the tower is on the axis of symmetry). Consequently robots can repeat the behavior and achieve the gathering. Note that due to the asynchrony of the system, the configuration may contain a single 1.block of size 2. In this case, one of the two nodes of the block contains a tower (the other is occupied by a single robot). Since we assume a local weak multiplicity detection, only the robot that does not belong to a tower can move. Thus, the system can achieve the gathering. In the followings, we define the special configuration set Csp and the behavior of robots in the configurations. To simplify the explanation, we define a block as a maximal consecutive nodes where every node is occupied by some robots. The size Size(B) of a block B denotes the number of nodes in the block. Then, we regard an isolated node as a block of size 1. The configuration set Csp is partitioned into five subsets: Single block Csb , block leader Cbl , semi-single block Cssb , semi-twin Cst , semi-block leader Csbl . That is,
158
S. Kamei et al. 2
b vt
vt
B0
B0
b0 vt
B0 b1
Fig. 1. Single block Csb (b) (b > 2)
Fig. 2. Single block Csb (2)
B1
Fig. 3. Block Cbl (b0 , b1 )
b
B1
B2
Fig. 4. Semi-single Cssb (b)
b
1
B1
B0
B2
Fig. 5. Semi-twin Cst (b)
leader
vt
b1
block
b1
b0
b+2
vt
vt
B2
B1
B2
b1+1
Fig. 6. Semi-block leader Csbl (b0 , b1 )
Csp = Csb ∪ Cbl ∪ Cssb ∪ Cst ∪ Csbl holds. We provide the definition of each set and the behavior of robots. Note that, although the definition of configurations specifies the position of a tower, each robot can recognize the configuration without detecting the position of a tower if the configuration is in Csp . – Single block. A configuration C is a single block configuration (denoted by C ∈ Csb ) if and only if there exists exactly one block B0 such that Size(B0) is odd or equal to 2. Note that If Size(B0) is equal to 2, one node of B0 is a tower and the other node is occupied by one robot. If Size(B0) is odd, letting vt be the center node of B0, no node other than vt is a tower. In this configuration, robots move as follows: 1) If Size(B0) is equal to 2, the robot that is not on a tower moves to the neighboring tower. 2) If Size(B0) is odd, the configuration is symmetric and hence there exists one robot on the axis of symmetry (Let this robot be R1). Then, the robots that are neighbors of R1 move towards R1. – Block leader. A configuration C is a block leader configuration (denoted by C ∈ Cbl ) if and only if the following conditions hold (see Figure 3): 1) There exist exactly three blocks B0, B1, and B2 such that Size(B0) is odd and Size(B1) = Size(B2). 2) Blocks B0 and B1 share a hole of size 1 as their neighbors. 3) Blocks B0 and B2 share a hole of size 1 as their neighbors. 4) Letting vt be the center node in B0, no node other than vt is a tower. Note that, since k < n − 3 implies that there exist at least four free nodes, robots can recognize B0, B1, and B2 exactly. In this configuration, the robots in B1 and B2 that share a hole with B0 as its neighbor move towards B0. – Semi-single block. A configuration C is a semi-single block configuration (denoted by C ∈ Cssb ) if and only if the following conditions hold (see Figure 4): 1) There exist exactly two blocks B1 and B2 such that Size(B2) = 1 and Size(B1) is even (Note that this implies Size(B1) + Size(B2) is odd.). 2) Blocks B1 and B2 share a
Asynchronous Mobile Robot Gathering from Symmetric Configurations
159
hole of size 1 as their neighbors. 3) Letting vt be a node in B1 that is the (Size(B1)/2)-th node from the side sharing a hole with B2, no node other than vt is a tower. In this configuration, the robot in B2 moves towards B1. – Semi-twin. A configuration C is a semi-twin configuration (denoted by C ∈ Cst ) if and only if the following conditions hold (see Figure 5). 1) There exist exactly two blocks B1 and B2 such that Size(B2) = Size(B1) + 2 (Note that this implies Size(B1) + Size(B2) is even, which is distinguishable from semi-single block configurations). 2) Blocks B1 and B2 share a hole of size 1 as their neighbors. 3) Letting vt be a node in B2 that is the neighbor of a hole shared by B1 and B2, no node other than vt is a tower. In this configuration, the robot in B2 that is a neighbor of vt moves towards vt . – Semi-block leader. A configuration C is a semi-block leader configuration (denoted by C ∈ Csbl ) if and only if the following conditions hold (see Figure 6). 1) There exist exactly three blocks B0, B1, and B2 such that Size(B0) is even and Size(B2) = Size(B1) + 1. 2) Blocks B0 and B1 share a hole of size 1 as their neighbors. 3) Blocks B0 and B2 share a hole of size 1 as their neighbors. 4) Letting vt be a node in B0 that is the (Size(B0)/2)-th node from the side sharing a hole with B2, no node other than vt is a tower. Note that, since k < n − 3 implies that there exist at least four free nodes, robots can recognize B0, B1, and B2 exactly. In this configuration, the robot in B2 that shares a hole with B0 as a neighbor moves towards B0. Correctness of the algorithm. In the followings, we prove the correctness of our algorithm: To prove the correctness, we define the following notations. – Csb (b): A set of single block configurations such that Size(B0) = b. – Cbl (b0 , b1 ): a set of block leader configurations such that Size(B0) = b0 and Size(B1) = Size(B2) = b1 . – Cssb (b): A set of semi-single block configurations such that Size(B1) = b. – Cst (b): A set of semi-twin configurations such that Size(B1) = b. – Csbl (b0 , b1 ): A set of semi-block leader configurations such that Size(B0) = b0 and Size(B1) = b1 . Note that every configuration in Csp has at most one node that can be a tower (denoted by vt in the definition). It is easy to observe that in the case the configuration is of type Csb (b) such as 1 < b ≤ 3, the gathering is eventually performed. When the configuration is of type Csb (b) such as b ≥ 5, a configuration of type Cbl (1, (b − 3)/2) is reached in O(1) rounds (Note that there might be an intermediate configuration which is Cst (b − 3)/2) in the case the scheduler activates the two robots allowed to move separately). If the configuration is of type Cbl (b0 , b1 ) such as b1 ≥ 2 then a configuration remains of type Cbl (b0 , b1 ) however b0 =b0 + 2 and b1 = b1 − 1. Thus we are sure that a configuration of type Cbl (b0 , 1) is eventually reached. Note that this configuration leads to a configuration of type Csb (b0 + 2). Observe that b0 + 2 = b − 2 (recall that we started from a configuration of type Csb (b) such as b ≥ 5). Thus we can conclude that starting from a configuration of type Csb (b) such as b ≥ 5, a configuration of type Csb (b − 2) is eventually reached. Hence we are sure that a configuration of type Csb (b) such as
160
S. Kamei et al.
Cbl (b0,b1) b1 ≥ 2
Cst (b)
Csb (b) b≥5
Cssb(b)
Csb (b) 1< b ≤ 3
Gathering
b0>1
Csbl (b0,b1)
Cbl (b0,b1) b1=1
b0=1
The number of the robots that are not part of the tower decreases b1 decreases by 1 No change regarding the number of robots
Fig. 7. Possible transitions
1 < b ≤ 3 is reached in a finite time. Thus, the gathering is performed in a finite time. In another hand, it is easy to see that from a configuration of type Cssb (b), Cst (b) and Csbl (b0 , b1 ) either a configuration of type Csb(b) or of type Cbl (b0 , b1) is reached in a finite time. Thus we are sure that from all the configurations that are part of the set Csp the gathering is performed. Note that, since the algorithm of the second phase is executed after the first phase, some robots may move based on an outdated view which is observed in the first phase. We can also show that the gathering is achieved in such a situation. We can then deduct the following Theorem: Theorem 1. From any non-periodic initial configuration without tower, the system achieves the gathering in O(n2 ) rounds.
4 Concluding Remarks We presented a new protocol for mobile robot gathering on a ring-shaped network. Contrary to previous approaches, our solution neither assumes that global multiplicity detection is available nor that the network is started from a non-symmetric initial configuration. Nevertheless, we retain very weak system assumptions: robots are oblivious and anonymous, and their scheduling is both non-atomic and asynchronous. We would like to point out some open questions raised by our work. First, the recent work of [5] showed that for the exploration with stop problem, randomized algorithm enabled that periodic and symmetric initial configurations are used as initial ones. However the proposed approach is not suitable for the non-atomic CORDA model. It would be interesting to consider randomized protocols for the gathering problem to bypass impossibility results. Second, investigating the feasibility of gathering without any multiplicity detection mechanism looks challenging. Only the final configuration with a single node hosting robots could be differentiated from other configurations, even if robots are given as input the exact number of robots.
Asynchronous Mobile Robot Gathering from Symmetric Configurations
161
References 1. Blin, L., Milani, A., Potop-Butucaru, M., Tixeuil, S.: Exclusive perpetual ring exploration without chirality. In: Lynch, N.A., Shvartsman, A.A. (eds.) DISC 2010. LNCS, vol. 6343, pp. 312–327. Springer, Heidelberg (2010) 2. Cieliebak, M.: Gathering non-oblivious mobile robots. In: Farach-Colton, M. (ed.) LATIN 2004. LNCS, vol. 2976, pp. 577–588. Springer, Heidelberg (2004) 3. Cieliebak, M., Flocchini, P., Prencipe, G., Santoro, N.: Solving the robots gathering problem. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 1181–1196. Springer, Heidelberg (2003) 4. Dessmark, A., Fraigniaud, P., Kowalski, D.R., Pelc, A.: Deterministic rendezvous in graphs. Algorithmica 46(1), 69–96 (2006) 5. Devismes, S., Petit, F., Tixeuil, S.: Optimal probabilistic ring exploration by semiˇ synchronous oblivious robots. In: Kutten, S., Zerovnik, J. (eds.) SIROCCO 2009. LNCS, vol. 5869, pp. 195–208. Springer, Heidelberg (2010) 6. Flocchini, P., Ilcinkas, D., Pelc, A., Santoro, N.: Computing without communicating: Ring exploration by asynchronous oblivious robots. In: Tovar, E., Tsigas, P., Fouchal, H. (eds.) OPODIS 2007. LNCS, vol. 4878, pp. 105–118. Springer, Heidelberg (2007) 7. Flocchini, P., Kranakis, E., Krizanc, D., Santoro, N., Sawchuk, C.: Multiple mobile agent rendezvous in a ring. In: Farach-Colton, M. (ed.) LATIN 2004. LNCS, vol. 2976, pp. 599– 608. Springer, Heidelberg (2004) 8. Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Gathering of asynchronous robots with limited visibility. Theor. Comput. Sci. 337(1-3), 147–168 (2005) 9. Izumi, T., Izumi, T., Kamei, S., Ooshita, F.: Mobile robots gathering algorithm with local weak multiplicity in rings. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 101–113. Springer, Heidelberg (2010) 10. Kamei, S., Lamani, A., Ooshita, F., Tixeuil, S.: Asynchronous mobile robot gathering from symmetric configurations without global multiplicity detection. Research report (2011), http://hal.inria.fr/inria-00589390/en/ 11. Klasing, R., Kosowski, A., Navarra, A.: Taking advantage of symmetries: Gathering of asynchronous oblivious robots on a ring. In: Baker, T.P., Bui, A., Tixeuil, S. (eds.) OPODIS 2008. LNCS, vol. 5401, pp. 446–462. Springer, Heidelberg (2008) 12. Klasing, R., Markou, E., Pelc, A.: Gathering asynchronous oblivious mobile robots in a ring. In: Asano, T. (ed.) ISAAC 2006. LNCS, vol. 4288, pp. 744–753. Springer, Heidelberg (2006) 13. Klasing, R., Markou, E., Pelc, A.: Gathering asynchronous oblivious mobile robots in a ring. Theoretical Computer Science 390(1), 27–39 (2008) 14. Kowalski, D.R., Pelc, A.: Polynomial deterministic rendezvous in arbitrary graphs. In: Fleischer, R., Trippen, G. (eds.) ISAAC 2004. LNCS, vol. 3341, pp. 644–656. Springer, Heidelberg (2004) 15. Lamani, A., Potop-Butucaru, M.G., Tixeuil, S.: Optimal deterministic ring exploration with oblivious asynchronous robots. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 183–196. Springer, Heidelberg (2010) 16. De Marco, G., Gargano, L., Kranakis, E., Krizanc, D., Pelc, A., Vaccaro, U.: Asynchronous deterministic rendezvous in graphs. Theor. Comput. Sci. 355(3), 315–326 (2006) 17. Prencipe, G.: C ORDA : Distributed coordination of a set of autonomous mobile robots. In: Proc. 4th European Research Seminar on Advances in Distributed Systems (ERSADS 2001), Bertinoro, Italy, pp. 185–190 (2001) 18. Prencipe, G.: On the feasibility of gathering by autonomous mobile robots. In: Pelc, A., Raynal, M. (eds.) SIROCCO 2005. LNCS, vol. 3499, pp. 246–261. Springer, Heidelberg (2005)
Gathering Asynchronous Oblivious Agents with Local Vision in Regular Bipartite Graphs Samuel Guilbault1 and Andrzej Pelc2, 1
2
D´epartement d’informatique, Universit´e du Qu´ebec en Outaouais, Gatineau, Qu´ebec J8X 3X7, Canada
[email protected] D´epartement d’informatique, Universit´e du Qu´ebec en Outaouais, Gatineau, Qu´ebec J8X 3X7, Canada
[email protected]
Abstract. We consider the problem of gathering identical, memoryless, mobile agents in one node of an anonymous graph. Agents start from different nodes of the graph. They operate in Look-Compute-Move cycles and have to end up in the same node. In one cycle, an agent takes a snapshot of its immediate neighborhood (Look), makes a decision to stay idle or to move to one of its adjacent nodes (Compute), and in the latter case makes an instantaneous move to this neighbor (Move). Cycles are performed asynchronously for each agent. The novelty of our model with respect to the existing literature on gathering asynchronous oblivious agents in graphs is that the agents have very restricted perception capabilities: they can only see their immediate neighborhood. An initial configuration of agents is called gatherable if there exists an algorithm that gathers all the agents of the configuration in one node and keeps them idle from then on, regardless of the actions of the asynchronous adversary. (The algorithm can be even tailored to gather this specific configuration.) The gathering problem is to determine which configurations are gatherable and find a (universal) algorithm which gathers all gatherable configurations. We give a complete solution of the gathering problem for regular bipartite graphs. Our main contribution is the proof that the class of gatherable initial configurations is very small: it consists only of “stars” (an agent A with all other agents adjacent to it) of size at least 3. On the positive side we give an algorithm accomplishing gathering for every gatherable configuration. Keywords: asynchronous, mobile agent, gathering, regular graph, bipartite graph.
1
Introduction
The aim of gathering is to bring mobile entities (agents), initially situated at different locations of some environment, to the same location (not determined in
Research partly supported by NSERC discovery grant and by the Research Chair in Distributed Computing at the Universit´e du Qu´ebec en Outaouais.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 162–173, 2011. c Springer-Verlag Berlin Heidelberg 2011
Gathering Asynchronous Oblivious Agents
163
advance) and stop. Agents may operate either in the plane, in which case they usually represent mobile robots, or in a network, modeled by a simple undirected graph, in which case they may model software agents. Gathering is a basic task which permits, e.g, to exchange information between agents or coordinate their further actions. A lot of effort has been devoted to study gathering in very weak scenarios, where agents represent simple devices that could be cheaply mass-produced. One of these scenarios is the CORDA model, initially formulated for agents operating in the plane [4,5,6,11,16,17,18] and then adapted to the network environment [12,13,14]. In this paper we study gathering in networks, in a scenario even weaker than the above. Below we describe our model and point out its differences with respect to that from [12,13,14]. Consider a simple undirected graph. Neither nodes nor links of the graph have any labels. Initially, some nodes of the graph are occupied by identical agents and there is at most one agent in each node. The goal is to gather all agents in one node of the graph and stop. Agents operate in Look-Compute-Move cycles. In one cycle, an agent takes a snapshot of its immediate neighborhood (Look), then, based on it, makes a decision to stay idle or to move to one of its adjacent nodes (Compute), and in the latter case makes an instantaneous move to this neighbor (Move). Cycles are performed asynchronously for each agent. This means that the time between Look, Compute, and Move operations is finite but unbounded, and is decided by the adversary for each agent. The only constraint is that moves are instantaneous, and hence any agent performing a Look operation can see other agents at its own or adjacent nodes and not on edges, while performing a move. However an agent A may perform a Look operation at some time t, perceiving agents at some adjacent nodes, then Compute a target neighbor at some time t > t, and Move to this neighbor at some later time t > t in which some agents are in different nodes from those previously perceived by A, because in the meantime they performed their Move operations. Hence agents may move based on significantly outdated perceptions, which adds to the difficulty of achieving the goal of gathering. It should be stressed that agents are memoryless (oblivious), i.e., they do not have any memory of past observations. Thus the target node (which is either the current position of the agent or one of its neighbors) is decided by the agent during a Compute operation solely on the basis of the location of other agents perceived in the previous Look operation. Agents are anonymous and execute the same deterministic algorithm. They cannot leave any marks at visited nodes, nor send any messages to other agents. The only difference between our scenario and that from [12,13,14] is in what an agent perceives during the Look operation. While in the above papers the agent was assumed to see the entire configuration of all agents in the graph, we assume that it only sees its immediate neighborhood, i.e., agents located at its own and at adjacent nodes. The reason for this change of model is applicability. It is hard to imagine how otherwise weak and simple agents could implement a global snapshot of the network, whereas local perception can be easily performed by exchanging signals between adjacent nodes.
164
S. Guilbault and A. Pelc
An important and well studied capability in the literature on agent gathering is the multiplicity detection [11,12,13,14,17]. This is the ability of the agents to perceive, during the Look operation, if there is one or more agents at a given location. It has been shown in [14] that without this capability gathering in networks is usually impossible (even for the ring and even if agents can take global snapshots). On the other hand, it was proved in [12] that multiplicity detection can be weakened to apply only to the node on which the agent is currently located. In this paper we consider both the weak and the strong version of multiplicity detection. Our negative result holds even with strong multiplicity detection (which means, in our case, that an agent can detect if there is one or more agents at its own and at adjacent nodes) and our positive result holds even for weak multiplicity detection, when the agent can only distinguish if it is alone or not at its node. It should be stressed that, during a Look operation, an agent can only tell if at some node there are no agents, there is one agent, or there are more than one agents: an agent does not see a difference between a node occupied by a or b agents, for distinct a, b > 1. In this paper we study the gathering problem in regular bipartite graphs. A configuration of agents is called gatherable if there exists an algorithm that gathers all the agents of the configuration in one node and keeps them idle from then on, regardless of the actions of the asynchronous adversary. (The algorithm can be even tailored to gather this specific configuration.) The gathering problem is to determine which initial configurations are gatherable and find a (universal) algorithm which gathers all initial gatherable configurations. 1.1
Our Results
We give a complete solution of the gathering problem for regular bipartite graphs. Our main contribution is the proof that the class of gatherable initial configurations is very small: it consists only of “stars” (an agent A with all other agents adjacent to it) of size at least 3. On the positive side we give a (universal) algorithm accomplishing gathering for every gatherable configuration. 1.2
Discussion of Assumptions
We would like to argue that our model is likely to be the weakest under which the gathering problem can be meaningfully studied in networks. Already the CORDA model adapted to networks in [12,13,14] is extremely weak, as agents do not have memory of previous snapshots and the asynchronous adversary has the full power of arbitrarily scheduling Look-Compute-Move cycles for all agents. Also agents are identical (anonymous), hence gathering protocols cannot rely on labels to break symmetry. However, the perception capabilities of agents were previously assumed very strong, thus giving rise to agents with contrasting features: no memory but powerful view. In our model the latter power is also weakened, as we allow the agents to perceive only their immediate neighborhood. It is easy to see that further restrictions are impossible: agents that see only their own node cannot gather. As for the assumption on multiplicity detection, we solve the gathering problem both for its weak and strong version.
Gathering Asynchronous Oblivious Agents
165
It remains to discuss our assumptions concerning the class of networks in which agents operate. We look at regular bipartite graphs. This is a large class of networks including e.g., even cycles, multidimensional tori with even sides, hypercubes and many other networks. It should be noted that our result remains valid without change in arbitrary cycles of size different from 3 and arbitrary multidimensional tori with every dimension of size different from 3. For multidimensional tori with at least one dimension of size 3, the result changes as follows. For strong multiplicity detection, gatherable configurations are exactly stars of size at least 3 with at least one agent having only one adjacent agent, and for weak multiplicity detection, gatherable configurations are exactly stars of size at least 3 with all agents except one having only one adjacent agent. The techniques developed in this paper can be easily adapted to cover the above cases. Notice that removing the assumption on regularity of the network makes the solution of the gathering problem impossible, even in the class of trees. (For non-regular graphs, local vision of an agent would additionally mean perceiving the degrees of its own and adjacent nodes.) To see this, consider the following trees: T1 is the five-node line with 1 leaf attached to each extremity, 1 leaf attached to the neighbor of each extremity and 2 leaves attached to the central node; T2 is the five-node line with 3 leaves attached to each extremity and 1 leaf attached to the neighbor of each extremity. Hence T1 has degree pattern 2-3-4-3-2 and T2 has degree pattern 4-3-2-3-4 on the “backbone” line of five nodes. Now consider the initial configuration in each of these trees consisting of two agents located at nodes of degree 3. Both configurations are gatherable. The algorithm for the configuration in T1 is: if you are at a node of degree 3, go to a node of degree 4, and if you are at a node of degree 4 , then stop. The algorithm for the configuration in T2 is: if you are at a node of degree 3, go to a node of degree 2, and if you are at a node of degree 2 , then stop. However, there is no common algorithm that can gather those two configurations: an adversary scheduling actions of both agents synchronously can keep them apart in one of these configurations. It remains to consider the assumption that the graph is bipartite. As mentioned above, it is possible to extend the solution to some other regular graphs. However, the gathering problem in arbitrary regular graphs remains open. 1.3
Related Work
The problem of gathering mobile agents in one location has been extensively studied in the literature. Many variations of this task have been considered. Agents move either in a network represented as a graph, cf. e.g. [2,8,9,10,15], or in the plane [1,3,4,5,6,11,16,17,18], they are labeled [8,9,15], or anonymous [1,3,4,5,6,11,16,17,18], gathering algorithms are probabilistic (cf. [2] and the literature cited there), or deterministic [1,3,4,5,6,8,10,11,15,16,17,18]. For deterministic gathering there are different ways of breaking symmetry: in [8,9,15] symmetry was broken by assuming that agents have distinct labels, and in [10] it was broken by using tokens.
166
S. Guilbault and A. Pelc
The very weak assumption of anonymous identical agents that cannot send any messages and communicate with the environment only by observing it, was first used to study deterministic gathering in the case of agents moving freely in the plane [1,3,4,5,6,11,16,17,18]. The scenario was further precised in various ways. In [4] it was assumed that agents have memory, while in [1,3,5,6,11,16,17,18] agents were oblivious, i.e., it was assumed that they do not have any memory of past observations. Oblivious agents operate in Look-Compute-Move cycles. The differences are in the amount of synchrony assumed in the execution of the cycles. In [3,18] cycles were executed synchronously in rounds by all active agents, and the adversary could only decide which agents are active in a given cycle. In [4,5,6,11,16,17,18] they were executed asynchronously, giving raise to the CORDA model: the adversary could interleave operations arbitrarily, stop agents during the move, and schedule Look operations of some agents while others were moving. It was proved in [11] that gathering is possible in the CORDA model if agents have the same orientation of the plane, even with limited visibility. Without orientation, the gathering problem was positively solved in [5], assuming that agents have the capability of multiplicity detection. A complementary negative result concerning the CORDA model was proved in [17]: without multiplicity detection, gathering agents that do not have orientation is impossible. Our scenario is the most similar to the asynchronous model used in [12,13,14] for rings. It differs from the CORDA model in the execution of Move operations. This has been adapted to the context of networks: moves of the agents are executed instantaneously from a node to its neighbor, and hence agents always see other agents at nodes. All possibilities of the adversary concerning interleaving operations performed by various agents are the same as in the CORDA model, and the characteristics of the agents (anonymity, obliviousness, multiplicity detection) are also the same. Unlike in our scenario, [12,13,14] assume unlimited vision of agents. A significantly different model of asynchrony for the study of gathering has been used in [7,8]. In these papers gathering of two agents was studied and meeting can occur either at a node or inside an edge. Agents have distinct labels and each of them knows its own label, but not that of the other agent.
2
Terminology and Preliminaries
A node at which there is no agent is called empty, otherwise it is called occupied. A single agent occupying a node is called a singleton and more than one agent occupying a node form a tower. A configuration is a function on the set of nodes of the graph with values in the set {empty, singleton, tower}. An initial configuration does not contain towers. We will say that singletons are adjacent (resp. towers are adjacent, a singleton is adjacent to a tower), if the respective nodes are adjacent. Since neither nodes nor edges nor agents are labeled and the graph is regular of degree δ, during a Look operation an agent located at node v gets the input (x, S), where the value of x concerns the status of node v: either singleton or tower, and the value of S, describing the status of neighbors of v, is a multi-set
Gathering Asynchronous Oblivious Agents
167
of size δ whose elements are empty or singleton or tower.1 Given this input the agent either decides to stay idle or to move to some element of S. If there are several elements of the same type (empty or singleton or tower) the choice of the particular neighbor of the type chosen by the agent belongs to the adversary, as the agent cannot distinguish between two neighbors of the same type. A star is a configuration in which there is some singleton A and all other agents are singletons adjacent to A. Two nodes are equivalent, if they have the same adjacent nodes. Two agents are similar if they are both singletons, or both belong to towers, and if the number of empty nodes, of singletons and of towers adjacent to them are equal. Thus similar agents have the same input obtained during the Look operation. Notice that singletons located on equivalent nodes and agents in towers located on equivalent nodes are similar. Throughout the paper we assume that the underlying graph is regular bipartite of degree δ. We will use the following propositions whose proofs are omitted: Proposition 1. If nodes a, b, c, d form a path and a is not adjacent to d, then a, b, c, d are pairwise non-equivalent. Proposition 2. If nodes a and b are not adjacent and every node adjacent to a is adjacent to b, then a and b are equivalent. Proposition 3. If there exists a node all of whose neighbors are equivalent, then the graph is complete bipartite.
3
The Impossibility Result
In this section we present our main contribution which is the following negative result. As mentioned in the introduction, it holds even when agents can detect multiplicities both at the currently occupied node and at all its neighbors. Theorem 1. A configuration that is not a star of size at least 3 is not gatherable. The proof of the theorem is split into a series of lemmas, which aim at excluding several classes of configurations from the pool of gatherable configurations. They culminate in excluding all configurations except stars of size at least 3. The general idea used to prove that a configuration with given properties is not gatherable is to consider a hypothetical gathering algorithm for it and show that the adversary can schedule moves of agents in such a way that the resulting configuration endlessly switches between two or more types of configurations, each of them having at least two occupied nodes. Due to lack of space, proofs of several lemmas are omitted and will appear in the journal version. The first three lemmas aim at showing that configurations with all agents in towers are not gatherable. 1
For our positive result this information is further restricted, leaving the possibilities for elements of S either empty or occupied.
168
S. Guilbault and A. Pelc
Lemma 1. An agent in a tower that has no adjacent agents cannot move. Proof. If all agents are in the same tower, no agent can move, as otherwise gathering would never occur. In any other configuration with a tower that has no adjacent agents, the agents in the tower get the same input as if the tower were alone, hence they cannot move either. Lemma 2. A configuration that consists of two adjacent towers is not gatherable. Proof. All agents are similar, hence they can all either move to an empty neighbor or to the occupied neighbor. In the first case the adversary first moves all agents from one tower to an empty neighbor, thus creating two isolated towers that cannot move by Lemma 1. In the second case the adversary simultaneously exchanges places of the two towers. In both cases gathering is prevented. Lemma 3. A configuration whose all agents are in at least two towers is not gatherable. Proof. The adversary moves all agents from a tower simultaneously either to the same empty neighbor or to the same occupied neighbor. If such moves could lead to a gathering, the adversary can schedule them so that at some point there are only two adjacent towers. Then gathering is impossible by Lemma 2. The next lemma gives a necessary condition on gatherability in regular complete bipartite graphs. Lemma 4. Consider a configuration in a regular complete bipartite graph with bipartition X, Y , consisting of two sets of singletons, such that singletons in each set are similar. This configuration is not gatherable, unless one of the sets is of size 1 and the other is of size at least 2. The next lemma shows what must happen when a pair of adjacent nodes containing a singleton and a tower are isolated from other nodes. Lemma 5. In a configuration with one singleton adjacent to a tower and no other agent adjacent to any of them, the tower cannot move and the singleton must move to the tower. Proof. If gathering can occur, the adversary can schedule moves of agents so that before the last move there is one tower, one adjacent singleton and no other agents. In such a configuration either the tower must move to the singleton or vice-versa. In the first case, the adversary moves all but one agent from the tower to the adjacent singleton, thus creating an identical configuration and gathering does not happen. Hence for such a configuration the singleton must move to the tower. If there are other agents in the configuration, non adjacent to the tower or to the adjacent singleton, then all agents of the tower and the adjacent singleton get the same input as in the previously considered configuration, and hence their behavior is the same. Hence the tower cannot move and the singleton must move to the tower.
Gathering Asynchronous Oblivious Agents
169
A configuration is called stable, if it contains a tower and a non-adjacent singleton that has a neighbor non-adjacent to this tower. A configuration is called multitower, if it contains more than one tower. The following lemma shows how a stable configuration with one large tower can evolve. Lemma 6. Consider a stable configuration with exactly one tower containing at least 4 agents. Then the adversary can move the agents in such a way that the configuration remains stable or becomes multi-tower. Proof. If the tower can move, then the adversary can create a multi-tower configuration. If the tower cannot move, then the singleton A making the configuration stable will have to move at some point to accomplish gathering. Since it is not a neighbor of the tower, it can move either to an empty node or to a singleton. If it moves to an empty node then, since A makes the configuration stable, there is a neighbor of A which is not adjacent to the tower. If this neighbor is empty, the adversary can move A to this node, keeping the configuration stable. If this neighbor is occupied then, regardless of where A moves, the configuration remains stable. If A moves to a singleton, the resulting configuration becomes multi-tower. A configuration C at time t is perpetual, if it is stable or multi-tower at time t and if the adversary can schedule moves of agents in such a way that for any time t > t there exists a time t > t when the configuration will be again stable or multi-tower. Note that a perpetual configuration is not gatherable. The next two lemmas show how configurations with exactly two adjacent towers can evolve. Lemma 7. Consider a configuration with exactly two towers, situated on adjacent nodes x and y. Then either the configuration is perpetual, or the adversary can schedule the movements of agents so that the configuration will eventually have the following properties: 1. there are exactly two towers situated on adjacent nodes, and every singleton is adjacent to one of them, 2. x has exactly one adjacent singleton A, 3. the node containing A is equivalent to y, 4. y has at least two adjacent singletons. For any gathering algorithm A, a parent of a configuration C is any configuration C , such that there exists a move of an agent in C according to algorithm A, which results in configuration C. For a positive integer k, a k-ancestor of C is a configuration C , such that there exists a sequence of configurations (C = C0 , C1 , . . . , Ck = C ), such that Ci+1 is a parent of Ci . Hence a parent is a 1ancestor. Notice that if a configuration C is perpetual, every ancestor C of C is perpetual as well. Lemma 8. Consider a configuration C with exactly two towers, situated on adjacent nodes x and y. If the configuration has the following properties:
170
S. Guilbault and A. Pelc
1. there are exactly two towers situated on adjacent nodes, and every singleton is adjacent to one of them, 2. x has exactly one adjacent singleton A, 3. the node containing A is equivalent to y, 4. y has at least two adjacent singletons, then there exists a positive integer k, such that every k-ancestor of C must be perpetual. The following lemma is crucial for further considerations. It implies that if an initial configuration evolved to become either stable or multi-tower, then this initial configuration was not gatherable. Lemma 9. Let C be a configuration that is either stable or multi-tower. There exists a positive integer k, such that for any k-ancestor C of C, the adversary can schedule moves of agents in such a way that C becomes perpetual. Proof. First suppose that C is multi-tower. If C is not perpetual, then after some moves of the agents it must be no longer multi-tower. Hence some agent must move. If some singleton moves, then the number of towers does not decrease and hence the configuration remains multi-tower. If agents in a tower move, then if there are more than two towers in C, then after the move the configuration remains multi-tower. If there are exactly two towers in C, then in order to create a non-multi-tower configuration, the towers must first become adjacent, and hence there exists a positive integer k, such that any k-ancestor of C is perpetual by Lemmas 7 and 8. Now suppose that C is stable. If it is also multi-tower, the above argument applies. Hence we may suppose that the configuration has a single tower located at a node v and a singleton A non-adjacent to v, that has a neighbor w nonadjacent to v. For the configuration C to stop being stable, either A or the tower must move. Case 1. The singleton A moves. A can move either to an empty node or to a singleton. If A moves to a singleton, then a new tower is created and the configuration becomes multi-tower. If A moves to an empty node, the adversary will move it to w, if w is empty. In this case the configuration remains stable. If w is occupied by a singleton, then regardless of where A moves, the configuration remains stable. Case 2. Agents in the tower move. Since the singleton A and the node v are not adjacent and the configuration is stable, there exists a node v adjacent to v which is not adjacent to A. Agents in the tower may move either to an empty node or to a singleton. Subcase 2.1. Agents in the tower move to a singleton. If there were exactly one adjacent singleton, the tower could not move, in view of Lemma 5. Hence we may assume that there are at least two singletons adjacent to the tower. The adversary can move agents from the tower to both singletons, thus creating a multi-tower configuration.
Gathering Asynchronous Oblivious Agents
171
Subcase 2.1. Agents in the tower move to an empty node. If A and the tower are at distance larger than 2, then after the move of the tower the configuration remains stable. Hence we may suppose that A and the tower are at distance 2. In this case, if v is empty, then the tower moves to v and the configuration remains stable. If v is occupied by a singleton, then if the tower moves to a node z adjacent to A, then the configuration remains stable because there exists a node adjacent to v that is not adjacent to z. A configuration is connected if the subgraph induced by the occupied nodes is connected. A configuration is linear if it contains four occupied nodes a, b, c, d, such that b is adjacent to a and c, and d is adjacent to c but not to a. Lemma 10. If a disconnected configuration that does not have 3 agents is obtained from a gatherable initial configuration, then the adversary can move agents in such a way that the configuration remains disconnected or becomes linear. The next lemma shows that gathering cannot be accomplished by passing through a linear configuration. Lemma 11. A linear configuration obtained from a gatherable initial configuration is not gatherable. We are now ready to prove three corollaries that together exclude all initial configurations except stars of size at least 3. Corollary 1. A disconnected initial configuration is not gatherable. Proof. First consider a disconnected initial configuration with 3 agents. If all agents are isolated, then the adversary can schedule their moves to keep them always isolated. If one agent is isolated and the other two are adjacent, then all nodes containing them are non-equivalent. It follows that the adversary can schedule moves of the agents to keep at least one agent isolated at all times. This proves that a disconnected initial configuration with exactly 3 agents is not gatherable. Hence we may suppose that the configuration does not have 3 agents. By Lemmas 10 and 11 the configuration is not gatherable. Corollary 2. A connected initial configuration of diameter different from 2 is not gatherable. Proof. If the diameter is 1, then there are exactly 2 adjacent singletons. They are similar, hence the adversary will move them both to different empty nodes or make them exchange locations. In both cases gathering is impossible. If the diameter is larger than 2, then the configuration must be linear and gathering is impossible by Lemma 11. Corollary 3. An initial configuration of diameter 2 with a cycle of agents is not gatherable.
172
S. Guilbault and A. Pelc
Proof. The only initial configuration of diameter 2 with a cycle is a configuration whose agents form a complete bipartite graph with at least two agents in each set of the bipartition. Agents in each set are similar. If agents in at least one of the sets move to singletons, then the adversary can move the agents to form a multi-tower configuration. If all agents move to empty nodes, then the adversary can move agents to create either a multi-tower configuration or a disconnected configuration without towers. Gathering is impossible by Lemma 9 and Corollary 1. We can finally prove our main negative result. Proof of Theorem 1. Consider an initial configuration that is not a star with at least 3 nodes. If the configuration is disconnected, then it is not gatherable by Corollary 1. If the configuration is connected with diameter different from 2, then it is not gatherable by Corollary 2. Hence we may assume that it has diameter 2. Since it is not a star, it must contain a cycle and thus it is not gatherable by Corollary 3.
4
The Algorithm
Theorem 1 leaves only stars of size at least 3 as candidates for gatherable configurations. The following algorithm, formulated for an agent A, performs gathering for all these configurations and works even with only weak multiplicity detection, i.e., when an agent can only detect if it is alone or not at the currently occupied node. Algorithm Gather-All If A is in a tower or has more than one occupied neighbor then A does not move else A moves to the only occupied neighbor.
Theorem 2. Algorithm Gather-All performs gathering for all gatherable initial configurations. Proof. In view of Theorem 1 it suffices to prove that Algorithm Gather-All performs gathering for all stars of size at least 3. Each such star has exactly one singleton B with more than one occupied neighbor, and all other singletons are adjacent to it. Since neither the singleton B nor a tower can move, all singletons other than B will move to the node occupied by B and stop.
Gathering Asynchronous Oblivious Agents
173
References 1. Agmon, N., Peleg, D.: Fault-Tolerant Gathering Algorithms for Autonomous Mobile Robots. SIAM J. Comput. 36(1), 56–82 (2006) 2. Alpern, S., Gal, S.: The Theory of Search Games and Rendezvous. Kluwer Academic Publishers, Dordrecht (2002) 3. Ando, H., Oasa, Y., Suzuki, I., Yamashita, M.: Distributed Memoryless Point Convergence Algorithm for Mobile Robots with Limited Visibility. IEEE Trans. on Robotics and Automation 15(5), 818–828 (1999) 4. Cieliebak, M.: Gathering Non-oblivious Mobile Robots. In: Farach-Colton, M. (ed.) LATIN 2004. LNCS, vol. 2976, pp. 577–588. Springer, Heidelberg (2004) 5. Cieliebak, M., Flocchini, P., Prencipe, G., Santoro, N.: Solving the Robots Gathering Problem. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 1181–1196. Springer, Heidelberg (2003) 6. Cohen, R., Peleg, D.: Robot Convergence via Center-of-Gravity Algorithms. In: Kralovic, R., S´ ykora, O. (eds.) SIROCCO 2004. LNCS, vol. 3104, pp. 79–88. Springer, Heidelberg (2004) 7. Czyzowicz, J., Labourel, A., Pelc, A.: How to meet asynchronously (almost) everywhere. In: Proc. 21st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA ), pp. 22–30 (2010) 8. De Marco, G., Gargano, L., Kranakis, E., Krizanc, D., Pelc, A., Vaccaro, U.: Asynchronous deterministic rendezvous in graphs. Theoretical Computer Science 355, 315–326 (2006) 9. Dessmark, A., Fraigniaud, P., Kowalski, D., Pelc, A.: Deterministic rendezvous in graphs. Algorithmica 46, 69–96 (2006) 10. Flocchini, P., Kranakis, E., Krizanc, D., Santoro, N., Sawchuk, C.: Multiple Mobile Agent Rendezvous in a Ring. In: Farach-Colton, M. (ed.) LATIN 2004. LNCS, vol. 2976, pp. 599–608. Springer, Heidelberg (2004) 11. Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Gathering of Asynchronous Robots with Limited Visibility. Theoretical Computer Science 337(1-3), 147–168 (2005) 12. Izumi, T., Izumi, T., Kamei, S., Ooshita, F.: Mobile robots gathering algorithm with local weak multiplicity in rings. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 101–113. Springer, Heidelberg (2010) 13. Klasing, R., Kosowski, A., Navarra, A.: Taking advantage of symmetries: gathering of asynchronous oblivious robots on a ring. In: Baker, T.P., Bui, A., Tixeuil, S. (eds.) OPODIS 2008. LNCS, vol. 5401, pp. 446–462. Springer, Heidelberg (2008) 14. Klasing, R., Markou, E., Pelc, A.: Gathering asynchronous oblivious mobile robots in a ring. Theoretical Computer Science 390, 27–39 (2008) 15. Kowalski, D., Pelc, A.: Polynomial deterministic rendezvous in arbitrary graphs. In: Fleischer, R., Trippen, G. (eds.) ISAAC 2004. LNCS, vol. 3341, pp. 644–656. Springer, Heidelberg (2004) 16. Prencipe, G.: CORDA: Distributed Coordination of a Set of Autonomous Mobile Robots. In: Proc. ERSADS, pp. 185–190 (2001) 17. Prencipe, G.: Impossibility of gathering by a set of autonomous mobile robots. Theoretical Computer Science 384, 222–231 (2007) 18. Suzuki, I., Yamashita, M.: Distributed Anonymous Mobile Robots: Formation of Geometric Patterns. SIAM J. Comput. 28(4), 1347–1363 (1999)
Gathering of Six Robots on Anonymous Symmetric Rings Gianlorenzo D’Angelo1 , Gabriele Di Stefano1 , and Alfredo Navarra2 1
2
Dipartimento di Ingegneria Elettrica e dell’Informazione, Universit` a degli Studi dell’Aquila, Italy {gianlorenzo.dangelo,gabriele.distefano}@univaq.it Dipartimento di Matematica e Informatica, Universit` a degli Studi di Perugia, Italy
[email protected]
Abstract. The paper deals with a recent model of robot-based computing which makes use of identical, memoryless mobile robots placed on nodes of anonymous graphs. The robots operate in Look-Compute-Move cycles; in one cycle, a robot takes a snapshot of the current configuration (Look), takes a decision whether to stay idle or to move to one of its adjacent nodes (Compute), and in the latter case makes an instantaneous move to this neighbor (Move). Cycles are performed asynchronously for each robot. In particular, we consider the case of only six robots placed on the nodes of an anonymous ring in such a way they constitute a symmetric placement with respect to one single axis of symmetry, and we ask whether there exists a strategy that allows the robots to gather at one single node. This is in fact the first case left open after a series of papers [1,2,3,4] dealing with the gathering of oblivious robots on anonymous rings. As long as the gathering is feasible, we provide a new distributed approach that guarantees a positive answer to the posed question. Despite the very special case considered, the provided strategy turns out to be very interesting as it neither completely falls into symmetrybreaking nor into symmetry-preserving techniques.
1
Introduction
We study one of the most fundamental problems of self-organization of mobile entities, known in the literature as the gathering problem. Robots, initially situated at different locations, have to gather at the same location (not determined in advance) and remain in it. We consider the case of an anonymous ring in which neither nodes nor links have any labels. Initially, some of the nodes of the ring are occupied by robots and there is at most one robot in each node. Robots operate in Look-Compute-Move cycles. In each cycle, a robot takes a snapshot of the current global configuration (Look), then, based on the perceived configuration, takes a decision to stay idle or to move to one of its adjacent nodes (Compute), and in the latter case makes an instantaneous move to this neighbor (Move). Cycles are performed asynchronously for each robot. This means that A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 174–185, 2011. c Springer-Verlag Berlin Heidelberg 2011
Gathering of Six Robots on Anonymous Symmetric Rings
175
the time between Look, Compute, and Move operations is finite but unbounded, and is decided by the adversary for each robot. The only constraint is that moves are instantaneous, and hence any robot performing a Look operation sees all other robots at nodes of the ring and not on edges. However, a robot r may perform a Look operation at some time t, perceiving robots at some nodes, then Compute a target neighbor at some time t > t, and Move to this neighbor at some later time t > t , at which some robots are in different nodes from those previously perceived by r at time t because in the meantime they performed their Move operations. Hence, robots may move based on significantly outdated perceptions. We stress that robots are memoryless (oblivious), i.e., they do not have any memory of past observations. Thus, the target node (which is either the current position of the robot or one of its neighbors) is decided by the robot during a Compute operation solely on the basis of the location of other robots perceived in the previous Look operation. Robots are anonymous and execute the same deterministic algorithm. They cannot leave any marks at visited nodes, nor send any messages to other robots. We remark that the Look operation provides the robots with the entire ring configuration. Moreover, it is assumed that the robots have the ability to perceive whether there is one or more robots located at a given node of the ring. This capability of robots is important and well-studied in the literature under the name of multiplicity detection [1,2,3,5,6,7,8]. In fact, without this capability, many computational problems (such as the gathering problem considered herein) are impossible to solve for all non-trivial starting configurations. 1.1
Related Work and Our Results
Under the Look-Compute-Move model, the gathering problem on rings was initially studied in [3], where certain configurations were shown to be gatherable by means of symmetry-breaking techniques, but the question of the general-case solution was posed as an open problem. In particular, it has been proved that the gathering is not feasible in configurations with only two robots, in periodic configurations (invariable under non-trivial rotation) or in those with an axis of symmetry of type edge-edge. A configuration is called symmetric if the ring has a geometrical axis of symmetry, which reflects single robots into single robots, multiplicities into multiplicities, and empty nodes into empty nodes. A symmetric configuration is not periodic if and only if it has exactly one axis of symmetry [3]. A symmetric configuration with an axis of symmetry has an edge-edge symmetry if the axis goes through (the middles of) two edges; it has a node-edge symmetry if the axis goes through one node and one edge; it has a node-node symmetry if the axis goes through two nodes; it has a robot-on-axis symmetry if there is at least one node on the axis of symmetry occupied by a robot. For an odd number, all the gatherable configurations have been solved. For an even number of robots greater than two, if the initial configuration is not periodic, the feasibility of the gathering has been solved, except for some types of symmetric configurations. In [2], the attention has been devoted to these left open symmetric cases. The new proposed technique was based on preserving symmetry rather than
176
G. D’Angelo, G. Di Stefano, and A. Navarra
breaking it, and the problem was solved when the number of robots is greater than 18. This left open the case of an even number of robots between 4 and 18, as the case of just 2 robots is not gatherable [3]. The case of 4 robots has been solved in [1,4]. Moreover, in [1] all the cases of 2k robots with k ≥ 2 have been addressed when the initial axis of symmetry is of type robot-on-axis. Hence, the first case left open concerns 6 robots with an initial axis of symmetry of type node-edge, or node-node. In this paper, we address the problem of 6 robots and provide a distributed algorithm that gathers the robots when starting from any symmetric configuration of type node-edge, or node-node.
2
Definitions and Notation
We consider an n-node anonymous ring without orientation. Initially, exactly six nodes of the ring are occupied by robots. During a Look operation, a robot perceives the relative locations on the ring of multiplicities and single robots. We remind that a multiplicity occurs when more than one robot occupy the same location. The current configuration of the system can be described in terms of the view of a robot r which is performing the Look operation at the current moment. We denote a configuration seen by r as a tuple Q(r) = (q0 , q1 , . . . , qj ), j ≤ 5, which represents the sequence of the numbers of free consecutive nodes interleaved by robots when traversing the ring either in clockwise or in anti-clockwise direction, starting from r. When comparing two configurations, we say that they are equal regardless the traversing orientation. Formally, given two configurations Q = (q0 , q1 , . . . , qj ) and Q = (q0 , q1 , . . . , qj ), we have Q = Q if and only if q0 = q0 , q1 = q1 , . . ., and qj = qj or q0 = qj , q1 = qj−1 , . . ., and qj = q0 . For instance, in the configuration of Fig. 1, node x can see the configuration Q(x) = (1, 2, 1, 3, 1, 2) or Q(x) = (2, 1, 3, 1, 2, 1). In our notation, a multiplicity is represented as qi = −1 for some 0 ≤ i ≤ j, disregarding the number of robots in the multiplicity. We also assume that the initial configuration is symmetric and not periodic. In this paper, we are interested only in node-edge and nodenode symmetries without robots on axis as the other cases are either solved or not gatherable. We can then represent a symmetric configuration independently from the robot view as in Fig. 1. In detail, without multiplicities, the ring is divided by the robots into 6 intervals: A, B, C, B , C , and D with a, b, c, b, c, and d free nodes, respectively. In the case of node-edge symmetry, A is the interval where the axis passes through a node and D is the interval where the axis passes through an edge; in the case of node-node symmetry, A and D are the intervals such that either a < d or a = d and b < c; the case where a = d and b = c cannot occur as it generates two axis of symmetry. Note that, in the case of node-node symmetry, a and d are both odd, while, in the case of node-edge symmetry, a is odd and d is even. The axis of symmetry passing trough intervals −−→ A and D is denoted as DA when directed from D to A. The direction of the axis distinguishes A and D. When the direction is not specified or it is clear by the context, we denote it by DA or AD. We denote as: x (x , resp.) the robots
Gathering of Six Robots on Anonymous Symmetric Rings
x
A a=1
x B b=2 y
y
z
x
x
c=1
B b = b = 2 y
y C
z
177
z
z d=3 D
C
c =c=1
Fig. 1. A symmetric configuration and its representation
between A and B (B , resp.); y (y , resp.) the robots between B and C (B and C , resp.); z (z , resp.) the robots between C (C , resp.) and D, see Fig. 1. A robot r ∈ {x, y, z, x , y , z } can perform only two moves: it moves up (r↑) if it goes towards A; it moves down (r↓) if it goes towards D. Note that, in general a robot could not be able to distinguish intervals A and D. However, we show that in our algorithm this is not the case and hence a robot r is always allowed to distinguish between moves r↑ and r↓.
3
Resolution Algorithm
The main idea of the algorithm is to perform moves x↑, x↑, y↑ and y ↑, with the aim of preserving the symmetry and gathering in the middle node of interval A, where the axis is directed. In some special cases, it may happen that the axis of symmetry changes at run time. Before multiplicities are created, the algorithm in a symmetric configuration allows only two robots to move in order to create a new symmetric configuration. In the general case, the algorithm compares b and d, and performs a pair of moves such that if b > d, then b is enlarged, while, if b < d, then b is reduced. In this way, the axis of symmetry and its direction do not change. In fact, in order to obtain a new axis of symmetry between BC or CB after one move, b must be equal to d. When b > d, x↑ and x ↑ are performed, while, when b < d, y↑ and y ↑ are performed. In both cases, (apart for some special cases) the ordering between b and d is maintained in the new configuration. Eventually, either one multiplicity is created at the middle node of the original interval A by means of robots x and x , or two symmetric multiplicities are created on the positions originally occupied by x and x by means of the moves of y and y , respectively. In the second case, the two multiplicities will move up again to the middle node of the original interval A by allowing at most 4 robots to move all together. Once such a multiplicity has been created, the remaining robots join it, and conclude the gathering. In the special case of b = d, which can only happen in the initial configuration, the algorithm tries to break this equality by enlarging or reducing d by means of either z ↑ and z ↑ (when C > 0) or z ↓ and z ↓ (when C = 0 and D > 0). The special cases when C = D = 0 require specific arguments.
178
G. D’Angelo, G. Di Stefano, and A. Navarra
The remainder of the section is structured as follows: in the next subsection we give the algorithm for the general case, then we describe the algorithm in some special cases, namely when a multiplicity is created on the middle node of interval A, when 2 non-symmetric multiplicities are created, and when n = 7. 3.1
General Case
In this section we describe the algorithm as it is performed by a single robot. In general, the algorithm allows only two types of configurations: those which are symmetric and those which differ from a symmetric one only by one move. As already observed, we do consider only node-edge and node-node symmetries, also excluding possible robots-on-axis symmetries. In the Look phase, a robot r obtains the tuple Q(r) and performs Procedure gather, see Fig. 2. First of all, it checks whether there is a multiplicity containing more than two robots, this is realized by counting the number of elements in Q(r), as a multiplicity is always counted as one interval of dimension −1. If the number of elements is less than five or two non-symmetric multiplicities have been created in a ring of more than 7 nodes, then Procedure multiplicity is invoked, see Fig. 5. Otherwise, the algorithm checks whether the ring is composed of seven nodes (that is i qi = 1) in which case, Procedure seven is invoked, see Fig. 6. Excluding these special cases, the main activity of the algorithm is performed by means of Procedure moving and Function identification, see Fig.s 3 and 4, respectively. Function identification computes the values a, b, c and d of the symmetric configuration that might be the one in input, or the one before the last move. The function also returns the identity of r among x, y and z, and the boolean variable move which indicates whether r is allowed to move or not. Due to symmetry arguments, a robot cannot distinguish of being, for instance, x or x . However, if the current configuration is at one step from a symmetry of interest, the robot can recognize whether it is the one which has already performed the move, or if it has to perform it in order to re-establish the desired symmetry. Finally, by means of Procedure moving, the Move phase of the robot is realized, if it is allowed to do it. We now describe in details Procedure moving and Function identification, while the special cases addressed by Procedures multiplicity and seven will be described in Subsection 3.2. Moving algorithm. Procedure moving takes as input the intervals describing a symmetric configuration and the identity of the robot which is performing its Move phase. When b < d or b > d, robot r moves up if its identity is either x (code line 2) or y (code line 5), respectively. When b = d, if c > 0, r moves up if it is identified as z (code line 8). Otherwise (that is, when b = d and c = 0), in order to avoid to create two multiplicities at the extremes of interval D, robot r moves down if it is identified as z and d > 0 (code line 11). The last case considers when b = d = c = 0. In this case, it results a > 1 as otherwise the ring would be composed of seven nodes. Then, r moves up if it is identified as x (code line 13).
Gathering of Six Robots on Anonymous Symmetric Rings
179
Procedure: gather Input: (q0 , q1 , . . . , qj ), j ≤ 5 1 2 3 4 5 6 7 8 9
if j < 5 OR q > 1 AND there are 2 multiplicities AND the configuration i i is not symmetric ) then multiplicity((q0 , q1 , . . . , qj )); else if q = 1 then seven; i i else (a, b, c, d, r, move) := identification((q0 , q1 , . . . , q5 )); if a = −1 then multiplicity((q0 , q1 , . . . , q5 )); else if move then moving(a, b, c, d, r);
Fig. 2. General algorithm executed each time a robot wakes up
Identification. Function identification implements the correct “positioning” of a robot with respect to the perceived configuration. To this aim, it makes use of Function symmetric that checks whether an input configuration is symmetric, and in the positive case, it returns the role of the robot in such a configuration and the values of a, b, c and d obtained by rotating k times its view. The behavior of symmetric will be described later in this section, while the pseudocode can be found in [9]. We now focus on Function identification. At code lines 2–3 of Function identification, the robot checks whether the perceived configuration is symmetric and, in the positive case, it sets the variable move to true. If the configuration is not symmetric, it must be at one step from a symmetric one. Indeed, it is at one step from the symmetric configuration before the last move, and from the symmetric configuration obtained by the move symmetric to the last one. In some special cases, it may also happen that the current configuration is at one step from other symmetric configurations, but we know how to distinguish the “good” one. In detail, at code lines 4–15 the function checks if the robot r is allowed to move of one node from the current configuration Q(r). The configuration Qi (r) of r after a move i ∈ {−1, 1} is computed at code line 5 by adding i to q0 and subtracting i to q5 . If Qi (r) is symmetric (code line 6), then, given the role of r, the algorithm retrieves the symmetric configuration ¯ i (r) that should have been occurred before the moves of r and the symmetric Q robot r (lines 7–13). In the pseudo-code, variables α[i], β[i], γ[i], δ[i], (a[i], b[i], c[i], d[i], resp.) and r[i], i ∈ {−1, 1}, denote the values of a, b, c, d, and r ¯ i (r), resp.). Variable dir ∈ {1, −1} indicates related to configuration Qi (r) (Q the direction where node r is moving when passing from Q(r) to Qi (r) that is, if dir = 1, then r is moving up, otherwise it is moving down. In order to check ¯ i (r) is an admissible configuration, the function simulates one step of whether Q the moving algorithm, code line 15. If the tested move was allowed, then variable move[i] is set to true. If the robot is allowed to do exactly one move i, then code lines 16–19 return the values a[i], b[i], c[i], d[i], and r[i]. If the robot is allowed to do both the tested moves, then code lines 20–23 return the values a[i], b[i],
180
G. D’Angelo, G. Di Stefano, and A. Navarra Procedure: moving Input : a, b, c, d, and r ∈ {x, y, z}
1 2 3 4 5 6 7 8 9 10 11 12 13
if b > d then if r = x then x↑ ; else if b < d then if r = y then y↑ ; else if c > 0 then if r = z then z↑ ; else if d > 0 then if r = z then z↓ ; else if r = x then x↑ ;
Fig. 3. Algorithm performing the Move phase of a robot
c[i], d[i] and r[i] where i is the move such that the identity of r[i] is either x or z. In fact, there might be only two cases where the robot can perform the two opposite moves (see the correctness proof of the algorithm in [9]). In the first case, r can behave as x or y (i.e., r[i] = x and r[−i] = y for some i ∈ {−1, 1}). In the second case it always behaves as z (i.e., r[1] = r[−1] = z). In the former case, we force r to behave always as x. In the latter case, r can move to any direction, indifferently. These situations might lead to the change of the original axis of symmetry. However, such a change can occur only once. Note that, Function identification works correctly also when multiplicities occur and the configuration is only at one step from symmetry. However, if a robot r belongs to a multiplicity formed by x and y, then we require r to provide its view in the form (−1, c, d, c, b, a). This can always be obtained because b is either 0 or −1 while d > 0 since before creating the multiplicities the moves y↑ have been performed, i.e. b < d. Actually, in the case two non-symmetric multiplicities occur, the right moves will be determined by Procedure multiplicity that either will bring the configuration to a symmetric one or only at one step from symmetry. At that point, Function identification is again invoked. This alternation will continue until one multiplicity containing more than 3 robots does occur. Symmetric algorithm. Function symmetric (provided in [9]) works as follows. It takes as input a configuration Q(r) = (q0 , q1 , . . . , q5 ) and checks whether it is symmetric. In the positive case, symmetric returns the values of a, b, c and d, an integer k (to be explained next), and the role of r ∈ {x, y, z} in Q(r). To this aim, symmetric rotates, for each j ∈ {0, 1, . . . , 5}, the position of qj ∈ {0, 1, . . . , 5} by i positions and checks whether the rotated configuration is symmetric. First, it checks whether there are two pairs of equal intervals q1+i mod 6 = q5+i mod 6 and q2+i mod 6 = q4+i mod 6 . In the positive case,
Gathering of Six Robots on Anonymous Symmetric Rings
181
Function: identification Input : (q0 , q1 , . . . , q5 ) Output: a, b, c, d, r ∈ {x, y, z}, move ∈ {true, false} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
move := false; move[1] := false; move[−1] := false; D[1] =↑; D[−1] =↓; (sym, a, b, c, d, k, r) := symmetric((q0 , q1 , . . . , q5 )); if sym then move := true else for i in {1, −1} do (sym, α[i], β[i], γ[i], δ[i], k, r[i]) := symmetric((q0 + i, q1 , . . . , q5 − i)); if sym then (a[i], b[i], c[i], d[i]) := (α[i], β[i], γ[i], δ[i]); dir := −i(−1)k ; case r[i] = x a[i] := α[i] + 2dir; b[i] := β[i] − dir; case r[i] = y b[i] := β[i] − dir; c[i] := γ[i] + dir; case r[i] = z c[i] := γ[i] + dir; d[i] := δ[i] − 2dir; if (a[i], b[i], c[i], d[i]) is not periodic, with less than 3 multiplicities, and no edge-edge symmetry then if by simulating moving(a[i], b[i], c[i], d[i], r[i]), r[i] is allowed to move with direction D[dir] then move[i] := true; if move[1] = move[−1] then move := true; if move[1] then (a, b, c, d, r) := (a[1], b[1], c[1], d[1], r[1]); else (a, b, c, d, r) := (a[−1], b[−1], c[−1], d[−1], r[−1]); if move[1] = move[−1] = true then move := true; if r[1] = x then (a, b, c, d, r) := (a[1], b[1], c[1], d[1], r[1]); else (a, b, c, d, r) := (a[−1], b[−1], c[−1], d[−1], r[−1]);
Fig. 4. Algorithm for the identification of a robot
value i is stored in k, and if qi is odd, three cases may arise: the configuration has a node-edge symmetry if q3+i mod 6 is even; if q3+i mod 6 is odd, the configuration has a node-node symmetry if qi < q3+i mod 6 or qi = q3+i mod 6 and q1+i mod 6 < q2+i mod 6 ; the configuration is not symmetric. 3.2
Multiplicities and Seven Nodes Case
In the case only one multiplicity is created at the middle node of the current interval A, then the gathering is almost completed as this node will be reached by all the other robots by means of Procedure multiplicity, see Fig. 5, code lines 4–5. This procedure is also invoked when two multiplicities have been created, and the configuration requires at least two robots (belonging to the same multiplicity) to move in order to re-establish the symmetry, i.e., the configuration is at more than one step from symmetry, code lines 1–3.
182
G. D’Angelo, G. Di Stefano, and A. Navarra Procedure: multiplicity Input: (q0 , q1 , . . . , qj ), 1 < j ≤ 5
1 2 3 4 5 6
if there are two multiplicities then if r belongs to the multiplicity closer than the other to a single robot then move r towards the other multiplicity along the path free from single robots; else if r does not belong to any multiplicity AND between r and the multiplicity there is no other robot then move r towards the multiplicity along a shortest path;
Fig. 5. Algorithm used for some configurations with multiplicities
Procedure: seven Input: Ring of 7 nodes with 6 robots 1 2 3 4 5 6 7 8 9 10 11
if 6 nodes are occupied then y↑; else if more than 3 nodes are occupied AND two consecutive free nodes do not occur then if robot r is not in a multiplicity AND (between r and a multiplicity there is a sequence of nodes S with S given by only one free node OR S given by one free node two single robots OR (S given by one free node and one single robot AND the configuration is symmetric)) then move r onto the localized free node; else if more than 3 nodes are occupied AND two consecutive free nodes are bounded by two single robots, r and r then move any robot but r and r towards the middle of the three nodes between r and r opposite to the interval of two consecutive free nodes;
Fig. 6. Algorithm invoked by Procedure gather for solving the case of 6 robots on a 7 nodes ring
When the input ring is made of only seven nodes, the gathering problem requires suitable arguments. In fact, the first move must be necessarily y ↑, as any other one could lead to deadlock. The algorithm shown in Fig. 6 solves the case of six robots on a ring of seven nodes, i.e. when a = 1, and b = c = d = 0. Actually, Procedure seven brings the robots to constitute a configuration with a multiplicity of more than 2 robots, then the gathering is finalized by means of Procedure multiplicity. The correctness of the algorithm is provided by Theorem 1. We will show that in this case the gathering node may vary with respect to the possible occurring execution. In particular, it can be any node
Gathering of Six Robots on Anonymous Symmetric Rings
183
except the ones originally occupied by z and z . Moreover, the allowed moves may bring the configuration to asymmetric situations at more than one step from symmetry. Theorem 1. Procedure gather solves the gathering problem when the initial configuration is given by 6 robots on a ring of 7 nodes by means of Procedures seven and multiplicity. Proof. The main idea behind Procedure seven is to create an interval of two free nodes delimited by two single robots. Once this has been realized, the remaining 4 robots, occupying the remaining 3 nodes can detect the central node among these 3 nodes as gathering node, and move there (code line 11). Once the configuration moves to have only one multiplicity placed at the gathering node with more than three robots, Procedure gather invokes Procedure multiplicity, hence finalizing the gathering. Let us show then, how the interval of two free nodes is obtained. For describing the evolving of the configuration we always refer to robots with their initial roles according to Figure 1. After code line 1 of the Procedure seven, either two or one multiplicity is created. In the first case, the algorithm moves the remaining two single robots towards the multiplicities of one node by means of code line 8, allowed by code line 5. As there are no other possible moves, the required interval of two free nodes is created, eventually. In the second case, there is only one multiplicity and two non-consecutive free nodes. For the ease of discussion, we consider y↑ ≡ y ↑ as the computed move, i.e. we consider the two symmetric moves of robots with role y as two distinguished moves.1 Now the execution depends on the delays of the robots and the possible −−→ pending move y ↑. In this case, the axis of symmetry changes to C B, with b = −1. If y ↑ is not pending, then the only possible moves, according to code line 5, are x↑ and z↑ (note that such moves would be y↑ and y ↑ with respect to the new axis of symmetry). Once both the two steps have been performed, the configuration is still symmetric, and the possible moves allowed from the current view, according to code line 7, are z ↓ and y ↑. If they are both realized, then the required interval of two free nodes is created, and the gathering node will be the one originally occupied by x. If only one move is realized, say z ↓, then the only move allowed afterwards by code line 6 is y ↓. Again the interval of two free nodes is created, but now the gathering node will be the one originally occupied by y. The remaining case to be analyzed is when after the first step y ↑, the symmetric move y ↑ is pending. In this case, the execution depends on whether x performs its Look operation before or afterwards the move y ↑, while x↑ is always computed sooner or later. If x performs its Look operation afterwards y ↑, then it does not move because it is part of a multiplicity and the only other moves allowed by the algorithm before creating an interval of two free nodes are z↑ and z ↑. If x performs its Look operation before y ↑, then x↑ as well as z↑ are performed, eventually. If y moves before z performs its Look operation, then z ↑ will be computed by code line either 5 or 6, and the gathering node will be 1
Indeed, from the robot’s perspective, roles y and y are indistinguishable because of the symmetry.
184
G. D’Angelo, G. Di Stefano, and A. Navarra
the one originally free. If y moves after z , then z ↓ will be computed by code line 7, and the gathering node will be the one originally occupied by x.
4
Correctness for the General Algorithm
In this section we provide the correctness proof for the proposed algorithm. Actually, the proof of the next lemma can be found in [9]. Lemma 1. Each time a robot r performs the Look operation, if the input ring has more than seven nodes and there are no multiplicities, r can recognize one unique robot or a couple of symmetric robots allowed to move. From the above results, the main contribution of the paper follows: Theorem 2. Algorithm gather solves the gathering problem starting from all initial configurations of 6 robots on a ring having exactly one axis of symmetry, provided that the axis is not of type edge-edge nor robot-on-axis. Proof. From Theorem 1, if the input ring has seven nodes, the gathering is feasible. From Lemma 1, we have that starting from a symmetric configuration, this always evolves by either increasing or decreasing intervals B and B . In the first case, a multiplicity corresponding to a = −1 will be created, eventually. Then, by means of Procedure multiplicity the gathering correctly terminates. In the second case, two symmetric multiplicities will be created, obtaining b = b = −1. As described in Section 3.1, all the robots belonging to the multiplicities, will behave as y or y , hence allowing at most four robots to move concurrently. The used technique to gather the two multiplicities into one is similar to “Phase 3: gathering two multiplicities using guards” provided in [2], hence it does not require further arguments. Once a single multiplicity containing more than 2 robots occurs, Procedure multiplicity correctly terminates the gathering.
5
Conclusion
We have considered the basic gathering problem of six robots placed on anonymous rings. We positively answer to the previously open question whether it is possible to perform the gathering when the placement of the robots implies a symmetric configuration of type node-node or node-edge, without robots on the axis. The proposed algorithm makes use of new techniques that sometimes do not fall neither into symmetry-breaking nor into symmetry-preserving approaches. The very special case of a seven nodes ring already exploits new properties of the robots’ view in order to decide movements. We believe that our approaches can provide useful ideas for further applications in robot-based computing. In particular, the gathering problem of 2i robots, 4 ≤ i ≤ 9, placed on anonymous rings in symmetric configurations of type node-node or node-edge, without robots on the axis remains open. However, our technique provides some evidences that allow us to claim the following conjecture:
Gathering of Six Robots on Anonymous Symmetric Rings
185
Conjecture 1. The gathering problem given by configurations with 2i robots, 2 ≤ i ≤ 9, is solvable on rings with n > 6 nodes having exactly one axis of symmetry, provided that the axis is not of type edge-edge.
References 1. Haba, K., Izumi, T., Katayama, Y., Inuzuka, N., Wada, K.: On gathering problem in a ring for 2n autonomous mobile robots. In: Kulkarni, S., Schiper, A. (eds.) SSS 2008. LNCS, vol. 5340. Springer, Heidelberg (2008) 2. Klasing, R., Kosowski, A., Navarra, A.: Taking advantage of symmetries: Gathering of many asynchronous oblivious robots on a ring. Theor. Comput. Sci. 411, 3235– 3246 (2010) 3. Klasing, R., Markou, E., Pelc, A.: Gathering asynchronous oblivious mobile robots in a ring. Theor. Comput. Sci. 390, 27–39 (2008) 4. Koren, M.: Gathering small number of mobile asynchronous robots on ring. Zeszyty Naukowe Wydzialu ETI Politechniki Gdanskiej. Technologie Informacyjne 18, 325– 331 (2010) 5. Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Gathering of asynchronous robots with limited visibility. Theor. Comput. Sci. 337, 147–168 (2005) 6. Izumi, T., Izumi, T., Kamei, S., Ooshita, F.: Randomized gathering of mobile robots with local-multiplicity detection. In: Guerraoui, R., Petit, F. (eds.) SSS 2009. LNCS, vol. 5873, pp. 384–398. Springer, Heidelberg (2009) 7. Izumi, T., Izumi, T., Kamei, S., Ooshita, F.: Mobile robots gathering algorithm with local weak multiplicity in rings. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 101–113. Springer, Heidelberg (2010) 8. Prencipe, G.: Impossibility of gathering by a set of autonomous mobile robots. Theor. Comput. Sci. 384, 222–231 (2007) 9. D’Angelo, G., Di Stefano, G., Navarra, A.: Gathering of six robots on anonymous symmetric rings. Technical Report R.11-112, Dipartimento di Ingegneria Elettrica e dell’Informazione, Universit` a dell’Aquila (2011)
Tight Bounds for Scattered Black Hole Search in a Ring J´er´emie Chalopin1 , Shantanu Das1 , Arnaud Labourel1 , and Euripides Markou2 1
LIF, CNRS & Aix-Marseille University, Marseille, France {jeremie.chalopin,shantanu.das,arnaud.labourel}@lif.univ-mrs.fr 2 Department of Computer Science and Biomedical Informatics, University of Central Greece, Lamia, Greece
[email protected]
Abstract. We study the problem of locating a particularly dangerous node, the so-called black hole in a synchronous anonymous ring network with mobile agents. A black hole destroys all mobile agents visiting that node without leaving any trace. Unlike most previous research on the black hole search problem which employed a colocated team of agents, we consider the more challenging scenario when the agents are identical and initially scattered within the network. Moreover, we solve the problem with agents that have constant-sized memory and carry a constant number of identical tokens, which can be placed at nodes of the network. In contrast, the only known solutions for the case of scattered agents searching for a black hole, use stronger models where the agents have non-constant memory, can write messages in whiteboards located at nodes or are allowed to mark both the edges and nodes of the network with tokens. We are interested in the minimum resources (number of agents and tokens) necessary for locating all links incident to the black hole. In fact, we provide matching lower and upper bounds for the number of agents and the number of tokens required for deterministic solutions to the black hole search problem, in oriented or unoriented rings, using movable or unmovable tokens.
1
Introduction
We consider the problem of exploration in unsafe networks which contain malicious hosts of a highly harmful nature, called black holes. A black hole is a node which contains a stationary process destroying all mobile agents visiting this node, without leaving any trace [9]. In the Black Hole Search (BHS) problem the goal for a team of agents is to locate the black hole within finite time, with the additional constraint that at least one of the agents must remain alive. It is
Part of this work was done while E. Markou was visiting the LIF research laboratory in Marseille, France. Authors J. Chalopin, S. Das and A. Labourel are partially supported by ANR projects SHAMAN and ECSPER.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 186–197, 2011. c Springer-Verlag Berlin Heidelberg 2011
Tight Bounds for Scattered Black Hole Search in a Ring
187
usually assumed that all the agents start from the same location and have distinct identities. In this paper, we do not make such an assumption and study the problem for identical agents starting from distinct locations within the network. We focus on minimizing the resources required to find the black hole. The only way of locating a black hole is to have at least one agent visiting it. However, since any agent visiting a black hole is destroyed without leaving any trace, the location of the black hole must be deduced by some communication mechanism employed by the agents. Four such mechanisms have been proposed in the literature: a) the whiteboard model in which there is a whiteboard at each node of the network where the agents can leave messages, b) the ‘pure’ token model where the agents carry tokens which they can leave at nodes, c) the ‘enhanced’ token model in which the agents can leave tokens at nodes or edges, and d) the time-out mechanism (only for synchronous networks) in which one agent explores a new node while another waits for it at a safe node. The most powerful inter-agent communication mechanism is having whiteboards at all nodes. Since access to a whiteboard is provided in mutual exclusion, this model could also provide the agents a symmetry-breaking mechanism: If the agents start at the same node, they can get distinct identities and then the distinct agents can assign different labels to all nodes. Hence in this model, if the agents are initially co-located, both the agents and the nodes can be assumed to be non-anonymous without any loss of generality. The BHS problem has been studied using whiteboards in asynchronous networks, with the objective of minimizing the number of agents required to locate the black hole. Note that in asynchronous networks, it is not possible to answer the question of whether or not a black hole exists in the network, since there is no bound on the time taken by an agent to traverse an edge. Assuming the existence of (exactly one) black hole, the minimum sized team of co-located agents that can locate the black hole depends on the maximum degree Δ of a node in the network (unless the agents have a complete map of the network). In any case, the prior knowledge of the network size is essential to locate the black hole in finite time. In the case of synchronous networks two co-located distinct agents can discover one black hole in any graph by using the time-out mechanism, without the need of whiteboards or tokens. Furthermore it is possible to detect whether a black hole actually exists or not in the network. Hence, with co-located distinct agents, the issue is not the feasibility but the time efficiency of black hole search (see [3,5,15,16] for example). However when the agents are scattered in the network (as in our case), the time-out mechanism is not sufficient to solve the problem anymore. Most of the previous results on black hole search used agents whose memory is at least logarithmic in the size of the network. This means that these algorithms are not scalable to networks of arbitrary size. This paper considers agents modeled as finite automata, i.e., having a constant number of states. This means that these agents can not remember or count the nodes of the network that they have explored. In this model, the agents cannot have prior knowledge of the size of the network. For synchronous ring networks of arbitrary size, containing exactly one black hole, we present deterministic algorithms for locating the black hole
188
J. Chalopin et al.
using scattered agents each having constant-sized memory. We are interested in minimizing both the number of agents and the number of tokens required for solving the BHS problem. We use the ‘pure’ token model. Note that the ‘pure’ token model can be implemented with O(1)-bit whiteboards (assuming that only a constant number of tokens may be placed on a node at the same time), while the ‘enhanced’ token model can be implemented with O(log Δ)-bit whiteboards. In the previous results using the whiteboard model, the capacity of each whiteboard is always assumed to be of at least Ω(log n) bits, where n is the number of nodes of the network. Unlike the whiteboard model, we do not require any mutual exclusion mechanism at the nodes of the network. We distinguish movable tokens (which can be picked up from a node and placed on another) from unmovable tokens (which can not be picked up once they are placed on a node). For both types of tokens, we provide matching upper and lower bounds on both the number of agents and the number of tokens per agent, required for solving the black hole search problem in synchronous rings. Related Works: The exploration of an unknown graph by one or more mobile agents is a classical problem initially formulated in 1951 by Shannon [18] and it has been extensively studied since then. In unsafe networks containing a single dangerous node (black hole), the problem of searching for it has been studied in the asynchronous model using whiteboards and given that all agents initially start at the same safe node (e.g., [6,8,9]). It has also been studied using ‘enhanced’ tokens in [7,10,19] and in the ‘pure’ token model in [13]. It has been proved that the problem can be solved with a minimal number of agents performing a polynomial number of moves. Notice that in an asynchronous network the number of the nodes of the network must be known to the agents otherwise the problem is unsolvable [9]. If the network topology is unknown, at least Δ + 1 agents are needed, where Δ is the maximum node degree in the graph [8]. In asynchronous networks, with scattered agents (not initially located at the same node), the problem has been investigated for arbitrary topologies [2,14] in the whiteboard model while in the ‘enhanced’ token model it has been studied for rings [11,12] and for some interconnected networks [19]. The issue of efficient black hole search has been studied in synchronous networks without whiteboards or tokens (only using the time-out mechanism) in [3,5,15,16] under the condition that all distinct agents start at the same node. The problem has also been studied for co-located agents in directed graphs with whiteboards, both in the asynchronous [4] and synchronous cases [16]. A different dangerous behavior is studied for co-located agents in [17], where the authors consider a ring and assume black holes with Byzantine behavior, which do not always destroy a visiting agent. In all previous papers (apart from [13]) studying the Black Hole Search problem using tokens, the ‘enhanced’ token model is used. The weakest ‘pure’ token model has only been used in [13] for co-located agents in asynchronous networks. In all previous solutions to the problem using tokens, the agents are assumed to have non-constant memory.
Tight Bounds for Scattered Black Hole Search in a Ring
189
Table 1. Summary of results for BHS in synchronous rings Resources necessary and sufficient Tokens are Ring is # agents # tokens References in the paper Oriented Movable 3 1 Theorem 1, 2 and 5 Unoriented Oriented 4 2 Theorem 1, 3 and 6 Unmovable Unoriented 5 2 Theorem 1, 4 and 7
Our Contributions: Unlike previous studies on BHS, we consider the scenario of anonymous (i.e., identical) agents that are initially scattered in an anonymous ring. We focus our attention on very simple mobile agents. The agents have constant-size memory, they carry a constant number of identical tokens which can be placed at nodes and, (apart from using the tokens), they can communicate with other agents only when they meet at the same node. We consider four different scenarios depending on whether the tokens are movable or not, and whether the agents agree on a common orientation. We present deterministic optimal algorithms and provide matching upper and lower bounds for the number of agents and the number of tokens required for solving BHS (See Table 1 for a summary of results). Surprisingly, the agreement on the ring orientation does not influence the number of agents needed in the case of movable tokens but is important in the case of unmovable tokens. The lower bounds presented in this paper are very strong in the sense that they do not allow any trade-off between the number of agents and the number of tokens for solving the BHS problem. In particular we show that: – Any constant number of agents, even having unlimited memory, cannot solve the BHS problem with less tokens than depicted in all cases of Table 1. – Any number of agents less than that depicted in all cases of Table 1 cannot solve the BHS problem even if the agents are equipped with any constant number of tokens and they have unlimited memory. Meanwhile our algorithms match the lower bounds, are time-optimal and since they do not require any knowledge of the size of the ring or the number of agents, they work in any anonymous synchronous ring, for any number of anonymous identical agents (respecting the minimal requirements of Table 1). Due to space limitations, proofs and formal algorithms are omitted and can be found in the full version of the paper [1].
2
Our Model
Our model consists of an anonymous, synchronous ring network with k ≥ 2 identical mobile agents that are initially located at distinct nodes called homebases. Each mobile agent owns a constant number t of identical tokens which can be placed at any node visited by the agent. The tokens are indistinguishable. Any
190
J. Chalopin et al.
token or agent at a given node is visible to all agents on the same node, but not visible to agents on other nodes. The agents follow the same deterministic algorithm and begin execution at the same time and being in the same initial state. In all our protocols a node may contain at most two tokens at the same time. At any node of the ring, the ports leading to the two incident edges are distinguishable and locally labelled (e.g. as 1 and 2) and an agent arriving at a node knows the port-label of the edge through which it arrived. In the special case of an oriented ring, the ports are consistently labelled as Left and Right (i.e., all ports going in the clockwise direction are labelled Left). In an unoriented ring, the local port-labeling at a node is arbitrary and each agent in its first step chooses one direction as Left and in every subsequent step, it translates the local port-labeling at a node into Left and Right according to its chosen orientation. In a single time unit, each mobile agent completes one step which consists of the Look, Compute and Move stages (in this order). During the Look stage, an agent obtains information about the configuration of the current node (i.e., agents, tokens present at the node) and its own configuration (i.e., the port through which it arrived and the number of tokens it carries). During the Compute stage, an agent can perform any number of computations (i.e., computations are instantaneous in our model). During the Move stage, the agent may put or pick up a token at the current node and then either move to an adjacent node or remain at the current node. Since the agents are synchronous they perform each stage of each step at the same time. We call a token movable if it can be put on a node and picked up later by any mobile agent visiting the node. Otherwise we call the token unmovable in the sense that, once released, it can occupy only the node where it was released. Formally we consider a mobile agent as a finite Moore automaton A = (S, S0 , Σ, Λ, δ, φ), where S is a set of σ ≥ 2 states among which there is a specified state S0 called the initial state; Σ ⊆ D × Cv × CA is the set of possible configurations an agent can see when it enters a node; Λ ⊆ D × {put, pick, no action} is the set of possible actions by the agent; δ : S × Σ → S is the transition function; and φ : S → Λ is the output function. D = {left, right, none} is the set of possible directions through which the agent arrives at or leaves a node (none represents no move by the agent). Cv = {0, 1}σ × {0, 1, 2} is the set of possible configurations at a node, consisting of a bit string that denotes for each possible state whether there is an agent in that state, and an integer that denotes the number of tokens at that node (in our protocols at most 2 tokens reside at a node at any time). Finally, CA = {1, 2} × {0, 1} is the set of possible configurations of an agent, i.e., its orientation and whether it carries any tokens or not. Notice that all computations by the agents are independent of the size n of the network and the number k of agents. There is exactly one black hole in the network. An agent can start from any node other than the black hole and no two agents are initially colocated1 . Once an agent detects a link to the black 1
Since there is no symmetry breaking mechanism at a node, two agents starting at the same node and in the same state, would behave as a single (merged) agent.
Tight Bounds for Scattered Black Hole Search in a Ring
191
hole, it marks the link permanently as dangerous (i.e., disables this link). We require that at the end of a black hole search scheme, all links incident to the black hole (and only those links) are marked dangerous and that there is at least one surviving agent. Note that our definition of a successful BHS scheme is slightly different from the original definition, since we consider finite state agents. The time complexity of a BHS scheme is the number of time units needed for completion of the scheme, assuming the worst-case location of the black hole and the worst-case initial placement of the scattered agents.
3
Impossibility Results
We first show that one unmovable token does not suffice to solve the problem. This result provides a lower bound on the number of tokens necessary for solving BHS. Theorem 1. For any constant k, there exists no algorithm that solves BHS in all oriented rings containing one black hole and k or more scattered agents, when each agent is provided with only one unmovable token. The result holds even if the agents have unlimited memory. We prove the above theorem by showing that no two agents can gather at the same node, either before or after placing their token. Further, if an agent puts down its only token, all other surviving agents would put down their respective tokens at the same time. An adversary could select the size of the ring and the initial locations of the agents in such a way that the tokens released by the agents are equidistant apart from each other, and thus the locations of the tokens does not convey any information about the location of the black hole. We now derive some lower bounds on the number of agents necessary to solve the BHS problem. Lemma 1. During any execution of any BHS algorithm, if a link to the black hole is correctly marked, then at least one agent must have entered the black hole through this link. To solve the BHS problem in a ring, both links leading to the black hole need to be marked as dangerous. Thus, we immediately arrive at the following result. Theorem 2. Two mobile agents carrying any number of movable (or unmovable) tokens each, cannot solve the BHS problem in an oriented ring, even if the agents have unlimited memory. When the tokens are unmovable, even three agents are not sufficient to solve BHS. If there are exactly three agents each having t tokens (for some constant t), we can show that no two agents can meet before at least one of the three agents has fallen into the black hole. The agent that falls into the black hole may have left at most t tokens in its path, but this is not sufficient to indicate the exact location of the black hole since the agents may be initially located at
192
J. Chalopin et al.
an arbitrarily large distance from the black hole. Thus, the two surviving agents cannot identify both links incident to the black hole (they may identify at most one of these links). Theorem 3. Three mobile agents carrying a constant number of unmovable tokens each, cannot solve the BHS problem in an oriented ring, even if agents have unlimited memory. In unoriented rings, even four agents do not suffice to solve the BHS problem with unmovable tokens. In fact we show a stronger result that it is not even possible to identify just one of the links to the black hole, using four agents. An adversary can construct a large unoriented ring of odd size with an axis of symmetry such that there are two agents on each side of the axis and the black hole lies on the axis. In this case, at least two agents may fall into the black hole (one from each side), before any two agents meet. Due to the symmetry of the resulting configuration, the two surviving agents would not be able to gather at a node (and none of them could, by itself, identify any link to the black hole). Thus, we have the following result: Theorem 4. In an unoriented ring, four agents carrying any constant number of unmovable tokens each, cannot correctly mark any link incident to the black hole, even when the agents have unlimited memory.
4
A BHS Scheme with Movable Tokens
We first consider the case when the agents have movable tokens. If each agent has a movable token it can perform a cautious walk [9]. The Cautious-Walk procedure consists of the following actions: Put the token at the current node, move one step in the specified direction, return to pick up the token, and again move one step in the specified direction (carrying the token). After each invocation of the Cautious Walk, the agent looks at the configuration of the current node2 and decides whether to continue performing Cautious Walk. Algorithm 1. BHS-Ring-1 /* BHS in any ring using k ≥ 3 agents having 1 movable token each
*/
repeat CautiousWalk (Left); until current node has a token and no agent or next link is marked Dangerous; Mark-Link(Left); repeat CautiousWalk (Right); until current node has a token and no agent or next link is marked Dangerous; Mark-Link(Right);
2
Recall that only the tokens put on the node are counted, not the tokens carried by the agent itself.
Tight Bounds for Scattered Black Hole Search in a Ring
193
We show that only three agents are sufficient to solve BHS, when they have one movable token each. Algorithm 1 achieves this, both for oriented and unoriented rings. The procedure Mark-Link permanently marks as dangerous the specified link. Theorem 5. Algorithm 1 solves the BHS problem in an unoriented ring with k ≥ 3 agents having constant memory and one movable token each.
5
BHS Schemes with Unmovable Tokens
For agents having only unmovable tokens, we use the technique of Paired Walk (called Probing in [3]) for exploring new nodes. The procedure is executed by two co-located agents with different roles and the same orientation. One of the agents called the leader explores an unknown edge while the other agent, called follower waits for the leader. If the other endpoint of the edge is safe, the leader immediately returns to the previous node to inform the follower and then both move to this new node. On the other hand, if the leader does not return in two time steps, the follower knows that the next node is the black hole. In order to use the Paired Walk technique, we need to gather two agents at the same node and then break the symmetry between them, so that distinct roles can be assigned to each of them. The basic idea of our algorithms is the following. We first identify the two homebases that are closest to the black hole (one on each side). These homebases are called gates. The gates divide the ring into two segments: one segment contains the black hole (thus, is dangerous); the other segment contains all other homebases (and is safe). Initially all agents are in the safe part and an agent can move to the dangerous part only when it passes through the gate node. We ensure that any agent reaching a gate node, waits for a partner agent in order to perform the Paired Walk procedure. We now present two BHS algorithms, one for oriented rings and the other for unoriented rings. 5.1
Oriented Rings
In an oriented ring, all agents may move in the same direction (i.e., Left). During the first phase of the algorithm each agent places a token on its homebase, moves left until the next homebase (i.e., next node with a token) and then returns to its homebase to put down the second token. During this phase one agent will fall into the black hole and there will be a unique homebase with a single token (a “gate” node) and the other homebases will have two tokens each. However, the agents may not complete this phase of the algorithm at the same time. Thus during the algorithm, there may be multiple homebases that contain a single token. Whenever an agent reaches a “single token” node, it waits for a partner and then performs Paired Walk in the left direction. One of the agents of a pair (the leader) eventually falls into the black hole and the other agent (the follower) marks the edge leading to the black hole and returns to the gate node, waiting for another partner. When another agent arrives at this node, these two agents perform Paired Walk in the opposite direction to find the other incident link to
194
J. Chalopin et al.
the black hole. The algorithm sketched below ensures that exactly one leader agent falls into the black hole from each side while performing Paired Walk. Algorithm BHS-Ring-2: During the algorithm, an agent a performs the following actions. 1. Agent a puts a token and moves left until the next node with a token (state CHECK-LEFT) and then returns to its homebase v (state GO-BACK) and puts its second token. 2. If there are no other agents at v, the agent moves left until it reaches a node containing exactly one token (state ALONE) and then waits for other agents arriving at this node (state WAITING). 3. Otherwise, if there is a WAITING (or ALONE) agent b at node v, the agents a and b form a (LEADER, FOLLOWER) pair. 4. If an ALONE agent meets a WAITING agent (and there are no other agents), they form a (LEADER, FOLLOWER) pair. 5. A LEADER agent performs Paired Walk until it falls into the black hole or it sees a link marked dangerous. In the latter case it moves to the gate node (state SEARCHER) and participates in Paired Walk in the other direction (state RIGHT-FOLLOWER). 6. A FOLLOWER agent performs Paired Walk until the corresponding leader falls into the black hole or they see a link marked dangerous. In the former case, the agent (state RIGHT-LEADER) moves to the gate node and waits for a partner to start Paired Walk in the other direction. 7. When a WAITING agent a meets a RIGHT-LEADER, agent a becomes a RIGHT-FOLLOWER and participates in the Paired Walk. 8. The algorithm has some additional rules to ensure that no two LEADERs are created at the same node at the same time. No agent becomes a LEADER if there is already another LEADER at the same node (In this case, the agent become a SEARCHER and eventually a RIGHT-FOLLOWER when it reaches the gate node). When the algorithm BHS-Ring-2 is executed by four or more agents starting from distinct locations, the following properties hold: – Exactly one CHECK-LEFT agent falls into the black hole. – There is at least one LEADER agent and each LEADER has exactly one FOLLOWER. – No two LEADER agents are created at the same time on the same node and thus, two LEADERs can not reach the black hole at the same time. – There is exactly one RIGHT-LEADER agent and it falls into the black hole through the edge on the left side of the black hole. – An agent in any state other than CHECK-LEFT, LEADER, or RIGHTLEADER, never enters the black hole. Theorem 6. Algorithm BHS-Ring-2 correctly solves the black hole search problem in any oriented ring with 4 or more agents having constant memory and carrying two unmovable tokens each.
Tight Bounds for Scattered Black Hole Search in a Ring
5.2
195
Unoriented Rings
For unoriented rings, we need at least 5 agents with two unmovable tokens each. The algorithm for unoriented rings with unmovable tokens is similar to the one for oriented rings, except that each agent chooses an orientation. When two agents meet and one has to follow the other, we assume that the state of the agent contains information about the orientation of the agent (i.e., the port at the current node considered by the agent to be Left ). Thus, when two agents meet at a node, one agent (e.g. the Follower) can orient itself according to the direction of the other agent (e.g. the Leader). Algorithm BHS-Ring-3: Each agent puts one token on its homebase, goes on its left until it sees another token and then returns to its homebase. Now the agent goes on its right until it sees a token and then returns again to the homebase. The agent now puts its second token on its homebase. During this operation exactly two agents will fall into the black hole. Each surviving agent walks to its left until it sees a node u with a single token. At this point the agent has to wait, since either there is a black hole ahead, or u is the homebase of an agent b that has not returned yet to put its second token. It may happen that two agents arrive at node u at the same time from opposite directions. In this case, both agents can wait until another agent arrives. Note that in this case, the ring is safe on both directions until the next homebase and thus, an agent b (whose homebase is u) would arrive within a finite time. When agent b arrives, only one of the waiting agents (the one having the same orientation as b) changes to state LEADER and pairs-up with agent b. A similar case occurs when an agent a is waiting and two agents (both ALONE) arrive from different directions. Among these two agents, the one having the same orientation as agent a pairs up with agent a and starts the Paired Walk procedure. As before there can be multiple leader-follower pairs performing Paired Walk in different parts of the ring. Note that no two LEADERs can be created at the same node at the same time. Thus, two LEADERs may not enter into the black hole at the same time from the same direction. After the first LEADER enters the black hole from one direction, the corresponding FOLLOWER agent marks the link as a dangerous link and thus, no other agents enter the black hole from the same direction. We ensure that each LEADER agent has exactly one FOLLOWER agent. When the LEADER agent falls into the black hole, the corresponding FOLLOWER agent becomes the RIGHT-LEADER. The objective of the RIGHTLEADER is to discover the other link incident to the black hole. The RIGHTLEADER agent moves to the other end of the ring until the node with one token. Since we assume there are at least five agents, there must be either an unpaired agent at one of the gates or, there must be another (LEADER, FOLLOWER) pair that has already detected and marked the other link leading to the black hole. If the RIGHT-LEADER does not find a RIGHT-FOLLOWER at the first gate, it performs a slow walk to the other gate and returns again to the former
196
J. Chalopin et al.
gate. During the slow walk, it moves at one-third the speed of any other agent (i.e., waits two steps after each move). This ensures that it will meet another agent in at least one of the two gates. These two agents now starts the Paired Walk procedure in the other direction. The following properties can be verified: 1. Exactly two agents fall into the black hole before placing their second token. 2. There is at least one LEADER and each LEADER has a corresponding FOLLOWER. 3. There is either one or two RIGHT-LEADER agents (with opposite orientations). 4. At most one LEADER or RIGHT-LEADER enters the black hole from each direction. 5. An agent in any other state never enters the black hole after placing its second token. Due to the above properties, we know that at most 4 agents may fall into the black hole. We now show that both links to the black hole are actually discovered and marked as dangerous, during the algorithm. Theorem 7. Algorithm BHS-Ring-3 correctly solves the black hole search problem in unoriented ring with 5 or more agents having constant memory and carrying two unmovable tokens each.
6
Conclusions
In this paper, we solved the scattered BHS problem using the optimal number of agents and the optimal number of tokens per agent, while requiring only constant-size memory. Thus, all resources used by our algorithms are independent of the size of the network. Further, all the algorithms presented in the paper have a time complexity of O(n) steps, so, they are asymptotically time-optimal for BHS in a ring. The results of this paper show that the constant memory limitation has no influence on the resource requirements since the (matching) lower bounds hold even if the agents have unlimited memory. It would be interesting to investigate if similar tight results hold for BHS in other network topologies. We would also like to investigate the difference between ‘pure’ and ‘enhanced’ token model in terms of the minimum resources necessary for black hole search in higher degree networks.
References 1. Chalopin, J., Das, S., Labourel, A., Markou, E.: Tight bounds for black hole search with scattered agents in synchronous rings. ArXiv Preprint (arXiv:1104.5076v1) (2011) 2. Chalopin, J., Das, S., Santoro, N.: Rendezvous of mobile agents in unknown graphs with faulty links. In: Pelc, A. (ed.) DISC 2007. LNCS, vol. 4731, pp. 108–122. Springer, Heidelberg (2007)
Tight Bounds for Scattered Black Hole Search in a Ring
197
3. Cooper, C., Klasing, R., Radzik, T.: Searching for black-hole faults in a network using multiple agents. In: Shvartsman, M.M.A.A. (ed.) OPODIS 2006. LNCS, vol. 4305, pp. 320–332. Springer, Heidelberg (2006) 4. Czyzowicz, J., Dobrev, S., Kralovic, R., Miklik, S., Pardubska, D.: Black hole search ˇ in directed graphs. In: Kutten, S., Zerovnik, J. (eds.) SIROCCO 2009. LNCS, vol. 5869, pp. 182–194. Springer, Heidelberg (2010) 5. Czyzowicz, J., Kowalski, D., Markou, E., Pelc, A.: Complexity of searching for a black hole. Fundamenta Informaticae 71(2,3), 229–242 (2006) 6. Dobrev, S., Flocchini, P., Kralovic, R., Prencipe, G., Ruzicka, P., Santoro, N.: Optimal search for a black hole in common interconnection networks. Networks 47(2), 61–71 (2006) 7. Dobrev, S., Flocchini, P., Kralovic, R., Santoro, N.: Exploring a dangerous unknown graph using tokens. In: Proceedings of 5th IFIP International Conference on Theoretical Computer Science, pp. 131–150 (2006) 8. Dobrev, S., Flocchini, P., Prencipe, G., Santoro, N.: Searching for a black hole in arbitrary networks: Optimal mobile agents protocols. Distributed Computing 19(1), 1–19 (2006) 9. Dobrev, S., Flocchini, P., Prencipe, G., Santoro, N.: Mobile search for a black hole in an anonymous ring. Algorithmica 48, 67–90 (2007) 10. Dobrev, S., Kralovic, R., Santoro, N., Shi, W.: Black hole search in asynchronous rings using tokens. In: Calamoneri, T., Finocchi, I., Italiano, G.F. (eds.) CIAC 2006. LNCS, vol. 3998, pp. 139–150. Springer, Heidelberg (2006) 11. Dobrev, S., Santoro, N., Shi, W.: Scattered black hole search in an oriented ring using tokens. In: Proceedings of IEEE International Parallel and Distributed Processing Symposium, pp. 1–8 (2007) 12. Dobrev, S., Santoro, N., Shi, W.: Using scattered mobile agents to locate a black hole in an un-oriened ring with tokens. International Journal of Foundations of Computer Science 19(6), 1355–1372 (2008) 13. Flocchini, P., Ilcinkas, D., Santoro, N.: Ping pong in dangerous graphs: Optimal black hole search with pure tokens. In: Taubenfeld, G. (ed.) DISC 2008. LNCS, vol. 5218, pp. 227–241. Springer, Heidelberg (2008) 14. Flocchini, P., Kellett, M., Mason, P., Santoro, N.: Map construction and exploration by mobile agents scattered in a dangerous network. In: Proceedings of IEEE International Symposium on Parallel & Distributed Processing, pp. 1–10 (2009) 15. Klasing, R., Markou, E., Radzik, T., Sarracco, F.: Hardness and approximation results for black hole search in arbitrary graphs. Theoretical Computer Science 384(2-3), 201–221 (2007) 16. Kosowski, A., Navarra, A., Pinotti, C.: Synchronization helps robots to detect black holes in directed graphs. In: Proceedings of 13th International Conference on Principles of Distributed Systems, pp. 86–98 (2009) 17. Kr` alovic, R., Mikl`ık, S.: Periodic data retrieval problem in rings containing a malicious host. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 156–167. Springer, Heidelberg (2010) 18. Shannon, C.E.: Presentation of a maze-solving machine. In: Proceedings of 8th Conference of the Josiah Macy Jr. Found (Cybernetics), pp. 173–180 (1951) 19. Shi, W.: Black hole search with tokens in interconnected networks. In: Guerraoui, R., Petit, F. (eds.) SSS 2009. LNCS, vol. 5873, pp. 670–682. Springer, Heidelberg (2009)
Improving the Optimal Bounds for Black Hole Search in Rings Balasingham Balamohan1, Paola Flocchini1 , Ali Miri2 , and Nicola Santoro3 1
University of Ottawa, Ottawa, Canada {bbala078,flocchin}@site.uottawa.ca 2 Ryerson University, Toronto, Canada
[email protected] 3 Carleton University, Ottawa, Canada
[email protected]
Abstract. In this paper we re-examine the well known problem of asynchronous black hole search in a ring. It is well known that at least 2 agents are needed and the total number of agents’ moves is at least Ω(n log n); solutions indeed exist that allow a team of two agents to locate the black hole with the asymptotically optimal cost of Θ(n log n) moves. In this paper we first of all determine the exact move complexity of black hole search in an asynchronous ring. In fact, we prove that 3n log3 n − O(n) moves are necessary. We then present a novel algorithm that allows two agents to locate the black hole with at most 3n log3 n + O(n) moves, improving the existing upper bounds, and matching the lower bound up to the constant of proportionality. Finally we show how to modify the protocol so to achieve asymptotically optimal time complexity Θ(n), still with 3n log3 n + O(n) moves; this improves upon all existing time-optimal protocols, which require O(n2 ) moves. This protocol is the first that is optimal with respect to all three complexity measures: size (number of agents), cost (number of moves) and time; in particular, its cost and size complexities match the lower bounds up to the constant.
1
Introduction
1.1
The Problem
In this paper we re-examine the problem of locating a black hole in a ring network. A black hole (Bh) is a network node where any incoming agent disappears without leaving any signs of destruction. The Black Hole Search (Bhs) problem is a multi-agents search problem: a team of (identical) cooperating computational mobile entities, the agents, must determine the location of the black hole; the problem is solved if at least one agent survives and all surviving agents know the location of the black hole within finite time.
This work has been partially supported by NSERC Discovery program and by Dr. Flocchini’s University Research Chair.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 198–209, 2011. c Springer-Verlag Berlin Heidelberg 2011
Improving the Optimal Bounds for Black Hole Search in Rings
199
The algorithmic goal when solving the problem is to minimize the size of the team (i.e., the number of agents), the cost of the search (i.e., the number of moves performed by the agents) and, possibly, the time1 , spent in the search. We consider the problem when the graph is a ring, the agents are asynchronous (and identical); and each node in the ring provides a whiteboard, a local memory that can be shared (in fair mutual exclusion) by the agents present there. The agents start from the same safe node, the homebase; at least one agent must survive and, within finite time, all surviving agents must know the location of the black hole. It is known that, under these conditions, any algorithmic solution must employ at least 2 agents, and that the total number of moves performed by agents during the search is Ω(n log n) where n is the size of the ring [12]. Indeed size- and costoptimal protocols exist, allowing 2 agents to locate the black hole with Θ(n log n) moves in the worst case [12, 14]; in particular the cost complexity M(n) of Bhs by the two agents in a ring of n nodes is 2n log2 n ≥ M(n) ∈ Ω(n log n) It is also known that any asynchronous solution requires at least Ω(n) time in the worst case [12], and it has been shown that such a bound can be achieved at a cost of O(n2 ) moves using n agents. The number of agents has been recently reduced to 2, but the number of moves is still quadratic [1]. 1.2
Main Contributions
In this paper we establish the exact cost complexity of the black hole search problem for rings; we also present the first protocol that, unlike all existing ones, is optimal with respect to all three main complexity measures: size, cost and time. More precisely, the contributions of the paper are as follows. We first of all improve the lower bound on M(n) showing that 3n log3 (n) − O(n) moves are necessary for locating the black hole. We then design a protocol that allows two agents to solve Bhs, and show that the agents perform at most 3n log3 n + O(n) moves in the worst case, improving the existing upper bound of [12], and matching the lower bound also in terms of the constant. Our improvements are based on non-trivial but surprisingly simple ideas: the new lower bound is based on establishing the precise conditions necessary for using the absence of messages on a whiteboard to convey information, the new upper bound is based on communicating using absence messages for a better division of the work between the two agents. These two results together prove that M(n) = 3n log3 n ± O(n) We then focus on time and we show that asymptotically optimal ideal time can be achieved by two agents; in fact we present an algorithm for a team of two agents running in of O(n) time; the algorithm achieves optimality also in 1
Measured as usual assuming unitary delays.
200
B. Balamohan et al.
terms of number of moves, which are 3n log3 n+ O(n). Our solution improves the existing results of [12,1] which use a quadratic number of moves. In other words, we present a protocol that, unlike all existing ones, is optimal with respect to all three main complexity measures: size, moves and time; in particular, its move and size complexities match the lower bound exactly. 1.3
Related Work
The black hole search problem has been originally studied in ring networks [12] and has been extensively investigated in various settings since then. The main distinctions made in the literature are whether the system is synchronous or asynchronous, and whether the agents communicate through whiteboards or by using tokens. The majority of the work focuses on the asynchronous whiteboard model, which is the one also studied in this paper. A complete characterization has been done for the localization of a single black hole in a ring [12]. In [10], arbitrary topologies have been considered and asymptotically (size and cost) optimal algorithms have been proposed under a variety of assumptions on the agents’ knowledge (knowledge of the topology, presence of sense of direction). An algorithm with improved cost when the topology is known has been described in [11], while (size and cost) optimal algorithms for common interconnection networks have been studied in [8]. In [16] the effects of knowledge of incoming link on the optimal team size has been studied and lower bounds provided. The case of black links in arbitrary networks has been studied in [2, 15], respectively for anonymous and non-anonymous nodes. Black hole search in directed graphs has been investigated for the first time in [5], where it is shown that the requirements in number of agents change considerably. A variant of dangerous node behavior has been studied in [20], where the authors introduce black holes with Byzantine behavior and consider the periodic ring exploration problem. Locating and repairing black hole is studied in [4]. In asynchronous settings, a variation of the model where communication among agents is achieved by placing tokens on the nodes, has been investigated in [9, 13, 21]. In synchronous networks, where movements are synchronized and it is assumed that it takes one unit of time to traverse a link, the techniques and the results are quite different. Tight bounds on the number of moves have been established for some classes of trees [7]. In the case of general networks finding the optimal strategy is shown to be NP-hard [6, 17] and approximation algorithms are given in [17, 18]. The problem of locating a black hole in synchronous networks with directed links has been studied in [19], while the case of multiple black holes has been investigated in [3] where a lower bound on the cost and close upper bounds are given.
2
Definitions and Basic Techniques
The network environment is a ring R of n anonymous nodes (for simplicity indicated as 0, 1, · · · , n − 1 in clockwise direction). Each node has two ports, labelled left and right. Without loss of generality we assume that this labeling is
Improving the Optimal Bounds for Black Hole Search in Rings
201
globally consistent and the ring is oriented (if it is not the case, orientation can be easily obtained). Each node is equipped with a limited amount of storage, called whiteboard. For all our algorithms O(log n) bits of storage are sufficient In this network there is a set of anonymous (i.e., identical) mobile agents, which are all initially located on the same node, called the homebase (w.l.g. node 0). The topology is known to the agents, as well as the number of nodes (as shown in [12] not knowing the number of nodes makes the location process impossible). The agents can move from node to neighboring node in R and have computing capabilities and bounded storage. The agents obey the same set of behavioral rules, the protocol, and all their actions are performed asynchronously, i.e., they take a finite but unpredictable amount of time. The agents communicate by writing on and reading from the whiteboards. Access to the whiteboards is governed by fair mutual exclusion. A black hole (Bh) is a stationary process located at a node, which destroys any agent arriving at the node; no observable trace of such a destruction will be evident external to the node in which the black hole is located. The Black Hole Search problem is the one of finding the location of the black hole. The problem is solved if at least one agent survives, and all surviving agents know the location of the black hole within finite amount of time. The efficiency of a solution protocol is evaluated based on the following measures: - size: number of agents used/needed in the protocol; - cost: number of moves performed in total by the agents; - time: amount of ideal time; that is number of time units from start to termination in a synchronous execution with unitary delays; i.e., assuming that it takes one time unit for an agent to traverse a link. We now recall the cautious walk technique, which is central to the algorithms presented in this paper, and the existing asymptotically optimal algorithm of [12]. At any time during the search for the black hole, the ports (corresponding to the incident links) of a node can be classified as follows: unexplored: if no agent has moved across this port; safe: if an agent arrived via this port; active: if an agent departed via this port, but no agent has arrived via it. Cautious walk is defined by the following two rules: Rule 1. when an agent moves from node u to v via an unexplored port (turning it into active), if v is not the black hole, the agent immediately returns to u (making the port safe), and only then goes back to v to resume its execution; Rule 2. no agent leaves via an active port. Dobrev et al. [12] use this technique of cautious walk to solve the black hole search problem in the ring with an asymptotically optimal number of moves. We now give a short description of their algorithm, which employs two agents (which is clearly size optimal). The agents (r and l) divide the unexplored area into two connected disjoint roughly equal segments. Agent r cautiously explores the right segment while agent l cautiously explores the left segment. One of the agents (say r) successfully completes the exploration and moves to the last explored node by the other agent (the one with an active port); the idea is now to divide the unexplored areas into two almost equal parts so to reassign the workload
202
B. Balamohan et al.
to be shared by r and l. Agent r leaves a message for l with the information about the new segments to be explored. The algorithm continues and the agents perform 2n log2 n moves, which is optimal in order of magnitude, as the authors prove a lower bound of Ω(n log n).
3 3.1
Exact Bounds on Cost of Black Hole Search Improved Lower Bound
We establish the lower bound by describing a game between an adversary and any algorithm solving the black hole search, which will force an execution of the algorithm in which the agents will perform at least the number of moves given by Theorem 1 below. The lower bound is established for algorithms using two agents. The result can be easily generalized to the case of more agents. The adversary has the power to: - block a port for a finite time- the corresponding link becomes very slow, effectively blocking all the agents traversing it; - unblock a blocked port - the agents in transit on the corresponding link will then arrive to their destination; - choose which agents will move, if there is a choice; - decide where the black hole is located in the unexplored area. Any agent exiting through or in transit on a blocked port will be said to be blocked. The adversary can block any port at any time; however, within finite time, it must unblock any blocked port not leading to the black hole. In the following we assume, without loss of generality, that the right agent (called r) consistently explores the right side of the explored area, while the left agent l explores the left side. The following definition is from [12]. Definition 1. We say that an agent executes a causal chain of length d− 1 from node u to node v at time t, if there are nodes u1 , u2 , ..., ud and times t < t1 < t1 < t2 < t2 ...td < td such that u1 = u, ud = v, (uj , uj+1 ) is a link and the agent leaves uj at time tj and reaches uj+1 at time tj for all 0 < j < d. Definition 2. Let an agent execute two causal chains c1 at time t and c2 at time s, composed, respectively, by nodes u1 , u2 , ..., ud at times t < t1 < t1 < t2 < t2 ...td < td , and by nodes w1 , w2 , ..., wd at times s < s1 < s1 < s2 < s2 ...sd < sd . We say, that c1 and c2 coincide at link (v, v ) if and only if there exists ui = v, ui+1 = v and wj = v, wj+1 = v such that ti = sj and ti = sj . The following lemma is a simple refinement and extension of Lemma 3 of [12]. Lemma 1. Let E and U be the the sets of explored and unexplored nodes at time t, with |U | > 2; then, in every execution of any solution algorithm P: 1. Within finite time from t at least one agent will have left the explored area Et in each direction, agent r from node x ∈ E to the right, and agent l from node y ∈ E to the left. 2. Consider two ways of extending the execution: (E1 ) agent r is blocked and l is let to explore; (E2) agent l is blocked and r is let to explore. Then for every
Improving the Optimal Bounds for Black Hole Search in Rings
203
node z in the unexplored area U , there is a node w in the explored area such that both conditions hold: - agent l has not explored z and has executed a causal chain to w from the last node it explored at some time t > t in execution E1. - agent r has not explored z and has executed a causal chain to w from the last node it explored at some time t > t in execution E2. Theorem 1. The worst-case complexity M(n) for solving Bhs using two agents on a ring with n nodes satisfies the following: M(n) ≥ 3n log3 n − O(n) Proof. Given a ring where some contiguous area E (including and possibly consisting just of the homebase) is already explored, let U denote the unexplored area. Any algorithm P solving the black hole search problem must obviously be able to solve the problem in such a ring, regardless of the size and choice of U . Let P (s) be the following predicate: The cost MP (s, n) of locating a black hole with algorithm P in a ring for any U and E with s = |U | and |E| = n − s, is MP (s, n) ≥ f (s, n) = 3n log3 (s) − 6s − 2n. We will prove the theorem by showing that the predicate holds; the proof is by induction on the size s = |U | of the unexplored area. Basis. Both P (1) and P (2) hold since f (1, n) ≤ f (2, n) < 0. It is easy to verify that MP (3, n) ≥ n − 3 while MP (5, n) ≥ MP (4, n) ≥ 2(n − 4) > 3n log3 (5) − 24 − 2n > f (5, n) > f (4, n). It is also MP (7, n) ≥ MP (6, n) ≥ 4(n − 6) > 3n log3 (7) − 42 − 2n > f (7, n) > f (6, n). Hence P (s) holds for 1 ≤ s ≤ 7. Induction Step. Let q ≥ 8, and let P (j) be true for 1 ≤ j < q. Now we proceed to prove that P (q) holds. Let us denote by R and L the right q3 , left 3q nodes, respectively, of the unexplored area; and let us denote by C the remaining nodes ˆ and L ˆ the at the middle of the unexplored area. Additionally, let us denote by R q q right 2 and left 2 nodes, respectively, of the unexplored area (see Fig. 1). Consider an execution of protocol P in a ring where |U | = q. By Lemma 1, a finite time after the agents start the execution, they leave E in different directions. The adversary blocks both ports leaving the explored area until the C L
U
E
R
ˆ L
U
ˆ R
E
ˆ = q , |R| ˆ = q |U | = q, |E| = n − q, |L| = q3 , |R| = q3 , |L| 2 2 Fig. 1. The black square indicates the homebase, the bold line is the unexplored area U , the dotted line is the explored area E
204
B. Balamohan et al.
agents are both blocked in opposite directions; let l be blocked on the link from E to L and r on the link from E to R. The adversary at this point performs two “virtual executions” of the algorithm. In the first execution, E1, the adversary unblocks the link leading from E to R, leaving the link from E to L blocked. In the second execution, E2, it unblocks the link from E to L, and keeps the link from E to R blocked. Consider the following two scenarios based on those two executions. ˆ and l begins to explore S1. The agents communicate before r begins to explore L C. That is, in E1 agent r executes a causal chain to a node vr before it begins ˆ and in E2 agent l executes a causal chain to the same vr before it to explore L, begins to explore C. S2. The agents communicate before r begins to explore C and l begins to ˆ That is, in E2 agent l executes a causal chain to a node vl before it explore R. ˆ and in E1 agent r executes a causal chain to vl before it begins to explore R, begins to explore C. We now consider the three possible cases that can occur with respect to scenarios S1 and S2 and we show that P (q) holds in all three cases. Case 1: Neither scenario S1 nor S2 occurred. Case 2: Both scenarios S1 and S2 occurred and there is at least one node simultaneously satisfying the definitions of both vr and vl . Case 3: Neither Case 1 nor Case 2 occur. Due to the lack of space, we only present the proof for Case 1. Case 1: Neither scenario S1 nor S2 occurred. By Lemma 1, there must exist two causal chains c1 and c1 , by r and l respectively, to a common node in the explored area before (in E1) agent r starts ˆ and (in E2) agent l starts exploring R. ˆ There must also be two causal exploring L chains c2 and c2 , by r and l respectively, to a common node in the explored area before (in E1) agent r starts exploring L and (in E2) agent l starts exploring C. As well as two causal chains c0 (by r in E1 before it begins to explore C) and c0 (by l in E2 before it begins to explore R). Observe now that, since scenarios S1 and S2 did not occur, the chains c0 , c1 and c2 do not coincide in any link; similarly, also c0 , c1 and c2 do not coincide in any link. In fact if r’s causal chains c1 and c2 coincide in an edge then they coincide on all the edges of c2 or of c1 ; hence, there would be at least a node in the explored area visited by both agents that satisfies the definition of vr for scenario S1, contradicting the assumptions that S1 did not occur. Similarly for c2 and c0 , as well as for c0 and c1 ; by symmetry, similar assertions holds for the causal chains of l. Now the adversary can force the cost of the algorithm to be at least the average of the costs of the two independent executions E1 and E2, by forcing the most expensive of the two. In execution E1, agent l is kept blocked and r is allowed to execute causal chains c0 , c1 and c2 . In execution E2, agent r is kept blocked and l is allowed to execute causal chains c0 , c1 and c2 . Let a and a be the number of moves made by r the l, respectively, in their three causal chains.
Improving the Optimal Bounds for Black Hole Search in Rings
205
The six causal chains c0 , c1 , c2 , c0 , c1 , c2 all together constitute at least 3|E| = 3(n − q) moves. With the cost of returning, at least 6(n − q) moves are performed in these chains in both executions; that is, a + a ≥ 6(n − q). After the chains are executed, the size of the still unexplored area U is at least a third of that at the beginning; that is |U | ≥ q3 . This means that, in both cases, when the agent returns to explore, by induction hypothesis, the adversary has a schedule to force further M ( q3 , n) moves. In fact, the cost of the two executions will be MP (q, n) ≥ a + MP ( q3 , n) and MP (q, n) ≥ a + MP ( q3 , n). The adversary, by choosing the costliest of the two expressions, can force at least the average cost of the two executions. Hence we have: MP (q, n) ≥ q q 1 1 2 (a + a + 6n log3 ( 3 ) − 4q − 4n) ≥ 2 (6(n − q) + 6n log3 ( 3 ) − 4q − 4n) ≥ 3n log3 (q) − 5q − 2n, and thus predicate P (q) holds. Let us point out that Lemma 1 can be easily generalized so that the lower bound of Theorem 1 holds regardless of the number k ≥ 2 of agents used by a solution algorithm. Algorithm 1. Algorithm Trisect Two co-located agents l and r with E0 = {vh }, U0 = V − E0 . At Stage i (starting with i = 1): 1. Agent l cautiously explores Li−1 , i.e. the left most (|Ui−1 |)/3| nodes of the unexplored area, and returns to the homebase of Ei−1 . 2. Agent r cautiously explores Ri−1 , i.e., the right most (|Ui−1 |)/3 nodes of the unexplored area and returns to the homebase of Ei−1 . 3. The agent accessing the homebase whiteboard first (say l) leaves a message indicating that it is going to explore the middle (1/3)rd of the unexplored area Ci−1 . 4. Agent r (if it reaches the homebase) reads the message and travels until reaching the last node explored by l. It leaves an update message for agent l to divide again in three parts the unexplored area so that both agents agree on: explored area Ei , unexplored area Ui , and new homebase (chosen to be the center of Ei ). 5. Agent l, if agent r has not left a message for it in stage i, when it finishes exploring Ci−1 , travels until reaching the last node explored by r. It leaves a message for agent r at the last explored node at r’s side to divide again in three parts the unexplored area so that both agents agree on: explored area Ei , unexplored area Ui , and new homebase (chosen to be the center of Ei ). 6. If Ui is a singleton, the surviving agent terminates; otherwise, each surviving agent proceeds to stage i + 1.
3.2
Matching Upper Bound
We now describe an algorithm whose cost matches the lower bound up to the multiplicative constant. The algorithm is still based, as in [12], on the idea of recursively dividing the workload between the agents selecting disjoint unexplored areas; in this case however, the unexplored area is divided into three parts of roughly equal size (L,R,C). The two co-located agents are initially assigned two
206
B. Balamohan et al.
of those parts (L and R) and either one or both (depending on the location of the black hole) will eventually complete the task. The first agent completing its part will take care of C leaving a note for the other in the homebase. Note that the location of the homebase is dynamic and it consists of the central node of the current explored area. The second agent (if it returns) will reach the first and divide again the unexplored area in three parts. The algorithm continues until the unexplored area contains a single node. The details of algorithm Trisect to locate the black hole using two mobile agents is reported in Algorithm 1, where Ei and Ui denote the explored and unexplored areas at step i. In the following we assume, for simplicity, that the size of the unexplored area is always divisible by 3. If this is not the case, the algorithm would work in the same way employing the appropriate rounding operations. Theorem 2. Algorithm Trisect solves Bhs using two agents perforning 3n log3 n + O(n) moves in the worst case.
4
Optimizing Also Ideal Time
Dobrev et al. [12] have shown that the worst case ideal time complexity for solving the black hole problem in the ring is at least 2(n − 2), regardless of the number of agents employed. However, their time-optimal protocol requires O(n) agents and O(n2 ) moves. Recently, we have shown that an asymptotically optimal Θ(n) bound can be achieved using only 2 agents [1]; the number of moves is however still O(n2 ). We now describe the first protocol that is optimal simultaneously in all three complexity measures: asymptotically in time, and exactly in cost and size. The idea behind the new algorithm Optimal is to combine Algorithm 1 (Trisect), with another algorithm (Big-Small) which we describe subsequently. The main principle of the Big-Small algorithm is to have the agents play asymmetric roles. The unexplored area is in fact divided into two parts of different sizes to which agents are assigned: one part containing a single node and the other containing all other unexplored nodes. In the following we say that the agent assigned to the small area is small and the other is big. Whenever the big agent returns after completing its task, the black hole is obviously located, being the only node under exploration by the small agent. On the other hand, if the small agent returns, the task might not be completed and another stage might be needed. Algorithm Optimal consists of a preliminary phase resembling algorithm Trisect where the unexplored area is divided in three portions (L, C, and R) and the two agents start exploring L and R. When one of them returns to the homebase, it takes charge of C after leaving a message for the other agent. Within finite time, one of the two agents will complete exploring the assigned region. At this point the execution of (at most three stages of) Big-Small starts. After this execution, if the black hole is not located yet, the algorithm continues following the rules of Trisect. When we say that an agent acts as small we mean that it cautiously explores the first node in its direction (i.e., right if r, left if l) of the
Improving the Optimal Bounds for Black Hole Search in Rings
207
Algorithm 2. Algorithm Optimal Initially: two co-located agents l and r . E = E0 = {vh }. U = U0 = V − E. Phase 0 (Preliminary Phase): Agent l cautiously explores L0 , i.e. the leftmost (|U0 |)/3 nodes of the unexplored area and returns to the homebase. Agent r cautiously explores R0 , i.e. the right most (|U0 |)/3 nodes of the unexplored area and returns to the homebase. The agent finishing the exploration first (say l ) leaves a message at homebase that it is exploring the middle (1/3)rd nodes (C0 ). /* at this point the two agents are exploring two disjoint areas: C0 and either L0 or R0 . */ Phase 1 (Big-Small Phase) (Stage 1) The first agent that completes its assigned exploration, say r, moves to the last explored node on agent l’s side, it leaves an update message to l indicating to become big. Agent r then moves to its side and acts as small (i.e., it cautiously explores the first unexplored node on its side). If/when l finds the message, it acts as big (i.e., it cautiously explores all but the last unexplored nodes on its side). If the big agent l completes its work, then the black hole is located and the algorithm terminates. (Stage 2) Otherwise, the small agent r, after exploring the assigned node, moves to the last explored node on agent l’s side, and leaves an update message for l indicating to start the second stage in the same role (big). Agent r moves then back to its side, again acting as small. If/when l finds the message, it updates the assigned area and starts the second stage as big. If the big agent l completes its work, then the black hole is located and the algorithm terminates. (Stage 3) Otherwise, the small agent r, after exploring the assigned node, it moves to the last explored node on l’s side, it leaves an update message for l. Agent r then moves to the other side and it changes role acting now as big. If r completes its work, then the black hole is located and the algorithm terminates. If/when agent l finds the update message, it moves to agent r’s side and leaves an update message to r indicating to perform algorithm Trisect on the new unexplored area. /* at this point one agent start Trisect, the other (if still alive) will join */ Phase i (Trisect Phase) Agent l starts to perform trisect. If/when r finds the message, r joins l and they perform Trisect together.
208
B. Balamohan et al.
unexplored area. When an agent acts as big it cautiously explores in its direction all but the last node of the unexplored area. As in Trisect, the location of the homebase in the various steps of the algorithms is variable and it is always the central node of the current explored area. An update message contains the update information about the current unexplored area and the current location of the homebase. The details are given in Algorithm 2. Theorem 3. Algorithm Optimal solves the black hole search in ideal time Θ(n) using 2 agents and performing 3n log3 n + O(n) moves. Proof. (Sketch) After the end of phase 0, at least an agent, say r, survives and returns. During phase 1, in the first stage of Big-Small, agent r becomes small, l becomes big, and they divide the area to be explored into two disjoint segments. If the big agent l returns, the problem is solved. If the small agent r returns, the unexplored area is again divided into two disjoint segments and the second stage of Big-Small is started, with the right agent r being small again. Also in this stage, if the big agent l returns, the black hole is located. If the small agent r returns, the third and final stage of Big-Small is started in which r becomes big. If r returns the black hole is located. If l returns, it goes to the other end, leaves a message to notify to begin Algorithm Trisect, updating the new explored and unexplored areas. Correctness in the subsequent execution follows from the correctness of algorithm Trisect. Hence, algorithm Optimal solves the black hole search problem. We first observe that when the first stage of Big-Small begins, the size of the explored area is at least 23 n. For the big agent l to complete its exploration (assuming it does not die before) it would take 3 n3 = n moves and time because each link is traversed with cautious walk. That is, by that time, in a synchronous execution, if l does not die, it has discovered the black hole. Agent r, if it does not disappear in the black hole during its exploration as small, performs two stages as small traversing the explored area back and forth twice and thus making at least 83 n moves and spending the same amount of time. This means that, since 83 n > n, if r successfully completes its two stages as small and starts the third stage as big, in a synchronous execution agent l must have died by that time; hence the algorithm terminates within an additional O(n) time units. Summarizing, within O(n) time steps, either r dies in the black hole within the first two stages as small, and l discovers the black hole while big, or l dies in the black hole and r discovers it while big in the third stage of Big-Small. Since the agents perform Trisect except for the Big-Small phase which costs O(n) moves, the overall number of moves is 3n log3 n + O(n).
References 1. Balamohan, B., Flocchini, P., Miri, A., Santoro, N.: Time optimal algorithms for black hole search in rings. In: Wu, W., Daescu, O. (eds.) COCOA 2010, Part II. LNCS, vol. 6509, pp. 58–71. Springer, Heidelberg (2010) 2. Chalopin, J., Das, S., Santoro, N.: Rendezvous of mobile agents in unknown graphs with faulty links. In: Pelc, A. (ed.) DISC 2007. LNCS, vol. 4731, pp. 108–122. Springer, Heidelberg (2007)
Improving the Optimal Bounds for Black Hole Search in Rings
209
3. Cooper, C., Klasing, R., Radzik, T.: Searching for black-hole faults in a network using multiple agents. In: Shvartsman, M.M.A.A. (ed.) OPODIS 2006. LNCS, vol. 4305, pp. 320–332. Springer, Heidelberg (2006) 4. Cooper, C., Klasing, R., Radzik, T.: Locating and repairing faults in a network with mobile agents. Theor. Comput. Sci. 411, 1638–1647 (2010) 5. Czyzowicz, J., Dobrev, S., Kr´ alovic, R., Mikl´ık, S., Pardubsk´ a, D.: Black hole search ˇ in directed graphs. In: Kutten, S., Zerovnik, J. (eds.) SIROCCO 2009. LNCS, vol. 5869, pp. 182–194. Springer, Heidelberg (2010) 6. Czyzowicz, J., Kowalski, D.R., Markou, E., Pelc, A.: Complexity of searching for a black hole. Fundamenta Informaticae 71(2-3), 229–242 (2006) 7. Czyzowicz, J., Kowalski, D.R., Markou, E., Pelc, A.: Searching for a black hole in synchronous tree networks. Comb. Prob. & Comp. 16(4), 595–619 (2007) 8. Dobrev, S., Flocchini, P., Kr´ alovic, R., Ruzicka, P., Prencipe, G., Santoro, N.: Black hole search in common interconnection networks. Networks 47(2), 61–71 (2006) 9. Dobrev, S., Flocchini, P., Kr´ alovic, R., Santoro, N.: Exploring an unknown graph to locate a black hole using tokens. In: 5th IFIP Int. Conference on Theoretical Computer Science (TCS), pp. 131–150 (2006) 10. Dobrev, S., Flocchini, P., Prencipe, G., Santoro, N.: Searching for a black hole in arbitrary networks: Optimal mobile agents protocols. Distributed Computing 19(1), 1–19 (2006) 11. Dobrev, S., Flocchini, P., Santoro, N.: Improved bounds for optimal black hole search with a network map. In: Kralovic, R., S´ ykora, O. (eds.) SIROCCO 2004. LNCS, vol. 3104, pp. 111–122. Springer, Heidelberg (2004) 12. Dobrev, S., Flocchini, P., Santoro, N.: Mobile search for a black hole in an anonymous ring. Algorithmica 48, 67–90 (2007) 13. Dobrev, S., Kr´ alovic, R., Santoro, N., Shi, W.: Black hole search in asynchronous rings using tokens. In: Calamoneri, T., Finocchi, I., Italiano, G.F. (eds.) CIAC 2006. LNCS, vol. 3998, pp. 139–150. Springer, Heidelberg (2006) 14. Flocchini, P., Ilcinkas, D., Santoro, N.: Ping pong in dangerous graphs: optimal black hole search with pebbles. Algorithmica (2011) 15. Flocchini, P., Kellett, M., Mason, P., Santoro, N.: Map construction and exploration by mobile agents scattered in a dangerous network. In: 24th IEEE International Parallel and Distributed Processing Symposium (IPDPS), pp. 1–10 (2009) 16. Glaus, P.: Locating a black hole without the knowledge of incoming link. In: Dolev, S. (ed.) ALGOSENSORS 2009. LNCS, vol. 5804, pp. 128–138. Springer, Heidelberg (2009) 17. Klasing, R., Markou, E., Radzik, T., Sarracco, F.: Hardness and approximation results for black hole search in arbitrary networks. Theoretical Computer Science 384(2-3), 201–221 (2007) 18. Klasing, R., Markou, E., Radzik, T., Sarracco, F.: Approximation bounds for black hole search problems. Networks 52(4), 216–226 (2008) 19. Kosowski, A., Navarra, A., Pinotti, C.M.: Synchronization helps robots to detect black holes in directed graphs. In: Abdelzaher, T., Raynal, M., Santoro, N. (eds.) OPODIS 2009. LNCS, vol. 5923, pp. 86–98. Springer, Heidelberg (2009) 20. Kr´ alovic, R., Mikl´ık, S.: Periodic data retrieval problem in rings containing a malicious host. In: Patt-Shamir, B., Ekim, T. (eds.) SIROCCO 2010. LNCS, vol. 6058, pp. 157–167. Springer, Heidelberg (2010) 21. Shi, W.: Black hole search with tokens in interconnected networks. In: Guerraoui, R., Petit, F. (eds.) SSS 2009. LNCS, vol. 5873, pp. 670–682. Springer, Heidelberg (2009)
The Cover Times of Random Walks on Hypergraphs Colin Cooper1, , Alan Frieze2, , and Tomasz Radzik1, 1 2
Department of Informatics, King’s College London, London WC2R 2LS, UK {colin.cooper,tomasz.radzik}@kcl.ac.uk Department of Mathematical Sciences, Carnegie Mellon University, Pittsburgh PA15213, USA
[email protected]
Abstract. Random walks in graphs have been applied to various network exploration and network maintenance problems. In some applications, however, it may be more natural, and more accurate, to model the underlying network not as a graph but as a hypergraph, and solutions based on random walks require a notion of random walks in hypergraphs. At each step, a random walk on a hypergraph moves from its current position v to a random vertex in a randomly selected hyperedge containing v. We consider two definitions of cover time of a hypergraph H. If the walk sees only the vertices it moves between, then the usual definition of cover time, C(H), applies. If the walk sees the complete edge during the transition, then an alternative definition of cover time, the inform time I(H) is used. The notion of inform time models passive listening which fits the following types of situations. The particle is a rumor passing between friends, which is overheard by other friends present in the group at the same time. The particle is a message transmitted randomly from location to location by a directional transmission in an ad-hoc network, but all receivers within the transmission range can hear. In this paper we give an expression for C(H) which is tractable for many classes of hypergraphs, and calculate C(H) and I(H) exactly for random r-regular, s-uniform hypergraphs. We find that for such hypergraph whp C(H)/I(H) = Θ(s) for large s.
1
Introduction
The idea of a random walk on a hypergraph is a natural one. The particle making the walk picks a random edge incident with the current vertex. The particle enters the edge, and exits via a random endpoint, other then the vertex of entry. Two alternative definitions of cover time are possible for this walk. Either the particle sees only the vertices it visits, or it inspects all vertices of the hyperedge during the transition across the edge. A random walk on a hypergraph models the following process. The vertices of a network are associated into groups, and these groups define the edges of the
Supported in part by Royal Society International Joint Project JP090592. Supported in part by NSF grant CCF0502793.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 210–221, 2011. c Springer-Verlag Berlin Heidelberg 2011
The Cover Times of Random Walks on Hypergraphs
211
network. In the simplest case, the network is a graph so the groups are exactly the edges of the graph. In general, the groups may be larger, and represent friends, a family, a local computer network, or all receivers within transmission range of a directed transmission in an ad-hoc network. In this case the network is modeled as a hypergraph, the hyperedges being the group relationships. An individual vertex can be in many groups, and two vertices are neighbours if they share a common hyperedge. Within the network a particle (message, rumor, infection, etc.) is moving randomly from vertex to neighboring vertex. When this transition occurs all vertices in a given group are somehow affected (infected, informed) by the passage of the particle within the group. Examples of this type of process include the following. The particle is an infection passed from person to person and other family members also become infected with some probability. The particle is a virus traveling on a network connection in an intranet. The particle is a message transmitted randomly from location to location by a directional transmission in an ad-hoc network, and all receivers within the transmission range can hear. The particle is a rumor passing between friends, which may be overheard by other friends present in the group at the same time. Let H = (V (H), E(H)) be a hypergraph. For v ∈ V = V (H) let d(v) be the degree ofv, i.e. the number of edges e ∈ E = E(H) incident with v, and let d(H) = v∈V d(v) be the total degree of H. For e ∈ E, let |e| be the size of hyperedge e, i.e. the number of vertices v ∈ e, respecting multiplicity. Let N (v) be the neighbour set of v, N (v) = {w ∈ V : ∃e ∈ E, e ⊇ {v, w}}. We regard N (v) as a multi-set in which each w ∈ N (v) has a multiplicity equal to the number of edges e containing both v and w. A hypergraph is r regular if each vertex is in r edges, and is s-uniform if every edge is of size s. A hypergraph is simple if no edge contains a repeated vertex, and no two edges are identical. We assume a particle or message originated at some vertex u and, at step t, is moving randomly from a vertex v to a vertex w in N (v). We model the problem conceptually as a random walk Wu = (Wu (0), Wu (1), . . . , Wu (t), . . .) on the vertex set of hypergraph H, where Wu (0) = u, Wu (t) = v and Wu (t + 1) = w ∈ N (v). Several models arise for reversible random walks on hypergraphs. Assume that the walk W is at vertex v, and consider the transition from that vertex. In the first model (Model 1), an edge e incident with v is chosen proportional to |e| − 1. The walk then moves to a random endpoint of that edge, other than v. This is equivalent to v choosing a neighbour w u.a.r. (uniformly at random) from N (v), where vertex w is chosen according to its multiplicity in N (v). The stationary distribution of v in Model 1 is given by (|e| − 1) πv = e:v∈e . e∈E(H) |e|(|e| − 1) In the case of graphs this reduces to πv = d(v)/2m, where m is the number of edges in the graph. Alternatively (Model 2) when W is at v, edge e is chosen u.a.r. from the hyperedges incident with v, and then w is chosen u.a.r. from the vertices w ∈ e, w = v. The stationary distribution of v in Model 2 is given by
212
C. Cooper, A. Frieze, and T. Radzik
πv =
d(v)
u∈V (H)
d(u)
,
which corresponds to the familiar formula for graphs. If the hypergraph is uniform (all edges have the same size) then the models are equivalent. Random walks on graphs are a well studied topic, for an overview see e.g. [1,9]. Random walks on hypergraphs were used in [5] to cluster together electronic components which are near in graph distance for physical layout in circuit design. For that application, edges were chosen inversely proportional to their size, and then a random vertex within the edge was selected. A random walk model is also used for generalized clustering in [11]. As before, the aim is to partition the vertex set, and this is done via the Laplacian of the transition matrix. A paper which directly considers notions of cover time for random walks on hypergraphs is [3], where Model 2 is used. For a hypergraph H, we define the (vertex) cover time C(H), the edge cover time CE (H), and the inform time I(H). The (vertex) cover time C(H) = maxu Cu (H), where Cu (H) is the expected time for the walk Wu to visit all vertices of H. Similarly, the edge cover time CE (H) = maxu Cu,E (H), where Cu,E (H) is the expected time to visit all hyperedges starting at vertex u. Suppose that the walk Wu is at vertex v. Using e.g. Model 2, the walk first selects an edge e incident with v and then makes a transition to w ∈ e. The vertices of e are said to be informed by this move. The inform time I(H), introduced in [3] as the radio cover time, is the maximum over start vertices u, of the expected time at which all vertices of the graph are informed. More formally, let Wu (t) = (Wu (0), Wu (1), ..., Wu (t)) be the trajectory of the walk. Let e(j) be the edge used for the transition from W (j) to W (j + 1) at step j. Let Su (t) = ∪t−1 j=0 e(j) be the set of vertices spanned by the edges of Wu (t). Let I u be the step t at which Su (t) = V for the first time, and let I(H) = maxu E(I u ). We use the name “inform time” rather than “radio cover time” in [3] to indicate the relevance of this term beyond the radio networks. Several upper bounds on the cover time C(H) are readily obtainable, for example an analog of the O(nm) bound for graphs [2] based on a twice round the |e|spanning tree argument. For Model 1, replace each edge e by a clique of size 2 ) for connected hypergraphs. Here s2 to obtain an upper bound of O(nms 2 is the expected squared edge size ( e∈E(H) |e|2 )/m. Thus C(H) = O(n3 m). A better bound of O(nms) = O(n2 m) was shown in [3] for Model 2. Similarly, a Matthews type bound of O(log n · maxu,v E(H u,v )) on the cover time exists, where E(H u,v ) is the expected hitting time of v starting from u. We contribute a bound on the cover time of a hypergraph given in Theorem 1, which allows us to calculate C(H) for many classes of hypergraphs. To prove this bound, we first observe that E(H u,v ) = O(T + Eπ (H v )), where T is a suitable mixing time and Eπ (H v ) is the expected hitting time of vertex v from stationarity. Then we bound Eπ (H v ) and apply Matthews’ bound [10]. Theorem 1. Let H be connected and aperiodic with stationary distribution π. Let P denote the transition matrix for a random walk on H. Let T be a mixing
The Cover Times of Random Walks on Hypergraphs
213
(T )
time such that |Pu (v) − πv | ≤ πv for all u, v ∈ V , and suppose that max πv = o(1). For a walk starting from v, let Rv (T ) be the expected number of returns to v during T steps. Then Rv (T ) C(H) = log n · O T + max . (1) v πv This bound for C(H) can be evaluated for many classes of random hypergraphs. For example, for random r-regular, s-uniform hypergraphs G(n, r, s), and random s-uniform hypergraphs Gn,p,s where each edge occurs independently with probability p. Let r ≥ 2 and s ≥ 3 in G(n, r, s), and let p ≥ C log n/ n−1 s−1 in Gn,p,s , where C > 1. Then, whp, T = o(n), πv = Θ(1/n), and Rv (T ) = 1+O(1), so Theorem 1 implies that whp C(H) = O(n log n). The calculation of inform time I(H) seems more challenging. Avin et al. [3] show that Matthews’ bound extends to I(H): for any n-vertex hypergraph H, ˜ u,v )) ≤ I(H) ≤ O(log n · maxu,v E(H ˜ u,v ), where E(H ˜ u,v ) is the exmaxu,v E(H ˜ u,v ) is called pected time when vertex v is informed starting from vertex u (E(H the radio hitting time in [3]). For a random walk on an s-uniform hypergraph, in ˜ x,v ) steps, the walk traverses an edge containing v each period of 2 · maxx E(H with probability at least 1/2, so visits vertex v with probability at least 1/(2s). ˜ x,v )), implying that C(H) = O(s log n · I(H)). Hence E(H u,v ) = O(s · maxx E(H Thus the speed-up of the inform time over the cover time is O(s log n). Avin et al. [3] consider a special type of directed hypergraphs, called radio hypergraphs, and analyse I(H) on one- and two-dimensional mesh radio hypergraphs, which are induced by a cycle and a square grid on a torus, respectively. Their result for the two-dimensional √ √ mesh can be stated in the following way. For a random walk on a n × n grid such that in each step all vertices within distance k from the current vertex are informed and the walk moves to a random vertex in this k-neighbourhood, the inform time is I(H) = O((n/k2 ) log(n/k 2 ) log n). In this paper we calculate precisely C(H), I(H) and CE (H) for the case of simple random r-regular, s-uniform hypergraphs H. As far as we know, this is the first analysis of cover time and inform time for random walks on classes of general (undirected) hypergraphs. The proof of the following theorem is the main technical contribution of this paper. Throughout this paper “log” stands for the natural logarithm. Theorem 2. Suppose that r ≥ 2 and s ≥ 3 are constants and H is chosen u.a.r. from the set of all simple r-regular, s-uniform hypergraphs with n vertices. Then whp as n → ∞, 1 C(H) ∼ 1 + n log n, (r − 1)(s − 1) − 1 s−1 n I(H) ∼ 1 + log n, (r − 1)(s − 1) − 1 s − 1 s−1 rn CE (H) ∼ 1 + log n. (r − 1)(s − 1) − 1 s
214
C. Cooper, A. Frieze, and T. Radzik
Our proof of the above theorem also applies if s and/or r grow (slowly) with n. In particular, we have the following corollary. Corollary 1. If r ≥ 2, s → ∞, and (rs)4 log log log n = o(log n), then C(H) ∼ n log n
and
I(H) ∼
r n log n. r−1 s
Thus in this case, seeing s vertices at each step of the walk leads to an Θ(s) speed up in cover time. In the case of graphs, I(H) = C(H), and CE (H) ≥ C(H). For hypergraphs, clearly I(H) ≤ C(H). However there is the possibility that CE (H) ≤ C(H), as every edge can be visited without visiting every vertex. We must have I(H) ≤ CE (H) as a vertex is informed whenever the walk covers an edge containing that vertex. Indeed, intuitively we should have CE (H) about r times I(H), if every vertex has degree r. We note that our theorem gives CE (H) ∼ r ((s − 1)/s) I(H).
2
Proof of Theorem 1
To prove Theorem 1, we use the bound C(H) = O(log n · maxu,v E(H u,v )), the observation that E(H u,v ) = O(T + Eπ (H v )), and the bound on Eπ (H v ) in Lemma 1 below. The quantity Eπ (H v ), expected hitting time of a vertex v from the stationary distribution π, can be expressed as Eπ (H v ) = Zvv /πv , where Zvv =
∞
(Pv(t) (v) − πv ),
(2)
t=0
see e.g. [1]. For a walk Wv starting from v define Rv (T ) =
T −1
Pv(t) (v).
(3)
t=0
Thus Rv (T ) is the expected number of returns made by Wv to v during T steps, (0) in the hypergraph H. We note that Rv (T ) ≥ 1, as Pv (v) = 1. Lemma 1. Let T be a mixing time of a random walk Wu on H satisfying (T ) |Pu (x) − πx | ≤ πx for all u, x ∈ V . Then, assuming πv = o(1), Eπ (H v ) ≤ 2T +
Rv (T ) . πv
(4)
(t)
Proof. Let D(t) = maxu,x |Pu (x) − πx |. It follows from e.g. [1] that D(s + (T ) t) ≤ 2D(s)D(t). Hence, since maxu,x |Pu (x) − πx | ≤ πv , then for each k ≥ 1, (kT ) maxu,x |Pu (x) − πx | ≤ (2πv )k . Thus Zvv =
∞ t=0
(Pv(t) (v) − πv ) =
t
(Pv(t) (v) − πv ) + T
(2πv )k ≤ Rv (T ) + 2T πv .
k≥1
The Cover Times of Random Walks on Hypergraphs
3
215
Proof of Theorem 2: Preliminaries
We explain the proof of the value of C(H) of Theorem 2; the proofs of I(H) and CE (H) are similar. We reduce the walk Wu (H) on the hypergraph H to an equivalent walk Wu (G) on an associated graph G(H) = (V, F ); Section 3.3. In Section 3.1 we state a lemma (Lemma 2) on which the proof of Theorem 2 is based. This lemma, proven in [6], gives a formula for the probability that a random walk Wu (t) on a graph G does not visit a given vertex v within t steps after a suitably defined mixing time T . We apply Lemma 2 to the associated graph G(H), but to do so, we have to derive a bound on the mixing time of G(H) and calculate the parameter pv of the random walk in G(H) defined in (11). We can calculate pv , if v is a tree-like vertex in hypergraph H, which means, informally, that there are no short cycles nearby v. In Section 3.2 we define formally the property of being a tree-like vertex, which holds for most vertices of H. In Section 3.4, we establish the conductance of the graph G(H) to obtain a bound on the mixing time T of graph G(H) (via the relation between the conductance and the mixing time given in Section 3.1). We also prove that the conditions of Lemma 2 hold for the graph G(H) and tree-like vertices, and derive the parameter pv for such vertices. In Section 4 we prove the formula for C(H) stated in Theorem 2, by establishing upper and lower bounds on C(H) in Sections 4.1 and 4.2, respectively. In Section 5 we sketch how the calculations of C(H) can be adapted to derive the formulas for I(H) and CE (H). 3.1
Random Walk Background
Let G = (V, E) denote a fixed connected graph with n vertices and m edges. (t) Let P be the matrix of transition probabilities of the walk and let Pu (v) = Pr(Wu (t) = v). We assume the random walk Wu on G is ergodic, so it has stationary distribution π, where πv = d(v)/(2m). Let ΦG be the conductance of G, i.e. ΦG = minS⊆V,πS ≤1/2 ΦG (S) where ¯ πx P (x, S) ΦG (S) = x∈S . (5) πS Then, with Φ = ΦG , |Pu(t) (x) − πx | ≤ (πx /πu )1/2 e−Φ
2
t/2
.
(6)
Let T be such that, for t ≥ T max |Pu(t) (x) − πx | ≤ n−3 .
u,x∈V
(7)
If (7) holds, we say the distribution of the walk is in near stationarity. We consider the returns to vertex v made by a walk Wv , starting at v. Define Rv (T, z) =
T −1 t=0
Pv(t) (v)z t .
(8)
216
C. Cooper, A. Frieze, and T. Radzik
Thus Rv (T, 1) = Rv (T ) in (3). Let v ∈ V . We list the conditions required by Lemma 2. (T ) (o) T is such that maxu,x |Pu (x) − πx | ≤ 1/n3 . (i) For some (small) constant θ > 0 and some (large) constant K we have: min
|z|≤1+1/KT
|Rv (T, z)| ≥ θ,
(9)
(ii) T πv = o(1) and T πv = Ω(n−2 ). Lemma 2. [6] Assume conditions (o), (i), (ii) above hold for a graph G and a vertex v in G. Let Av (t) be the event that a walk Wu on graph G, does not visit vertex v at steps T, T + 1, . . . , t. Then, Pr(Av (t)) =
(1 + O(T πv )) + O(T 2 πv e−t/KT ), (1 + pv )t
(10)
where pv is given by the following formula, with Rv = Rv (T ): pv =
3.2
πv . Rv (1 + O(T πv ))
(11)
Tree-Like Vertices
To use Lemma 2, we need the parameter Rv for (11). To calculate Rv , the expected number of returns made by Wv to vertex v during T steps, we need to identify the local structure of a typical vertex of a random hypergraph H. Let ω = log log log n. A sequence v1 , v2 , . . . , vk ∈ V is said to define a path of length k − 1 if there are distinct edges e1 , e2 , . . . , ek−1 ∈ E such that {vi , vi+1 } ⊆ ei for 1 ≤ i ≤ k − 1. A sequence v1 , v2 , . . . , vk ∈ V , k ≥ 3, is said to define a cycle of length k if there are distinct edges e1 , e2 , . . . , ek ∈ E such that {vi , vi+1 } ⊆ ei for 1 ≤ i ≤ k, with vk+1 = v1 . A path/cycle is short if its length is at most ω. A vertex v ∈ V (H) is said to be locally-tree-like to depth k if there does not exist a path from v of length at most k to a cycle of length at most k. An edge e ∈ E(H) is locally-treelike to depth k, if it contains only vertices which are locally-tree-like to depth k. A vertex, or en edge, is tree-like if it is locally-tree-like to depth ω. We argue that almost all vertices of H are tree-like. Lemma 3. Whp there are at most (rs)3ω vertices in H that are not tree-like. Lemma 4. Whp there are no short paths joining distinct short cycles. The details of the proofs of Lemmas 3 and 4 are omitted. We only mention that we need for the proofs a workable model of an r-regular s-uniform hypergraph. We use a hypergraph version of the configuration model of Bollob´ as [4]. A configuration C(r, s) consists of a partition of rn labeled points
The Cover Times of Random Walks on Hypergraphs
217
{a1,1 , ..., a1,r , · · · , an,1 , ..., an,r } into unordered sets Ei , i = 1, ..., rn/s of size s. We assume naturally that s divides rn. We refer to these sets as the hyperedges of the configuration, and to the sets vi = {ai,1 , ..., ai,r } as the vertices. By identifying the points of vi , we obtain an r-regular, s-uniform (multi-)hypergraph H(C). In general, many configurations map to one underlying hypergraph H(C). Considering the set C(r, s) of all configurations C(r, s) with the uniform measure, the measure μ(H(C)) depends only on the number of parallel edges (if any) at each vertex, and as an example all simple hypergraphs i.e. those without multiple edges have equal measure in H(C). The probability a u.a.r. sampled configuration is simple is bounded below by a number dependent only on r and s. For the values of r, s considered in this paper, the probability that H(C) is simple is Ω(e−(r−1)(s−1) ). It follows that any almost sure property of H(C) is also an almost sure property of simple hypergraphs. 3.3
Construction of an Equivalent (Contracted) Graph
To calculate C(H), I(H) and CE (H), we replace the hypergraph H with graphs G(H), Γ (v) and Γ (e), where v and e are a tree-like vertex and edge of G. Clique graph G(H) is obtained from H by replacing each hyperedge e ∈ E(H) with a clique of size |e| on the vertex set of e. This transforms thehypergraph H into a multi-graph G(H). Formally, G(H) = (V, F ) where F = e∈E(H) e2 . We can think of the walk Wu on H as a walk on G(H). Thus, the cover time of G(H) is the cover time of H. Inform-contraction graph Γ (v) is used in the analysis of the inform time I(H). Let Sv be the multi-set of edges {w, x} in G(H), not containing v, but which are contained in hyperedges incident with vertex v in H i.e. Sv = {{w, x} : ∃e ∈ E(H), v ∈ e, and w, x ∈ e \ {v}} . Since H is r-regular and s-uniform, each Sv has size r s−1 2 . A vertex v is informed if either (i) v is visited or (ii) Sv is visited by Wu . To compute the probability that v or Sv are visited we subdivide each edge f = {w, x} of Sv by introducing an artificial vertex af . Thus f is replaced by {w, af }, {af , x}. Call the resulting graph Gv (H). Let Dv = {v} ∪ {af : f ∈ Sv } and note that Dv is an independent set in Gv (H). Now contract Dv to a single vertex γ = γ(Dv ). Let Γ (v) be the resulting multi-graph. It is easy to check that the degree of γ is deg(γ) = r(s − 1)2 . Furthermore, deg(Γ (v)) = deg(Gv (H)) = r(s − 1)n + r(s − 1)(s − 2). For a random walk in Γ = Γ (v) the stationary distribution of γ is thus π(γ) = (s − 1)/(n + s − 2). / Dv . For Suppose now that Xu is a random walk in Gv (H) starting at u ∈ t ≥ T , let Bv (t) be the event that the walk Wu in G(H) does not visit Sv ∪ {v} at steps T, T + 1, . . . , t. Then Bv (t) is equivalent to ∧x∈Dv Ax (t) defined with respect to Xu . Edge-Contraction graph Γ (e) is used in the analysis of the edge cover time CE (H). Starting from G(H), and given e ∈ E(H) form Ge (H) as follows. For
218
C. Cooper, A. Frieze, and T. Radzik
each of the edges f = {u, v} ∈ 2e , subdivide f using a new vertex af . Thus f is replaced by {u, af }, {af , v}. The set De = {af : f ⊆ e ∈ E(H)} gives rise to Ge (H), similarly as for Gv (H) above. Contract De to a vertex γ to form a multi-graph Γ (e), similarly to Γ (v). The degree of γ is deg(γ) = s(s − 1). Furthermore, deg(Γ (e)) = deg(Ge (H)) = rn(s − 1) + s(s − 1). For a random walk in Γ = Γ (e) the stationary distribution of γ is thus π(γ) = s rn+s . Suppose now that X u is a random walk in Ge (H) starting at u ∈ / De . For t ≥ T , let Be (t) be the event that the walk Wu in Ge (H) does not visit De at steps T, T + 1, . . . , t. The following lemma (proof omitted) is used in conjunction with Lemma 2, which gives Pr(Aγ (t); Γ ), in the analysis of I(H) and CE (H). Lemma 5. Let x = v or e, and let Γ = Γ (v) or Γ (e), respectively. Let Yu be a random walk in Γ starting at u = γ. Let T be a mixing time satisfying (7) in both Gx (H) and Γ . Then
s Pr(Aγ (t); Γ ) = Pr(Bx (t); G(H)) 1 + O , n where the probabilities are those derived from the walk in the given graph. 3.4
Conditions and Parameters for Lemma 2
Our proof of Theorem 2 is based on applying Lemma 2 to graphs G(H), Γ (v) and Γ (e). To apply Lemma 2, we need suitable upper bounds on the mixing times in these graphs. We obtain such bounds from the lower bounds on conductance given in the following lemma (proof omitted). Lemma 6. The conductance ΦG of the graph G(H) is Ω(1/s) whp. The conductance ΦΓ of the graph Γ = Γ (v), Γ (e) is Ω(1/s) whp. We then use Lemma 6 and Inequality (6) in a straightforward verification of the following lemma. Lemma 7. Let s = o(log n), and let T = A log2 n, where A is a large constant. Then whp T satisfies the mixing time condition (7) in each of the graphs G(H), Γ (v) and Γ (e). The next steps towards applying Lemma 2 to graphs G(H), Γ (v) and Γ (e) are to check that the technical condition (i) holds (the condition (ii) is clear since T = O(log2 n)), and to obtain precise estimates of the parameters Rv (the number of returns to vertex v during the miximg time) for the values pv in (11). We summarize these parts of the analysis in the following lemma, omitting the proofs.
The Cover Times of Random Walks on Hypergraphs
219
Lemma 8. (i) Let v be tree-like in H, then in G(H) the value of pv is given by pv = (1 + o(1))
1 (r − 1)(s − 1) − 1 . n (r − 1)(s − 1)
(12)
(ii) Let v be tree-like in H, then in Γ (v) the value of pγ(v) is given by pγ(v) = (1 + o(1))
s − 1 (r − 1)(s − 1) − 1 . n r(s − 1) − 1
(13)
(iii) Let e be tree-like in H, then in Γ (e) the value of pγ(e) is given by pγ(e) = (1 + o(1))
s (r − 1)(s − 1) − 1 . rn r(s − 1) − 1
(14)
(iv) Let v (resp. e) be a tree like vertex (resp. edge) in H. Then v (resp γ(v), γ(e)) satisfies the conditions of Lemma 2 in G(H), (resp. Γ (v), Γ (e)).
4 4.1
Proof of Theorem 2: Estimate the Cover Time C(H) Upper Bound on the Cover Time C(H)
We are assuming from now on that the hypergraph H satisfies the conditions stated in Lemmas 3 and 4, and that the mixing time T = O(log2 n) satisfies (7) (see Lemma 7). We view the random walk Wu in H as a random walk in the clique graph G = G(H). (r−1)(s−1) Let t0 = (1 + o(1)) (r−1)(s−1)−1 n log n where the o(1) term is large enough so that all inequalities below are satisfied. Let TG (u) be the time taken to visit every vertex of G by the random walk Wu . Let Ut be the number of vertices of G which are not visited by Wu in the interval [T, t]. We note the following: Cu = Cu (H) = Cu (G) = ETG (u) = Pr(TG (u) > t), (15) t≥0
Pr(TG (u) > t) = Pr(Ut ≥ 1) ≤ EUt . It follows from (15) and (16) that for all t ≥ T Cu ≤ t + EUσ = t + Pr(Av (σ)). σ≥t
(16)
(17)
v∈V σ≥t
Let V1 be the set of tree-like vertices and let V2 = V − V1 . We apply Lemma 2. For v ∈ V1 , from (12) we have npv ∼ (r−1)(s−1)−1 (r−1)(s−1) . Hence,
Pr(Av (σ)) ≤ 1 + o(1))e−t0 pv
σ≥t0
σ≥t0
≤
−t0 pv 2p−1 v e
≤ 5.
e−(σ−t0 )pv + O et0 /(2KT )
220
C. Cooper, A. Frieze, and T. Radzik
Furthermore, also from Lemma 2, Pr(Av (3n)) ≤ (1 + o(1))e−3npv ≤ e−1 .
(18)
Suppose next that v ∈ V2 . It follows from Lemmas 3 and 4 that we can find w ∈ V1 such that dist(v, w) ≤ ω. So from (18), with ν = 3n + ω, we have Pr(Av (ν)) ≤ 1 − (1 − e−1 )(rs)−ω , since if our walk visits w, it will with probability at least (rs)−ω visit v within the next ω steps. Thus if ζ = (1 − e−1 )(rs)−ω , Pr(Av (σ)) ≤ (1 − ζ)σ/ν ≤ (1 − ζ)σ/(2ν) σ≥t0
σ≥t0
σ≥t0
(1 − ζ) 1 − (1 − ζ)1/(2ν) t0 /(2ν)
=
≤ 3νζ −1 .
(19)
Thus for all u ∈ V , and assuming for the last bound that (rs)4ω = o(log n), Cu ≤ t0 + 5|V1 | + 3|V2 |νζ −1 = t0 + O((rs)4ω n) = t0 + o(t0 ). 4.2
(20)
Lower Bound on the Cover Time C(H)
For any vertex u, we can find a set of vertices S, such that at time t1 = t0 (1 − o(1)), the probability the set S is covered by the walk Wu tends to zero. Hence TG (u) > t1 whp which implies that CG ≥ t0 − o(t0 ). We construct S as follows. Let S ⊆ V1 be some maximal set of locally tree-like vertices all of which are at least distance 2ω + 1 apart. Thus |S| ≥ (n − (rs)3ω )(rs)−(2ω+1) . Let S(t) denote the subset of S which has not been visited by Wu in the interval [T, t]. Now, using Lemma 2, 1 + o(1) −2 E|S(t)| = (1 − o(1)) + o(n ) . (1 + pv )t v∈S
Setting t1 = (1 − )t0 where = 2ω −1 , we have E|S(t1 )| = (1 + o(1))|S|e−(1− )t0 pv ≥ (1 + o(1))
n2/ω (rs)2ω+1
≥ n1/ω . (21)
Let Yv,t be the indicator for the event that Wu has not visited vertex v at time t. Thus v∈S Yv,t = |S(t)|. Let Z = {v, w} ⊂ S. It can be shown, by merging v and w into a single node Z and using Lemma 2, that E(Yv,t1 Yw,t1 ) =
1 + o(1) + o(n−2 ), (1 + pZ )t1 +2
(22)
where pZ ∼ pv + pw . Thus E(Yv,t1 Yw,t1 ) = (1 + o(1))E(Yv,t1 )E(Yw,t1 ).
(23)
The Cover Times of Random Walks on Hypergraphs
221
Using (21) and (23), it can be shown that Pr(|S(t1 )| > T ) ≥
(E|S(t1 )| − T )2 = 1 − o(1). E((|S(t1 )| − T )2 )
Since at most T /ω of S(t1 ) can be visited in the first T steps, the probability that not all vertices are covered at time t1 is equal to 1 − o(1), so C(H) ≥ t1 .
5
Proof of Theorem 2: Estimate I(H) and CE (H)
The estimation of I(H) and CE (H) is done very similarly as in Sections 4.1, 4.2. We briefly outline only the upper bound proof for I(H). Let Iu (H) be the expected time for Wu to inform all vertices. Then for t ≥ T , similarly to (17), Iu (H) ≤ t + Pr(Bv (σ)) v∈V σ≥t
where Bv (σ) is the
event that vertex v is not informed in the interval [T, σ]. Let s−1 n t0 = (1 + o(1)) 1 + (r−1)(s−1)−1 log n. For tree-like vertices we use pγ(v) s−1 from (13), and apply Lemma 2. For non-tree-like vertices we use the argument for (19) and obtain, as in (20), Iu (H) ≤ t0 + o(t0 ).
References 1. Aldous, D., Fill, J.: Reversible Markov Chains and Random Walks on Graphs, http://stat-www.berkeley.edu/pub/users/aldous/RWG/book.html 2. Aleliunas, R., Karp, R.M., Lipton, R.J., Lov´ asz, L., Rackoff, C.: Random Walks, Universal Traversal Sequences, and the Complexity of Maze Problems. In: Proc. 20th Annual IEEE Symp. Foundations of Computer Science, pp. 218–223 (1979) 3. Avin, C., Lando, Y., Lotker, Z.: Radio cover time in hyper-graphs. In: Proc. DIALM-POMC, Joint Workshop on Foundations of Mobile Computing, pp. 3–12 (2010) 4. Bollob´ as, B.: A probabilistic proof of an asymptotic formula for the number of labelled regular graphs. European Journal on Combinatorics 1, 311–316 (1980) 5. Cong, J., Hagen, L., Kahng, A.: Random walks for circuit clustering. In: Proc. 4th IEEE Intl. ASIC Conf., pp. 14.2.1–14.2.4 (1991) 6. Cooper, C., Frieze, A.M.: The cover time of random regular graphs. SIAM Journal on Discrete Mathematics 18, 728–740 (2005) 7. Cooper, C., Frieze, A.M.: The cover time of the giant component of of Gn,p . Random Structures and Algorithms 32, 401–439 (2008) 8. Feller, W.: An Introduction to Probability Theory, 2nd edn., vol. I. Wiley, Chichester (1960) 9. Lov´ asz, L.: Random walks on graphs: A survey. Bolyai Society Mathematical Studies 2, 353–397 (1996) 10. Matthews, P.: Covering Problems for Brownian Motion on Spheres. Annals of Probability, Institute of Mathematical Statistics 16(1), 189–199 (1988) 11. Zhou, D., Huang, J., Sch¨ olkopf, B.: Learning with Hypergraphs: Clustering, Classifcation, and Embedding. In: Advances in Neural Information Processing Systems (NIPS), vol. 19, pp. 1601–1608. MIT Press, Cambridge (2007)
Routing in Carrier-Based Mobile Networks Bronislava Brejov´ a1, Stefan Dobrev2 , Rastislav Kr´ aloviˇc1, and Tom´ aˇs Vinaˇr1 1
Faculty of Mathematics, Physics, and Informatics, Comenius University, Bratislava 2 Institute of Mathematics, Slovak Academy of Sciences, Bratislava, Slovakia
Abstract. The past years have seen an intense research effort directed at study of delay/disruption tolerant networks and related concepts (intermittently connected networks, opportunistic mobility networks). As a fundamental primitive, routing in such networks has been one of the research foci. While multiple network models have been proposed and routing in them investigated, most of the published results are of heuristic nature with experimental validation; analytical results are scarce and apply mostly to networks whose structure follows deterministic schedule. In this paper, we propose a simple model of opportunistic mobility network based on oblivious carriers, and investigate the routing problem in such networks. We present an optimal online routing algorithm and compare it with a simple shortest-path inspired routing and the optimal offline routing. In doing so, we identify the key parameters (the minimum non-zero probability of meeting among the carrier pairs, and the number of carriers a given carrier comes into contact) driving the separation among these algorithms.
1
Introduction
In the last decade, there has been significant research activity in highly dynamic networks, e.g. wildlife tracking and habitat monitoring networks [2,13], vehicular ad-hoc networks [3,25], military networks, networks for low-cost provision of Internet for remote communities [9,18], as well as LEO [20] and inter-planetary networks [4]. As the incurred delays in these networks can be large and unpredictable, they have been named Delay (or Disruption) Tolerant Networks (DTRs). The disruptions and loss of connectivity come from many sources— sparseness [12,19], high and unpredictable mobility [25], covertness, or nodes powering down to conserve energy [13]. Since the connectivity can not be guaranteed, these networks can be classified as Intermittently Connected Networks (ICMs). As standard Internet and MANET routing protocols cannot be applied in ICMs, this has spawned intense research into communicating primitives in ICMs. Strong motivation also comes from the possibility of exploiting (conceivably maliciously) the ICMs for uses external and extraneous to the mobile carriers that form the network. As pointed out in [5], ”other entities (e.g., code, information, web pages) called agents can opportunistically move on the carriers network for their own purposes, by using the mobility of the carriers as a transport mechanism.” A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 222–233, 2011. c Springer-Verlag Berlin Heidelberg 2011
Routing in Carrier-Based Mobile Networks
223
The high dynamism of DTRs and ICMs cannot be adequately modeled by previous fault-based techniques. In these networks, ”topology changes are not anomalies but rather integral part of the nature of the system” ([5]). There have been several approaches to model such networks (time-varying graphs [11,23], temporal networks [14], evolving graphs [10], graphs over time [16]), all in essence capturing the network topology as a function of time. While allowing to describe and characterize several important concepts related to connectivity over time, such modeling approach is far too general for analytical investigation of performance guarantees of various routing algorithms. On the other hand, the more applied research of routing in ICMs has typically modeled node mobility using planar random walk, random waypoint or related mobility models. Performance evaluation is in such cases achieved through simulation, analytical results are scarce and limited to these quite restricted and unrealistic mobility models. Clearly, there is a lack of models for ICMs that are simple and concrete enough to make theoretical analysis of communication algorithms tractable, while sufficiently strong to be of practical relevance. From the simplicity point of view, we find the carrier-based approach of [11] highly desirable. It neatly combines the simplicity of discrete time and space with capturing the inherently local communication. Its main drawback is the deterministic nature, as the mobility patterns in ICMs are often complex, inherently non-deterministic and unknown. One of the main contributions of this paper is extension of this model to stochastic networks. The system consists of n sites, k mobile carriers roaming over these sites and an agent (or several agents, when considering multiple-copy routing schemes) that is the active entity executing the routing algorithm. The agent is always located on some carrier, the sites are resource-less abstractions of geographic locations. The system is synchronous. From a point of view of an agent, a time step t is as follows: The step starts with the agent located on some carrier c at a site v. All carriers then move to their new destinations, with the carrier c moving to site v (carrying with it the agent). To conclude the step, the agent can switch to any carrier c that is at the moment present in v . In [11] the carriers were limited to deterministically executing cyclical walks, making the network a periodic time-varying graph. We propose to model the carriers as stochastic processes. There are several possibilities to do so, e.g. using the recently introduced Markov Trace Model of [8]. In [8] it is shown how to compute the stationary distributions for carrier location based on known Markov Trace Model of their movement. However, typically, the situation is reverse: the probability distribution of carrier location can be relatively straightforwardly obtained by sampling/trace collection, while the underlying movement algorithm is unknown. This motivates us to investigate the simpler case of carrier mobility modeled as i.i.d. process where the carrier location at each time step is chosen according to some fixed (per carrier) probability distribution over the sites. The principal question we ask is ”How and to what extend can such simple and limited knowledge of the movement patterns be exploited to help routing?”
224
B. Brejov´ a et al.
Related work—routing in ICMs. Routing in ICMs is a research area which has seen considerable attention. For deterministic networks, modified shortest path approaches can be used [12], however for stochastic networks fundamentally different techniques are needed. The first routing schemes (so-called epidemic routing [24]) for stochastic ICMs were flooding based and hence inherently costly in bandwidth, buffer space and energy consumption. Significant subsequent work [7,17,20,21,22,13] has been done to improve upon epidemic routing by limiting the spread of the messages to nodes that are estimated to be closer to the destination. Several approaches have been used for this estimation, typically using the previous history of carrier encounters [17,20,13] or specific models of carrier mobility [7,20]. Nevertheless, most of these approaches are inherently multi-copy and to various degree exhibit the drawbacks of flooding. Furthermore, the typical performance evaluation is experimental comparison with epidemic routing, with little/no theoretical results concerning provable performance bounds. The few single-copy approaches [15,19,22] are either inherently based on the assumption that the movement range of the carriers covers all sites [19] or analytical results are known only for very simple mobility models (random walk) [22]. See [22,26] for detailed discussion of different routing schemes in ICMs and further pointers. Our results. The focus of this paper is investigation of single-copy routing in (synchronous, time and space discrete) ICMs induced by mobile carriers whose mobility patterns are modeled as i.i.d. processes. First, we show that it is sufficient to limit ourselves to greedy routing algorithms in which the agent always chooses the best available carrier according to some total ordering of the carriers. Such greedy routing is a type of opportunistic routing studied before [1,6], however our simple model and knowledge of carrier mobility patterns allows us to find the provably optimal algorithm AlgOPT. The algorithm is optimal in the sense that it produces the lowest expected routing time (measured as the number of synchronous steps) and gives the best possible competitive ratio with respect to the optimal offline routing algorithm knowing the future moving patterns of carriers (which corresponds to epidemic flooding with unlimited resources). We provide tight upper and lower bound of Θ(min(pmin , Δ)) on this competitive ratio, where pmin is the minimum non-zero probability of meeting among the carrier pairs and Δ is the maximal (over all carriers) number of carriers a carrier comes into contact with. This allows us to clearly identify the parameters of the carrier movement patterns that drive the performance bounds of routing. The upper bound is actually achieved by a simple rigid carrier-path based algorithm SimplePath. This might possibly suggest that the use of AlgOPT is not really necessary. As a final results we show that this is not the case as there is an instance for which SimplePath is as much as Ω(n) times worse than AlgOPT.
2
Model
We consider a system of n sites, and k carriers. Formally, a carrier c is modelled (t) (t) by a sequence of random variables {Xc }∞ t=1 , where Xc ∈ {1, . . . , n} is the site to which the carrier moves in step t. In this paper, we consider memoryless
Routing in Carrier-Based Mobile Networks
225
carriers: for a carrier c, the {Xc }∞ = t=1 are i.i.d., so that for all t, t , Pr[Xc (t ) v] = Pr[Xc = v] Let us consider random variables X (t) ∈ {1, . . . , n}k such (t) (t) that X (t) = Xc1 , . . . , Xck , and a sequence X = {X (t) }∞ t=1 that describes the positions of the carriers over time. The movement of the agent is a sequence of random variables A = {A(t) }∞ t=1 where A(t) ∈ {1, . . . , k} denotes the carrier on which the agent is moving during (t) (t) step t. Let us denote seen(t) = {c | Xc = XA(t) } the set of carriers seen by the agent at the end of step t. We require that for each t > 1, A(t) ∈ seen(t − 1). We investigate the routing problem, where at the beginning the agent is located on some carrier ca , and its goal is to reach a given carrier cb In order for the routing problem to be solvable, we require that there exists a sequence of (t) (t) carriers ca = c1 , c2 , . . . , cm = cb such that ∀t, i : Pr[Xci = Xci+1 ] > 0. The route (1) (T ) of the agent is a movement where A = ca , and A = cb for some T . Let T (A) be the first T where A(T ) = cb . Given the values of X it is easy to compute the values of A in a way to minimize T (A) (using modified shortest paths algorithm). We shall refer to this (offline) optimum (which is again a random variable) as OP T . (i) t−1 (t) For an algorithm, let us call {A(i) }t−1 i=1 ∪{X }i=1 a history up to time t. If A (i) t−1 is a function of the {A(i) }t−1 i=1 ∪ {Xc | c ∈ seen(i)}i=2 , the algorithm is called online, and for the rest of the paper, we shall consider online algorithms only. A specific class of algorithms are greedy algorithms in which the agent always chooses the ”best” available carrier according to some fixed ordering, i.e. there is an ordering of the carriers c1 ≺A · · · ≺A ck , and A(t) = min≺ seen(t − 1). (t)
3
(t)
Optimal Algorithm
In this section, we construct the optimal routing algorithm for the routing problem with known probability distributions of carriers. We start by observing an important property of greedy algorithms. Lemma 1. For any optimal algorithm A there is a greedy algorithm A such that E[T (A )] = E[T (A)]. Proof (sketch). First note that it is sufficient to restrict our attention to algorithms with finite E[T (A)]. It is easy to see that for any (online) algorithm A, and any history H(t) up to time t, there is a fixed probability distribution of the A(t) . By increasing, in each of these distributions, the probability of the choice leading to shortest expected running time, we can transform A into a deterministic algorithm without increasing E[T (A)]. Next, we make the (deterministic, optimal) algorithm A memoryless , i.e. for the same set of seen carriers, the decision will always be the same regardless of the history. From the fact that A is optimal it follows that for any two histories with the same set of seen carriers, the expected time to finish is the same. Hence, it is easy to modify the algorithm in such a way that A(t) is the function of seen(t − 1) only. To make the algorithm greedy, it is sufficient to ensure that for any pair of seen agents c1 , c2 , one of them is
226
B. Brejov´ a et al.
always preferred, i.e. w.l.o.g. ∀C : {c1 , c2 } ⊆ C ∧ seen(t − 1) = C =⇒ c2 ∈ A(t) . Again, the optimality of A ensures that this transformation can be done.
We can now restrict ourselve to the greedy algorithms. For an algorithm A, let (A) Eci = E[T (A)] when A starts the routing from ci . Since the algorithm does not use the history, and X (t) are i.i.d, any time the agent is located on carrier ci , the (A) expected number of steps to reach the destination is Eci . When the ordering of k carriers {ci }i=1 coincides with the ordering ≺A used by the algorithm A, notation (A) Ei will be used as a shorthand; similarly, we will omit the superscript when the algorithm is clear from the context. (A) Let pci ,cj denote the probability that cj is the best (lowest rank in the carrier ordering ≺A used by A) carrier among those seen by ci in any given step. This probability is the same for all steps and can be straightforwardly computed from the probabilistic distributions of carriers. Again, if c1 ≺A · · · ≺A ck , we will use (A) a shorthand pi,j , or pi,j if A is clear from the context. i Note that for a greedy algorithm E1 = 0, and Ei = 1 + j=1 pi,j Ej = i−1 1 + j=1 pi,j Ej + pi,i Ei , and hence Ei can be expressed as follows: Ei = (A)
1+
i−1 j=1
pi,j Ej
1 − pi,i
1 + i−1 j=1 pi,j Ej = i−1 j=1 pi,j
(1)
(A)
If Ei < Ej implies i < j, we say that the algorithm A is a fixpoint. Moreover, we say that the algorithm A dominates the algorithm B if for every carrier ci , (A) (B) Eci ≤ Eci . We will show that it is sufficient to consider fixpoints. Lemma 2. For any greedy algorithm A there exists a dominating fixpoint B. (A) Proof. Let E(A) = i Eci , let c1 ≺A c2 ≺A · · · ≺A ck be the ordering of carriers corresponding to algorithm A, and let f (A) be the number of inversions (A) (A) in the sequence (Ec1 , . . . , Eck ). Unless A is already a fixpoint, there must (A) (A) exist such that Ec > Ec+1 . Now consider algorithm A , where we exchange the ordering of carriers c and c+1 . Below we show that A dominates A, and therefore E(A ) ≤ E(A). We can repeat the above exchange steps until we reach a fixpoint (i.e., f (A) = 0). Since in every step, we obtain a new algorithm that dominates the previous one, the resulting fixpoint will dominate the original algorithm A. Note that it is impossible to reach the same ordering twice, since in each step we either decrease E(A), or decrease the number of inversions f (A). It remains to show that after the exchange step, A will dominate A. (A) (A ) (A) Let us use a shorthand notation Ei , Ei , pi,j and pi,j for Eci , Eci , pci ,cj and (A )
pci ,cj , respectively (in all cases we index using the carrier ordering ≺A ). Note that from the definition of pi,j and pi,j , we get pi,j = pi,j for all i, j ∈ / {, + 1}. Case i < : Since the carrier orderings are the same in A and A up to cl−1 , and the fact that Ei depends only on Ej for j < i we have Ei = Ei for all i < l.
Routing in Carrier-Based Mobile Networks
Case i = + 1: Let X = 1 +
−1 j=1
due to the previous case, we have
p+1,j Ej and Y = E+1
−1 j=1
227
p+1,j . From (1) and
= X/Y and E+1 =
X+p+1, E . Y +p+1,
Thus
X + p+1, E X Y (X + p+1, E ) − X(Y + p+1, ) − = Y + p+1, Y Y (Y + p+1, ) p+1, (Y E − X) = , Y (Y + p+1, )
E+1 − E+1 =
and since all p’s are non-negative, E+1 ≤ E+1 holds if and only if E Y ≥ X. This holds because E > E+1 = (X + p+1, E )/(Y + p+1, ). −1 −1 Case i = : Substitute X = 1 + j=1 p,j Ej and Y = j=1 p,j . Using (1), and the previously shown cases, we have E ≤ (X + p,+1 E+1 )/(Y + p,+1 ), and El = X/Y E < E now follows from the assumption that E+1 < E . Case i > + 1. We show the claim by induction on i. We assume that for all + 1 < j < i the claim already holds (for all smaller values of j it has been shown in previous cases). We obtain: i−1 i−1 i−1 i−1 1 + j=1 pi,j Ej 1 + j=1 pi,j Ej j=l pi,j Ej − j=l pi,j Ej Ei − Ei = − = , 1 − pi,i 1 − pi,i 1 − pi,i
and therefore it is sufficient to show that induction hypothesis this simplifies to
i−1 j=
pi,j Ej ≥
i−1 j=
pi, E + pi,+1 E+1 ≥ pi,+1 E+1 + pi, E .
pi,j Ej . Using the (2)
Note that pi, + pi,+1 = pi, + pi,+1 (precisely the instances of available carriers when there is no carrier cj with j < available, and there is a carrier from {c , c+1 } available). Let us substitute ∇ = pi, − pi, . As pi, includes instances of available carriers containing c+1 , while pi, does not, we obtain pi, ≥ pi, and hence ∇ ≥ 0. We can now rewrite (2) as (pi, E − pi, E ) − (pi,+1 E+1 − pi,+1 E+1 ) ≥ ∇(E − E+1 ). Since ∇ ≥ 0 and E > E+1 , this proves (2) and hence Ei ≥ Ei follows.
Using (1) and motivated by Lemma 2, Algorithm 1 computes a fixpoint ordering in polynomial time. Let AlgOPT be the greedy algorithm based on this ordering. Next we show the optimality of the resulting algorithm. Theorem 1. No algorithm is better than AlgOPT. Proof. Due to Lemmas 1 and 2, we consider only fixpoint greedy algorithms. Let A be a fixpoint different from AlgOPT. We show a sequence of algorithms {Aj }sj=0 , where A0 = A, Aj+1 dominates Aj (0 ≤ j < s), and As = AlgOPT. Here, we denote the carriers based on their ordering in AlgOPT. Let be the first carrier in AlgOPT order that has a different position cm in Aj (m > ). Let Aj be the ordering 1, . . . , − 1, cm = , c , . . . , cm−1 , cm+1 , . . . , ck .
228
B. Brejov´ a et al.
Algorithm 1. Constructing carrier ordering for algorithm AlgOPT 1: 2: 3: 4:
Set c1 to be the destination carrier, set E1 = 0 Set U to contain all carriers except c1 . Set i = 1 (the number of processed carriers). while U is non-empty do Set ci+1 to be cx for which Ex =
5:
1+
i j=1
px,j Ej
j=1
px,j
i
is minimal among those in U .
6: Remove ci+1 from U and increment i. 7: end while 8: The sequence {ci }ki=1 is the desired ordering.
Observe that Aj possibly differs from AlgOPT only at positions m + 1, m + 2, . . . , k. We repeatedly apply the carrier swapping from Lemma 2 to this ordering until we reach a fixpoint Aj+1 . This carrier swapping only happens at positions larger than m (otherwise a different cm would have been chosen in AlgOPT) and therefore Aj+1 and AlgOPT agree on the first m carriers. The whole process can be recursively applied until As = AlgOPT. Hence, it is sufficient to show that Aj dominates Aj . The equation (1) can be alternatively expressed as 1 + α∈S (A) pci ,α Emin(A) (α) (A) i Eci = , (3) (A) pci ,α α∈S i
where α is the set of available carriers, min(A) (α) selects the carrier with the lowest rank in α in the carrier ordering ≺A , pci ,α is the probability that the set (A) of available carriers at ci is α and Si = {α : min(A) (α) = ci }. Note that pci ,α does not depend on the carrier ordering used by the algorithm. We use shorthand (A )
(A )
notation Ei , Ei and pi,α for Eci j , Eci j and pci ,α , respectively. Analogously, we use Si , min and Si , min to denote the versions for Aj and Aj . The rest of the proof is by case analysis. Case i < : Since the carrier orders of Aj and Aj are the same on the first l − 1 positions, we have Ei = Ei for all i < . Case i ≥ m: From the construction of Aj , for all i ≥ m, Si ⊆ Si , ∀α ∈ Si : min (α) = min(α) and Emin(α) = Emin(α) , and ∀α ∈ Si \ Si : min (α) ∈ {cl , cl+1 , . . . , cm−1 }. We prove Ei ≤ Ei by induction on i. Let Ej ≤ Ej for all m ≤ j < i (it also holds for j < as shown above). Then Ei
1+ = ≤
1+
α∈Si
pi,α Emin (α)
α∈Si
pi,α
1+ =
pi,α Emin (α) + α∈Si \Si pi,α Emin (α) ≤ α∈Si pi,α + α∈S \Si pi,α
α∈Si
i pi,α Emin(α) + α∈S \Si pi,α Em X + E Z m i = , Y +Z α∈Si pi,α + α∈S \Si pi,α
α∈Si
i
where X = 1 + α∈Si pi,α Emin(α) , Y = α∈Si pi,α and Z = α∈Si \Si pi,α . We know by construction of AlgOPT that Ei ≥ Em (otherwise ci would have
Routing in Carrier-Based Mobile Networks
229
been chosen instead of cm in AlgOPT). Therefore Ei ≤ (X + Em Z)/(Y + Z) ≤ (X + Ei Z)/(Y + Z) which yields Ei ≤ X/Y = Ei . ≤ Em ≤ Ei . The first inequality follows from the fact Case l ≤ i < m: Ei ≤ Em that AlgOPT is a fixpoint and Aj agrees with AlgOPT on the first m carriers. The second was just proven in the previous case. The third one follows from the
fact that Aj is a fixpoint and cm is smaller then ci in Aj ’s carrier ordering.
4
Competitive Analysis
We have proven that AlgOPT has the best expected time over all online algorithms. However, there is an inherent gap between E[T (AlgOPT)] and E[OP T ]. Here, we give tights bounds on the competitive ratio E[T (AlgOPT)]/E[OP T ]. In carrier graph, vertices correspond to carriers, and edge {u, v} has weight w if the probability that carriers u and v meet in a given time step is non-zero and equal to 1/w. Let wmax be the maximum weight of an edge, and let Δ be the maximum degree of a vertex. Consider an algorithm SimplePath (π) for routing between u and v along a given path π in the carrier graph. The algorithm waits on ui until the next carrier ui+1 on path π is encountered and then switches to ui+1 . The expected time to route from u to v along path π is exactly the length of this path, which we denote Dπ (u, v). Lemma 3. The competitive ratio of SimplePath is at most min(wmax , Δ). Proof. First, let π be the shortest path (in the number of hops) from u to v in the carrier graph. Clearly, the optimum is at least the number of hops in π. Hence, Dπ (u, v) ≤ wmax OP T . Now, let π be the shortest path (in edge weights) between u and v, and let D(u, v) = Dπ (u, v). Consider a flooding process starting with only one carrier infected. A carrier gets infected whenever it meets an infected carrier. The expected time F (u, v) until carrier v is infected by an infection started by u is precisely the expected time to route from u to v by an optimal offline algorithm. d(v) Let In(v; {wi , Ti , mi }i=1 ) denote the expected time until carrier v will be infected if its neighbor wi in the carrier graph has been infected at time Ti and the expected time for v and wi to meet is mi (d(v) is the degree of v in the d(v) carrier graph). Now we have F (u, v) = In(v; {wi , F (u, wi ), D(wi , v)}i=1 ). Note the following properties of In(·): (P1) If a single mi or Ti is replaced by a smaller value, the value of In(·) does not increase. (P2) If Ti and mi are replaced by Ti and mi such that Ti < Ti and Ti + mi = Ti + mi then In(·) does not increase. d(v) (P3) If for all i, Ti = T and mi = m then In(v, {wi , Ti , mu }i=1 ) ≥ T + m/d(v). We show by induction on F (u, v) that for all u, v, D(u, v)/Δ ≤ F (u, v). If F (u, v) = 0 then u = v, and the the statement holds. Now, consider a pair of carriers u, v. By induction hypothesis, for all v such that F (u, v ) < F (u, v), we have D(u, v )/Δ ≤ F (u, v ). Let w be the predecessor of v on the shortest
230
B. Brejov´ a et al.
a a
v1
ca,vn−2
v2
d vn−2
c b
v1
v2
vn−4
cvn−2,b
b Fig. 1. Left: The instance with large competitive ratio. In each place x, there is a carrier cx with probability 1 in x. Carriers ca,vi are with equal probability in a, and vi . Carriers cvi ,b are with probability p = 1/an in vi , and with probability 1 − p in b. The routing must be done from a to b. Right: Gap between SimplePath and AlgOPT. In each place x, there is a carrier cx with probability one. Thin line between places i and j represents a carrier ci,j with probability 1/2 in i, and 1/2 in j. Thick arrow from i to j represents carrier ci,j with probability 1/n in i, and 1 − 1/n in j.
path from u to v and let w be the neighbor of v with the smallest D(u, wi ), wi ∈ N eigh(v). By applying P1, P2, and P3 we get d(v)
F (u, v) = In(v; {wi , F (u, wi ), D(wi , v)})i=1 ≥ In(v; {wi , ≥
D(u, w ) d(v) , D (w , v)}i=1 Δ
1 (D(u, w ) + D (w , v)) ≥ D(u, v)/Δ, Δ
where D (wi , v) = D(u, w) + D(w, v) − D(u, wi ).
From Theorem 1 and Lemma 3 immediately follows Corollary 1 below. Furthermore, Lemma 4 provides a matching lower bound, leading to Theorem 2. Corollary 1. The competitive ratio of AlgOPT is at most min(wmax , Δ). Lemma 4. For each n, there is an instance with wmax = an for some constant a, and with Δ = n − 2, for which the competitive ratio of AlgOPT is Ω(n). Proof. Consider instance in Fig.1(left) with n places a, b, v1 , . . . , vn−2 , and 3n − 4 carriers. The task is to route from a to b. AlgOPT computes the expected 1 time Ex to reach b from carrier cx . For all vi , Evi = p1 + 1−p and Ea,vi = 1 2 1 + 2p(1−p) p+1 . Hence the expected time of AlgOPT is Ea = 1 + n−2 Ea,vi / 2 n−2 > Ea,vi . 2 Now let us analyze the expected optimal time E[OP T ]. The shortest way to reach b is to choose the best i, and wait for ca,vi to appear in a, and then to
Routing in Carrier-Based Mobile Networks
231
continue all the way to b. Let Pt be the probability that the value of the optimum ∞ time is t, then E[OP T ] = t=2 tPt . The value of Pt can be bounded from above by ⎡ ⎛ ⎞⎤n−2 t t−i 1 t i − 1 ⎝ (1 − p)j · pt−i−j ⎠⎦ Pt ≤ ⎣ t + t + . 2 2 2 i=2 j=0 The interpretation is that the probability that the first carrier enters b at time t contains the event that there were no carriers in b before. A particular route a − vk − b may not reach b within t time if either ca,vk never arrives at a in the first t steps (probability 1/2t ), or it arrives at a at time i, and remains in a for the remaining t − i steps (probability t/2i ), or it arrives at vk at time i. Before that, the carrier must have been for some number of steps in vk , and then for the remaining steps in a; this generates the probability (i − 1)/2. After (and including) time i, the carrier cvk ,b must have been some j steps in b, and the remaining t−i−j steps in vk . By solving the sums, and after some manipulations (omitted due to space) we obtain: 1 3n−6 1 n−2 ∞ 1 − an 2 − 1 − an E[OP T ] = tPt ≤ n−2 . 2 1 4(1− an ) 1 n−2 2 n−2 t=2 1 − 1 − an 1 − an 1− an This bound decreases with n. Since lim
n→∞
1−
rb r bn−x = e− a , we obtain an
2z 5 − z 4 1 lim E[OP T ] ≤ , where z = e a . This bound is minimized by tak2 n→∞ (z − 1) √ ing a = 1/ ln 1 + 13 3 leading to lim E[OP T ] ≤ 40.02. Hence for large n, n→∞ expected optimum is bounded by constant, and expected AlgOPT time is linear in n.
Theorem 2. The competitive ratio of AlgOPT is Θ(min(wmax , Δ)).
Since the upper bound is based on SimplePath, one might think that it is as good as AlgOPT. However, there is a significant performance gap between AlgOPT and SimplePath. Theorem 3. For any n there is an instance with n places and 3n − 5 carriers, where SimplePath has expected time Ω(n), and expected time of AlgOPT is O(1). Proof. Consider the instance in Fig.1(right) with places a, b, c, d, v1 , . . . , vn−4 . The aim is to route from ca to cb . 1 SimplePath selects the path a, c, b, with expected time 4+n(1+ n−1 ). Expected 1 time of any other path (a, d, vi , b for some vi ) is 8 + n(1 + n−1 ). In AlgOPT, the agent waits on carrier ca for cad , and then waits on cd for the first arrival of one of the cdvi s. The expected times are Evi = 4 for each i, Ed ≈ 5.58, and Ea ≈ 8.19. Hence, AlgOPT finishes in expected constant time, whereas SimplePath needs linear time.
232
5
B. Brejov´ a et al.
Conclusions and Future Work
We have extended the (time and space) discrete model of mobile carrier-induced ICMs [11] to stochastic networks and investigated single-copy routing problem for the case of carriers modeled by known i.i.d. processes. We have shown the optimal online routing algorithm and provided tight upper and lower bounds on its competitive ratio wrt. optimal offline algorithms, identifying parameters that drive these bounds. These are the first results of this kind for routing in stochastic ICMs, providing both theoretically proven characterization and performance bounds and applying to wider mobility models than planar random walk/random waypoint. The area is open for further research. In particular, one can expand the analysis to multiple (but still limited)-copy routing algorithms and investigate the tradeoff between the number of copies used and the expected routing time. What happens if the full knowledge of the probability distributions guiding carrier movements is not known beforehand? Perhaps each carrier knows this information only for itself, perhaps even this is not available and will have to be approximated by analyzing movement and connection history. We could also consider more complex and realistic models of carrier movement and investigate other problems, e.g. network traversal and exploration, in this setting. Acknowledgments. BB and TV are funded by VEGA grant 1/0210/10 and FP7 grants IRG-224885 and IRG-231025, SD by VEGA grant 2/0111/09, and RK by VEGA grant 1/0671/11 with very limited financial support.
References 1. Biswas, S., Morris, R.: Opportunistic routing in multi-hop wireless networks. Computer Communication Review 34(1), 69–74 (2004) 2. Boehlert, G.W., Costa, D.P., Crocker, D.E., Green, P., O’Brien, T., Levitus, S., Le Boeuf, B.J.: Autonomous pinniped environmental samplers: Using instrumented animals as oceanographic data collectors. Journal of Atmospheric and Oceanic Technology 18(11), 1882–1893 (2001) 3. Burgess, J., Gallagher, B., Jensen, D., Levine, B.N.: Maxprop: Routing for vehiclebased disruption-tolerant networks. In: INFOCOM, IEEE, Los Alamitos (2006) 4. Burleigh, S., Hooke, A., Torgerson, L.: Delay-tolerant networking: an approach to interplanetary internet. IEEE Communications Magazine 41, 128–136 (2003) 5. Casteigts, A., Flocchini, P., Quattrociocchi, W., Santoro, N.: Time-varying graphs and dynamic networks. In: CoRR, abs/1012.0009 (2010) 6. Chaintreau, A., Hui, P., Crowcroft, J., Diot, C., Gass, R., Scott, J.: Impact of human mobility on opportunistic forwarding algorithms. IEEE Trans. Mob. Comput. 6(6), 606–620 (2007) 7. Chen, Z.D., Kung, H., Vlah, D.: Ad hoc relay wireless networks over moving vehicles on highways. In: Mobile Ad Hoc Networking & Computing (MobiHoc), pp. 247–250. ACM, New York (2001) 8. Clementi, A.E.F., Monti, A., Silvestri, R.: Modelling mobility: A discrete revolution. In: Abramsky, S., Gavoille, C., Kirchner, C., Meyer auf der Heide, F., Spirakis, P.G. (eds.) ICALP 2010. LNCS, vol. 6199, pp. 490–501. Springer, Heidelberg (2010)
Routing in Carrier-Based Mobile Networks
233
9. Doria, A.: Providing connectivity to the saami nomadic community. In: Open Collaborative Design for Sustainable Innovation (2002) 10. Ferreira, A.: Building a reference combinatorial model for manets. IEEE Network 18(5), 24–29 (2004) 11. Flocchini, P., Mans, B., Santoro, N.: Exploration of periodically varying graphs. In: Dong, Y., Du, D.-Z., Ibarra, O. (eds.) ISAAC 2009. LNCS, vol. 5878, pp. 534–543. Springer, Heidelberg (2009) 12. Jain, S., Fall, K.R., Patra, R.K.: Routing in a delay tolerant network. In: SIGCOMM, pp. 145–158. ACM, New York (2004) 13. Juang, P., Oki, H., Wang, Y., Martonosi, M., Peh, L.-S., Rubenstein, D.: Energyefficient computing for wildlife tracking: design tradeoffs and early experiences with zebranet. In: ASPLOS, pp. 96–107 (2002) 14. Kempe, D., Kleinberg, J., Kumar, A.: Connectivity and inference problems for temporal networks. In: Symposium on Theory of Computing (STOC), pp. 504– 513. ACM, New York (2000) 15. Leguay, J., Friedman, T., Conan, V.: Dtn routing in a mobility pattern space. In: ACM SIGCOMM Workshop on Delay-Tolerant Networking (WDTN), pp. 276–283. ACM, New York (2005) 16. Leskovec, J., Kleinberg, J., Faloutsos, C.: Graph evolution: Densification and shrinking diameters. ACM Trans. Knowl. Discov. Data 1(1), 2 (2007) 17. Lindgren, A., Doria, A., Schel´en, O.: Probabilistic routing in intermittently connected networks. SIGMOBILE Mob. Comput. Commun. Rev. 7, 19–20 (2003) 18. Pentland, A.S., Fletcher, R., Hasson, A.: Daknet: Rethinking connectivity in developing nations. Computer 37, 78–83 (2004) 19. Shah, R.C., Roy, S., Jain, S., Brunette, W.: Data mules: modeling and analysis of a three-tier architecture for sparse sensor networks. Ad Hoc Networks 1(2-3), 215–233 (2003) 20. Shen, C., Borkar, G., Rajagopalan, S., Jaikaeo, C.: Interrogation-based relay routing for ad hoc satellite networks. In: IEEE Globecom 2002, pp. 17–21 (2002) 21. Spyropoulos, T., Psounis, K., Raghavendra, C.S.: Spray and wait: an efficient routing scheme for intermittently connected mobile networks. In: ACM SIGCOMM Workshop on Delay-Tolerant Networking (WDTN), pp. 252–259. ACM, New York (2005) 22. Spyropoulos, T., Psounis, K., Raghavendra, C.S.: Efficient routing in intermittently connected mobile networks: the single-copy case. IEEE/ACM Trans. Netw. 16(1), 63–76 (2008) 23. Tang, J., Musolesi, M., Mascolo, C., Latora, V.: Characterising temporal distance and reachability in mobile and online social networks. SIGCOMM Comput. Commun. Rev. 40, 118–124 (2010) 24. Vahdat, A., Becker, D.: Epidemic routing for partially connected ad hoc networks. Technical Report CS-200006, Duke University (April 2000) 25. Wu, H., Fujimoto, R.M., Guensler, R., Hunter, M.: Mddv: a mobility-centric data dissemination algorithm for vehicular networks. In: Vehicular Ad Hoc Networks, pp. 47–56. ACM, New York (2004) 26. Zhang, Z.: Routing in intermittently connected mobile ad hoc networks and delay tolerant networks: Overview and challenges. IEEE Communications Surveys and Tutorials 8(1-4), 24–37 (2006)
On the Performance of a Retransmission-Based Synchronizer Thomas Nowak1 , Matthias F¨ ugger2 , and Alexander K¨oßler2 1
LIX, Ecole polytechnique, Palaiseau, France
[email protected] 2 ECS Group, TU Wien, Vienna, Austria {fuegger,koe}@ecs.tuwien.ac.at
Abstract. Designing algorithms for distributed systems that provide a round abstraction is often simpler than designing for those that do not provide such an abstraction. However, distributed systems need to tolerate various kinds of failures. The concept of a synchronizer deals with both: It constructs rounds and allows masking of transmission failures. One simple way of dealing with transmission failures is to retransmit a message until it is known that the message was successfully received. We calculate the exact value of the average rate of a retransmissionbased synchronizer in an environment with probabilistic message loss, within which the synchronizer shows nontrivial timing behavior. The theoretic results, based on Markov theory, are backed up with Monte Carlo simulations.
1
Introduction
Analyzing the time-complexity of an algorithm is at the core of computer science. Classically this is carried out by counting the number of steps executed by a Turing machine. In distributed computing [12,1], local computations are typically viewed as being completed in zero time, focusing on communication delays only. This view is useful for algorithms that communicate heavily, with only a few local operations of negligible duration between two communications. In this work we are focusing on the implementation of an important subset of distributed algorithms where communication and computation are highly structured, namely round based algorithms [2,4,8,17]: Each process performs its computations in consecutive rounds. Thereby a single round consists of (1) the processes exchanging data with each other and (2) each process executing local computations. Call the number of rounds it takes to complete a task the round-complexity. We consider repeated instances of a problem, i.e., a problem is repeatedly solved during an infinite execution. Such problems arise when the distributed system under consideration provides a continuous service to the top-level application, e.g., repeatedly solves distributed consensus [11] in the context of
This research was partially supported by grants P21694 and P20529 of the Austrian Science Fund (FWF).
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 234–245, 2011. c Springer-Verlag Berlin Heidelberg 2011
On the Performance of a Retransmission-Based Synchronizer
235
state-machine replication. A natural performance measure for these systems is the average number of problem instances solved per round during an execution. In case a single problem instance has a round-complexity of a constant number R 1 of rounds, we readily obtain a rate of 1/R. If we are interested in time-complexity in terms of Newtonian real-time, we can scale the round-complexity with the duration (bounds) of a round, yielding a real-time rate of 1/RT , if T is the duration of a single round. Note that the attainable accuracy of the calculated real-time rate thus heavily relies on the ability to obtain a good measurement of T . In case the data exchange within a single round comprises each process broadcasting a message and receiving messages from all other processes, T can be related to message latency and local computation upper and lower bounds, typically yielding precise bounds for the round duration T . However, there are interesting distributed systems where T cannot be easily related to message delays: consider, for example, a distributed system that faces the problem of message loss, and where it might happen that processes have to resend messages several times before they are correctly received, and the next round can be started. It is exactly these nontrivial systems the determination of whose round duration T is the scope of this paper. We claim to make the following contributions in this paper: (1) We give an algorithmic way to determine the expected round duration of a general retransmission scheme, thereby generalizing results concerning stochastic max-plus systems by Resing et al. [18]. (2) We present simulation results providing (a) deeper insights in the convergence behavior of round duration times and indicating that (b) the error we make when restricting ourselves to having a maximum number of retransmissions is small. (3) We present nontrivial theoretical bounds on the convergence speed of round durations to the expected round duration. Section 2 introduces the retransmission scheme in question and the probabilistic environment in which the round duration is investigated, and reduces the calculation of the expected round duration to the study of a certain random process. Section 3 provides a way to compute the asymptotically expected round duration λ, and also presents theoretical bounds on the convergence speed of round durations to λ. Section 4 contains simulation results. We give an overview on related work in Section 5. An extended version of this paper, containing detailed proofs, appeared as a technical report [15].
2
Retransmitting under Probabilistic Message Loss
Simulations that provide stronger communication directives on top of a system satisfying weaker communication directives are commonly used in distributed computing [9,8]. In this section we present one such simulation—a retransmission scheme. The proposed retransmission scheme is a modified version of the α synchronizer [2]. We assume a fully-connected network of processes 1, 2, . . . , N . Given an algorithm B designed to work in a failure-free round model, we construct algorithm A(B), simulating B on top of a model with transient message loss. The idea of
236
T. Nowak, M. F¨ ugger, and A. K¨ oßler
L(r − 1)
1
L(r)
T1 (r − 1)
L(r + 1)
T1 (r)
T1 (r + 1)
t
δ1,2 (r)
2
T2 (r − 1)
T2 (r)
T2 (r + 1)
t
δ1,3 (r)
3
T3 (r − 1)
T3 (r)
T3 (r + 1)
t
Fig. 1. An execution of A(B)
the simulation is simple: Algorithm A(B) retransmits B’s messages until it is known that they have been successfully received by all processes. Explicitly, each process periodically, in each of its steps, broadcasts (1) its current (simulated) round number Rnd, (2) algorithm B’s message for the current round (Rnd), and (3) algorithm B’s message for the previous round (Rnd − 1). A process remains in simulated round Rnd until it has received all other processes’ round Rnd messages. When it has, it advances to simulated round Rnd+1. In an execution of algorithm A(B), see Figure 1, we define the start of simulated round r at process i, denoted by Ti (r), to be the number of the step in which process i advances to simulated round r. We assume Ti (1) = 1. Furthermore, define L(r) to be the number of the step in which the last process advances to simulated round r, i.e., L(r) = maxi Ti (r). The duration of simulated round r at process i is Ti (r + 1) − Ti (r), that is, we measure the round duration in the number of steps taken by a process. Define the effective transmission delay δj,i (r) to be the number of tries until process j’s simulated round r message is successfully received for the first time by process i.1 We obtain the following equation relating the starts of the simulated rounds: Ti (r + 1) = max
1jN
Tj (r) + δj,i (r)
(1)
Figure 1 depicts part of an execution of A(B). Messages from process i to itself are not depicted as they can be assumed to be received in the next step. To allow for a quantitative assessment of the durations of the simulated rounds, we extend the environment using a probability space. Let ProbLoss(p) be the following probability distribution: The random variables δj,i (r) are pairwise independent, and for any two processes i = j, the probability that δj,i (r) = z is equal to (1 − p)z−1 · p, i.e., using p as the probability of a successful message 1
Formally, for any two processes i and j, let δj,i (r) − 1 be the smallest number 0 such that (1) process j sends a message m in its (Tj (r) + )th step and (2) process i receives m from j in its (Tj (r) + + 1)th step.
On the Performance of a Retransmission-Based Synchronizer
237
transmission, the first z − 1 tries of sending j’s round r message to i failed and the z th try was successful. Note that we can assume δi,i (r) = 1. For computational purposes we further introduce the probability distribution ProbLoss(p, M ), where M ∈ ∪{∞}, which is a variant of ProbLoss(p) where the number of tries per simulated round message until it is successfully received is bounded by M . Call M the maximum number of tries per round. Variable δj,i (r) can take values in the set {z ∈ | 1 z M }. For any two processes i = j, and for integers z with 1 z < M , the probability that δj,i (r) = z is (1 − p)z−1 · p. In the remaining cases, i.e., with probability (1 − p)M−1 , δj,i (r) = M . If M = ∞, this case vanishes. In particular, ProbLoss(p, ∞) = ProbLoss(p). We will see in Sections 3.3 and 4, that the error we make when calculating the expected duration of the simulated rounds in ProbLoss(p, M ) with finite M instead of ProbLoss(p) is small, even for small values of M .
Æ
Æ
3
Calculating the Expected Round Duration
The expected round duration of the presented retransmission scheme, in the case of ProbLoss(p, M ), is determined by introducing an appropriate Markov chain, and analyzing its steady state. To this end, we define a Markov chain Λ(r), for an arbitrary round r 1, that (1) captures enough of the dynamics of round construction to determine the round durations and (2) is simple enough to allow efficient computation of each of the process i’s expected round duration λi , defined by λi = E limr Ti (r)/r. Since for each process i and r 2, it holds that L(r − 1) Ti (r) L(r), we obtain the following equivalence: Proposition 1. If L(r)/r converges, then lim Ti (r)/r = lim L(r)/r. r→∞
r→∞
We can thus reduce the study of the processes’ average round durations to the study of the sequence L(r)/r as r → ∞. In particular, for any two processes i, j it holds that λi = λj = λ, where λ = E limr L(r)/r. 3.1
Round Durations as a Markov Chain
A Markov chain is a discrete-time stochastic process X(r) in which the probability distribution for X(r + 1) only depends on the value of X(r). We denote the transition probability from state Y to state X by PX,Y . A Markov chain that, by definition, fully captures the dynamics of the round durations is T (r), where T (r) is defined to be the collection of local round finishing times Ti (r) from Equation (1). However, directly using Markov chain T (r) for the calculation of λ is infeasible since Ti (r), for each process i, grows without bound in r, and thereby its state space is infinite. For this reason we introduce Markov chain Λ(r) which optimizes T (r) in two ways and which we use to compute λ: One can achieve a finite state space by considering differences of T (r), instead of T (r). This is one optimization we built into Λ(r) and only by it are we enabled to use the computer to calculate the expected round duration. The
238
T. Nowak, M. F¨ ugger, and A. K¨ oßler
other optimization in Λ(r), which is orthogonal to the first one, is that we do not record the local round finishing times (resp. the difference of local round finishing times) for every of the N processes, but only record the number of processes that are associated a given value. This reduces the size of the state space from M N to N+M−1 , which is significant, because in practical situations, it suffices M−1 to use modest values of M as will be shown in Section 4. We are now ready to define Λ(r). Its state space L is defined to be the set M of M -tuples (σ1 , . . . , σM ) of nonnegative integers such that z=1 σz = N . The M -tuples from L are related to T (r) as follows: Let #X be the cardinality of set X, and define σz (r) = # i | Ti (r) − L(r − 1) = z (2) for r 1, where we set L(0) = 0 to make the case r = 1 in (2) well-defined. Note that Ti (r) − L(r − 1) is always greater than 0, because δj,i (r) in Equation (1) is greater than 0. Finally, set Λ(r) = σ1 (r), . . . , σM (r) . (3) The intuition for Λ(r) is as follows: For each z, σz (r) captures the number of processes that start simulated round r, z steps after the last process started the last simulated round, namely r − 1. For example, in case of the execution depicted in Figure 1, σ1 (r) = 0, σ2 (r) = 1 and σ3 (r) = 2. Since algorithm A(B) always waits for the last simulated round message received, and the maximum number of tries until the message is correctly received is bounded by M , we obtain that σz (r) = 0 for z < 1 and z > M . Knowing σz (r), for each z with 1 z M , thus provides sufficient information (1) on the processes’ states in order to calculate the probability of the next state Λ(r + 1) = (σ1 , . . . , σM ), and (2) to determine L(r + 1) − L(r) and by this the simulated round duration for the last process. We first obtain: Proposition 2. Λ(r) is a Markov chain. In fact Proposition 2 even holds for a wider class of delay distributions δj,i (r); namely those invariant under permutation of processes. Likewise, many results in the remainder of this section are applicable to a wider class of delay distributions: For example, we might lift the independence restriction on the δj,i (r) for fixed r and assume strong correlation between the delays, i.e., for each process j and each round r, δj,i (r) = δj,i (r) for any two processes i, i .2 Let X(r) be a Markov chain with countable state space X and transition probability distribution P . Further, let π be a probability distribution on X . We call π a stationary distribution for X(r) if π(X) = Y ∈X PX,Y · π(Y ) for all X ∈ X . Intuitively, π(X) is the asymptotic relative amount of time in which Markov chain X(r) is in state X. Definition 1. Call a Markov chain good if it is aperiodic, irreducible, Harris recurrent, and has a unique stationary distribution. 2
Rajsbaum and Sidi [17] call this “negligible transmission delays”.
On the Performance of a Retransmission-Based Synchronizer
239
Proposition 3. Λ(r) is a good Markov chain. Denote by π the unique stationary distribution of Λ(r), which exists because of Proposition 3. Define the function σ : L → by setting σ(Λ) = max{z | σz = 0} where Λ = (σ1 , . . . , σM ) ∈ L. By abuse of notation, we write σ(r) instead of σ Λ(r) . From the next proposition follows that σ(r) = L(r)−L(r −1), i.e., σ(r) is the last process’ duration of simulated round r − 1. For example σ(r + 1) = 5 in the execution in Figure 1. Proposition 4. L(r) = rk=1 σ(k)
Ê
The following theorem is key for calculating the expected simulated round duration λ. We will use the theorem for the computation of λ starting in Section 3.2. It states that the simulated round duration averages L(r)/r up to some round r converge to a finite λ almost surely as r goes to infinity. This holds even for M = ∞, that is, if no bound is assumed on the number of tries until successful reception of a message. The theorem further relates λ to the steady state π of Λ(r). Let Lz ⊆ L denote the set of states Λ such that σ(Λ) = z. M Theorem 1. L(r)/r → λ with probability 1. It is λ = z=1 z · π(Lz ) < ∞. 3.2
Using Λ(r) to Compute λ
We now state an algorithm that, given parameters M = ∞, N , and p, computes the expected simulated round duration λ (see Theorem 1). In its core is a standard procedure to compute the stationary distribution of a Markov chain, in form of a matrix inversion. In order to utilize this standard procedure, we need to explicitly state the transition probability distributions PXY , which we regard as a matrix P . For ease of exposition we state P for the system of processes with probabilistic loop-back links, i.e., we do not assume that δi,i (r) = 1 holds. Later, we explain how to arrive at a formula for P in the case of the (more realistic) assumption of δi,i (r) = 1. A first observation yields that matrix P bears some symmetry, and thus some of the matrix’ entries can be reduced to others. In fact we first consider the transition probability from normalized Λ states only, that is, Λ = (σ1 , . . . , σM ) with σM = 0. In a second step we observe that a non-normalized state Λ can be transformed to a normalized state Λ = Norm(Λ) without changing its outgoing transition probabilities, i.e., for any state X in L, it holds that PX,Λ = PX,Λ : Thereby Norm is the function L → L defined by: (σ1 , . . . , σM ) if σM = 0 Norm(σ1 , . . . , σM ) = Norm(0, σ1 , . . . , σM −1 ) otherwise For example, assuming that M = 5, and considering the execution in Figure 1, it holds that Λ(r) = (0, 1, 2, 0, 0). Normalization, that is, right alignment of the last processes, yields Norm(Λ(r)) = (0, 0, 0, 1, 2).
240
T. Nowak, M. F¨ ugger, and A. K¨ oßler
Further, for any Λ = (σ1 , . . . , σM ) in L with σM = 0, and any 1 z M , let P ( z | Λ) be the conditional probability that a specific process i is in the set {i | Ti (r + 1) − L(r) z}, given that Λ(r) = Λ. We easily observe that i is in the set if and only if all the following M conditions are fulfilled: for each u, 1 u M : for all processes j for which Tj (r) − L(r − 1) = u (this holds for σu (r) many) it holds that δj,i (r) z + M − u. Therefore we obtain: P ( z | Λ(r)) = P (δ z + M − u)σu (r) , (4) 1uM
for all z, 1 z M . Let P (z | Λ) be the conditional probability that process i is in the set {i | Ti (r + 1) − L(r) = z}, given that Λ(r) = Λ. From Equation (4), we immediately obtain: P (1 | Λ) = P ( 1 | Λ) and P (z | Λ) = P ( z | Λ) − P ( z − 1 | Λ) ,
(5)
for all z, 1 < z M . We may finally state the transition matrix P : for each ), X, Y ∈ L, with X = (σ1 , . . . , σM ) and Y = (σ1 , . . . , σM N − z−1 σk
k=1 (6) PXY = P (z | Norm(Y ))σz . σz 1zM
Note that for a system where δi,i (r) = 1 holds, in Equation (4), one has the account for the fact that a process i definitely receives its own message after 1 step. In order to specify a transition probability analogous to Equation (4), it is thus necessary to know to which of the σk (r) in Λ(r), process i did count for, that is, for which k, Ti (r) − L(r − 1) = k holds. We then replace σk (r) by σk (r) − 1, and keep σu (r) for u = k. Formally, let P ( z | Λ, k), with 1 k M , be the conditional probability that process i is in the set {i | Ti (r + 1) − L(r) z}, given that Λ(r) = Λ, as well as Ti (r) − L(r − 1) = k. Then: P ( z | Λ(r), k) = P (δ z + M − u)σu (r)−1{k} (u) 1uM
where 1{k} (u) is the indicator function, having value 1 for u = k and 0 otherwise. Equation (5) can be generalized in a straightforward manner to obtain expressions for P (z | Λ, k). The dependency of P ( z | Λ(r), k) on k is finally accounted for in Equation (6), by additionally considering all possible choices of processes whose sum makes up σz . Let Λ1 , Λ2 , . . . , Λn be any enumeration of states in L. We write Pij = PΛi Λj and πi = π(Λi ) to view P as an n × n matrix and π as a column vector. By definition, the unique stationary distribution π satisfies (1) π = P ·π, (2) i πi = 1, and (3) πi 0. It is an elementary linear algebraic fact that these properties suffice to characterize π by the following formula: −1 ·e (7) π = P (n→1) − I (n→0)
On the Performance of a Retransmission-Based Synchronizer
241
where e = (0, . . . , 0, 1)T , P (n→1) is matrix P with its entries in the nth row set to 1, and I (n→0) is the identity matrix with its entries in the nth row set to zero. After calculating π, we can use Theorem 1 to finally determine the expected simulated round duration λ. The time complexity of this approach is determined by the matrix inversion of P . Its time complexity is within O(n3 ), where n is the number of states in the Markov chain Λ(r). Since the state space is given by the set of M -tuples +Mwhose entries are within {1, . . . , M } and whose sum is −1 N , we obtain n = NM . In Sections 3.4 and 4 we show that already small −1 values of M yield good approximations of λ, that quickly converge with growing M . This leads to a tractable time complexity of the proposed algorithm. 3.3
Results
The presented algorithm allows to obtain analytic expressions for λ for fixed N and M in terms of probability p. Figure 2 contains the expressions of λ(p, N ) for M = 2 and N equal to 2 and 3, respectively. For larger M and N , the expressions already become significantly longer. λ(p,2)= 6−6p+p 3−2p
2
2 3 +12p4 +24p5 −64p6 +22p7 +30p8 −22p9 +3p10 λ(p,3)= 2−8p+18p −16p 2 3 4 5 6 7 8 9 1−4p+9p −8p +6p +12p −27p +6p +12p −6p
Fig. 2. Expressions for λ(p, 2) and λ(p, 3) in a system with M = 2
4
4 Calc: M=4 Calc: M=3 Calc: M=2
3
2.5
2
3
2.5
2
1.5
1.5
1
Calc: M=4 Calc: M=3 Calc: M=2
3.5
average roundtime
average roundtime
3.5
0
0.2
0.4
0.6 p
(a) N = 2
0.8
1
1
0
0.2
0.4
0.6
0.8
1
p
(b) N = 4
Fig. 3. λ versus p in a system with different choices of N
Figures 3(a) and 3(b) show solutions of λ(p) for systems with N = 2 and N = 4, respectively. We observe that for high values of the probability of successful communication p, systems with different M have approximately same slope. Since real distributed systems typically have a high p value, we may approximate λ for higher M values with that of significantly lower M values. The effect is further investigated in Section 4 by means of Monte Carlo simulation.
242
3.4
T. Nowak, M. F¨ ugger, and A. K¨ oßler
Rate of Convergence
Theorem 1 states that L(r)/r converges to λ with probability 1, however it does not give a rate of convergence. We now present a lower bound on the speed of this convergence. The fundamental facts regarding the convergence speed of L(r)/r are: (1) The expected value of L(r)/r is λ + O(r−1 ) as r → ∞. (2) The variance of L(r)/r converges to zero; more precisely, it is O(r−1 ) as r → ∞. Chebyshev’s inequality provides a way of utilizing these two facts, and yields the following corollary. It bounds the probability for the event |L(r)/r − λ| A, where A is a positive real number. (A more general statement is [15, Theorem 5].) Corollary 1. For all A > 0, the probability that |L(r)/r − λ| A is O r−2 .
4
Simulations
In this section we study the applicability of the results obtained in the previous section to calculate the expected round duration the simulating algorithm in a distributed system with N processes in a p-lossy environment. The algorithm presented in Section 3.2, however, only yields results for M < ∞. Therefore, the question arises whether the solutions for finite M yield (close) approximations for M = ∞. Hence, we study the behavior of the random process T (r)/r for increasing r, for different M , with Monte Carlo simulations carried out in Matlab. We considered the behavior of a system of N = 5 processes, for different parameters M and p. The results of the simulation are plotted in Figures 4(a)– 4(c). They show: (1) The expected round duration λ, computed by the algorithm presented in Section 3.2 for a system with M = 4, drawn as a constant function. (2) The simulation results of sequence T1 (r)/r, that is process 1’s round starts, relative to the calculated λ, for rounds 1 r 150, for two systems: one with parameter M = 4, the other with parameter M = ∞, averaged over 500 runs. In all three cases, it can be observed that the simulated sequence with parameter M = 4 rapidly approximates the theoretically predicted rate for M = 4. From the figures we further conclude that calculation of the expected simulated round duration λ for a system with finite, and even small, M already yields good approximations of the expected rate of a system with M = ∞ for p > 0.75, while for practically relevant p 0.99 one cannot distinguish the finite from the infinite case. To further support this claim, we compared analytically obtained λ values for several settings of parameters p, N , and small M to the rates obtained from 100 Monte-Carlo simulation runs each lasting for 1000 rounds of the corresponding systems with M = ∞: The resulting Figures 5(a)–5(c) visualizes this comparison: the figures show the dependency of λ on the number of processes N , and present the statistical data from the simulations as boxplots. Note that for p = 0.75 the discrepancy between the analytic results for M = 4 and the simulation results for M = ∞ is already small, and for p = 0.99 the analytic results for all choices of M are placed inbetween the lower the upper quartile of the simulation results.
On the Performance of a Retransmission-Based Synchronizer
λ
λ
λ
0.5λ
average roundtime
1.5λ
average roundtime
1.5λ
average roundtime
1.5λ
0.5λ
0.5λ
Sim: p=0.50 M=4 Sim: p=0.50 M=∞ Calc: p=0.50 M=4 0
1
20
40
60
80 rounds
100
120
140
243
Sim: p=0.75 M=4 Sim: p=0.75 M=∞ Calc: p=0.75 M=4 0
1
20
(a) p = 0.5
40
60
80 rounds
100
120
Sim: p=0.99 M=4 Sim: p=0.99 M=∞ Calc: p=0.99 M=4 0
140
1
20
(b) p = 0.75
40
60
80 rounds
100
120
140
9
10
(c) p = 0.99
Fig. 4. T1 (r)/r versus r in systems with different p 6
3.5
1.5
Sim: p=0.5 M=∞ Calc: p=0.5 M=4 Calc: p=0.5 M=3 Calc: p=0.5 M=2
5.5
Sim: p=0.75 M=∞ Calc: p=0.75 M=4 Calc: p=0.75 M=3 Calc: p=0.75 M=2
5
3
1.4
4.5
1.35
3.5
3
2.5
average roundtime
4
average roundtime
average roundtime
Sim: p=0.99 M=∞ Calc: p=0.99 M=4 Calc: p=0.99 M=3 Calc: p=0.99 M=2
1.45
2
2.5
1.3
1.25
1.2
1.15
2
1.5
1.1
1.5
1.05
1
1 2
3
4
5 6 7 number of nodes
8
9
10
(a) p = 0.5
1 2
3
4
5 6 7 number of nodes
8
(b) p = 0.75
9
10
2
3
4
5 6 7 number of nodes
8
(c) p = 0.99
Fig. 5. λ versus N in systems with different p
5
Related Work
The notion of simulating a stronger system on top of a weaker one is common in the field of distributed computing [1, Part II]. For instance, Neiger and Toueg provide automatic translation technique that turns a synchronous algorithm B that tolerates benign failures into an algorithm A(B) that tolerate more severe failures. Dwork, Lynch, and Stockmeyer [9] use the simulation of a round structure on top of a partially synchronous system, and Charron-Bost and Schiper [8] systematically study simulations of stronger communication axioms in the context of round-based models.
244
T. Nowak, M. F¨ ugger, and A. K¨ oßler
In contrast to randomized algorithms, like Ben-Or’s consensus algorithm [5], the notion of a probabilistic environment , as we use it, is less common in distributed computing: One of the few exceptions is Bakr and Keidar [4] who provide practical performance results on distributed algorithms running on the Internet. On the theoretical side, Bracha and Toueg [7] consider the Consensus Problem in an environment, for which they assume a nonzero lower bound on the probability that a message m sent from process i to j in round r is correctly received, and that the correct reception of m is independent from the correct reception of a message from i to some process j = j in the same round r. While we, too, assume independence of correct receptions, we additionally assume a constant probability p > 0 of correct transmission, allowing us to derive exact values for the expected round durations of the presented retransmission scheme, which was shown to provide perfect rounds on top of fair-lossy executions. The presented retransmission scheme is based on the α-synchronizer introduced by Awerbuch [2] together with correctness proofs for asynchronous (non-faulty) communication networks of arbitrary structure. However, since Awerbuch did not assume a probability distribution on the message receptions, only trivial bounds on the performance could be stated. Rajsbaum and Sidi [17] extended Awerbuch’s analysis by assuming message delays to be negligible, and processes’ processing times to be distributed. They consider (1) the general case as well as (2) exponential distribution, and derive performance bounds for (1) and exact values for (2). In terms of our model their assumption translates to assuming maximum positive correlation between message delays: For each (sender) process j and round r, δj,i (r) = δj,i (r) for any two (receiver) processes i, i . They then generalize their approach to the case where δj,i (r) comprises a dependent (the processing time) and an independent part (the message delay), and show how to adapt the performance bounds for this case. However, only bounds and no exact performance values are derived for this case. Rajsbaum [16] presented bounds for the case of identical exponential distribution of transmission delays and processing times. Bertsekas and Tsitsiklis [6] state bounds for the case of constant processing times and independently, exponentially distributed message delays. However, again, no exact performance values were derived. Our model comprises negligible processing times and transmission faults, which result in a discrete distribution of the effective transmission delays δj,i (r). Interestingly, with one sole exception [18] which considers the case of a 2processor system only, we did not find any published results on exact values of the expected round durations in this case. The nontriviality of this problem is indicated by the fact that finding the expected round duration is equivalent to finding the exact value of the Lyapunov exponent of a nontrivial stochastic maxplus system [10], which is known to be hard problem (e.g., [3]). In particular, our results can be translated into novel results on stochastic max-plus systems. Acknowledgements. The authors would like to thank Martin Biely, Ulrich Schmid, and Martin Zeiner for helpful discussions. The computational results presented have been achieved in part using the Vienna Scientific Cluster (VSC).
On the Performance of a Retransmission-Based Synchronizer
245
References 1. Attiya, H., Welch, J.: Distributed Computing: Fundamentals, Simulations and Advanced Topics, 2nd edn. John Wiley & Sons, Chichester (2004) 2. Awerbuch, B.: Complexity of Network Synchronization. J. ACM 32, 804–823 (1985) 3. Baccelli, F., Hong, D.: Analytic Expansions of Max-Plus Lyapunov Exponents. Ann. Appl. Probab. 10, 779–827 (2000) 4. Bakr, O., Keidar, I.: Evaluating the Running Time of a Communication Round over the Internet. In: 21st Annual ACM Symposium on Principles of Distributed Computing. ACM, New York (2002) 5. Ben-Or, M.: Another Advantage of Free Choice: Completely Asynchronous Agreement Protocols. In: 2nd Annual ACM Symposium on Principles of Distributed Computing. ACM, New York (1983) 6. Bertsekas, D.P., Tsitsiklis, J.N.: Parallel and Distributed Computation: Numerical Methods. Prentice Hall, Englewood Cliffs (1989) 7. Bracha, G., Toueg, S.: Asynchronous Consensus and Broadcast Protocols. J. ACM 32, 824–840 (1985) 8. Charron-Bost, B., Schiper, A.: The Heard-Of Model: Computing in Distributed Systems with Benign Faults. Distrib. Comput. 22, 49–71 (2009) 9. Dwork, C., Lynch, N., Stockmeyer, L.: Consensus in the Presence of Partial Synchrony. J. ACM 35, 288–323 (1988) 10. Heidergott, B.: Max-Plus Linear Stochastic Systems and Pertubation Analysis. Springer, Heidelberg (2006) 11. Lamport, L., Shostak, R., Pease, M.: The Byzantine Generals Problem. ACM T. Progr. Lang. Sys. 4, 382–401 (1982) 12. Lynch, N.A.: Distributed Algorithms. Morgan Kaufmann, San Francisco (1996) 13. Meyn, S., Tweedie, R.L.: Markov Chains and Stochastic Stability. Springer, Heidelberg (1993) 14. Neiger, G., Toueg, S.: Automatically Increasing the Fault-Tolerance of Distributed Algorithms. J. Algorithm 11, 374–419 (1990) 15. Nowak, T., F¨ ugger, M., K¨ oßler, A.: On the Performance of a Retransmission-based Synchronizer. Research Report 9/2011, TU Wien, Inst. f. Technische Informatik (2011), http://www.vmars.tuwien.ac.at/documents/extern/2899/paper.pdf 16. Rajsbaum, S.: Upper and Lower Bounds for Stochastic Marked Graphs. Inform. Process. Lett. 49, 291–295 (1994) 17. Rajsbaum, S., Sidi, M.: On the Performance of Synchronized Programs in Distributed Networks with Random Processing Times and Transmission Delays. IEEE T. Parall. Distr. 5, 939–950 (1994) 18. Resing, J.A.C., de Vries, R.E., Hooghiemstra, G., Keane, M.S., Olsder, G.J.: Asymptotic Behavior of Random Discrete Event Systems. Stochastic Process. Appl. 36, 195–216 (1990)
Distributed Coloring Depending on the Chromatic Number or the Neighborhood Growth Johannes Schneider and Roger Wattenhofer Computer Engineering and Networks Laboratory, ETH Zurich, 8092 Zurich, Switzerland
Abstract. We deterministically compute a Δ + 1 coloring in time O(Δ5c+2 · (Δ5 )2/c /(Δ1 ) + (Δ1 ) + log∗ n) and O(Δ5c+2 · (Δ5 )1/c /Δ + Δ + (Δ5 )d log Δ5 log n) for arbitrary constants d, and arbitrary constant integer c, where Δi is defined as the maximal number of nodes within distance i for a node and Δ := Δ1 . Our greedy algorithm improves the state-of-the-art Δ + 1 coloring algorithms for a large class of graphs, e.g. graphs of moderate neighborhood growth. We also state and analyze a randomized coloring algorithm in terms of the chromatic ∗ number, the run time and the used colors. If Δ ∈ Ω(log1+1/ log n n) 1+1/ log∗ n and χ ∈ O(Δ/ log n) then our algorithm executes in time O(log χ + log∗ n) with high probability. For graphs of polylogarithmic chromatic number the analysis reveals an exponential gap compared to √ the fastest Δ + 1 coloring algorithm running in time O(log Δ + log n). The algorithm works without knowledge of χ and uses less than Δ colors, i.e., (1 − 1/O(χ))Δ with high probability. To the best of our knowledge this is the first distributed algorithm for (such) general graphs taking the chromatic number χ into account.
1
Introduction
Coloring is a fundamental problem with many applications. Unfortunately, even in a centralized setting, where the whole graph is known, approximating the chromatic number (the minimal number of needed colors), is currently computationally infeasible for general graphs and believed to take exponential running time. Thus, basically any reduction of the used colors below Δ + 1 – even just to Δ – is non-trivial in general. Looking at the problem in a distributed setting, i.e., without global knowledge of the graph, makes the problem harder, since coloring is not a purely “local” problem, i.e., nodes that are far from each other have an impact on each other (and the chromatic number). Therefore, it is not surprising that all previous work has targeted to compute a Δ + 1 coloring in general graphs as fast as possible (or resorted to very restricted graph classes). However, this somehow overlooks the original goal of the coloring problem, i.e., use as little colors as possible. Though in distributed computing the focus is often on communication, in many cases keeping the number of colors low outweighs the importance of minimizing communication. For example, a TDMA schedule A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 246–257, 2011. c Springer-Verlag Berlin Heidelberg 2011
Distributed Coloring Depending on the Chromatic Number
247
can be derived from a (2-hop) coloring. The length of the schedule (and thus the throughput of the network) is determined by the number of employed colors. In this paper, we also consider fast distributed computation of Δ + 1 colorings in the first part. In the second part we are interested in both using less than Δ + 1 colors and efficient computation. For sparse graphs, such as trees and planar graphs, as well as for dense graphs, e.g. cliques and unit disk graphs (UDG), efficient distributed algorithms are known that have both “good” time complexity and “good” approximation ratio of the chromatic number. Sparse graphs typically restrict the number of edges to be linear in the number of nodes. Unit disk graphs restrict the number of independent nodes within distance i to be bounded by a polynomial function f (i). Our requirements on the graph are much less stringent than for UDGs, i.e., we do not restrict the number of independent nodes to grow dependent on the distance only. We allow for growth of the neighborhood dependent on the distance and also on Δ, i.e., n. For illustration, if the number of nodes within distance i is bounded by Δ1+(i−1)/100 our deterministic algorithm improves on the state-of-the-art algorithms running in linear time in Δ by more than a factor of Δ1/10 .1 Note, for any graph the size of the neighborhood within distance i is bounded by Δi . Additionally, if the size of the neighborhood within distance i of a graph is lower bounded by Δc·i for an aribtrary constant c then the graph can have only small diameter, i.e. O(log Δ). In such a case a trivial algorithm collecting the whole graph would allow for a coloring exponentially faster than the current state of the art deterministic algorithms running in time O(Δ + log∗ n) for small Δ already. Therefore, we believe that for many graphs that are considered “difficult” to color we significantly improve on the best known algorithms. The guarantee on the number of used colors is the same as in previous work, i.e., Δ + 1. Despite the hardness of the coloring problem, intuitively, it should be possible to color a graph with small chromatic number with fewer colors and also a lot faster than a graph with large chromatic number. Our second (randomized) algorithm shows that this in indeed the case. The algorithm works without knowledge of the chromatic number χ.
2
Model and Definitions
Communication among nodes is done in synchronous rounds without collisions, i.e., each node can exchange one distinct message with each neighbor. Nodes start the algorithm concurrently. The communication network is modeled with a graph G = (V, E). The distance between two nodes u, v is given by the length of the shortest path between nodes u and v. For a node v its neighborhood N r (v) represents all nodes within distance r of v (not including v itself). By N (v) we denote N 1 (v) and by N+ (v) := N (v) ∪ v. The degree d(v) of a node v is defined as |N (v)|, d+ (v) := |N+ (v)|, Δ := maxu∈V d(u) and Δi := maxu∈V |N i (u)|. By Gi = (V, E i ) of G = (V, E) we denote the graph where for each node v ∈ V there is an edge to each node u ∈ N i (v). In a (vertex) coloring any two adjacent 1
Generally, for a graph with Δ5c+2 · (Δ5 )2/c /(Δ1 ) + log ∗ n = (Δ1 ) for any choice of parameters and c, the best known run time (linear in Δ) is cut by a factor Δ1− .
248
J. Schneider and R. Wattenhofer
nodes u, v have a different color. A set T ⊆ V is said to be independent in G if no two nodes u, v ∈ T are neighbors. A set R ⊆ V is (α, β)-ruling if every two nodes in the set R have distance at least α and any node not in the set R has a node in the set within distance β. The function log∗ n states∗ how often one has to take the (iterated) logarithm to get at most 1, i.e., log(log n) n ≤ 1. The term “ with high probability” abreviated by w.h.p. denotes a number 1 − 1/nc for an arbitrary constant c. Our algorithm is non-uniform, i.e., every node knows an upper bound on the total number of nodes n and the maximal degree Δ. We also use the following Chernoff bound: Theorem 1. The probability that the number X of occurred independent events Xi ∈ {0, 1}, i.e., X := Xi , is less than (1 − δ) times a with a ≤ E[X] can be 2 bounded by P r(X < (1 − δ)a) < e−aδ /2 . The probability that the sum is more than (1 + δ)b with b ≥ E[X] with δ ∈ [0, 1] can be bounded by P r(X > (1 + δ)b) < 2 e−bδ /3 . Corollary 2. The probability that the number X of occurred independent events Xi ∈ {0, 1}, i.e., X := Xi , is less than E[X]/2 is at most e−E[X]/8 and the probability that is more than 3E[X]/2 is bounded by e−E[X]/12.
3
Related Work
Distributed coloring is a well studied problem in general graphs in the message passing model e.g. [3,4,15,13,12,11]. There is a tradeoff between the number of used colors and the running time of an algorithm. Even allowing a constant factor more colors can have a dramatic influence on the running time of a coloring algorithm, i.e., in [15] the gap between the running time of an O(Δ) and an Δ + 1 coloring algorithm can be more than exponential for randomized √ algorithms. More precisely, a Δ + 1 coloring is computed in time O(log Δ + log n) ∗ and an O(Δ + log1+1/ log n n) coloring in time O(log∗ n). When using O(Δ2 ) colors, a coloring can be computed in time O(log∗ n) [12], which is asymptotically optimal for constant degree graphs due to a lower bound of time Ω(log∗ n) for three coloring of an n-cycle. Using O(Δ1+o(1) ) colors [4] gives a deterministic algorithm running in time O(f (Δ) log Δ log n) where f (Δ) = ω(1) is an arbitrarily slow growing function in Δ. To this date, the fastest deterministic algorithm to compute a Δ + 1 coloring in general graphs requires O(Δ + log∗ n) √ O(1)/ log n [3,10] or n time [13]. Algorithm [13] computes graph decompositions recursively until the maximum degree in the graph is sufficiently small. To deal with large degree vertices, a ruling forest is computed for each decomposition and each tree is collapsed into a single vertex. The algorithms [3,10] improved on [11] by a factor of log Δ through employing defective colorings, i.e., several nodes initially choose the same color. However, through multiple iterations the number of adjacent nodes with the same color is reduced until a proper coloring is achieved. In [4] defective colorings were combined with tree decompositions
Distributed Coloring Depending on the Chromatic Number
249
[2]. In comparison, our deterministic algorithm improves the linear running time in Δ by a factor Δd for a constant d for a large class of graphs by iteratively computing ruling sets, such that a node in the ruling set can color its two hop neighborhood. Overall Δ + 1 coloring has probably attracted more attention than employing O(Δ) or more colors. Using less than Δ + 1 colors is not possible for complete graphs – not even in a centralized setting, where the entire graph is known. An algorithm in [9] parallelizes Brooks’ sequential algorithm to obtain a Δ coloring from a Δ + 1 coloring. In a centralized setting the authors of [1] showed how to approximate a three-colorable graph using O(n0.2111 ) colors. Some centralized algorithms iteratively compute large independent sets, e.g. [5]. It seems tempting to apply the same ideas in a distributed setting, e.g. a parallel minimum greedy algorithm for computing large independent sets is given in [8]. It has approximation ratio (Δ + 2)/3. However, the algorithm runs in time polynomial in Δ and logarithmic in n and thus is far from efficient. For some restricted graph classes, there are algorithms that allow for better approximations in a distributed setting. A Δ/k coloring for Δ ∈ O(log1+c n) for a constant c with k ≤ c1 (c) log Δ where constant c1 depends on c is given in [7]. It works for quite restricted graphs (only), i.e., graphs that are Δ-regular, triangle free and Δ ∈ O(log1+c n). Throughout the algorithm a node increases its probability to be active. An active node picks a color uniformly at random. The algorithm runs in O(k + log n/ log Δ) rounds.Constant approximations of the chromatic number are achieved for growth bounded graphs (e.g. unit disk graphs) [14] and for many types of sparse graphs [2]. In [6] the existence of graphs of arbitrarily high girth was shown such that χ ∈ Ω(Δ/ log Δ). Since graphs of high girth locally look like trees and trees can be colored with two colors only, this implies that coloring is a non-local phenomenon. Thus, a distributed algorithm that only knows parts of the graph and is unaware of global parameters such as χ, has a clear disadvantage compared to a centralized algorithm. We give a randomized coloring algorithm in terms of the chromatic number of a graph which uses ideas from [15]. Given a set of colors {0, 1, . . . , f (Δ)} for an arbitrary function f with f (x) ≥ x [15] computes an f (x) + 1 coloring. The run time depends on f , i.e. for f (Δ) := Δ Algorithm DeltaPlus1Coloring[15] √ ∗ takes time O(log Δ + log n). For f (Δ) := O(Δ + log1+1/ log n n) Algorithm ConstDeltaColoring[15] takes only O(log∗ n) time. Both Algorithms from [15] operate analogously: In each communication round a node chooses a subset of all available colors and keeps one of the colors, if no neighbor has chosen the same color. For our deterministic coloring we employ the (deterministic) Algorithm CoordinateTrials[15] for computing ruling sets from [15] as a subroutine. Due to Theorem 16 in [15] a (2, c)-ruling set is computed using CoordinateTrials(d,c) in time 2c d1/c from an initial coloring {0, 1, . . . , d}. The algorithm partitions the digits of a node’s label, e.g. color, into c equal parts (with the same number of digits). A node v computes a rank Rank(v) consisting of c bits in each round j, where bit i is 1 if the ith part equals round j and 0 otherwise. Based on the rank a node either continues the algorithm (and eventually joins the ruling set)
250
J. Schneider and R. Wattenhofer
or stops. Nodes with rank larger 0 compete to continue and force other nodes to stop the algorithm. More precisely, a node v tells its neighbors with distinct rank to halt the algorithm, if in the kth round of the competition its Rank(v) equals k.
4
Deterministic Coloring
For coloring one can either let each node decide itself on a color or decompose the graph into (disjoint) clusters and elect a leader to coordinate the coloring in a cluster. Our deterministic algorithm follows the later strategy by iteratively computing ruling sets. Each node in the set can color itself and (some) nodes up to distance 2 from it (in a greedy manner). To make fast progress, only nodes can join the ruling set that color many nodes. Once, no node has sufficiently many nodes to color within distance two, i.e., less than Δ (for a parameter of the algorithm), the nodes switch to another algorithm [3,10]. When a node v is in the ruling set, it gets to know all nodes N 3 (v) and assigns colors to all uncolored nodes N 2 (v) by taking into account previously assigned colors. Node v can assign colors, for instance, in a greedy manner, i.e., it looks at a node u ∈ N 2 (v) and picks the smallest color that is not already given to a neighbor of w ∈ N (u). Potentially, two nearby nodes u, v in the ruling set might concurrently assign the same colors two adjacent nodes, e.g. node u assigns 1 to x and node v assigns 1 to y and x, y are neighbors. To prevent this problem any two nodes u, v in the ruling-set must have distance at least 6 to avoid that neighbors are potentially assigned the same color. Thus, the algorithm computes a (6, 5k)- ruling set, where k is a parameter of the ruling-set algorithm [15]. In fact, the ruling-set algorithm from [15] computes only a (2, k)-ruling set for the graph G. However, if the ruling set is computed on the graph Gi then we get a (1 + i, ik)-ruling set. Note that any algorithm working on the graph Gi can be run by using the graph G at the price of prolonging the algorithm by a factor of i and, potentially, requiring larger messages. This is because a message between two adjacent nodes u, v in Gi might have to be forwarded along up to i edges in G and a single node might have to forward several messages at a time from its neighbors. Computing a (6, 5k)-ruling set in turn demands that two nodes u, v within distance 5 have distinct labels, therefore we start out by computing an O(|N 5 (v)|2 ) coloring in the graph G5 using [12] (or [4] to compute an O(|N 5 (v)|) coloring). After the initial coloring, a node participates in iteratively computing (6, 5k)ruling sets until it has color less than Δ + 1, or it and all neighbors have less than Δ neighbors with color larger than Δ for some parameter . The remaining nodes (with color larger Δ) are taken care of using [3,10]. Lemma 1. A (6, 5c)-ruling set is computed in time O(|N 5 (v)|2/c ) (Line 1 Algorithm RulingColoring). Proof. Due to Theorem 16 in [15] a (2, c)-ruling set can be computed deterministically using Algorithm CoordinateTrials(d,c) in time 2c d1/c in a graph G
Distributed Coloring Depending on the Chromatic Number
251
Algorithm RulingColoring for arbitrary and any integer k 1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
col(v) := Compute an O(|N 5 (v)|2 ) coloring in the graph G5 using [12] while col(v) > Δ ∧ ∃u ∈ N+ (v) with |{w ∈ N (u)|col(w) > Δ}| > Δ do Compute a (6, 5k)-ruling set R using [15] if v ∈ ruling set R then for all w ∈ N+ (v) with |{x ∈ N(w)|col(x) > Δ}| > Δ do (Greedily) color all nodes u ∈ N (w) for which col(u) > Δ end for end if end while Execute Algorithm [3] if col(v) > Δ
from an initial d + 1 coloring. The algorithm only requires that two adjacent nodes have distinct colors. Since a node v has a distinct color from any node u ∈ N 5 (v), any two adjacent nodes in G5 have distinct colors. Thus we can run CoordinateTrials(|N 5 (v)|2 , c) to compute a (2, c)-ruling set in G5 , i.e., a (6, 5c)ruling set in G, in time O(c2c |N 5 (v)|2/c ) = O(|N 5 (v)|2/c ), since c is a constant. Two nodes that are adjacent in G5 have distance 1 to 5 in G. If two nodes are at distance 2 in G5 then they are at distance 6 to 10 in G. Thus, we get a (6, 5c)ruling set, since any two nodes in G5 at distance 2 have distance at least 6 in G5 and any two nodes at distance c in G5 have distance at most 5c in G. Theorem 3. Algorithm RulingColoring computes a Δ + 1 coloring in time O(Δ5c+2 · (Δ5 )2/c /Δ + Δ + log∗ n). Proof. Any node v that participates in computing a ruling set, can color at least Δ nodes within distance 5c + 2. This is because a node only takes part in the computation, if there is a node u ∈ N+ (v) with at least Δ uncolored neighbors. If a node enters the ruling set it can color itself and all nodes w ∈ N (u). By definition of a (6, 5c)-ruling set any two nodes have distance 6. Therefore, if all nodes in the ruling set color nodes at distance 2 from them, there will not be any color conflicts. Furthermore, every node gets a node in the ruling set within distance 5c. Any node that has more than Δ uncolored neighbors, gets at least Δ colored nodes within distance 5c + 2 by computing one ruling set. The total time until node v gets colored or has less than Δ colored neighbors is given by the following expression: The total number of nodes |N 5c+2 (v)| ≤ Δ5c+2 within distance 5c + 2 divided by the number of nodes that get colored for a computation of a ruling set, i.e., at least Δ , multiplied by the time it takes to color the nodes and to compute one ruling set, i.e., O((Δ5 )2/c ) (see Lemma 1). In total this results in time O(Δ5c+2 /Δ · (Δ5 )2/c ). To color the remaining nodes, i.e., at most Δ neighbors of each node, using [3] (or [10]) takes time O(Δ + log∗ n). Computing an O(|N 5 (v)|2 ) coloring in graph G5 using [12] takes time O(log∗ n). Depending on the maximal degree Δ, it might be better to compute an (initial) O(|N 5 (v)|) coloring in time O((Δ5 )c0 log Δ5 log n) for an arbitrary small
252
J. Schneider and R. Wattenhofer
constant c0 using [4]. The time complexity changes to O(Δ5c+2 · (Δ5 )1/c /Δ + Δ + (Δ5 )d log Δ5 log n) for arbitrary small d.
5
Coloring Depending on the Chromatic Number
The algorithm (but not the analysis) itself is straight forward without many novel ideas. In the first two rounds a node attempts to get a color from a set with less than Δ colors. Then, (essentially) coloring algorithms from [15] are used to color the remaining nodes. Let Δ0 := Δ be the maximal size of a neighborhood in the graph, where all nodes are uncolored, and let N (v) be all uncolored neighbors of node v (in the current iteration). The algorithm lets an uncolored node v be a active twice with a fixed constant probability 1/c1 . An active node chooses (or picks) a random color from all available colors in the interval [0, Δ0 /2−1]. Node v obtains its color and exits the algorithm, if none of its neighbors N (v) has chosen the same color. After the initial two attempts to get colored each node v computes how many neighbors have been colored and how many colors have been used. The difference denotes the number of “conserved” colors nc (v). The algorithm can use the conserved colors to either speed up the running time, since more available colors render the problem simpler, e.g. allow for easier symmetry breaking, or to reduce the number of used colors as much as possible. In Algorithm FastRandColoring we spend half of the conserved colors for fast execution and preserve the other half to compute a coloring using Δ0 + 1 − nc (v)/2 colors. A node v repeatedly picks uniformly at random an available color from [0, Δ0 + 1 − nc (v)/2] using Algorithm DeltaPlus1Coloring until the number of available colors is at least a factor two larger than the number of uncolored neighbors. Afterwards it executes Algorithm ConstantDeltaColoring [15] using 2Δ colors. Algorithm FastRandColoring 1: col(v) := none 2: for i = 0..1 do 3: choice(v) := With probability 1/c1 random color from interval [0, Δ0 /2 − 1] else none 4: if choice(v) = none ∧ u ∈ N (v), s.t.choice(u) = choice(v) ∨ col(u) = choice(v) then col(v) := choice(v) and exit end if 5: end for 6: nc (v) := (Δ − |N (v)|) − |{col(u)|u ∈ N(v)}| 7: C(v) := [0, max(3Δ0 /4, Δ0 + 1 − nc (v)/2] \ {col(u)|u ∈ N (v)} {available colors} 8: Execute Algorithm DeltaPlus1Coloring [15] until C(v) ≥ 2|N (v)| 9: Execute Algorithm ConstDeltaColoring [15]
If an event occurs with high probability then conditioning on the fact that the event actually took place does not alter the probability of other likely events much as shown in the next theorem. It is a (slight) generalization of Theorem 2 from [15] proven in [16].
Distributed Coloring Depending on the Chromatic Number
253
Theorem 4. For nk0 (dependent) events Ei with i ∈ {0, ..., nk0 − 1} and constant k0 , such that each event Ei occurs with probability P r(Ei ) ≥ 1 − 1/nk for k > k0 + 2, the probability that all events occur is at least 1 − 1/nk−k0 −2 . Consider any coloring of the graph G using the minimal number of colors χ. Let Sc be a set of nodes having color c ∈ [0, χ − 1] for this coloring. For a node v with color c for this optimal coloring, we have v ∈ Sc . Let choice i ≥ 0 (of colors) be the (i + 1)-st possibility where a node could have picked a color, i.e., iteration i of the for-loop of Algorithm FastRandColoring. Let the set CSi be all distinct colors that have been obtained by a set of nodes S for any choice j ≤ i, i.e. CSi := {c|∃u ∈ S, s.t. col(u) = c after iteration i}. We do not use multisets here, i.e. a color c can only occur once in CSi . Let PSi be all nodes in S that make a choice in iteration i,i.e., PSi := {c|∃u ∈ S, s.t. choice(u) = c in iteration i}. Let CPSi be all colors that have been chosen (but not yet obtained) by a set of nodes S in iteration i, i.e., CPSi := {c|∃u ∈ PSi , s.t. choice(u) = c in iteration i}. By definition, |CPSi | ≤ |PSi |. To deal with the interdependence of nodes we follow the idea of stochastic domination. If X is a sum of random binary variables Xi ∈ {0, 1}, i.e., X := X , with probability distributions A, B and P rA (Xi = 1|X0 = x0 , X1 = i i x1 , ..., Xi−1 = xi−1 ) ≥ P rB (Xi = 1|X0 = x0 , X1 = x1 , ..., Xi−1 = xi−1 ) = p for any values of x0 , x1 , ..., xi−1 , we can apply a Chernoff bound to lower bound P rA (X ≥ x) by a sum of independent random variables Xi , where Xi = 1 with probability p. Theorem 5. After choice i ∈ [0, 1] for every node v holds w.h.p.: The colored nodes CS1 of any set S ∈ N (v)∪{Sc ∩N (v)|c ∈ [0, χ−1]} with |S| ≥ c2 log n fulfill |S|/(16c1 ) ≤ |CS1 | ≤ 3|S|/c1 with c1 > 32. The number of nodes |PS1 | making a choice is at least |S|/(4c1 ) and at most 3|S|/(2c1). Proof. Consider a set S ∈ {Sc ∩ N (v)|c ∈ [0, χ − 1]} of nodes for some node v. For i choices we expect (up to) i|S|/c1 nodes to make a choice. Using the Chernoff bound from Corollary 2 the number of nodes that pick a color deviates by no more than one half of the expectation with probability 1 − 2i/8|S|/c1 ≥ 1 − 2i/8c2 log n/c1 = 1−1/nc3 for a constant c3 := ic2 /(8c1 ). Thus, at most 3i|S|/(2c1) neighbors of v make a choice and potentially get colored with probability 1 − 1/nc3 . Using Theorem 4 this holds for all nodes with probability 1 − 1/nc3 −3 , which yields the bounds |PS1 | ≤ 3|S|/(2c1 ) and |CS1 | ≤ 3|S|/c1 . For choice i w.h.p. the number of nodes that make a choice is therefore in [a, b] := [1/2 · (1 − 3i/(2c1 )) · |S|/c1 , 3|S|/(2c1 )]. The lower bound, i.e. a ≤ |PSi |, follows if we assume that for each choice j < i at most 3|S|/(2c1 ) nodes get colored, which happens w.h.p.. Thus, after i−1 choices at least (1−3i/(2c1))·|S| nodes can make a choice, i.e. are uncolored. We expect a fraction of 1/c1 to choose a color. Using Corollary 2 the nodes that make a choice is at least half the expected number w.h.p.. Thus, for choice 1 we have for c1 > 32 and a := (1 − 3/(2c1 ))/(2c1 ) · |S|: |S|/(4c1 ) ≤ a ≤ |PS1 |. Consider an arbitrary order w0 , w1 , ..., w|S|−1 of nodes S. We compute the probability that node wk ∈ S obtains a distinct color for choice i from all previous
254
J. Schneider and R. Wattenhofer
nodes w0 , w1 , ..., wk−1 ∈ S. The probability is minimized, if all k − 1 nodes have distinct colors and k is large. Since k ≤ b = 3|S|/(2c1 ) we have p(col(wk ) ∈ [0, Δ0 /2] \ Sw0 ,w1 ,...,wk−1 ) ≥ p(col(wk ) ∈ [0, Δ0 /2] \ Sw0 ,w1 ,...,wb−1 ) ≥ 1/c1 · (1 − b/(Δ0 /2) ≥ (1 − 3/Δ0 /(2c1 )/(Δ0 /2))/c1 = 1/c4 with constant c4 := 1/c1 · (1 − 3/c1 ). The lower bound for the probability of 1/c4 holds for any k ∈ [0, b − 1] and any outcome for nodes Sw0 ,w1 ,...,wk−1 . Thus, to lower bound the number of distinct colors |CS | that are obtained by nodes in S we assume that the number of nodes that make a choice is only a and that each node that makes a choice gets a color with probability 1/c4 (independent of the choices of all other nodes). Using the Chernoff bound from Corollary 2 gives the desired result for a set S. In total there are n nodes and we have to consider at most 1 + χ ≤ n + 2 sets per node. Using Theorem 4 for n · (n + 1) events each occurring w.h.p. completes the proof. Next we consider a node v and prove that for the second attempt of all uncolored nodes u ∈ Sc ∩ N (v) a constant fraction of colors taken by independent nodes w ∈ Sc ∩ N (v) \ {u} from u are not taken (or chosen) by its neighbors y ∈ N (u). Theorem 6. For the second choice let E(c) be the event that for a node 1 v for each uncolored node u ∈ N (v) ∩ Sc holds |(CPN1 (u) ∪ CN (u) ) ∩ 1 CN (v)∩Sc | ≤ 3/4|CN (v)∩Sc | for |N (v) ∩ Sc | ≥ c2 log n. Event E(c) occurs given c1 ∈X⊆[0,χ],|N (v)∩Sc |≥c2 log n E(c1 ) w.h.p. for an arbitrary set X ⊆ [0, χ]. 1
Proof. Consider a colored node w ∈ Sc ∩N (v) for some node v, i.e. col(w) = none. We compute an upper bound on the probability that a node y ∈ N (u) gets (or chooses) color col(w), i.e., p(∃y ∈ N (u), col(y) = col(w) ∨ choice(y) = col(w)) = p(∨y∈N (u) col(y) = col(w) ∨ choice(y) = col(w)) ≤ y∈N (u) p(col(y) = col(w) ∨ choice(y) = col(w)). The latter inequality follows from the inclusion-exclusion principle: For two events A, B we have p(A ∪ B) = p(A) + p(B) − p(A ∩ B) ≤ p(A) + p(B). We consider the worst case topology and worst case order in which nodes make their choices to maximize y∈N (u) p(col(y) = col(w) ∨ choice(y) = col(w)). Due to Theorem 5 for every node y ∈ N (u) at most |PN0 (y) | + |PN1 (y) | ≤ 3d(y)/c1 ≤ 3Δ0 /c1 neighbors z ∈ N (y) make a choice during the first two attempts i ∈ [0, 1]. To maximize the chance that some node y obtains (or chooses) color col(w), we can minimize the number of available colors for y and the probability that some neighbor z ∈ N (y) chooses color col(w), since when making choice i we have p(choice(y) = col(w)) ≤ 1/(c1 |C(y)|) because each available color is chosen with the same probability. To minimize |C(y)| the number of colored nodes z ∈ N (y) should be maximized and at the same time each node z ∈ N (y) should have a neighbor itself with color col(w). The latter holds, if z ∈ N (y) is adjacent to node w. Thus, to upper bound p(col(y) = col(w)) we assume that node w and each node y ∈ N (u) share the same neighborhood (except u), i.e., N (y) \ {u} = N (w), and the maximal number of nodes in N (y) given our initial assumption are colored or make a choice, i.e., 3d(y)/c1 ≤ 3Δ0 /c1 . This, yields p(col(y) = col(w)) ≤ 1/(c1 |C(y)|) ≤ 1/(c1 (Δ0 /2 − 3Δ0 /c1 )) ≤ 8/(c1 Δ0 ) (for c1 > 32) and therefore p(∃y ∈ N (u), col(y) = col(w)) = p(∨y∈N (u) col(y) =
Distributed Coloring Depending on the Chromatic Number
255
col(w)) ≤ y∈N (u) p(col(y) = col(w)) ≤ 3Δ0 /c1 · 8/(c1 Δ0 ) ≤ 1/c1 (for c1 > 32). In other words, the probability that some node y ∈ N (u) has obtained color col(w) or chooses col(w) is bounded by 1/c1 . Let us estimate the probability that some neighbor y ∈ N (u) gets the same color as a node w1 ∈ N (v) ∩ Sc given that no (or some) node in y ∈ N (u) has chosen or obtained col(w0 ) for some node w0 ∈ CN (v)∩Sc \ {w1 }. To minimize |C(y)| we assume that |C(y)| is reduced by 1 for every colored node w0 ∈ CN (v)∩Sc \ {w1 }. Since at most 3/2d(y)/c1 ≤ 3/2Δ0 /c1 neighbors make a choice concurrently, the event reduces our (unconditioned) estimate of the size of |C(y)| by at most 3/2Δ0 /c1 . Using the same calculations as above with |C(y)| ≤ Δ0 /2 − 9/2Δ0 /c1 , the probability that some node y ∈ N (u) has obtained color col(w) or chooses col(w) given the outcome for any set of colored nodes W ⊆ N (v)∩Sc is at most 1/2. Thus, we expect at most |CN (v)∩Sc |/2 colors from CN (v)∩Sc to occur in node u’s neighborhood. Using the Chernoff bound from Corollary 2, we get that the deviation is at most 1/2 the expectation with probability 1 − 2−|CN (v)∩Sc |/8 for node u, i.e., the probability p(E(u, c)) of the event E(u, c) that for a node u ∈ N (v) at most 3|CN (v)∩Sc |/4 colors from N (v) ∩ Sc are also taken or chosen by its neighbors y ∈ N (u) is at least 1 − 2−|CN (v)∩Sc |/8 . Using Theorem 5 for S = N (v) ∩ Sc we have |CN (v)∩Sc | ≥ |S|/(16c1 ) = p(E(u, c)) ≥ 1 − 1/nc2 /(16c1 ) . |N (v) ∩ Sc |/(16c1 ) ≥ c2 log n/(16c1 ). Therefore, Due to Theorem 4 the event E(c) := u∈N (v) E(u, c) occurs with probability 1 − 1/nc2 /(16c1 )−3 . Theorem 7. After the first two choices for a node v with initial degree d(v) ≥ Δ0 /2 there exists a subset Nc ⊆ N (v) with |Nc | ≥ (Δ + 1)/(c5 χ) that has been colored with (Δ + 1)/(2c5 χ) colors for a constant c5 := 2048c21 w.h.p. for ∗ Δ ∈ Ω(log1+1/ log n n) and χ ∈ O(Δ/ log n). Proof. By assumption χ ∈ O(Δ/ log n), i.e., χ < 1/(4c3 )Δ/ log n. At least half of all neighbors u ∈ N (v) with u ∈ Sc ∩ N (v) must be in sets |Sc ∩ N (v)| ≥ c3 log n. This follows, since the maximum number of nodes in sets |Sc ∩ N (v)| < c3 log n is bounded by χ · c3 log n ≤ Δ0 /4. Assume that all statements of Theorem 5 that happen w.h.p. have actually taken place. Consider a node v and a set N (v) ∩ Sc with |Sc ∩ N (v)| ≥ c3 log n given there are at most 3/2Δ0 colored neighbors u ∈ N (v). For a node u ∈ N (v) ∩ Sc the probability that it obtains the same color of another node N (v) \ {u} ∩ Sc is given by the probability that it chooses a color col(w) taken by node w ∈ N (v) \ {u} ∩ Sc that is not chosen by any of u’s neighbors x ∈ N (u). Due to Theorem 6 |CN (v)∩Sc |/4 colors exist that are taken by some node w ∈ N (v) ∩ Sc but not taken (or chosen for the second choice) by a neighbor x ∈ N (u). Due to Theorem 5 we have |CN (v)∩Sc |/4 ≥ |N (v)∩Sc |/(64c1 ). Additionally, the theorem yields |PN1 (v)∩Sc | ≥ |N (v) ∩ Sc |/(4c1 ). The probability for a node u ∈ PN1 (v)∩Sc to obtain (not only pick) a color in CN (v)∩Sc becomes the number of “good” colors, i.e., |N (v) ∩ Sc |/(64c1 ), divided by the total number of available colors, i.e., 1/(Δ0 /2), yielding |N (v)∩Sc |/(32c1 · Δ0 ). This holds irrespectively of the behavior of other nodes w ∈ PN1 (v)∩Sc and
256
J. Schneider and R. Wattenhofer
other sets N (v) ∩ Sd with d ∈ [0, χ − 1] \ {c}. The reason is that a node u makes its decision what color to pick independently of its neighbors y ∈ N (u) and Theorems 5 and 6 already account for the worst case behavior of neighbors y ∈ N (u) to bound the probability that node u gets a chosen color. Thus, for a set of |PN1 (v)∩Sc | ≥ |N (v) ∩ Sc |/(4c1 ) nodes we expect that for at least |N (v)∩Sc |2 /(128c21 ·Δ0 ) nodes u there exists another node w ∈ (N (v)∩Sc )\ {u} with the same color. The expectation |N (v) ∩ Sc |2 /(128c21 · Δ0 ) is minimized if all sets |N (v) ∩ Sc | ≥ c3 log n are of equal size and as small as possible, i.e., Δ0 /(4χ) sinceat least Δ0 /4 nodes are in sets |N (v) ∩ Sc | ≥ c3 log n for some c. This gives c∈[0,χ−1] |N (v) ∩ Sc |2 /(128c21 · Δ0 ) ≥ c∈[0,χ−1] (Δ0 )2 /(2048c21 · Δ0 · χ2 ) = Δ0 /(c5 · χ) for c5 = 2048c21. Since by assumption χ ∈ O(Δ0 / log n) using Corollary 2 the actual number deviates by at most 1/2 of its expectation with probability 1 − 1/nc4 for an arbitrary constant c4 . Therefore, for at least Δ0 /(c5 · χ) nodes u ∈ N (v) ∩ Sc there exists another node w ∈ N (v) \ {u} ∩ Sc with the same color. Thus to color all of these Δ0 /(c5 · χ) nodes only Δ0 /(2c5 · χ) colors are used. ∗
∗
Theorem 8. If Δ ∈ Ω(log1+1/ log n n) and χ ∈ O(Δ/ log1+1/ log n n) then Algorithm FastRandColoring computes a (1−1/O(χ))Δ coloring in time O(log χ+ log∗ n) w.h.p.. Proof. Extending Theorem 7 to all nodes using Theorem 4 we have w.h.p. that each node v with d(v) ≥ Δ0 /2 has at most (Δ0 + 1) · (1 − 1/(c5 χ)) uncolored neighbors after the first two choices. However, node v is allowed to use d(v) + 1 colors and, additionally, half of the conserved colors, i.e., ∗ Δ0 /(8c2 χ) ≥ log1+1/ log n n/(4c5 ) (see Theorem 7), colors to get a color itself. Nodes with initial degree d(v) < Δ0 /2 can use much more colors, i.e., at least 3Δ0 /4. When executing Algorithm DeltaPlus1Coloring [15] the maximum degree is reduced by a factor 2 in O(1) rounds as long as it is larger than ∗ Ω(log n) due to Theorem 8 in [15]. Thus, since Δ0 /χ ∈ O(log1+1/ log n n) the time until the maximum degree Δ is less than O(max(Δ0 /χ, log n)) is given by O(log Δ0 −log(Δ0 /χ)) = O(log χ). Thus, we have at least 2Δ colors available, i.e., ∗ at least log1+1/ log n n/(4c5 ) additional colors, when calling Algorithm ConstDeltaColoring[15]. Therefore, the remaining nodes are colored in time O(log∗ n) using Corollary 14 [15].
6
Conclusion
It is still an open problem, whether deterministic Δ + 1 coloring in a general graph is possible in time Δ1− + log∗ n for a constant . Our algorithm indicates that this might well be the case, since we broke the bound for a wide class of graphs. Though it is hard in a distributed setting – and sometimes not even possible – to use less than Δ + 1 colors, we feel that one should also keep an eye on the original definition of the coloring problem in a distributed environment: Color a
Distributed Coloring Depending on the Chromatic Number
257
graph with as little colors as possible. To strive for a Δ + 1 coloring is of much appeal and gives interesting insights but as we have shown (in many cases) better bounds regarding the number of used colors and the required time complexity can be achieved by taking the chromatic number of the graph into account.
References 1. Arora, S., Chlamtac, E.: New approximation guarantee for chromatic number. In: Symp. on Theory of computing(STOC) (2006) 2. Barenboim, L., Elkin, M.: Sublogarithmic distributed MIS algorithm for sparse graphs using nash-williams decomposition. In: PODC (2008) 3. Barenboim, L., Elkin, M.: Distributed (δ + 1)-coloring in linear (in δ) time. In: Symp. on Theory of computing(STOC) (2009) 4. Barenboim, L., Elkin, M.: Deterministic distributed vertex coloring in polylogarithmic time. In: Symp. on Principles of distributed computing(PODC) (2010) 5. Blum, A.: New approximation algorithms for graph coloring. Journal of the ACM 41, 470–516 (1994) 6. Bollobas, B.: Chromatic nubmer, girth and maximal degree. Discrete Math. 24, 311–314 (1978) 7. Grable, D.A., Panconesi, A.: Fast distributed algorithms for Brooks-Vizing colorings. J. Algorithms 37(1), 85–120 (2000) 8. Halld´ orsson, M.M., Radhakrishnan, J.: Greed is good: approximating independent sets in sparse and bounded-degree graphs. In: STOC (1994) 9. Karchmer, M., Naor, J.: A fast parallel algorithm to color a graph with delta colors. J. Algorithms 9(1), 83–91 (1988) 10. Kuhn, F.: Weak Graph Coloring: Distributed Algorithms and Applications. In: Symp. on Parallelism in Algorithms and Architectures, SPAA (2009) 11. Kuhn, F., Wattenhofer, R.: On the Complexity of Distributed Graph Coloring. In: Symp. on Principles of Distributed Computing (PODC) (2006) 12. Linial, N.: Locality in Distributed Graph Algorithms. SIAM Journal on Computing 21(1), 193–201 (1992) 13. Panconesi, A., Srinivasan, A.: Improved distributed algorithms for coloring and network decomposition problems. In: Symp. on Theory of computing, STOC (1992) 14. Schneider, J., Wattenhofer, R.: A Log-Star Distributed Maximal Independent Set Algorithm for Growth-Bounded Graphs. In: Symp. on Principles of Distributed Computing(PODC) (2008) 15. Schneider, J., Wattenhofer, R.: A New Technique For Distributed Symmetry Breaking. In: Symp. on Principles of Distributed Computing(PODC) (2010) 16. Schneider, J., Wattenhofer, R.: Distributed Coloring Depending on the Chromatic Number or the Neighborhood Growth. In: TIK Technical Report 335 (2011), ftp://ftp.tik.ee.ethz.ch/pub/publications/TIK-Report-335.pdf
Multiparty Equality Function Computation in Networks with Point-to-Point Links Guanfeng Liang and Nitin Vaidya Department of Electrical and Computer Engineering, and Coordinated Science Laboratory University of Illinois at Urbana-Champaign, USA {gliang2,nhv}@illinois.edu
Abstract. In this paper, we study the problem of computing the multiparty equality (MEQ) function: n ≥ 2 nodes, each of which is given an input value from {1, · · · , K}, determine if their inputs are all identical, under the point-to-point communication model. The MEQ function equals to 1 if and only if all n inputs are identical, and 0 otherwise. The communication complexity of the MEQ problem is defined as the minimum number of bits communicated in the worst case. It is easy to show that (n− 1) log2 K bits is an upper bound, by constructing a simple algorithm with that cost. In this paper, we demonstrate that communication cost strictly lower than this upper bound can be achieved. We show this by constructing a static protocol that solves the MEQ problem for n = 3, K = 6, of which the communication cost is strictly lower than the above upper bound (2 log 2 6 bits). This result is then generalized for large values of n and K.
1
Introduction
In this paper, we study the problem of computing the following multiparty equality function (MEQ): 0 if x1 = · · · = xn M EQ(x1 , · · · , xn ) = (1) 1 otherwise. The input vector x = (x1 , · · · , xn ) is distributed among n ≥ 2 nodes, with only xi known to node i, and each xi chosen from the set {1, · · · , K}, for some integer K ≥ 1. Communication Complexity: The notion of communication complexity (CC) was introduced by Yao in 1979 [12]. They investigated the problem of quantifying the number of bits that two separated parties need to communicate between
This research is supported in part by Army Research Office grant W-911-NF-0710287 and National Science Foundation award 1059540. Any opinions, findings, and conclusions or recommendations expressed here are those of the authors and do not necessarily reflect the views of the funding agencies or the U.S. government.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 258–269, 2011. c Springer-Verlag Berlin Heidelberg 2011
Multiparty Equality Function Computation in Networks
259
themselves in order to compute a function whose inputs, namely X and Y , are distributed between them. The communication cost of a protocol P , denoted as C(P ), is the number of bits exchanged for the worst case input pair. The communication complexity of a Boolean function f : X × Y → {0, 1}, is minimum of the cost of the protocols for f . Multiparty Function Computation: The notion of communication complexity can be easily generalized to a multiparty setting, i.e., when the number of parties > 2. The communication complexity of a Boolean function f : X1 ×· · ·×Xn → {0, 1}, is minimum of the cost of the protocols for f . There are more than one communication models for the multiparty problems. Two commonly used models are the “number on the forehead” model [4] and the “number in hand” model. Consider function f : X1 × · · · × Xn → {0, 1}, and input (x1 , x2 , · · · , xn ) where each xi ∈ Xi . In the number on the forehead model, the i-th party can see all the xj such that j = i; while in the number in hand model, the i-th party can only see xi . As in the two-party case, the n parties have an agreed-upon protocol for communication, and all this communication is posted on a “public blackboard”. In these two models, the communication may be considered as being broadcast using the public blackboard, i.e., when any party sends a message, all other parties receive the same message. Tight bounds often follow from considering two-way partitions of the set of parties. In this paper, we consider a different point-to-point communication model, in which nodes communicate over private point-to-point links. This means that when a party transmits a message on a point-to-point link, only the party on the other end of the link receives the message. This model makes the problem significantly different from that with the broadcast communication model. We are interested in the communication complexity of the MEQ problem under the point-to-point communication model.
2
Related Work
The 2-party version of the MEQ problem (i.e., n = 2), which is usually referred to as the EQ problem, was first introduced by Yao in [12]. It is shown that the communication complexity of the EQ problem with deterministic algorithms is log K [6]. The complexity of the EQ problem can be reduced to O(log log K) if randomized algorithms are allowed [6]. MEQ problem with n ≥ 3 has been studied under the number on the forehead model and the number in hand model, both assuming a “public blackboard” for broadcast communications. The MEQ problem with n ≥ 3 can be solved with cost of 2 bits [6] under the number on the forehead head model, while it requires Θ(log K) bits under the number in hand model. On the other hand, the result changes significantly if we consider
260
G. Liang and N. Vaidya
the point-to-point communication model used in this paper (It is easy to show at least Ω(n log K) bits are needed.). The MEQ problem is related to the Set Disjointness problem and the consensus problem [8]. In the n-party Set Disjointness problem, we have n parties, and given subsets S1 , . . . , Sn ⊆ {1, . . . , K}, and the parties wish to determine if S1 ∩ · · · ∩ Sn = φ without communicating many bits. The disjointness problem is closely related to our MEQ problem. Consider the two-party set disjointness problem with subsets S1 and S2 . Let x1 and x2 be the binary representations of S1 and S2 , respectively. Then it is not hard to show that x1 = x2 is equivalent to S1 ∩ S2 = φ and S1 ∩ S2 = φ. The multi-party set disjointness problem has been widely studied under the “number on the forehead” and broadcast communication model, e.g. [7,11]. The set disjointness problem has also been studied under the “number in hand” model and point-to-point communication model (i.e., the same models we are using in this paper), with randomized algorithms. In [1], a lower bound of Ω(K/n4 ) on its communication complexity is proved for randomized algorithms. The lower bound was then improved to Ω(K/n2 ) in [2]. In [3], the authors established a further improved near-optimal lower bound of Ω(K/(n log n)). Nevertheless, these papers focus on the order of the communication complexity of randomized algorithms. On the other hand, in this paper, our goal is to characterize the exact communication complexity of deterministic algorithms. In the Byzantine consensus problem, n parties, each of which is given an input xi of log K bits, want to agree on a common output value x of log K bits under the point-to-point communication model, despite the fact that up to t of the parties may be faulty and deviate from the algorithm in arbitrary fashion [8]. The core of the consensus problem is to make sure that all fault-free parties’ outputs are identical, which is essentially what the MEQ problem tries to solve. In our recent report [9], we established a lower bound on the communication complexity of the Byzantine consensus problem of n parties as a function of the communication complexity of the MEQ problem of n − t parties. This motivates the MEQ problem under the point-to-point communication model. The consensus problem has also been studied under a slightly different fault-free model [5]. Authors of [5] investigated the fault-free consensus problem, which is essentially solving the MEQ problem with 1-bit inputs, i.e., K = 2, in tree topologies. We consider the problem under a more general setting with arbitrary K and do not assume any structure of the communication topology.
3 3.1
Models and Problem Definition Communication Model
In this paper, we consider a point-to-point communication model. We assume a synchronous fully connected network of n nodes. We assume that all point-topoint communication channels/links are private such that when a node transmits, only the designated recipient can receive the message. The identity of the sender is known to the recipient.
Multiparty Equality Function Computation in Networks
3.2
261
Protocol
A protocol P is a schedule that consists of a sequence of steps. In each step l, as specified by the protocol, a pair of nodes are selected as the transmitter and receiver, denoted respectively as Tl and Rl . The transmitter Tl will send a message the receiver Rl . The message being sent is computed as a function ml (xTl , Tl+ (l)), where xTl denotes Tl ’s input, and Tl+ (l) denotes all the messages Tl has received so far. When it is clear from the context, we will use Tl+ to denote Tl+ (l) to simplify the presentation. In this paper, we design protocols that are static : the triple Tl , Rl , ml (·)
are pre-determined by the protocol and are independent of the inputs. In other words, in step l, no matter what the inputs are, the transmitter, receiver, and the function according to which the transmitter compute the message are the same. Since the schedule is fixed, a static protocol can be represented as a sequence of L(P ) steps: {α1 , α2 , · · · , αL(P ) }, where αl = Tl , Rl , ml (xTl , Tl+ ) in the l-th step. L(P ) is called the length of the protocol P , and P always terminates after the L(P )-th step. Denote Sl (P ) as the cardinality of ml (), i.e., the number of possible channel symbols needed in step l of a static protocol P , considering all possible inputs. Then the communication cost of a static protocol P is determined by
L(P )
C(P ) =
log2 Sl (P ),
(2)
l=1
If only binary symbols are allowed, Sl (P ) = 2 for all l, and C(P ) becomes L(P ). 3.3
Problem Definitions
We define two versions of the MEQ problem. MEQ-AD (Anyone Detects): We consider protocols in which every node i decides on a one-bit output EQi ∈ {0, 1}. A node i is said to have detected a mismatch (or inequality of inputs) if it sets EQi = 1. A protocol P is said to solve the MEQ-AD problem if and only if at least one node detects a mismatch when the inputs to the n nodes are not identical. More formally, the following property must be satisfied when P terminates: EQ1 = · · · = EQn = 0 ⇔ M EQ(x1 , · · · , xn ) = 0.
(3)
MEQ-CD (Centralized Detect): The second class of protocols we consider are the ones in which one particular node is assigned to decide on an output. Without loss of generality, we can assume that node n has to compute the output. Then a protocol P is said to solve the MEQ-CD problem if and only if, when P terminates, node n computes output EQn such that EQn = M EQ(x1 , · · · , xn ).
(4)
262
G. Liang and N. Vaidya
Communication Complexity: Denote ΓAD (n, K) and ΓCD (n, K) as the sets of all protocols that solve the MEQ-AD and MEQ-CD problems with n nodes, respectively. We are interested in finding the communication complexity of the two versions of the MEQ problem, which is defined as the infimum of the communication cost of protocols in ΓAD (n, K) and ΓAD (n, K), i.e., CAD (n, K) =
inf
P ∈ΓAD (n,K)
C(P ), and CCD (n, K) =
inf
P ∈ΓCD (n,K)
C(P ).
Communication Complexity with General Protocols: In general, a protocol that solves the MEQ problem may not necessarily be static. The schedule of transmissions might be determined dynamically on-the-fly, depending on the inputs. So the transmitter and receiver in a particular step l can be different with different inputs. Since the set of all static protocols is a subset of all general protocols, the communication complexities of the two versions of the MEQ problem are bounded from above by the cost of static protocols. The purpose of this paper is to show that there exist instances of the MEQ problem whose communication complexity is lower than the intuitive upper bound we are going to present in the next section. For this purpose, it suffices to show that, even if we constrain ourselves to static protocols, some MEQ problems can still be solved with cost lower than the upper bound. In sections 6 to 7, such examples of static protocols are presented.
4
Upper Bound of the Complexity
An upper bound of the communication complexity of both versions of the MEQ problem is (n − 1) log2 K, for all positive integer n ≥ 2 and K ≥ 1. This can be proved by a trivial construction: in step i, node i sends xi to node n, for all i < n. The decisions are computed according to M EQ(x1 , · · · , xn ) , i = n; (5) EQi = 0 , i < n. It is obvious that this protocol solves both the MEQ-AD and MEQ-CD problems with communication cost (n − 1) log2 K, which implies CAD(CD) (n, K) ≤ (n − 1) log2 K. In particular, when K = 2k , we have CAD(CD) (n, 2k ) ≤ (n − 1)k. For the two-party equality problem (n = 2), this bound is tight [6], for arbitrary K. The bound is also tight when K = 2 (binary inputs). (n − 1) log2 2 = n − 1 bits are necessary when K = 2, since any protocol with communication cost < n − 1 will have at least one node not communicating with any other node at all, making it impossible to solve the MEQ problem. However, in the following sections, we are going to show that the (n − 1) log K bound is not always tight, by presenting a static protocol that solves instances of the MEQ problem with communication cost lower than (n − 1) log2 K.
Multiparty Equality Function Computation in Networks
5
263
Equivalent MEQ-AD Protocols
In the rest of this paper, except for section 8, we will focus on static protocols that solve the MEQ-AD problem. It is not hard to see that a static protocol P can be interpreted as a directed multi-graph G(V, E(P )), where the set of vertices V = {1, · · · , n} represents the n nodes, and the set of directed edges E(P ) = {(T1 , R1 ), · · · , (TL(P ) , RL(P ) )} represents the transmission schedule in each step. From now on, we will use the terms protocol and graph interchangeably, as well as the terms transmission and link. Fig.1(a) gives an example of the graph representation of a protocol for n = 4. In Fig.1(a), the numbers next to the directed links indicate the corresponding step numbers. Two protocols P and P in are said to be equivalent if their costs are equal, i.e., C(P ) = C(P ). The following lemma says that we can flip the direction of any edge in E(P ) and obtain a protocol P that is equivalent to P . Lemma 1. Given any static protocol P for MEQ-AD of length L(P ), and any positive integer l ≤ L(P ), there exists a equivalent static protocol P of the same length, such that E(P ) and E(P ) are identical, except that in the l-th step, the transmitter and receiver are swapped, i.e., E(P ) = E(P )\{(Tl , Rl )} ∪ {(Rl , Tl )} = {(T1 , R1 ), · · · , (Tl−1 , Rl−1 ), (Rl , Tl ), (Tl+1 , Rl+1 ), · · · , (TL(P ) , RL(P ) )}. Proof. Given the integer l and a protocol P = {α1 , · · · , αl−1 , αl , αl+1 , · · · , αL(P ) } with αl = (Tl , Rl , ml (xTl , Tl+ )), we construct P = {α1 , · · · , αl−1 , αl , αl+1 , · · · , αL(P ) } by modifying P as follows: – αj = αj for 1 ≤ j ≤ l − 1. – αl = (Rl , Tl , ml (xRl , Rl+ )). Here ml (xRl , Rl+ ) = ml (xTl , Tl+ )|x1 =···=xn =xRl is the symbol that party Rl expects to receive in step l of protocol P , assuming all parties have the same input as xRl . – αj = (Tj , Rj , mj (xTj , Tj+)) for j > l. • If Tj = Rl , mj (xTj , Tj+ ) = mj (xTj , Tj+ )|ml (xT ,T + )=m (xR ,R+ ) is the l l l l l symbol that party Rl sends in step j, pretending that it has received ml (xRl , Rl+ ) in step l of P . • If Tj = Rl , mj (xTj , Tj+ ) = mj (xTj , Tj+ ). – To compute the output, Tl first computes EQTl in the same way as in P . Then Tl sets EQTl = 1 if ml (xRl , Rl+ ) = ml (xTl , Tl+ ), else no change. That is, Tl sets EQl to 1 if the symbol it receives from Rl in step l of P differs from the symbol Tl would have sent to Rl in step l of P . The other nodes compute their outputs in the same way as in P . To show that P and P are equivalent, consider the two cases:
264
G. Liang and N. Vaidya
(a) Graph representation of (b) Equivalent protocol of (c) iid equivalent protocol P P with Step 5 flipped of P Fig. 1. Example of graph representation of a protocol P and its equivalent protocols. The numbers next to the links indicate the corresponding step number.
– ml (xRl , Rl+ ) = ml (xTl , Tl+ ): It is not hard to see that in this case, the execution of every step is identical in both P and P , except for step l. So for all i = Tl , EQi is identical in both protocols. Since ml (xRl , Rl+ ) = ml (xTl , Tl+), EQTl remains unchanged, so it is also identical in both protocols. – ml (xRl , Rl+ ) = ml (xTl , Tl+ ): Observe that these two functions can be different only if the n inputs are not all identical. So it is correct to set EQTl = 1. In Fig.1(b), the graph for an equivalent protocol obtained by flipping the link corresponding to the 5-th step of the 4-node example in Fig.1(a) is presented. Let us denote all the symbols a node i receives from and sends to the other nodes throughout the execution of protocol P as i+ and i− , respectively. It is obvious that i− can be written as a function Mi (xi , i+ ), which is the union of ml (xi , i+(l)) over all steps l in which node i is the transmitter. If a protocol P satisfies Mi (xi , i+ ) = Mi (xi ) for all i, we say P is individual-input-determined (iid). The following theorem shows that there is always an iid equivalent for every protocol. Theorem 1. For every static protocol P for MEQ-AD, there always exists an iid equivalent static protocol P ∗ , which corresponds to an acyclic graph. Proof. According to Lemma 1, we can flip the direction of any edge in E(P ) and obtain a new protocol which is equivalent to P . It is to be noted that we can keep flipping different edges in the graph, which implies that we can flip any subset of E(P ) and obtain a new protocol equivalent to P . In particular, we consider a protocol equivalent to P , whose corresponding graph is acyclic, and for all (i, j) ∈ E(P ), the property i < j is satisfied. In this protocol, every node i has no incoming links from any node with index greater than i. This implies that the messages transmitted by node i are independent of the inputs to nodes with larger indices. Thus we can re-order the transmissions of this protocol such that node 1 transmits on all of its out-going links first, then node 2 transmits on all of its out-going links, ..., node n − 1 transmits to n at the end. Name the new protocol Q. Obviously Q is equivalent to P . Since we can always find a protocol Q equivalent to P as described above, all we need to do now is to find P ∗ . If Q itself is iid, then P ∗ = Q and we are done.
Multiparty Equality Function Computation in Networks
265
If not, we obtain P ∗ in the following way (using function M ), which is similar to how we obtain the equivalent protocol P in Lemma 1: – For node 1, since it receives nothing from the other nodes, M1 (x1 , 1+ ) = M1 (x1 ) is trivially true. – For node 1 < i < n, we modify Q as follows: node i computes its out-going message as a function Mi (xi ) = Mi (xi , i+ |x1 =···=xn =xi ), where i+ |x1 =···=xn =xi are incoming messages node i expects to receive, assuming that all parties have the same input xi . At the end of the protocol, node i checks if i+ |x1 =···=xn =xi equals to the actual incoming symbols i+ . If they match, nothing is changed. If they do not match, the inputs cannot be identical, and node i can set EQi = 1. (The correctness of this step may be easier to see by induction: apply this modification one node at a time, starting from node 1 to node n − 1.) Theorem 1 shows that, to find the least cost of static protocols, it is sufficient to investigate only the static protocols that are iid and the corresponding communication graph is acyclic. From now on, such protocols are called iid static protocols for MEQ-AD. Fig.1(c) shows an iid static protocol that is equivalent to the one shown in Fig.1(a). NOTE: The above technique of inverting the direction of transmissions can also be applied to general non-static MEQ-AD protocols. So Theorem 1 can be extended to cover all general protocols that solve the MEQ-AD problem. This immediately implies that among all MEQ-AD protocols (static and not static), there always exist an optimal protocol that is static. So for the MEQ-AD problem, it is sufficient to only consider static protocols.
6
MEQ-AD(3,6)
Let us first consider MEQ-AD(3,6), i.e., the case where 3 nodes (say A, B and C) are trying to solve the MEQ-AD problem when each node is given input from one out of six values, namely {1, 2, 3, 4, 5, 6}. According to Theorem 1, for any protocol that solves this MEQ-AD problem, there exists an equivalent iid partially ordered protocol in which node A has no incoming link, node B only transmits to node C, and node C has no out-going link. We construct one such protocol that solves MEQ-AD(3,6) and requires only 3 channel symbols, namely {1, 2, 3}, per link. Denote the channel symbol being sent over link ij as sij , the schedule of the proposed protocol is: (1) Node A sends sAB (xA ) to node B; (2) Node A sends sAC (xA ) to node C; and (3) Node B sends sBC (xB ) to node C. Table 1 shows how sij is computed as a function of xi . Now consider the outputs. Node A simply sets EQA = 0. For nodes B and C, they just compare the channel symbol received from each incoming link with the expected symbol computed with its own input value, and detect a mismatch if the received and expected symbols are not identical. For example, node B receives sAB (xA ) from node A. Then it detects a mismatch if the sAB (xA ) = sAB (xB ).
266
G. Liang and N. Vaidya
Table 1. A protocol for MEQ-AD(3,6)
x sAB sAC sBC
1 1 1 1
2 1 2 2
3 2 2 3
4 2 3 1
5 3 3 2
6 3 1 3
Fig. 2. The bipartite graph corresponding to the MEQ-AD(3,6) protocol in Table 1.
It can be easily verified that if the three input values are not all identical, at least one of nodes B and C will detect a mismatch. Hence the MEQ-AD(3,6) problem is solved with the proposed protocol. The communication cost of this protocol is 3 log2 3 = log2 27 ≈ 0.92 × 2 log2 6. (6) Notice that in this case, the upper bound from Section 4 equals to (3 − 1) log2 6 = 2 log2 6. So we have found a static MEQ-AD protocol whose communication cost is lower than the upper bound. In fact, this protocol is optimal in the sense that it can be shown to achieve the minimum communication cost among all static protocols We prove the optimality of this protocol using an edge coloring argument. 6.1
Edge Coloring Representation of MEQ-AD(3,K)
From Sections 5, we have shown that it is sufficient to study 3-node systems where messages are transmitted only on links AB, AC and BC. Let us denote |sAB |, |sAC | and |sBC | as the number of different symbols being transmitted on links AB, AC and BC, respectively. Theorem 2. The existence of a MEQ-AD(3,K) static protocol P with cost C(P ) is equivalent to the existence of a simple bipartite graph G(U, V, E) and a distance-2 edge coloring scheme W , such that |U | × |V | × |W | = 2C(P ) , given |E| = K, |U | × |V | ≥ K, |U | × |W | ≥ K and |V | × |W | ≥ K. Here U and V are disjoint sets of vertices, E is the set of edges, |U | = |sAB | and |V | = |sAC | are the sizes of sets U and V , and |W | = |sBC | is the number of colors used in W . The detailed proof can be found in our technical report [10]. According to Theorem 2, we can conclude that the problem of finding a least cost static protocol for M EQ − AD(3, K) is equivalent to the problem of finding the minimum of |U | × |V | × |W | for the bipartite graphs and distance-2 coloring schemes that satisfy the above constraints. Using Theorem 2, to show that CAD (3, 6) = log2 27, we only need to show that for every combination of |U | × |V | × |W | < 27, there exists no bipartite graph G(U, V, E) and a distance-2 coloring scheme W that satisfy the conditions as described in Theorem 2. It is not hard to see that there are only two
Multiparty Equality Function Computation in Networks
267
combinations (up to permutation) that satisfy all conditions and have product less than 27: (2, 3, 3) and (2, 3, 4). Notice that in both cases, |E| = |U | × |V |, where every pair of edges is within distance 2 of each other, which means that the corresponding graph G(U, V, E) can only be distance-2 edge colored with at least |E| = 6 > 4 > 3 colors. So neither (2, 3, 3) nor (2, 3, 4) satisfies the aforementioned conditions. Hence, together with the protocol presented before, we can conclude that CAD (3, 6) = log2 27. The bipartite graph corresponding to Table 1 is illustrated in Fig. 2. Near the nodes Ui (or Vi ) we show the set of value x’s such that sAB (x) = i (or sAC (x) = i). The number near each edges is the input value corresponding to that edge.
7
MEQ-AD(3,2k)
Now we construct a protocol when the number of possible input values K = 2k , k ≥ 1 and only binary symbols can be transmitted in each step, using the MEQ-AD(3,6) protocol we just introduced in the previous sections as a building block. First, we map the 2k input values into 2k different vectors in the vector space {1, 2, 3, 4, 5, 6}h, where h = log6 2k = k log6 2. Then h instances of the MEQAD(3,6) protocol are performed in parallel to compare the h dimensions of the vector. Since 3 channels symbols are required for each instance of the MEQAD(3,6) protocol, we need to transmit a vector from {1, 2, 3}h on each of the links AB, AC and BC. One way to do so is to encode the 3h possible vectors from {1, 2, 3}h into b = log2 3h = h log2 3 bits, and transmit the b bits through the links. Since the h instances of MEQ-AD(3,6) protocols solve the MEQ-AD(3,6) problem for each dimension, altogether they solve the MEQ-AD(3,2k ) problem. The communication cost this protocol can be computed as [10] C(P ) = 3h log2 3 < (0.92 × 2k) + 7.755.
(7)
From Eq.7, we can see that when k is large enough, the communication cost of this protocol is upper bounded by 0.92 times of the upper bound 2 log2 2k = 2k from Section 4. The way in which the above protocol is constructed can be generalized to obtain a MEQ-AD(3,K) protocol P with similar cost C(P ) < (0.92 × 2 log2 K) + Δ
(8)
for arbitrary value of K, where Δ is some positive constant.
8
About MEQ-CD
In this section, we will show that CCD (n, K) roughly equals to CAD (n, K): CAD (n, K) ≤ CCD (n, K) ≤ CAD (n, K) + n − 1.
(9)
We have shown the first inequality in Section 3.3. The second inequality can be proved by the following simple construction: Consider any protocol P for MEQAD, construct a protocol P by having node i send EQi to node n by the end
268
G. Liang and N. Vaidya
of P , for all i < n. Node n collects the n − 1 decisions from all other nodes and computes the final decision EQn = max{EQ1 , · · · , EQn }.
(10)
It is easy to see that, EQn = M EQ(x1 , · · · , xn ). So P ∈ ΓCD (n, K). Since C(P ) = C(P ) + n − 1, the second inequality is proved. From Eq.8 it then follows that for large enough K, the MEQ-CD(3,K) problem can also be solved with communication strictly less than 2 log2 K bits. The performance can be improved somewhat by exploiting communication that may be already taking place between node n and the other nodes. For example, to solve MEQ-CD(3,6), instead of having nodes A and B sending 1 extra bit to node C at the end of the MEQ-AD(3,6) protocol in Section 6, we only need to add one possible value to sBC , namely sBC ∈ {1, 2, 3, 4}, where sBC = 4 means that node B has detected a mismatch. The cost of this protocol is 2 log2 3+log2 4 = 2 log2 3+2 < 3 log2 3+2. The same approach can also be applied to the MEQ-AD(3,2k ) protocol from Section 7 by making |sBC | = log2 (3h + 1), and obtain an MEQ-CD(3,2k ) protocol with cost of 2h log2 3 + log2 (3h + 1) bits, which is almost the same as 3h log2 3 for large h.
9
MEQ Problem with Larger n
Our construction in sections 6 and 7 can be generalized to networks of larger sizes. For brevity, just consider the case when n = 3m . The nodes are organized in m − 1 layers of “triangle”s. At the bottom ((m − 1)-th) layer, there are 3m−1 triangles, each of which is formed with 3 nodes running the MEQ-AD(3,K) protocol presented in section 7. Then the i-th layer (i < m − 1) consists 3i triangles, each of which is formed with 3 “smaller” triangles from the (i + 1)th layer running the MEQ-AD(3,K) protocol. So the top layer consists of one triangle. For K = 2k , the cost of this protocol is approximately n−1 (0.92 × 2k + 7.755) ≈ 0.92(n − 1)k, 2
(11)
for large k. Notice that (n − 1)k is the upper bound from Section 4. So the improvement of a constant factor of 0.92 can also be achieved for larger networks.
10
Conclusion
In this paper, we study the communication complexity problem of the multiparty equality function, under the point-to-point communication model. The point-topoint communication model changes the problem significantly compared with previously used broadcast communication models. We focus on static protocols in which the schedule of transmissions is independent of the inputs. We then introduce techniques to significantly reduce the space of protocols to be studied. We then study the MEQ-AD(3,6) problem and introduce an optimal static protocol that achieves the minimum communication cost among all static protocols
Multiparty Equality Function Computation in Networks
269
that solve the problem. This protocol is then used as building blocks for construction of efficient protocols for more general MEQ-AD problems. The problem of finding the communication complexity of the MEQ problem for arbitrary values of n and K is still open. Acknowledgments. We thank the referees for their insightful comments and asking interesting questions. In particular, the referees pointed out that the MEQ problem is related to the set disjointness problem, and also asked the question of generalizing our results to networks larger than 3 nodes. Sections 2 and 9 incorporate these comments.
References 1. Alon, N., Matias, Y., Szegedy, M.: The space complexity of approximating the frequency moments. In: STOC (1996) 2. Bar-yossef, Z., Jayram, T.S., Kumar, R., Sivakumar, D.: An information statistics approach to data stream and communication complexity. In: IEEE FOCS, pp. 209–218 (2002) 3. Chakrabarti, A., Khot, S., Sun, X.: Near-optimal lower bounds on the multi-party communication complexity of set disjointness. In: IEEE CCC (2003) 4. Chandra, A.K., Merrick, I., Furst, L., Lipton, R.J.: Multi-party protocols. In: Proceedings of the Fifteenth Annual ACM Symposium on Theory of Computing, pp. 94–99 (1983) 5. Dinitz, Y., Moran, S., Rajsbaum, S.: Exact communication costs for consensus and leader in a tree. J. of Discrete Algorithms 1, 167–183 (2003) 6. Kushilevitz, E., Nisan, N.: Communication Complexity. Cambridge University Press, Cambridge (2006) 7. Kushilevitz, E., Weinreb, E.: The communication complexity of set-disjointness with small sets and 0-1 intersection. In: IEEE FOCS (2009) 8. Lamport, L., Shostak, R., Pease, M.: The byzantine generals problem. ACM Trans. on Programming Languages and Systems (1982) 9. Liang, G., Vaidya, N.: Complexity of multi-valued byzantine agreement. Technical Report, CSL, UIUC (June 2010), http://arxiv.org/abs/1006.2422 10. Liang, G., Vaidya, N.: Multiparty equality function computation in networks with point-to-point links. Technical Report, CSL, UIUC (2010) 11. P˘ atra¸scu, M., Williams, R.: On the possibility of faster sat algorithms. In: Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’10, pp. 1065–1075, Philadelphia, PA, USA, Society for Industrial and Applied Mathematics (2010) 12. Yao, A.C.-C.: Some complexity questions related to distributive computing(preliminary report). In: STOC 1979: Proceedings of the Eleventh Annual ACM Symposium on Theory of Computing, pp. 209–213. ACM, New York (1979)
Network Verification via Routing Table Queries Evangelos Bampas1 , Davide Bil` o2 , Guido Drovandi3 , Luciano Gual` a4 , 1 3,5 Ralf Klasing , and Guido Proietti 1
2
LaBRI, CNRS / INRIA / University of Bordeaux, Bordeaux, France Dip. di Teorie e Ricerche dei Sistemi Culturali, University of Sassari, Italy 3 Istituto di Analisi dei Sistemi ed Informatica, CNR, 00185 Rome, Italy 4 Dipartimento di Matematica, University of Tor Vergata, Rome, Italy 5 Dipartimento di Informatica, University of L’Aquila, L’Aquila, Italy
Abstract. We address the problem of verifying the accuracy of a map of a network by making as few measurements as possible on its nodes. This task can be formalized as an optimization problem that, given a graph G = (V, E), and a query model specifying the information returned by a query at a node, asks for finding a minimum-size subset of nodes of G to be queried so as to univocally identify G. This problem has been faced w.r.t. a couple of query models assuming that a node had some global knowledge about the network. Here, we propose a new query model based on the local knowledge a node instead usually has. Quite naturally, we assume that a query at a given node returns the associated routing table, i.e., a set of entries which provides, for each destination node, a corresponding (set of) first-hop node(s) along an underlying shortest path. First, we show that any network of n nodes needs Ω(log log n) queries to be verified. Then, we prove that there is no o(log n)-approximation algorithm for the problem, unless P = NP, even for networks of diameter 2. On the positive side, we provide an O(log n)-approximation algorithm to verify a network of diameter 2, and we give exact polynomial-time algorithms for paths, trees, and cycles of even length.
1
Introduction
There is a growing interest about networks which are built and maintained by decentralized processes. In such a setting, it naturally arises the problem of discovering a map of the network or to verify whether a given map is accurate. A common approach to discover or to verify a map is to make some local measurement on a selected subset of nodes that – once collected – can be used to derive information about the whole network (see for instance [6,9]). A measurement on a node is usually costly, so it is natural to try to make as few measurements as possible. These two tasks – that of discovering a map and that of verifying a given map – have been formalized as optimization problems and have been studied in
Part of this work was done while the second author was visiting LaBRI-Bordeaux. Additional support by the ANR projects ALADDIN and IDEA and the INRIA project CEPAGE.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 270–281, 2011. c Springer-Verlag Berlin Heidelberg 2011
Network Verification via Routing Table Queries
271
several papers. The idea is to model the network as a graph G = (V, E), while a measurement at a given node can be seen as a unitary-cost query returning some piece of information about G. In the discovery problem, we want to design an online algorithm that selects a minimum-size subset of nodes Q ⊆ V to be queried that allows to precisely map the entire graph, i.e., to settle all the edges and all the non-edges of G. The quality of the algorithm is measured by its competitive ratio, i.e., the ratio between the number of queries made by the algorithm (which does not know G) and the minimum number of queries which would be sufficient to discover the graph. On the other hand, in the off-line version of the problem, which is of interest for our paper, we are given a graph G, and we want to compute a minimum number of queries sufficient to discover G. This is known as the verification problem, and it has an interesting application counterpart, since it models the activity of verifying the accuracy of a given map associated with an underlying real network (on which the queries are actually done). In the literature, two (main) query models have been studied. In the allshortest-paths query model, a query of a node q returns the subgraph of G consisting of the union of all shortest paths between q and every other node v ∈ V . A weaker notion of query is used in the all-distances query model, in which a query to a node q returns all the distances in G from q to every other node v ∈ V . Notice that both models inherently require global knowledge/information about the network, hence a central problem for these query models is whether/how the information can be obtained locally (without preprocessing of the network). In this paper, we propose a query model that uses only local knowledge/information about the network. Quite naturally, we assume that a query at a given node q returns the associated routing table, namely a set of entries which provides, for each destination node, a corresponding (set of) first-hop node(s) along an underlying shortest path. In the rest of the paper, this will be referred to as the routing-table query model. Previous work. It turns out that the verification problem with the all-shortestpaths query model is equivalent to the problem of placing landmarks on a graph [14]. In this problem, we want to place landmarks on a subset of the nodes in such a way that every node is uniquely identified by the distance vector to the landmarks. Interestingly enough, the minimum number of landmarks to be placed is called the metric dimension of a graph [13]. The problem has been shown to be NP-hard in [8]. An explicit reduction from 3-SAT is given in [14] which also provides an O(log n)-approximation algorithm (n is the number of nodes) and an exact polynomial-time algorithm for trees. Subsequently, in [1], the authors prove that the problem is not o(log n) approximable, showing thus that the algorithm in [14] is the best possible in an asymptotic sense. As far as the all-distances query model is concerned, the verification problem has been studied in [1] where the NP-hardness is proved and an algorithm with O(log n)-approximation guarantee is provided. Other results in [1] include exact polynomial-time algorithms for trees, cycles and hypercubes. Problems close in spirit to the verification have been addressed in [2,4,5], while for the state of art about the discovery problem in both models, the reader is referred to [1,3,7].
272
E. Bampas et al.
Our results. Throughout the paper, we focus on the verification problem w.r.t the routing-table query model. We first show a lower bound of Ω(log log n) on the minimum number of queries needed to verify any graph with n nodes. This is in contrast with the previous two query models for which certain classes of graphs can be verified with a constant number of queries, like paths and cycles. Our proof also implies a lower bound of Ω(n) on the number of queries needed to verify a path or a cycle. So, one can wonder whether every graph needs a linear number of queries to be verified. We provide a negative answer to this question by exhibiting a class of graphs that can be verified with O(log n) queries. We then analyze the computational complexity of the problem. To this respect, although it remains open for general input graphs to establish whether the problem is in NPO, we are able to provide an O(log n)-approximation algorithm to verify graphs of diameter 2. Moreover, we also show that this bound is asymptotically tight, unless P = NP. On the positive side, we provide exact polynomial-time algorithms to verify paths, trees and cycles of even length. Our result for trees is based on a characterization of a solution that can be used to reduce the problem to that of computing a minimum vertex cover of a certain class of graphs (for which a vertex cover can be found in polynomial time). The algorithm for cycles of even length shows a counterintuitive fact about the routing-table query model. Indeed, while a query in our model seems to obtain only local information about the graph, we show in the case of the cycle that the symmetry can be used to infer some knowledge about edges and non-edges that are far from queried nodes. The paper is organized as follows. After giving some basic definitions in Section 2, we formally introduce our query model in Section 3. Section 4 is devoted to the lower bound of Ω(log log n) for any graph with n nodes, while the results for graphs of diameter 2 are presented in Section 5. Then, in Section 6, we describe exact polynomial-time algorithms for classical topologies, and finally Section 7 concludes the paper. Due to space limitations, some of the proofs are omitted/sketched here, and will be given in the extended version of the paper.
2
Basic Definitions
Let G = (V, E) be an undirected (simple) graph with n vertices. We assume that vertices are distinguishable, i.e., they have different identifiers. If (u, v) ∈ E, then we say that (u, v) is a non-edge of G. For a graph G, we will also denote by V (G) and E(G) its set of vertices and its set of edges, respectively. For every vertex v ∈ V , let NG (v) := {u | u ∈ V \ {v}, (u, v) ∈ E} and let NG [v] = NG (v) ∪ {v}. The maximum degree of G is equal to maxv∈V |NG (v)|. Let U ⊆ V be a set of vertices. We denote by G[U ] the graph with V (G[U ]) = U and E(G[U ]) = {(u, v) | u, v ∈ U, (u, v) ∈ E}. Let F ⊆ {(u, v) | u, v ∈ V, u = v}. We denote by G + F (resp., G − F ) the graph on V with edge set E ∪ F (resp., E \ F ). When F = {e} we will denote G + {e} (resp., G − {e}) by G + e (resp., G − e). For two graphs G1 and G2 , we denote by G1 ∪ G2 the graph with V (G1 ∪ G2 ) = V (G1 ) ∪ V (G2 ) and E(G1 ∪ G2 ) = E(G1 ) ∪ E(G2 ). We
Network Verification via Routing Table Queries
273
denote by dG (u, v) the distance in G from u to v. The diameter of G is equal to maxu,v∈V dG (u, v). Let queryG be a query model, that is, a function from vertices of G to some information about G. Let Q ⊆ V . We denote by queryG (Q) = {queryG (q) | q ∈ Q}. Moreover, we say that Q verifies edge (resp., non-edge) (u, v) of G iff for every graph G = (V, E ) with queryG (Q) = queryG (Q) we have that (u, v) ∈ E (resp., (u, v) ∈ E ). Finally, Q verifies G iff for every G = (V, E ) with E = E we have that queryG (Q) = queryG (Q). This implies that Q verifies G iff Q verifies every edge and every non-edge of G. Clearly, we have that if Q ⊆ V verifies G, then for every q ∈ V , Q ∪ {q} verifies G. Given an undirected graph G = (V, E), the Network Verification Problem w.r.t. query model queryG is the optimization problem of finding a minimumsize subset Q ⊆ V that verifies G w.r.t. query model queryG .
3
The Routing-Table Query Model
For a given vertex q ∈ V , we denote by tableG (q) the routing table of q in G, i.e., tableG (q) = u, v | u, v ∈ V \ {q} ∧ (q, v) ∈ E ∧ dG (u, v) + 1 = dG (q, u) . A pair u, v ∈ tableG (q) means that there exists a shortest path from q to u whose first hop is vertex v. The routing-table query model is the model in which queryG (q) = tableG (q), for every q ∈ V. In the rest of the paper, we will denote by TqG (v) = u ∈ V | u, v ∈ tableG (q) . Clearly, for every v ∈ V we have that Q = V \ {v} verifies G w.r.t. the routing table query model, as any q ∈ Q verifies all edges and non-edges of G of the form (q, u), for any u ∈ V \ {q}. Notice also that if G is a clique, then this is optimal. The following fact is easy to prove: Fact 1. Let q and u be two vertices of G such that (q, u) ∈ E. For every v ∈ TqG (u), there is a shortest path between q and v using edge (q, u) and using only some of the vertices in TqG (u). Moreover, if for every other u = u, we have that v ∈ TqG (u ), then all the shortest paths between q and v must use edge (q, u) and must use only vertices in TqG (u). As a consequence of the above fact, we are now able to give some easy-tocheck conditions which are sufficient to verify a given edge (respectively, nonedge) w.r.t. routing-table query model. Unfortunately, these conditions are not necessary, and so it remains open to establish whether the problem is in NPO. Proposition 1. Let (u, v) be an edge of G. Let q be such that TqG (u) = {v}. Then, {q} verifies edge (u, v). Proposition 2. Let (u, v) be an edge of G. Let q be a neighbor of u and q a neighbor of v, respectively. If TqG (v) ∩ TqG (u) = {u, v}, then {q, q } verifies the edge (u, v).
274
E. Bampas et al.
Proposition 3. Let (u, v) be a non-edge of G. Let q ∈ V \ {u, v} be such that (q, u) ∈ E, (q, v) ∈ E. If v ∈ TqG (u), then {q} verifies the non-edge (u, v). Proposition 4. Let (u, v) be a non-edge of G = (V, E) and let q, q ∈ V \ {u, v} be two distinct vertices such that (q, q ) ∈ E. If there exists w ∈ V such that v ∈ TqG (w), u ∈ TqG (w), v ∈ TqG (q ), and u ∈ TqG (q), then {q, q } verifies non-edge (u, v). Proof. For the sake of contradiction, assume there exists a graph G = (V, E ) satisfying the hypothesis of the claim such that (u, v) ∈ E . This implies that |dG (z, u) − dG (z, v)| ≤ 1 for every vertex z ∈ V . As v ∈ TqG (w) and u ∈ TqG (w), we have that dG (q, v) ≤ dG (q, u). Moreover, as u ∈ TqG (q) and v ∈ TqG (q ), we have that dG (q , u) = dG (q, u) + 1 and dG (q , v) = dG (q, v) − 1. As a consequence, dG (q , v) = dG (q, v) − 1 ≤ dG (q, u) − 1 = dG (q , u) − 2, which implies |dG (q , u) − dG (q , v)| ≥ 2, contradicting the assumption that |dG (q , u) − dG (q , v)| ≤ 1. This completes the proof.
Before ending this section, we provide some connections between the routingtable query model and the all-shortest-paths query model, which will be useful in the following sections. First, we recall the formal definition of the all-shortestpaths query model. For two given vertices u, v ∈ V , let ΠG (u, v) denote the graph obtained by the union of all shortest paths in G between u and v. For a given vertex q ∈ V , we denote by aspG (q) = u∈V ΠG (q, u). The all-shortest-paths query model is the model in which queryG (q) = aspG (q), for every q ∈ V . Lemma 1 ([1]). A set Q ⊆ V verifies a graph G = (V, E) w.r.t. the all-shortestpaths query model iff, for every u, v ∈ V , with u = v, there exists a vertex q ∈ Q such that |dG (q, u) − dG (q, v)| ≥ 1. As from aspG (q) we can easily construct tableG (q), the routing-table query model is weaker than the all-shortest-paths query model. More formally, Proposition 5. If Q ⊆ V verifies G w.r.t. the routing-table query model, then Q verifies G w.r.t. the all-shortest-paths query model. One can wonder whether the routing-table query model is always much weaker than the all-shortest-paths query model. The following lemma, which we will use also in the rest of the paper, shows that this is not the case for some class of graphs. Proposition 6. Let G = (V, E) be a graph containing a vertex s which is adjacent to all other vertices of G. Let Q ⊆ V . If Q verifies G w.r.t. the all-shortestpaths query model, then Q ∪ {s} verifies G w.r.t. the routing-table query model. Proof. Let u, v ∈ V, u = v and u, v ∈ Q. As Q verifies G w.r.t. the all-shortestpaths query model, then Lemma 1 implies that |dG (q, u) − dG (q, v)| ≥ 1, for some q ∈ Q. W.l.o.g., let dG (q, u) < dG (q, v). Now, consider the routing-table query model. After making the query at s, we know that every vertex is at
Network Verification via Routing Table Queries
275
distance 1 from s. Thus, the distance between any pair of distinct vertices of G can be either 1 or 2. Since u, u ∈ tableG (q) whilst v, v ∈ tableG (q), we know that dG (q, u) = 1 whilst dG (q, v) = 2. Therefore, (u, v) is an edge of G iff v, u ∈ tableG (q) (and thus, (u, v) is a non-edge of G iff v, u ∈ tableG (q)). Hence, Q ∪ {s} verifies G w.r.t. the routing-table query model.
4
Lower Bounds on the Size of Feasible Solutions
In this section, we show lower bounds on the minimum number of queries needed to verify any graph G of n vertices w.r.t. the routing-table query model, as well as improved (linear) lower bounds for paths and cycles. We begin by showing that Ω(log log n) queries are necessary to verify a graph G of n vertices. In [1], the authors proved that log3 Δ queries are necessary to verify a graph G of maximum degree equal to Δ w.r.t. the all-shortest-paths query model. Therefore, by Proposition 5, we have that Corollary 1. Let G be a graph of maximum degree equal to Δ and let Q be a query set that verifies G w.r.t. the routing-table query model. Then |Q| ≥ log3 Δ. n In what follows, we prove a lower bound of Ω log on the minimum number Δ of queries needed to verify a graph G with n vertices and maximum degree equal to Δ w.r.t. the routing-table query model, thus obtaining a lower bound of n max{log3 Δ, Ω log } = Ω(log log n) on the minimum number of queries needed Δ to verify any graph G of n vertices w.r.t. the routing-table query model. For any q, v ∈ V , let w ∈ V | v ∈ TqG (w) if v ∈ NG [q]; q groupG (v) := ∅ otherwise. The lower bound of Ω
log n Δ
hinges on the following necessary condition
Proposition 7. If Q ⊆ V verifies G, then, ∀u, v ∈ V, u = v, one of the following conditions is satisfied: (i) u ∈ NG [q] or v ∈ NG [q], for some q ∈ Q; (ii) ∃q ∈ Q such that groupqG (u) = groupqG (v). Proof. For the sake of contradiction, assume that Q verifies G but none of the conditions (i) and (ii) is satisfied. We divide the proof into two cases. In the first case, we have that u and v are twin vertices, i.e., the identity function from V to V is an isomorphism for G and the graph obtained from G by swapping the role of u and v. As (i) is not satisfied, we have that u, v ∈ Q. Therefore, dG (q, u) = dG (q, v) for every q ∈ Q. Thus, Proposition 5 and Lemma 1 imply that Q cannot verify G. In the second case, we have that u and v are not twin vertices. Consider the graph G obtained from G by swapping the role of u and v. Clearly, for every q ∈ Q, and for every vertex x ∈ V, x = u, v, x, w ∈ tableG (q) iff x, w ∈
276
E. Bampas et al.
tableG (q), since w = u, v as condition (i) does not hold. Moreover, by definition of G and because (i) does not hold, u ∈ TqG (w) iff v ∈ TqG (w) and v ∈ TqG (w) iff u ∈ TqG (w), for every q ∈ Q. Since (ii) does not hold, then for every q ∈ Q, u ∈ TqG (w) iff v ∈ TqG (w). As a consequence, for every q ∈ Q, u ∈ TqG (w) iff u ∈ TqG (w) and v ∈ TqG (w) iff v ∈ TqG (w). Therefore, tableG (q) = tableG (q) for every q ∈ Q. Thus, Q cannot verify G.
We can prove the following. Lemma 2. Let G be a graph with n vertices of maximum degree equal to Δ and let Q be a set of queries that verifies G w.r.t. the routing-table query model. Then n |Q| ≥ Ω log . Δ Proof. Let Q = {q1 , . . . , qh } be a minimum cardinality set ofqueries that verifies G w.r.t. the routing-table query model and let V = V \ q∈Q NG [q]. Since G has maximum degree equal to Δ, we have that |V | ≥ n − |Q|(Δ + 1). Moreover, as groupqG (v) ⊆ NG (q), for every v ∈ V and for every q ∈ Q, we have that groupqG (v) is an element of the power set 2Δ . As a consequence,
groupqG1 (v), . . . , groupqGh (v) is an element of the set (2Δ )|Q| = 2|Q|Δ
power . q1 qh Since condition (ii) of Proposition 7 implies that groupG (v), . . . , groupG (v) =
groupqG1 (u), . . . , groupqGh (u) for every two distinct vertices u, v ∈ V , we have that 2|Q|Δ ≥ |V | ≥ n − |Q|(Δ + 1) n holds. Hence, |Q| = Ω log .
Δ By combining the lower bound in Corollary 1 with the one in Lemma 2 we obtain Theorem 1. Let G be a graph of n vertices and let Q be a query set that verifies G w.r.t. the routing-table query model. Then |Q| = Ω(log log n). We point out that a direct application of Proposition 7 implies linear lower bounds for paths and cycles (unlike in the all-shortest-paths query model, for which a constant number of queries suffices). More formally, Corollary 2. Let G be a graph of n vertices and let Q be a minimum cardinality set of queries that verifies G w.r.t. the routing-table query model. We have that 1. |Q| ≥ n4 if G is a path; 2. |Q| ≥ n8 if G is a cycle. Proof. For paths, by Proposition 7, at least one vertex of every subpath of four consecutive vertices has to be contained in Q. The proof for cycles is omitted.
In Section 6, we provide an improved (tight) lower bound for paths. Due to the results of Corollary 2, one can wonder whether every graph needs a linear number of queries to be verified. We provide a negative answer to this question by exhibiting a class of graphs that can be verified with O(log n) queries.
Network Verification via Routing Table Queries
277
Consider any graph G of n vertices u0 , . . . , un −1 . We build G as follows. G contains a copy of G plus 1 + log n vertices s, q1 , . . . , qlog n . Vertex ui is adjacent to vertex qj iff the j-th bit of the binary representation of i is equal to 1. Vertex s is adjacent to all the other vertices of G. Let Q = {s, q1 , . . . , qlog n }. We now argue that Q verifies G w.r.t. the all-shortest-path query model. Indeed, Q verifies all edges and non-edges incident to the vertices in Q. Moreover, for every ui , ui with i = i , there exists at least one bit, say the j-th, in which the binary representation of i differs from the binary representation of i . This implies that |dG (qj , ui ) − dG (qj , ui )| ≥ 1. Thus, Lemma 1 implies that Q verifies G w.r.t. the all-shortest-paths query model. Finally, as s is adjacent to all vertices of the graph, by Proposition 6 we have that Q verifies G w.r.t the routing-table query model.
5
Verifying Graphs of Diameter 2
Even though the problem of determining whether the Network Verification Problem w.r.t. the routing-table query model is in NPO is open, in this section, we first show the existence of a polynomial-time algorithm that computes a set of queries Q that verifies a graph G of diameter equal to 2 w.r.t. the routing-table query model such that |Q| is within an O(log n) (multiplicative) factor from the size of any optimal solution. Furthermore, we also show that this result is asymptotically best possible. Indeed, for graphs of diameter equal to 2, we prove that no polynomial time algorithm can compute a set of queries that verifies the graph w.r.t. the routing-table query model whose size is within an o(log n) (multiplicative) factor from the size of any optimal solution. To describe our algorithm, we need to introduce some definitions. Let G = (V, E) be a graph. A set U ⊆ V is a locating-dominating code of G iff (i) NG [v] ∩ U = ∅ for every v ∈ V and (ii) NG (v) ∩ U = NG (u) ∩ U for every u, v ∈ V \ U, u = v. A set U ⊆ V is a connected locating-dominating code iff U is a locating-dominating code and G[U ] is a connected graph. The optimization problem of computing a minimum cardinality locating-dominating code of a graph G of n vertices can be approximated within a factor of O(log n) and this ratio is asymptotically tight [10,15]. Lemma 3. Let G = (V, E) be a graph of diameter equal to 2, let U ∗ be a minimum cardinality locating-dominating code of G, and let Q ⊆ V be a set of vertices that verifies G w.r.t. the routing-table query model. Then |Q| ≥ |U ∗ | − 1. Proof. Let u, v ∈ V \ Q, with u = v. By Proposition 5 we have that if Q verifies G, then |dG (q, u) − dG (q, v)| ≥ 1, for some q ∈ Q. As G has diameter equal to 2, we either have that dG (q, u) = 1 and dG (q, v) = 2 or dG (q, u) = 2 and dG (q, v) = 1. As this has to be true for every two distinct vertices u, v ∈ V \ Q, it follows that there exists at most one vertex, say v¯ such that dG (q, v¯) = 2 for every q ∈ Q. As a consequence, Q ∪ {¯ v} is a locating-dominating code of G. Thus, |Q| + 1 ≥ |U ∗ |.
278
E. Bampas et al.
Theorem 2. Let G = (V, E) be a graph of diameter equal to 2 and let Q∗ be a minimum cardinality set of queries that verifies G w.r.t. the routing-table query model. There exists a polynomial-time algorithm that computes a set Q |Q| that verifies G w.r.t. the routing-table query model such that |Q ∗ | = O(log n). Proof. We prove that any connected locating-dominating code of G verifies G. Observe that this immediately implies the claim. Indeed, let U ∗ be a minimum cardinality locating-dominating code of G. As U ∗ is also a dominating set of G, it is easy to construct a connected locating-dominating code U of G such that U ∗ ⊆ U and |U | ≤ O(|U ∗ |) (see also [11]). Therefore, thanks to the O(log n)-approximation algorithm for computing a locating-dominating code of G (see [10]), we can also compute a connected locating-dominating code Q of G |Q| |Q| |Q| such that |U ∗ | = O(log n). Thus, Lemma 3 implies |Q∗ | ≤ |U ∗ |−1 = O(log n). Let Q be a connected locating-dominating code of G and consider two distinct vertices u and v of G such that u, v ∈ Q. As Q is a locating-dominating code, then there exists a vertex q ∈ Q such that, w.l.o.g., q ∈ NG (u) and q ∈ NG (v), i.e, u, u ∈ tableG (q) and v, v ∈ tableG (q). This implies that dG (q, u) = 1 and dG (q, v) ≥ 2. If (u, v) is a non-edge, then as the diameter of G is equal to 2, we have that v ∈ TqG (u). Therefore, by Proposition 3, we have that Q verifies non-edge (u, v). If (u, v) is an edge, then we have that v ∈ TqG (u). Let q be a vertex of Q be such that q ∈ NG (v), i.e., v, v ∈ tableG (q ). If dG (q, q ) = 1, then we have that v, q ∈ tableG (q) and thus we know that dG (q, v) = 2. Therefore, v ∈ TqG (u) implies that (u, v) is an edge of G. Consider the case dG (q, q ) ≥ 2 for every vertex q ∈ Q such that q ∈ NG (v). Since G has diameter equal to 2, we have that dG (q, q ) = 2. Moreover, as Q is a connected locating-dominating code, there is a vertex q ∈ Q such that dG (q, q ) = dG (q , q ) = 1. As dG (¯ q , v) = 2 for every vertex q¯ ∈ Q such that dG (q, q¯) = 1, we have that v, q¯ ∈ tableG (q). Furthermore, after querying q¯ and all the q ∈ Q such that q ∈ NG (v), we know that dG (¯ q , v) = 2. As a consequence, v, q¯ ∈ tableG (q) implies that dG (q, v) ≤ dG (¯ q , v) + 1 − 1 ≤ 2. As dG (q, v) ≥ 2, we have that dG (q, v) = 2. Furthermore, as dG (q, v) = 1 + dG (u, v), it follows that (u, v) is an edge of G.
We observe that the result of Theorem 2 is asymptotically tight due to the following Theorem 3. There exists a class of graphs G and a constant c > 0 such that, for every G ∈ G of n vertices and for every c ≤ c, unless P = NP no polynomialtime algorithm computes a set Q of queries that verifies G w.r.t. the routing-table query model of size |Q| ≤ c |Q∗ | log n, where Q∗ is a minimum cardinality set of queries that verifies G. Proof. In [1], the authors proved that the Network Verification Problem w.r.t. the all-shortest-paths query model has a lower bound of Ω(log n) on its approximability ratio, unless P = NP. Their reduction consists of a graph G having a vertex which is adjacent to all other vertices of G. The claim now follows as a consequence of Proposition 5 and Proposition 6.
Network Verification via Routing Table Queries
6
279
Optimal Algorithms for Classical Topologies
In this section, we show that the Network Verification Problem w.r.t. the routingtable query model can be solved optimally in linear time on paths and trees. Besides that, for cycles of even length we are able to build an optimal query set of size 2n/6+ n2 mod 3. Due to space limitations this result is omitted, but it is worth noting here that our approach heavily relies on the existence of antipodal nodes in the cycle, and so it is not easily extendible to cycles of odd length. 6.1
Paths
It is clear that a path of 2 vertices can be verified by querying any of the two vertices. Let Pn be a path of n ≥ 3 vertices. In what follows we show that 4 2 n4 + n mod queries are necessary to verify Pn . We also show how to verify 3 n 4 Pn with 2 4 + n mod queries. We number the vertices of Pn from 1 to n by 3 traversing the path from one endvertex to the other one. We have that Lemma 4. Let Q ⊆ V (Pn ). Q verifies Pn iff for every i = 1, . . . , n − 2, i ∈ Q or i + 2 ∈ Q. Proof. Let Q be a set of vertices that verifies G and, for the sake of contradiction, assume that there exists i ∈ {1, . . . , n − 2} such that i, i + 2 ∈ Q. It is easy to verify that tableG (j) = tableG+(i,i+2) (j) for every j = 1, . . . , n, j = i, i + 2. Indeed, for every k = 1, . . . , n, with k = j, we have that k, j ± 1 ∈ tableG (j) iff k, j ± 1 ∈ tableG+(i,i+2) (j). Now, let Q be a set of vertices such that i ∈ Q or i + 2 ∈ Q, for every i = 1, . . . , n − 2. We show that Q verifies G. Consider any vertex i not in Q. We prove that Q verifies all the edges and non-edges of the form (i, j), for every j = 1, . . . , n, j = i. If i = 1, n − 1, n, as i + 1 ∈ Q or {i − 1, i + 2} ⊆ Q, then by Proposition 2, we have that Q verifies all edges (i, i + 1) with 2 ≤ i ≤ n − 2. If 1 ∈ Q or 2 ∈ Q, then also edge (1, 2) is verified. If 1, 2 ∈ Q, then 3 ∈ Q and thus, by Proposition 1, we have that Q also verifies edge (1, 2). The proof for the edge (n − 1, n) is similar to the proof of edge (1, 2). Concerning the non-edges of G, let (i, j) with j ≥ i + 3 be any non-edge of G such that j ∈ Q. Notice that there exists i < k < j − 1 such k, k + 1 ∈ Q. By Proposition 4, we have that {k, k + 1} verifies non-edge (i, j).
Thanks to Lemma 4, we can reduce the problem of verifying Pn to the problem of finding a minimum vertex cover on paths, a problem that can be clearly solved in linear time.1 Indeed, consider the graph G with V (G ) = V (Pn ) such that 1
Assume the path contains n vertices numbered from 1 to n by traversing the path from one endvertex to the other one. The set X = i | 1 ≤ i ≤ n, i is even of n/2 vertices is a vertex cover of the first of all observe path. To see that it is minimum, that |X| is equal to the size of (i−1, i) | 1 ≤ i ≤ n, i is even , a maximum matching of the path. Next, use the well-know K¨ onig-Egerv´ ary theorem stating that the size of any vertex cover of a graph G is lower bounded by the size of any matching of G.
280
E. Bampas et al. P11 G
Fig. 1. An example of an optimal query set for P11 . Graph G on V (P11 ) contains an edge between two vertices iff their distance in P11 is 2. The set of gray vertices is a minimum vertex cover of G as well as a minimum-size set of queries that verifies P11 .
there exists edge (i, j) iff |i − j| = 2 (i.e., either j = i − 2 or j = i + 2). We have that Q verifies Pn iff Q is a vertex cover of G . Observe that the graph G is a forest of two paths, one containing all the n 2 odd vertices, and the other one containing all the n2 even vertices (see also Figure 1). As the minimum cardinality vertex cover of a path of k vertices is k2 , n
4 we have that n4 + 22 = 2 n4 + n mod vertices are necessary to verify Pn . 3 n 4 Moreover, the set {4i | i = 1, . . . , 4 } ∪ {4i − 1 | i = 1, . . . , n4 + n mod } of 3 n n mod 4 2 4 + 3 vertices verifies Pn (see Figure 1). Thus, we have the following
Theorem 4. There exists a linear-time algorithm that solves optimally the Network Verification Problem w.r.t. the routing-table query model on paths. 6.2
Trees
We now extend the above algorithm for trees. Let T be a tree of n vertices. Observe that the proof of Lemma 4 can be easily extended to prove the following. Lemma 5. Let Q ⊆ V (T ). Q verifies T iff for every path P in T , with |V (P )| ≥ 3, Q ∩ V (P ) verifies P . Then, the following can be proven Theorem 5. There exists a linear-time algorithm that solves optimally the Network Verification Problem w.r.t. the routing-table query model on trees. Sketch of proof. Thanks to Lemma 4 and 5, it can be shown that the problem of verifying T reduces to finding a minimum vertex cover of G = (V (T ), {(u, v) | u, v ∈ V (T ), dT (u, v) = 2}). Graph G consists of two connected components, each of which is a block graph [12]. For such special graph we can provide a lineartime algorithm to compute a minimum vertex cover, and the claim follows.
7
Conclusions
In this paper, we addressed the problem of verifying a graph w.r.t. the newly defined routing-table query model. On the one hand, we showed that the problem is NP-hard to approximate within o(log n) (which is tight for graphs of diameter 2), and on the other hand that it can be solved optimally in linear time for some basic network topologies.
Network Verification via Routing Table Queries
281
We argued that our query model is much closer to reality than the previously used all-shortest-paths and all-distances query models, as it relies on local information that can be gathered by simply exploring the routing tables of the nodes of a given network. In practice, however, routing tables could contain much more information than the one we used in defining our query model (e.g., the distance to the destination nodes), or they might have a bounded number of next-hop entries for each specific destination node. Thus, we plan in the future to investigate corresponding variants of the introduced model. Moreover, for the presented query model and its envisioned variants, establishing whether the network verification problem is in NPO is a challenging research task.
References 1. Beerliova, Z., Eberhard, F., Erlebach, T., Hall, A., Hoffman, M., Mihal’´ak, M., Ram, S.: Network discovery and verification. IEEE Journal on Selected Areas in Communications 24(12), 2168–2181 (2006) 2. Bejerano, Y., Rastogi, M.: Rubust monitoring of link delays and faults in IP networks. In: 22nd IEEE Int. Conf. on Comp. Comm (INFOCOM 2003), pp. 134–144 (2003) 3. Bil` o, D., Erlebach, T., Mihal’´ ak, M., Widmayer, P.: Discovery of network properties with all-shortest-paths queries. Theoretical Computer Science 411(14-15), 1626– 1637 (2010) 4. Bshouty, N.H., Mazzawi, H.: Reconstructing weighted graphs with minimal query complexity. Theoretical Computer Science 412(19), 1782–1790 (2011) 5. Choi, S.-S., Kim, J.H.: Optimal query complexity bounds for finding graphs. Artificial Intelligence 174(9-10), 551–569 (2010) 6. Dall’Asta, L., Alvarez-Hamelin, J.I., Barrat, A., V´ azquez, A., Vespignani, A.: Exploring networks with traceroute-like probes: Theory and simulations. Theoretical Computer Science 355(1), 6–24 (2006) 7. Erlebach, T., Hall, A., Mihal’´ ak, M.: Approximate Discovery of Random Graphs. In: Hromkoviˇc, J., Kr´ aloviˇc, R., Nunkesser, M., Widmayer, P. (eds.) SAGA 2007. LNCS, vol. 4665, pp. 82–92. Springer, Heidelberg (2007) 8. Garey, M.R., Johnson, D.: Computers and intractability: a guide to the theory of NP-completeness. Freeman, San Francisco (1979) 9. Govindan, R., Tangmunarunkit, H.: Heuristics for Internet map discovery. In: 19th IEEE Int. Conf. on Comp. Comm (INFOCOM 2000), pp. 1371–1380 (2000) 10. Gravier, S., Klasing, R., Moncel, J.: Hardness results and approximation algorithms for identifying codes and locating-dominating codes in graphs. Algorithmic Operations Research 3, 43–50 (2008) 11. Guha, S., Khuller, S.: Approximation algorithms for connected dominating sets. Algorithmica 20, 374–387 (1998) 12. Harary, F.: A characterization of block graphs. Canad. Math. Bull. 6(1), 1–6 (1963) 13. Harary, F., Melter, R.: The metric dimension of a graph. Ars Combinatoria, 191– 195 (1976) 14. Khuller, S., Raghavachari, B., Rosenfeld, A.: Landmarks in graphs. Discrete Applied Mathematics 70, 217–229 (1996) 15. Suomela, J.: Approximability of identifying codes and locating-dominating codes. Information Processing Letters 103(1), 28–33 (2007)
Social Context Congestion Games Vittorio Bil` o1 , Alessandro Celi2 , Michele Flammini2 , and Vasco Gallotti2 1 Department of Mathematics, University of Salento Provinciale Lecce-Arnesano, P.O. Box 193, 73100 Lecce - Italy
[email protected] 2 Department of Computer Science, University of L’Aquila Via Vetoio, Loc. Coppito, 67100 L’Aquila - Italy {alessandro.celi,michele.flammini,vasco.gallotti}@univaq.it
Abstract. We consider the social context games introduced in [2], where we are given a classical game, an undirected social graph expressing knowledge among the players and an aggregating function. The players and strategies are as in the underlying game, while the players costs are computed from their immediate costs, that is the original payoffs in the underlying game, according to the neighborhood in the social graph and to the aggregation function. More precisely, the perceived cost incurred by a player is the result of the aggregating function applied to the immediate costs of her neighbors and of the player herself. We investigate social context games in which the underlying games are linear congestion games and Shapley cost sharing games, while the aggregating functions are min, max and sum. In each of the six arising cases, we first completely characterize the class of the social network topologies guaranteeing the existence of pure Nash equilibria. We then provide optimal or asymptotically optimal bounds on the price of anarchy of 22 out of the 24 cases obtained by considering four social cost functions, namely, max and sum of the players’ immediate and perceived costs. Finally, we extend some of our results to multicast games, a relevant subclass of the Shapley cost sharing ones.
1
Introduction
The widespread of decentralized and autonomous computational systems, such as highly distributed networks, has rapidly increased the interest of computer scientists for existence and efficiency of equilibria solutions in presence of selfish non-cooperative users (see [25] for a detailed discussion). Nevertheless, there are scenarios of practical application (i.e., social networks) in which it can be observed a certain degree of cooperation among users who are related by some kind of knowledge relationships. In such environments, in fact, it may be the case that the happiness of a player does not depend only on her experienced utility,
This work was partially supported by the PRIN 2008 research project COGENT “Computational and game-theoretic aspects of uncoordinated networks” funded by the Italian Ministry of University and Research.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 282–293, 2011. c Springer-Verlag Berlin Heidelberg 2011
Social Context Congestion Games
283
but it is rather somehow related to the one of her “friends”. As a consequence, considerable research effort is being devoted to the determination and investigation of suitable frameworks able to combine in a realistic way game theoretical concepts with social network aspects. Such a task is usually accomplished by coupling a standard non-cooperative game with a social knowledge graph expressing social relationships among the players involved in the game. Social knowledge graphs were first used in [5,6,12,21] in order to model the lack of complete information among players. In particular, they represent each player in the game with a node in the graph and assume that there exists an edge between node vi and node vj if and only if player i knows player j’s adopted strategy. Another model, exploiting social knowledge graphs in a different and perhaps more powerful way, is that of social context games introduced in [2]. These kind of games constitutes an interesting extension able to capture important concepts related to social aspects in noncooperative games, like, for instance, collaboration, coordination and collusion among subsets of players. Consider a strategic game SG defined by a given set of players, strategies and payoff functions which we assume, without loss of generality, to be costs for the players and which are called immediate costs. Given a social knowledge graph G, the neighborhood of node vi in G defines the set of players interacting with player i. The particular type of interaction is then characterized by an aggregating function f which maps tuples of real values into real values. A social context game, defined by the triple (SG, G, f ), is a game in which players play as in SG and the cost experienced by player i, called perceived cost, is obtained by applying f to the tuple yielded by the immediate cost of i and of all the players interacting with her according to G. Clearly, depending on which underlying game SG, which social knowledge graph G and which aggregating function f are used, several interesting social context games can be defined. In this paper, we focus on the cases in which SG belongs to one of the following subclasses of congestion games: linear congestion games, Shapley cost sharing games and multicast games, while f may be one of the following aggregating functions: minimum, maximum and sum (or average). Related works. Congestion games were introduced in [26] by Rosenthal who showed that they admit an exact potential. This means that any sequence of improving deviations performed by non-cooperative selfish players is always guaranteed to end up in a pure Nash equilibrium. Equivalence between this class of games and the class of games admitting exact potentials was later discovered in [24]. Since then, congestion games have affirmed as one of the most hot topic in Algorithmic Game Theory and as a challenging and fruitful arena where to study the existence of equilibria and the complexity of their computation, as well as their prices of anarchy [22] and stability [1] (corresponding respectively to the worst-case and the best-case ratios between the quality of an equilibrium and that of an optimal solution). For more details, the interested reader may refer to [25] and references therein. One of the most interesting and studied special cases is the class of linear congestion games which has been considered in [3,7,9,10,27,29]. Shapley cost
284
V. Bil` o et al.
sharing games have been mainly addressed in the special case in which resources are edges in a network and players want to establish connections between two terminals by buying paths. According to the Shapley value definition [28], the cost of each edge is equally shared among its users. The case in which each player wants to connect arbitrary pairs of terminals is called multi-commodity network design, while the restricted case in which all players share a common terminal is called multicast games. The study of these classes of games has been carried out in [1,4,8,11,23]. The idea of using a graph in order to model relationships among the players in a strategic game dates back to the seminal paper [17], where such a graph has as node set the set of players and is constructed in such a way that there is an edge from node vi to node vj if the choices of player i may influence j’s payoff. However, given the particular underlying game, the graphical representation of [17] is completely induced by the underlying game, since the purpose of their investigation is the reduction of the space complexity for representing sparse games (i.e., games in which only small subsets of the players can influence the payoff of a player) and the reduction of the time complexity for computing equilibria. The use of social knowledge graphs in order to model the lack of complete information among players in a game was first considered in [5,6]. Their approach is based on the observation that, for highly decentralized games, still in the pure selfish setting, the usual assumption that each player knows the strategy adopted by all the other ones may be too optimistic or even infeasible, and it becomes more realistic to assume that each player is aware only of the strategies played by the subset of players she knows. More precisely, they introduce the notion of social knowledge graph in which the neighborhood of each node vi models the set of players of which player i is aware, that is, whose chosen strategies can influence player i’s payoff and hence her choices. For analogy with [17], conventional games equipped with social graphs are also called graphical. However, differently from [17], the social knowledge graph is independent from the underlying game and causes a redefinition of the basic payoffs as functions of the induced mutual influences. Besides characterizing the convergence to pure Nash equilibria with respect to the social graph topology (directed, undirected, directed acyclic), in [5] the the prices of anarchy and stability in linear congestion games and the restricted case of resource selection games with linear latencies have been determined as a function of the bounds (node degree) on the players knowledge. For undirected social knowledge graphs, their results have been significantly extended in [12] to the more general setting of weighted players. In such a paper, the authors prove that the game always converges to pure Nash equilibria, that the largest improvement -Nash dynamics converges in polynomial time to a solution with approximation ratio arbitrarily close to the price of anarchy and that, for unweighted players, the largest improvement -Nash dynamics converges in polynomial time to an -pure Nash equilibrium. Then, they characterize both the prices of anarchy and stability as a function of α(G), the independence number of the social knowledge graph, by showing that the price of anarchy
Social Context Congestion Games
285
essentially grows as α(G)(α(G) + 2) and that the price of stability lies between α(G) and 2α(G), i.e., the more players know, the better the performances of pure Nash equilibria. On the other side, investigations in multicast games provided in [6] show that a limited social influence may lead to better equilibria, thus opening a new window on how the performances of non-cooperative systems may benefit from the lack of global knowledge among players. Indeed, the impact of incomplete information in non-cooperative games had been already taken into account in some previous papers [14,16,21], although in restricted scenarios. In particular, in [14], each player only knows that each of the other ones belongs to a set of possible types and so pure profiles in the complete information setting translate to probability distributions over all possible type profiles. In [16], performances of non-atomic congestion games in which a fraction of the players are totally ignorant to the presence of other players, thus oblivious to the resource congestion when selecting their strategies, are analyzed. In [21], a model based on a directed social graph, where each player knows the precise weights of the players in her social neighborhood and only a probability distribution for the weights of the rest, is presented to analyze performances of a very simple game with just two identical parallel links. Social context games were introduced and studied in [2] for the cases in which SG is drawn from the class of resource selection games, i.e., the special case of congestion games in which strategies are always singleton sets, and f is one among minimum, maximum, sum and ranking functions. They show existence of pure Nash equilibria in the following cases: f is the minimum function and the size of the largest dominating set of G is smaller than n2 , f is the maximum function, f is the sum function and G is a tree of maximal degree m − 2, where m is the number of resources in the game, f is the ranking function, G is a partition into cliques and all the resources are identical. On the negative side, they provide instances possessing no pure Nash equilibria in the following cases: f is the minimum function and the size of the larger dominating set of G is equal to n2 , f is the sum function, G is a tree and all the resources are identical, f is the ranking function, G is a partition into cliques and the resources are not identical. Finally, they also show that none of the considered social context games is a potential game, i.e., it may admit infinite sequences of improving deviations. Social context games in which G is a partition into cliques coincide with games in which static coalitions among players are allowed. These games were considered in [13,15]. The authors of [13] focus on the case in which SG is a weighted congestion game defined on an parallel link graph and f is the maximum function (i.e, the coalitional generalization of the KP-model [22]). Among their findings, they show that such games always admit a potential function which becomes an exact one in case of linear latency functions (even in the generalization to networks) and that the price of anarchy remains in the order of the one holding for the KP-model as long as more than a sublogarithmic number of coalitions is formed. Moreover, for the case in which SG is a linear network congestion game and f is the sum function, they show that the game admits an
286
V. Bil` o et al.
exact potential (Theorem 6). In [15], it is considered the case in which SG is a general congestion game and f is the sum function. Anyway, their model is more complex than the one based on social context games, since they allow players in a coalition (clique) to perform joint deviations to new strategies. They define the price of collusion as the ratio between the worst Nash equilibrium in the game with coalitions and the worst Nash equilibrium in the coalition-free game. For splittable congestion games they show an arbitrarily high price of collusion which drops to 1 in symmetric resource selection games with convex delays. For unsplittable games, they show existence of pure Nash equilibria and a price of collusion equal to 2 in symmetric resource selection games with convex delays. In the case of concave delays, the existence of pure Nash equilibria is left open, while the price of collusion is shown to be at least 8/7 and at most 4 in general and at most 2 when pure Nash equilibria do exist. Our contribution. We consider social context games in which SG can be either a linear congestion game or a Shapley cost sharing game and f is one among the minimum, maximum and sum functions. In all cases we completely characterize which topologies of G can always guarantee existence of pure Nash equilibria as follows. For any G, if SG is a linear congestion game and f is the sum function, then (SG, G, f ) is an exact potential game (this extends Theorem 6 in [13], which holds for network linear congestion games in which G is a partition into cliques). If G is either the complete or the empty graph, then (SG, G, f ) is an exact potential game for any SG and f . In all the other cases, for any fixed G, there always exists a pair (SG, f ) such that (SG, G, f ) does not admit pure Nash equilibria. We bound the price of anarchy for all the six arising social context games under four natural social functions, namely, the sum and the maximum of the players’ immediate and perceived costs. For coherence with our existence results, we restrict our analysis to the cases in which pure Nash equilibria always exist. We present tight or asymptotically tight bounds on 22 out of the 24 cases. In general, all of them are significatively high, except for the case of linear congestion games with aggregating function sum and social function sum of immediate costs for which a price of anarchy between 5 and 17 holds. 3 Finally, we (partially) extend the above results to the case in which SG is a multicast game, an interesting restriction to networks of Shapley cost sharing games. In particular, we show that any Shapley cost sharing game admitting no pure Nash equilibria can be turned into a multicast game admitting no potential functions (i.e., admitting an infinite sequence of improving deviations). We also show that although multicast games are a restriction of the Shapley cost sharing ones, their prices of anarchy are asymptotically related. More precisely, we show instances of multicast games whose prices of anarchy asymptotically match the upper bounds on the price of anarchy of Shapley cost sharing games in all the cases under analysis. Paper organization. The paper is organized as follows. In the next section we present the model of social context games and basic definitions. In Section 3,
Social Context Congestion Games
287
we give some preliminary general results. In Section 4, we analyze social context games in which the underlying strategic game SG is a linear congestion game, while in Section 5, we consider the case in which SG is a Shapley cost sharing game. Finally, in Section 6, we give some conclusive remarks and discuss some open questions. Due to lack of space, proofs are omitted.
2
Model and Definitions
A non-cooperative game in strategic form is a triple SG = (P, Si∈P , ωi∈P ), where P = [n] is a set of n players and, for any i ∈ [n], Si defines the set of strategies of player i and ωi : ×i∈[n] Si → R defines the cost i gets in any possible strategy profile s ∈ S := ×i∈[n] Si . For a strategy profile s = (s1 , . . . , sn ) ∈ S, a player i ∈ [n] and a strategy t ∈ Si , we denote as (s−i t) = (s1 . . . , si−1 , t, si+1 , . . . , sn ) the strategy profile obtained from s by replacing strategy si with strategy t. We say that player i has an improving deviation in s if there exists t ∈ Si such that ωi (s−i t) < ωi (s). A strategy profile s is a pure Nash equilibrium if for any i ∈ [n] and t ∈ Si , it holds ωi (s) ≤ ωi (s−i t), that is, no player can lower her cost by unilaterally changing her strategy or, analogously, no player has an improving deviation in s. We denote by N E(SG) the set of pure Nash equilibria of game SG. A game SG is a potential game (or it has the finite improvement path property) if it does not admit an infinite sequence of improving deviations or, analogously, any sequence of improving deviations is always guaranteed to end up at a pure Nash equilibrium. More formally, a potential function for SG is a function Φ(s) : S → R such that, for any s ∈ S, i ∈ [n] and t ∈ Si , it holds ωi (s−i t) < ωi (s) ⇒ Φ(s−i t) < Φ(s). The function Φ is called an exact potential if Φ(s) − Φ(s−i t) = ωi (s) − ωi (s−i t). Given a social function H : S → R measuring the overall happiness of the players in any strategy profile, the price of anarchy of a game SG is defined as H(s) ∗ P oA(SG) = maxs∈N E(SG) H(s is the strategy profile minimizing the ∗ ) , where s social function H. A congestion game CG is defined as CG = (P, R, Si∈P , r∈R) where P = [n] is the set of players, R = {r1 , . . . , rm } is a set of m resources, Si ⊆ 2R is a family of subsets of resources defining the strategy set of each player i ∈ [n] and r : N → R is the latency function associated with each resource r ∈ R. Let S = ×i∈[n] Si be the set of all possible strategy profiles which can be realized in the game. The congestion of resource r ∈ R in the profile s = (s1 , . . . , sn ) ∈ S, denoted as cr (s), is defined as the number of players using r in s, that is, cr (s) = |{i ∈ [n] : r ∈ si }|. The payoff experienced by playeri ∈ [n] in the profile s, which we call immediate cost, is defined as ωi (s) = r∈si r (cr (s)), that is, the sum of the latencies of all the resources she uses. We consider the following three special cases: linear congestion games, in which r (x) = ar x + br , Shapley cost sharing games, in which r (x) = axr , and multicast cost sharing games, the subclass of Shapley cost sharing games in which resources are edges in an undirected network and each player wants to connect a terminal node to a common source.
288
V. Bil` o et al.
We denote by n − SG a generic class of strategic games with n players and by SG = n≥2 n − SG a generic class of strategic games. Analogously, we denote by n− LCG (resp. n− SCG and n− MCG) the class of linear congestion games (resp. Shapley cost sharing games and multicast cost sharing games) with n players and by LCG (resp. SCG and MCG) the class of linear congestion games (resp. Shapley cost sharing games and multicast cost sharing games). A social knowledge graph for a strategic game SG is an undirected graph G = (V, E) in which each vertex vi ∈ V (G) is associated to a player i ∈ [n] and {vi , vj } ∈ E(G) if and only if players i and j know each other. Thus, G captures the social knowledge of the players in the game. Let Q be the set of all finite tuples of real numbers. A social context game is a triple SCG = (SG, G, f ) where SG is a strategic game, G is a social knowledge graph for SG and f : Q → R is an aggregating function mapping tuples of real numbers into real numbers. Let Pi (G) = {j ∈ [n] : {vi , vj } ∈ E(G)} ∪ {i} be the set of players knowing i according to G, counting i herself and let Qi (s) =
ωj (s)j∈Pi (G) be the tuple of immediate costs experienced in s by all players in Pi (G). The social context game SCSG = (SG, G, f ) has the same set of players and strategies of SG (that is, players keep playing the underlying strategic game SG), but the payoff of player i in the strategy profile s, which we call perceived games SG cost, is now redefined as ω i (s) = f (Qi (s)). Each class of strategic induces a class of related social context games SC SG (G,f ) = SG∈SG (SG, G, f ) for any fixed G and f . We also denote as SC SG (f ) = G SC SG (G, f ) the class of all social context games induced by f on the underlying class of games SG. We will consider social context games induced by the classes of linear congestion games, Shapley cost sharing games and multicast cost sharing games, i.e., the classes SC LCG (G, f ) = SG∈LCG (SG, G, f ), SC SCG (G, f ) = SG∈SCG (SG, G, f ) and SC MCG (G, f ) = SG∈MCG (SG, G, f ), where G can be any social network and f is one among the functions min, max and sum, defined respectively as the minimum, maximum and sum of the given tuple of numbers. Moreover, we study the efficiency of pure Nash equilibria for the four social functions: sum of immediate costs sum-imm(s) = i∈[n] ωi (s), sum of perceived i (s), maximum immediate cost max-imm(s) = costs sum-per(s) = i∈[n] ω i (s). maxi∈[n] ωi (s) and maximum perceived cost max-per(s) = maxi∈[n] ω
3
Results for the Class SC SG (G, f )
For any class of social context games SC SG (G, f ), we consider here the degenerate cases in which G is either the empty or the complete graph, since, in these cases, existence or non-existence of pure Nash equilibria can be shown independently of the particular class defining the underlying games. For the case in which G is the empty graph, it is easy to see that the perceived cost of any player in a social context game SCSG ∈ SC SG (G, f ) coincides with her immediate cost in SG, that is, there is no difference between the social context game SCSG and underlying game SG. Thus all the properties possessed by SG carry over also to SCSG independently of which aggregating function is adopted.
Social Context Congestion Games
289
For the case in which G is the complete graph, the following result shows that, for any of the aggregating functions we are considering, SCSG is always an exact potential game independently of the particular underlying game SG. Lemma 1. Any social context game is an exact potential game when G is the complete graph and f ∈ {min, max, sum}. Let G(n) be the set of undirected graphs G = (V, E) such that |V | = n and 0 < |E| < n(n−1) , that is, the set of n-node undirected graphs which are neither 2 empty nor complete. We call the 3-node graphs G1 = ({x, y, z}, {{x, y}, {y, z}}) and G2 = ({x, y, z}, {x, y}) respectively the path graph and the two-components graph. We show that, for any n ≥ 3 and f ∈ {min, max, sum}, no social network G can guarantee existence of pure Nash equilibria in the class n − SC SG (G, f ) when there exist a game in 3 − SC SG (G1 , f ) and a game in 3 − SC SG (G2 , f ) both admitting no pure Nash equilibria. Theorem 1. For any class of strategic games SG and aggregating function f ∈ {min, max, sum}, if there exist two games SG1 , SG2 ∈ 3 − SG such that (SG1 , G1 , f ) and (SG2 , G2 , f ) admit no pure Nash equilibria, then, for any n ≥ 3 and social network G ∈ G(n), there always exists a game SG ∈ n − SG such that (SG, G, f ) does not admit pure Nash equilibria.
4
Results for the Class SC LCG (G, f )
We show that, for f ∈ {min, max}, pure Nash equilibria are always guaranteed to exist in the class SC LCG (G, f ) if and only if G is either the empty or the complete graph. This is achieved by exploiting the following result together with Theorem 1. Lemma 2. For any f ∈ {min, max}, there exist LCG1 , LCG2 ∈ 3 − LCG such that both (LCG1 , G1 , f ) and (LCG2 , G2 , f ) admit no pure Nash equilibria. As a consequence of Lemma 2 and Theorem 1, and because of Lemma 1 and the fact that each linear congestion game is an exact potential game, we can state the following result. Theorem 2. For any f ∈ {min, max}, the class n − SC LCG (G, f ) always possesses pure Nash equilibria if and only if G ∈ / G(n). Moreover, for G ∈ / G(n), all games in n − SC LCG (G, f ) are exact potential games. For the case in which f = sum, we show that any game in SC LCG (G, f ) is an exact potential game, independently of the social knowledge graph G. Theorem 3. Any game in SC LCG (G, f ) is an exact potential game when f = sum.
290
V. Bil` o et al.
In the rest of the section, we bound the price of anarchy of the class SC LCG (f ). For the sake of clarity, we will assume br = 0 for every resource r ∈ R; a complete proof taking into account the br terms will be given in the full version of the paper. Moreover, without loss of generality, we assume that ar = 1 for every r ∈ R. In fact, given a congestion game having latency functions r (x) = ar x with integer coefficient ar ≥ 0, it is possible to obtain an equivalent game by replacing each resource r with a set of ar resources with latency function (x) = x, while if ar is not an integer we can use a similar scaling argument. For coherence with our existential results on pure Nash equilibria, it makes sense to restrict the analysis only to the cases in which G is either empty or complete. Anyway, since in the former case immediate and perceived costs coincides and SCLCG (min), SCLCG (max) and SCLCG (sum) all collapse to the class LCG for which the price of anarchy has been already characterized in [9] for both sum-imm and max-imm, we only need to analyze the case in which G = Kn . Theorem 4. The bounds on the price of anarchy for the class SC LCG (f ) given in Table 1 hold when f ∈ {min, max} and G = Kn . Table 1. Bounds on the price of anarchy for different aggregating and social cost functions when G = Kn SocialF unction sum-imm max-imm sum-per max-per
f = min f = max Θ(nm) Θ(nm) Θ(nm) Θ(nm) n Θ(nm) n Θ(nm)
For the case f = sum, even though we need to consider all possible social knowledge graphs, significantly better bounds can be achieved as shown by the following theorems. Theorem 5. Under the social function sum-imm, for any SCLCG ∈ SCLCG (sum) it holds P oA(SCLCG ) ≤ 17 . Moreover, there is a game SCLCG ∈ 3 SCLCG (sum) such that P oA(SCLCG ) ≥ 5. Theorem 6. Under the social function √ max-imm, for any SCLCG ∈ SCLCG (sum) it holds P oA(SCLCG ) = O( n). Moreover, there is a game √ SCLCG ∈ SCLCG (sum) such that P oA(SCLCG ) = Ω( n). Theorem 7. Under the social function sum-per, for any SCLCG ∈ SCLCG (sum) it holds P oA(SCLCG ) = O(n).√Moreover, there is a game SCLCG ∈ SCLCG (sum) such that P oA(SCLCG ) = Ω( n). Theorem 8. Under the social function max-per, for any SCLCG ∈ SCLCG (sum) it holds P oA(SCLCG ) = O(n).√Moreover, there is a game SCLCG ∈ SCLCG (sum) such that P oA(SCLCG ) = Ω( n).
Social Context Congestion Games
5
291
Results for the Class SC SCG (G, f )
In this section we focus on social context games defined on the underlying class of Shapley congestion games, that is congestion games whose latency functions are of the form r (x) = axr for any r ∈ R. Again we first give a complete characterization of the cases guaranteeing the existence of pure Nash equilibria. Because of Lemma 1 and the fact that Shapley cost sharing games are exact potential games, we have that, for any n ≥ 2 and f ∈ {min, max, sum}, each game in n − SC SCG (G, f ) is an exact potential game when G ∈ / G(n). However, differently from the linear case, equilibria are not guaranteed to exist in all the other cases. This is a consequence of the following lemma and of Theorem 1. Lemma 3. For any f ∈ {min, max, sum}, there exist LCG1 , LCG2 ∈ 3 − SCG such that both (LCG1 , G1 , f ) and (LCG2 , G2 , f ) admit no pure Nash equilibria. We now bound the price of anarchy for all the cases admitting equilibria. Again, since the case in which G is the empty graph has been extensively investigated in the literature, we restrict our analysis to the case in which G = Kn . As in the previous section, we assume that ar = 1 for every r ∈ R. In fact, given a congestion game having latency functions r (x) = ar /x with integer coefficients ar ≥ 0, it is possible to obtain an equivalent game by replacing each resource r with a set of ar resources with latency functions (x) = 1/x, while if ar is not an integer we can use a similar scaling argument. Theorem 9. The bounds on the price of anarchy for the class SC SCG (f ) given in Table 2 hold when G = Kn . Table 2. Bounds on the price of anarchy for all the aggregating and social functions when G = Kn . SocialF unction sum-imm max-imm sum-per max-per
6
f = min f = max f = sum Θ(m) m m Θ(nm) Θ(nm) Θ(nm) n Θ(nm) m n Θ(nm) m
Conclusions
We have considered social context congestion games with linear and Shapley cost functions. In particular, we have provided a complete characterization of the cases admitting pure Nash equilibria for the aggregating functions min, max and sum, and we have given optimal or asymptotically optimal bounds on the price of anarchy, according to the four most natural social cost functions. Several issues are left open. First of all, besides tightening the gaps between some of the proven lower and upper bounds on the price of anarchy, it would be
292
V. Bil` o et al.
worth to extend results for Shapley congestion games also to their restriction on networks. It would also be nice to consider social context games induced by different underlying games as well as to investigate the expected performance when the social graph obeys some social behavior, like in Kleinberg’s Small World model [18,19,20]. Finally, are there more realistic models able to combine strategic and social aspect of games?
References 1. Anshelevich, E., Dasgupta, A., Kleinberg, J., Tardos, E., Wexler, T., Roughgarden, T.: The Price of Stability for Network Design with Fair Cost Allocation. SIAM Journal of Computing 38(4), 1602–1623 (2008) 2. Ashlagi, I., Krysta, P., Tennenholtz, M.: Social Context Games. In: Papadimitriou, C., Zhang, S. (eds.) WINE 2008. LNCS, vol. 5385, pp. 675–683. Springer, Heidelberg (2008) 3. Awerbuch, B., Azar, Y., Epstein, A.: The Price of Routing Unsplittable Flow. In: Proceedings of the 37th Annual ACM Symposium on Theory of Computing (STOC), pp. 57–66. ACM Press, New York (2005) 4. Bil` o, V., Caragiannis, I., Fanelli, A., Monaco, G.: Improved lower bounds on the price of stability of undirected network design games. In: Kontogiannis, S., Koutsoupias, E., Spirakis, P.G. (eds.) Algorithmic Game Theory. LNCS, vol. 6386, pp. 90–101. Springer, Heidelberg (2010) 5. Bil` o, V., Fanelli, A., Flammini, M., Moscardelli, L.: Graphical Congestion Games. Algorithmica (to appear) 6. Bil` o, V., Fanelli, A., Flammini, M., Moscardelli, L.: When ignorance helps: Graphical multicast cost sharing games. Theoretical Computer Science 411(3), 660–671 (2010) 7. Caragiannis, I., Flammini, M., Kaklamanis, C., Kanellopoulos, P., Moscardelli, L.: Tight Bounds for Selfish and Greedy Load Balancing. In: Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4051, pp. 311–322. Springer, Heidelberg (2006) 8. Christodoulou, G., Chung, C., Ligett, K., Pyrga, E., van Stee, R.: On the price of stability for undirected network design. In: Bampis, E., Jansen, K. (eds.) WAOA 2009. LNCS, vol. 5893, pp. 86–97. Springer, Heidelberg (2010) 9. Christodoulou, G., Koutsoupias, E.: The Price of Anarchy of Finite Congestion Games. In: Proceedings of the 37th Annual ACM Symposium on Theory of Computing (STOC), pp. 67–73. ACM Press, New York (2005) 10. Christodoulou, G., Koutsoupias, E.: On the Price of Anarchy and Stability of Correlated Equilibria of Linear Congestion Games. In: Brodal, G.S., Leonardi, S. (eds.) ESA 2005. LNCS, vol. 3669, pp. 59–70. Springer, Heidelberg (2005) 11. Fiat, A., Kaplan, H., Levy, M., Olonetsky, S., Shabo, R.: On the price of stability for designing undirected networks with fair cost allocations. In: Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4051, pp. 608–618. Springer, Heidelberg (2006) 12. Fotakis, D., Gkatzelis, V., Kaporis, A.C., Spirakis, P.G.: The Impact of Social Ignorance on Weighted Congestion Games. In: Leonardi, S. (ed.) WINE 2009. LNCS, vol. 5929, pp. 316–327. Springer, Heidelberg (2009) 13. Fotakis, D., Kontogiannis, S., Spirakis, P.G.: Atomic Congestion Games among Coalitions. In: Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4051, pp. 572–583. Springer, Heidelberg (2006)
Social Context Congestion Games
293
14. Gairing, M., Monien, B., Tiemann, K.: Selfish Routing with Incomplete Information. Theory of Computing Systems 42, 91130 (2008) 15. Hayrapetyan, A., Tardos, E., Wexler, T.: The Effect of Collusion in Congestion Games. In: Proceedings of the 38th ACM Symposium on Theory of Computing (STOC), pp. 89–98. ACM Press, New York (2006) 16. Karakostas, G., Kim, T., Viglas, A., Xia, H.: Selfish Routing with Oblivious Users. In: Prencipe, G., Zaks, S. (eds.) SIROCCO 2007. LNCS, vol. 4474, pp. 318–327. Springer, Heidelberg (2007) 17. Kearns, M.J., Littman, M.L., Singh, S.P.: Graphical Models for Game Theory. In: Proceedings of the 17th Conference in Uncertainty in Artificial Intelligence (UAI), pp. 253–260. Morgan Kaufmann, San Francisco (2001) 18. Kleinberg, J.: The small-world phenomenon: an algorithm perspective. In: Proceedings of the 32nd ACM Symposium on Theory of Computing (STOC), pp. 163–170. ACM Press, New York (2000) 19. Kleinberg, J.: Small-world phenomena and the dynamics of information. In: Proceedings of the 14th Advances in Neural Information Processing Systems (NIPS), pp. 431–438. MIT Press, Cambridge (2001) 20. Kleinberg, J.: The Small-World Phenomenon and Decentralized Search. SIAM News 37, 3 (2004) 21. Koutsoupias, E., Panagopoulou, P., Spirakis, P.G.: Selfish Load Balancing Under Partial Knowledge. In: Kuˇcera, L., Kuˇcera, A. (eds.) MFCS 2007. LNCS, vol. 4708, pp. 609–620. Springer, Heidelberg (2007) 22. Koutsoupias, E., Papadimitriou, C.: Worst-case equilibria. In: Covaci, S. (ed.) IWAN 1999. LNCS, vol. 1653, pp. 404–413. Springer, Heidelberg (1999) 23. Li, J.: An O(log n/ log log n) upper bound on the price of stability for undirected Shapley network design games. Information Processing Letters 109(15), 876–878 (2009) 24. Monderer, D., Shapley, L.S.: Potential games. Games and Economic Behaviour 14, 124–143 (1996) 25. Nisan, N., Roughgarden, T., Tardos, E., Vazirani, V.V.: Algorithmic Game Theory. Cambridge University Press, Cambridge (2007) 26. Rosenthal, R.W.: A Class of Games Possessing Pure-Strategy Nash Equilibria. International Journal of Game Theory 2, 65–67 (1973) 27. Roughgarden, T., Tardos, E.: How Bad Is Selfish Routing? Journal of the ACM 49(2), 236–259 (2002) 28. Shapley, L.S.: The value of n-person games. In: Contributions to the theory of games, pp. 31–40. Princeton University Press, Princeton (1953) 29. Suri, S., Tth, C.D., Zhou, Y.: Selfish Load Balancing and Atomic Congestion Games. Algorithmica 47(1), 79–96 (2007)
Network Synchronization and Localization Based on Stolen Signals Christian Schindelhauer1 , Zvi Lotker2 , and Johannes Wendeberg1 1
Department of Computer Science, University of Freiburg, Germany {schindel,wendeber}@informatik.uni-freiburg.de 2 Department of Communication Systems Engineering, Ben-Gurion University of the Negev, Israel
[email protected]
Abstract. We consider an anchor-free, relative localization and synchronization problem where a set of n receiver nodes and m wireless signal sources are independently, uniformly, and randomly distributed in a disk in the plane. The signals can be distinguished and their capture times can be measured. At the beginning neither the positions of the signal sources and receivers are known nor the sending moments of the signals. Now each receiver captures each signal after its constant speed journey over the unknown distance between signal source and receiver position. Given these nm capture times the task is to compute the relative distances between all synchronized receivers. In a more generalized setting the receiver nodes have no synchronized clocks and need to be synchronized from the capture times of the stolen signals. For unsynchronized receivers we can compute in time O(nm) an approximation ofthe positions and the clock offset within an absolute error log m of O with probability 1 − m−c − e−c n (for any c ∈ O(1) and m some c > 0). For synchronized receivers we can compute in time O(nm) an approximation the of correct relative positions within an absolute error margin 2 of O logm2m with probability 1 − m−c − e−c n . This error bound holds also for unsynchronized receivers if we consider a normal distribution of the sound signals, or if the sound signals are randomly distributed in a surrounding larger disk. If the receiver nodes are connected via an ad hoc network we present a distributed algorithm which needs at most O(nm log n) messages in total to compute the approximate positions and clock offsets for the log m network within an absolute error of O with probability 1−n−c m if m > n.
1
Introduction
Localization and synchronization are fundamental and well researched problems. In this paper we take a fresh look at this problem. Basic principles in localization are synchronized clocks and anchor points – points with known positions. A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 294–305, 2011. c Springer-Verlag Berlin Heidelberg 2011
Network Synchronization and Localization
295
Some localization methods like DECCA, LORAN and cellular localization have a fixed and known set of anchor points. In other methods, like GPS, the anchor points are moving, but communicate their position to the receivers. In some methods, like WLAN based communication, the position of the anchor points, i.e. the WLAN base stations, needs to be learned. In this paper we do not use anchors at all. For localization one can use the direction, the runtime or the strength (received signal strength indicator – RSSI) of signals. Runtime based schemes may know the time of arrival (TOA), where the time while the signal travels is known, or the time difference of arrival (TDOA) where the time difference of the signal arriving at two receivers is used. In this paper we use the time difference of arrival of abundantly available, distinguishable signal sources of unknown location and timing, called “stolen” signals, which can be received at a set of receivers. Assuming that the senders and receivers are on the plane the task is to find the locations of all receivers. Furthermore, we consider the case where the receivers are unsynchronized and try to synchronize their clocks from these stolen signals. As an application we envisage wireless sensor networks in a noisy area utilizing otherwise interfering signals, e.g. a sensor network with microphones within a swamp with quaking frogs or laptop computers which receive encrypted signals from other WLAN clients and base stations of unknown locations. Then, position information can be used for geometric routing. In this work we will steal the received sound or radio signals to synchronize the clocks of our network and to compute the locations of our network nodes. For this, we assume that a subset of the senders of the stolen signals are randomly distributed around the receivers. For simplicity we assume a uniform distribution in a disk of same or larger size. The localization and synchronization approach is briefly introduced in [1]. After collecting all the time information from all receivers we want to compute the time offsets and positions of all nodes without knowing where or when the stolen signals are produced. We only assume that we can distinguish stolen signals and they reach all nodes of our network. We are also interested in a distributed algorithm for an ad hoc network minimizing the number of messages. Problem Setting Given n synchronized receiver nodes r1 , . . . , rn ∈ R2 and m signals s1 , . . . , sm ∈ R2 that are produced at unknown time points ts1 , . . . , tsm . The signals travel with fixed speed, which we normalize to 1, and are received at time tri ,sj for signal sj and receiver ri . Given tri ,sj as the only nm inputs we have the following nm equations: tri ,sj − tsj = ri − sj where (tsj )j∈[m] , (sj )j∈[m] are unknown and (ri )i∈[n] need to be computed. Since no locations are based at the beginning translation, rotation and mirroring symmetries occur. This can be easily resolved by choosing one receiver as the
296
C. Schindelhauer, Z. Lotker, and J. Wendeberg
origin (0, 0), assuming a second receiver lying on the x-axis and a third receiver having a positive y coordinate. Further complications are possible measurement inaccuracies for the time. The given problem is a non-linear non-convex optimization problem for which no efficient solution for the general case has been known so far. Non-linear nonconvex optimization is known to be NP-hard. However, for this specific problem no computational complexity results are known.
2
Related Work
Localization of wireless sensor networks is a broad and intense research topic, where one can distinguish range-based and range-free approaches. Range-based approaches include techniques based on RSSI [2][3] or time of arrival (TOA, “time of flight”) [4][5] to acquire distance information between nodes. The DILOC algorithm uses barycentric coordinates [6]. In many cases a first rough estimation is refined in iterative steps [7][8][9]. Usually, range-based systems require expensive measurement equipment in terms of power consumption and money. We use the term of time of arrival to denote a range measurement by sending a signal to a transponder and measuring the time of the signal flight. In contrast, the term time differences of arrival (TDOA) describes the reception of an unknown signal without any given range information. In some contributions a set of receivers is used to locate one or more beacons by evaluation of the TDOA [10][11]. Maybe closest to our problem setting is the iterative solution of Biswas and Thrun [12]. They also implement a distributed approach [13]. A very elegant solution for a fixed number of 10 microphones in three-dimensional space is shown by Pollefeys and Nister [14]. Range-free systems do not require the expensive augmentations that rangebased systems do. In the centralized approach [15] the connectivity matrix between nodes is evaluated and a set of distance constraints is generated, which leads to a convex optimization problem. A general disadvantage of centralized algorithms is the lack of scalability and communication overhead. Distributed algorithms avoid this issue [16][17]. A common representation for the communication ranges of nodes in range-free approaches are unit disk graphs (UDG) [18]. In [19] we present a technique for robust distance estimation between microphones by evaluating the timing information of sharp sound signals. We assume synchronized receivers and that signals originate from a far distance, but we have no further information about their location. We consider this a rangebased approach because we estimate distances between receivers using the time differences of signals between nodes. A question that occurs in many wireless sensor network schemes is synchronization. Many synchronization algorithms rely on the exchange of synchronization messages between nodes in the network, assuming that the message delay is symmetric. Another method uses an external radio signal from a base station
Network Synchronization and Localization
297
(e.g DCF77) or a satellite system (e.g. GPS) carrying the current time information. In some approaches a network is assumed to be synchronized in roundbased algorithms [20]. An overview of techniques and synchronization issues is given in [21]. Our TDOA-based distance estimation approach [19] implements a synchronization protocol based on the Network Time Protocol algorithm. Most of the referred algorithms perform effectively in a very specific environment and on safe ground conditions. There are attempts to survey the numerous approaches and to compare them quantitatively [22] and qualitatively [23]. Or the Cram´er-Rao bound is calculated to determine the lower variance bounds of a position estimator [24][25][26]. Few is actually known about the general solvability of localization problems in wireless sensor networks. St´ewenius examines the required minimum of microphones and signal sources for convergence towards unique solutions [27]. Eren et al. inspect the uniqueness of ranged networks by analyzing the graph rigidity [28].
3
Estimating Distances
The localization problem that we face is vastly overconstrained for large n and m. While we have n + m unknown receiver and sender locations, m unknown signal time points and n unknown clock offsets between the receivers, we face nm equations on the other side. So, the clue for an efficient solution of the problem is to concentrate on the most helpful information. For this we consider only two receivers. As we have pointed out in [19] it is possible to estimate the distance between two receiver nodes if the signals are uniformly distributed on a circle around the receivers at a large distance. Here, we show that this method also results in a reasonable estimation if the signals are distributed in the same disk where the receivers lie. Max-Min-Technique Given two vertices i, j (1 ≤ i < j ≤ n) and the relative time differences of the stolen signals: tri ,sk − trj ,sk for all stolen signals s1 , . . . , sm , we compute the estimated distance di,j between i and j as – di,j := max and as k {|tri ,sk − trj ,sk |} if the receivers are synchronized – di,j := 12 maxk {tri ,sk − trj ,sk } − mink {tri ,sk − trj ,sk } if the receivers are not synchronized. The estimated relative time offset will be computed using the time signal k ∗ := arg maxk {tri ,sk − trj ,sk }. Then, tri ,sk∗ − trj ,sk∗ − di,j yields the approximation of the correction for the clocks at i and j. Clearly, this estimation is only an approximation. But a surprisingly good one. First, note that in both cases the estimation is always upper-bounded by the real distance: ri − rj ≥ di,j . We now describe a sufficient condition for the accuracy of the estimator. For this we define the -critical area. Definition 1. The -critical area of two nodes (u, v) is the set of points p in the plane where u − v − (p − v − p − u) ≤ .
298
C. Schindelhauer, Z. Lotker, and J. Wendeberg
Fig. 1. The 0.2-critical areas of two nodes at (−1, 0) and (1, 0) are on the left and right side of the hyperbolas
This convex area is bounded by a hyperbola containing the point u, see Fig. 1. If in this critical area signals are produced, then the distance estimation is accurate up to an absolute error of . Lemma 1. If in both of the -critical areas of (u, v) and (v, u) signals are produced, then the Max-Min distance estimation du,v is in the interval du,v ∈ [u − v − 2, u − v]. The time offset between the clocks of u and v can be computed up to an absolute error margin of 2. If at least in one of the -critical areas of (u, v) and (v, u) a signal is produced, then for synchronized receivers the Max-Min distance estimation du,v is in the interval du,v ∈ [u − v − , u − v]. These signals can be found in time O(m). Proof. The proof of the accuracy of the distance estimators follows from the definition of the critical areas. For the accuracy of the time offset consider that one clock u is assumed to be correct, then the other node’s clock offset is chosen such that the signal arrives later at time du,v if the signal was detected at the -critical area of u. The best signals can be found by computing the minimum or maximum of the differences of the time points at the receivers u and v. Lemma 2. For two receivers u, v with := u − v the intersection of the critical area (v, u) of a disk with center 12 (u + v) and radius r has – at least an area of min{π2 , 12 2 } if r = and – at least an area of min{πr2 , (r − )2 /} if r > . Since the critical areas are rather large there is a good chance that a signal could be found in one of these areas. Theorem 1. For m stolen signals the Max-Min distance estimator for two receiver nodes u, v with distance := u − v within the disk with center (0, 0) and radius 1 outputs a result du,v with du,v ∈ [u − v − , u − v] with probability 1 − p, where for and p we have:
Network Synchronization and Localization
299
1. If u and v are unsynchronized and them signal sources are uniformly dis log m tributed in the unit disk we have = O and p = m1c for any c > 1. m 2. If u and v are unsynchronized and the m signal sources are independently 2 normal distributed with mean (0, 0) and variance 1 we have = O logm2m and p = m1c for any c > 1. 3. If u and v are unsynchronized, u and v are not close to the unit disk boundary, i.e. |u| < 1−k and |v| < 1−k for some constant k > 0, andthe m signal sources are uniformly distributed in the unit disk we have = O
log2 m m2
and
1
p = mck2 for any c > 1. 4. If u and v are synchronized, u or v are not close to the unit disk boundary, i.e. |u| < 1 − k or |v| < 1 − k for some constant k > 0, and the m signal sources are uniformly distributed in the unit disk we have = O and p =
1 mck2
log2 m m2
for any c > 1.
Using this information we do not need to consider the signals at all, again. From now on, we will only use the distance estimation information and compute the locations of the receiver nodes. Now the goal is to avoid any further loss of precision when we compute coordinates out of the distance estimates.
4
Centralized Localization and Synchronization
Now we discuss how the distance estimation can be converted into cartesian coordinates without increasing the inaccuracy by more than a constant factor. The usual approaches to reconstruction of node positions from distances are iterative force-directed algorithms [29] or non-linear optimization schemes to minimize a function ⎛ ⎞ n n min ⎝ ri − rj 2 − d2i,j ⎠ ri ,rj
i=1 j=i+1
where di,j denotes the distances yielded by the Max-Min approximation technique. Examples are the gradient descent method, Newton’s method [30] or the Levenberg-Marquardt algorithm. The common problem of all these methods is their lack of reliability. They cannot guarantee successful convergence to the correct network topology and they are prone to local minima of the error function. In such cases the induced error is disproportionately higher than one would expect from changes in parameters. We require an algorithm with constant propagation of error where the induced uncertainty can be bounded below a function of the input error . For this we have to consider the rigidity and precision. – Rigidity: If the number of receivers is small or the accuracy is high, then different topologies are valid solutions to the problem. This problem is known as the rigidity problem [28]. We will prove that our distance estimations are so precise that this problem can occur only with a very small probability.
300
C. Schindelhauer, Z. Lotker, and J. Wendeberg
– Precision: In some situations small measurement errors of the distance result in much larger changes of the coordinates. Sometimes, there seems to be no valid solution. We will prove that for any triangle (with non-collinear points), the problems can be solved if the distance estimation error is small enough. The coordinates will suffer from a higher estimation error. This increase can be bounded by a constant factor if the triangles are not too extreme. Furthermore, the probability that such receivers exist grows exponentially with the number of receivers. Assuming that all distance estimations are precise up to an additive error of at most 0 we will present algorithms which produce an output with an additive error of at most = O(0 ) with probability 1 − e−cn for n receiver nodes and a constant c > 0. In this section we assume that a central node has complete knowledge of the nm capture times of all nodes. In fact our algorithms use only the n2 distance estimations du,v for all receiver nodes u, v. Our basic method for localization is bilateration with a symmetry breaker. Given two anchor points u, v where u = (0, 0) and v = (du,v , 0) and the estimated distances du,p , dv,p ≥ 0 we want to compute the location of a point p such that u − p = r1 and v − p = r2 . We know that the given distances are only an approximation of the real distances which could be longer by an additive term of 0 . Of course, there are two symmetric solutions for p. So, we also assume a third anchor point w with given coordinates, called symmetry breaker, which is used for deciding which solution is valid. At the beginning we assume that d, r1 , r2 are the correct values of the triangle distances and compute the coordinates of p by p1,2 = (du,p cos αu , ±du,p sin αu ) ,
where
cos αu =
d2u,p − d2v,p + d2u,v . 2du,p du,v
However, this method fails if du,p , dv,p , du,v do not fulfill the triangle inequality. Then, we are not able to find the locations. For deciding between p1 and p2 we use the symmetry breaker w. If | w − p1 − dw,p| ≤ | w − p2 − dw,p| we choose p1 , and p2 otherwise. Using only bilateration it is not possible to locate all points in the plane. But if we have three anchor points we have three possibilities to apply bilateration. The third point is used as a symmetry breaker. Actually every triangle can be used for the localization as long as the points are not collinear. Theorem 2. For every set of non-collinear points u, v, w and for every disk D of radius r containing u, v, w there exists an 0 > 0 such that each point in D can be located with an absolute error of ≤ cu,v,w,r · , if ≤ 0 . Here, is the precision of the distance measurements and cu,v,w,r is a constant which depends solely on u, v, w and the disk radius r. So, the distance information provides enough rigidity if the number of signals is large enough, since the larger the number of signals the smaller the starting error 0 .
Network Synchronization and Localization
301
The factor cu,v,w,r describes the loss of quality of the localization depending on u, v, w and r. 1. cu,v,w,r increases with growing disk radius r. 2. cu,v,w,r decreases with growing minimum edge length. 3. If a triangle angle of u, v, w approaches 0 or π, then cu,v,w,r also increases. So, best results can be achieved if the edge lengths are large and if they are the same. Since we are only interested in asymptotic results we use the following corollary. Corollary 1. Fix some 0 < δ1 < π/6, δ1 < δ2 < π and 0 < r0 ≤ r. Then there is some 0 > 0 and a constant c such that all triangles, where all inner angles are in the interval [δ1 , δ2 ] and all edge lengths are at least r0 , can be used for localization of all points in the disk of radius r within an accuracy of c · . This localization is based on distances which are only known with some absolute precision of < 0 . In the case of unsynchronized receivers we experience an accuracy of = log m O with high probability. It remains to find the best base triangle based m on the distance estimations. This can be done by computing all n2 distances within time O(n2 m) and testing all n3 = O(n3 ) triangles. Since we look for any triangle obeying the properties of inner angles and some reasonable minimum edge length r0 , one can use a faster approach. Algorithm 1. Finding a base triangle 1: Start with an arbitrary node s 2: Find the node u maximizing ds,u 3: Find the node v maximizing du,v 4: Find the node w maximizing min{du,w , dv,w } 5: Use u, v, w as a base triangle for trilateration of all other points
Note that each step of this algorithm can be solved by estimating O(n) distances. Each distance estimation needs time O(m). So the overall running time is O(nm). Using this algorithm a centralized algorithm can solve the localization in nearly all cases for sufficiently large m and n. Theorem 3. For n receivers and a subset of m signals produced uniformly distributed in a disk the nodes can be synchronized and localized in time O(m) with log m an accuracy of = O in running time O(m + n) with probability m 1−
1 mc
− e−nc for any c and some c > 0.
1. If the m signals are produced independently with a Gaussian normal distribution with mean (0, 0) and variance 1 or
302
C. Schindelhauer, Z. Lotker, and J. Wendeberg
2. if the m signals are independently and uniformly produced in a disk with radius r > 1 and center (0, 0) then the receiver nodes can be be and localized in time O(m + n) synchronized log2 m with a maximum error of = O m2 with probability 1 − m1c − e−nc for any c and some c > 0.
The proof follows by combining the distance estimation with the triangulation results. The exponential bound for the receivers follows from the observation that there is a constant probability for three receiver nodes to satisfy the triangle property. Adding three more receiver nodes independently results in the multiplicative decrease of this failing probability, thus leading to an exponential probability function with respect to n. Of course these bounds also hold for synchronized receivers. We now concentrate on the case where signals and receivers are produced in the same disk, since the accuracy can be increased considerably for this case. The key point is to find a second base triangle where all receiver nodes have a constant distance to the boundary of the disk. Then, the distance estimations to all other points 2 are accurate to an error of O( logm2m ). Algorithm 2. Finding an inner base triangle 1: Find a base triangle u0 , v0 , w0 2: Compute the coordinates of all receiver nodes with low precision 3: Based on this information find a base triangle u, v, w with a minimum distance of 1 to the border of the disk 8
The distance 18 is an arbitrary non-zero choice. Decreasing this distance will increase the distance estimation error but will increase the probability of finding such triangles. Theorem 4. For n synchronized receivers and a subset of m signals produced uniformly distributed in a disk the nodes can be localized in time O(m) with an accuracy of = O 1−
1 mc
log2 m m2
in running time O(m + n) with probability
− e−nc for any c and some c > 0.
The proof is analogous to the one above. Our centralized Algorithm 1 can be extended for distributed localization, as for example in a wireless sensor network. In such an ad hoc network each node broadcasts its capture times, which costs O(nm) messages for each receiver node with a total communication complexity of O(n2 m). The upper bound for the message broadcast in the distributed network is described by the following theorem. Theorem 5. For n receiver nodes and m > n signals a distributed algorithm requires O(nm log n) messages and computes the coordinates and the clock offset
Network Synchronization and Localization
of all receiver nodes within an error of = O
log m m
303
with probability 1 − n−c
for any constant c, if the receiver and signal nodes are independently, randomly, and uniformly distributed in the same disk.
5
Outlook
While our focus is the localization and synchronization of the receiver nodes, it is straight-forward to determine the time and position of the signals using the receivers as anchor points. Synchronization based on stolen signals can provide a helpful feature for wireless sensor networks or ad hoc networks. While the speed of light could be too fast for an accurate localization, it is always a good source for synchronizing clocks. Our approach solves the problem that distant nodes might suffer from the delay of the synchronization signal since we compensate with other stolen signals. A remarkable property of this localization problem is the decrease of complexity with increasing problem size. If the number of receivers and stolen signals increases, the precision of the approximation improves, while the algorithm’s running time remains linear. In case the number of signals is too large, a set of node can agree to consider only a random subset of signals. While the accuracy decreases, the number of messages and the computational effort can be reduced to fit the wireless network’s capabilites. On the other side, the problem is very complex when few signals and receivers are known. We have observed this for approximation methods based on iterative improvement of local solutions like force-directed algorithms and gradient-based search in previous work. For four receivers, which is the minimum number of receivers in the plane to solve this problem, all considered methods can run into local minima. In the successful cases they converge slower to the solution than in large scenarios. If one also reduces the number of signals to the absolute minimum of six signals in the plane (where we conjecture that the solution is unique for non-degenerated input) it appears to be the hardest problem setting. It is an open problem how to solve this localization problem for four receivers and six signals in the plane.
Acknowledgment This work has partly been supported by the German Research Foundation (Deutsche Forschungsgemeinschaft, DFG) within the Research Training Group 1103 (Embedded Microsystems).
References 1. Schindelhauer, C., Lotker, Z., Wendeberg, J.: Brief Announcement: Network Synchronization and Localization Based on Stolen Signals. In: Proceedings of the 30th Annual ACM Symposium on Principles of Distributed Computing, PODC (2011)
304
C. Schindelhauer, Z. Lotker, and J. Wendeberg
2. Sichitiu, M.L., Ramadurai, V.: Localization of Wireless Sensor Networks with a Mobile Beacon. In: Proceedings of the First IEEE Conference on Mobile Ad-hoc and Sensor Systems, pp. 174–183 (2004) 3. Ferris, B., H¨ ahnel, D., Fox, D.: Gaussian Processes for Signal Strength-Based Location Estimation. In: Proceedings of Robotics: Science and Systems Conference, RSS (2006) 4. Priyantha, N.B., Chakraborty, A., Balakrishnan, H.: The Cricket Location-Support System. In: MobiCom 2000: Proceedings of the 6th annual international conference on Mobile computing and networking, pp. 32–43 (2000) 5. Savvides, A., Han, C.C., Strivastava, M.B.: Dynamic Fine-Grained Localization in Ad-Hoc Networks of Sensors. In: Proceedings of the 7th annual international conference on Mobile Computing and Networking, pp. 166–179. ACM, New York (2001) 6. Khan, U.A., Kar, S., Moura, J.M.F.: Distributed Sensor Localization in Random Environments using Minimal Number of Anchor Nodes. IEEE Transactions on Signal Processing 57(5), 2000–2016 (2009) 7. Biswas, P., Ye, Y.: Semidefinite Programming for Ad Hoc Wireless Sensor Network Localization. In: IPSN 2004: Proceedings of the 3rd international symposium on Information processing in sensor networks, pp. 46–54. ACM, New York (2004) 8. Savarese, C., Rabaey, J., Langendoen, K.: Robust Positioning Algorithms for Distributed Ad-Hoc Wireless Sensor Networks. In: USENIX Technical Annual Conference, Monterey, CA, vol. 2 (2002) 9. Savvides, A., Park, H., Srivastava, M.B.: The Bits and Flops of the N-hop Multilateration Primitive For Node Localization Problems. In: Proceedings of the 1st ACM International Workshop on Wireless Sensor Networks and Applications, p. 121. ACM, New York (2002) 10. Torrieri, D.J.: Statistical Theory of Passive Location Systems. IEEE Transactions on Aerospace and Electronic Systems AES-20(2), 183–198 (1984) 11. Gillette, M.D., Silverman, H.F.: A Linear Closed-Form Algorithm for Source Localization From Time-Differences of Arrival. IEEE Signal Processing Letters 15, 1–4 (2008) 12. Biswas, R., Thrun, S.: A Passive Approach to Sensor Network Localization. In: Proceedings of the 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2004), vol. 2, pp. 1544–1549 (2004) 13. Biswas, R., Thrun, S.: A Distributed Approach to Passive Localization for Sensor Networks. In: Proceedings of the National Conference on Artificial Intelligence, vol. 20, p. 1248. AAAI Press, MIT Press (1999) 14. Pollefeys, M., Nister, D.: Direct computation of sound and microphone locations from time-difference-of-arrival data. In: IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 2445–2448. IEEE, Los Alamitos (2008) 15. Doherty, L., El Ghaoui, L.: Convex Position Estimation in Wireless Sensor Networks. In: INFOCOM 2001. Proceedings of the Twentieth Annual Joint Conference of the IEEE Computer and Communications Societies, vol. 3, pp. 1655–1663. IEEE, Los Alamitos (2002) 16. Simic, S.N., Sastry, S.: Distributed Localization in Wireless Ad Hoc Networks. UC Berkeley ERL report (2001) 17. Lotker, Z., de Albeniz, M.M., P´er´ennes, S.: Range-Free Ranking in Sensors Networks and Its Applications to Localization. In: Nikolaidis, I., Barbeau, M., An, H.-C. (eds.) ADHOC-NOW 2004. LNCS, vol. 3158, pp. 158–171. Springer, Heidelberg (2004)
Network Synchronization and Localization
305
18. Kr¨ oller, A., Fekete, S., Pfisterer, D., Fischer, S.: Deterministic boundary recognition and topology extraction for large sensor networks. In: Proceedings of the seventeenth annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1000–1009. ACM, New York (2006) 19. Janson, T., Schindelhauer, C., Wendeberg, J.: Self-Localization Application for iPhone using only Ambient Sound Signals. In: Proceedings of the 2010 International Conference on Indoor Positioning and Indoor Navigation (IPIN), pp. 259– 268 (November 2010) 20. Anta, A.F., Mosteiro, M.A., Thraves, C.: Deterministic Recurrent Communication and Synchronization in Restricted Sensor Networks. INRIA RR 486277 (2010) 21. Sundararaman, B., Buy, U., Kshemkalyani, A.D.: Clock Synchronization for Wireless Sensor Networks: A Survey. Ad Hoc Networks 3(3), 281–323 (2005) 22. Langendoen, K., Reijers, N.: Distributed localization in wireless sensor networks: a quantitative comparison. Computer Networks 43(4), 499–518 (2003) 23. Stupp, G., Sidi, M.: The expected uncertainty of range-free localization protocols in sensor networks. Theoretical Computer Science 344(1), 86–99 (2005) 24. Savvides, A., Garber, W.L., Moses, R.L., Srivastava, M.B.: An Analysis of Error Inducing Parameters in Multihop Sensor Node Localization. IEEE Transactions on Mobile Computing, 567–577 (2005) 25. Dulman, S., Havinga, P., Baggio, A., Langendoen, K.: Revisiting the Cramer-Rao Bound for Localization Algorithms. In: 4th IEEE/ACM DCOSS Work-in-progress paper (2008) 26. Moses, R.L., Krishnamurthy, D., Patterson, R.M.: A Self-Localization Method for Wireless Sensor Networks. EURASIP Journal on Advances in Signal Processing, 348–358 (2003) 27. Stew´enius, H.: Gr¨ obner Basis Methods for Minimal Problems in Computer Vision. PhD thesis, Lund University (April 2005) 28. Eren, T., Goldenberg, D.K., Whiteley, W., Yang, Y.R., Morse, A.S., Anderson, B.D.O., Belhumeur, P.N.: Rigidity, Computation, and Randomization in Network Localization. In: INFOCOM 2004. Twenty-Third Annual Joint Conference of the IEEE Computer and Communications Societies, vol. 4, pp. 2673–2684. IEEE, Los Alamitos (2004) 29. Efrat, A., Forrester, D., Iyer, A., Kobourov, S.G., Erten, C., Kilic, O.: ForceDirected Approaches to Sensor Localization. ACM Transactions on Sensor Networks (TOSN) 7(3), 1–25 (2010) 30. Calafiore, G.C., Carlone, L., Wei, M.: A Distributed Gauss-Newton Approach for Range-based Localization of Multi Agent Formations. In: 2010 IEEE International Symposium on Computer-Aided Control System Design (CACSD), pp. 1152–1157. IEEE, Los Alamitos (2010)
Optimal Time Data Gathering in Wireless Networks with Omni–Directional Antennas Jean-Claude Bermond1, , Luisa Gargano2, Stephane Per´ennes1, Adele A. Rescigno2 , and Ugo Vaccaro2 1
MASCOTTE, joint project CNRS-INRIA-UNSA, F-06902 Sophia-Antipolis, France 2 Dipartimento di Informatica, Universit` a di Salerno, 84084 Fisciano (SA), Italy Abstract. We study algorithmic and complexity issues originating from the problem of data gathering in wireless networks. We give an algorithm to construct minimum makespan transmission schedules for data gathering when the communication graph G is a tree network, the interference range is any integer m ≥ 2, and no buffering is allowed at intermediate nodes. In the interesting case in which all nodes in the network have to deliver an arbitrary non-zero number of packets, we provide a closed formula for the makespan of the optimal gathering schedule. Additionally, we consider the problem of determining the computational complexity of data gathering in general graphs and show that the problem is NP– complete. On the positive side, we design a simple (1 + 2/m) factor approximation algorithm for general networks.
1
Introduction
Technological advances in very large scale integration, wireless networking, and in the manufacturing of low cost, low power digital signal processors, combined with the practical need for real time data collection have resulted in an impressive growth of research activities in Wireless Sensor Networks (WSN). Usually, a WSN consists of a large number of small-sized and low-powered sensors deployed over a geographical area, and of a base station where data sensed by the sensors are collected and accessed by the end user. Typically, all nodes in a WSN are equipped with sensing and data processing capabilities; the nodes communicate with each other by means of a wireless multi-hop networks. A basic task in a WSN is the systematic gathering at the base station of the sensed data, generally for successive further processing. Due to the current technological limits of WSN, this task must be performed under quite strict constraints. Sensor nodes have low-power radio transceivers and operate with non– replenishable batteries. Data transmitted by a sensor reach only the nodes within the transmission range of the sender. Nodes far from the base station must use intermediate nodes to relay data transmissions. Data collisions, that happen when two or more sensors send data to a common neighbor at the same time, may disrupt the data aggregation process at the base station. An other important factor to take into account when performing data gathering is the
Funded by ANR AGAPE, ANR GRATEL and APRF PACA FEDER RAISOM.
A. Kosowski and M. Yamashita (Eds.): SIROCCO 2011, LNCS 6796, pp. 306–317, 2011. c Springer-Verlag Berlin Heidelberg 2011
Optimal Time Data Gathering in Wireless Networks
307
latency of the information accumulation process. Indeed, the data collected by a node of the network can frequently change, thus it is essential that they are received by the base station as soon as it is possible without being delayed by collisions [18]. The same problem was asked by France Telecom (see [6]) on how to bring internet to places where there is no high speed wired access. Typically, several houses in a village want to access a gateway connected to internet (for example via a satellite antenna). To send or receive data from this gateway, they necessarily need a multiple hop relay routing. All these issues raise unique challenging problems towards the design of efficient algorithms for data gathering in wireless networks. It is the purpose of this paper to address some of them and propose effective methods for their solutions. 1.1
The Model
We adopt the network model considered in [1,2,9,10,14]. The network is represented by a node–weighted graph G = (V, E), where V is the set of nodes and E is the set of edges. More specifically, each node in V represents a device that can transmit and receive data. There is a special node s ∈ V called the Base Station (BS), which is the final destination of all data possessed by the various nodes of the network. Each v ∈ V − {s} has an integer weight w(v) ≥ 0, that represents the number of data packets it has to transmit to s. Each node is equipped with an half–duplex transmission interface, that is, the node cannot transmit and receive at the same time. There is an edge between two nodes u and v if they can communicate. So G = (V, E) represents the graph of possible communications. Some authors consider that two nodes can communicate only if their distance in the Euclidean space is less than some value. Here we consider general graphs in order to take into account physical or social constraints, like walls, hills, impediments, etc.. In that context paths and trees represent the cases where the communications are done with antennas only in few directions or urban situations with possible communications only along streets. Furthermore, many transmission protocols use a tree of shortest paths for routing. Time is slotted so that one–hop transmission of a packet (one data item) consumes one time slot; the network is assumed to be synchronous. These hypotheses are strong ones and suppose a centralized view. The values of the completion time we obtain will give lower bounds for the corresponding real life values. Said otherwise, if we fix a value on the completion time, our results will give an upper bound on the number of possible users in the network. Following [10,12,18], we assume that no buffering is done at intermediate nodes and each node forwards a packet as soon as it receives it. One of the rationales behind this assumption is that it might be too much energy consuming to hold data in the node memory; moreover, it also free intermediate nodes from the need to maintain costly state information. Finally we use a binary model of interference based on the distance in the communication graph. Let d(u, v) denote the distance (that is, the length of a shortest path) between u and v in G. We suppose that when a node u transmits, all nodes v such that d(u, v) ≤ m are subject to the interference of u’s
308
J.-C. Bermond et al.
transmission and cannot receive any packet from their neighbors. This model is a simplified version of the reality, where a node is under the interference of all the other nodes and where models based on SNR (Signal-to-Noise Ratio) are used. However our model is more accurate compared to the classical binary model (m = 1), where a node cannot receive a packet only in the case one of its neighbor transmits. We suppose all nodes have the same interference range m; in fact m is only an upper bound on the possible range of interferences since due to obstacles the range can be sometimes lower (however, see also [17] for a critique of this model). Under above model, simultaneous transmissions among pair of nodes are successful whenever transmission and interference constraints are respected. Namely, a transmission from node v to w is called collision–free if, for all simultaneous transmissions from any node x, it holds: d(v, w) = 1 and d(x, w) ≥ m + 1. The gathering process is called collision–free if each scheduled transmission is collision–free. The collision–free data gathering problem can be stated as follows. Data Gathering. Given a graph G = (V, E), a weight function w : V → N , and a base station s, for each node v ∈ V −{s} schedule the multi-hop transmission of the w(v) data items sensed at node v to base station s so that the whole process is collision–free and the makespan, i.e., the time when the last data item is received by s, is minimized. Actually, we will describe the gathering schedule by illustrating the schedule for the equivalent personalized broadcast problem, since this last formulation allows us to use a simpler notation. Personalized broadcast: Given a graph G, a weight function w : V → N , and a BS s, for each node v = s schedule the multi-hop transmission from s to v of the w(v) data items destined to v so that the whole process is collision– free and the makespan, i.e., the time when the last data item is received at the corresponding destination node, is minimized. We notice that any collision–free schedule for the personalized broadcasting problem is equivalent to a collision–free schedule for data gathering. Indeed, let T be the last time slot used by a collision–free personalized broadcasting schedule; any transmission from a node v to its neighbor w occurring at time slot k in the broadcasting schedule corresponds to a transmission from w to v scheduled at time slot T + 1 − k in the gathering schedule. Moreover, if two transmissions in the broadcasting schedule, say from node v to w and from v to w , do not collide then d(v , w), d(v, w ) ≥ m + 1; this implies that, in the gathering schedule, the corresponding transmissions from w to v and from w to w do not collide either. Hence, if one has an (optimal) broadcasting schedule from s, then one can get an (optimal) solution for gathering at s. Let S be a personalized broadcasting schedule for the graph G and BS s. We denote by TS the makespan of S, i.e., the last time slot in which a packet is sent along any edge of the graph. Moreover, we denote by TS (x) the time slot in which BS s transmits the last of the w(x) packets destined to node x during the execution of the schedule S. Clearly, the makespan of S is
Optimal Time Data Gathering in Wireless Networks
TS = max {dS (s, x) + TS (x) | x ∈ V, w(x) > 0} ,
309
(1)
where dS (s, x) is the number of hops used in S for a packet to reach x. The makespan of an optimal schedule1 is T ∗ (G, s) = minS TS , where the minimum is taken over all collision-free personalized broadcasting schedules for the graph G and BS s. When s is clear from the context, we simply write T ∗ (G) to denote the optimal makespan value. 1.2
Our Results and Related Work
Our first result is presented in Section 2, where we give an algorithm to determine an optimal transmission schedule for data gathering (personalized broadcasting) in case the communication graph G is a tree network and the interference range is any integer m ≥ 2. Our algorithm works for general weight functions w on the set of nodes V of G. In the interesting case in which the weight function w assume non-zero values on V we are also able to determine a closed formula for the makespan of the optimal gathering schedule. The papers most closely related to our results are [2,10,12]. Paper [10] firstly introduced the data gathering problem in a model for sensor networks very similar to the one adopted in this paper. The main difference with our work is that [10] mainly deals with the case where nodes are equipped with directional antennas, that is, only the designated neighbor of a transmitting node receives the signal while its other neighbors can simultaneously and safely receive from different nodes. Under this assumption, [10] gives optimal gathering schedules for trees. Again under the same hypothesis, an optimal algorithm for general networks has been presented in [12] in the case each node has one packet of sensed data to deliver. Paper [2] gives optimal gathering algorithms for tree networks in the same model considered in the present paper, but the authors consider only the particular case of interference range m = 1. It is worthwhile to notice that, although our results hold for general interference range m ≥ 2, our algorithms (and analysis thereof) are much cleaner and simpler than those for m = 1. In view of our results, it really appears that the case of interference range m = 1 has a peculiar behavior, justifying the quite detailed case analysis of [2]. Other related results appear in [1,4,5,7], where fast gathering with omnidirectional antennas is considered under the assumption of possibly different transmission and interference ranges. That is, when a node transmits all the nodes within a fixed distance dT in the graph can receive, while nodes within distance dI (dI ≥ dT ) cannot listen to other transmissions due to interference (in our paper dI = m and dT = 1). However, unlike the present paper, all of the above works explicitly allow data buffering at intermediate nodes. In Section 4, we consider the problem of assessing the hardness of data gathering in general graphs and show that the problem is NP–complete. In Section 3 we give a simple (1 + 2/m) factor approximation algorithm for general networks. 1
Note that, by the equivalence between data gathering and personalized broadcasting, in the following we will use T ∗ (G) to denote interchangeably the makespan of the data gathering and the personalized broadcasting.
310
J.-C. Bermond et al.
Due to space limits, most of the proofs are omitted. The full version of the paper is available on ArXiv.
2
Scheduling in Trees
In this section we describe scheduling algorithms when the network topology is a tree T = (V, E). We first give a polynomial time algorithm for obtaining optimal personalized broadcast schedules in case of strictly positive node weights. Subsequently, in the general case when some nodes can have zero weight, we derive an O(δW 3δ ) algorithm for obtaining an optimal schedule, where W is the sum of the weights of the nodes in the network (number of data packets transmitted) and δ is the BS degree. Let T1 , T2 , · · · , Tδ be the subtrees of T rooted at the children of the BS s. In order to describe the scheduling, we use the following nomenclature. – At time t: During the t-th time slot (one time slot corresponding to a one hop transmission of one packet). – Transmit to node v at time t: a packet to v is sent along a path (s = x0 , x1 , · · · , x = v) from s to v in T starting at time t, that is, the packet is transmitted with a call from xj to xj+1 at step t + j, for j = 0, · · · , − 1. – Node v is completed (at time t): s has already transmitted all the w(v) packets to v (within some time t < t). – Transmit to Ti at time t: a packet is transmitted at time t to a node v in Ti , where v is chosen as the node having maximum level among all nodes in Ti which are not completed at time t. – Ti is completed: each node v in Ti is completed. Fact 1. Let s transmit to a node u ∈ V (Ti ) at time t and to node v ∈ V (Tj ) at time t > t. The calls done during the transmission from s to u and the calls of the transmission from s to v do not interfere if and only if t ≥ t + Δ(u, v), where the inter–call interval Δ(u, v) is defined as min{d(s, u), m} if i = j, Δ(u, v) = (2) min{d(s, u), m + 2} if i = j. 2.1
Trees with Non–zero Node Weights
In this section we show how to obtain an optimal transmission schedule of the packets to the nodes in a tree T when w(v) ≥ 1, for each node v in T . For each subtree Ti of T , for i = 1, . . . , δ, we denote by – si the root of Ti ; – |Ai | = v∈Ai w(v): the total weight of the nodes in Ai = {v ∈ V (Ti ) | d(s, v) ≤ m}, that is, of the nodes in Ti that are at level at most m in T ; – |Bi | = v∈Bi w(v): the total weight of all the nodes in Bi = {v ∈ V (Ti ) | d(s, v) = m + 1},that is, of the nodes in Ti that are at level m + 1 in T ; – |Ci | = v∈Ci w(v): the total weight of all the nodes in Ci = {v ∈ V (Ti ) | d(s, v) ≥ m + 2}, that is, of the nodes in Ti that are at level m + 2 or more in T ; – |Ti |: the total weight of nodes in Ti , that is, |Ti | = |Ai | + |Bi | + |Ci |.
Optimal Time Data Gathering in Wireless Networks
311
Definition 1. Given i, j = 1, . . . , δ with i = j, we say that
Ti Tj if
⎧ |Bi | + |Ci | ≥ |Bj | + |Cj | ⎪ ⎪ ⎨
|Ai | − w(si ) ≥ |Aj | − w(sj )
⎪ ⎪ ⎩
w(si ) ≥ w(sj )
whenever |Bi | + |Ci | > 0, whenever |Bi | + |Ci | = |Bj | + |Cj | = 0, |Ai | > w(si ) whenever |Ti | = w(si ) and |Tj | = w(sj )
Theorem 1. Let the interference range be m ≥ 2. Let T be a tree with node weight w(v) ≥ 1, for each v ∈ V . Consider T as rooted at the BS s and (w.l.o.g.) let its subtrees be indexed so that T1 T2 . . . Tδ . There exists a polynomial time scheduling algorithm S for T such that δ w(u)d(s, u) + m (|Bi | + |Ci |) + M, (3) TS = T ∗ (T ) = u∈V d(s,u)≤m
i=1
where M = max{0, (|B1 | + |C1 |) −
δ i=2
|Ti |, (|B1 | + 2|C1 |) +
δ
w(si ) − 2
i=2
δ
|Ti |} (4)
i=2
Proof (Sketch). The proof consists in showing that the value in the statement of Theorem 1 is a lower bound on the makespan of any schedule. Subsequently, we prove that the scheduling algorithm given in Figure 1 is collision-free and its makespan matches the lower bound. We notice that in the special case δ = 1, Theorem 1 reduces to Corollary 1. [10] Let L be a line with nodes {0, 1, . . . , n}, BS at node 0, and let w() ≥ 1 be the weight of node , for = 1, . . . , n. Then T ∗ (L) = m+1 =1 · w() + (m + 2) ≥m+2 w(). Example 1. We stress that each of the values of M in (4) is attained by some tree. Figure 2 shows an example for each case assuming the interference range be m = 3. The vertices of the trees are labeled with their weights and the subtrees are ordered from left to right according to Definition 1. a) Consider the tree T in Fig.2 a). T has subtrees T1 , T2 , T3 with |B1 | = 3, |C1 | = 1, |T2 | + |T3 | = 12 and w(s2 ) + w(s3 ) = 2. Therefore, |B1 | + |C1 | − (|T2 | + |T3 |) = −8 < 0 and |B1 | + 2|C1 | + (w(s2 ) + w(s3 )) − 2(|T2 | + |T3 |) = −17 < 0. Hence, M = 0 in this case. b) Consider the tree T in Fig.2 b). T has subtrees T1 , T2 , T3 with |B1 | = 7, |C1 | = 3, |T2 | + |T3 | = 9 and w(s2 ) + w(s3 ) = 2. Therefore, |B1 | + |C1 | − (|T2 | + |T3 |) = 1 > 0 and |B1 | + 2|C1 | + (w(s2 ) + w(s3 )) − 2(|T2 | + |T3 |) = −3 < 0. Hence, M = |B1 | + |C1 | − δi=2 |Ti | in this case. c) Consider the tree T in Fig.2 c). T has subtrees T1 , T2 , T3 , T4 with |B1 | = 2, |C1 | = 12, |T2 | + |T3 | + |T4 | = 13 and w(s2 ) + w(s3 ) + w(s4 ) = 5. Therefore, |B1 |+|C1 |−(|T2 |+|T3 |+|T4 |) = 1 > 0 and |B1 |+2|C1 |+(w(s2 )+w(s3 )+w(s4 ))− δ δ 2(|T2 | + |T3 | + |T4 |) = 5 > 1. Hence, M = |B1 | + 2|C1 | + i=2 w(si ) − 2 i=2 |Ti |.
312
J.-C. Bermond et al.
TREE-scheduling (T, s) [T has non empty subtrees T1 , . . . , Tδ and root s] Phase 1: Set τ = 1; previous = 0; i = 0 Set ak = |Ak |, bk = |Bk |, ck = |Ck |, and nk = |Tk |, for k = 1, . . . , δ Set D = {1, . . . , δ} [D represents the set of indices of subtrees with nk > 0] Phase 2: while |D| ≥ 2 i =i+1 Execute the following Iteration Step i Set α[i] = F alse Let k ∈ D − {previous} be s.t. Tk Tj , for each j ∈ D − {previous} [cfr. Def. 1] Transmit to Tk at time τ nk = nk − 1 (2.1) if bk + ck > 0 then if ck > 0 then α[i] = T rue and ck = ck − 1 else bk = bk − 1 previous = k τ = τ +m (2.2) if bk + ck = 0 then ak = ak − 1 if ak = 0 then D = D − {k} Let u in Tk be the destination of the last transmission by s τ = τ + d(s, u) (2.3) [If the previous transmission was to a node at distance at least m + 2 and the actual transmission is to a son of s, we choose an uncompleted son of s different from sprevious , if any ] if α[i − 1] = T rue and d(s, u) = 1 then if |D| ≥ 2 then Transmit to Th at time τ, for some h ∈ D − {previous} ah = ah − 1 if ah = 0 then D = D − {h} τ =τ +1 previous = 0 Phase 3: Let D = {k} [here |D| = 1] while nk > 0 Transmit to Tk at time τ, nk = nk − 1 τ = τ + min{d(s, u), m + 2}, where u is the destination node in Tk .
Fig. 1. The scheduling algorithm on trees s 2
1 3
1 2 2 1
s
1
1
1
2
1
1
1
1
1
1
7 1
2
s
1
1
3
1
1
2
1
2
1 1
1
1
2
1
1
1
1
1
1
1
1
2
10
2 1
a)
b)
Fig. 2. The trees of Example 1
c)
2
Optimal Time Data Gathering in Wireless Networks
2.2
313
Trees with General Weight Distribution
In this section we present an algorithm for the general case in which only some of the nodes needs to receive packets from the BS s. Let T = (V, E) be the tree representing the network, and let s be the root of T . Denote by δ the degree of s, and by T1 , T2 , · · · , Tδ the subtrees of T rooted at the children of s. We present an algorithm which gives an optimal schedule in time O(δW 3δ ), where W is the number of items to be transmitted (i.e, the sum of the weights). However, for sake of simplicity, in the following we limit our analysis to the case w(v) ∈ {0, 1}, for each v ∈ V − {s}. Lemma 1. For each u, v ∈ V , if either of the following conditions hold a) 2 ≤ d(s, u) < d(s, v) ≤ m b) d(s, u) > d(s, v) ≥ m + 2 and u, v ∈ V (Ti ), for some 1 ≤ i ≤ δ, then there exists an optimal schedule where s transmits to u before than to v. Based on Lemma 1, we consider the lists Ci , Bi , Ai , for i = 1, . . . , δ, where: Ci = (xi,1 , xi,2 , · · · ) consists of all the nodes in Ti with w(xi,j ) > 0 and d(s, xi,j ) ≥ m + 2; nodes are ordered so that d(s, xi,j ) ≤ d(s, xi,j+1 ) for each j ≥ 1; Bi = (zi,1 , zi,2 , · · · ) consists of all the nodes in Ti with w(zi,j ) > 0 and d(s, zi,j ) = m + 1; in any order; Ai = (yi,1 , yi,2 , · · · ) consists of all the nodes in Ti with w(yi,j ) > 0 and 2 ≤ d(s, yi,j ) ≤ m; nodes are ordered so that d(s, yi,j ) ≥ d(s, yi,j+1 ) for j ≥ 1. Given integers ci ≤ |Ci |, bi ≤ |Bi |, ai ≤ |Ai |, ri ∈ {0, 1}, for i = 1, . . . δ, let S(c1 , . . . , cδ , b1 , . . . , bδ , a1 , . . . , aδ , r1 , . . . , rδ ), denote an optimal schedule satisfying Lemma 1 when the only packets to be transmitted are destined to the first ci nodes of Ci , bi nodes of Bi , ai nodes of Ai , respectively, and, if ri = 1, to the root si of Ti , for i = 1, . . . , δ. In the following we will use the compact vectorial notation c = (c1 , · · · , cδ ),
b = (b1 , · · · , bδ )
a = (a1 , · · · , aδ )
r = (r1 , · · · , rδ ).
Therefore, we write S(c, b, a, r) for S(c1 , · · · , cδ , b1 , · · · , bδ , a1 , · · · , aδ , r1 , · · · , rδ ). Moreover, let S(c, b, a, r, (j, t)) be an optimal schedule satisfying above condition and the additional restriction that the first transmission in the schedule is to a node in Tj where t ∈ {r, C, B, A} specifies whether this node is either the root of Tj , or a node in Cj (by Lemma 1, node xj,cj ), or a node in Bj , or in Aj (by Lemma 1, node yj,aj ). The makespan of the schedule S(c, b, a, r) (resp. S(c, b, a, r, (j, t))) will be denoted by T (c, b, a, r) (resp. T (c, b, a, r, (j, t))). Clearly, T (c, b, a, r) = min
min
1≤j≤δ t∈{r,C,B,A}
T (c, b, a, r, (j, t)).
Denote by ei the identity vector ei = (ei,1 , · · · , ei,δ ) with ei,j = The following result is an immediate consequence of Fact 1.
(5) 1 0
if j = i, otherwise.
314
J.-C. Bermond et al.
Fact 2. For any j = 1, · · · , δ, it holds – if t = r, then T (c, b, a, r, (j, r)) = 1 + T (c, b, a, r − ej ) – if t = A, then T (c, b, a, r, (j, A)) = d(s, yj,aj ) + T (c, b, a − ej , r). – if t = B, i.e., the first transmission is for zj,bj , ∈ Bj , then T (c, b,⎧a, r, (j, B)) = ⎪ m + T (c, b − ej , a, r, (k, t )) ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ min m + 1 + T (c, b − ej , a, r, (k, t )) k, t ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩d(s, z )
if j = k and d(s, zj,bj ) ≤ T (c, b − ej , a, r, (k, t )) + m if j = k and d(s, zj,bj ) ≤ T (c, b − ej , a, r, (k, t )) + m + 1 otherwise j,bj – if t = C, i.e., the first transmission is for xj,cj , ∈ Cj , then T (c, b, a, r, (j, C)) = ⎧ ⎪ if j = k and ⎪ ⎪m + T (c − ej , b, a, r, (k, t )) ⎪ ⎪ ⎪ d(s, xj,cj ) ≤ T (c − ej , b, a, r, (k, t )) + m ⎨ min m + 2 + T (c − ej , b, a, r, (k, t )) if j = k and k, t ⎪ ⎪ ⎪ d(s, xj,cj ) ≤ T (c − ej , b, a, r, (k, t )) + m + 2 ⎪ ⎪ ⎪ ⎩d(s, x ) otherwise j,cj
An optimal schedule for T is S(T ) = S(cT , bT , aT , rT ), where (cT , bT , aT , rT ) includes all the packets in T . In order to obtain the optimal solution we compute the various partial solutions for (c, b, a, r, (j, t)); starting from T (0, 0, 0, 0, (j, t)) = 0, for each j and t, where 0 = (0, . . . , 0) is the null vector. We know that ck +bk +ak ≤ v∈V w(v) = W and rk ∈ {0, 1}, for k = 1, · · · , δ; moreover, the pair (j, t) can assume at most 4δ values. Therefore, since w(v) ∈ {0, 1} for each v ∈ V , we get W ≤ |V | and the number of different values we need to compute is O(δ|V |3δ ). For general weights, each node v needs to appear in the proper list (among Ai , Bi , and Ci , for i = 1, . . . , δ) with multiplicity equal to w(v). Hence, our result assumes the following form. Theorem 2. It is possible to obtain an optimal schedule in time O(δW 3δ ).
3
General Topologies
We present an algorithm for Personalized Broadcasting in general graphs and 2 prove that it achieves an approximation ratio of 1+ m , where m is the interference range. We then show that if one requires that the personalized broadcasting has to be done using a routing tree, then the problem is NP–complete. We stress that this practical requirement is widely adopted, indeed it avoids that intermediate nodes have to forward data in a way that depends on source and destination information. The same scenario for m = 1 is considered in [9]. 3.1
The Approximation Algorithm
Consider an arbitrary topology graph G = (V, E) with BS s and node weight w(v) ≥ 0, v ∈ V − {s}. Let SP be a set of shortest paths from s to each node in V − {s}. We route transmissions along the paths in SP .
Optimal Time Data Gathering in Wireless Networks
315
Graph-SPschedule(G, SP, s) Set t = 1; h = maxu∈V d(s, u) Set w = v∈V,d(s,v)= w(v), for = 1, . . . , h while w > 0 Let L = max{|w > 0} Establish an (arbitrary) ordering on the wL packets to be transmitted to nodes at distance L from s For j = 1 to wL s transmits at time t the j–th data packet in the above ordering t = t + min{L, m + 2} wL = 0 Fig. 3. The general graphs scheduling algorithm
Lemma 2. The makespan of the schedule produced by Graph-SPschedule (G, SP, s) is max
w(v)d(s, v) + (m + 2)
v∈V d(s,v)≤m+1
v∈V d(s,v)≥m+2
w(v),
max
≥m+2
− m − 2+
(m + 2)
w(v)
.
v∈V d(s,v)≥
The analysis of the algorithm would be very simple if we had to deal only with trees (indeed schedules with optimal makespan for trees are given in Sections 2). However, even if we restrict ourselves to packets transmission on a (shortest path) tree, we still need to deal with possible collisions due to the edges in E − E(SP ). In order to see that our algorithm does not suffer from interferences, let us first notice that if (u, v) ∈ E then |d(s, u) − d(s, v)| ≤ 1. Moreover, if s transmits to u at time t and to v at time t > t then the Graph-SPschedule algorithm imposes that t = t + min{d(s, u), m + 2}. By this, as in Fact 1, we get that no collision occurs during the execution of Graph-SPschedule. Theorem 3. Let G = (V, E) be a graph with BS s ∈ V and w(u) ≥ 0, for each u ∈ V − {s}, and let the interference range be m. The makespan T of the schedule produced by Graph-SPschedule(G, SP, s) satisfies T T
∗ (G)
≤1+
2 , m
where T ∗ (G) is the makespan of an optimal scheduling for G.
4
Complexity Results
We now show that the Data Gathering Problem is NP-complete if the process must be performed along the edges of a routing tree.
316
J.-C. Bermond et al.
Our proof assumes m ≥ 2. The case m = 1 is claimed to be NP-complete in [9]; however the proof is incorrect. Firstly, it uses invalid results concerning trees. Indeed the authors claim that in the case m = 1, a tree with n vertices and weight 1 in each node has makespan equal to 3n − 2. As a counterexample, consider the tree formed by δ paths of length 2 sharing the node s, so with n = 2δ + 1 nodes. The makespan in this case is 2δ = n − 1 (see [2] for exact values for trees). As a matter of fact, the value in [9] is true only for paths with BS at one end. Additionally, one can easily see that the reduction employed in [9] is, in general, not computable in polynomial time. To prove our NP-completeness result, let us consider the decision version of the equivalent Minimum Time Personalized Broadcasting. MTPB (Minimum Time Personalized Broadcasting) Instance: A graph G = (V, E), an interference range m, a special node s ∈ V , integer weights w(v) ≥ 0 for v ∈ V − {s}, and an integer bound K. Question: Is there a routing tree in G and a multi-hop schedule on it of the w(v) packets from s to node v, for each v ∈ V , so that the process is collision–free and the makespan is T ≤ K? We show now that MTPB is NP-complete. It is clearly in NP. We prove its NP-hardness by a reduction from the well known Partition Problem [13]. PARTITION Instance: n + 1 integers a1 , a2 , · · · , an , B such that ni=1 ai = 2B. Question: Is there a subset S ⊂ {1, 2, · · · , n} such that i∈S ai = B? Given a PARTITION instance, we construct a MTPB instance as follows: – The graph is G = (V, E) with node set
V = s} ∪ {u0j , vj0 | 1 ≤ j ≤ m + n + 1 ∪ uij , vji | 1 ≤ i ≤ n, 0 ≤ j ≤ m
∪ xi | 1 ≤ i ≤ n , edge set 0 E = {(s, u01 ), (s, v10 )} ∪ {(u0j , u0j+1 ), (vj0 , vj+1 ) | 1 ≤ j ≤ m + n} 0 , v01 )} ∪ {(u0m+n+1 , u10 ), (vm+n+1 i ∪ {(uij , uij+1 ), (vji , vj+1 ) | 1 ≤ i ≤ n, 0 ≤ j ≤ m − 1} i+1 i ∪ {(ui1 , ui+1 0 ), (v1 , v0 ) | 1 ≤ i ≤ n − 1} i , xi ) | 1 ≤ i ≤ n}; ∪ {(uim , xi ), (vm
and node weights w(u0j ) = w(vj0 ) = 0, for w(u0j ) = w(vj0 ) = 1, for w(uij ) = w(vji ) = 0, for w(xi ) = ai , for
j = 1 . . . , m + 1, j = m + 2 . . . , m + n + 1, i = 1 . . . , n and j = 0 . . . , m, i = 1 . . . , n.
– The interference parameter is a fixed integer m ≥ 2; – The bound is K = 2m(B + n) + 2.
Optimal Time Data Gathering in Wireless Networks
317
We notice that the graph G can be constructed in polynomial-time. Moreover, it can be shown that the PARTITION instance admits an answer “Yes” if and only if there exists a schedule for the MTPB instance such that the makespan is T ≤ K. Hence we get Theorem 4. The MTPB problem is NP-complete.
References 1. Bermond, J.-C., Galtier, J., Klasing, R., Morales, N., P´erennes, S.: Hardness and approximation of gathering in static radio networks. PPL 16(2), 165–183 (2006) 2. Bermond, J.-C., Gargano, L., Rescigno, A.: Gathering with Minimum Delay in Sensor Networks. In: Shvartsman, A.A., Felber, P. (eds.) SIROCCO 2008. LNCS, vol. 5058, pp. 262–276. Springer, Heidelberg (2008) 3. Bermond, J.-C., Correa, R., Yu, M.-L.: Optimal Gathering Protocols on Paths under Interference Constraints. Discrete Mathematics 309(18), 5574–5587 (2009) 4. Bermond, J.-C., Peters, J.: Efficient gathering in radio grids with interference. In: Proc. AlgoTel 2005, Presqu’ˆıle de Giens, pp. 103–106 (2005) 5. Bermond, J.-C., Yu, M.-L.: Optimal gathering algorithms in multi-hop radio tree networks with interferences. Ad Hoc and S.W.N. 9(1-2), 109–128 (2010) 6. Bertin, P., Bresse, J.-F., Le Sage, B.: Acc`es haut d´ebit en zone rurale: une solution “ad hoc”. France Telecom R&D 22, 16–18 (2005) 7. Bonifaci, V., Korteweg, P., Marchetti-Spaccamela, A., Stougie, L.: An Approximation Algorithm for the Wireless Gathering Problem. Op. Res. Lett. 36(5), 605–608 (2008) 8. Bonifaci, V., Klasing, R., Korteweg, P., Marchetti-Spaccamela, A., Stougie, L.: Data Gathering in Wireless Networks. Graphs and Algorithms in Communication Networks. In: Koster, A., Munoz, X. (eds.) Springer Monograph, pp. 357–377. Springer, Heidelberg (2010) 9. Choi, H., Wang, J., Hughes, E.A.: Scheduling for information gathering on sensor network. Wireless Network 15, 127–140 (2009) 10. Florens, C., Franceschetti, M., McEliece, R.J.: Lower Bounds on Data Collection Time in Sensory Networks. IEEE J. on SAC 22(6), 1110–1120 (2004) 11. Gargano, L.: Time Optimal Gathering in Sensor Networks. In: Prencipe, G., Zaks, S. (eds.) SIROCCO 2007. LNCS, vol. 4474, pp. 7–10. Springer, Heidelberg (2007) 12. Gargano, L., Rescigno, A.A.: Optimally Fast Data Gathering in Sensor Networks. Discrete Applied Mathematics 157, 1858–1872 (2009) 13. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman, New York (1979) 14. Gasieniec, L., Potapov, I.: Gossiping with Unit Messages in Known Radio Networks. IFIP TCS, pp. 193–205 (2002) 15. Pelc, A.: Broadcasting in radio networks. In: Stojmenovic, I. (ed.) Handbook of Wireless Networks and Mobile Computing, pp. 509–528. John Wiley and Sons, Inc, Chichester (2002) 16. Revah, Y., Segal, M.: Improved bounds for data-gathering time in sensor networks. Computer Communications 31(17), 4026–4034 (2008) 17. Schmid, S., Wattenhofer, R.: Algorithmic models for sensor networks. IPDPS (2006) 18. Zhu, X., Tang, B., Gupta, H.: Delay efficient data gathering in sensor networks. In: Jia, X., Wu, J., He, Y. (eds.) MSN 2005. LNCS, vol. 3794, pp. 380–389. Springer, Heidelberg (2005)
Author Index
Anantharamu, Lakshmi
89
Balamohan, Balasingham 198 Bampas, Evangelos 270 Bermond, Jean–Claude 306 Bil` o, Davide 270 Bil` o, Vittorio 282 Brandes, Philipp 138 Brejov´ a, Bronislava 222 Bui, Alain 54 Celi, Alessandro 282 Chalopin, J´er´emie 186 Charron-Bost, Bernadette Chlebus, Bogdan S. 89 Clavi`ere, Simon 54 Cooper, Colin 1, 210
Kowalski, Dariusz R. 89 Kr´ aloviˇc, Rastislav 222 Labourel, Arnaud 186 Lamani, Anissa 150 Larmore, Lawrence L. 54 Liang, Guanfeng 258 Lotker, Zvi 294 Markou, Euripides 186 Meyer auf der Heide, Friedhelm Miri, Ali 198 Moser, Heinrich 42
101, 113
D’Angelo, Gianlorenzo 174 Das, Shantanu 186 Datta, Ajoy K. 54 Degener, Bastian 138 Di Stefano, Gabriele 174 Dobrev, Stefan 222 Drovandi, Guido 270
Navarra, Alfredo Nowak, Thomas
174 234
Ooshita, Fukuhito
150
Pelc, Andrzej 162 Peleg, David 15 Per´ennes, Stephane 306 Peters, Joseph 29 Proietti, Guido 270
Flammini, Michele 282 Flocchini, Paola 198 Frieze, Alan 210 F¨ ugger, Matthias 101, 113, 234
Radzik, Tomasz 210 Rajsbaum, Sergio 17, 66 Raynal, Michel 17, 66 Rescigno, Adele A. 306 Rokicki, Mariusz A. 89
Gallotti, Vasco 282 Gargano, Luisa 306 Godard, Emmanuel 29 Gual` a, Luciano 270 Guilbault, Samuel 162
Santoro, Nicola 198 Schindelhauer, Christian 294 Schmid, Ulrich 42 Schneider, Johannes 246 Sohier, Devan 54
Hsieh, Sun-Yuan
Tixeuil, S´ebastien
Imbs, Damien
78 66
Kamei, Sayaka 150 Kao, Chi-Ya 78 Katreniak, Branislav 125 Kempkes, Barbara 138 Klasing, Ralf 270 K¨ oßler, Alexander 234
Vaccaro, Ugo Vaidya, Nitin Vinaˇr, Tom´ aˇs
150
306 258 222
Wattenhofer, Roger 246 Welch, Jennifer L. 101, 113 Wendeberg, Johannes 294 Widder, Josef 101, 113
138