How Many Cooks Spoil the Soup?

In this work, we undertake the study of the following basic question:"How much parallelism does a distributed task permit?"Our definition of parallelism (or symmetry) here is not in terms of speed, but in terms of identical roles that processes have at the same time in the execution. For example, we may ask:"Can a given task be solved by a protocol that always has at least two processes in the same role at the same time?"We choose to initiate this study in population protocols, a very simple model that not only allows for a straightforward definition of what a role is, but also encloses the challenge of isolating the properties that are due to the protocol from those that are due to the adversary scheduler, who controls the interactions between the processes. In particular, we define the role of a process at a given time to be equivalent to the state of the process at that time. Moreover, we isolate the symmetry that is due to the protocol by focusing on those schedules that maximize symmetry for that protocol and observing how much symmetry breaking the protocol is forced to achieve in order to solve the problem. To allow for such symmetry maximizing schedules we consider parallel schedulers that in every step may select a whole collection of pairs of nodes (up to a perfect matching) to interact. Based on these definitions of symmetric computation, we (i) give a partial characterization of the set of predicates on input assignments that can be stably computed with maximum symmetry, i.e. $\Theta(N_{min})$, where $N_{min}$ is the minimum multiplicity of a state in the initial configuration, and (ii) we turn our attention to the remaining predicates (that have some essentially different properties) and prove a strong negative result for the parity predicate: the symmetry of any protocol that stably computes it is upper bounded by a constant that depends on the size of the protocol.


Introduction
George Washington said "My observation on every employment in life is, that, wherever and whenever one person is found adequate to the discharge of a duty by close application thereto, it is worse executed by two persons, and scarcely done at all if three or more are employed therein" [30].The goal of the present paper is to investigate whether the analogue of this observation in distributed systems is true.In particular, we ask whether a task that can be solved when a single process has a crucial duty is still solvable when that (and any other) duty is assigned to more than one process.Moreover, we are interested in quantifying the degree of parallelism (also called symmetry in this paper) that a task is susceptible of.
Leader election is a task of outstanding importance for distributed algorithms.One of the oldest [3] and probably still one of the most commonly used approaches [21,8,5,20,17] for solving a distributed task in a given setting, is to execute a distributed algorithm that manages to elect a unique leader (or coordinator) in that setting and then compose this (either sequentially or in parallel) with a second algorithm that can solve the task by assuming the existence of a unique leader.Actually, it is quite typical, that the tasks of electing a leader and successfully setting up the composition enclose the difficulty of solving many other higher-level tasks in the given setting.
Due to its usefulness in solving other distributed tasks, the leader election problem has been almost extensively studied, in a great variety of distributed settings [21,8,17,16,2].Still, there is an important point that is much less understood.It concerns whether an election step is necessary for a given task and to what extent it can be avoided.Even if a task T can be solved in a given setting by first passing through a configuration with a unique leader, it is still valuable to know whether there is a correct algorithm for T that avoids this.In particular, such an algorithm succeeds without the need to ever have less than k processes in a given "role", and we are also interested in how large k can be made without sacrificing solvability.
Depending on the application, there are several ways of defining what the "role" of a process at a given time in the execution is.In the typical approach of electing a unique leader, a process has the leader role if a leader variable in its local memory is set to true and it does not have it if the leader variable is set to false.In other cases, the role of a process could be defined as its complete local history.In such cases, we would consider that two processes have the same role after t steps iff both have the same local history after each one of them has completed t local steps.It could also be defined in terms of the external interface of a process, for example, by the messages that the process transmits, or it could even correspond to the branch of the program that the process executes.In this paper, as we shall see, we will define the role of a process at a given time in the execution, as the entire content of its local memory.So, in this paper, two processes u and v will be regarded to have the same role at a given time t iff, at that time, the local state of u is equal to the local state of v.
Another important issue has to do with the fact that, no matter which definition we choose, the present role of a given process usually depends not only on the algorithm executed but also on a number of adversarially determined factors.Actually, it is always the result of applying the local program to the initial state and the sequence of received messages, where the initial state can be arbitrarily selected from a set of possible initial states and the messages depend on the network (which may be even dynamic and adversarially controlled in some settings) and possibly also on other factors that are model-specific, e.g.faults.Given that in this work we are interested in characterizing the parallelism that is only due to the protocol, we have to agree on a way of isolating it from all these protocol-external factors.
Understanding the parallelism that a distributed task allows, is of fundamental importance for the following reasons.First of all, usually, the more parallelism a task allows, the more efficiently it can be solved.Moreover, the more symmetry breaking a solution for a given problem has to achieve in order to succeed, the more vulnerable it is to faults.For an extreme example, if a distributed algorithm elects in every execution a unique leader in order to solve a problem, then a single crash failure (of the leader) can be fatal.Finally, understanding the inherent parallelism of distributed tasks, will enable the development of truly distributed algorithms for those tasks that allow much parallelism or to conclude that electing a unique process (or a few such processes) in a given role is necessary for solving the task.

Our Approach
We have chosen to initiate the study of the above problem in a very minimal distributed setting, namely in Population Protocols of Angluin et al. [5] (see Section 1.2 for more details and references).One thing that makes population protocols convenient for the problem under consideration, is that the role of a process at a given step in the execution can be defined in a straightforward way as the state of the process at the beginning of that step.So, for example, if we are interested in an execution of a protocol that stabilizes to the correct answer without ever electing a unique leader, what we actually require is an execution that, up to stability, never goes through a configuration in which a state q is the state of a single node, which implies that, in every configuration of the execution, every state q is either absent or the state of at least two nodes.Then, it is straightforward to generalize this to any symmetry requirement k, by requiring that, in every configuration, every state q is either absent or the state of at least k nodes.
What is not straightforward in this model, is how to isolate the symmetry that is due to the protocol.For if we require the above condition on executions to be satisfied for every execution of a protocol, then most protocols will fail trivially, because of the power of the adversary scheduler.In particular, there is almost always a way for the scheduler to force the protocol to break symmetry in a worst possible way, for example, to make it reach a configuration in which some state is the state of a single node, even when the protocol does not have an inherent mechanism of electing a unique state.Actually, the very first parameter of the model that needs to be adjusted to our purposes is the scheduler itself.Though for computability questions it is sufficient to assume that the scheduler selects in every step a single pair of nodes to interact with each other, this special type of a scheduler is problematic for estimating the symmetry of protocols.The reason is that even fundamentally parallel operations, necessarily pass through a highly-symmetry-breaking step.For example, consider the rule (a, a) → (b, b) and assume that an even number of nodes are initially in state a.The goal is here for the protocol to convert all as to bs.If we were allowed to pick a perfect matching between the as, then in one step all as would be converted to bs, and additionally the protocol would never pass trough a configuration in which a state is the state of fewer than n nodes.Now, observe that the sequential scheduler can only pick a single pair of nodes in each step, so in the very first step it yields a configuration in which state b is the state of only 2 nodes.Of course, there are turnarounds to this, for example by taking into account only equal-interaction configurations, consisting of the states of the processes after all processes have participated in an equal number of interactions, still we shall focus on an alternative way that simplifies the arguments and the analysis.
In particular, we will consider schedulers that can be maximally parallel.Such a scheduler, selects in every step a matching (of any possible size) of the complete interaction graph, so, in one extreme, it is still allowed to select only one interaction but, in the other extreme, it may also select a perfect matching (that is, n/2 interactions, for even n) in a single step.Observe that this scheduler is different both from the sequential scheduler traditionally used in the area of population protocols and from the fully parallel scheduler which assumes that Θ(n) interactions occur in parallel in every step.Actually, several recent papers [10,2,15] assume such a parallel scheduler implicitly by defining the model in terms of the sequential scheduler and then performing their analysis in terms of parallel time, defined as the sequential time divided by n.
Finally, in order to isolate the parallelism that is only due to the protocol, we shall focus on those schedules that maximize symmetry for the given protocol.In particular, for a given initial configuration, we shall estimate the symmetry breaking performed by the protocol not in any possible execution but an execution in which the scheduler tries to maximize the symmetry.In particular, we shall define the symmetry of a protocol on a given initial configuration c 0 as the maximum symmetry achieved over all possible executions on c 0 .So, in order to lower bound by k the symmetry of a protocol on a given c 0 , it will be sufficient to present a schedule in which the protocol stabilizes without ever "electing" fewer than k nodes.On the other hand, to establish an upper bound of h on symmetry, we will have to show that in every schedule (on the given c 0 ) the protocol "elects" at most h nodes.Then we may define the symmetry of the protocol on a set of initial configurations as the minimum of its symmetries over those initial configurations.The symmetry of a protocol (as a whole) shall be defined as a function of some parameter of the initial configuration and is deferred to Section 2.
Section 2 brings together all definitions and basic facts that are used throughout the paper.In particular, it recalls the basic definitions concerning the population protocol model, it defines the parallel scheduler under consideration, and gives a definition of symmetry that is suitable for the setting under consideration.In Section 3, we give a set of positive results.The main result here is a partial characterization, stating that any positive linear combination can be computed with symmetry Θ(N min ), which is asymptotically optimal.Then, in Section 4, we study some basic predicates that seem to require much symmetry breaking.In particular, we study the majority and the parity predicates.For majority (and, in general, all linear combinations with mixed coefficient signs) we establish a constant symmetry, while for parity we prove a strong negative result, stating that the symmetry of any protocol that stably computes it is upper bounded by an integer depending only on the size of the protocol (i.e. a constant, compared to the size of the system).The latter implies that there exist predicates which can only be computed by protocols that perform some sort of leader-election (not necessarily a unique leader but at most a constant number of nodes in a distinguished leader role).Finally, in Section 5 we conclude and give further research directions that are opened by our work.

Further Related Work
In contrast to static systems with unique identifiers (IDs) and dynamic systems, the role of symmetry in static anonymous systems has been deeply investigated [3,31,19].Similarity as a way to compare and contrast different models of concurrent programming has been defined and studied in [18].One (restricted) type of symmetry that has been recently studied in systems with IDs is the existence of homonyms, i.e. processes that are initially assigned the same ID [12].Moreover, there are several standard models of distributed computing that do not suffer from a necessity to break symmetry globally (e.g. to elect a unique leader) like Shared Memory with Atomic Snapshots [1,8], Quorums [29,28,22], and the LOCAL model [27].
Population Protocols were originally motivated by highly dynamic networks of simple sensor nodes that cannot control their mobility.The first papers focused on the computational capabilities of the model which have now been almost completely characterized.In particular, if the interaction network is complete (as is also the case in the present paper), i.e. one in which every pair of processes may interact, then the computational power of the model is equal to the class of the semilinear predicates (and the same holds for several variations) [6].Interestingly, the generic protocol of [5] that computes all semilinear predicates, elects a unique leader in every execution and the same is true for the construction in [11].Moreover, according to [2], all known generic constructions of semilinear predicates "fundamentally rely on the election of a single initial leader node, which coordinates phases of computation".Semilinearity of population protocols persists up to o(log log n) local space but not more than this [9].If additionally the connections between processes can hold a state from a finite domain, then the computational power dramatically increases to the commutative subclass of NSPACE(n 2 ) [24].The latter constitutes the mediated population protocol (MPP) model, which was the first variant of population protocols to allow for states on the edges.Recently, Doty [13] demonstrated the formal equivalence of population protocols to chemical reaction networks (CRNs), which model chemistry in a well-mixed solution.Moreover, the Network Constructors extension of population protocols [26], showed that a population of finite-automata that interact randomly like molecules in a well-mixed solution and that can establish bonds with each other according to the rules of a common small protocol, can construct arbitrarily complex stable networks [26].In [23], a geometrically constrained variant was studied, where the formed network and the allowable interactions must respect the structure of the 2-dimensional (or 3-dimensional) grid network.Finally, in [10], the authors highlighted the importance of executions that necessarily pass through a "bottleneck" transition (meaning a transition between two states that have only constant counts in the population, which requires Ω(n 2 ) expected number of steps to occur), by proving that protocols that avoid such transitions can only compute existence predicates.To the best of our knowledge no paper in this area has considered the problem of computing predicates stably without ever electing a unique leader (according to [2], " [14] proposes a leader-less framework for population computation", but this should not be confused with what we do in this paper, as it only concerns the achievement of dropping the requirement for a pre-elected unique leader that was assumed in all previous results for that problem).For introductory texts to population protocols, the interested reader is encouraged to consult [7] and [25].

Preliminaries
A population protocol (PP) is a 6-tuple (X, Y, Q, I, O, δ), where X, Y , and Q are all finite sets and X is the input alphabet, Y is the output alphabet, Q is the set of states, I : x for at least one x ∈ {a, b} and ineffective otherwise.When we present the transition function of a protocol we only present the effective transitions.The system consists of a population V of n distributed processes (also called nodes when clear from context).In the generic case, there is an underlying interaction graph G = (V, E) specifying the permissible interactions between the nodes.Interactions in this model are always pairwise.In this work, G is a complete directed interaction graph.
Let Q be the set of states of a population protocol A. A configuration c of A on n nodes is an element of N |Q| ≥0 , such that, for all q ∈ Q, c[q] is equal to the number of nodes that are in state q in configuration c and it holds that q∈Q c[q] = n.For example, if Q = {q 0 , q 1 , q 2 , q 3 } and c = (7, 12, 52, 0), then, in c, 7 nodes of the 7 + 12 + 52 + 0 = 71 in total, are in state q 0 , 12 nodes in state q 1 , and 52 nodes in state q 2 .Execution of the protocol proceeds in discrete steps and it is determined by an adversary scheduler who is allowed to be parallel, meaning that in every step it may select one or more pairwise interactions to occur at the same time.So, an important difference from classical population protocols is that, in this work, the scheduler may not only select a single interaction but also more than one interactions, up to a maximum matching.More formally, in every step, a non-empty matching (u 1 , v 1 ), (u 2 , v 2 ), . . ., (u k , v k ) from E is selected by the scheduler and, for all 1 ≤ i ≤ k, the nodes u i , v i interact with each other and update their states according to the transition function δ.A fairness condition is imposed on the adversary to ensure the protocol makes progress.An infinite execution is fair if for every pair of configurations c and c such that c → c (i.e.c can go in one step to c ), if c occurs infinitely often in the execution then so does c .
In population protocols we are typically interested in computing predicates on the inputs, e.g.N a ≥ 5, being true whenever there are at least 5 as in the input. 1 Moreover, computations are stabilizing and not terminating, meaning that it suffices for the nodes to eventually converge to the correct output.We say that a protocol stably computes a predicate if, on any population size, any input assignment, and any fair execution on these, all nodes eventually stabilize their outputs to the value of the predicate on that input assignment.
The symmetry s(c) of a configuration c is defined as the minimum multiplicity of a state that is present in c.That is, For example, if c = (0, 4, 12, 0, 52) then s(c) = 4, if c = (1, . ..) then s(c) = 1, which is the minimum possible value for symmetry, and if c = (n, 0, 0, . . ., 0) then s(c) = n which is the maximum possible value for symmetry.So, the range of the symmetry of a configuration is {1, 2, . . ., n}.Let C 0 (A) be the set of all initial configurations for a given protocol A. Given an initial configuration c 0 ∈ C 0 (A) denote by Γ(c 0 ) the set of all fair executions of A that begin from c 0 .Actually, we only focus on the prefix of each of these executions up to stability. 2iven any initial configuration c 0 and any execution α ∈ Γ(c 0 ), define the symmetry breaking of A on α as the difference between the symmetry of the initial configuration of α and the minimum symmetry of a configuration of α, that is, the maximum drop in symmetry during the execution.Formally,

Also define the symmetry of A on α as
The symmetry breaking of a protocol A on an initial configuration c 0 can now be defined as and the symmetry of A on c 0 as Intuitively, to estimate the degree of symmetry breaking that the protocol must perform in order to solve the problem on a given c 0 , we execute the protocol against a scheduler who is a symmetry maximizer.Such a scheduler, picks a symmetry-maximizing schedule for the given protocol and c 0 , and the symmetry breaking that the protocol has to perform in order to solve the problem under this schedule must then be an upper bound on its symmetry breaking on all other (less symmetric) schedules.The reason for this approach is that there are schedules that break symmetry without requiring any symmetry breaking effort by the protocol itself.So, in order to estimate the symmetry breaking that is solely due to the protocol, we have to test it under schedules that try to maximize the symmetry, thus forcing the protocol to break it as much as required in order to manage to solve the problem.Now, given the set C(N min ) of all initial configurations c 0 such that s(c 0 ) = N min , we define the symmetry breaking of a protocol A on C(N min ) as and the symmetry of A on C(N min ) as This means that, in order to establish that a protocol A is at least g(N min ) symmetric asymptotically (e.g. for g(N min ) = Θ(log N min )), we have to show that for every sufficiently large N min , the symmetry breaking of A on C(N min ) is at most N min − g(N min ), that is to show that for all initial configurations c 0 ∈ C(N min ) there exists an execution on c 0 that drops the initial symmetry by at most N min − g(N min ), e.g. by at most N min − log N min for g(N min ) = log N min , or that does not break symmetry at all in case g(N min ) = N min .On the other hand, to establish that the symmetry is at most g(N min ), e.g. at most 1 which is the minimum possible value, one has to show a symmetry breaking of at least N min − g(N min ) on infinitely many N min s.

Symmetrically Computable Predicates
In this section, we try to identify predicates that can be stably computed with much symmetry.First, in Section 3.1 we give an indicative example, that serves both as an illustration of the model and the definitions and as a first positive result.Then, in Section 3.2 we generalize the main ideas developed in the previous example, and arrive at a partial characterization of the predicates that can be computed with maximum symmetry.Finally, Section 3.3 highlights the role of output-stable states in symmetric computations.In particular, it proves a proposition that is crucial for the negative result of Section 4.2, it highlights the importance of output-stable states for maximizing symmetry, and concludes with the fact that there are predicates which do not allow for output-stable states, so they require alternative approaches (developed in Section 4).
q 2 , . . ., q x } I(σ) = q σ , for all σ ∈ X O(q x ) = 1 and O(q) = 0, for all q ∈ Q\{q x } δ: Proof.The scheduler partitions the q 1 s, let them be N 1 (0) initially and denoted just N 1 in the sequel, into N 1 /x groups of x q 1 s each, possibly leaving an incomplete group of r ≤ x − 1 q 1 s residue.Then, in each complete group, it performs a sequential gathering of x − 3 other q 1 s to one of the nodes, which will go through the states q 1 , q 2 , . . ., q x−1 .The same gathering is performed in parallel to all groups, so every state that exists in one group will also exist in every other group, thus its cardinality never drops below N 1 /x .In the end, at step t, there are many q 0 s, N x−1 (t) = N 1 /x , and N 1 (t) = N 1 /x + r, where 0 ≤ r ≤ x − 1 is the residue of q 1 s.That is, in all configurations so far, the symmetry has not dropped below N 1 /x .Now, we cannot pick, as a symmetry maximizing choice of the scheduler, a perfect bipartite matching between the q 1 s and the q x−1 s converting them all to the alarm state q x , because this could possibly leave the symmetry-breaking residue of q 1 s.What we can do instead, is to match in one step as many as we can so that, after the corresponding transitions, N x (t ) ≥ N 1 (t ) is satisfied.In particular, if we match y of the (q 1 , q x−1 ) pairs we will obtain N x (t ) = 2y, N x−1 (t ) = N 1 /x − y, and N 1 (t ) = N 1 /x − y + r and what we want is which means that if we match approximately 1/3 of the (q 1 , q x−1 ) pairs then we will have as many q x as we need in order to eliminate all q 1 s in one step and all remaining q x−1 s in another step.The minimum symmetry in the whole course of this schedule is So, we have showed that if there are no q 0 s in the initial configuration, then the symmetry breaking of the protocol on the schedule defined above is at most N min − ((2/3) N 1 /x − (x − 1)/3) = N min − ((2/3) N min /x − (x − 1)/3).Next, we consider the case in which there are some q 0 s in the initial configuration.Observe that in this protocol the q 0 s can only increase, so their minimum cardinality is precisely their initial cardinality N 0 .Consequently, in case N 0 ≥ 1 and N 1 ≥ 1, and if N min = min{N 0 , N 1 }, the symmetry breaking of the schedule defined above is N min − min{N 0 , N x−1 (t )}.If, for some initial configuration, N 0 ≥ N x−1 (t ) then the symmetry breaking is N min − N x−1 (t ) ≤ N min − ((2/3) N 1 /x − (x − 1)/3).This gives again N min − ((2/3) N min /x − (x − 1)/3), when N 1 ≤ N 0 , and less than then, in this case, the symmetry breaking is N min − min{N 0 , N x−1 (t )} = N 0 − N 0 = 0. Finally, if N 0 = n, then the symmetry breaking is 0. We conclude that for every initial configuration, the symmetry breaking of the above schedule is at most N min − N x−1 (t ) ≤ N min − ((2/3) N min /x − (x − 1)/3), for all x ≥ 2, and 0, for x = 1.Therefore, the symmetry of the Count-to-x protocol is at least (2/3) N min /x + (x − 1)/3 = Θ(N min ), for x ≥ 2, and N min , for x = 1.and c ≥ 0, can be computed with symmetry more than N min /(c/ j∈L a j + 2) − 2 = Θ(N min ).

A General Positive Result Theorem 1. Any predicate of the form
Proof.We begin by giving a parameterized protocol (Protocol 2) that stably computes any such predicate, and then we shall prove that the symmetry of this protocol is the desired one.
Protocol 2 Positive-Linear-Combination Q = {q 0 , q 1 , q 2 , . . ., q c } I(σ i ) = q ai , for all σ i ∈ X O(q c ) = 1 and O(q) = 0, for all q ∈ Q\{q c } δ: (q i , q j ) → (q i+j , q 0 ), if i + j < c → (q c , q c ), otherwise Take now any initial configuration C 0 on n nodes and let L ⊆ [k] be the set of indices of the initial states that are present in C 0 .Let also q min be the state with minimum cardinality, N min , in C 0 .Construct N min /x groups, by adding to each group x = c/ j∈L a j copies of each initial state.Observe that each group has total sum j∈L a j x = x j∈L a j = c/ j∈L a j ( j∈L a j ) ≥ c.Moreover, state q min has a residue r min of at most x and every other state q i has a residue r i ≥ r min .Finally, keep y = (N min + r min )/(x + 1) − 1 from those groups and drop the other N min /x − y groups making their nodes part of the residue, which results in new residue values r j = x( N min /x − y) + r j , for all j ∈ L. It is not hard to show that y ≤ r j , for all j ∈ L.
We now present a schedule that achieves the desired symmetry.The schedule consists of two phases, the gathering phase and the dissemination phase.In the dissemination phase, the schedule picks a node of the same state from every group and starts aggregating to that node the sum of its group sequentially, performing the same in parallel in all groups.It does this until the alarm state q c first appears.When this occurs, the dissemination phase begins.In the dissemination phase, the schedule picks one after the other all states that have not yet been converted to q c .For each such state q i , it picks a q c which infects one after the other (sequentially) the q i s, until N c (t) ≥ N i (t) is satisfied for the first time.Then, in a single step that matches each q i to a q c , it converts all remaining q i s to q c .
We now analyze the symmetry breaking of the protocol in this schedule.Clearly, the initial symmetry is N min .As long as a state appears in the groups, its cardinality is at least y, because it must appear in each one of them.When a state q i first becomes eliminated from the groups, its cardinality is equal to its residue r i .Thus, so far, the minimum cardinality of a state is min{y, min j∈L It follows that the maximum symmetry breaking so far is less than Finally, we must also take into account the dissemination phase.In this phase, the q c s are 2y initially and can only increase, by infecting other states, until they become n and the cardinalities of all other states decrease until they all become 0. Take any state q i = q c with cardinality N i (t) when the dissemination phase begins.What the schedule does is to decrement N i (t), until N c (t ) ≥ N i (t ) is first satisfied, and then to eliminate all occurrences of q i in one step.Due to the fact that N i is decremented by one in each step resulting in a corresponding increase by one of N c , when y for all y ≥ which implies that the lower bound of y on the minimum cardinality, established for the gathering phase, is not violated during the dissemination phase.
We conclude that the symmetry of the protocol in the above schedule is more than N min /(c/ j∈L a j + 2) − 2.

Output-stable States
Informally, a state q ∈ Q is called output-stable if its appearance in an execution guarantees that the output value O(q) must be the output value of the execution.More formally, if q is output-stable and C is a configuration containing q, then the set of outputs of C must contain O(q), for all C s.t.C C .Moreover, if all executions under consideration stabilize to an agreement, meaning that eventually all nodes stabilize to the same output, then the above implies that if an execution ever reaches a configuration containing q then the output of that execution is necessarily O(q).
A state q is called reachable if there is an initial configuration C 0 and an execution on C 0 that can produce q.We can also define reachability just in terms of the protocol under the assumption that if Q 0 ⊆ Q is the set of initial states then any possible combination of cardinalities of states from Q 0 can be part of an initial configuration.A production tree for a state q ∈ Q, is a directed binary in-tree with its nodes labeled from Q s.t.its root has label q, if a is the label of an internal node (the root inclusive) and b, c are the labels of its children, then the protocol has a rule of the form {b, c} → {a, •} (that is, a rule producing a by an interaction between a b and a c in any direction) 3 , and any leaf is labeled from Q 0 .Observe now that if a path from a leaf to the root repeats a state a, then we can always replace the subtree of the highest appearance of a by the subtree of the lowest appearance of a on the path and still have a production tree for q.This implies that if q has a production tree, then q also has a production tree of depth at most |Q|, that is, a production tree having at most 2 |Q|−1 leaves, which is a constant number, when compared to the population size n, that only depends on the protocol.Now, we can call a state q reachable (by a protocol A) if there is a production tree for it.These are summarized in the following proposition.Proposition 2. Let A be a protocol, C 0 be any (sufficiently large) initial configuration of A, and q ∈ Q any state that is reachable from C 0 .Then there is an initial configuration C 0 which is a sub-configuration of C 0 of size n ≤ 2 |Q|−1 such that q is reachable from C 0 .
Note that Proposition 2 is crucial for proving negative results, and will be invoked in Section 4.
Proposition 3. Let p be a predicate.There is no protocol that stably computes p (all nodes eventually agreeing on the output in every fair execution), having both a reachable output-stable state with output 0 and a reachable output-stable state with output 1.

Proof.
Let A be such a protocol and let q and q be the two reachable output-stable states, such that O(q) = 0 and O(q ) = 1.As both q and q are reachable, both have production trees.Denote by L(a) the set of leaves of a minimum (w.r.t.its number of leaves) production tree for state a together with their labels.Consider now an initial configuration C 0 , in which a subset set of the nodes is labeled as L(q) and another disjoint subset of nodes is labeled as L(q ).As any label in L(q) ∪ L(q ) is an initial state, there is always such an initial configuration C 0 .Now, consider the following finite prefix of a fair execution on C 0 : The scheduler first simulates the production tree of q on the nodes corresponding to L(q) and then it simulates the production tree of q on the nodes corresponding to L(q ).One way of performing the simulation is to always pick the next internal node of maximum depth, not picked yet.Such a node can only have nodes already picked or leaves as its children, otherwise there would be an unpicked internal node of greater depth, violating depth maximality.What the scheduler does after picking an internal node in state a with children in states b and c, is to select the appropriate interaction between two nodes in states b and c in order to produce a copy of state a in the population.At the end of the first simulation, there will be a copy of state q in the population and at the end of the second simulation there will be a copy of state q in the population.As q is output-stable, any fair execution having the above prefix producing q must necessarily have eventually all nodes agree on output O(q) = 0.But q is also output-stable implying that all nodes must eventually agree on output O(q ) = 1, which is a contradiction.
An output-stable state q is additionally called disseminating if {x, q} → (q, q) for all x ∈ Q. Proposition 4. Let A be a protocol with at least one reachable output-stable state, that stably computes a predicate p and let Q s ⊆ Q be the set of reachable output-stable states of A. Then there is a protocol A with a reachable disseminating state that stably computes p.
Proof.We first show how to construct A from A. Pick a single state q ∈ Q s .Replace any occurrence of a q ∈ Q s in the transition function δ by q, eliminate duplicate rules, and remove from Q all q ∈ Q s \{q}.Finally, replace any rule (x, y) → (z, w), where x = q, y = q, z = q, or w = q by the rule (x, y) → (w, w).This completes the construction of A .State q is a disseminating state of A because, by the last step of the construction, it holds that {x, q} → (q, q) for all x ∈ Q.Moreover, q is reachable because every q ∈ Q s is reachable in A, q inclusive, and the above construction has only positively affected the reachability of q.
It remains to show that A stably computes p.As A stably computes p, it suffices to show that when the two protocols are executed on the same schedule (including the choice of the initial configuration) their stable outputs are the same.Take any schedule in which A produces a q ∈ Q s and consider the first time t that this happens.As q is output-stable, the stable output of A on this schedule must be O(q ).Consider now A on the same schedule.Before step t, the executions of A and A must be equivalent, because the construction has only affected rules containing at least one output-stable state.At step t, A produces its disseminating state q, thus its output is O(q) = O(q ), so the outputs of the two protocols agree on schedules producing output-stable states.Finally, for any schedule in which A does not produce an output-stable state, the executions of A and A are equivalent on this schedule, thus again their outputs agree.Theorem 2. Let A be a protocol with a reachable disseminating state q and let C d 0 be the subset of its initial configurations that may produce q.Then the symmetry of A on Theorem 2 emphasizes the fact that disseminating states can be exploited for maximum symmetry.We have omitted its proof, because it is similar to the proofs of Proposition 1 and Theorem 1.This lower bound on symmetry immediately applies to single-signed linear combinations (where passing a threshold can safely result in the appearance of a disseminating state, because there are no opposite-signed numbers to inverse the process), thus, it can be used as an alternative way of arriving at Theorem 1.On the other hand, the next proposition shows that this lower bound does not apply to linear combinations containing mixed signs, because protocols for them cannot have output-stable states.

Proposition 5. Let p be a predicate of the form i∈
and c ≥ 0 such that at least two a i s have opposite signs.Then there is no protocol, having a reachable output-stable state, that stably computes p.

Proof.
Let A be such a protocol and let q ∈ Q be a reachable output-stable state of A. Take an initial configuration C 0 that can produce q.As q is output-stable, it must hold that the value of the predicate on C 0 is equal to O(q).If O(q) = 1 then C 0 must satisfy i∈[k] a i N i ≥ c.Construct now another initial configuration C 0 by adding to C 0 as many nodes in a negative-coefficient initial state as required to violate i∈[k] a i N i ≥ c.The value of the predicate p on C 0 is equal to 0 but q can still be produced on the C 0 sub-configuration of C 0 implying that A's output on C 0 is 1.The latter violates the fact that A stably computes p. If, instead, O(q) = 0, then we can obtain a similar contradiction by adding a sufficient number of positive-coefficient nodes to C 0 .

Harder Predicates
In this section, we study the symmetry of predicates that, in contrast to single-signed linear combinations, do not allow for output-stable states.In particular, we focus on linear combinations containing mixed signs, like the majority predicate, and also on modulo predicates like the parity predicate.Recall that these predicates are not captured by the lower bound on symmetry of Theorem 2. For mixed-signed linear combinations we give weak positive results on symmetry in Section 4.1 and for parity we give a strong impossibility result in Section 4.2.

Weak Positive Results for Mixed Coefficients
We now prove a proposition stating that the majority predicate (also can be generalized to any predicate with mixed signs) can be computed with symmetry that depends on the difference of the state-cardinalities in the initial configuration.If the difference is large, then there is a protocol that can exploit it for symmetric computation.However, in the worst case the difference is small, while N min is large, and then that protocol gives small symmetry (with worst possible value the election of a unique state when the initial difference is only 1).An implication of this proposition is that in order to establish an impossibility result for the mixed-signs case, one has to focus on initial configurations with small differences.Proof.Initially, a node is in (l, 1) if its input is a and in (l, −1) if its input is b.The definition of the protocol is given in Protocol 3.

Protocol 3 Majority
We first argue about the correctness of the protocol.Initially all nodes are l-leaders and l-leaders can only decrease via an interaction between an (l, 1) and an (l, −1), in which case both become followers in state (f, −1).The only things that followers do is to copy the data bit of the leaders (provided that at least one leader still exists) and to let the data bit −1 dominate a disagreement between two of them.Moreover, as long as there are at least two leaders with opposite data bits, due to fairness, an interaction between them will eventually occur.It follows that eventually, min{N a , N b } such eliminations will have occurred leaving 2 • min{N a , N b } followers and n − 2 • min{N a , N b } leaders.All leaders will have data bit 1 in case as are the majority, data bit −1 in case bs are the majority, while there will be no leaders in case none of the two is a strict majority.In the first case, all followers will eventually copy 1, thus all nodes will stabilize their output to 1. Observe that the 1 of a follower may change many times to −1 due to its interactions with other followers that have not yet set their data bit to 1, still fairness guarantees that eventually the unique (continuously reachable) stable configuration in which all followers have switched to 1 after interacting with the leaders will occur.In the second case, all followers will eventually copy -1, thus all nodes will stabilize their output to 0 and in the third case there are only followers, so the data bit -1 eventually dominates due to the last two rules of the protocol and eventually all nodes will stabilize their output to 0. In summary, if the as form a strict majority all nodes stabilize to 1, otherwise all nodes stabilize to 0, thus Protocol 3 stably computes the majority predicate.
For symmetry, consider first those initial configurations which satisfy |N a − N b | ≥ min{N a , N b }.Consider the schedule that matches min{N a , N b } leaders with opposite data bits in its first step, leaving |N a − N b | leaders agreeing on the majority (i.e. in the sate state) and 2 • min{N a , N b } followers in state (f, −1).Up to this point, there is no symmetry breaking because the minimum cardinality that has appeared is still the initial minimum min{N a , N b }.Next, the scheduler matches in one step min{N a , N b } followers to leaders and then in another step the rest min{N a , N b } followers to leaders, which leads to a stable configuration in which all followers have their output agree with the data bit of the leaders.As the minimum cardinality never has fallen below the initial minimum min{N a , N b }, the symmetry is in this case at least min{N a , N b }.
Next, consider those initial configurations which satisfy Remark.A result similar to Proposition 6 can be proved for any predicate of the form Still, as we prove in the following theorem, it is possible to do better in the worst-case, and achieve any desired constant symmetry.Theorem 3.For every constant k ≥ 1, the majority predicate N a −N b > 0 can be computed with symmetry k.
Proof.The idea is to multiply both N a and N b by k so that their difference becomes k|N a − N b |.In this manner, the difference will become at least k (in absolute value) whenever there is a strict majority which can be exploited for computation with symmetry k.Fortunately, multiplying both N a and N b by k ≥ 1 does not affect the value of the majority predicate, but only the winning difference.
To this end, we set the state of a node initially to (l, k) if its input is a and to (l, −k) if its input is b.The definition of the protocol is given in Protocol 4.
For correctness, initially all nodes are l-leaders.Now, l-leaders, apart from decreasing as in Protocol 3, can also increase.This occurs whenever an (l, i), with |i| ≥ 2, meets a follower, in which case the follower becomes a leader taking one unit of the other leader's count.Still, as in Protocol 3, as long as there are at least two leaders with opposite data bits, due to fairness, an interaction two such leaders will eventually occur.Eventually, all leaders will have a positive data bit in case as are the majority, and a non-positive in case as are not the majority.From that point on, no leader can change its output and all followers will eventually copy this output.
For symmetry, in case N a = N b , then the scheduler can pick a perfect bipartite matching between the (l, k)s and the (l, −k)s to convert them to (f, 0) and thus stabilize to output 0 without any symmetry breaking.The case, N b > N a is simpler then the N a > N b because the default output of the followers is 0, while in the N a > N b case there is a small additional difficulty due to the fact that all (f, 0)s have to be converted to (f, 1)s.So, w.l.o.g.we focus (l, i), (l, j) → (l, i + j), (f, 1), if i, j have opposite signs and i + j > 0 → (l, i + j), (f, 0), if i, j have opposite signs and i + j < 0 These are converted to (f, 0)s in one step, so we now have the initial k (f, 0)s, the new (f, 0)s that are at least 2k 2 − k − 1, k + 1 (l, k)s, and k (l, −k)s.Together the (l, k)s and (l, −k)s hold a total count of k(k + 1) + k 2 = 2k 2 + k and together the new (f, 0)s, the (l, k)s, and the (l, −k)s are at least 2k 2 − k − 1 + (k + 1) + k = 2k 2 + k nodes.So, there are enough nodes (the initial (f, 0)s excluded) to distribute on them the count as follows.First the scheduler picks the (l, k)s and matches them in one step to k + 1 nodes in (f, 0).This leaves k + 1 nodes in (l, k − 1) and k + 1 nodes in (l, 1).Then it matches the (l, k − 1)s to (f, 0)s, introducing k + 1 more (l, 1)s and leaving k + 1 nodes in (l, k − 2).It continues in the same way until no count is greater than 1, in this way distributing the counts of the k + 1 nodes in (l, k) to k(k + 1) copies of (l, 1).Observe that during this process the initial (l, k)s are always in identical states going in parallel through the sequence of states (l, k), (l, k − 1), (l, k − 2), . . ., (l, 1), so each state on them is the state of k + 1 other nodes.Moreover, their first matching with (f, 0)s introduces k + 1 (l, 1)s in one step and from that point on (during this particular process) (l, 1)s only increase, so the cardinality of (l, 1)s does not go below k + 1.Next (or in parallel), it does the same with the k nodes in (l, −k) leaving k 2 copies of (l, −1).Observe that even though (f, 0)s decrease during these processes, their cardinality never goes below k due to the initial set of k (f, 0)s.So, at this point there are at least k (f, 0)s, k 2 + k (l, 1)s, and k 2 (l, −1), while the minimum multiplicity of a state has never dropped below k.The scheduler now matches in one step all the (l, −1)s to (l, 1)s leaving in the population at least k 2 + k (f, 0)s and precisely k (l, 1)s.Then, the scheduler matches all (l, 1)s to (f, 0)s, thus introducing in one step k (f, 1)s (and still having at least k 2 (f, 0)s), and then picks an (l, 1) and starts converting sequentially (f, 0)s to (f, 1)s until precisely k (f, 0)s have remained.Finally, it matches the remaining k (f, 0)s to the k (l, 1)s to convert all (f, 0)s to (f, 1)s in one step.At this point the protocol has stabilized and the multiplicity of no state has ever dropped below k.

A Negative Result
We now prove a negative result, establishing that there are predicates that cannot be stably computed with much symmetry.The result concerns the parity predicate, defined as n mod 2 = 1.In particular, all nodes obtain the same input, e.g. 1, and thus all begin from the same state, e.g.q 1 .So, in this case N min = n in every initial configuration, so we can here talk about symmetry as a function of n.The parity predicate is true iff the number of nodes is odd.So, whenever n is odd, we want all nodes to eventually stabilize their outputs to 1 and, whenever it is even, to 0. If symmetry is not a constraint, then there is a simple protocol that solves the problem [4].All nodes begin as leaders with data bit 1, i.e. in state (l, 1).Whenever two leaders (l, i) and (l, j) interact, one of them remains a leader in (l, (i + j) mod 2) and the other becomes a follower in (f, (i + j) mod 2).Followers can never become leaders again and only copy the data bit of the leaders they interact with.Observe that n mod 2 is always preserved as the sum of the leaders' data bits, that a unique leader is guaranteed to remain eventually with its data bit being equal to n mod 2, and that all followers will eventually copy the unique leader's data bit.In case this data bit is equal to 1, all output 1 and, in case it is equal to 0, all output 0. Unfortunately, not only this particular strategy, but any possible strategy for the problem, cannot achieve symmetry more than a constant that depends on the size of the protocol, as we shall now prove.

Theorem 4.
Let A be a protocol with set of states Q, that solves the parity predicate.Then the symmetry of A must be less than 2 |Q|−1 .
Proof.For the sake of contradiction, assume A solves parity with symmetry f (n) ≥ 2 |Q|−1 .Take any initial configuration C n for any sufficiently large odd n (e.g.n ≥ f (n) or n ≥ |Q| • f (n), or even larger if required by the protocol).By definition of symmetry, there is an execution α on C n that reaches stability without ever dropping the minimum cardinality of an existing state below f (n).Call C stable the first output-stable configuration of α.As n is odd, C stable must satisfy that all nodes are in states giving output 1 and that no execution on C stable can produce a state with output 0.Moreover, due to the facts that A has symmetry f (n) and that α is an execution that achieves this symmetry (e.g. it could be a symmetry maximizing one), it must hold that every q ∈ Q that appears in C stable has multiplicity Consider now the initial configuration C 2n , i.e. the unique initial configuration on 2n nodes.Observe that now the number of nodes is even, thus the parity predicate evaluates to false and any fair execution of A must stabilize to output 0. Partition C 2n into two equal parts, each of size n.Observe that each of the two parts is equal to C n .Consider now the following possible finite prefix β of a fair execution on C 2n .The scheduler simulates in each of the two parts the previous execution α up to the point that it reaches the configuration C stable .So, the prefix β takes C 2n to a configuration denoted by 2C stable and consisting precisely of two copies of C stable .Observe that 2C stable and C stable consist of the same states with the only difference being that their multiplicity in 2C stable is twice their multiplicity in C stable .A crucial difference between C stable and 2C stable is that the former is output-stable while the latter is not.In particular, any fair execution of A on 2C stable must produce a state q 0 with output 0. But, by Proposition 2, q 0 must also be reachable from a sub-configuration C small of 2C stable of size at most 2 |Q|−1 .So, there is an execution γ restricted on C small that produces q 0 .Observe now that C small is also a sub-configuration of C stable .The reason in that (i) every state in C small is also a state that exists in 2C stable and thus also a state that exists in C stable and (ii) the multiplicity of every state in C small is restricted by the size of C small , which is at most 2 |Q|−1 , and every state in C stable has multiplicity at least f (n) ≥ 2 |Q|−1 , that is, C stable has sufficient capacity for every state in C small .But this implies that if γ is executed on the sub-configuration of C stable corresponding to C small , then it must produce q 0 , which contradicts the fact that C stable is output-stable with output 1.Therefore, we conclude that A cannot have symmetry at least f (n) ≥ 2 |Q|−1 .
Remark.Theorem 4 constrains the symmetry of any correct protocol for parity to be upper bounded by a constant that depends on the size of the protocol.Still, it does not exclude the possibility that parity is solvable with symmetry k, for any constant k ≥ 1.The reason is that, for any constant k ≥ 1, there might be a protocol with |Q| > k (or even |Q| k) that solves parity and achieves symmetry k, because k < 2 |Q|−1 , which is the upper bound on symmetry proved by the theorem.On the other hand, the 2 |Q|−1 upper bound of Theorem 4 excludes any protocol that would solve parity with symmetry depending on N min .

Conclusions and Further Research
In this work, we managed to obtain a first partial characterization of the predicates with symmetry Θ(N min ) and to exhibit a predicate (parity) that resists any non-constant symmetry.
The obvious next goal is to arrive at an exact characterization of the allowable symmetry of all semilinear predicates.Another more specific question, concerning the parity predicate (but could possibly generalize to other modulo predicates as well), is the following.Some preliminary results of ours, indicate that constant symmetry for parity can be achieved if the initial configuration has a sufficient number of auxiliary nodes in a distinct state q 0 .Apart from making this precise, if true, the most interesting question then is whether it can also be achieved without such nodes.Moreover, in general, "How do auxiliary nodes affect symmetry?".Another very challenging direction for further research, concerns networked systems (either static or dynamic) in which the nodes have memory and possibly also unique IDs.Even though the IDs provide an a priori maximum symmetry breaking, still, solving a task and avoiding the process of "electing" one of the nodes may be highly non-trivial.But in this case, defining the role of a process as its local state is irrelevant.As already discussed, there are other plausible ways of defining the role of a process, but which one is best-tailored for such systems is still unclear and needs further investigation.
Mediated Population Protocols [24] seem to not suffer from the soup spoiling of the kind exhibited in Theorem 4, mainly because nodes in the same state can mark other nodes without changing the local state of those nodes (instead they can record the marks on the edges of the network).An interesting first possible question here is "Can all semilinear predicates be computed with symmetry Θ(N min )?".Then, the natural next target would be an exact characterization of the allowable symmetry of all predicates computable by Mediated Population Protocols.This could be challenging, as the class of computable predicates in that model is equal to the commutative subclass of NSPACE(n 2 ).On the positive side, the model allows the preservation of the definition of a node's role as its local state, but maybe should be extended to also take into account the states of the edges.
Finally, recall that in this work we have restricted ourselves to the symmetry achieved in a symmetry maximizing schedule, without making any other particular assumptions about the scheduler.An interesting alternative is to consider random parallel schedulers, like one that selects in every step a maximum matching uniformly at random from all such matchings.Then we may ask "What is the average symmetry achieved by a protocol under such a scheduler?".

Proposition 6 .
The majority predicate N a − N b > 0 can be computed with symmetry min{N min , |N a − N b |}, where N min = min{N a , N b }.
|N a − N b | < min{N a , N b }.Again, in the first step all opposite data bits are matched leaving 2 • min{N a , N b } followers and |N a − N b | ≥ 0 leaders.Observe that if |N a − N b | = 0 then the configuration is already stable without any symmetry breaking.If |N a − N b | ≥ 1, then the scheduler goes on by matching in one step |N a − N b | followers to the leaders.Then it picks a leader and converts sequentially from the remaining followers, until precisely |N a − N b | of them remain.Those are then converted in one step by being matched to the leaders.The minimum cardinality of a state in this schedule is |N a − N b | and the initial minimum is min{N a , N b }, so the symmetry breaking is min{N a , N b } − |N a − N b | and the symmetry is on those initial configurations |N a − N b |.So, whenever N min ≤ |N a − N b |, the protocol has optimal symmetry N min .On the other hand, when N min > |N a − N b |, the symmetry achieved by the protocol is |N a − N b |.When this happens to be large, the protocol exploits it and achieves a high symmetry.Still, there are cases in which the difference |N a − N b | is as small as 1 while N min = Θ(n).For example, when N a = N b + 1 it holds that N min = N b = (n − 1)/2 but the symmetry of the above protocol is only 1.

Protocol 4 k
-Symmetry-Majority Q = {l, f } × {−k, −(k − 1), . . ., 0, . . ., k − 1, k} I(a) = (l, k) and I(b) = (l, −k) O(•, j) = 0, for all −k ≤ j ≤ 0 and O(•, i) = 1, for all 0 < i ≤ k δ: 0), (f, 0) on the N a > N b case and we only give a proof for the special case in which N a = N b + 1 as the other cases are similar.So, assume that N a = N b + 1.The construction requires that n ≥ 2k(k + 1).The initial configuration consists of N a = N b + 1 nodes in state (l, k) and N b nodes in (l, −k).We present a schedule with symmetry k.The scheduler first picks a matching between (l, k)s and (l, −k)s of size k/2 .This introduces k copies of state (f, 0) and leaves N b − k/2 nodes in state (l, −k) and N b − k/2 + 1 nodes in state (l, k).Now isolate k + 1 nodes in state (l, k) and k nodes in state (l, −k).The remaining nodes in states (l, k) and (l, −k) (equal of each) are n − k −