Introduction

In recent years, the study of opinion dynamics in social networks has garnered significant attention. On the one hand, the development of new media technologies, such as social media platforms like TikTok and Little Red Book, has introduced numerous social factors that directly influence opinions1. On the other hand, these technologies are profoundly altering the structure of social networks, thereby changing the mechanisms of opinion evolution2. On the other hand, opinion dynamics has extensive applications in various domains, including marketing activities, political elections, etc3,4,5. To investigate and interpret the opinion dynamics on social networks, several models are presented to simulate the consensus problems, where consensus denotes the agreement on variables of interest among agents. Freeman et al. investigated the efficiency of two algorithms for average consensus problems, where each agent must estimate the average inputs of all agents6. Besides this, the joint influence of the dynamic property of individual agent and their interaction topology on opinion dynamics is studied, which may lead to polarity, consensus, or neutrality7. Moreover, regarding the consensus problem in the leader-follower cooperative interactions, a continuous-time model with the signed model is introduced, and its convergence and stability are analyzed under various leader’s states8. Furthermore, to capture the influential cognitive links, a multi-dimension learning model is designed for opinion dynamics, whose efficacy has been successfully verified through extensive subjective simulation9. The studies mentioned above examine opinion dynamics models under various conditions; however, they focus more on the collaboration between agents’ opinions.

In opinion dynamics, competition is also a common phenomenon, which refers to situations where multiple opinions or ideas coexist and compete for dominance within a social system10,11,12. More specifically, each individual (agent) in the social network may have a specific opinion regarding a certain topic/objective in the initial stage, such as the assessment of goods, support of the election candidate, and feeling about events12. Then, agents may communicate with their friends, families, and even strangers via social networks. After spread and interaction, those opinions that have advantaged status (being close to the social norm, having more communication channels, supported by opinion leaders) will be amplified and adopted by more and more agents. Finally, some opinions may win the competition and become consensus in social networks. Notably, investigating how opinions compete and evolve has real-world significance. For example, the evolution of opinion formulation on YouTube regarding COVID-19 has been investigated13. It is reported that the extent of polarization has increased as the pandemic unfolded, likely caused by echo chambers. The framework proposed in that study is helpful for regulatory agencies to take essential actions to mitigate social media-induced polarization. In addition, a conceptual model is designed to simulate the competitive behaviors of social networking firms, simulation synthesized with archival data illustrates that the firms emphasizing value cocreation actions and undertaking complex action repertoires can outperform others14. Similarly, regarding opinion dynamics, the strategies that make certain opinions popular can also be deduced by modeling the competitive behavior with real-world data. Furthermore, the opinion formation and evolution process are studied with an abundance of data from Twitter, revealing that public opinion often evolves into an ordered state, whose finding is beneficial for public opinion monitor15.

Fig. 1
figure 1

The schematic diagram of this paper.

With the development of artificial intelligence technology and hardware circuits, utilizing neural network-related systems to simulate biological and even human behaviors and social phenomena has become a research hotspot. For instance, in16, a multi-input operant conditioning neural network incorporating blocking and competitive effects was proposed. The proposed model can realize blocking and overshadowing effects under multiple inputs and efficiently learn in complex environments. In another study, Sun et al. innovatively designed a memristor-based associative memory neural network circuit that establish a link between emotion and overshadowing17. Moreover, combining machine learning methods with causal regression methods, the influence of social bots on information diffusion in social networks was explored18. Regarding public opinion, a model combining edge computing with deep learning was proposed and applied to an emotion recognition model for network public opinion19. Additionally, using complex network theory, information dissemination theory, and disease spread theory, Zhao et al. constructed a model for disseminating emergency information20. Given this background, several models based on neural networks that describe competitive behavior have also been investigated. For example, a popular competitive model, the k-Winners-Take-All (k-WTA) model, is frequently used to simulate competitive mechanisms. k-WTA models can be classified into two types: centralized models and distributed models. For instance, the k-WTA model is transformed into a quadratic programming under certain condition, which enables the usage of schemes originally designed for solving quadratic programming to address k-WTA problems21. Similarly, Liu et al. converted the k-WTA model into a linear programming problem and proposed a neural network with a simple structure to estimate the outputs of the k-WTA model22. In addition, a novel k-WTA model has been designed, in which the coefficient k is implicitly determined by the initial state of the neuron rather than given directly22. Although these models have been proven to be effective, their centralized structure may suffer from poor scalability, uncertainty, and privacy disclosure23. To solve these limitations, a distributed k-WTA model was first introduced 24, whose global convergence was proved via Lyapunov theory. After that, Liu et al. employed a distributed k-WTA model in a location task, where the k robot closest to the target executes the tracking action25. Besides this, considering the perturbation in the system, a robust gradient-based differential k-WTA network is designed. This new model outperformed traditional models, and successfully solved the multi-robot coordination task26. In real life, each individual only interacts with its connected individuals (i.e., neighbors) in a social network, which inherently possesses a distributed structure. However, few existing works exploited the distributed k-WTA model to simulate the competitive behavior of opinions in the social network.

Therefore, this paper investigates the distributed opinion competition in social networks, whose schematic diagram is illustrated in Fig. 1. Firstly, the social networks and the links between agents are represented using an undirected graph and algebraic topology27. Furthermore, the graph is partially connected, with connections established based on the similarity of agents’ opinions. In comparison to a randomly connected topology28,29, this principle aligns more closely with real-world conditions, as individuals tend to communicate with those who share similar viewpoints. Then, a consensus model is exploited to model the interaction among neighbors. By integrating the distributed consensus model and the k-WTA model, the competitive mechanism is incorporated into the model. More specially, for those opinions in the k most favorable positions, as well as those have the top k largest input to k-WTA model, they continue to evolve and may converge to consensus. In contrast, the rest opinions may be deactivated and stop evolution. Within this mechanism, the positions of opinions are related to the social environment, making this model closer to the real-world scenarios. In addition, to guarantee the convergence of the proposed model, a modified gradient-based neural network (MGNN) is employed to drive opinion evolution, as well as solve time-varying problems. Unlike existing models30,31,32, the MGNN model enjoys a higher accuracy and low computing complexity. Up to this point, the distributed opinion competition scheme in social networks has been established. Theoretical analyses and simulation verification will also be provided in this paper. For clarity and ease of understanding, the definitions of symbols used throughout the article are provided in Table 1.

Table 1 symbols and definitions.

Preliminary

In this section, the preliminary and background are introduced to lay a basis for investigation. First, the mathematical model of the social network and the distributed communication protocol within the network are presented. Subsequently, the competition model (i.e., the k-WTA model) is introduced, detailing its definitions of inputs and outputs, as well as its mathematical model.

Description of social network

Without loss of generality, the social network topology is described with an undirected graph \(G=(\mathscr {A}, \mathscr {E}, \mathscr {M})\), where \(\mathscr {A}=(a_1, a_2, \ldots a_n)\) denotes agents set, \(\mathscr {E}\) represents edges set, and \(\mathscr {M}=[m_{i,j}]\) is the adjacent matrix of the social network. If any two agents \(a_i\) and \(a_j\) have interaction, they are said to be adjacent and there exists an undirected edge \((a_i, a_j) \subseteq \mathscr {E}\) with weight \(w_{i,j}=1\) 33,34. In addition, this work does not consider self-efficacy in the social network. In other words, there is no self-loop connection in graph G and \(m_{i,i}=0\). Regarding agent \(a_i\), a neighbor set is defined as \(\mathscr {N}_i=\{j:(a_i, a_j)\subseteq \mathscr {E}\}\). Therefore, \(\mathscr {M}\) is expressed as

$$\begin{aligned} m_{i,j}=\left\{ \begin{aligned}&w_{i,j}, \,\,\,\,j \in \mathscr {N}_i,\\&0, \,\,\,\,\,\,\,\,j \notin \mathscr {N}_i,\\ \end{aligned}\right. \end{aligned}$$
(1)

where \(w_{i,j}=w_{j,i}\) due to the undirected connection of G. Furthermore, the Laplacian matrix of G is defined as \(H=[h_{i,j}]_{n\times n}\), where \(h_{i,i}=\sum \limits _{j \in \mathscr {N}_i} m_{i,j}\) and \(h_{i,j}=-m_{i,j}\) for \(i\ne j\).

Distributed consensus protocol

To study how each agent’s opinion competes and reaches consensus within a social network, the distributed consensus protocol proposed by Freeman et al. is adopted6, and the estimation of the consensus of the social network for ith agent can be formulated as

$$\begin{aligned} \dot{y}_i(t)=f(y_i(t),y_{j \in \mathscr {N}_i}(t), u_i(t)), \end{aligned}$$
(2)

where \(y_i(t)\) is the estimation of consensus and \(\dot{y}_i(t)\) is its dynamics, \(u_i(t)\) denotes the external input. According to (2), \(\dot{y}_i(t)\) is only affected by its neighbors rather than opinions of all agents, demonstrating the distributivity of this protocol. More specifically, \(\dot{y}_i(t)\) is expressed as

$$\begin{aligned} \left\{ \begin{aligned}&\begin{aligned}\dot{y}_i(t)=&-\alpha \left( \sum \limits _{j \in \mathscr {N}_i} m_{i,j}(y_i(t)-y_j(t))+\right. \\&\left. (y_i(t)-u_i(t))+\sum \limits _{j \in \mathscr {N}_i} m_{i,j}(\eta _i(t)-\eta _j(t))\right) ,\end{aligned}\\&\dot{\eta }_i(t)=m_{i,j}(y_i(t)-y_j(t)), \end{aligned}\right. \end{aligned}$$
(3)

where \(\alpha\) is a positive constant. According to (3), \(\dot{y}(t)\) is not only related to the difference between \(y_i(t)\) of ith agent and neighbors in the current state but also their historical difference, which can filter the noise from input signal 6. From the perspective of the whole network, the opinion dynamic can be rewritten as

$$\begin{aligned} \dot{y}(t)=-\alpha (Hy(t)+y(t)-u(t)+H\int _{t_0}^{t }Hy(\tau)\text {d}\tau ), \end{aligned}$$
(4)

where \(t_0\) denotes the initial time.

Fitness between opinions

The opinion held by an individual (i.e., the state of the agent) is associated with the social environment and opinion dynamics are significantly influenced by social factors such as social norms, communication channels, and other factors 35,36. Opinions that align with prevailing norms and gain support from influential figures or resonate with public sentiment are more likely to spread and gain acceptance, benefiting from positive feedback mechanisms. In contrast, opinions that deviate from norms, lack influential backing, or face resistance from social factors tend to struggle and may lose traction. Defining the expected opinion or status of a target social problem as \(o_e(t)\) and the opinion of ith agent as \(o_i(t)\), these opinion are related to the social environments. The degree of fitness between \(o_i(t)\) and \(o_e(t)\) can be defined with a mapping function as \(e(o_i(t),o_e(t))\), which is abbreviated as \(e_i(t)\) for simplification.

k-WTA model

The concept of winner-takes-all (WTA) has profound implications across various domains, stemming from its origins in electoral systems and social dynamics. Originally coined in the context of U.S. presidential elections, WTA dictates that the candidate with a relative majority in a state receives all of its electoral votes, regardless of the margin of victory37. This system highlights a stark reality: in competitive scenarios, the leading contender reaps disproportionate rewards, overshadowing competitors who may not differ significantly in support.

Beyond electoral systems, WTA extends into diverse arenas, including cell biology, coordination of robots, and opinion evolution38,39,40. In the realm of opinion evolution within social networks, these WTA manifest prominently. Social media platforms exemplify this by amplifying content that gains initial traction, thereby increasing its visibility and influence. Consider a scenario where many competing opinions on a controversial topic emerge. Due to algorithms favoring engagement and popularity, the opinion that gains an early edge perhaps due to timing, high emotional charge, resonance with a subset of users, or even strategic promotion—can quickly dominate the discourse41,42. As more users encounter and interact with this opinion, it garners additional attention, reinforcing its prominence through feedback loops of visibility and validation. For example, the phenomenon of WTA is observed in electronic word-of-mouth systems within the digital tourism domain, where a few influential microblogs dominate tourism discussions40. However, due to the complexity of competitive processes and environments, several winners will exist in many scenarios, leading to a k-WTA model. In a k-WTA model, the top k largest inputs out of total inputs output 1, while other inputs output 0.

To introduce influence from the social environment and competition in consensus protocol, u(t) in (4) is defined as the outputs of k-WTA model, where the k-winners are opinions with the top k highest fitness. Moreover, to make those opinions with the highest fitness has the largest inputs to the k-WTA model, the input \(v_i(t)\) is defined as \(v_i(t)=-||e_i(t)||_2^2/2\). Thus, \(u_i(t)\) is mathematically expressed as

$$\begin{aligned} u_i(t)=\left\{ \begin{aligned}&1, \text {if } v_i(t) \in \{\text {the top }k\text { largest inputs}\}\\&0, \text { otherwise}. \end{aligned}\right. \end{aligned}$$
(5)

where \(u_i(t) \in \{ 0,1 \}\) represents the outputs. Therefore, the k-WTA model can be solved with the following model43:

  • State equation

    $$\begin{aligned} \frac{\text {d}q(t)}{\text {d}t}=-\gamma \left( \sum \limits _{i=1}^N u_i(t)-k\right) , \end{aligned}$$
    (6)

    where \(\gamma >0\) is scale factor, and q(t) is an auxiliary variable.

  • Output equation

    $$\begin{aligned} u_i(t)=-\Phi _{\Omega }\left( q(t)+\frac{v_i(t)}{2\lambda }\right) , \end{aligned}$$
    (7)

    where \(\Omega =[0,1]\), and \(\Phi _{\Omega }(\cdot )\) is defined as

    $$\begin{aligned} \Phi _{\Omega }(q(t)+\frac{v_i(t)}{2\lambda })=\left\{ \begin{aligned}&1, \,\,\,\,\,q(t)+\frac{v_i(t)}{2\lambda }>1\\&0, \,\,\,\,-1 \le q(t)+\frac{v_i(t)}{2\lambda } \ge 1\\&-1, \,q(t)+\frac{v_i(t)}{2\lambda }<-1. \end{aligned}\right. \end{aligned}$$
    (8)

In addition, to guarantee the solution of (6) and (7) equals to the solution of (5)\(, \lambda\) should satisfy \(\lambda \le \frac{1}{2}(\hat{v}_k+\hat{v}_{k+1})\), where \(\hat{v}_k\) and \(\hat{v}_{k+1}\) is the kst and \(k+1\)st largest input, respectively.

Modeling

In this section, the opinion dynamic problem is presented, and an MGNN is introduced to solve it. The convergence of the MGNN model is then proven theoretically. Finally, the entire distributed opinion competition model is derived.

Opinion evolution with MGNN model

According to the analyses presented in Preliminary, the opinion \(o_i(t)\) should evolve to fit the social expectation \(o_e(t)\). In other words, the expected value of \(e_i(t)\) should be zero. Therefore, the problem of opinion evolution becomes a time-varying zero-finding problem.

Recently, massive neural networks have been investigated for their outstanding performance in solving time-varying problems, etc31,44,45. Among this class of neural networks, the zeroing neural network (ZNN) and gradient-based neural network (GNN) are two prevalent models. However, the ZNN model contains the inverse matrix, which leads to a high computing load and potential failures in solving. Thus, much effort has been devoted to designing GNN models46,47,48. By defining a non-negative scalar \(\frac{1}{2}||e_i(t)||_2^2\), the traditional GNN model solving opinion dynamics can be expressed as

$$\begin{aligned} \dot{o}_i(t)=-\rho\left( \frac{\partial e_i(t)}{\partial o_i^\text {T}(t)}\right) ^{\text {T}}e_i(t), \end{aligned}$$
(9)

where ρ > 0. To make \(e_i(t)\) converge to zero, an MGNN model is designed as an evolution law of opinion based on the traditional GNN model (9). The MGNN model is expressed as

$$\begin{aligned} \dot{o}_i(t)=-\theta (t)\left( \frac{\partial e_i(t)}{\partial o_i^\text {T}(t)}\right) ^{\text {T}}e_i(t), \end{aligned}$$
(10)

where

$$\begin{aligned} \theta (t)=(\text {exp}(\beta *t)+1)\frac{\left| e^{\text {T}}_i(t)\frac{\partial e_i(t)}{\partial t}\right| }{\left| \left|\frac{\partial e_i(t)}{\partial o_i^\text {T}(t)}e_i(t)\right| \right|_2^2}, \,\,\beta >0. \end{aligned}$$
(11)

Compared with the traditional GNN model (9), the MGNN model (10) replaces the stationary coefficient \(\rho\) with a variable one \(\theta (t)\).

Convergence analysis

To demonstrate the convergence analysis of the MGNN model, the following theorem is provided.

Theorem 1

When update \(o_i(t)\) with the MGNN model (10), \(o_i(t)\) globally converges to \(o_e(t)\).

Proof

Defining a positive definite Lyapunov candidate as \(\mathbb {L}(t)=\frac{1}{2}||e_i(t)||_2^2\), its time derivative can be calculated as

$$\begin{aligned} \dot{\mathbb {L}}(t)&=e_i^{\text {T}}(t)\dot{e}_i(t)\nonumber \\&=e_i^{\text {T}}(t)\left( \frac{\partial e_i(t)}{\partial o^{\text {T}}_i(t)}\dot{o}^{\text {T}}_i(t)+\frac{\partial e_i(t)}{\partial t}\right) . \end{aligned}$$
(12)

Inserting (10) into (12) leads to

$$\begin{aligned} \dot{\mathbb {L}}(t)&=e_i^{\text {T}}(t)\dot{e}_i(t)\nonumber \\&=e_i^{\text {T}}(t)\left( -\theta (t)\frac{\partial e_i(t)}{\partial o_i^{\text {T}}(t)}\left( \frac{\partial e_i(t)}{\partial o_i^{\text {T}}(t)}\right) ^{\text {T}}e_i(t)+\frac{\partial e_i(t)}{\partial t}\right) \nonumber \\&=-(\text {exp}(\beta *t)+1)\left| e^{\text {T}}_i(t)\frac{\partial e_i(t)}{\partial t}\right| +e^{\text {T}}_i(t)\frac{\partial e_i(t)}{\partial t}\nonumber \\&\le 0. \end{aligned}$$
(13)

Therefore, according to Lyapunov stability theorem48, the system is stable. In other words, the computed \(o_i(t)\) converges to \(o_e(t)\). Therefore, this theorem holds. \(\square\)

The proposed model

First of all, as analyzed before, only those wined opinions can evolve. Thus, combining (6), (7), and (10), the opinion dynamic model should be rewritten as

$$\begin{aligned} \left\{ \begin{aligned}&\dot{o}_i(t)=\Phi _{\Omega }\left( q(t)+\frac{v_i(t)}{2\lambda }\right) \theta(t) \left( \frac{\partial e_i(t)}{\partial o_i^\text {T}(t)}\right) ^{\text {T}}e_i(t),\\&\frac{\text {d}q(t)}{\text {d}t}=-\gamma \left( \sum \limits _{i=1}^n \Phi _{\Omega }(q(t)+\frac{v_i(t)}{2\lambda })-k\right) . \end{aligned}\right. \end{aligned}$$
(14)

In addition, term \(\sum \limits _{i=1}^n \Phi _{\Omega }(q_i(t)+\frac{v_i(t)}{2\lambda })\) requires the knowledge of the whole network, which is unrealistic for individuals. Thus, the distributed scheme (3) is utilized. Inserting (3) into (14), the proposed distributed opinion competition model is expressed as

$$\begin{aligned} \left\{ \begin{aligned}&\dot{o}_i(t)=\Phi _{\Omega }\left( q(t)+\frac{v_i(t)}{2\lambda }\right)\theta(t) \left( \frac{\partial e_i(t)}{\partial o_i^\text {T}(t)}\right) ^{\text {T}}e_i(t),\\&\frac{\text {d}q(t)}{\text {d}t}=-\gamma \left( \sum \limits _{i=1}^ny_i(t)-k\right) ,\\&\begin{aligned}\dot{y}_i(t)=&-\alpha \left( \sum \limits _{j \in \mathscr {N}_i} m_{i,j}(y_i(t)-y_j(t))\right. +\\ &\left. (y_i(t)-u_i(t))+\sum \limits _{j \in \mathscr {N}_i} m_{i,j}(\eta _i(t)-\eta _j(t))\right) ,\end{aligned}\\&\dot{\eta }_i(t)=m_{i,j}(y_i(t)-y_j(t)). \end{aligned}\right. \end{aligned}$$
(15)
Fig. 2
figure 2

Opinion dynamics in social network. (a) The randomly generated initial distribution of opinions in social network. (b) The opinions dynamics within \(t=[0, 0.25]\) s. (c) The opinions dynamics within \(t=[0, 1]\) s.

Remark 1

According to the first equation in (15), the evolution of opinion is not only governed by the evolution rule (10) but also influenced by the output of the k-WTA model, where only the winners remain active and evolve. In addition, as depicted in the state equation (6) in the k-WTA model, solving the k-WTA model necessitates the status (i.e., \(y_i(t)\)) of every node in the network, which is impractical in real social networks. Therefore, the state equation (6) is refined as the second equation in (15), incorporating a distributed consensus protocol to approximate the status of other nodes (expressed as the third and fourth equation in (15)). In the distributed consensus protocol, the estimation of \(y_i(t)\) is based on the communication with neighbors, which is related to the status of neighbors and their connection \(m_{i,j}\). Therefore, the interaction structure of the social network affects the k-WTA model and by influencing the estimation of the state equation, and thus ultimately impacts the evolution of opinion.

Simulation results and discussion

Simulation setting

In this section, numerical simulations are performed to verify the availability of the proposed model, which also illustrates the process of opinion evolution. Firstly, the opinion of individual \(o_i(t)\) is denoted by a three-dimensional vector in the simulation for better demonstration, which can be a higher dimension vector in the real world. Each dimension reflects the state of the condition related to the social environment, as discussed in the previous section. To an extent, the opinion evolution is similar to the process of the tracking problem, where \(o_e(t)\) is the target’s position. In addition, \(o_e(t)\) is time-varying due to dynamics of the social environment. For example, after a particular moment, the communication channel of a polarity opinion is banned due to rules, then the element in \(o_e(t)\) related to this factor should vary, even be removed. Furthermore, the fitness function \(e_i(t)\) in this simulation is the same as49, expressed as \(e_i(t)=o_i(t)-o_e(t)\). In the simulation, the execution time \(T=1\) s, and parameters are set as \(n=15, k=2, \gamma =10^5, \alpha =5, \lambda =0.01, \beta =1\). Therefore, this simulation imitates the process of two opinions competing and wining under the influence of the social environment among 15 opinions. Moreover, the initial opinion \(o_i(t)\) of each individual and \(o_e(t)\) are randomly generated, those individuals who hold similar opinions (satisfy \(||o_i(t)-o_j(t)||_2\le 10\)) are defined as neighbors and connected in social networks.

Fig. 3
figure 3

Simulative trajectories of variables in the proposed model. (a) The norm of fitness between opinion \(o_i(t)\) and \(o_e(t)\). (b) The output of the k-WTA model. (c) The state of opinions in three dimensions.

Illustrative example

In Fig. 2, the distribution of opinions is displayed, where the circles denote the opinions of the individual and the cross denotes the social expectation. According to Fig. 2a, in the initial stage, opinions \(o_{10}(t)\) and \(o_{15}(t)\) have the top greatest fitness to \(o_e(t)\), and are able to evolve. On the contrary, other opinions remain inactive. Figure 2b illustrates the trajectories of opinion evolution until \(t=0.25\) s. It can be observed that the evolving speeds of \(o_{10}(t)\) and \(o_{15}(t)\) are different, which is mainly caused by the various interaction with their neighbors and environments. In addition, \(o_e(t)\) also moves over time as the society’s expected opinion is transient. Thus, there may be a chance that those unactivated opinions can have better fitness to \(o_e(t)\), thereby be activated as time goes by. On the other hand, the activated opinion will lose the competition and become disabled. Figure 2c shows the whole opinion evolution process, which demonstrates this phenomenon. Compared Fig. 2c with Fig. 2b, the trajectory of \(o_{10}(t)\) is basically unchanged, indicating it is inactivated after 0.25 s. In contrast, \(o_{14}(t)\) has a long trajectory that finally purchases \(o_e\). The trajectories of \(o_{10}(t)\) and \(o_{14}(t)\) illustrates that \(o_{14}(t)\) becomes the new winner while \(o_{10}(t)\) is the new loser.

Figure 3 demonstrates detail and inner information about the opinion dynamic. As indicated in Fig. 3a, \(o_{10}(t)\) and \(o_{15}(t)\) have the best fitness in the beginning, and \(o_{14}(t)\) has a better fitness than \(o_{10}(t)\) at about \(t=0.26\) s. In other words, \(o_{14}(t)\) becomes the new winner and is activated after that moment, while \(o_{10}(t)\) becomes inactivated, which satisfied the results observed in Fig. 2b,c. In addition, the output of the k-WTA model is displayed in Fig. 3b. The opinions with the top-2 best fitness output 1 and others output 0. Remarkably, the output of \(o_{14}(t)\) smoothly but finally converges to its theoretical value 0 in the beginning. On the one hand, that may be caused by the insufficient estimation of the whole situation among the network in the beginning due to the distributed scheme. On the one hand, this smooth change better matches the real scenario as the competition and the withdrawal of the loser are time-consuming. Furthermore, Fig. 3c depicted the trajectories of opinions in three-dimension, where only contains the results of \(o_{10}(t)\), \(o_{14}(t)\), \(o_{15}(t)\) for better demonstration. According the Figs. 2 and 3, the proposed model can successfully simulate the distributed competitive behavior of opinion dynamics in social networks, considering the influence of social environment and neighbors.

Fig. 4
figure 4

The outputs of the proposed model with various typologies. (a) A static topology whose connections are based on the fitness between opinions. (b) The transitional model whose connections are based on the fitness between opinions. (c) The transitional Erdős–Rényi model.

Discussion on topology

Regarding the topology of the social network, since the k-WTA model in this model only considers the situation with a certain number of competitors, these scale-free models (e.g., Barabasi–Albert model50) are not suitable for this work. Furthermore, the initial topology of this work is indeed the Erdős–Rényi model (i.e., nodes are connected with a certain probability)51. More specifically, the opinions held by each individual are generated randomly; those agents who have similar opinions (where the difference between opinions is smaller than a certain value) are connected. Otherwise, they are disconnected. Thus, individuals are connected with a certain probability at the initial stage. During the evolution of opinions, the topology of social networks is also constructed following the concept that individuals who hold similar opinions are connected. Compared with those randomly connected models (e.g., Erdős–Rényi model and stochastic block model29), this principle is more reasonable, as people tend to communicate with those who hold similar viewpoints.

To demonstrate the effect of the topology, compared simulations are performed with a static topology that is the same as the initial topology of the proposed model in this work, the transitional topology proposed in this work, and the transitional model based on the Erdős–Rényi model, whose results are shown in Fig. 4a–c, respectively. According to Fig. 4, both the static and transitional models based on the conception proposed in this work can successfully generate the winners. Besides this, comparing with Fig. 4a,b, changes of the network structure have indeed occurred in the transitional model, making the figures of result different. Regarding to the Erdős–Rényi model, it fails to estimate the winners as shown in Fig. 4c. One potential reason is that the topology, as well as \(m_{i,j}\), changes randomly in each iteration when solving the proposed model (15), which may introduce random noise into the k-WTA model and cause failure. Thus, the randomly connected typologies are unsuitable for the proposed model (15).

Potential applications

According to the simulation results, the proposed model delves deep into the dynamics of opinion competition in social networks. It provides invaluable insights to better understand how various opinions form, develop and influence individual choices, extending its potential application scenarios. For example, the proposed model can be utilized to predict how different political opinions or ideologies may compete for the support of the major population, enabling those politicos to formulate effective communication strategies and finally win the election. Moreover, in the field of marketing, the company can leverage the model to simulate and forecast consumer perceptions towards various products or brands to craft available marketing strategies. Furthermore, the proposed model can also be employed in public opinion monitoring, entertainment promotion, and health information dissemination.

Conclusions

This paper has introduced an innovative distributed opinion competition model designed to simulate the evolution and competition of opinions within social networks. By integrating elements from the topology of social networks, distributed consensus protocols, and the k-WTA model, this approach captures the dynamics of opinion formation while accounting for interactions with neighbors and the broader influence of the social network. The competition and evolution of opinions result in a scenario where only a few opinions ultimately prevail. In addition, to drive the evolution of these opinions, an MGNN model has been developed, and its convergence has been rigorously proven through theoretical analysis. In the simulation section, an illustrative example of 15 opinions competing for 2 winners is displayed. The trajectories of opinions’ evolution and their competitive behaviors are demonstrated via visualization results. Simulations closely aligned with real-world conditions have validated the model’s effectiveness, highlighting its potential for application in various other social competitive behaviors. However, this study does not consider more complicated social network topology. Future research could explore how opinions compete and evolve within dynamically changing network structures, and how these changes affect the final distribution of opinions. In addition, the proposed model could integrate the real-time social media data to dynamically update the status of opinions and predict the final winners in some campaigns (e.g., the presidential election).