Mathematical Programming for the Dynamics of Opinion Diffusion

: The focus of this paper is on analyzing the role and the choice of parameters in sociophysics diffusion models by leveraging the potentialities of sociophysics from a mathematical programming perspective. We ﬁrst present a generalised version of Galam’s opinion diffusion model. For a given selection of the coefﬁcients in our model, this proposal yields the original Galam’s model. The generalised model suggests guidelines for possible alternative selection of its parameters that allow it to foster diffusion. Examples of the parameters selection process as steered by numerical optimisation, taking into account various objectives, are provided.


Introduction
Opinion diffusion is a fundamental aspect of human interaction, playing a pivotal role in the spread of innovations, and the emergence of consensus.Understanding how opinions spread and evolve within social networks is crucial for comprehending the emergence of collective behavior, the formation of public opinion, and the polarisation of societies.
Galam's opinion diffusion model (see [6]) provides a framework for investigating and understanding the dynamics of opinion formation in social systems.Galam's model sheds light on the mechanisms that drive opinion dynamics.In particular, Galam's model describes the formation of collective opinion convergence processes using concepts from statistical physics.To analyse them, along with several generalisations of the model, the authors of the current paper have proposed the alternatives in Ref. [7] (showing some drawbacks when applying Galam's model with a relatively small number of agents), and in Ref. [8] (where a novel subset of agents, namely the opinion leaders, are introduced, to duly represent a possible communication bias).Furthermore, additional literature covering a number of keynote issues can be found in Refs.[5,9,10] and the references therein.
The standard Galam's model in Ref. [6] assumes that individuals in a group influence and are influenced by their peers.After several iterations within repeated group discussions, each agent may consequently influence the opinion diffusion.Galam's stylised model simplifies the complexity of opinions by considering a binary state, where individuals can adopt either of two possible opinions, thus allowing a straightforward mathematical analysis of the diffusion process.
We suggest a generalisation of Galam's model and then offer evidence in an optimisation framework that some of the diffusion parameters can be successfully adjusted in order to steer the diffusion process.Combining Galam's model with specific Linear Programming (LP) formulations, we take into account both theoretical and numerical results concerning the role of the model's parameters in order to better control the dynamics of the diffusion.Namely, we aim at maximising the probability that an opinion can spread among agents.
This paper is organised as follows.The essential characteristics of Galam's model [6] are recapped in Section 2.Then, in Section 3, we present and discuss a generalisation of Galam's model.The optimisation of the parameters of the new model via linear programming allows one to speed up opinion diffusion at a fixed step of the process: the optimisation problem is discussed in Section 4, while Section 5 provides numerical examples of its resolution.Section 6 discusses a dynamic programming extension of the optimisation problem that optimises the values of the parameters along the whole diffusion process, till convergence.Section 7 contains final remarks and concludes the paper.

Recap of Galam's Model
This section reviews the foundational elements of Galam's model [6].Think of a group of N people (agents), each of whom may hold one of two opposing views (let us say, '+' or '−'), regarding a specific issue.These agents meet, for several repeated rounds within subgroups of smaller cardinality, to converse and possibly change one anothers' minds.
Each agent at round (time) t has a probability a k of being a member of a subgroup of size k, and L is the maximum allowed size of groups.In the original formulation of Galam's model, the values a 1 , . . ., a L are exogenous parameters such that Joining a group discussion at time t, any agent may, at the beginning of the subsequent time t + 1, modify their position (e.g., '+' becomes '−' or vice versa) in accordance with a unique law: the majority rule.Indeed, all agents in a subgroup take the position of the majority in that group in the end of time t.The rule for reversing opinion is slightly biased in favour of the negative opinion '−', since tie breaks are in favour of '−'.This may lead to a substantial bias in the case where the subgroup has an even number of members.
P+ constitutes the threshold value such that when N + (0)/N is greater than P+ , then all agents will eventually have opinion '+'.Conversely, when t → ∞ all the agents will definitely think '−' if N + (0)/N < P+ .The value P+ is the fixed point of Equation (1) and is called the killing point or tipping point of the model.In Figure 1, one can observe the dynamics described by relation (1), when the largest cardinality L of the subgroups takes integer values in the interval [3,20] and a k = 1/L, for any k: for each of the 18 curves, the killing point is identified by the intersection with the bisector line other than the extreme points (0, 0) and (1,1).Observe that for small values of L no killing point appears (or equivalently, it coincides with the extreme point (1, 1)). Figure 2 shows a zoomed in perspective of Figure 1.[3,20] and a k = 1/L, for any k: magnification of the area of intersections among curves.

Capturing Additional Dynamics Using a Generalised Galam's Model
According to model (1), a strict majority of members with positive opinion is a necessary and sufficient condition to have opinion '+' for all the subgroup members.
Since the ultimate choice in a group is frequently the product of a discussion, rather than a simple tally of the two opposing viewpoints in the group, a rule that is so rigorous yet so straightforward could not correctly reflect the actual opinion dynamics in practice.As an illustration, think about the propagation of political opinions.The probability that everyone in the group would share the same view (e.g., +) at the close of a conversation may rise smoothly with the number of members who had that opinion prior to the meeting.As a second application, the reader may consider the audience of social networks, where the dynamics of information spreading was widely investigated in the dedicated literature (see, e.g., [11]).
Accordingly, we suggest to generalise Galam's model (1) taking into account a softer dynamics of opinion change, i.e., without using rigid majority as a necessary and sufficient condition to shift the entire group to the same view.In particular, we assume that after the conversations, all agents in a group will have opinion '+' with a probability α k j that is dependent on the size k of the group and the number j of agents that had opinion '+' before the discussion.We use the following definition to model the relationship between the probabilities of having an opinion '+' before (i.e., P + (t)) and after (i.e., P + (t + 1)) discussion (see [12] for a preliminary version of the model): Model (2) generalises model ( 1), since it is possible to select indeed the probabilities {α k j } that exactly replicate model ( 1) (see also Figure 3): ( Figure 3.For a given 1 ≤ k ≤ L, the model (3) considers the above step-shaped choice for the coefficients {α k j }.In particular, if j < k/2 + 1 then α k j = 0, otherwise α k j = 1, so that this choice corresponds exactly to obtain the original Galam's model (1).
As mentioned, probabilities {α k j } should reasonably increase with the number j of '+' in a subgroup, and decrease with respect to the size of the group k.In this regard, it is reasonable to expect for the probability α k j to become negligible when the number j of '+' in a subgroup is relatively small (i.e., much lower than the strict majority), and to become close to 1 as the number of '+' noticeably increases (i.e., higher than strict majority).In general, the probability that all agents in the subgroup will adopt the opinion '+' is conceivably a function rising from zero to one as j increases.If one assumes that this function of j is linear, one may precisely define the probabilities α k j as (see Figure 4) When z k j = h = 0, the probabilities defined in Equation ( 4) are exactly the same as in Equation ( 3).The value of z k j in (4) represents a shift (either positive or negative) from the value k/2 + 1 , while the slope of the ramp in Figure 4 is 1/(2h).
To better grasp the geometric insight behind the choice of the parameters in (4), let us consider the simple numerical example reported in Ref. [6], where L = 4, a 1 = 0, and a 2 = a 3 = a 4 = 1/3 (and h = z k j = 0 for all j and k).As reported in Ref. [6], the killing point (KP) lies in between 0.84 and 0.87 (see Figure 5).Then, in Figure 6, there is also the model (2) with the choice (4), after setting h = z k j = 0.5 for any j and k.One can immediately infer that the dynamics of Galam's model [6] is definitely spoiled when the choice for the coefficients {α k j } in Equation ( 3) is replaced by Equation ( 4).Equivalently, even in case P + (t) = 1 (complete consensus among agents to think +) then the choice (4) imposes a regression towards the stable point given by the origin.
Hence, the presence of a killing point for Galam's model seems to be strictly related to the expression (1), and introducing the coefficients {α k j } definitely also spoils the killing point.Moreover, one observes that, in case the majority rule is not explicitly applied in Equation ( 1), then the dynamics of the model is strongly altered.
Nevertheless, the model (2) retains a number of properties and can suggest fruitful results, following both of the next guidelines: • it provides clues on the perspective for studying the process of diffusion of information; • it may suggest proper ways to control information spreading among agents.At least a couple of intriguing issues in applications can steer the choice of the coefficients {α k j }, ranging from small-medium-to large-scale (number of agents) applications: • One Period Analysis.One may assess values for {α k j } so that, considering at time t the probability P + (t), one miximizes the probability P + (t + 1) at time t + 1.In this regard, the values {α k j } represent costs for steering the information among agents and fostering the positive opinion: the larger {α k j } (i.e., higher costs) the larger the probability to convey a group to opinion '+'.Certainly, the combination of the proper values for each of the coefficients {α k j } is strongly related to the value P + (t), the probabilities {a k }, and the binomial coefficients C k j ; • Multi-Period Analysis.Similarly to the previous item, one may decide to select {α k j } such that, considering again at time t the probability P + (t), one miximizes the probability P + (T) at time T > t, and compute the entire sequence P + (t + 1), P + (t + 2), . . ., P + (T) of intermediate probabilities.
The last two scenarios can be declined in a variety of contexts, including production and marketing, where consumers play the role of agents and the aforementioned perspectives may be the answer to the question: what is (if any) the necessary extra effort in terms of advertising campaign, in order to promote a certain spread of the products or customers' expectations on items?In this regard, the quantities {α k j } summarise the resulting effort, while from a mathematical programming perspective they represent unknowns to be assessed.This also suggests that a number of additional questions may arise adopting the model (2), mapping relevant practical instances where a tentative forecast is sought in order to plan the use of (possibly scarce) resources to control the process of diffusion of the information.For the sake of brevity, we itemise below some proposals that are representative but not exhaustive: • Feasibility Problem.Given the value of P + (t) and the target value P, one may determine a set of values for the coefficients {α k j } such that, starting at t from P + (t), at time T > t, P + (T) ≥ P; • Focus Group Problem.Given the value of P + (t) and the target value P and the time T > t, one may be interested to determine a set of values for the coefficients {α k j } such that α M , where α m , α M are possible bounds, and P + (T) ≥ P.This scenario models a specific interest on those subgroups of cardinality k.

Single Period Maximisation of Diffusion
As from the analysis in Section 3, one of the possible proposals to couple the dynamics described through the model ( 2) with a single period optimisation framework, is given by the following LP scheme: The last optimisation problem assumes that the value P + (t) is given, so that both the objective function and the constraints are linear in the set {α k j }.Though the meaning associated with the objective function is relatively clear, for the constraints some clarifications seem necessary: • the constraints in Equation ( 6) state that for a given dimension k of a subset, larger values of the number of agents thinking '+' imply a larger probability α k j ; • similarly, in the constraints in Equation ( 7), when the number of agents thinking '+' remains constant, the larger the set cardinality (i.e., k), the smaller the probability α k j ; • the constraint in Equation ( 8) expresses the overall cost (i.e., it is a budget constraint) allowed to assess the probabilities {α k j }, at time t; • since the quantities {α k j } need to represent probabilities, they are required to fulfill also the constraint (9).
In order to avoid either infeasible or straightforward solutions for the optimisation Problems ( 5)-( 9), the following lemmas gives some indications on the choice of the parameter b(t), for any t (for a proof, see [12]).
Note that Lemma 1 gives a straightforward idea of the fact that the solution of the linear Programs ( 5)-( 9) is substantially nothing else but a generalisation of Equation ( 1).Furthermore, the next result will give a precise indication on the possible values for the budget b(t) in Equation ( 8).
Lemma 2. Let one be given the optimisation problems (5)-( 9) and let {α k j } be assigned as in Equation (10), for any Note that the right sides of Equation (11) explicitly give some hints for the selection of the parameter b(t) in Equation ( 8), both whether in case L it is even or it is odd.
Regarding some technicalities associated with the solution of the optimisation problems ( 5)- (9), one observes that it is a continuously differentiable problem, where all the functions are linear.Hence, it is a convex problem, so that the set of all its solutions (possibly an empty set or a singleton) is a convex set.This implies that for any given pair of its solutions, all the points in the segment joining them will be solutions, too.Moreover, being a linear program, all its (possible) solutions will lie on vertices of the feasible set, and not in the interior of the feasible set.As is known, this makes its solution relatively simple (throughout any solver based on the simplex method) and achievable in polynomial time.Hence, large-scale instances are well tractable and allow for a scalable solution in a number of applications with a great number of agents (e.g., problems involving social media or large social groups).
We complete this section highlighting that one further generalisation of the linear programs ( 5)-( 9) suggests to disaggregate the budget constraint and to replace the inequality ( 8) by the set of constraints, Observe that the value b k (t), for any k, represents a budget devoted to possibly affect the solution after working uniquely on the subsets of cardinality k.This increases the flexibility of the model without compromising its overall complexity (being the resulting model yet a linear program).

Preliminary Numerical Experience
This Section is devoted to provide a numerical experience where the potentialities of the formulations ( 5)-( 9) are exploited.In this regard, the investigation here is limited to a couple of meaningful instances.The first one is a small-scale (number of unknowns) problem, while the second one attempts to scale the first's by 100.
The above choice corresponds to possibly allow only subgroups of dimensions 1, 3, 5, 7, and 9, with probabilities that include null values and possibly repeated values.Furthermore, we set the initial percentage of the population thinking '+' to P + (t) = 65%.Finally, in order to avoid an empty feasible set in Equations ( 5)-( 9) we also selected, respectively, the values b(t) = 5 and b(t) = 10, based on Lemma 2. The outcomes of our numerical experience are obtained using the solver CPLEX 20.1.0.0 available on the NEOS Server platform [13].Let us remark that CPLEX is definitely among the best and faster solvers for LP, along with the alternative solver BARON.Our numerical experience on the above two instances is summarised as follows: • b(t) = 5: the problems ( 5)-( 9) is coded using AMPL (A Mathematical Programming Language; see [14,15]).The presolve tool in CPLEX eliminated 65 constraints from the formulation, so that the simplified problem was reduced to 65 variables and 110 linear inequality constraints.Regarding the final solution, CPLEX performed 13 dual simplex iterations (i.e., iterations of a method for LP which represents the counterpart of the simplex method, after exploiting the duality theory), with an overall time for the solution not larger than a couple of seconds.Finally, the value of P + (t + 1) found by the solver is P + (t + 1) = 0.245428625 with the set of variables (α k j ) * given by  9) is coded using AMPL and the presolve tool in CPLEX eliminated 65 constraints from the formulation, so that again the simplified problem was reduced to 65 variables and 110 linear inequality constraints.CPLEX performed 18 dual simplex iterations with an overall time for computation similar to the case where it is b(t) = 5.Finally, the value of P + (t + 1) found by the solver is with the set of variables (α k j ) * given by the matrix, Note that while allowing a larger value of the budget (for example, b(t) = 10), the solver is able to select a larger number of nonzero unknowns, so that the final value of P + (t + 1) is almost doubled with respect to the case b(t) = 5.In actual applications, this implies that, in order to obtain almost twice the effect of the previous case, on this instance twice the value of the budget must be allowed.

Large-Scale Instance
Here, we focus on the same instance of Section 5.1, where conversely, a larger number of unknowns is considered.The novel setting of the parameters for the solver are given as follows: The above choice corresponds to possibly allow all the subgroups with the same probability, and again the initial percentage of the population thinking '+' is equal to P + (t) = 65%.Similarly to the small-scale instance, we consider two values for the budget, b(t) = 50 and b(t) = 100.The computation is again performed adopting the solver CPLEX 20.1.0.0 on the NEOS Server [13].The outcomes of the resulting two instances are summarised as follows: • b(t) = 50: the problems ( 5)-( 9) is coded using AMPL and the presolve tool in CPLEX eliminated 501,500 constraints from the formulation.The overall simplified problem contained 501,500 variables and 1,001,000 linear inequality constraints.CPLEX performed 192 dual simplex iterations with a time of computation smaller than 20 s, showing that the linear model can well scale the time of computation.The final value of P + (t + 1) found by the solver is with the set of variables (α k j ) * given by and we do not report the value of the unknowns for the sake of simplicity.
Observe that in both the last two examples, given that subgroups are allowed to be quite large, despite relatively high budget values, the levels reached by the probabilities P + (t + 1) are quite low.
As a general achievement, we can immediately describe the pattern of the nonzero unknowns which was respected in all four numerical tests reported above.In particular, we can prove that the solution of the formulations (5)-( 9) only fills the principal submatrix of unknowns of order h × h, depending h on the value of the budget parameter along with the number of possible subgroups L. Finally, this also allows one to straightforwardly assess a number of null unknowns and possibly reduce the complexity of the overall formulation.

A Multi-Period Model
This Section considers a multi-period reformulation of the LP (5)- (9), in order to further generalise the model (2).In particular, in place of the single-period model ( 5)-( 9), where at time step t the quantity P + (t + 1) is maximised starting from P + (t), we can consider a multi-period approach with the ultimate goal of maximising P + (T + 1), where T is the time horizon.The latter approach is summarised in the following Nonlinear Program (NLP): The above NLP includes the unknowns α k j (t), t = 1, . . ., T; j = 0, 1, . . ., k; k = 1, . . ., L, which represent a larger number of variables with respect to Equations ( 5)-( 9).This implies that the larger the time horizon T, the larger the number of unknowns of the resulting problem formulation.Moreover, as already remarked, Equations ( 12)-( 17) represents an NLP, which in general increases the difficulty of its solution.In particular, the nonlinearities in Equation ( 13) might yield a nonconcave overall maximisation problem, which implies that a certain number of local maxima (which are not global) might arise.In addition, unlike Equations ( 5)-( 9), the feasible set of Equations ( 12)-( 17) is no longer a polyhedron, so that the final solutions are not necessarily located on the boundary of the feasible set.As a consequence, the choice of the starting value P + (1) in Equation ( 13) becomes a key factor for at least a couple of reasons: • the sequence {P + (t)} strongly depends on P + (1), in a similar fashion of the singleperiod formulation ( 5)-( 9); • the choice of {P + (t)} strongly affects the local maximum provided by the solver adopted for Equations ( 12)-(17).
Proof.Observe that from relation (2), one has the following equalities: Thus, considering that P + (1) ∈ is a constant value, the maximisation in Equation ( 12) is equivalent to the maximisation, max T+1 ∑ t=2 ∆P + (t).

Figure 1 .
Figure 1.Dynamic curves described by relation (1), when the largest cardinality L of the subgroups takes integer values in the interval [3, 20] and a k = 1/L, for any k.

Figure 2 .
Figure 2. Dynamic curves described by relation (1), when the largest cardinality L of the subgroups takes integer values in the interval [3, 20] and a k = 1/L, for any k: magnification of the area of intersections among curves.

Figure 4 .
Figure 4.For a given 1 ≤ k ≤ L, the model (4) considers the above piecewise-linear choice for the coefficients {α k j }, where z k j represents a shift with respect to the abscissa k/2 + 1 , and 1/(2h) is the slope of the ramp.
= 200: the outcomes are quite similar to the case where b(t) = 50, with 501,500 indicating the overall number of variables and 1,001,000 the linear inequality constraints.CPLEX performed 30,854 simplex iterations with a time of computation smaller than 20 s, showing again that the linear model can well scale the time of computation.The final value of P + (t + 1) found by the solver was now 2, ..., T}, where the inequality (8) is replaced by the nonlinear inequality, The proof trivially follows the guidelines of the proof for Proposition 1.Let α k j (t) be a global solution of Equations (5)-(9), for any t ∈ {1, 2, . . ., T}, where the inequality (8) is replaced by the nonlinear inequality, = 0, . . ., k; 0 ≤ λ t ≤ 1; t = 1, . . ., T; j = 0, . . ., k. (20) Proof.j j (t).