Next Article in Journal
Combining the A* Algorithm with Neural Networks to Solve the Team Orienteering Problem with Obstacles and Environmental Factors
Next Article in Special Issue
Optimization of PFMEA Team Composition in the Automotive Industry Using the IPF-RADAR Approach
Previous Article in Journal
Structure Approximation-Based Preconditioning for Solving Tempered Fractional Diffusion Equations
Previous Article in Special Issue
A Regret-Enhanced DEA Approach to Mapping Renewable Energy Efficiency in Asia’s Growth Economies
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Polarization in Political Rallies: A Markovian Agent-Based Model for Opinion Dynamics

Department of Engineering, University of Messina, 98166 Messina, Italy
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Algorithms 2025, 18(6), 308; https://doi.org/10.3390/a18060308
Submission received: 18 February 2025 / Revised: 10 May 2025 / Accepted: 20 May 2025 / Published: 23 May 2025

Abstract

:
One of the most studied problems among researchers in recent years is how individuals form their opinions. This problem has become more urgent with the advent of social networks, which can easily influence a huge number of followers and have become increasingly pervasive over time. The produced effect is the rise of polarized opinions among different groups of people. Understanding polarization is of great relevance across various application domains, such as economics and politics. Opinion dynamics has often been studied by exploiting the popular Friedkin–Johnsen model. In this paper, we propose a different modeling approach based on the Markovian agents paradigm for deriving metrics characterizing polarized opinions. The main goal of this work is to demonstrate the potential of the Markovian agent modeling paradigm for the analysis of opinion dynamics. The main advantages of Markovian agents are the ease of setting a large number of behavioral parameters, spatial distribution of agents, scalability, and numerical tractability. We extend our previous work, in which we analyzed a peer assembly and validated it against other commonly used modeling approaches. In our opinion, the Markovian agent approach offers an effective modeling framework due to its scalability and flexibility in handling parameters that describe the behavior of individuals in the opinion formation process. The context we will discuss is inspired by election rallies, where an assembly attends a speech by a political candidate. The crowd consists of individuals with diverse initial political opinions, and the candidate seeks to polarize them toward his/her own political stance.

1. Introduction

Analysis of opinion dynamics has become a crucial area of research in various fields, including sociology, political science, and network theory. Understanding how opinions spread, evolve, and stabilize within a population is essential for addressing societal challenges such as political polarization, misinformation, and social influence. Traditional models—such as the DeGroot model, bounded confidence models, and voter models—have provided valuable insights into the mechanisms driving opinion formation and change. However, these approaches often rely on simplified assumptions that may not fully capture the complexities of real-world opinion dynamics.
Opinion polarization has emerged as a critical area of study, especially in the age of social networks, where information spreads rapidly and influences large audiences. This phenomenon, marked by an increasing divide in public opinion, has significant implications across various domains, including politics, economics, and social dynamics.
Agent-based models offer a powerful tool for simulating complex systems composed of heterogeneous, autonomous entities whose interactions give rise to emergent macro-level patterns. Unlike system dynamics, which relies on aggregated variables and differential equations to model feedback loops and system-wide behaviors, agent-based models operate at the micro-level, modeling individual agents with distinct behaviors, decision-making rules, and interaction patterns. This allows agent-based models to capture non-linearities, spatial heterogeneity, adaptation, and stochastic behaviors more naturally than system dynamics. Agent-based models are particularly useful when individual variability, local interactions, or bottom-up phenomena are central to the system’s dynamics, such as ecological systems, social behavior modeling, epidemiology, and market dynamics. While system dynamics excels in offering broad, high-level insights into the feedback structure of a system, agent-based models provide a granular, dynamic perspective that reveals how simple rules at the micro-level can lead to complex macro-level outcomes.
In the context of opinion dynamics, agent-based models have emerged as a powerful methodological tool for investigating how individual-level behavior and social interactions lead to emergent collective phenomena. Although system dynamics models provide useful information on the macro-level evolution of opinions through aggregated feedback loops and continuous variables, they often lack the resolution to capture the heterogeneity and stochasticity inherent in individual decision-making. Agent-based models, on the contrary, simulate discrete agents with unique attributes—such as varying persuasiveness, trust, or resistance to change—and model their interactions within structured or evolving social networks [1,2]. This enables the exploration of critical dynamics such as consensus formation, polarization, opinion clustering, and the role of network topology in shaping public discourse [3,4]. Moreover, agent-based models can incorporate mechanisms such as bounded confidence, social reinforcement, and external media influence, which are difficult to represent within traditional social dynamics frameworks [5,6]. As such, agent-based models offer a complementary and often indispensable approach to studying opinion dynamics, particularly when the goal is to understand how local interaction rules scale up to system-wide behavioral patterns.
Traditional models, such as the Friedkin-–Johnsen framework, have been extensively used to analyze opinion dynamics. However, these models often face limitations in capturing complex interactions and achieving the scalability required for real-world scenarios.
This paper proposes a novel approach to studying opinion polarization using the Markovian agents modelling paradigm. This method offers enhanced scalability and flexibility, enabling the dynamic analysis of polarized opinions within heterogeneous groups. By studying a political rally scenario—where a speaker attempts to influence a diverse audience—our analysis explores how spatial distribution, individual predispositions, and interaction patterns shape the formation and evolution of polarized opinions. The findings aim to provide deeper insights into opinion dynamics and contribute to more effective strategies for managing polarization in social systems.
The proposed Markovian agent-based model is a computational framework exploiting continuous-time Markov chains (CTMCs). Here, we want to use it to analyze how individuals in structured groups influence each other’s opinions. Agents transit between discrete states (e.g., Support or Oppose) based on interaction rules, spatial proximity, and predefined influence rates. The framework exhibits the following key features:
  • Markovian Agents: Each agent (e.g., a politician or rally attendee) is modeled as a CTMC. Transitions between opinion states occur at specific rates (e.g., a politician persuades listeners at rate λ s ) (i.e., a speaker at a rally emits messages to convert opponents; listeners switch opinions stochastically, influenced by the speaker’s rate ( λ s ) and their neighbors’ opinions—Figure 1a).
  • Spatial Interactions: Agents interact based on their physical or network proximity (e.g., grid neighbors) (i.e., listeners in a crowd influence only adjacent neighbors; central listeners receive more messages and shift opinions faster than those at the edge—Figure 1b).
  • Message-Passing: Agents send “messages” (e.g., arguments) during state transitions or while holding an opinion. Reception depends on perception probabilities (i.e., a listener in Oppose sends messages to nearby agents to convert them, but neighboring Support agents might reject these with probability α Figure 1c).
  • Analytical Solution: Unlike simulation-heavy models, the proposed approach uses coupled differential equations to compute opinion distributions over time (i.e., with 400 listeners and one speaker, the proposed approach solves 801 equations to predict how many support the speaker at any given moment, avoiding costly Monte Carlo simulations).
In addition to offering a solid theoretical framework for analyzing opinion dynamics, the proposed approach also presents several key strengths that highlight its versatility and effectiveness across a range of applications:
  • Transient Analysis: It enables the tracking of opinion evolution in real time, allowing questions such as “How many supporters will the speaker gain in the next two hours?” to be addressed.
  • Spatial Dynamics: The model captures spatial phenomena such as opinion clustering (e.g., resistant groups forming in corners of a crowd) and can represent hierarchical roles within the population, distinguishing between leaders and followers.
  • Scalability: It efficiently handles large populations (up to 10,000 agents) by relying on analytical equations rather than computationally expensive simulations.
Overall, the proposed model is particularly well-suited for the analysis of social systems with structural and temporal constraints. It proves especially effective in structured environments (e.g., rallies, workplaces), where interactions follow spatial or organizational patterns; in time-bounded scenarios (e.g., elections, emergencies), where opinion dynamics must be evaluated within fixed time frames; and in systems with clearly defined roles (e.g., influencers, centralized leaders), where hierarchical relationships drive collective behavior.
The remainder of this article is organized as follows. In Section 2, we review the related literature and highlight the limitations of existing approaches. Section 3 provides a description of the proposed algorithm, focusing on its theoretical foundations and suggesting a software tool in support of computational implementation. Section 4 presents the reference scenario used to analyze opinion polarization and details the model developed based on the approach introduced in Section 3Section 5 presents the results of the analysis performed under different environmental conditions. Finally, Section 6 concludes with a discussion of implications, potential applications, and future research directions.

2. Literature Review

The opinion dynamics and the diffusion of innovations represent interdisciplinary research fields involving sociology, economics, psychology, and computational sciences. Numerous theoretical and experimental models have been developed to understand how opinions form, evolve, and influence collective behavior. Given the importance of the topic, opinion dynamics have been the subject of significant research activity. Below, we will examine some of the articles considered most relevant to our work.
In [7], the authors explored the dynamics of new product adoption through the CODA (continuous opinions and discrete actions) model, which considers continuous opinions and discrete actions. This model demonstrated that the fat-tailed distribution for late adopters emerges naturally, finding confirmation in empirical data. The model posits that the refusal to adopt a new idea or product is increasingly viewed by nearby agents as evidence against the product. Their work is particularly relevant because it shows a significant ability to bring out Rogers’ normal curves without assuming behavioral heterogeneity among consumers. Rogers’ innovation diffusion curves divide the population into different categories, such as innovators, early adopters, early majority, late majority, and laggards. This division is based on the idea that there are different behaviors among individuals, implying a variety of propensities to adopt innovations.
Subsequently, in [8], Fu et al. proposed a modified version of the Hegselmann–Krause model for a population based on groups with limited and heterogeneous trust. Their simulations are very interesting, particularly demonstrating that closed-minded agents dominate the number of final clusters, influencing opinion dynamics based on the proportion and size of subgroups. These results have important implications for strategies in group debates and for understanding real dynamic processes.
Similarly, Shang in [9] identified the critical value, the ratio between high and low confidence levels, for consensus formation. It could be interesting, in future work, to identify the critical value also in our model.
Later, in [10], the authors modified the original models of Deffuant et al. and Hegselmann and Krause to incorporate both an external mass media and a heterogeneous distribution of confidence levels. An interesting analysis they perform is to consider two cases: one where only two confidence limits are considered and another where each individual in the system has their characteristic confidence level. They found that, in the absence of mass media, the diversity of confidence limits can enhance the system’s ability to reach consensus. They also show that the persuasive power of the external message is optimal for intermediate levels of heterogeneity. Their simulations also highlighted the existence, for some parameter values, of a counterintuitive but very interesting effect, where the persuasive power of mass media decreases if the intensity of the mass media is too high. Our model currently does not include agents representing mass media capable of reaching everyone, but it is possible to add them easily, and this could become a topic for a potential extension.
Around the same period, Diao et al. in [11] proposed a model that introduces social influence and its feedback mechanism. An interesting result they obtained is that if the initial density of one of the two parties is greater than 0.8 , then the enormous imbalance leads to complete consensus.
In [12], Waagen et al. analyzed a generalized version of the “naming game” with zealots. The interesting thing is that they consider an arbitrary number of opinions. Additionally, they assume an infinite population but assume that all individuals are neighbors, and thus each individual can interact with anyone else. Our model also has the concept of space, which can be understood in various ways, from the simplest physical distance to the distance in terms of opinion. The authors demonstrated that the critical point for the dominance of an opinion depends on the fraction of zealots.
In another study, Fan et al. [13] developed a model based on social judgment, SJBO (social judgment-based opinion). The authors distinguish between internal opinions and observable choices and incorporate both compromise between similar opinions and repulsion between dissimilar opinions. Our proposed approach is also able to represent such features, even if this work does not deal with them.
An additional interesting work is [14]; a nonlinear model that introduces a bias parameter for each individual has been proposed, generalizing the DeGroot model. The authors analyze how the presence of a bias parameter modifies the behavior and stability of equilibrium in the opinion dynamics model and how the structure of the interaction network among individuals can influence opinion polarization and the formation of opinion clusters. Our model already includes this feature, as it is capable of capturing the diversity of individual predispositions in the assimilation of opinions.
Biondi et al. in [15] examined the conditions under which the Friedkin–Johnsen model can lead to opinion polarization in a social network, depending on the social ties between nodes and their individual susceptibility to others’ opinions. They also developed a very interesting methodology to identify specific opinion vectors capable of bringing the network to a polarized state.
Another interesting work, perhaps the one most similar to ours, is [16]. Here, the authors generalize the DeGroot and Friedkin–Johnsen models, allowing each vertex to have attributes that can influence opinion dynamics. While their analysis is performed only at equilibrium, ours focuses also on the transient phase. Analyzing the transient phase can be very useful for understanding the evolution of opinions: comprehending how opinions change and spread in the population during the initial period is crucial. Transient phases can reveal how an initial, possibly minority, opinion can grow, spread, or disappear before reaching equilibrium. Additionally, for identifying opinion leaders, during the transient phase, it is possible to identify individuals or groups that significantly influence others’ opinions. These “opinion leaders” can have a disproportionate impact during the early periods of opinion evolution. For opinion stability: analyzing transient behavior helps to understand how long it takes for a community to stabilize on a dominant opinion. This is important for evaluating the resilience of opinions and the likelihood that a new opinion can emerge and challenge the status quo. For conflict prevention and management: during transient periods, opinions can be more polarized and subject to rapid changes. This is a critical time for interventions aimed at mitigating conflicts or promoting constructive dialogue before opinions consolidate into fixed positions. Finally, for the effects of social interactions, studying the transient phase can help to better understand the effects of social interactions and communication networks on opinion diffusion. One more notable difference between the approach in [16] and ours is that all individuals have the same influence capacity, meaning it is not possible to represent the heterogeneity of individuals’ influence capacities. In the model we introduce in this work, there are three types of individuals: speakers and two kinds of listeners, but there is not any limit to enhancing their number. Moreover, in [16], there is no variability of influences based on state; an individual in a state representing a completely different opinion from the initial one will tend to influence with the same probability. This condition with our model can be achieved by exploiting the concept of distance, understood as opinion distance. The concept of distance in [16] seems to not be used for this purpose.
Finally, a comprehensive review of classic and recent models of social dynamics has been provided by tutorials on modeling and analysis of dynamic social networks in [17,18]. These works offer a rigorous analysis of convergence and stability properties, discussing future perspectives for control in social and techno-social systems and highlighting the challenges of scalability and experimental validation on big data.
Most of the models in the articles cited above are based on French–DeGroot and Friedkin–Johnsen models. These models are based on interacting agents, whose interactions are described through a graph. Each agent is characterized by an opinion represented as a continuous quantity. The evolution of the set of agents’ opinions is described by discrete-time recurrence equations or by their continuous-time counterparts through systems of differential equations. Although the French–DeGroot and Friedkin–Johnsen models, along with their generalizations, are widely used in modeling opinion dynamics, a different approach has also been proposed. In the latter case, opinions are modeled as discrete quantities, and time can be either discrete or continuous. In this context, Markov chains are often employed to describe the behavior of interacting agents, and the evolution of opinions is of a stochastic nature [19]. Since the (discrete) state of a Markov chain encapsulates the state/opinion of each agent within the system, the stochastic approach corresponds to a macro-description, as opposed to the micro-description offered by Friedkin–Johnsen type models. Of course, the probability distributions employed play a crucial role in describing the evolution of opinion dynamics, and the better they represent reality, the more representative the transient evolution will be close to the actual behavior.
The use of Markov chains thus offers both flexibility and good accuracy but can easily lead to intractable models as the number of agents increases, due to the rapid growth of the state space. To address this issue, lumpability techniques and approximations exploiting model symmetries can be employed to reduce the dimensionality of the problem; however, this often limits the range of scenarios that can be treated, as specific structural constraints in the model must be satisfied.
In this work, an approach based on the Markovian agent paradigm [20] is proposed, with the aim of combining the advantages of both micro- and macro-level descriptions of a system of interacting agents. The micro-level description is achieved by representing each individual through a continuous-time Markov chain, while the macro-level description is obtained by explicitly modeling the interactions among individual agents, resulting in a comprehensive model that captures the collective state of all individuals within the system.
The explicit representation of each individual as a Markovian agent offers a twofold advantage:
  • The resulting comprehensive model is more descriptive with respect to a monolithic Markov chain, as it clearly distinguishes between the internal dynamics of each agent (micro-representation)—whose states are associated with different discrete opinions—and the interactions among agents as well as between agents and the external environment (macro-representation);
  • The comprehensive model remains tractable even in the presence of a large number of modeled individuals (agents), unlike approaches based on a monolithic model.
Moreover, a model involving a large number of agents does not necessarily require resolution through simulation, as demonstrated in [21]. Although a closed-form solution is not obtained, the adopted approach generates a system of ordinary differential equations, from which the state probabilities of each individual agent are derived through a numerical solution. To this end, in the present work we employed the MAGNET tool [22], a C language library that facilitates the definition of agents and their interactions, from which it derives the equations governing the model dynamics and solves them using appropriate numerical integration algorithms for transient analysis.
Another probabilistic approach can be found in [23]. In the aforementioned study [23], a set of probability matrices (one per opinion) is defined for each agent. These matrices store the probabilities of opinion changes when interactions occur between pairs of agents. During simulations, these matrices are used to stochastically determine the new opinion of an agent (at the microscopic level) following an interaction. The analysis operates in discrete time, and the microscopic results are aggregated into macroscopic metrics, such as the number of agents with specific opinions. Mean-field analysis is also used to derive an approximate analytical model at the macroscopic level, which describes the number of agents with a given opinion out of N, as N approaches infinity. In contrast, the modeling approach we explore in this paper is based on a continuous-time framework where each agent is explicitly represented using interacting Markov chains, resulting in an analytical model at the microscopic level, without the need to resort to simulation. Furthermore, the parameters governing the behavior of agents depend on internal dynamics, interactions with other agents, and environmental factors, all of which are directly modeled. Thanks to its structure, the Markovian agent approach investigated here is capable of representing diverse agent behaviors, as we exemplify in the application of Section 4. In contrast, Kozitsin’s technique is based on the underlying assumption that all agents exhibit identical behavior.
The purpose of this paper is thus to show how Markovian agent model (MAM) paradigm is an appropriate tool to model opinion dynamics, more than to introduce a new further model of opinion dynamics.
This paper is a follow-up to our previous study [24], in which agents are modeled through interacting Markov chains. We extend it by considering many agent classes, representing different personal opinion dynamics.

3. The Markovian Agent Modelling Paradigm

Markovian agent models (MAMs) represent systems as a collection of agents distributed across a geographical area and are characterized by continuous-time Markov chains.In these models, there are two primary types of transitions: local transitions and induced transitions. Local transitions capture the internal dynamics of a Markovian agent (MA), while induced transitions model interactions between MAs based on their states.
The original MAM framework introduced by [25] focused on agent interactions through message exchange. However, this approach was later expanded in [20] to incorporate a variety of interaction mechanisms among the entities involved.
In this paper, we exploit the message-passing interaction paradigm because it is particularly suited to the type of interactions we are examining. Thus, we will briefly outline the MAM analytical framework with a focus on this interaction mode.
An MA can send messages to other MAs either upon the occurrence of a local transition or while remaining in a specific state. The propagation of these messages is governed by the perception function  u ( · ) . This function enables the receiving MA to be aware of the state from which the message originated, based on the agent’s position in the space, the message routing policy, and the transmission characteristics of the medium. This awareness helps the receiving MA decide on the appropriate response. Agents can be distributed across a geographical space V . They may belong to different classes and exchange various types of messages.
We represent a Markovian agent (MA) using the graphical notation illustrated in Figure 2. For an MA of class c, a local transition from state i to state j is depicted with a solid arc, annotated with the transition rate q i j c . When a transition occurs, a message m might be sent with probability g i j c ( m ) ; this is represented graphically by a dotted line originating from the transition that sends the message, labeled with S ( m ) to indicate which message is sent. Additionally, an MA can send a message during its stay in a particular state. This is represented by self-loops, where a self-loop in state i signifies the emission of message m at rate λ i c , similar to how messages are sent during state transitions. It is important to note that self-loops do not affect the local behavior of MAs due to the memoryless property of the exponential distribution, unlike in the traditional theory of continuous-time Markov chains.Instead, self-loops influence the behavior of a remote MA that receives the corresponding message. For example, in Figure 2, message m 1 is sent when transitioning from state i to state j, and a self-loop is associated with state i to emit message m 2 at rate λ i c . Induced transitions due to the reception of a message are graphically represented by dashed arcs between the involved states, labeled with R ( m ) . In Figure 2, for instance, a transition from state i to state k is induced by the reception of message m 3 .
Formally, a Multiple Agent Class, Multiple Message Type  M A M is defined by the tuple:
M A M = { C , M , V , U , R } ,
where C = { 1 C } is the set of agent classes, and M = { 1 M } is the set of message types. V is a finite space over which MAs are distributed, and U = { u 1 ( · ) u M ( · ) } is a set of M perception functions (one for each message type). The density of the agents is regulated by functions R = { ξ 1 ( · ) ξ C ( · ) } , where each component ξ c ( v ) , with c C , counts the number of class c agents placed in position v V . Each position could be identified by a cell numbered with an integer with respect to some reference system, since in this work the space is considered discrete.
Each agent M A c of class c is defined by the tuple:
M A c = { Q c , Λ c , G c ( m ) , A c ( m ) , π 0 c }
where Q c = [ q i j c ] is the n c × n c infinitesimal generator matrix of the CTMC that describes the local behavior of a class c agent, with its element q i j c representing the transition rate from state i to state j (and q i i c = j i q i j c ). Λ c = [ λ i c ] is a vector of size n c whose components represent the rates at which the Markov chain reenters the same state; this can be used to send messages at a specified rate without leaving a state. G c ( m ) = [ g i j c ( m ) ] and A c ( m ) = [ a i j c ( m ) ] are n c × n c matrices that represent, respectively, the probability that an agent of class c generates a message of type m during a transition from state i to state j, and the probability that an agent of class c accepts a message of type m in state i and immediately transits to state j. π 0 c is a probability vector of size n c that represents the agent initial state distribution.
The perception function of a multi-agent model (MAM) is formally defined as u m : V × C × I N × V × C × I N I R + . The values u m ( v , c , i , v , c , i ) represent the probability that an agent of class c, located at position v , and in state i, perceives a message m generated by an agent of class c located at position v in state i . Perception functions enable different instances of agents deployed in space to interact by sending messages to each other. These interactions are technically implemented through the matrix Γ c ( t , v , m ) , which is a diagonal matrix collecting the total rate of received messages m by an agent of class c in position v . Element γ i i stores the total rate of received messages when the agent is in the state i.
The elements of Γ c ( t , v , m ) are computed as follows. β j c ( m ) represents the total rate at which messages of type m are generated by an agent of class c in state j. This is evaluated using the equation
β j c ( m ) = λ j c g j j c ( m ) + k j q j k c g j k c ( m ) .
Let π j c ( t , v ) denote the probability vector of class c agent in position v . The total rate of messages received by an agent of class c, in state i, in position v , and at time t is given by
γ i i c ( t , v , m ) = v c = 1 C j = 1 n c u m ( v , c , i , v , c , j ) β j c ( m ) π j c ( t , v ) .
Rates in (4) are collected into the diagonal matrix Γ c ( t , v , m ) = diag ( γ i i c ( t , v , m ) ) , which is used to compute the kernel (infinitesimal generator matrix) of a class c agent at position v at time t:
K c ( t , v ) = Q c + m Γ c ( t , v , m ) A c ( m ) I .
The overall MAM thus evolves according to a set of coupled differential equations
d π c ( t , v ) d t = π c ( t , v ) K c ( t , v )
under the initial condition π 0 c , v V , c C .
As described in detail in [21,25], the main advantage of MAM is that it maintains low state-space complexity by modeling dependencies between agents through messages, rather than defining the cross-product of their state spaces.

Comparison with Classical Opinion Dynamics Models

To contextualize our MAM within the broader field of opinion dynamics, it is crucial to compare its foundations and features with existing modeling paradigms. While traditional approaches such as the DeGroot model, bounded confidence models (e.g., Hegselmann–Krause and Deffuant–Weisbuch), and voter models have significantly advanced our understanding, MAM introduces a distinct set of core assumptions and operational mechanisms. A key differentiating aspect lies in its foundation on CTMCs, where agents stochastically transit between discrete opinion states according to specified transition rates. This contrasts with most established models that operate in discrete time and rely on deterministic or probabilistic update rules based on opinion distances or network topology.
In MAM, message passing is the fundamental interaction mechanism: agents emit messages either during transitions or while residing in a state, and reception by other agents can probabilistically induce state changes, modulated by perception functions that reflect individual openness to influence. This explicit modeling of communication processes distinguishes MAM from models that assume direct averaging (DeGroot), bounded confidence thresholds (Hegselmann–Krause), or simple mimicry (voter models). Another key advantage of MAM lies in its capacity for analytical computation of opinion distributions over time, without relying exclusively on large-scale simulations. In contrast, most other models offer either simulation-based insights or closed-form analytical results only under restrictive or highly symmetric assumptions. Furthermore, MAM’s inherent scalability and flexibility enable the inclusion of heterogeneous agents and spatial locality—both essential for capturing real-world dynamics. Its ability to capture transient evolution makes it particularly suited to time-bounded scenarios such as political rallies, public health campaigns, or emergency communication.
To clarify these distinctions, we present in Table 1 a structured comparison of representative models, including their assumptions, features, limitations, and application domains. This highlights how MAM complements existing approaches, offering a versatile and analytically tractable framework for studying opinion dynamics in temporally and spatially structured settings. Our focus here is to demonstrate the efficacy of this paradigm in modeling opinion polarization in dynamic assemblies, with broader potential across social, political, and economic systems where belief evolution and heterogeneous communication are central.

4. Reference Scenario and Proposed Model

The scenario analyzed in this paper is inspired by an electoral rally, where a political candidate addresses an audience, promotes the ideas of their platform, and seeks to persuade individuals to vote for them. The audience is made up of people with different initial political beliefs: the same political party as the speaker and the opposite one. When the rally begins, listeners belonging to the speaker’s political faith will have his/her same opinion and a high propensity to accept the message; listeners of contrary faith, on the other hand, will have a lower propensity to change their opinion by listening to the speaker’s arguments. Since the listeners share the same environment, they influence one another in an attempt to sway those holding different opinions. Obviously, the candidate could have higher oratory ability and a greater strength of conviction than the people in the audience. Spatial distribution also plays a role: while the candidate influences everyone, the attendees can only interact with neighborhoods.
For representing the scenario mentioned above, we used three classes of agents: one for modeling the speaker and two for representing the two types of listeners as shown in Figure 3. Emission and perception of messages are detailed in the following. Class Sp is used to model the speaker. The only agent in class Sp is modeled by a single state CTMC representing the speaker’s opinion, let’s say O p i n i o n 0 , that cannot change. The classes L 0 and L 1 are used for modeling individuals; they may have one opinion between two: either O p i n i o n 0 , the same as the speaker, or O p i n i o n 1 . Accordingly, agents in both classes L 0 and L 1 are characterized by two states, op0 and op1, modeling the two possible opinions an individual may have. Classes L 0 and L 1 differ for different initial probability vectors π 0 L 0 and π 0 L 1 , so that individuals with different opinions are easily implemented in the model.
S p class agent generates messages m s p through a self-loop with rate λ S ; λ S is the rate characterizing the ability of the speaker to change the other’s mind. Attendees also try to move others toward their own opinions, interacting with them. However, we assumed that a single individual cannot spontaneously change his own opinion. Accordingly, we assumed that the infinitesimal generator matrix of each CTMC is equal to 0 (square matrix with null elements). Indeed, the local behavior of a generic class agent represents the intrinsic behavior of either the speaker or the listeners. When an agent in both classes L 0 and L 1 is in the state o p 0 ( o p 1 ), it emits messages m n e 0 ( m n e 1 ) with intensity λ 0 0 and λ 1 0 ( λ 0 1 and λ 1 1 ) through self-loops exploiting the same mechanism used in class S p for inducing others to change opinion. On the other hand, an attendee could change his/her mind because convinced by other listeners with different opinions. When an agent is in the state o p 0 , its state could change to o p 1 induced by a transition firing when message m n e 1 is received. At the opposite, if an agent is in state o p 1 , its opinion could change because influenced by other agents in state o p 0 as well as by the speaker; the induced transitions from o p 1 to o p 0 model this situation by exploiting the reception of messages m s p and m n e 0 .
Regardless of the effort put into inducing others to change their opinion, each individual has a different inclination to accept the reasoning of others. We model this behavior by modulating the acceptance probability of each perceived type of message. Thus, we use different perception probabilities for the same type of message in different agent classes.
Based on the description above, the characteristic quantities formally defining the three agent classes are:
π 0 S p 1 , π 0 L 0 1 0 π 0 L 1 0 1
Q S p = 0 , Q L 0 = Q L 1 = 0 0 0 0 , Λ S p = λ S , Λ L i = λ i 0 0 0 λ i 1 ,
A L i ( m s p ) = 0 α i s 0 0 , A L i ( m n e 0 ) = 0 α i 0 0 0 , A L i ( m n e 1 ) = α i 1 0 0 0 , i = 0 , 1 .
The quantities above describe the general behavior of agents. Table 2 summarizes the meaning of each parameter and provides notes describing their association with the MAM framework.
A block diagram illustrating the model dynamics protocol is shown in Figure 4. Specifically, Figure 4a shows the dynamics protocol of a generic listener belonging to class L i and fig:protocolb shows the dynamics protocol of the speaker.
When these agents are deployed over a space V , the perception function u m ( ) has to be defined between each couple of them for all the exchanged messages m. The values of u m ( v , C , s , v , C , s ) represent the probability that an agent of class C, in position v , and in state s, perceives a message m generated by an agent of class C in position v in state s . We assume the spread of the agents belonging to both the classes L 0 and L 1 over a ( n × n ) squared grid with one agent per grid cell; on the other hand, only one agent in the class S p is deployed. A position will be denoted by a couple v = ( x , y ) , with x , y { 0 , , n 1 } .
Whereas the messages emitted by the agent in class S p are perceived by all the others, we assume agents in the grid interact only with their immediate neighborhoods. Let us denote with v s the position in the space where the only agent in class S p is located. The perception functions implementing the scenario we introduced above are:
u m s p ( v , L i , o p 1 , v s , S p , o p 0 ) = 1 ,
u m n e 0 ( v , L i , o p 1 , v , L j , o p 0 ) = 1 , v , v V : | x x | + | y y | = 1 0 , otherwise ,
u m n e 0 ( v , L i , o p 0 , v , L j , o p 1 ) = 1 , v , v V : | x x | + | y y | = 1 0 , otherwise ,
i , j { 0 , 1 } .
By solving a Markovian agent model, state probability vectors π ( t , v ) of all deployed agents are derived. Their knowledge allows us to get information about the emerging opinion and how it takes form. In fact, we are able to derive whether an individual in position v tends to have either O p i n i o n 0 or O p i n i o n 1 at time t by evaluating state probabilities π 0 ( t , v ) and π 1 ( t , v ) .
Although the scenario we implemented with the model above is inspired by an electoral rally, the latter is more general, and it is useful in many other real contexts.

5. Model Analysis and Numerical Results

In this section, we present and discuss results obtained by analyzing the model introduced in Section 4 under several conditions of parameter settings with the aim to show the potentiality of the proposed approach in exploring the related opinion dynamics behavior.
The performed experimentation aims to understand if the speaker is able to have the majority of consensus from the assembly assuming the crowd is heterogeneous. The space is a ( n × n ) grid and N 0 ( t ) agents, over N = n × n , with opinion o p 0 are located in the space at time t; the remaining N 1 ( t ) = N N 0 ( t ) will have opinion o p 1 . N 0 ( t ) and N 1 ( t ) are r.v. whose value at time t = 0 depends on the spatial distribution of listeners. We experimented with two different scenarios: (1) the number of agents within both class L 0 and class L 1 are randomly scattered in the grid; (2) a similar initial fraction of agents has been set as in scenario, (1) but they have all been located in a rectangular area in the middle of the grid. The two scenarios are denoted Random and Rectangular, respectively. For instance, Figure 5 shows both Random and Rectangular initial distribution of individuals into a 20 × 20 grid. Individuals with O p i n i o n 0 are depicted as a white box, whereas black boxes represent O p i n i o n 1 oriented individuals; 25 % of the population has O p i n i o n 0 in the scenarios depicted in Figure 5.
It is worth noting that even if the model here introduced has the aim to analyze the opinion dynamics of listeners during an election rally, its validity is much more general, and it can be used for several different applications. Due to the consideration above, we will not explicitly state the time unit used, leaving it general and denoting it simply with “u”. In the election rally application, it should be assumed to be “hours”.
Several parameters can be tuned in our proposed model: the induction rate of the agent in the S p class ( λ S ), and the induction rates of the agents in the L 0 and L 1 classes ( λ 0 0 , λ 0 1 , λ 1 0 , λ 1 1 ); the perception probabilities that regulate the tendency to listen to the opinion of others ( α 0 S , α 0 0 , α 0 1 , α 1 S , α 1 0 , α 1 1 ); and the relative number r = N 1 ( 0 ) N of agents in class L 1 . We choose to keep the perception probabilities and the induction rates of L 0 and L 1 constant and to vary λ S and r. The parameter values used in our experimentation are summarized in Table 3.
The experimented scenario is made by 401 agents belonging to three classes as introduced in Section 3. The agent modeling the speaker is characterized by one state; all of the remaining 400 agents are made by two states, thus the model generates a system of 801 non-homogeneous ordinary differential equations as described in Section 3 and Section 5. We assumed a set of initial probability vectors as in Equation (7).
The generated ODE system has been numerically solved by exploiting explicit embedded Runge-Kutta solver evaluating 101 time points, from 0.0 to 5.0 , with 0.05 as step and tolerance equal to 10 6 . The model has been implemented in C, with the support of MAGNET C library [22], which is a tool for the analysis of models based on the Markovian agent modeling paradigm (MAGNET is available at http://perf.unime.it/magnet/accessed on 22 May 2025). By exploiting MAGNET primitives, we implemented the description of agents’ structure (Equations (8) and (9)), their interactions (Equations (10)–(12)), and their spatial distribution. MAGNET implements the generation and solution of the ODE system.
Let Ω ( t ) denote the number of agents with opinion O p i n i o n 0 at time t. It can be derived by counting the agents in state o p 0 . It is easy to understand that, in a specific time instant t ¯ , Ω ( t ¯ ) is a discrete random variable distributed according to a Poisson binomial distribution in a collection of N = n × n trials with success probabilities π ( v , t ¯ ) . Based on this latter remark, we evaluated the probability mass function of Ω ( t ¯ ) , f Ω ( t ¯ ) [ k ] , and its expected value μ Ω ( t ¯ ) = E [ Ω ( t ¯ ) ] as follows:
f Ω ( t ¯ ) [ k ] = V V k v V π 0 ( v , t ¯ ) v V ¯ ( 1 π 0 ( v , t ¯ ) ) ,
μ Ω ( t ¯ ) = v V π 0 ( v , t ¯ )
where π 0 ( v , t ¯ ) is the probability the agent in position v is in the state o p 0 at time t ¯ , V k is the set of all subsets of k positions in the grid, and V ¯ = V V . Computation of f Ω ( t ¯ ) [ k ] in Equation (13) is quite expensive but can be efficiently completed by exploiting the FFT like described in [26].
Figure 6 depicts f Ω ( t ¯   =   2.5 u ) [ k ] for both the two scenarios when the number of spread agents in class L 1 changes and the speaker induction rate is λ S = 2.5 u 1 ; we also put in evidence all the expected values in the ground 0 (red lines). Figure 6a,c,e are related to the Random scenario with r = 0.25 , 0.5 , 0.75 , respectively, whereas Figure 6b,d,f show results of the Rectangular one, assuming rectangular regions whose dimensions were 10 × 10 , 14 × 14 and 17 × 18 ; these latter are chosen in order to have the r parameter as similar as possible to the Random scenario ( r = 0.25 , 0.49 , 0.77 ) and make them comparable. The results show that Random scenarios produce more polarized final configurations of the speaker’s opinion, and also the mean value of agents with the same opinion of the speaker is higher even if the initial number of initial opponents is the same. Such a kind of dynamic is a general result; this is shown by the graphs of Figure 7, where the expected values of Ω ( t ) are depicted for all the scenarios and with different speaker influence rates, as depicted in the legend; even if some degree of polarization is always reached, the Rectangular scenario is less prone to produce a diffusion of speaker opinion both in terms of the number of agents in class L 1 with a changed opinion and the time at which a given polarization level is reached because its dynamic is slower. This behavior is due to the fact that most of the agents in class L 1 (with an opinion different from the speaker) do not interact with agents in class L 0 ; thus, their opinion is reinforced from the neighbors (they support each other), and only a very good speaker, with λ S 4.0 u 1 , can significantly produce a polarization toward its opinion.
One of the advantages of the model introduced in this work is the ability to derive transient measures, which are important when the application does not require knowledge of the steady state but of established time intervals, such as the case study of an electoral rally. In this sense, the set of distributions at a time instant of interest t ¯ can be analyzed to determine whether the required conditions are met. Figure 8 shows the set of f Ω [ k ] at t ¯ = 0.25 u parameterized with the speaker induction rates (written in the legend). We used different scale axes for making the drawing readable; otherwise, it is difficult to grasp the characteristics of the depicted distribution functions. We can see that when the speaker is not strong enough in convincing people with contrary opinions, just a few of them change their minds; it happens when λ S 1.5 u 1 and r = 0.5 , when λ S 3.0 u 1 and r = 0.75 in the Random scenario, and when λ S 3.0 u 1 and r 0.5 when λ S 4.0 u 1 and r 0.75 in the Rectangular scenario. This is quite crucial information for planning the speaker’s speech within a given time instant t ¯ .
Since the aim of a political rally is to convince as many people as possible in order to obtain a majority, we also evaluated the probability over time that at least half plus one of the people have reached the speaker’s opinion in the different scenarios. Figure 9 depicts the quantity M 0 ( t ) = k > N 2 + 1 f Ω [ k ] that estimates the probability the majority of the agents has opinion o p 0 at different time points. From the graph, it is easy to see the final effect depends on both the speaker induction rate λ s (the parameter of the set of curves reported in the legend) and the time length. It is worth noting that spatial distribution also has its significance. Although in the scenario where r = 0.25 there is a majority regardless of the speaker’s characteristics (Figure 9a,b), as expected, in the other situations it does not happen. In the Random scenario, it is necessary to have at least 2.5 u of time for a reasonable certainty of reaching the majority when r = 0.5 , if the speaker has an influencing capacity equal to λ s = 1.0 u 1 (Figure 9c); while a speaker with λ S = 3.0 u 1 cannot reinforce the audience to keep the majority. In the Rectangular scenario, the situation improves when r = 0.5 , while it becomes worse than the Random scenario, where it is necessary to have an induction rate higher than 3.0 , and, in any case, it is necessary to have longer times, with the same speaker’s induction rate, to obtain high probabilities to reach the majority of the consensus. The speaker needs to devote more effort (Figure 9e,f) to convincing individuals when most of them are against the opinion of the speaker when the assembly starts (at t ¯ = 0 u ).
The last measure we evaluated is the time required for considering the transitory expired; that is important for evaluating when no new effects emerge from the agents. We defined the transitory expiration time T T as the first time after which the probability to be in state o p 0 remains under the threshold h T for all the agents spread over the grid. In order to compute the T T value, we introduce the resolution step δ T and evaluate it as the quantity satisfying both of the two following statements:
T T : max v V [ π 0 ( v , T T ) π 0 ( v , T T δ T ) ] h T t < T T max v V [ π 0 ( v , t ) π 0 ( v , t δ T ) ] > h T
Figure 10 shows T T for the two scenarios when the speaker intensity changes, assuming h T = 0.1 and δ T = 0.05 . We can see that the Random scenario is very different from the Rectangular one; in the latter, the transitory expires similarly independently from the initial number of agents in a given class. Its maximum is around λ S = 4.5 . At the opposite, the T T value in Random scenarios has very different behaviors depending on parameter values because the lack of symmetry makes each agent’s behavior different depending on the number of neighbors in a different class.

6. Conclusions and Future Works

In this paper, we propose the use of Markovian agents for agent-based opinion dynamics modeling. Markovian agents are particularly suitable for modeling asymmetric scenarios with different kinds of individuals, each with their own opinion, and complex scenarios.
The proposed Markovian agent modeling framework complements existing approaches by providing a versatile and analytically tractable tool for studying opinion dynamics in temporally and spatially structured settings.
We showed how the interactive Markovian agent modeling paradigm is able to capture interactions between individuals, also taking into account spatial distribution that affects their behavior.
Our model demonstrated the ability to simulate the dynamics of opinion formation and polarization in a crowd during an electoral rally, where a speaker attempts to influence listeners with diverse initial opinions. The results highlighted the importance of the speaker’s influence rate and the spatial distribution of listeners in determining the final consensus. Specifically, we observed that a higher speaker influence rate significantly increases the likelihood of achieving a majority consensus, particularly in scenarios where listeners are randomly distributed. Conversely, when listeners are clustered in a specific area, the speaker’s influence becomes less effective, and achieving consensus requires more time and a higher influence rate.
One of the key advantages of our model is its ability to derive transient measures, which are crucial for applications where the focus is on understanding the evolution of opinions over a specific time frame rather than reaching a steady state. This is particularly relevant in the context of political rallies, where the goal is to maximize the number of convinced listeners within a limited time period. Our analysis of the transient phase revealed that the spatial distribution of listeners plays a significant role in the speed and extent of opinion change, with random distributions leading to faster and more widespread consensus compared to clustered distributions.
Furthermore, the flexibility of our model allows incorporation of additional factors that could influence opinion dynamics, such as the presence of mass media or the introduction of multiple speakers with varying levels of influence. Future work could explore these extensions to provide a more comprehensive understanding of opinion formation in complex social networks.
Another area of interest is the extension of the model to include more complex network structures, such as scale-free or small-world networks, which better reflect real-world social interactions. This could help in understanding how the topology of social networks influences the spread of opinions and the formation of consensus.
Finally, empirical validation of the model using real-world data from political rallies, social media platforms, or other opinion-influencing events could enhance the model’s applicability and provide more accurate predictions of opinion dynamics in various contexts. We plan to experiment with the Markovian agent approach using real-world data in future work.

Author Contributions

Conceptualization, M.S. and S.S.; methodology, M.S., F.L. and S.S.; software, M.S.; validation, M.S. and S.S.; formal analysis, M.S., M.G., F.L. and S.S.; investigation, M.S., M.G., F.L. and S.S.; resources, M.S.; writing—original draft preparation, M.S., M.G., F.L. and S.S.; writing—review and editing, M.S., M.G., F.L. and S.S.; supervision, M.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Epstein, J.M. Generative Social Science: Studies in Agent-Based Computational Modeling; Princeton University Press: Princeton, NJ, USA, 2006. [Google Scholar]
  2. Macy, M.W.; Willer, R. From Factors to Actors: Computational Sociology and Agent-Based Modeling. Annu. Rev. Sociol. 2002, 28, 143–166. [Google Scholar] [CrossRef]
  3. Castellano, C.; Fortunato, S.; Loreto, V. Statistical physics of social dynamics. Rev. Mod. Phys. 2009, 81, 591–646. [Google Scholar] [CrossRef]
  4. Flache, A.; Mäs, M.; Feliciani, T.; Chattoe-Brown, E.; Deffuant, G.; Huet, S.; Lorenz, J. Models of Social Influence: Towards the Next Frontiers. J. Artif. Soc. Soc. Simul. 2017, 20, 2. [Google Scholar] [CrossRef]
  5. Hegselmann, R.; Krause, U. Opinion Dynamics and Bounded Confidence Models, Analysis and Simulation. J. Artif. Soc. Soc. Simul. 2002, 5, 1–33. [Google Scholar]
  6. Deffuant, G.; Neau, D.; Amblard, F.; Weisbuch, G. Mixing beliefs among interacting agents. Adv. Complex Syst. 2000, 3, 87–98. [Google Scholar] [CrossRef]
  7. Martins, A.C.; Pereira, C.d.B.; Vicente, R. An opinion dynamics model for the diffusion of innovations. Phys. A Stat. Mech. Its Appl. 2009, 388, 3225–3232. [Google Scholar] [CrossRef]
  8. Fu, G.; Zhang, W.; Li, Z. Opinion dynamics of modified Hegselmann–Krause model in a group-based population with heterogeneous bounded confidence. Phys. A Stat. Mech. Its Appl. 2015, 419, 558–565. [Google Scholar] [CrossRef]
  9. Shang, Y. Consensus formation of two-level opinion dynamics. Acta Math. Sci. 2014, 34, 1029–1040. [Google Scholar] [CrossRef]
  10. Pineda, M.; Buendía, G. Mass media and heterogeneous bounds of confidence in continuous opinion dynamics. Phys. A Stat. Mech. Its Appl. 2015, 420, 73–84. [Google Scholar] [CrossRef]
  11. Diao, S.M.; Liu, Y.; Zeng, Q.A.; Luo, G.X.; Xiong, F. A novel opinion dynamics model based on expanded observation ranges and individuals’ social influences in social networks. Phys. A Stat. Mech. Its Appl. 2014, 415, 220–228. [Google Scholar] [CrossRef]
  12. Waagen, A.; Verma, G.; Chan, K.; Swami, A.; D’Souza, R. Effect of zealotry in high-dimensional opinion dynamics models. Phys. Rev. E 2015, 91, 022811. [Google Scholar] [CrossRef] [PubMed]
  13. Fan, K.; Pedrycz, W. Opinion evolution influenced by informed agents. Phys. A Stat. Mech. Its Appl. 2016, 462, 431–441. [Google Scholar] [CrossRef]
  14. Xia, W.; Ye, M.; Liu, J.; Cao, M.; Sun, X.M. Analysis of a nonlinear opinion dynamics model with biased assimilation. Automatica 2020, 120, 109113. [Google Scholar] [CrossRef]
  15. Biondi, E.; Boldrini, C.; Passarella, A.; Conti, M. Dynamics of opinion polarization. IEEE Trans. Syst. Man, Cybern. Syst. 2023, 53, 5381–5392. [Google Scholar] [CrossRef]
  16. Fraiman, N.; Lin, T.C.; Olvera-Cravioto, M. Opinion dynamics on directed complex networks. Math. Oper. Res. 2024, 50, 838–870. [Google Scholar] [CrossRef]
  17. Proskurnikov, A.V.; Tempo, R. A tutorial on modeling and analysis of dynamic social networks. Part I. Annu. Rev. Control 2017, 43, 65–79. [Google Scholar] [CrossRef]
  18. Proskurnikov, A.V.; Tempo, R. A tutorial on modeling and analysis of dynamic social networks. Part II. Annu. Rev. Control 2018, 45, 166–190. [Google Scholar] [CrossRef]
  19. Banisch, S.; Lima, R.; Araújo, T. Agent based models and opinion dynamics as Markov chains. Soc. Netw. 2012, 34, 549–561. [Google Scholar] [CrossRef]
  20. Bobbio, A.; Cerotti, D.; Gribaudo, M.; Iacono, M.; Manini, D. Markovian Agent Models: A Dynamic Population of Interdependent Markovian Agents. In Seminal Contributions to Modelling and Simulation: 30 Years of the European Council of Modelling and Simulation; Al-Begain, K., Bargiela, A., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 185–203. [Google Scholar] [CrossRef]
  21. Bruneo, D.; Scarpa, M.; Bobbio, A.; Cerotti, D.; Gribaudo, M. Markovian agent modeling swarm intelligence algorithms in wireless sensor networks. Perform. Eval. 2012, 69, 135–149. [Google Scholar] [CrossRef]
  22. Scarpa, M.; Molica, G. MAGNET: A Software Library for Markovian Agent Networks. In Proceedings of the Valuetools 2017: 11th EAI International Conference on Performance Evaluation Methodologies and Tools, Venice, Italy, 5–7 December 2017; pp. 164–169. [Google Scholar] [CrossRef]
  23. Kozitsin, I.V. A general framework to link theory and empirics in opinion formation models. Sci. Rep. 2022, 12, 5543. [Google Scholar] [CrossRef]
  24. Scarpa, M.; Serrano, S.; Longo, F. A Scalable Opinion Dynamics Model Based on the Markovian Agent Paradigm. In European Workshop on Performance Engineering; Springer: Cham, Switzerland, 2022; pp. 185–199. [Google Scholar]
  25. Gribaudo, M.; Cerotti, D.; Bobbio, A. Analysis of On-off policies in Sensor Networks Using Interacting Markovian Agents. In Proceedings of the 2008 Sixth Annual IEEE International Conference on Pervasive Computing and Communications (PerCom), Hong Kong, China, 17–21 March 2008; pp. 300–305. [Google Scholar] [CrossRef]
  26. Hong, Y. On computing the distribution function for the Poisson binomial distribution. Comput. Stat. Data Anal. 2013, 59, 41–51. [Google Scholar] [CrossRef]
Figure 1. Proposed framework: (a) entities are modeled as Markovian agents influencing others by sending messages; (b) Interactions between agents can be modeled on their physical or network proximity; (c) Reception of messages depends on agents’ perception probabilities.
Figure 1. Proposed framework: (a) entities are modeled as Markovian agents influencing others by sending messages; (b) Interactions between agents can be modeled on their physical or network proximity; (c) Reception of messages depends on agents’ perception probabilities.
Algorithms 18 00308 g001
Figure 2. Graphical representation of MAs.
Figure 2. Graphical representation of MAs.
Algorithms 18 00308 g002
Figure 3. Graphical representation of MA classes: Agent class S p (a) and classes L i with i = 0 , 1 (b).
Figure 3. Graphical representation of MA classes: Agent class S p (a) and classes L i with i = 0 , 1 (b).
Algorithms 18 00308 g003
Figure 4. Blok diagrams illustrating the model dynamics protocol: (a) listener in class L i , (b) speaker.
Figure 4. Blok diagrams illustrating the model dynamics protocol: (a) listener in class L i , (b) speaker.
Algorithms 18 00308 g004
Figure 5. Initial distribution of individuals with different opinions spread over a grid space in a Random scenario (a), and Rectangular scenario (b).
Figure 5. Initial distribution of individuals with different opinions spread over a grid space in a Random scenario (a), and Rectangular scenario (b).
Algorithms 18 00308 g005
Figure 6. Probability distribution of number agents in state o p 0 , Ω ( t ¯ = 2.5 u ) [ k ] , for both Random (a,c,e) and Rectangular (b,d,f) scenarios (red lines in the ground 0 put in evidence the expected values).
Figure 6. Probability distribution of number agents in state o p 0 , Ω ( t ¯ = 2.5 u ) [ k ] , for both Random (a,c,e) and Rectangular (b,d,f) scenarios (red lines in the ground 0 put in evidence the expected values).
Algorithms 18 00308 g006
Figure 7. Expected number of agents in state o p 0 , μ Ω ( t ) , over the time for both Random (a,c,e) and Rectangular (b,d,f) scenarios.
Figure 7. Expected number of agents in state o p 0 , μ Ω ( t ) , over the time for both Random (a,c,e) and Rectangular (b,d,f) scenarios.
Algorithms 18 00308 g007
Figure 8. Distribution of Ω ( 0.25 ) of agents in state o p 0 for both Random (a,c,e) and Rectangular (b,d,f) scenarios.
Figure 8. Distribution of Ω ( 0.25 ) of agents in state o p 0 for both Random (a,c,e) and Rectangular (b,d,f) scenarios.
Algorithms 18 00308 g008
Figure 9. Expected number of agents in state o p 0 over the time when r = 0.25 (a,b), r = 0.5 (c,d) and r = 0.75 (e,f).
Figure 9. Expected number of agents in state o p 0 over the time when r = 0.25 (a,b), r = 0.5 (c,d) and r = 0.75 (e,f).
Algorithms 18 00308 g009
Figure 10. Transitory expiration time length T T of Random (a) and Rectangular (b) configurations.
Figure 10. Transitory expiration time length T T of Random (a) and Rectangular (b) configurations.
Algorithms 18 00308 g010
Table 1. Comparison of representative opinion dynamics models.
Table 1. Comparison of representative opinion dynamics models.
ModelMain AssumptionsSpecial FeaturesLimitationsTypical Applications
DeGrootContinuous opinions; fixed network; deterministic averagingSimple consensus dynamics; analytical tractability in steady state No transient analysis Trust modeling; information diffusion; collaborative decision-making
Friedkin-Johnsen Stubbornness; fixed influence weights; continuous timeModels resistance to influence; convergence dynamicsRequires symmetric networks for closed-form solutionsGroup influence analysis; sociological modeling
Hegselmann-KrauseBounded confidence; synchronous updates; discrete timeOpinion clustering; tolerance modelingRelies on simulations; limited analytical results for realistic casesPolitical fragmentation; echo chamber formation; public discourse analysis
Deffuant-WeisbuchPairwise bounded confidence; random interactionsCaptures gradual belief change; probabilisticPrimarily simulation-based; lacks spatial awarenessCultural drift; polarization dynamics; social contagion
MAM (This work)Markovian agents; message-driven transitions; spatially distributedCaptures transients; message-level modeling; fully analyzableMore complex model setup; validation requires real-world mappingPolitical rallies; emergency crowd dynamics; spatio-temporal influence propagation
Table 2. Model parameters.
Table 2. Model parameters.
ParameterDefinitionNotes
π 0 S p Initial distribution of the speaker’s state probabilityThe speaker has a single state associated with opinion o p 0 , therefore the initial state probability distribution will be [ 1 ] and will remain unchanged throughout the observation period.
π 0 L i Listeners in class L i initial state distributionListeners have two states, each associated with opinion o p 0 and o p 1 , respectively. The initial state probability distribution is [ 1 0 ] for listeners in class L 0 and [ 0 1 ] for listeners in class L 1 . This distribution will be influenced by the opinions of the speaker and neighboring listeners throughout the observation period.
Q S p Intrinsic behavior of the speakerInfinitesimal generator matrix of the CTMC is equal to 0 . The speaker cannot spontaneously change their opinion throughout the entire observation period. This is a trivial consequence of the fact that the speaker was modeled with a single state.
Q L i Intrinsic behavior of listeners in class L i Infinitesimal generator matrix of the CTMC is equal to 0 . We assumed the listeners in both classes L 0 and L 1 cannot spontaneously change their opinion throughout the entire observation period.
Λ S p The rate at which the speaker attempts to influence the listeners’ opinionsIt is a vector of size 1, representing the rate at which the speaker’s Markov chain reenters its only state, o p 0 , and sends messages to all listeners. Higher rates imply stronger influence
Λ L i The rate at which the listeners in class L i attempt to influence their neighbors’ opinionsIt is a 2 × 2 matrix, representing the rate at which the listener’s Markov chain reenters both states, o p 0 and o p 1 , and sends messages to neighboring listeners. The diagonal element at position ( 0 , 0 ) represents the rate to induce o p 0 , while the diagonal element at position ( 1 , 1 ) represents the rate to induce o p 1 . Off-diagonal elements must be 0. Higher rates imply stronger influence
A L i ( m s p ) The probability with which a listener belonging to class L i accepts the speaker’s influence and changes their opinion from o p 1 to o p 0 It is a 2 × 2 matrix. Only the element at position ( 0 , 1 ) can be non-zero, as the speaker exclusively influences towards opinion o p 0 , and the listener can only be influenced when they hold opinion o p 1
A L i ( m n e 0 ) The probability with which a listener belonging to class L i accepts the influence of a neighbor with opinion o p 0 and changes their opinion from o p 1 to o p 0 .It is a 2 × 2 matrix. Only the element at position ( 0 , 1 ) can be non-zero, as a neighbor with opinion o p 0 influences towards opinion o p 0 , and the listener can only be influenced when they hold opinion o p 1
A L i ( m n e 1 ) The probability with which a listener belonging to class L i accepts the influence of a neighbor with opinion o p 1 and changes their opinion from o p 0 to o p 1 .It is a 2 × 2 matrix. Only the element at position ( 1 , 0 ) can be non-zero, as a neighbor with opinion o p 1 influences towards opinion o p 1 , and the listener can only be influenced when they hold opinion o p 0
Table 3. Model parameter values; induction rate value unit is 1 / u .
Table 3. Model parameter values; induction rate value unit is 1 / u .
nN λ 0 0 λ 0 1 λ 1 0 λ 1 1 α 0 S α 0 0 α 0 1 α 1 S α 1 0 α 1 1
20400 1.0 0.1 0.1 1.0 0.9 0.9 0.1 0.2 0.2 0.9
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Scarpa, M.; Garofalo, M.; Longo, F.; Serrano, S. Polarization in Political Rallies: A Markovian Agent-Based Model for Opinion Dynamics. Algorithms 2025, 18, 308. https://doi.org/10.3390/a18060308

AMA Style

Scarpa M, Garofalo M, Longo F, Serrano S. Polarization in Political Rallies: A Markovian Agent-Based Model for Opinion Dynamics. Algorithms. 2025; 18(6):308. https://doi.org/10.3390/a18060308

Chicago/Turabian Style

Scarpa, Marco, Marco Garofalo, Francesco Longo, and Salvatore Serrano. 2025. "Polarization in Political Rallies: A Markovian Agent-Based Model for Opinion Dynamics" Algorithms 18, no. 6: 308. https://doi.org/10.3390/a18060308

APA Style

Scarpa, M., Garofalo, M., Longo, F., & Serrano, S. (2025). Polarization in Political Rallies: A Markovian Agent-Based Model for Opinion Dynamics. Algorithms, 18(6), 308. https://doi.org/10.3390/a18060308

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop