The Firing Squad Problem Revisited

In the classical firing squad problem, an unknown number of nodes represented by identical finite state machines is arranged on a line and in each time unit each node may change its state according to its neighbors’ states. Initially all nodes are passive, except one specific node located at an end of the line, which issues a fire command. This command needs to be propagated to all other nodes, so that eventually all nodes simultaneously enter some designated “firing" state. A natural extension of the firing squad problem, introduced in this paper, allows each node to postpone its participation in the squad for an arbitrary time, possibly forever, and firing is allowed only after all nodes decided to participate. This variant is highly relevant in the context of decentralized distributed computing, where processes have to coordinate for initiating various tasks simultaneously. The main goal of this paper is to study the above variant of the firing squad problem under the assumptions that the nodes are infinite state machines, and that the inter-node communication links can be changed arbitrarily in each time unit, i.e., are defined by a dynamic graph. In this setting, we study the following fundamental question: what connectivity requirements enable a solution to the firing squad problem? Our main result is an exact characterization of the dynamic graphs for which the firing squad problem can be solved. When restricted to static directed graphs, this characterization implies that the problem can be solved if and only if the graph is strongly connected. We also discuss how information on the number of nodes or on the diameter of the network, and the use of randomization, can improve the solutions to the problem. 2012 ACM Subject Classification Mathematics of computing → Graph algorithms, Theory of computation → Dynamic graph algorithms, Theory of computation → Distributed algorithms


Introduction
Many distributed algorithms assume a synchronous networked system, in which computation is divided into synchronized rounds that are communication closed layers: any message sent at some round can be received only at that round.In this model it is typically assumed that each execution of an algorithm is started by all nodes simultaneously, i.e., at the same round.
In this paper, we justify this assumption of synchronous starts for dynamic networks with no central control that monitors the node activities, but with sufficient connectivity assumptions.Specifically, we study a generalization of the associated synchronization problem, classically referred to as the firing squad problem.This generalization considers

20:2
The Firing Squad Problem Revisited a communication network of unknown size, in which messages are delivered along a set of edges which may change in each round.All nodes are initially passive, and a node becomes active upon receiving a start signal at an unpredictable time.We stress that receiving a message from an active node is not necessarily considered as a start signal.The goal is then to guarantee that the nodes synchronize by firing -i.e., entering a designated state for the first time -simultaneously if and only if all nodes are eventually active.Formally, the following must be satisfied: FS1 (Validity): A node fires if and only if all nodes have received start signals.FS2 (Simultaneity): All the nodes that fire, fire at the same round.
As a basic synchronization abstraction, the fulfillment of FS1 and FS2 above can be used in various types of situations to guarantee simultaneity: for distributed initiation (to force nodes to begin some computation in unison), in real-time processing (where nodes have to carry out some external actions simultaneously), or for distributed termination (to guarantee that nodes complete their computation at the same round).Another typical scenario that requires FS1 and FS2 is when some algorithm needs to be executed several times in a row, and the i + 1-st execution should be started simultaneously, after all nodes terminated the i-th execution (see e.g., [5]).
It is easy to see that when the communication graph is permanently complete, the firing squad problem can be solved in one round after all nodes are active.At the opposite scenario, the problem is clearly unsolvable if some node is permanently isolated.This demonstrates a strong correlation between the solvability and complexity of the firing squad problem, and the connectivity of the network.The primary aim of this paper is to explore this relation.
The firing squad problem was originally studied in the context of automata theory (eg., [18,19]).This model considers a finite but unknown number n of nodes which are connected in a line (or in some other specific topologies in more recent works -see eg., [8]).Nodes are identical finite state machines (whose number of states is independent of n), and at each time unit each node changes its state according to the states of its neighbors on the line.A start signal is given to a node located at one end of the line -the "general" -and then is propagated to the rest of the nodes so that all nodes have eventually to fire simultaneously.It should be noted that the above model assumes diffusive start signals, for which the timing of start signals is not arbitrary: upon the receipt of a message from an active node, a passive node becomes active, i.e., receiving such a message is considered as a start signal.The main challenges in this model are to reduce the number of states of the finite state machine and the time required to reach the firing state.
A natural question raised at this point is then the following: considering that nodes are no longer restricted to be finite state machines, but possess a full computational power (equivalent to that of a Turing machine), what are the connectivity properties that are needed to solve the firing squad problem?
It should be noted that the firing squad problem has also been studied in the context of fault tolerant distributed computations (eg., [3,12,7]), and more recently in the context of self-stabilization (eg., see [10]).This model also assumes that each node has a full computational power, but otherwise the setting of the problem is different: Nodes are connected by a complete graph, and thus the number of nodes n is given.At most f nodes may be faulty, for various types of Byzantine faults.This implies a permanent complete connectivity between the non-faulty nodes, and arbitrary connectivity of all other links.Besides, due to the unpredictable behavior of faulty nodes, the simultaneity condition and to a larger extent the validity condition in this model ought to be drastically weakened: eg., it is only required that all non-faulty nodes eventually fire simultaneously.Finally, the study of the problem is strictly limited to diffusive start signals.

20:3
Contribution.In this paper we consider a set of an unknown number n of nodes possessing full computational power.Nodes have distinct identities which are not mutually known, but otherwise they run identical codes (in some precise sense that is discussed later).The internode communication is modeled by a dynamic graph, i.e., at each round, nodes communicate along directed edges of an arbitrary communication graph which may change continually and unpredictably from one round to the next.Communication is done by having each node broadcast at each round a message along the unknown set of its outgoing edges in this round.We examine various connectivity properties that hold, not necessary round by round, but globally over finite periods of consecutive rounds.In particular, these properties do not imply any stability of the links, as opposed to the failure model of at most f faulty nodes that guarantees a stable clique of size n − f , or several models of dynamic networks in distributed computing (eg., see [16,1,22]) that assume the existence of a stable spanning tree in the network over every T consecutive rounds.
The main contribution of this paper is a characterization of the connectivity properties that enable to solve the firing squad problem in dynamic (and hence also in static) graphs.On the positive side, we show that if the dynamic graph is guaranteed to be connected within each period of T consecutive rounds, where the constant T is given, then the problem is solvable in time which is at most linear in the (unknown) network size.On the negative side, we show that under the sole assumption that such a constant T exists but is unknown, the problem becomes unsolvable.Moreover, the problem remains unsolvable in this case even when the number of nodes in the network is given and even in the restricted model of diffusive start signals.The above results imply that the firing squad problem is solved for a static directed graph if and only if it is strongly connected.
Our solution is obtained by combining two basic procedures: the first implements local virtual clocks whose values cannot exceed the diameter of the dynamic graph unless all nodes are active, and the second collects the identities of all nodes in the network.The idea is then that a node fires when the value of its virtual clock is sufficiently large compared to the number of active nodes it has heard of so far.
We also show that if an upper bound D on the diameter of the dynamic graph is given, then the problem is solvable in time linear in D. This solution is applicable to anonymous networks, where nodes have no identities, and it uses much shorter messages.We conclude by showing that when a polynomial bound on the network size is given, the use of randomization can substantially reduce messages size while preserving a linear time complexity.
For space consideration, some proofs are omitted in this version.

2
The Model

Distributed computations in the dynamic graphs model
We consider a networked system with a fixed set of n nodes.Nodes have unique identifiers, and the set of identifiers is denoted by V .The identities of the nodes are not mutually known, and the network size n is unknown as well.Nodes may also ignore their own identities, in which case the network is said to be anonymous.Furthermore, nodes run identical programs, i.e., programs do not depend on node identities (see the discussion in Section 5).
Computation proceeds in synchronized rounds, which are communication closed in the sense that no node receives messages in round t that are sent in a round different from t.In round t (t = 1, 2 . . .), each node attempts to send messages to all nodes, receives messages from some nodes, and finally goes to its next state and proceeds to round t + 1.The round number t is used for a reference, but is unknown to the nodes.
In every run of an algorithm, each node u is initially passive: it is part of the network, but sends only heartbeats -that we call null messages -and does not change its state.Then it either becomes active by receiving a unique start signal at the beginning of some round s u 1, or remains passive forever -in which case we let s u = +∞.A run is active if all nodes are eventually active.
Upon the receipt of its start signal, node u sets up its local variables (with its initial state) and starts executing its program.For any of its local variables x u , the value of x u at the beginning of round t is denoted by x u (t).Thus x u (t) is undefined for t < s u .
Communications that occur at round t are modeled by a directed graph G(t) = (V, E t ) that may change from round to round.We assume a self-loop at each node in all the graphs G(t) since any node can communicate with itself instantaneously.
The sequence of directed graphs G = (G(t)) t∈N is called a dynamic graph [4].It can be decided ahead of time, by an online adversary, or endogenously as in influence systems [6].Similarly, the way start signals are generated is left totally arbitrary: a node may receive an external start signal coming from outside, or it may receive a start signal relayed by some active node.In particular, there may be more than one external start signal in the network, and start signals may be not correlated to the dynamic graph.
A run of a firing squad algorithm is entirely determined by the dynamic graph G = (G(t)) t∈N and by the list S = (s u ) u∈V of rounds at which nodes become active.We denote by G * (t) = (V, E * t ) the directed graph of edges in E t connecting two nodes which are active in round t.The sets of u's incoming neighbors (in-neighbors for short) in the directed graphs G(t) and G * (t) are denoted by In u (t) and In * u (t), respectively.Let D be a set of dynamic graphs.We say that an algorithm A solves the firing squad problem for D if for each G ∈ D and each scheduling of start signals S, the run of A defined by G and S satisfies FS1 and FS2.The firing squad problem is solvable for D if there is an algorithm that solves it for D.

Paths and broken paths in a dynamic graph
Let us first recall that the product of two directed graphs is the directed graph with the set of nodes V and with an edge (u, v) if there exists w ∈ V such that (u, w) ∈ E 1 and (w, v) ∈ E 2 .
For any dynamic graph G and any integers t > t 1, we let G(t

Delayed connectivity of a dynamic graph
Let us recall that a directed graph is strongly connected if for each pair of nodes u, v there is a directed path from u to v.For c 1, c strong connectivity is then defined by (see, e.g., [9]): Definition 1.Let G = (V, E) be a directed graph and let c < |V | be a positive integer.We say that G is c strongly connected if G remains strongly connected whenever less than c nodes are removed from G.
Note that a directed graph is strongly connected if and only if it is 1 strongly connected.
Next we extend the above definition to bounded-length intervals of dynamic graphs.Definition 3. Let c, T be two positive integers.The dynamic graph G is c connected with delay T if for every positive integer t, the directed graph G(t : t + T − 1) is c strongly connected.When c = 1, we use the abbreviation connected with delay T .
Finally, we present our weakest connectivity assumption for dynamic graphs.

Definition 4.
A dynamic graph G is said to be eventually connected if for any positive integer t, there exists t t such that G(t : t ) is strongly connected.
Using the connectivity properties of dynamic graphs defined above, we then characterize the connectivity properties that enable solutions to the firing squad problem.For a positive integer T , D T denotes the set of dynamic graphs which are connected with delay T .The union D B = ∞ T =1 D T is the set of dynamic graphs with bounded delay connectivity and D E denotes the set of eventually connected dynamic graphs.The relations among the above sets of dynamic graphs are thus given by the strict inclusions In the next sections, we show that the firing squad problem is not solvable for D B (and hence also for D E ), but for each positive integer T , it is solvable for D T .

Bounded Delay Connectivity is not Enough
In this section we show that the firing squad problem is not solvable for the set D B of the dynamic graphs with bounded delay connectivity, even if the network size, n, is given.Specifically, we show that for this set of dynamic graphs, the validity condition FS1 can be achieved if and only if n is given, and the firing squad problem (i.e., FS1 plus FS2) cannot be solved even if n is given.Interestingly, these two impossibility results still hold for the original model of diffusive start signals and when all communication graphs are bidirectional.

Proposition 5. For the set of dynamic graphs with bounded delay connectivity D B , the validity condition FS1 can be achieved if the network size n is given, but cannot be achieved if it is given that the network size is either n or
Next we show that there is no algorithm that solves the firing squad problem for D B , even if the number of nodes in the dynamic graph is given.This demonstrates that adding the simultaneity condition FS2 to the validity condition FS1 makes the problem strictly harder and that the knowledge of the size of the network does not help in the sole context of bounded delay connectivity.

S TA C S 2 0 1 8 20:6
The Firing Squad Problem Revisited Theorem 6.The firing squad problem is not solvable for the set D B of dynamic graphs with bounded delay connectivity, even if the size of the network n is given.
Proof.By contradiction, suppose that there is an algorithm A solving the firing squad problem in any dynamic graph with n nodes and with bounded delay connectivity, and let V be a set of n > 1 nodes.
Let u, v be two distinct nodes in V , and for x ∈ {v, u} let G x be the graph consisting of a complete graph over V \ {x} plus the self loop (x, x).Let further I = (V, E I ) denote the directed graph with only a self-loop at each node, i.e., We consider the run of A in which all nodes are active in the first round, and with the dynamic graph consisting of alternating sequence of directed graphs Clearly, G ∈ D B , and thus by FS1-2, all nodes fire at the same round t F .Now assume that G(t From the viewpoint of u, G is indistinguishable up to round t F from the dynamic graph G 1 that is similar to G except at round t F where G 1 (t F ) = I.Hence u also fires at round t F with the dynamic graph G 1 .Since G 1 ∈ D B , all other nodes also fire at round t F with G 1 .Using a similar argument, we get that from the viewpoint of v, G 1 is indistinguishable up to round t F from the dynamic graph G 2 that is similar to G 1 except at round t F − 1, in which G 2 (t F − 1) = I.Hence with G 2 , all nodes fire at round t F as well.
By repeating this argument t F times, we show that all nodes fire at round t F in the run of A with start signals all received in the first round, and the dynamic graph From the viewpoint of any node v = u, the latter run is indistinguishable up to round t F from the run with the same dynamic graph G t F and where all nodes are active from round one except node u which is passive forever.All nodes other than u fire at round t F , violating FS1 -a contradiction.

Firing with a Bounded Diameter
As a first step towards our main positive result, which solves the firing squad problem in dynamic graphs that are c connected with delay T , we present a solution in the case that a finite bound on the diameter of the dynamic graph is given.We start with some definitions.Let G = (G(t)) t∈N be a dynamic graph.The distance from node v to node w at time t, denoted d t (v, w), is defined as the minimum positive integer δ such that there is a v∼w path in the interval [t, t + δ − 1].If for any t t there is no v∼w path in the interval [t, t ], then conventionally d t (v, w) = +∞.
The diameter of the dynamic graph G is then defined as the minimum positive integer d such that for any positive integer t, the directed graph G(t : t + d − 1) is complete, or infinity if there is no such integer, namely diam(G) = sup t 1, v,w∈V 2 d t (v, w).
Let D be a set of dynamic graphs, and assume that a finite bound D on the diameters of the dynamic graphs in D is given.Then a solution to the firing squad problem is enabled by using local virtual clocks whose values may reach D only if all nodes are active.Moreover, if some virtual clock is set to D, then all virtual clocks are set to D at the same round.The corresponding algorithm, denoted A D , does not use identifiers, and the computation and storage capabilities of the nodes do not grow with the network size.More precisely, its time complexity is in O(D) and it uses only O(log(D)) bits per message.
Notation.In the pseudo-codes of all our algorithms, M * u denotes the multiset of non-null messages received by u in the current round.Observe that the diameter of any connected dynamic graph with n nodes is at most n − 1.Thus one immediate spinoff of Theorem 9 is the following corollary, which when an upper bound N on the network size is given, provides a solution to the firing squad problem that uses messages of size O(log(N )).Corollary 10.If nodes have an upper bound N of the network size, the firing squad problem can be solved in any continuously strongly connected dynamic graph in N rounds after all nodes have become active using only O(log(N )) bits per message.

Firing with T Delayed Connectivity
We now present the algorithm B c,T that show that it solves the firing squad problem in linear time for dynamic graphs that are c connected with delay T while no bound on the diameter or the size of the network is given.The algorithm B c,T uses the same virtual clocks r u as the previous algorithm A D .Moreover, each node u collects the identities of the active nodes which u had heard of in a variable HO u .Then node u fires when its virtual clock r u is large enough compared to the size of its HO u set.A similar idea was first used in [14], and also later in early stopping consensus algorithms [11,13] and in the counting algorithm of [16], but with different virtual clocks.This technique requires distinct node identifiers and long messages since each node u broadcasts HO u in each round.

S TA C S
The following lemma is needed for the analysis of the algorithm B c,T .
Lemma 11.If G = (V, E) is c strongly connected, then for any non-empty subset S ⊆ V , the following holds: where Γ in (S) denotes the set of in-neighbors of S in G, and S = V \ S.
It can be shown that the converse of Lemma 11 also holds.Moreover, the set Γ out (S) of out-neighbors of S can be substituted for Γ in (S) in Lemma 11 since any directed graph G is c strongly connected if and only if its transpose G T is.Using this out-variant of Lemma 11 and an easy induction, we check that the diameter of a dynamic graph that is c connected with delay T is bounded by T 1 + n−2 c .The correctness proof of the algorithm B c,T then relies on the following key technical lemma.

Lemma 12.
In each run of the algorithm B c,T on a dynamic graph G which is c connected with delay T , for each node u and each round t s u , it holds that r u (t) and HO u (t) are Then by induction, we construct a sequence of at most a + 2 sets of nodes S −1 , S 0 , . . ., S k as follows:

FromTheorem 9 .
the two above lemmas, we can prove the correctness of the algorithm A D : The algorithm A D solves the firing squad problem for any set of dynamic graphs with diameters at most D.Moreover, all nodes in an active run of the algorithm fire exactly D rounds after all nodes have become active and use messages of size O(log D).
, and G(t : t ) is the directed graph with only a self-loop at each node when t < t.We also use the notation G(I) instead of G(t : t ) when I is the integer interval [t, t ].We now fix a run of a firing squad algorithm, with the dynamic graph G and the scheduling of start signals S which, as above, determine the dynamic graph G * .The sets of u's in-neighbors in G(t : t ) and in G * (t : t ) are denoted by In u (t : t ) and In * u (t : t ), respectively, or by In u (I) and In * u (I) for short when I = [t, t ].Let t and t be two positive integers such that t t; a v∼u path in the interval [t, t ] is any sequence P

Charron-Bost and S. Moran 20:5
m − 1. Hence there exists a v∼u path in the interval [t, t ] if and only if v ∈ In u (t : t ).The path P is said to be broken if one of its edges (v k , v k+1 ) is not in G * (t + k).B.
Thus M * u at round t is the multiset of messages sent to u by the nodes in In * u (t).If non-null messages are vectors of some size, then M * Algorithm A D , firing with diameter at most D.We begin the correctness proof of the algorithm A D by two useful lemmas about the way the virtual clocks r u 's evolve, whatever the connectivity properties of dynamic graphs are.Assume that t < t and s u t .Then r u (t ) is defined and: 1.If there exists a broken path ending at u in the interval [t, t − 1], then r u (t ) t − t − 1.2.Otherwise, for every v ∈ In u (t : t − 1) it holds that r v (t) is defined and r u (t ) r v (t) + t − t.For every node u and at every round t s max = max v∈V (s v ) of an active run, we have r u (t) t − s max .Moreover, if t s max + 1 and In u (s max