Uniform Bipartition in the Population Protocol Model with Arbitrary Communication Graphs

In this paper, we focus on the uniform bipartition problem in the population protocol model. This problem aims to divide a population into two groups of equal size. In particular, we consider the problem in the context of \emph{arbitrary} communication graphs. As a result, we clarify the solvability of the uniform bipartition problem with arbitrary communication graphs when agents in the population have designated initial states, under various assumptions such as the existence of a base station, symmetry of the protocol, and fairness of the execution. When the problem is solvable, we present protocols for uniform bipartition. When global fairness is assumed, the space complexity of our solutions is tight.


Background
In this paper, we consider the population protocol model introduced by Angluin et al. [5].The population protocol model is an abstract model for low-performance devices.In the population protocol model, devices are represented as anonymous agents, and a population is represented as a set of agents.Those agents move passively (i.e., they cannot control their movements), and when two agents approach, they are able to communicate and update their states (this pairwise communication is called an interaction).A computation then consists of an infinite sequence of interactions.
Application domains for population protocols include sensor networks used to monitor live animals (each sensor is attached to a small animal and monitors e.g. its body temperature) that move unpredictably (hence, each sensor must handle passive mobility patterns).Another application domain is that of molecular robot networks [28].In such systems, a large number of molecular robots collectively work inside a human body to achieve goals such as transport of medicine.Since those robots are tiny, their movement is uncontrollable, and robots may only maintain extremely small memory.
In the population protocol model, many researchers have studied various fundamental problems such as leader election protocols [4] (A population protocol solves leader election if starting from an initially uniform population of agents, eventually a single agent outputs leader, while all others output non-leader ), counting [8,10,11] (The counting problem consists in counting how many agents participate to the protocol; As the agents' memory is typically constant, this number is output by a special agent that may maintain logarithmic size memory, the base station), majority [6] (The majority problem aims to decide which, if any, initial state in a population is a majority), k-partition [32,34,35] (The k-partition problem consists in dividing a population into k groups of equal size), etc.
In this paper, we focus on the uniform bipartition problem [33,34,35], whose goal is to divide a population into two stable groups of equal size (the difference is one if the population size is odd).To guarantee the stability of the group, each agent eventually belongs to a single group and never changes the group after that.Applications of the uniform bipartition include saving batteries in a sensor network by switching on only one group, or executing two tasks simultaneously by assigning one task to each group.Contrary to previous work that considered complete communication graphs [33,34,35], we consider the uniform bipartition problem over arbitrary graphs.In the population protocol model, most existing works consider the complete communication graph model (every pairwise interaction is feasible).However, realistic networks command studying incomplete communications graphs (where only a subset of pairwise interactions remains feasible) as low-performance devices and unpredictable movements may not yield a complete set of interactions.Moreover, in this paper, we assume the designated initial states (i.e., all agents share the same given initial state), and consider the problem under various assumptions such as the existence of a base station, symmetry of the protocol, and fairness of the execution.Although protocols with arbitrary initial states tolerate a transient fault, protocols with designated initial states can usually be designed using fewer states, and exhibit faster convergence times.Actually, it was shown in [34] that, with arbitrary initial states, constant-space protocols cannot be constructed in most cases even assuming complete graphs.

Related Works
The population protocol model was proposed by Angluin et al. [5], who were recently awarded the 2020 Edsger W. Dijkstra prize in Distributed Computing for their work.While the core of the initial study was dedicated to the computability of the model, subsequent works considered various problems (e.g., leader election, counting, majority, uniform k-partition) under different assumptions (e.g., existence of a base station, fairness, symmetry of protocols, and initial states of agents).
The leader election problem was studied from the perspective of time and space efficiency.Doty and Soloveichik [20] proved that Ω(n) expected parallel time is required to solve leader election with probability 1 if agents have a constant number of states.Relaxing the number of states to a polylogarithmic value, Alistarh and Gelashvili [3] proposed a leader election protocol in polylogarithmic expected stabilization time.Then, Gąsieniec et al. [23] designed a protocol with O(log log n) states and O(log n • log log n) expected time.Furthermore, the protocol of Gąsieniec et al. [23] is spaceoptimal for solving the problem in polylogarithmic time.In [29], Sudo et al. presented a leader election protocol with O(log n) states and O(log n) expected time.This protocol is time-optimal for solving the problem.Finally, Berenbrink et al. [15] proposed a time and space optimal protocol that solves the leader election problem with O(log log n) states and O(log n) expected time.In the case of arbitrary communication graphs, it turns out that self-stabilizing leader election is impossible [7] (a protocol is self-stabilizing if its correctness does not depend on its initial global state).This impossibility can be avoided if oracles are available [9,18] or if the self-stabilization requirement is relaxed: Sudo et al. [30] proposed a loosely stabilizing protocol for leader election (loose stabilization relates to the fact that correctness is only guaranteed for a very long expected amount of time).
The counting problem was introduced by Beauquier et al. [11] and popularized the concept of a base station.Space complexity was further reduced by follow-up works [10,24], until Aspnes et al. [8] finally proposed a time and space optimal protocol.On the other hand, by allowing the initialization of agents, the counting protocols without the base station were proposed for both exact counting [16] and approximate counting [1,16].In [1], Alistarh et [34] agents must keep their groups after convergence, they cannot exchange their states among different groups and thus the transformer proposed in [5] cannot directly apply to the uniform bipartition problem.Bournez et al. [17] proposed a transformer that transforms an asymmetric protocol into symmetric protocol by assuming additional states.In [17], only protocols with complete communication graphs were considered and the transformer works under global fairness.We use the same idea to construct a symmetric uniform bipartition protocol under global fairness without a base station.

Our Contributions
In this paper, we study the solvability of the uniform bipartition problem with designated initial states over arbitrary graphs.A summary of our results is presented in Table 2. Let us first observe that, as complete communication graphs are a special case of arbitrary communication graphs, the impossibility results by Yasumi et al. [34] remain valid in our setting.With a base station (be it initialized or non-initialized) under global fairness, we extend the three states protocol by Yasumi et al. [34] from complete communication graphs to arbitrary communication graphs.With a non-initialized base station under weak fairness, we propose a new symmetric protocol with 3P + 1 states, where P is a known upper bound of the number of agents.These results yield identical upper bounds for the easier cases of asymmetric protocols and/or initialized base station.In addition, we also show a condition of communication graphs in which the number of states in the protocol can be reduced from 3P + 1 to constant.Concretely, we show that the number of states in the protocol can be reduced to 3l + 1 if we assume communication graphs such that every cycle either includes the base station or its length is not a multiple of l, where l is a positive integer greater than three.On the other hand, with no base station under global fairness, we prove that four and five states are necessary and sufficient to solve uniform bipartition with asymmetric and symmetric protocols, respectively.In the same setting, in complete graphs, three and four states were necessary and sufficient.So, one additional state enables problem solvability in arbitrary communications graphs in this setting.With no base station under weak fairness, we prove that the problem cannot be solved, using a similar argument as in the impossibility result for leader election by Fischer and Jiang [21].Overall, we show the solvability of uniform bipartition in a variety of settings for a population of agents with designated initial states assuming arbitrary communication graphs.In cases where the problem remains feasible, we provide upper and lower bounds with respect to the number of states each agent maintains, and in all cases where global fairness can be assumed, our bounds are tight.

Population Protocol Model
A population whose communication graph is arbitrary is represented by an undirected connected graph G = (V, E), where V is a set of agents, and E ⊆ V × V is a set of edges that represent the possibility of an interaction between two agents.That is, two agents u ∈ V and v ∈ V can interact only if (u, v) ∈ E holds.A protocol P = (Q, δ) consists of Q and δ, where Q is a set of possible states for agents, and δ is a set of transitions from Q × Q to Q × Q.Each transition in δ is denoted by (p, q) → (p , q ), which means that, when an interaction between an agent x in state p and an agent y in state q occurs, their states become p and q , respectively.Moreover, we say x is an initiator and y is a responder.When x and y interact as an initiator and a responder, respectively, we simply say that x interacts with y.Transition (p, q) → (p , q ) is null if both p = p and q = q hold.We omit null transitions in the descriptions of protocols.Protocol P = (Q, δ) is symmetric if, for every transition (p, q) → (p , q ) in δ, (q, p) → (q , p ) exists in δ.In particular, if a protocol P = (Q, δ) is symmetric and transition (p, p) → (p , q ) exists in δ, p = q holds.If a protocol is not symmetric, the protocol is asymmetric.Protocol P = (Q, δ) is deterministic if, for any pair of states (p, q) ∈ Q × Q, exactly one transition (p, q) → (p , q ) exists in δ.We consider only deterministic protocols in this paper.A global state of a population is called a configuration, defined as a vector of (local) states of all agents.A state of agent a in configuration C, is denoted by s(a, C).Moreover, when C is clear from the context, we simply use s(a) to denote the state of agent a.A transition between two configurations C and C is described as C → C , and means that configuration C is obtained from C by a single interaction between two agents.For two configurations C and C , if there exists a sequence of configurations An execution Ξ is weakly-fair if, for each pair of agents (v, v ) ∈ E, v (resp.v ) interacts with v (resp., v) infinitely often1 .An execution Ξ is globally fair if, for every pair of configurations C and C such that C → C , C occurs infinitely often when C occurs infinitely often.Intuitively, global fairness guarantees that, if configuration C occurs infinitely often, then every possible interaction in C also occurs infinitely often.Then, if C occurs infinitely often, C satisfying C → C occurs infinitely often, we can deduce that C satisfying C → C also occurs infinitely often.Overall, with global fairness, if a configuration C occurs infinitely often, then every configuration C * reachable from C also occurs infinitely often.
In this paper, we consider three possibilities for the base station: initialized base station, noninitialized base station, and no base station.In the model with a base station, we assume that a single agent, called a base station, exists in V .Then, V can be partitioned into V b , the singleton set containing the base station, and V p , the set of agents except for the base station.The base station can be distinguished from other agents in V , although agents in V p cannot be distinguished.Then, the state set Q can be partitioned into a state set Q b for the base station, and a state set Q p for agents in V p .The base station has unlimited resources (with respect to the number of states), in contrast with other resource-limited agents (that are allowed only a limited number of states).So, when we evaluate the space complexity of a protocol, we focus on the number of states |Q p | for agents in V p and do not consider the number of states |Q b | that are allocated to the base station.In the sequel, we thus say a protocol uses x states if |Q p | = x holds.When we assume an initialized base station, the base station has a designated initial state.When we assume a non-initialized base station, the base station has an arbitrary initial state (in Q b ), although agents in V p have the same designated initial state.When we assume no base station, there exists no base station and thus V = V p holds.For simplicity, we use agents only to refer to agents in V p in the following sections.To refer to the base station, we always use the term base station (not an agent).In the initial configuration, both the base station and the agents are not aware of the number of agents, yet they are given an upper bound P of the number of agents.However, in protocols except for a protocol in Section 3.2, we assume that they are not given P .

Uniform Bipartition Problem
Let f : Q p → {red, blue} be a function that maps a state of an agent to red or blue.We define the color of an agent a as f (s(a)).Then, we say that agent a is red (resp., blue) if f (s(a)) = red (resp., f (s(a)) = blue) holds.If an agent a has state s such that f (s) = red (resp., f (s) = blue), we call a a red agent (resp., a blue agent).For some population V , the number of red agents (resp., blue agents) in V is denoted by #red(V ) (resp., #blue(V )).When V is clear from the context, we simply write #red and #blue.
A configuration C is stable with respect to the uniform bipartition if there exists a partition {H r , H b } of V p that satisfies the following conditions: An execution Ξ = C 0 , C 1 , C 2 , . . .solves the uniform bipartition problem if Ξ includes a configuration C t that is stable for uniform bipartition.Finally, a protocol P solves the uniform bipartition problem if every possible execution Ξ of protocol P solves the uniform bipartition problem.

Upper Bounds with Non-initialized Base Station
In this section, we prove some upper bounds on the number of states that are required to solve the uniform bipartition problem over arbitrary graphs with designated initial states and a non-initialized base station.More concretely, with global fairness, we propose a symmetric protocol with three states by extending the protocol by Yasumi et al. [34] from a complete communication graph to an arbitrary communication graph.In the case of weak fairness, we present a symmetric protocol with 3P + 1 states, where P is a known upper bound of the number of agents.

Upper Bound for Symmetric Protocols under Global Fairness
The state set of agents in this protocol is Q p = {initial, red, blue}, and we assume that f (initial) = f (red) = red and f (blue) = blue hold.The designated initial state of agents is initial.The idea of the protocol is as follows: the base station assigns red and blue to agents whose state is initial alternately.As the base station cannot meet every agent (the communication graph is arbitrary), the positions of state initial are moved throughout the communication graph using transitions.
Thus, if an agent with initial state exists somewhere in the network, the base station has infinitely many chances to interact with a neighboring agent with initial state.This implies that the base station is able to repeatedly assign red and blue to neighboring agents with initial state unless no agent anywhere in the network has initial state.Since the base station assigns red and blue alternately, the uniform bipartition is completed after no agent has initial state.
To make red and blue alternately, the base station has a state set Q b = {b red , b blue }.Using its current state, the base station decides which color to use for the next interaction with a neighboring agent with initial state.Now, to move the position of an initial state in the communication graph, if an agent with initial state and an agent with red (or blue) state interact, they exchange their states.This implies that eventually an agent adjacent to the base station has initial state and then the agent and the base station interact (global fairness guarantees that such interaction eventually happens).Transition rules of the protocol are the following (for each transition rule (p, q) → (p , q ), transition rule (q, p) → (q , p ) exists, but we omit the description).From these transition rules, the protocol converges when no agent has initial state (indeed, no interaction is defined when no agent has initial state).
We now prove the correctness of the protocol.
Theorem 1.In the population protocol model with a non-initialized base station, there exists a symmetric protocol with three states per agent that solves the uniform bipartition problem with designated initial states assuming global fairness in arbitrary communication graphs.
Proof.Recall that #red (resp., #blue) denotes the number of agents in state s such that f (s) = red (resp., f (s) = blue) holds, thus initially #red = n and #blue = 0 hold.We show that eventually |#red − #blue| ≤ 1 holds and no agent ever changes its state afterwards.the base station and a neighboring agent with initial state eventually interact.Thus, transition rules 1 and 2 occur repeatedly unless no agent has initial.After all agents have red or blue state, no agent ever changes its color.Recall that agents are assigned red and blue alternately and thus |#red − #blue| ≤ 1 holds after those assignments.Moreover, the arguments do not depend on the initial state of the base station, and the proposed protocol is symmetric.Therefore, the theorem holds.
Note that, under weak fairness, this protocol does not solve the uniform bipartition problem.This is because we can construct a weakly-fair execution of this protocol such that some agents keep Algorithm 1 Uniform bipartition protocol with 3P + 1 states Variables at the base station: RB ∈ {r, b}: The state that the base station assigns next Variables at an agent x: color x ∈ {ini, r, b}: Color of the agent, initialized to ini depth x ∈ {⊥, 1, 2, 3, . . ., P }: Depth of agent x in a tree rooted at the base station, initialized to ⊥ 1: when an agent x and the base station interact do 2: if color x = ini and depth x = 1 then 3: end if 9: end when 10: when two agents x and y interact do 11: if depth y = ⊥ and depth x = ⊥ then 12: else if depth x = ⊥ and depth y = ⊥ then 14: if depth x < depth y and color y = ini then initial state infinitely often.For example, we can make an agent keep initial by constructing an execution in the following way.
• If the agent (in initial) interacts with an agent in red or blue, the next interaction occurs between the same pair of agents.

A protocol over arbitrary graphs
We obtain a symmetric protocol under the assumption by using a similar idea of the transformer proposed in [17].The transformer simulates an asymmetric protocol on a symmetric protocol.To do this, the transformer requires additional states.Moreover, the transformer works with complete communication graphs.We show that one additional state is sufficient to transform the asymmetric uniform bipartition protocol into the symmetric protocol even if we assume arbitrary graphs.
In this protocol, every agent x has variables color x and depth x .Variable color x represents the color of agent x.That is, for an agent x, if color x = ini or color x = r holds, f (s(x)) = red holds.On the other hand, if color x = b holds, f (s(x)) = blue holds.The protocol is given in Algorithm 1.Note that this algorithm does not care an initiator and a responder.
The basic strategy of the protocol is the following.
1. Create a spanning tree rooted at the base station.Concretely, agent x assigns its depth in a tree rooted at the base station into variable depth x .Variable depth x is initialized to ⊥.
Variable depth x obtains the depth of x in the spanning tree as follows: If the base station and an agent p with depth p = ⊥ interact, depth p becomes 1.If an agent q with depth q = ⊥ and an agent p with depth p = ⊥ interact, depth p becomes depth q + 1.By these behaviors, for any agent x, eventually variable depth x has a depth of x in a tree rooted at the base station.
2. Using the spanning tree, carry the initial color ini toward the base station and make the base station assign r and b to agents one by one.Concretely, if agents x and y interact and both depth y < depth x and color x = ini hold, x and y exchange their colors (i.e., ini is carried from x to y).Hence, since ini is always carried to a smaller depth, eventually an agent z with depth z = 1 obtains ini.After that, the base station and the agent z interact and the base station assigns r or b to z.Note that, if the base station assigns r (resp., b), the base station assigns b (resp., r) next.
Then, for any agent v, eventually color v = ini holds.Hence, there exist n/2 red (resp., blue) agents, and n/2 blue (resp., red) agents if variable RB in the base station has r (resp., b) as an initial value.Therefore, the protocol solves the uniform bipartition problem.
From now on, we demonstrate the correctness of the protocol.Let #ini = |{x|color x = ini}|, #r = |{x|color x = r}|, and #b = |{x|color x = b}|.First, we show that #r, #b, and #ini do not change except for an interaction between the base station and an agent with a specific state.
Lemma 2. For any weakly-fair execution of Algorithm 1, unless an interaction occurs between the base station and an agent v such that depth v = 1 and color v = ini hold, #r, #b, and #ini do not change.
Proof.For each interaction occurring in a weakly-fair execution of the protocol, we consider two cases.
First, we consider the case that the base station does not participate to the interaction.From the protocol, when agents interact, the color of agents may only change in lines 17-18 or 21-22 of the pseudocode.On lines 17-18 and 21-22, two agents x and y just exchange color x and color y .Thus, #r, #b, and #ini do not change in this case.
Next, we consider the case that the base station participates the interaction.In the case, from the protocol, variable color changes only if the base station interacts with an agent v such that depth v = 1 and color v = ini hold.Thus, the lemma holds.
We now show three basic properties of variable depth.Lemma 3.For any agent v, when depth v = ⊥ holds in a configuration, depth v does not change afterwards.
Proof.From the protocol, variable depth v of agent v changes only in line 7, 12, or 14 of the pseudocode.On lines 7, 12, and 14, depth v changes only if depth v = ⊥ holds.Thus, the lemma holds.
Lemma 4. For any agent v, depth v = ⊥ holds after some configuration in any weakly-fair execution of Algorithm 1.
Proof.By the weak fairness assumption, for any agent v 0 adjacent to the base station, eventually v 0 and the base station interact.By lines 6-7 of the pseudocode, depth v 0 = ⊥ holds after the interaction with the base station occurs.From Lemma 3, for any agent v, once depth v = ⊥ holds, depth v = ⊥ holds perpetually.Hence, if agent v with depth v = ⊥ is adjacent to v with depth v = ⊥, eventually agents v and v interact by the weak fairness assumption, and after the interaction occurs, depth v = ⊥ holds.This implies that, for any agent v, eventually depth v = ⊥ holds.
Lemma 5.For any agent v 1 , when Proof.We focus on interactions such that an agent v assigns a value other than ⊥ to depth v .By Lemmas 3 and 4, the number of such interactions for a given agent is exactly one.We consider two cases.
First, we consider the case when depth v becomes one by the interaction.From the protocol, depth v can become one only if the base station and v interact.Hence, v is adjacent to the base station.
Next, we consider the case that depth v becomes neither ⊥ nor one by the interaction.From the protocol, if the interaction happens between v and an agent w, depth v becomes depth w + 1 by the interaction.By Lemma 3, depth w and depth v never change afterward.Thus, the lemma holds.
From the above lemmas, we show that eventually #ini = 0 holds in any weakly-fair execution of the protocol.Lemma 6.For any weakly-fair execution of Algorithm 1, #ini = 0 holds after finite time.
Proof.For the purpose of contradiction, let us assume that, after some configuration C, #ini > 0 never decreases.Let us consider a configuration C such that depth v = ⊥ holds for any agent v in C , and C appears after C. By Lemma 4, such C exists.In C , let Ini = {x|color x = ini}, and let v 1 ∈ Ini be an agent such that depth v 1 = min{depth x |x ∈ Ini} holds.By Lemma 5, either v 1 is adjacent to an agent v 2 such that depth First, we consider the case when depth v 1 = 1 holds.By Lemma 5, v 1 is adjacent to the base station.Since depth v 1 = 1 holds, there is not an agent v 2 such that depth v 2 < depth v 1 holds.Hence, from the protocol, color v 1 keeps ini unless v 1 and the base station interact.Thus, eventually v 1 with color v 1 = ini and the base station interact.Then, #ini decreases in this case.
Next, we consider the case that v 1 is adjacent to an agent v 2 such that depth v 2 = depth v 1 − 1.From the protocol, since depth v 1 = 1 holds, color v 1 keeps ini unless an interaction happens between v 1 and an agent v 2 such that depth v 2 < depth v 1 holds.From the weak fairness, eventually v 1 and such v 2 interact and color v 2 becomes ini.At that time, the smallest depth of agents with color ini decreases.By repeating this behavior similarly, eventually some agent v h with depth v h = 1 obtains color ini.After that, v h and the base station interact and #ini decreases.This is a contradiction.
Next, we prove that |#r − #b| ≤ 1 holds in any weakly-fair execution of the protocol.Proof.Consider an execution Ξ = C 0 , C 1 , . . . of the protocol.We prove the lemma by induction on the index of a configuration.In the base case (C 0 ), #r = #b = 0 and RB = r hold and thus alternative (ii) of the lemma holds immediately.
For the induction step, assume that there exists an integer i ≥ 0 such that the lemma holds in C i .Consider an interaction at C i → C i+1 .We consider two cases.
First, we consider the case where, for an agent v such that depth v = 1 and color v = ini hold, the base station and v do not interact.By Lemma 2, when the base station and such v do not interact, #r, #b, and #ini do not change.Moreover, from the protocol, RB does not change at the interaction, and thus either alternatives (i) of (ii) of the lemma holds in this case.
Next, we consider the case where, for an agent v such that depth v = 1 and color v = ini hold, the base station and v interact.Thus, the lemma holds.
Using Lemmas 6 and 7, we show that the protocol solves the uniform bipartition problem.
Theorem 8. Algorithm 1 solves the uniform bipartition problem.That is, there exists a protocol with 3P + 1 states and designated initial states that solves the uniform bipartition problem under weak fairness assuming arbitrary communication graphs with a non-initialized base station.
Proof.By Lemmas 6 and 7, |#r − #b| ≤ 1 holds in any weakly-fair execution of the protocol and eventually #ini = 0 holds in the execution.Moreover, from the protocol, when there exists no agent v such that color v = ini, any agent x does not change its color x .Thus, the protocol solves the problem.Additionally, the protocol works with 2P + (P + 1) states.This is because, if depth x = ⊥ holds, color x = ini holds.That is, depth x takes ⊥, 1, 2, . .., P for ini, and takes 1, 2, . .., P for r and b.Therefore, the theorem holds.

A protocol with constant states over a restricted class of graphs
In this subsection, we show that the space complexity of Algorithm 1 can be reduced to constant for communication graphs such that every cycle either includes the base station or its length is not a multiple of l, where l is a positive integer at least three.We modify Algorithm 1 as follows.Each agent maintains the distance from the base station by computing modulo l plus 1.That is, we change lines 12 and 14 in Algorithm 1 to depth x ← depth y mod l + 1 and depth y ← depth x mod l + 1, respectively.Now depth x ∈ {⊥, 1, 2, 3, . .., l} holds for any agent x.Then we redefine the relation depth x < depth y in lines 16 and 20 as follows: depth x < depth y holds if and only if either We can easily observe that these modifications do not change the essence of Algorithm1.For two agents x and y, we say x < y if depth x < depth y holds.Each agent x eventually assigns a depth of x modulo l plus 1 to depth x , and at that time there exists a path x 0 , x 1 , . . ., x h such that Algorithm 2 Uniform bipartition protocol with four states x 0 is a neighbor of the base station, x = x h holds, and x i < x i+1 holds for any 0 ≤ i < h.In addition, there exists no cycle x 0 , x 1 , . . ., x h = x 0 such that x i < x i+1 holds for any 0 ≤ i < h.This is because, from the definition of relation '<', the length of such a cycle should be a multiple of l, but we assume that underlying communication graphs do not include a cycle of agents in V p whose length is a multiple of l.Hence, similarly to Algorithm 1, we can carry the initial color ini toward the base station and make the base station assign r and b to agents one by one.
Corollary 9.There exists a protocol with 3l + 1 states and designated initial states that solves the uniform bipartition problem under weak fairness assuming arbitrary communication graphs with a non-initialized base station if, for any cycle of the communication graphs, it either includes the base station or its length is not a multiple of l, where l is a positive integer at least three.

Upper and Lower Bounds with No Base Station
In this section, we show upper and lower bounds of the number of states to solve the uniform bipartition problem with no base station and designated initial states over arbitrary communication graphs.Concretely, under global fairness, we prove that the minimum number of states for asymmetric protocols is four, and the minimum number of states for symmetric protocols is five.
Under weak fairness, we prove that the uniform bipartition problem cannot be solved without a base station using proof techniques similar to those Fischer and Jiang [21] used to show the impossibility of leader election.

Upper Bound for Asymmetric Protocols under Global Fairness
In this subsection, over arbitrary graphs with designated initial states and no base station under global fairness, we give an asymmetric protocol with four states.We define a state set of agents as Q = {r ω , b ω , r, b} , and function f as follows: We say an agent has a token if its state is r ω or b ω .Initially, every agent has state r ω , that is, every agent is red and has a token.The transition rules are given in Algorithm 2 (for each transition rule (p, q) → (p , q ), transition rule (q, p) → (q , p ) exists, but we omit the description except for transition rule 1).
The basic strategy of the protocol is as follows.When two agents with tokens interact and one of them is red, a red agent transitions to blue and the two tokens are deleted (transition rules 1 and 2).Since n tokens exist initially and the number of tokens decreases by two in an interaction, n/2 blue agents appear and n/2 red agents remain after all tokens (except one token for the case of odd n) disappear.To make such interactions, the protocol moves a token when agents with and without a token interact (transition rules 3, 4, 5, and 6).Global fairness guarantees that, if two tokens exist, an interaction of transition rule 1 or 2 happens eventually.Therefore, the uniform bipartition is achieved by the protocol.
From now, we prove the correctness of the protocol.We define #r, #b, #r ω , #b ω as the number of agents that have state r, b, r ω , b ω , respectively.Let #red = #r + #r ω and #blue = #b + #b ω be the number of red and blue agents, respectively.Let #token = #r ω + #b ω be the number of agents with tokens.Proof.Consider an execution Ξ = C 0 , C 1 , . . . of the protocol.We prove the equation by induction on the index of a configuration.The base case is the case of C 0 .In this case, the equation holds because all agents have r ω initially.For the induction step, assume that the equation holds in C i (0 ≤ i).Consider an interaction at C i → C i+1 for each transition rule.Proof.First of all, there is no transition rule that increases #token.This implies that, if #token ≤ 1 holds at some configuration, #token ≤ 1 holds thereafter.Hence, for the purpose of contradiction, we assume that there exists a globally-fair execution Ξ of the protocol where #token = x > 1 continuously holds after some configuration.Consider a configuration C that occurs infinitely often in Ξ.Note that C is stable and satisfies #token = x.Consider two agents a 1 and a 2 such that a 1 is adjacent to a 2 and one of them is red in C.
Since tokens can move through a graph by swapping states (transition rules 3,4,5, and 6), a configuration C such that a 1 and a 2 have a token is reachable from C. When a 1 and a 2 interact at C → C , #token = x − 2 holds in C .From the global fairness assumption, since C occurs infinitely often in Ξ, C also occurs infinitely often.Since #token = x continuously holds after some configuration, this is a contradiction.Next, by using these lemmas, we show that Algorithm 2 solves the problem under the assumptions.
Theorem 12. Algorithm 2 solves the uniform bipartition problem.That is, there exists a protocol with four states and designated initial states that solves the uniform bipartition problem under global fairness over arbitrary communication graphs.
Proof.Since #token is reduced only by transition rules 1 and 2, #token is reduced by two in an interaction.This implies that, by Lemma 11, when n is even (resp., odd), #token = 0 (resp., #token = 1) holds after some configuration C.

Upper Bound for Symmetric Protocols under Global Fairness
In this subsection, with arbitrary communication graphs with designated initial states and no base station under global fairness, we give a symmetric protocol with five states.
Observe that, with designated initial states and no base station, clearly no symmetric protocol can solve the problem if the number of agents n is two (the state of the two agents is the same in the initial state, so symmetry is never broken and uniform bipartition cannot occur).Thus, we assume that 3 ≤ n holds.
We define a state set of agents as Q = {r ω 0 , r ω 1 , b ω , r, b} , and function f as follows: We say an agent has a token if its state is r ω 0 , r ω 1 , or b ω .Initially, every agent has state r ω 0 , that is, every agent is red and has a token.The transition rules are given in Algorithm 3.
The idea of Algorithm 3 is similar to Algorithm 2. That is, when two agents with tokens interact and one of them is red, a red agent transitions to blue, and the two tokens are deleted.Then, eventually n/2 blue agents appear and n/2 red agents remain after all tokens (except one token for the case of odd n) disappear.However, to make a red agent transition to a blue agent in the first place, Algorithm 2 includes transition rule 1 that makes agents with the same states transition to different states.This implies that Algorithm 2 is not symmetric.Hence, by borrowing the technique proposed in [17], we improve Algorithm 2 so that the new protocol (Algorithm 3) makes a red agent transition to a blue agent without such a transition (and two tokens are deleted at that time).Concretely, we realize it as follows.In Algorithm 3, there are two states r ω 0 and r ω 1 that are red and have a token.When two agents with r ω 0 interact, they transition to r ω 1 , and vice versa (transition rules 1 and 2).Thus, under global fairness, eventually an agent with r ω 0 interacts with an agent with r ω 1 and then one of them transitions to blue, and two tokens are deleted (transition rule 3).Observe that, these transitions do not affect the essence of Algorithm 2. This is because the numbers of blue agents, red agents, and tokens do not change after transition rules 1 and 2, and a red agent transitions to blue, and two tokens are deleted at transition rule 3.

Algorithm 3 Uniform bipartition protocol with five states
We now prove the correctness of Algorithm 3 along the proof in subsection 4.1.We define #r, #b, #r ω 0 , #r ω 1 , #b ω as the number of agents that have state r, b, r ω 0 , #r ω 1 , b ω , respectively.Let #red = #r + #r ω 0 + #r ω 1 and #blue = #b + #b ω be the number of red and blue agents, respectively.Let #token = #r ω 0 + #r ω 1 + #b ω be the number of agents with tokens.Recall that a mechanism of symmetry breaking (transition rules 1, 2, and 3) does not affect the essence of Algorithm 2. In particular, if r ω 0 = r ω 1 (= r ω ) holds, Algorithm 3 is equal to Algorithm 2. Thus, since an equation of Lemma 10 holds in any configuration of any execution of Algorithm 3 and #r ω is not related to the equation, the following corollary holds.Moreover, we show the following lemma similarly to Lemma 11.Lemma 14.For any globally-fair execution of Algorithm 3, #token ≤ 1 holds after some configuration.
Proof.First of all, there is no transition rule that increase #token.This implies that, if #token ≤ 1 holds at some configuration, #token ≤ 1 holds thereafter.Hence, for the purpose of contradiction, we assume that there exists a globally-fair execution Ξ of Algorithm 3 where #token = x > 1 continuously holds after some configuration.
Consider a configuration C that occurs infinitely often in Ξ.Note that C is stable and satisfies #token = x.First, we show that at least one blue agent occurs from the initial configuration.When n = #r ω 0 + #r ω 1 holds, only transition rules 1, 2, and 3 can occur.From the global fairness assumption, an agent with r ω 0 is adjacent to agent with r ω 1 at the same time and then they interact.By the interaction, transition rule 3 happens and thus one blue agent appears.
Since there is no transition rule that decreases the number of blue agents, at least one blue agent exists after some configuration of Ξ.Moreover, by Corollary 13, if there exists blue agent, there also exists red agent.Hence, in C, there exist at least one blue agent and at least one red agent.Consider two agents a 1 and a 2 such that a 1 is adjacent to a 2 and a 1 (resp., a 2 ) is red (resp., blue) in C.
Since tokens can move through a graph by swapping states (transition rules 4, 5, 6, 7, 8, and 9), a configuration C such that a 1 and a 2 have a token is reachable from C. When a 1 and a 2 interact at C → C , #token = x − 2 holds in C .From the global fairness assumption, since C occurs infinitely often in Ξ, C also occurs infinitely often.Since #token = x continuously holds after some configuration, this is a contradiction.Finally, we show, similarly to Theorem 12, that Algorithm 3 solves the uniform bipartition problem.
Theorem 15.Algorithm 3 solves the uniform bipartition problem.That is, there exists a symmetric protocol with five states and designated initial states that solves the uniform bipartition problem under global fairness with arbitrary communication graphs.
Proof.Since #token is reduced only in transition rules 3, 10, and 11, #token is reduced by two in an interaction.This implies that, by Lemma 14, when n is even (resp., odd), #token = 0 (resp., #token = 1) holds after some configuration C.

Lower Bound for Asymmetric Protocols under Global Fairness
In this section, we show that, over arbitrary graphs with designated initial states and no base station under global fairness, there exists no asymmetric protocol with three states.
To prove this, we first show that, when the number of agents n is odd and no more than P/2, each agent changes its own state to another state infinitely often in any globally-fair execution Ξ of a uniform bipartition protocol Alg, where P is a known upper bound of the number of agents.This proposition holds regardless of the number of states in a protocol.
After that, we prove impossibility of an asymmetric protocol with three states.The outline of the proof is as follows.For the purpose of contradiction, we assume that there exists a protocol Alg that solves the problem with three states.From the above proposition, in any globally-fair execution, some agents change their state infinitely often.Now, with three states, the number of red or blue states is at least one and thus, if we assume without loss of generality that the number of blue states is one, agents with the blue state change their color eventually.This is a contradiction.
From now on, we show that, in any globally-fair execution Ξ of a protocol Alg solving uniform bipartition over an arbitrary communication graph such that the number of agents n < P/2 is odd, all agents transition their own state to another state infinitely often.V, E) such that the number of agents n is odd and no more than P/2.In any globally-fair execution Ξ = C 0 , C 1 , . . . of Alg over G, each agent changes its state infinitely often.
Proof.The outline of the proof is as follows.First, for the purpose of contradiction, we assume that there exists an agent v α that never changes its state after some stable configuration C h in a globally-fair execution Ξ over graph G. Let s α be a state that v α has after C h .Let v β ∈ V be agent adjacent to v α and S β be a set of states that v β has after C h .Since the number of states is finite, there exists a stable configuration C t that occurs infinitely often after C h .Next, let , E ) by connecting G 1 and G 2 with an additional edge (v α , v n+β ).Over G , we consider an execution Ξ such that, agents in G 1 and G 2 behave similarly to Ξ until C t occurs in G 1 and G 2 , and then make interactions so that Ξ satisfies global fairness.Since Ξ is globally fair, we can show the following facts after G 1 and G 2 reach C t in Ξ .
• v α has state s α as long as v n+β has a state in S β .
• v n+β has a state in S β as long as v α has state s α .
From these facts, in Ξ , v α continues to have state s α and v n+β continues to have a state in S β .Hence, in Ξ , each agent in V 1 cannot notice the existence of agents in V 2 , and vice versa.This implies that, in stable configurations, #red( From now on, we show the details of the proof. Assume, for the purpose of contradiction, that there exists v α that does not change its state after some stable configuration C h in globally-fair execution Ξ.Let s α be a state that v α has after C h .Since the number of states is finite, in Ξ, there exists a stable configuration C t that appears infinitely often after C h .Without loss of generality, #red(V ) − #blue(V ) = 1 holds after C h .Let v β be an agent that is adjacent to v α .
Next, consider a communication graph G = (V , E ) that satisfies the following.
An example (n = 5) of G and G is shown in Figure 1.Consider a globally-fair execution Ξ = C 0 , C 1 , C 2 , C 3 , . . .over G as follows: • For i ≤ t, when v x interacts with v y at C i → C i+1 , v x interacts with v y at C 2i → C 2i+1 , and v x+n interacts with v y+n at C 2i+1 → C 2i+2 .
• After C 2t , agents make interactions so that Ξ satisfies global fairness.
In the following, for configuration C in Ξ and configuration C in Ξ, we say From now on, by induction on the index of configuration, we prove the proposition that, for any configuration C m that occurs after C 2t , there is a configuration C a (resp., C b ) such that 1) The base case is C m = C 2t .Since C t appears infinitely often in Ξ and C 2t of V 1 and V 2 is equivalent to C , the base case holds.
For the induction step, assume that, for C m (m ≥ 2t), there is a configuration C a (resp., C b ) that satisfies the conditions.We consider two cases for an interaction at C m → C m+1 .The first case considers an interaction of v α and v n+β , and the second case considers other interactions.
First, we consider the case that v α and v n+β interact at C m → C m+1 .By the assumption, we have Hence, since v α does not change its state even when it interacts with v β at C b , a transition rule (s(v β , C b ), s α ) → (s, s α ) exists, where s is some state.This implies that, when v α and v β+n interact at C m , v α keeps the state s α .Thus, occurs infinitely often in Ξ and Ξ is globally fair, C b occurs infinitely often in Ξ.Thus, the proposition holds for C m+1 .
Next, we consider the case that at least one agent other than v α and v n+β joins an interaction at C m → C m+1 .By the definition, no edge other than In the former case, letting C a be the configuration immediately after v i and v j interact at C a , C m+1 of V 1 is equivalent to C a and C m+1 of V 2 is still equivalent to C b .In the latter case, letting C b be the configuration immediately after v i−n and v j−n interact at C b , C m+1 of V 1 is still equivalent to C a and C m+1 of V 2 is equivalent to C b .Since C a and C b occur infinitely often in Ξ and Ξ is globally fair, such C a and C b occurs infinitely often in Ξ and thus the proposition holds in the case.
Since #red(V ) From now, by using Lemma 16, we show the theorem.Theorem 17.There exists no uniform bipartition protocol with three states and designated initial states over arbitrary communication graphs assuming global fairness.
Proof.For the purpose of contradiction, we assume that such a protocol Alg exists.
Let S = {s 1 , s 2 , s 3 } be a state set of agents.Without loss of generality, f (s 1 ) = f (s 2 ) = red and f (s 3 ) = blue hold.Consider a globally-fair execution Ξ of Alg over graph G such that the number of agents is odd and no more than P/2.By Lemma 16, after some stable configuration C t in Ξ, each agent changes its state infinitely often.This implies that each agent with s 3 transitions to s 1 or s 2 after C t .That is, each blue agent transitions to red state after C t .Since C t is stable, this is a contradiction.

Lower Bound for Symmetric Protocols under Global Fairness
In this section, we show that, with arbitrary communication graphs, designated initial states, and no base station assuming global fairness, there exists no symmetric protocol with four states.Recall that, with designated initial states and no base station, clearly any symmetric protocol never solves the problem if the number of agents n is two.Thus, we assume that 3 ≤ n ≤ P holds, where P is a known upper bound of the number of agents.Note that the symmetric protocol proposed in subsection 4.2 solves the problem for 3 ≤ n ≤ P .
In this subsection, we newly define q sym q as follow: • For states q and q , we q sym q if there exists a sequence of states q = q 0 , q 1 , • • • , q k = q such that, for any i(0 ≤ i < k), transition rule (q i , q i ) → (q i+1 , q i+1 ) exists.
Moreover, we say two agents are homonyms if they have the same state.Intuitively, q sym q means that an agent in state q can transition to q by only interactions with homonyms.
Theorem 18.There exists no symmetric protocol for the uniform bipartition with four states and designated initial states over arbitrary graph assuming global fairness when P is twelve or more.
For the purpose of contradiction, suppose that there exists such a protocol Alg.Let R (resp., B) be a state set such that, for any s ∈ R (resp., s ∈ B), f (s) = red (resp., f (s ) = blue) holds.First, we show that the following lemma holds from Lemma 16.Consider a globally-fair execution Ξ = C 0 , C 1 , C 2 , . . . of Alg with a communication graph G such that the number of agents n is three.From Lemma 16, after some stable configuration C t in Ξ, each agent transitions its own state to another state infinitely often.Hence, after C t , some agent with r transitions to some blue state.Since C t is stable, this is a contradiction.
Let ini r and r (resp., ini b and b) be states belonging to R (resp., B).In addition, without loss of generality, assume that ini r is the initial state of agents.
From the property of symmetry, the following lemma holds.
Proof.For the purpose of contradiction, suppose that p i = p i+1 holds for some i.Consider a complete communication graph G = (V, E) such that the number of agents n is four, where Consider a globally-fair execution Ξ as follows: • v 1 (resp., v 3 ) interacts with v 2 (resp., v 4 ) i times.
• After that, make interactions so that Ξ satisfies global fairness.
Since the initial state of agents is ini r , all agents have p i after the i interactions.By the assumption, since (p i , p i ) → (p i , p i ) holds, every agent keeps state p i after that.Hence, Ξ cannot reach a stable configuration.Since Ξ is globally fair, this is a contradiction.

Additionally, we can extend Lemma 20 as follow:
Lemma 21.There exists some s b ∈ B such that (ini r , ini r ) → (s b , s b ) and (s b , s b ) → (ini r , ini r ) hold.
Proof.Consider a globally-fair execution Ξ = C 0 , C 1 , C 2 , . . . of Alg with a complete communication graph G such that the number of agents n is six.First, consider a state q such that there are two or more agents with q in a stable configuration C t of Ξ. Observe that, for any state q such that q sym q holds, f (q) = f (q ) holds.This is because, if such equation does not hold, it contradicts the definition of the stable configuration (i.e., it contradicts the fact that each agent cannot change its own color after a stable configuration).Using this fact, we show that the lemma holds.
Since the number of states is four and Lemma 20 holds, there are three possible symmetric transition sequences starting from ini r as follows: 1.For distinct states ini r , p 1 , p 2 , and p 3 , there exists a transition sequence (ini r , ini r ) → (p We consider cases of p = p 3 , p = p 2 , and p = p 1 .In the case of p = p 3 , f (p 1 ) = f (p 2 ) = blue holds.By the transition sequence 1, p can transition to p 2 by only interactions with homonyms.By the definition of stable configurations, since f (p) = f (p 2 ) holds, this case does not hold.In the case of p = p 2 , f (p 1 ) = f (p 3 ) = blue holds.By the transition sequence 1, p can transition to p 3 by only interactions with homonyms.By the definition of stable configurations, since f (p) = f (p 3 ) holds, this case does not hold.In the case of p = p 1 , f (p 2 ) = f (p 3 ) = blue holds.By the transition sequence 1, p can transition to p 2 by only interactions with homonyms.By the definition of stable configurations, since f (p) = f (p 2 ) holds, this case does not hold.Thus, the transition sequence 1 does not hold.Case 2: Assume, for the purpose of contradiction, that the transition sequence 2 holds.We show that 1) f (p 1 ) = f (p 2 ) = blue holds and 2) y = p 1 holds.After that, from these facts, we show that 3) the transition sequence 2 does not hold.
First we show 1) f (p 1 ) = f (p 2 ) = blue holds.Assume, for the purpose of contradiction, that either p 1 or p 2 is a red state and the other is a blue state (since ini r is red state, either p 1 or p 2 is blue state).In this case, since ini r can transition to blue state by only interactions with homonyms, there exist at most one agent with ini r in C t of Ξ.Hence, in C t , there exists two red agents with p 1 or p 2 .By the transition sequence 2, p 1 (resp., p 2 ) can transition to p 2 (resp., p 1 ) by only interactions with homonyms.Since f (p 1 ) = f (p 2 ) holds, this contradicts the definition of stable configuration.
Next, we show 2) y = p 1 holds.For the purpose of contradiction, assume that y = ini r holds.In this case, p 1 and p 2 can transition to ini r by only interactions with homonyms.In addition, f (ini r ) = red holds.From 1) f (p 1 ) = f (p 2 ) = blue, since #blue is three in a stable configuration C t of Ξ, there exist two agents with p 1 or p 2 .These facts contradict the definition of stable configuration.
• After that, make interactions so that Ξ satisfies global fairness.
After the first item, all agents have p 1 .Hence, from 1) f (p 1 ) = f (p 2 ) = blue and 2) y = p 1 (i.e., (p 1 , p In addition, since (ini r , p 1 ) → (s b1 , s b2 ) exists, some agent can change its color from C t .Since C t is stable, this is a contradiction.Therefore, f (p 1 ) = blue holds and thus the lemma holds.
Without loss of generality, assume that (ini r , ini r ) → (ini b , ini b ) and (ini b , ini b ) → (ini r , ini r ) exist.For some population V , we denote the number of agents with ini r (resp., ini b ) belonging to V as #ini r (V ) (resp., #ini b (V )).Moreover, let #ini(V ) be the sum of #ini r (V ) and #ini b (V ).When V is clear from the context, we simply denote them as #ini r , #ini b , and #ini, respectively.
From now on, we show that Theorem 18 holds if the following lemmas and corollary hold.We show the detail of these intermediate proofs later.Lemma 22.There does not exist a transition rule such that #ini increases after the transition.
Lemma 23.Consider a globally-fair execution Ξ of Alg with some complete communication graph G.After some configuration in Ξ, #ini ≤ 1 holds.

Corollary 24. Consider a state set
Consider a globally-fair execution Ξ = C 0 , C 1 , C 2 , . . . of Alg with a ring communication graph G = (V, E) such that the number of agents is three, where First, consider the case of #blue(V ) − #red(V ) = 1.By Lemma 16, red agents keep exchanging r for ini r in Ξ.Moreover, by Lemma 23, there exists a stable configuration in Ξ such that #ini ≤ 1 holds.From these facts, there exists a stable configuration C t of Ξ such that there exists exactly one agent that has ini r .Without loss of generality, we assume that the agent is v 0 .
Consider the communication graph G = (V , E ) that includes four copies of G.The details of G are as follows: , v 9 } be a set of agents that will have state ini r . • An image of G and G is shown in Figure 2.
Consider the following execution • After C 4t , make interactions between agents in V red until agents in V red converge and #ini(V red ) ≤ 1 holds.We call the configuration C t .
• After C t , make interactions so that Ξ satisfies global fairness.
Until C 4t , agents in V 1 , V 2 , V 3 , and V 4 behave similarly to agents in V from C 0 to C t .This implies that, in C 4t , every agent in V red has state ini r .From Lemma 23, since ini r is the initial state of agents, it is possible to make interactions between agents in V red until agents in V red converge and #ini(V red ) ≤ 1 holds.Moreover, since v 0 is the only agent that has ini r in C t , no agent in V i \V red (1 ≤ i ≤ 4) has state ini r or ini b in C 4t .Hence, #ini ≤ 1 holds in C t .By Corollary 24, if #ini ≥ 2 does not hold, no agent can change its color.Thus, since #ini ≤ 1 holds after C t by Lemma 22, no agent can change its color after C t .Since v 1 and v 2 are blue in C t , v 1 , v 2 , v 4 , v 5 , v 7 , v 8 , v 10 , and v 11 are blue in C t .In addition, #blue(V red ) = #red(V red ) holds.Hence, #blue(V ) − #red(V ) = 8 holds.Since no agent can change its color after C t and Ξ is globally fair, this is a contradiction.
Next, consider the case of #red(V ) − #blue(V ) = 1.In this case, we can prove in the same way as the case of #blue(V ) − #red(V ) = 1.However, in the case, we focus on ini b instead of ini r .That is, we assume that agents in V red (i.e., v 0 , v 3 , v 6 , and v 9 ) have ini b in C 4t .From C 4t , we make v 0 (resp., v 6 ) interact with v 3 (resp., v 9 ) once.Then, by Lemma 21, all of them transition to ini r .After that, since all agents in V red have ini r , we can construct an execution such that only agents in V red interact and eventually #ini(V red ) ≤ 1 holds.As a result, we can lead to contradiction in the same way as the case of #blue(V ) − #red(V ) = 1.

Proofs of Lemmas 22 and 23, and Corollary 24
From now on, we prove Lemmas 22 and 23, and Corollary 24.First, from Lemmas 16 and 21, we prove the following lemmas.
Lemma 25.Consider a globally-fair execution Ξ of Alg with some complete communication graph G = (V, E).In any stable configuration of Ξ, there is at most one agent with ini r and at most one agent with ini b .
Proof.For the purpose of contradiction, assume that there exists a stable configuration C t of Ξ such that there are more than one agent with ini r (or more than one agent with ini b ).Since G = (V, E) is a complete communication graph, two agents with ini r (or two agents with ini b ) can interact.By Lemma 21, ini r (resp., ini b ) transitions to ini b (resp., ini r ).Since f (ini r ) = f (ini b ) holds and C t is stable, this is a contradiction.Proof.Consider a globally-fair execution Ξ of Alg with a complete communication graph G = (V, E) such that the number of agents n is seven.Consider a stable configuration C t 1 (resp., C t 2 ) of Ξ such that there exists exactly one agent with ini r (resp., ini b ) and C t 1 (resp., C t 2 ) occurs infinitely often in Ξ.From Lemmas 25 and 16, C t 1 and C t 2 exist.Note that, since the number of agents must be P/2 or less to use Lemma 16, P must be fourteen or more.Since the number of agents n is seven, there exist at least two agents with r and at least two agents with b in C t 1 and C t 2 .Hence, since G is a complete graph and C t Consider a globally-fair execution Ξ of Alg with a complete graph G = (V, E) such that the number of agents n is five.Moreover, consider a stable configuration C t 1 (resp., C t 2 ) such that there exists exactly one agent with ini r (resp., ini b ) and C t 1 (resp., C t 2 ) occurs infinitely often in Ξ.From Lemmas 25 and 16, C t 1 and C t 2 exist.Since the number of agents n is five, there exists at least one agent with r and at least one agent with b in C t 1 and C t 2 .This implies that, an agent with ini r (resp., ini b ) can interact with an agent with r in C t 1 (resp., C t 2 ).Similarly, an agent with ini r (resp., ini b ) can interact with an agent with b in C t 1 (resp., C t 2 ).Moreover, since G is a complete graph and Ξ is globally fair, those interactions happen infinitely often.
First, we consider the case that ini = ini r and rb = r hold.Consider an interaction between an agent with ini r and an agent with r in C t 1 .Since any agent cannot change its color in a stable configuration, both agents transition to ini r by the interaction.However, by Lemma 25, two agents cannot have ini r in any stable configuration.This is a contradiction.Thus, ini = ini r and rb = r do not hold.In a similar way, ini = ini b and rb = b do not hold.
Next, we consider the case that ini = ini r and rb = b hold.Consider an interaction between an agent with ini r and an agent with b in C t 1 .Let C t 1 be configuration that can be obtained from C t 1 by the interaction.Since any agent cannot change its color after a stable configuration, one ini r and one ini b occur by the interaction.Moreover, by Lemma 25, there exist exactly one ini r and exactly one ini b in C t 1 .This implies that, since C t 1 is stable and n is five, there exists at least one agent with b and thus an agent with ini r can interact with an agent with b in C t 1 .Hence, we can obtain C t 1 from C t 1 by making interaction between an agent with ini r and an agent with b.

Impossibility under Weak Fairness
In this subsection, assuming arbitrary communication graphs and designated initial states and no base station, we show that there is no protocol that solves the problem under weak fairness.Fischer and Jiang [21] proved the impossibility of leader election for a ring communication graph.We borrow their proof technique and apply it to the impossibility proof of a uniform bipartition problem.
Theorem 29.There exists no protocol that solves the uniform bipartition problem with designated initial states and no base station under weak fairness assuming arbitrary communication graphs.
Proof.For the purpose of contradiction, let us assume that there exists such a protocol Alg.
• For x and y such that either x = 0 or y = 0 holds, when v x interacts with v y at C i → C i+1 , v x interacts with v y at D i → D i , and v x+3 interacts with v y+3 at D i → D i+1 .
• When v 1 interacts with v 2 at C i → C i+1 , v 1 interacts with v 5 at D i → D i , and v 4 interacts with v 2 at D i → D i+1 .
If configurations C of R 1 and D of R 2 satisfy the following condition, we say that those configurations are equivalent.
From now on, by induction on the index of configuration, we show that C r and D r are equivalent for any r ≥ 0. Clearly C 0 and D 0 are equivalent, so the base case holds immediately.For the induction step, we assume that C l and D l are equivalent, and then consider two cases of interaction at C l → C l+1 .
First we consider the case that, for x and y such that either x = 0 or y = 0 holds, agents v x and v y interact at C l → C l+1 .In this case, at D l → D l , v x interacts with v y and, at D l → D l+1 , v x+3 interacts with v y+3 .By the induction assumption, s(v x , C l ) = s(v x , D l ) = s(v x+3 , D l ) and s(v y , C l ) = s(v y , D l ) = s(v y+3 , D l ) hold.Thus, agents v x and v x+3 change their state similarly to v x , and agents v y and v y+3 change their state similarly to v y .Hence, C l+1 and D l+1 are equivalent in this case.
Next, we consider the case that v 1 and v 2 interact at C l → C l+1 .In this case, at D l → D l , v 1 interacts with v 5 and, at D l → D l+1 , v 4 interacts with v 2 .By the induction assumption, s(v 1 , C l ) = s(v 1 , D l ) = s(v 4 , D l ) and s(v 2 , C l ) = s(v 2 , D l ) = s(v 5 , D l ) hold.Thus, agents v 1 and v 4 change their state similarly to v 1 , and agents v 2 and v 5 change their state similarly to v 2 .Hence, C l+1 and D l+1 are equivalent in this case.
Thus, C r and D r are equivalent for any r ≥ 0. This implies that, after D t , #red = 2 and #blue = 4 hold.Moreover, since Ξ is weakly fair, clearly Ξ is weakly fair.This is a contradiction.

Concluding Remarks
In this paper, we consider the uniform bipartition problem with designated initial states assuming arbitrary communication graphs.We clarified the problem solvability, and even provided tight bounds (with respect to the number of states per agent) in the case of global fairness.Concretely, with no base station under global fairness, we proved that four is the minimum number of states per agent to enable asymmetric protocols, and five is the minimum number of states per agent to enable symmetric protocols.With no base station under weak fairness, we proved the impossibility to obtain an asymmetric protocol.On the other hand, with a base station, we propose a symmetric protocol with 3P + 1 states under weak fairness, and a symmetric protocol with three states under global fairness.
Our work raises interesting open problems: • Is there a relation between the uniform bipartition problem and other classical problems such as counting, leader election, and majority?We pointed out the reuse of some proof arguments, but the existence of a more systematic approach is intriguing.
• What is the time complexity of the uniform bipartition problem?
• Is the uniform bipartition problem in arbitrary communication graphs with arbitrary initial states feasible?In case the answer is yes, what is the space complexity?

Lemma 7 .
For any configuration in any weakly-fair execution of Algorithm 1, either (i both #r − #b = 1 and RB = b hold, or (ii) both #r − #b = 0 and RB = r hold.

•
In the case where RB = r holds in C i : After the interaction at C i → C i+1 , #r increases by one and RB becomes b.By the induction assumption, since #r − #b = 0 holds in C i , #r − #b = 1 holds in C i+1 .Hence, alternative i) of the lemma holds.• In the case where RB = b holds in C i : After the interaction at C i → C i+1 , #b increases by one and RB becomes r.By the induction assumption, since #r − #b = 1 holds in C i , #r − #b = 0 holds in C i+1 .Hence, alternative (ii) of the lemma holds.

• Transition rule 1 :Lemma 11 .
When the transition rule 1 occurs at C i → C i+1 , #r and #b increase by one.• Transition rule 2: When the transition rule 2 occurs at C i → C i+1 , #b ω decreases by one, and #b increases by two.• Transitions rule 3 and 4: When the transition rule 3 or 4 occurs at C i → C i+1 , #r, #b, and #b ω do not change.• Transition rule 5: When the transition rule 5 occurs at C i → C i+1 , #b decreases by one, and #r and #b ω increase by one.• Transition rule 6: When the transition rule 6 occurs at C i → C i+1 , #b increases by one, and #r and #b ω decrease by one.For every case, #r = #b + 2 * #b ω holds in C i+1 .Therefore, the lemma holds.For any globally-fair execution of the Algorithm 2, #token ≤ 1 holds after finite time.
First, we consider the case that n is even.By Lemma 10, if #token = 0 holds, #r = #b holds.Hence, since n = #r + #b + #token holds, #r = #b = n/2 holds at C.Moreover, since agents can change their colors only if #token ≥ 2 holds, they do not change their colors after C. Hence C is a stable configuration, and thus the uniform bipartition is completed.Next, we consider the case that n is odd.When #token = 1 holds, we consider two cases.If an agent in state r ω exists at C, by Lemma 10, #r = #b holds and thus #red = #r + #r ω = #b + 1 = #blue + 1 holds.If an agent in state b ω exists at C, by Lemma 10, #r = #b + 2 holds and thus #red = #r = #b + #b ω + 1 = #blue + 1 holds.Hence, in both cases, #red − #blue = 1 holds at C. Since agents can change their colors only if #token ≥ 2 holds, they do not change their colors after C. Hence C is a stable configuration, and thus the uniform bipartition is completed.
First, we consider the case where n is even.By Corollary 13, if #token = 0 holds, #r = #b holds.Hence, since n = #r + #b + #token holds, #r = #b = n/2 holds at C.Moreover, since agents can change their colors only if #token ≥ 2 holds, they do not change their colors after C. Hence C is a stable configuration, and thus the uniform bipartition is completed.Next, we consider the case that n is odd.When #token = 1 holds, we consider two cases.If an agent in state r ω 0 or r ω 1 exists at C, by Corollary 13, #r = #b holds and thus #red = #r + #r ω 0 + #r ω 1 = #b + 1 = #blue + 1 holds.If an agent in state b ω exists at C, by Corollary 13, #r = #b + 2 holds and thus #red = #r = #b + #b ω + 1 = #blue + 1 holds.Hence, in both cases, #red − #blue = 1 holds at C. Since agents can change their colors only if #token ≥ 2 holds, they do not change their colors after C. Hence C is a stable configuration, and thus the uniform bipartition is completed.

Figure 1 :
Figure 1: An example of communication graphs G and G (n = 5)

Figure 2 :
Figure 2: An image of graphs G and G
1 and C t 2 are stable, if (r, r) → (r , r ), (b, b) → (b , b ), and (r, b) → (r , b ) exist, f (r) = f (r ) = f (r ) and f (b) = f (b ) = f (b ) hold.In addition, by Lemma 25, r and r are not ini r , and, b and b are not ini b .Therefore, the lemma holds.From these lemmas, we can prove Lemma 22. Lemma 22.There does not exist a transition rule such that #ini increases after the transition.Proof.For the purpose of contradiction, assume that such a transition rule exists.By Lemma 26, transition rules (r, r) → (r, r), (b, b) → (b, b), and (r, b) → (r, b) exist and these transition rules do not increase #ini.Hence, there exists (rb, ini) → (ini 1 , ini 2 ) such that rb ∈ {r, b}, ini ∈ {ini r , ini b }, ini 1 ∈ {ini r , ini b }, and ini 2 ∈ {ini r , ini b } hold.

Table 2 :
al. proposed a protocol The minimum number of states to solve the uniform bipartition problem with designated initial states over arbitrary graphs.P is a known upper bound of the number of agents, and l ≥ 3 and h are a positive integer.
Transition rules 1 and 2 indicate that, if the base station has state b red (resp., b blue ), and an agent with initial state interact, the agent state becomes red (resp., blue), and the base station state becomes b blue (resp., b red ).By repeating these transitions, agents are assigned red and blue alternately, and the number of agents in state initial decreases.This implies that, eventually |#red − #blue| ≤ 1 holds by alternating transition rules 1 and 2 (transition rules 1 and 2 are never enabled simultaneously, and executing one disables it while enabling the other).Transition rules 3 and 4 indicate that, if an agent with initial state and an agent with red (or blue) state interact, they exchange their states.From the global fairness hypothesis and transition rules 3 and 4, if there exists an agent with initial state, 1 , p 1 ), (p 1 , p 1 ) → (p 2 , p 2 ), (p 2 , p 2 ) → (p 3 , p 3 ), (p 3 , p 3 ) → (x, x), ..., where x ∈ {ini r , p 1 , p 2 }.2.For distinct states ini r , p 1 , and p 2 , there exists a transition sequence (ini r , ini r ) → (p 1 , p 1 ), (p 1 , p 1 ) → (p 2 , p 2 ), (p 2 , p 2 ) → (y, y), . .., where y ∈ {ini r , p 1 }.3.For distinct states ini r and p 1 , there exists a transition sequence (ini r , ini r ) → (p 1 , p 1 ), (p 1 , p 1 ) → (ini r , ini r ), (ini r , ini r ) → (p 1 , p 1 ), . . . .Assume, for the purpose of contradiction, that the transition sequence 1 holds.Let p ∈ {p 1 , p 2 , p 3 } be a state such that f (p) = red holds.By the assumption, in a stable configuration C t of Ξ, #red is three.This implies that there exist two agents with ini r or p.If there exist two agents with ini r in C t , they can transition to p ∈ {p 1 , p 2 , p 3 } such that f (p ) = blue = f (ini r ) holds by only interactions with homonyms.Hence, by the definition of stable configurations, there exists at most one agent with ini r in C t and thus there exist two or more agents with p.
1 ) → (p 2 , p 2 ) and (p 2 , p 2 ) → (p 1 , p 1 ) hold), there exists transition rule (p 1 , p 2 ) → (s r1 , s r2 ) such that f (s r1 ) = f (s r2 ) = blue does not hold.Since transition rules (p 1 , p 1 ) → (p 2 , p 2 ) and (p 2 , p 2 ) → (p 1 , p 1 ) exist and only p 1 and p 2 are blue states, a stable configuration Ĉt of Ξ can reach Ĉt such that both p 1 and p 2 exist in Ĉt .Additionally, since (p 1 , p 2 ) → (s r1 , s r2 ) exists, some agent can change its color after Ĉt .Since Ĉt is stable, this is a contradiction.Thus, the transition sequence 2 does not hold.Case 3: Assume, for the purpose of contradiction, that f (p 1 ) = red holds.Consider a globally-fair execution Ξ of Alg with a complete communication graph G = (V , E ) such that the number of agents is six.Since transition rules (ini r , ini r ) → (p 1 , p 1 ) and (p 1 , p 1 ) → (ini r , ini r ) exist and f (ini r ) = f (p 1 ) = red holds, there exists transition rule (ini r , p 1 ) → (s b1 , s b2 ) such that f (s b1 ) = f (s b2 ) = red does not hold.Since transition rules (ini r , ini r ) → (p 1 , p 1 ) and (p 1 , p 1 ) → (ini r , ini r ) exist and only ini r and p 1 are red state (and the number of red agents is three in any stable configuration), a stable configuration C t of Ξ can reach C t such that both p 1 and ini r exist in C t .