Using Synchronous Boolean Networks to Model Several Phenomena of Collective Behavior

In this paper, we propose an approach for modeling and analysis of a number of phenomena of collective behavior. By collectives we mean multi-agent systems that transition from one state to another at discrete moments of time. The behavior of a member of a collective (agent) is called conforming if the opinion of this agent at current time moment conforms to the opinion of some other agents at the previous time moment. We presume that at each moment of time every agent makes a decision by choosing from the set (where 1-decision corresponds to action and 0-decision corresponds to inaction). In our approach we model collective behavior with synchronous Boolean networks. We presume that in a network there can be agents that act at every moment of time. Such agents are called instigators. Also there can be agents that never act. Such agents are called loyalists. Agents that are neither instigators nor loyalists are called simple agents. We study two combinatorial problems. The first problem is to find a disposition of instigators that in several time moments transforms a network from a state where the majority of simple agents are inactive to a state with the majority of active agents. The second problem is to find a disposition of loyalists that returns the network to a state with the majority of inactive agents. Similar problems are studied for networks in which simple agents demonstrate the contrary to conforming behavior that we call anticonforming. We obtained several theoretical results regarding the behavior of collectives of agents with conforming or anticonforming behavior. In computational experiments we solved the described problems for randomly generated networks with several hundred vertices. We reduced corresponding combinatorial problems to the Boolean satisfiability problem (SAT) and used modern SAT solvers to solve the instances obtained.

In this paper, we propose an approach for modeling and analysis of a number of phenomena of collective behavior. By collectives we mean multi-agent systems that transition from one state to another at discrete moments of time. The behavior of a member of a collective (agent) is called conforming if the opinion of this agent at current time moment conforms to the opinion of some other agents at the previous time moment. We presume that at each moment of time every agent makes a decision by choosing from the set f0,1g (where 1-decision corresponds to action and 0-decision corresponds to inaction). In our approach we model collective behavior with synchronous Boolean networks. We presume that in a network there can be agents that act at every moment of time. Such agents are called instigators. Also there can be agents that never act. Such agents are called loyalists. Agents that are neither instigators nor loyalists are called simple agents. We study two combinatorial problems. The first problem is to find a disposition of instigators that in several time moments transforms a network from a state where the majority of simple agents are inactive to a state with the majority of active agents. The second problem is to find a disposition of loyalists that returns the network to a state with the majority of inactive agents. Similar problems are studied for networks in which simple agents demonstrate the contrary to conforming behavior that we call anticonforming. We obtained several theoretical results regarding the behavior of collectives of agents with conforming or anticonforming behavior. In computational experiments we solved the described problems for randomly generated networks with several hundred vertices. We reduced corresponding combinatorial problems to the Boolean satisfiability problem (SAT) and used modern SAT solvers to solve the instances obtained.

Introduction
In recent years the interest to the analysis of various phenomena of collective behavior has significantly increased. It can be explained by the fact that in almost all areas of human activity there are processes involving information exchange inside collectives. Such processes deeply affect the future behavior of a collective and can lead to positive or negative consequences not only for the collective considered but also for a much larger social formation. For example an intensive sale of shares on the stock exchange market by players that have a big influence on others can lead to a drastic drop of global economic indexes. Riots and revolutionary situations proceed in a similar fashion when a relatively small group of instigators activates such a large number of people that state security systems are not able to cope with it.
The active development of social networking services in later years greatly increased the possibilities in collective behavior manipulation. This thesis can be proved by analyzing such revolutionary phenomena as Arab Spring, 2011-13 Russian protests, Euromaidan etc. In the majority of these cases the corresponding actions were planned via social networks. It is worth mentioning that such processes are usually coordinated by small groups of designated activists.
The modeling of collective behavior was studied in a large number of papers. Following many other authors we base our work on the paper of M. Granovetter [1], in which threshold models of collective behavior were studied. The threshold behavior means that a state of every member of a group (agent) changes only when the value of a special function, that is associated with this agent, reaches some threshold. The simplest example of such behavior is following the decision of the majority. In Granovetter's model the network connecting the agents is specified by a complete graph -every agent takes into account the opinion of every other agent. In many real situations such approach cannot be used. For example, in real world social networks an agent usually bases its opinion on that of agents from some neighborhood. In this case the opinion of agents outside of such neighborhood would have no impact on the opinion of the agent considered. Similar situations can be observed in genetics: in many gene networks the amount of genes that directly affect each particular gene is small relative to the total number of genes in the network.
Similarities of dynamical processes that can be observed in gene networks and social networks led us to an idea to introduce and analyze models of collective behavior that are based on Boolean networks. The apparatus of Boolean networks have been used in mathematical biology for 50 years. Below we consider the so called synchronous Boolean networks (SBNs) first introduced by S. Kauffman in [2] with the purpose of analyzing dynamical properties of gene networks. In our approach we consider a collective as an SBN with special functions associated with the network vertices. From our point of view the language of Boolean networks is well suited for explaining a number of phenomena of collective behavior. For example, equilibrium states from [1] can be viewed as fixed points of a discrete function specified by the corresponding SBN. Another important feature of such models is that to solve combinatorial problems that arise during the analysis of SBNs, it is possible to use modern methods of solving large systems of Boolean equations. For this purpose in our paper we use algorithms for solving the Boolean satisfiability problem (SAT).
Let us present a brief outline of the paper. First we describe SBNs and define fixed points and cycles of discrete functions determined by these networks. Then we introduce two models of collective behavior that are based on SBNs. In the first model we consider a situation when each network agent at the next moment of time makes a decision to act if at least a specific amount of agents in its neighborhood are currently active. Otherwise the agent decides not to act. This form of collective behavior is usually referred to as conformity. The second model is used to illustrate the phenomenon of anticonformity -an agent decides not to act if at the present moment at least a specific amount of its neighbors decide to act and vice versa. After this, we extend the models proposed by introducing two special types of agents: instigators and loyalists. Instigators are the agents that always act regardless of other agents decisions. Loyalists are the agents that never act. For the extended models we formulate the following combinatorial problem: for a network with the majority of inactive agents to find such a disposition of small amount of instigators, that after several moments of time the majority of agents in this network becomes active. An opposite problem is also considered: for a previously activated network (with instigators) to find a disposition of a relatively small number of loyalists, such that after several moments of time the majority of agents becomes inactive. In the context of problems considered we state a number of theoretical properties of discrete functions defined by the corresponding SBNs. Then we note that modern combinatorial algorithms can be used to solve such problems. In particular, we use algorithms for solving SAT. Further we describe our computational experiments and discuss the results obtained. In these experiments we constructed SBNs according to widely known models of random graphs (Gilbert-Erdos-Renyi model, Watts-Strogatz model, Barabasi-Albert model). Using modern SAT solvers we managed to solve combinatorial problems outlined above for corresponding networks with 500 vertices and more. In the conclusion we give some final remarks and outline our future plans.

Related Works
As we already noted, the paper [1] is the fundamental work in the field of threshold models of collective behavior. In a number of later works, for example [3][4][5], the ideas from [1] were detailed and applied to analysis of various sociological situations.
In [6][7][8][9] and others it was shown that various phenomena of collective behavior may be studied from the game theory point of view. In particular, equilibrium states [1] in collectives can be considered as Nash equilibria. In this context we would like to mention the work [7] in which the conformity and anticonformity were considered from the game theory positions.
In the paper [10] the influence of thresholds distributions on the genesis and development of several phenomena (in particular, the so called bandwagon effect) in the networks with arbitrary structure is analyzed.
As we said above, synchronous Boolean networks were introduced by S. Kauffman in [2]. In that paper problems of analysis of fixed points and cycles of corresponding discrete functions were considered as important and helpful for the study of dynamics of real gene networks. Apparently, [11] is the first example of application of combinatorial algorithms to the search for cycles of discrete functions specified by Kauffman networks. Later the same authors used the SAT approach for similar purposes [12]. In [13] we considered the problem of search for fixed points of discrete functions specified by networks, in which vertex weight functions take natural values and at the same time act as threshold functions. In order to solve the corresponding problems, we used both SAT and ROBDD approaches. Also in [13] we studied an opposite problem: given fixed points of the function specified by some network, to restore the structure of the network.
In recent years there were published a lot of works about the analysis of structure of big networks and processes that can occur in them. Works [14] and [15] are quite complete reviews of relevant topics.

Synchronous Boolean Networks
A Synchronous Boolean Network (SBN) is defined as a directed graph in which with each vertex there is associated a total function that takes values from f0,1g at discrete moments of time. Hereinafter we will refer to such functions as vertex weight functions. The value of a weight function for an arbitrary vertex u at moment tz1 is calculated based on the values of weight functions of some set of network vertices at moment t. In SBNs values of all weight functions are updated simultaneously (synchronously). Note that the weight functions can be specified in various ways: by truth tables, Boolean formulas or predicates. Values of weight functions of all vertices at an arbitrary moment t, t §1 can be considered as a result of computing a value of a discrete function that takes a Boolean vector of length n as input and outputs a Boolean vector of length n, where n is the number of vertices in the network. We denote a Boolean vector consisting of weight functions values at moment t as W(t) and call it a network state at moment t. We will refer to W(0) as an initial network state. It is clear that an arbitrary SBN with n vertices has 2 n different network states.
Thus, more formally, let us assume that G is a directed graph with n vertices that represents some SBN. Below we will consider only graphs without loops and without multiple arcs. For convenience let us mark vertices by natural numbers from 1 to n. With an arbitrary vertex u i , i[f1, . . . ,ng we associate a weight function f u i (t), whose values are defined at discrete moments of time t[f0,1,2, . . .g. We assume that at t~0 each weight function has some initial value. By V i we denote such a set of network vertices that for each u j [V i , u j =u i the graph G has an arc (u j ,u i ). Essentially it means that V i contains vertices that directly affect u i . We also call V i a neighborhood of u i . From here on by f0,1g n we mean the set of all possible binary words of length n. The rules that specify each weight function f u i , i[f1, . . . ,ng are the same at any moment of time. It means that in total these functions specify a vector function that is defined everywhere in f0,1g n and takes values from f0,1g n . We denote this function as F G : f0,1g n ?f0,1g n and refer to it as a discrete function defined by network G. The transitions between network states, represented by Boolean vectors from f0,1g n , can be naturally illustrated using special graphs called State Transition Graphs (STGs). We denote the STG of network G as C G . An example of a simple SBN with 3 vertices where weight functions are specified by Boolean formulas is displayed in Fig. 1.
As we already noted, the amount of different states of an arbitrary SBN with n vertices is 2 n , and the rules, according to which the network transitions from one state into another, do not depend on t. Therefore, regardless of the network state at moment t~0, there are such k and l, 0ƒkvl, that W(k)~W(l). In this situation we call the sequence of transitions W(k)? . . . ?W(l) a cycle of length l{k [2]. In some works on the analysis of dynamical properties of gene networks the cycles are called "attractors". The cycle of length 1 is called a fixed point of function F G . For the network in Fig. 1 it is easy to see that (000)?(000) is a fixed point, while a sequence (100)?(001)?(100) forms a cycle of length 2. Note that the neighborhood of every vertex of the network in Fig. 1 is formed by other two vertices.

Models of Collective Behavior Based on Synchronous Boolean Networks
In this section we introduce and analyze two phenomena of collective behavior that can be observed in the real world. The first one is conforming behavior. It means that an agent agrees with the opinion of some agents from its neighborhood. It is easy to find many examples of conformity in real life: from riots and financial crises mentioned above to presidential elections, etc. The second phenomenon we study is anticonforming behavior. The agent demonstrating anticonforming behavior acts as an opposite to an agent with conforming behavior: it chooses not to act while certain amount of agents from its neighborhood are active and vice versa.
Let us consider an SBN G with n vertices interpreting agents. We will say that an arbitrary agent u i , i[f1, . . . ,ng is active (inactive) at moment t if f u i (t)~1 (f u i (t)~0, respectively). We assume that an arbitrary agent u i is associated with the weight function of one of the following two types: where h i ,f i [½0,1 are called conformity threshold and anticonformity treshold, respectively. Essentially, (1) means that the agent u i becomes active at moment tz1 only if at least qh i : jV i r agents from its neighborhood are active at moment t. Otherwise u i becomes inactive at moment tz1. Hereinafter we refer to such agents as conformists. Likewise (2) means that u i becomes inactive at moment tz1 if at least qf i : jV i jr agents from its neighborhood are active at moment t and becomes active otherwise. These agents will be refered to as anticonformists. Values H i~q h i : jV i jr and Z i~q f i : jV i jr we will call conformity level and anticonformity level, respectively. Further we assume that if V i~6 0 then the sum of corresponding weights is 0.
Let u i be a conformist with the conformity threshold h i~0 and f u i (0)~1. Then it is clear that f u i (t):1, i.e. that f u i (t) takes the value of 1 at any moment t. It means that agent u i is active at any moment regardless of decisions of agents in its neighborhood. We will refer to such agents as instigators. Now let u i be an anticonformist with anticonformity threshold f i~0 and f u i (0)~0. Following the similar reasoning we can conclude that such agent is inactive at any moment of time regardless of decisions of agents from its neighborhood. We call such agents loyalists.
To an arbitrary agent that is neither instigator nor loyalist we will refer as a simple agent. Thus an arbitrary simple agent u i is either a conformist with h i w0 or an anticonformist with f i w0.
In Fig. 2 we demonstrate the notation that we use below. The networks with described types of agents can often be observed in real life. Indeed, for example one can notice that on the early stage of every revolutionary situation there are instigators. Their purpose is to activate as many initially inactive simple agents-conformists as possible. Once they become active, conformists help activating other inactive agents-conformists in the following moments of time. This process gradually involves even agents that are not directly connected to instigators. The goal of loyalists in such situations is to launch the deactivation process aimed at making active simple agents inactive.
It should be noted that the disposition of instigators and loyalists in the network can significantly affect the activation/deactivation of the network. In Fig. 3 we display the behavior of the same network with two different dispositions of instigators at the initial time moment. The considered network does not have loyalists and all its simple agents are conformists. We assume that at the initial moment all the simple agents are inactive (i.e. for every simple agent f u i (0)~0). In the first case 5 instigators after 5 moments of time manage to activate only 17 simple agents. In the second case 3 instigators after 5 moments of time activate almost the whole network -26 simple agents. An important detail here is that in the first case there is more instigators but their disposition is worse.
Further we establish a number of theoretical results regarding the dynamical properties of SBNs with agents of the described types. The main achievement here Crimson vertices correspond to instigators -agents that are always active. Bright green vertices represent loyalists -agents that are always inactive. The vertex corresponding to simple agent is marked with orange if the agent is active and with blue otherwise. The arcs going from active agents (including instigators) are marked with red. The arcs going from inactive agents (including loyalists) are marked with green. Each simple agent has a conformity level.
consists in the justification of the fact that the networks in which all simple agents are conformists and networks where all simple agents are anticonformists can demonstrate significantly different activation/deactivation dynamics.

Conforming Behavior
Consider an arbitrary SBN G with n agents. We assume that all the simple agents in the network are conformists and that there can be instigators and loyalists. Hereinafter we study two problems that we believe to be interesting from the practical point of view.
In the context of the first problem (to which we will refer below as Problem 1) we consider a network with n agents among which there can be I, Ivn instigators, while all the other n{I agents are simple agents-conformists. We assume that a priori I instigators can be arbitrarily placed in the network. Also we assume that at the initial time moment t~0 all the simple agents are inactive. The goal is to find such disposition of instigators that starting from t~0 the network after some time moments transitions to the state with the majority of active agents. The second problem (to which we will refer below as Problem 2) consists in the following: we consider the network with a fixed disposition of I, Ivn instigators and all the other n{I simple agents-conformists are active at the initial moment t~0. We assume that it is possible to replace L, Lvn{I arbitrary simple agents by loyalists. We need to find such disposition of these loyalists that starting from t~0 the network after some time moments transitions to the state with the majority of inactive simple agents.
Let us show that the following theorem holds.

Theorem 1
Consider an arbitrary SBN with n agents among which there are I, Ivn instigators and the remaining n{I simple agents are conformists. We assume that at the initial time moment t~0 all n{I simple agents are inactive. Then for any disposition of instigators and any conformity thresholds of simple agents the network starting from t~0 will transition to a fixed point after Tƒn{I time moments.

Proof
Assume that G is an SBN with n vertices, weight functions (1), an arbitrary disposition of I instigators and arbitrary conformity thresholds of simple agents. Suppose that all simple agents are inactive at t~0. If after the transition from t~0 to t~1 none of simple agents have changed their decisions (0?1) then we have a fixed point (since instigators do not change their decisions by definition). Now suppose that at moment t~1 some simple agents have changed their decisions from 0 to 1. Let u be one of them. It means that v has changed its decision from 0 to 1 only because it had enough (relative to its conformity threshold) instigators in its neighborhood. But since instigators are always active then the number of active agents in the neighborhood of u at any t §1 can not be less than that at t~0. Therefore this agent will not change its decision 1 at any of the following moments of time. If at moment t~2 none of simple agents have changed their decisions then we have a fixed point. Suppose u is an arbitrary agent that has changed its decision during the transition from t~1 to t~2. From the above it follows that u changed decision from 0 to 1. It could have occured only because it had enough (relative to its conformity threshold) instigators and active agents in its neighborhood. However all agents that have become active at t~1 cannot change their decisions at the following moments of time. Therefore agent u will remain active at all t §2. If we continue by analogy we can conclude that not later than after n{I time moments our network will reach a fixed point. & Using the reasoning technique from the proof of Theorem 1 it is easy to prove the following corollary.

Corollary 1
Consider an arbitrary SBN with n agents among which there are I, Ivn instigators and the remaining n{I simple agents are conformists. Assume that some disposition of instigators is fixed and all simple agents are active at the initial time moment t~0. Also assume that we can replace any L, Lvn{I simple agents by loyalists. Then for any disposition of these L loyalists and any conformity thresholds of remaining n{I{L simple agents the network starting from t~0 will transition to a fixed point after Tƒn{I{L time moments.
Note that the Theorem 1 despite its simplicity makes it possible to explain the situations when a relatively small number of instigators thanks to their advantageous disposition manage to activate quite a big network quickly. Apparently, the development of revolutionary situations, epidemics and critical processes in stock markets proceed in the similar fashion.
The principal possibility of the phenomenon when a small number of instigators can activate the network starting from the state in which all simple agents-conformists are inactive means that the network itself is vulnerable to instigators. Intuitively it is clear that such networks can be activated by instigators even faster if some simple agents are already active at the initial time moment. This thesis is proved by the following theorem.

Theorem 2
Assume S 0 (I) is a state of an SBN with n vertices with weight functions (1) and I, Ivn instigators, in which all simple agents-conformists are inactive. Denote by S(I) a network state, with the same disposition of instigators as in S 0 (I), in which there is at least one active simple agent. By W 0 (T) and W(T) we denote states reached by the network after T time moments starting from S 0 (I) and S(I), respectively. Then for any where wt(x) stands for a Hamming weight of a Boolean vector x.

Proof
Consider a state S 0 (I) in which all simple agents are inactive and a state S(I) where some k, k §1 simple agents are active. Denote these active agents as a 1 , . . . ,a k . We assume that the disposition of I instigators is the same in both S 0 (I) and S(I). First let us prove that wt(W 0 (1))ƒwt(W (1)). Let us analyze all possible cases. First, both S 0 (I) and S(I) can be fixed points of F G . In this case the property holds. If S 0 (I) is a fixed point and S(I) is not, then even if all agents a 1 , . . . ,a k become inactive in W(1) it holds that wt(W 0 (1))ƒwt(W (1)). Now suppose that S 0 (I) is not a fixed point, i.e. some simple agents in W 0 (1) become active. It can only occur if they have enough instigators in their neighborhoods (relative to their conformity thresholds). But it means that the same simple agents will be active in W(1). Additionally some (possibly all) agents from a 1 , . . . ,a k can become inactive or remain active in W(1). Also in W(1) there can appear other active simple agents because a 1 , . . . ,a k are active in S(I). In any case we have wt(W 0 (1))ƒwt(W(1)). Since S 0 (I) is not a fixed point of F G then some simple agents in W 0 (1) become active. Denote these agents as b 1 , . . . ,b s . From Theorem 1 it follows that these agents cannot become inactive in any of states W 0 (1),W 0 (2), . . .. Consider an arbitrary agent b i , i[f1, . . . ,sg and let V b i be its neighborhood. From the above the number of active agents in V b i in states W(1),W(2), . . . is not less than that in V b i in the state S 0 (I). Therefore b 1 , . . . ,b s will be active in all states W(r), r §1. It means that W 0 (1) and W(1) can be considered as initial states of the network with a set of Izs instigators: this set is formed by I original instigators and s new instigators b 1 , . . . ,b s . After that by analogy we can show that wt(W 0 (2))ƒwt(W(2)), etc. &

Anticonforming Behavior
Consider an arbitrary SBN G with n agents. We assume that all simple agents in G are anticonformists and also that the network can contain instigators and loyalists.
On the first glance it may seem that the dynamical processes we studied for the collectives of conformists should have some simple analogues in the collectives of anticonformists. However, more thorough investigation reveals that this is not the case. In particular, assume that G is a network in which any agent u i has a nonempty neighborhood (V i = 6 0). Also let this network contain neither instigators nor loyalists. Then it is easy to see that if all the agents in the network are conformists (with non-zero conformity thresholds), then the states 0 n and 1 n are fixed points. However, if all the agents are anticonformists (with non-zero anticonformity thresholds) then there is the cycle of length 2: 0 n ?1 n ?0 n . Indeed, let G be the network for which all listed conditions are satisfied, all its simple agents are anticonformists and they are inactive at moment t~0. Let u i be an arbitrary agent of the network and V i be its neighborhood. Since V i = 6 0 (by assumption), then at t~0 all the agents from V i have the 0 state. Therefore for any value of fw0 we have: P u j [V i f u j (0)vf : jV i j, so at moment t~1 the agent u i will switch its state to 1. Since u i is an arbitrary network agent, it means that at moment t~1 every agent of the network will switch to the state 1. Now let us consider what occurs at moment t~2. Let u i be an arbitrary agent-anticonformist. Then at moment t~1 all the agents in V i are in the state 1. It means that for any 0vfƒ1 the following holds: P In this situation at moment t~2 the agent u i switches to the state 0. But since v i is an arbitrary agent, then all the network agents switch to 0 at t~2. Therefore we have the cycle 0 n ?1 n ?0 n . The following theorem describes the dynamics of collectives of anticonformists with the initial conditions similar to that in Theorem 1. It can be noted that in this situation, generally speaking, the collective of anticonformists has more complex behavior than that of the collective of conformists. In particular, if the network of anticonformists starts from an initial state in which all simple agents-anticonformists are inactive, then it may not reach an equilibrium state (a fixed point).

Theorem 3
Consider an arbitrary SBN with n agents, where I, Ivn agents are instigators and the remaining n{I simple agents are anticonformists. Assume that at the initial moment t~0 all n{I simple agents are inactive. Additionally we assume that if u i is a simple agent then V i = 6 0. Then for any disposition of instigators and any anticonformity thresholds of simple agents the network starting from t~0 after Tƒn{I time moments will either transition to a fixed point or will enter the cycle of length 2.

Proof
Let G be an SBN with n vertices, weight functions (2), an arbitrary disposition of I instigators and arbitrary anticonformity thresholds of simple agents. Also we assume that all simple agents have nonempty neighborhoods. Below we denote the set of all vertices of G as V. Let S 0 (I) be an initial state of a network with an arbitrary disposition of I instigators and with inactive simple agents. Let W 0 (1) be the state to which the network transitions from S 0 (I) at moment t~1. If in W 0 (1) none of simple agents have changed their decisions (from 0 to 1) then we have a fixed point. Suppose that m~n{I, mw0 and r, 0vrƒm simple agents have switched from 0 to 1. If r~m, i.e. all simple agents have switched, then with the transition from W 0 (1) to W 0 (2) all these agents will switch back from 1 to 0 since in W 0 (1) each of them has a neighborhood consisting only of active agents. Therefore in this case we have the following cycle of length 2: S 0 (I)?W 0 (1)?S 0 (I). Now suppose that rvm. Consider q~m{r, qw0 simple agents that have not switched from 0 to 1 with the transition from S 0 (I) to W 0 (1). It could have occured only if in their neighborhoods there were enough (relative to their anticonformity thresholds) instigators (which are always active). But since instigators do not change their decisions, then each of these q agents will not switch from 0 to 1 at any of the following time moments. Denote by R 1 , jR 1 j~r the set formed by all simple agents that have switched (0?1) at moment t~1. Note that every agent from V\R 1 does not change its state from 0 to 1 at time moments t, t §1. Further let us look only at the behavior of agents from R 1 . Consider moment t~2. If none of agents from R 1 have switched (1?0) then we have a fixed point (since all agents from V\R 1 do not change their decisions at any t §1). Suppose that p agents from R 1 , 0vpƒr have switched at t~2 (1?0). It is clear that if p~r (all agents from R 1 have switched) then we have a cycle of length 2. Assume pvr, by Q, Q5R 1 denote the set of all r{p agents that have not switched (1?0) at moment t~2. Consider an arbitrary agent u[Q. This agent has not changed its decision (1?0) at t~2 only because at t~1 its neighborhood had enough inactive agents from V (relative to v anticonformity threshold). However these inactive agents could not belong to R 1 (since at t~1 all agents from R 1 are active). Therefore they must belong to V\R 1 . But as we noted above all such agents do not change their decisions from 0 to 1 at any of moments t §1. It means that any agent u[Q will not change its decision at any of the following moments t §2. The set containing p, pvr simple agents that have switched at t~2 from 1 to 0 we denote by R 2 and further analyze only the behavior of agents from R 2 . By analogy we note that each agent from V\R 2 does not change its decision at t §2, etc. Thus at most after T~n{I time moments the network considered will either reach a fixed point or enter a cycle of length 2. & The reasoning technique from the proof of the Theorem 3 can be generalized for the cases of the networks with instigators, loyalists and simple agentsanticonformists with possibly empty neighborhoods. For all such situations one can show that starting from the initial state, in which either all simple agentsanticonformists are active or inactive, the network will transition to a fixed point or will enter the cycle of length 2 after at most n{I{L time moments, where I stands for the amount of instigators and L -for the amount of loyalists.

Final Remarks
In this part we presented several theoretical results regarding the conforming and the anticonforming behavior. From our point of view these results explain a number of phenomena observed in the real world. In particular, fast activation of a large network by a relatively small number of instigators can be explained not only by the network structure (for example by its strong connectivity) or by small conformity thresholds but also by advantageous disposition of instigators. If there exists such disposition of small number of instigators, that forces the network to transition from the state with inactive simple agents to the state with the majority of active agents, then this network is vulnerable to instigators. To determine the degree of such vulnerability for some particular disposition of I instigators it is sufficient to study the behavioral dynamics of the network for at most n{I time moments. This fact is the assertion of the Theorem 1. Evidently, for many realworld networks the vulnerability to instigators is highly undesirable. On the other hand, as it follows from the Corollary 1, even if the network was already activated by instigators, but there is a solution of Problem 2, then, roughly speaking, the situation can be improved by transforming a number of simple agents to loyalists.
Theorem 3 shows that the activation dynamics of collectives of anticonformists can significantly differ from that of the collectives of conformists even for the similar initial conditions. Unfortunately, we could not obtain any analogues of Theorems 1 and 3 for collectives in which simple agents are represented by both conformists and anticonformists. In the section about the experiments we give an example when such network displays more complex behavior.

SAT Approach to the Study of SBN-Based Models of Collective Behavior
Note that in the real world the conforming behavior is spread much more than the anticonforming. On the other hand, the collectives of anticonformists demonstrate more complex behavioral dynamics compared to that of collectives of conformists. It follows from theorems 1 and 3. That is why in our computational experiments we studied the collectives of conformists and concentrated our attention on Problem 1 and Problem 2, formulated above. We would like to point out the fact that the considered problems are combinatorial since they presume the analysis of many possible variants of dispositions of instigators and loyalists. We applied to Problem 1 and Problem 2 the algorithms that are used to solve the Boolean satisfiability problem (SAT). This choice is motivated by the fact, that modern SAT solving algorithms are very powerful computational methods that successfully cope with combinatorial problems from a wide spectrum of practical areas [16].
For an arbitrary Boolean formula the Boolean satisfiability problem (SAT) consists in answering a question if this formula is satisfiable, i.e. if there exists such an assignment to Boolean variables of this formula, that makes the formula true. This problem in the general case can be effectively (in polynomial time on the length of a binary encoding of the considered formula) reduced to the problem of deciding if a Boolean formula in a conjunctive normal form (CNF) is satisfiable. Taking this fact into account, below we consider SAT in the following formulation: for an arbitrary CNF C over the set of Boolean variables X we need to answer a question if C is satisfiable, and if the answer is 'yes', to present a corresponding variable assignment that evaluates C to 1. This problem is NPhard, therefore, it cannot be solved in polynomial time if P=NP. Nevertheless, SAT is very important in a practical sense because a lot of industrial problems can be effectively reduced to it and solved using modern algorithms developed during recent 15 years. Basic algorithmic constructions used in solving SAT and main directions of development and applications of SAT approach are described in [16].
The reducibility of an arbitrary NP problem to SAT (in the form of decision problem) follows from the Cook theorem [17]. However, in practice the analysis of specific details of the considered problem makes it possible to significantly decrease the size of the CNF formula produced. A number of general techniques used to reduce combinatorial problems to SAT can be found in [18].
The SAT approach was successfully applied to the search for cycles of functions defined by Boolean networks in [12] and [19]. It should be noted, however, that networks studied in that papers have their own specifics motivated by the source of origin: essentially they are Kauffman networks in which the power of the neighborhood of an arbitrary agent does not exceed some relatively small number K (usually K[f1,2,3g). Also, weight functions used in [12] and [19] are completely different from the ones we use. That is why below we present a relatively detailed description of the SAT encoding process for problems outlined above.
Basic idea that is used to encode many combinatorial problems to SAT, including problems studied in our paper, is to represent the computation process for the considered discrete function (in our case it is F G : f0,1g n ?f0,1g n ) as a Boolean circuit B(F G ) formed by logical gates from a complete basis (for example f^,:g). Formally, circuit B(F G ) is a directed acyclic graph where n nodes are labeled as inputs. All other nodes of this graph are called inner nodes. Each inner node corresponds to logical gate from the chosen basis. Usually, nodes that form the output of the considered function are referred to as output gates. In our case circuit B(F G ) has n output gates.
Circuit inputs are labeled by Boolean variables x 1 , . . . ,x n . Below we refer to these variables as input variables. An output of each logical gate E is marked by an auxiliary variable u(E). By fy 1 , . . . ,y n g we denote a set of n variables corresponding to output gates. We refer to y 1 , . . . ,y n as output variables. Let U be the set of all auxiliary variables. Then fx 1 , . . . ,x n g\U~6 0, fy 1 , . . . ,y n g(U. For circuit B(F G ) it is possible to effectively construct (in linear time on the total number of nodes in the circuit) a CNF C(F G ), using the Tseitin transformations [20] procedure, described below.
Assume E is an arbitrary gate in B(F G ). If E is a NOT-gate then it has a single input labeled by variable p. Then for NOT-gate E we construct a formula u(E)<:p where by < we mean logical equivalence. The CNF-representation of the Boolean function specified by formula u(E)<:p is If E is an AND-gate, and p,q are variables corresponding to its inputs, then for E we construct formula u(E)<p^q and CNF (:u(E) _ p)^(:u(E) _ q)^(u(E) _ :p _ :q) We say that CNFs constructed this way encode the corresponding logical gates. Then the CNF encoding circuit where C(E) is a CNF that encodes gate E. To be more precise, CNF C'(F G ) is satisfiable if and only if function F G has fixed points. If C'(F G ) is satisfiable and its satisfying assignment is obtained, then we can effectively extract the corresponding fixed point: it is sufficient to write down values of the input variables. To make a SAT instance that specifies the problem of finding a cycle of length k we need to represent a superposition as Boolean circuit B(F k G ), and construct the CNF of the kind C'(F k G ). Instead of logical gates we actually can use more complex basic Boolean functions, such as predicates over finite sets. In this case elements of the corresponding sets are represented by Boolean vectors. In fact this is what we do to encode functions F G : f0,1g n ?f0,1g n for networks with weight functions (1) and (2). Now let us consider an SBN with n vertices and weight functions (1) that can have both instigators and loyalists. Assume that the network is functioning for T time moments. The decision of agent u i , i[f1, . . . ,ng at moment t[f0,1, . . . ,Tg we encode with Boolean variable x t i . We would like to stress out once more that a priori we do not know dispositions of instigators and loyalists in the network and therefore presume that any agent can take one of these roles. To take into account that an arbitrary vertex u i can be either an instigator, a loyalist or a simple agent, we introduce two additional sets of Boolean variables fa i g n i~1 , fl i g n i~1 . We assume that if a i~1 , l i~0 then u i is an instigator; if a i~0 , l i~1 , then it takes the role of a loyalist; if a i~li~0 then our vertex represents a simple agent. The situation corresponding to a i~li~1 would mean that the vertex is simultaneously an instigator and a loyalist. That is why it is forbidden by means of a clause (:a i _ :l i ).
Let u i be an arbitrary network vertex, V i~f u j 1 , . . . ,u j jV i j g and H i be a conformity level of u i . We introduce the following predicate Then from the above we can conclude that the decision of agent u i at moment tz1 is associated with the following formula: Additional constraints on the initial network state are encoded in a similar fashion. For example a constraint that specifies that an arbitrary agent u i at the initial state is active only if it is an instigator is equivalent to satisfiability of the following formula: x 0 i <a i À Á^: In fact, all clauses of the kind :a i _ :l i ð Þare added to the result CNF only once. By applying Tseitin transformations to formulas (4) and (5) we can produce CNFs that are satisfiable if and only if the original Boolean formulas are satisfiable. To do this we need to be able to effectively encode predicate (3). It can be represented as a Boolean circuit implementing a function that counts ones in a Boolean vector and then compares the obtained result with H i . Such circuit can then be encoded to CNF in accordance with the procedure described above. However, there are algorithms that produce more effective SAT encodings for predicates (3). These algorithms are based on various methods that work with so called cardinality constraints ( [21][22][23][24][25]). In the present paper we encode predicates (3) using sorting networks. The main idea of the corresponding approach is very simple: we can sort bits in an arbitrary Boolean vector a 1 , . . . ,a m ð Þdescending from left to right, as we consider them as natural numbers from the set f0,1g. Let Þbe a result of such sorting. Then it is clear that P m j~1 a j §k, k[f1, . . . ,mg if and only if b k~1 . Essentially, in our work to sort Boolean vectors we used binary variants of Batcher sorting networks [26,27]. A SAT encoding of such network with input a 1 , . . . ,a m ð Þand output b 1 , . . . ,b m ð Þrequires O(m : log 2 m) auxiliary variables and O(m : log 2 m) clauses. SAT encodings for the constraints that specify that after T time moments the network must contain at least m, mƒn active agents and the constraints of the kind wt(a 1 , . . . ,a n )ƒI, wt(l 1 , . . . ,l n )ƒL are produced in a similar way.
It is easy to see that in the general case, if we encode the evolution of network G with n vertices during T moments of time, then in the CNF obtained the number of variables and clauses will be upper-bounded by O T : n 2 : log 2 n ð Þ . Taking into account the theorems proved above for the combinatorial problems considered we can study only cases when Tƒn{I{L.
We would like to briefly mention algorithms underlying the solvers that we have used to study the proposed models. As we said above, the book [16] is probably the most complete source of information about the algorithms for solving SAT. There are several classes of such algorithms and their effectiveness is justified by their ability to solve real practical problems. To solve SAT instances encoding the combinatorial problems outlined above we used modern CDCL solvers, basic design features of which are described in [28]. This choice is motivated first by the fact that CDCL solvers provide us with exact solutions, and, second, these particular algorithms successfully cope with many hard SAT instances, for example, with instances that encode some cryptanalysis problems.

Computational Experiments
In our computational experiments we constructed networks according to the known models of random graphs. In particular, we used the Gilbert model [29] also known as the Erdos-Renyi model [30] (see also [31]), the Watts-Strogatz model [32] and the Barabasi-Albert model [33].
Informally the process of constructing tests for combinatorial problems outlined above for SBNs in which simple agents are conformists (tests for networks of anticonformists are generated in a similar way) looks as follows.
1. We generate a random oriented simple graph (without loops and without multiple arcs) with n vertices, in the form of adjacency matrix where main diagonal is filled with zeros. 2. For each of n vertices we generate a conformity threshold that is randomly selected from ½0,1 according to the uniform distribution.
3. For a fixed number of time moments T we encode to SAT the problem of search for a disposition of instigators with given constraints on their number (Problem 1). 4. The CNF obtained is given to a SAT solver. 5. If the SAT solver managed to solve the instance, before exceeding the time limit, and found a satisfying assignment, then the corresponding disposition of instigators is extracted. 6. For the instigators disposition obtained we encode the problem of search for a disposition of loyalists with given constraint on their number (Problem 2). 7. The CNF obtained on the previous step is given to a SAT solver. 8. If the SAT solver managed to solve the provided instance and found a satisfying assignment then a corresponding disposition of loyalists is extracted.
Now let us briefly describe random graph models that we used. In fact, original models generate undirected graphs, so we modified them to take into account all features of formulas (1) and (2) (the neighborhood V i of vertex u i is formed by vertices in G that have arcs going to u i ).
When generating a graph according to the Gilbert-Erdyos-Renyi model we fix the parameter p[½0,1 that is the probability of an arc. Then an arbitrary element g ij , i=j of an adjacency matrix of graph G takes the value of 1 with probability p and the value of 0 with probability 1{p.
An important feature of the original Watts-Strogatz model is that random graphs generated according to this model have the small-world property that can often be observed in real world networks. The parameters of the Watts-Strogatz model include k, k §2 and b[½0,1. First we generate a regular lattice network with n vertices, where each vertex u i , i[f1, . . . ,ng is connected with an arc u j ,u i À Á with k 2 vertices on either side of u i if k is even. If k is odd then we can consider t k 2 s and q k 2 r similar arcs u j ,u i À Á . On the second stage of graph generation each arc u j ,u i À Á with probability b is rewired to u s ,u i ð Þ, where s is chosen according to the uniform distribution from some subset of f1, . . . ,ng in such a way that in the resulting graph there will be no loops and no multiple arcs.
The Barabasi-Albert model is important because it allows one to generate random networks with scale-free property. The construction of a network according to the Barabasi-Albert model can be considered as an iterative process consisting of Sz1 steps. On the step s~0 an initial network G 0 with m 0 vertices is built. The result of each step s[f1, . . . ,Sg is the network G s which is constructed by adding to G s{1 one new vertex u' connected to mƒm 0 existing vertices of G s{1 . The procedure of constructing edges (u,u'), u[G s{1 is probabilistic and is referred to as preferential attachment. According to this procedure for u' and an arbitrary v[G s{1 the edge (u,u') is added to G s with probability Step s[f1, . . . ,Sg lasts, i.e. the corresponding probabilistic experiments are repeated, until vertex u' is connected with m vertices of the graph G s{1 . In our experiments we use the following modification of the Barabasi-Albert model. An open cycle, i.e. a cycle in which an edge connecting the first and the last vertices is removed, is used as an initial network G 0 . On each step s[f1, . . . ,Sg the probabilistic experiment is carried out for all pairs of the kind (u',u) where u[G s{1 , and as a result of the step new vertex u' is connected with §m existing vertices. In the final network every edge (u',u) is replaced by a pair of arcs (u',u) and (u,u').
Defining the conformity thresholds of agents in real networks is a highly nontrivial task and in each particular case it requires a thorough analysis of the corresponding specifics. Since the main goal of our computational experiments was to test the general applicability of the SAT approach to the study of the considered models, we chose conformity thresholds for each vertex randomly (according to the uniform distribution on (0,1)).
In the series of experiments we considered networks with 500 vertices. SAT instances were solved using the Plingeling SAT solver [34] working on 32 threads (two 16-core AMD Opteron 6276 CPUs with 64 GB RAM). The corresponding results are shown in tables 1, 2 and 3.
Below we demonstrate several figures that illustrate the dynamics of SBNs with 30 vertices modeling the conforming behavior under the influence of instigators and loyalists. In Fig. 4 the evolution of the network generated according to the Barabasi-Albert model is displayed. In Fig. 5 we show that some networks (the particular network displayed was generated in accordance with the Watts-Strogatz model) are highly vulnerable to the influence of instigators. For the network shown it is sufficient to place one instigator to activate the whole network in 6 steps. However, it is possible to find such disposition of 9 loyalists that transforms the network to a state with the majority of inactive agents.
Intuitively, one of the most natural strategies of constructing dispositions of instigators is to place them into vertices with the largest number of outgoing arcs. In Fig. 6 (the network is generated according to the Erdos-Renyi model) we show, that even if we forbid instigators to replace agents with the most advantageous positions (in the sense explained above), that does not exclude the existence of other possible variants of dispositions of instigators that transform the network into states with the majority of active agents. The corresponding constraints that forbid instigators and loyalists to take place of particular vertices are quite easily encoded into SAT.
Also we considered optimization variants of Problem1 and Problem2, i.e. to find corresponding dispositions of instigators and loyalists of a minimal cardinality. These problems can also be effectively reduced to SAT using techniques described above. On the current stage we managed to solve corresponding problems for networks with 100-150 vertices.
In tables 1, 2 and 3 we present the information about the size of encodings and about the time required to solve Problems 1 and 2 on determining dispositions of instigators or loyalists. We considered networks with 500 vertices. For each value of parameter p in case of Erdos-Renyi networks, combination of values of b and k in case of Watts-Strogatz networks, and m in case of Barabasi-Albert networks we generated 10 different tests. Note, that solving time can greatly vary even within one test series (for a particular random graph model). From our point of view it can be explained by the fact that among randomly generated tests there can appear instances that are very complex for the particular SAT solver. However, such instances appear quite rarely while the majority of tests are solved relatively fast.

Additional Materials
In this section we propose some additional materials. In particular, there are videos that illustrate the dynamics of collectives of conformists under the influence of instigators and loyalists (in the context of Problems 1 and 2 outlined above). Corresponding collectives are represented by SBNs with 200 vertices. On S1 Video we show the behavior of the Barabasi-Albert network under the influence of 29 instigators and 60 loyalists. S2 Video demonstrates the dynamics of the Watts-Strogatz network with 10 instigators and 60 loyalists. On S3 Video the behavior of the Erdos-Renyi network under the influence of 16 instigators and 44 loyalists is shown.

Conclusions and Future Works
In the present paper we introduce the models of collective behavior, that are based on the synchronous Boolean networks, and study several phenomena related to conformity and anticonformity. In the context of the proposed models we formulate several combinatorial problems on the search for dispositions of agents with special properties (instigators and loyalists) in a network. To these combinatorial problems we applied modern algorithms for solving the Boolean satisfiability problem (SAT). We do not pretend that the results of our paper can be directly applied to practice since all computational experiments were performed for artificially generated networks with a random structure. However, our main goal was to show the principal possibility of solving corresponding combinatorial problems for networks with hundreds of vertices.
We believe that the use of various SAT parallelization techniques will make it possible to develop our approach in such a way that it will be applicable to networks with 1000 and more vertices. The corresponding methods will be useful in the study of networks that represent strongly connected components extracted from the real world networks with a much greater number of vertices. The vulnerability of such strongly connected components to instigators in our opinion can have highly undesirable consequences for the corresponding large networks. To extract strongly connected components from real world networks, one can use methods from [35].
As we mentioned above, determining correct thresholds is probably the hardest stage of construction of any collective behavior model. In our experiments we generated such thresholds randomly. To study real world processes this task should be performed by a specialist in a relevant field of science (such as economy, biology, sociology, psychology, etc.).
Unfortunately we could not obtain the results similar to theorems 1 and 3 for the networks, in which simple agents are represented both by conformists and anticonformists. In Fig. 7 we show how such network starting from the state in which all simple agents are inactive enters the cycle of length 4. It means that these networks display more complex behavior than that described by theorems 1 and 3.
Also it should be noted that the key condition in theorems 1 and 3 is that all simple agents must be either all inactive or all active at the initial time moment. If we drop this condition, the corresponding networks can display the behavior different from that described by Theorems 1 and 3. For example in Fig. 8 we demonstrate the cycle of length 3 for the network with instigators, where all simple agents are conformists, but at the initial state there are both active and inactive simple agents. We would like to note that for the models proposed it is possible to study more complex dynamical properties using the formalism of quantified Boolean formulas with two quantification levels (2QBF) [36]. Suppose that W is a disposition of instigators and Y is a disposition of loyalists. Then, for example, the condition that there exists such disposition of instigators, that for any Using Boolean Networks to Model Collective Behavior disposition of loyalists the network, starting from the state with inactive simple agents after several time moments transitions to a state in which almost all simple agents are active, can be described using the 2QBF of the following kind: This condition can be considered as an improved variant of condition describing the vulnerability of the network to instigators. To solve such problems one can use modern 2QBF-solvers [36], [37]. We can also take into account any constraints on the cardinality of W and Y.
Finally, one natural extension of the proposed models is to assign various types of weights to network arcs and modify vertex weight functions accordingly. Arc weights can represent social pressure, authority, etc. for each particular member of a collective. In addition to that, it would be interesting to study the dynamics of networks in which weight function of a vertex can take into account the influence of vertices that are at a distance w1 in G from the vertex considered. All the listed aspects can be quite easily implemented into corresponding SAT encodings. We plan to do it in the nearest future.