Introduction

In nature and society, many phenomena can be observed widely, i.e., some high-level intelligence features are shown or emerge from aggregated individuals with low-level intelligence or even without intelligence, such as ants foraging, bird migration, fish school’s hedging, free market, etc. Those phenomena are called swarm intelligence1,2. Swarm intelligence is often associated with concepts such as emergence and collectivity3. Emergence is the process of presentation of high-level intelligence features from (multi-agent) systems4. Swarms with high-level intelligence features tend to present orderly structures in space, time, or function5.

Since the concept of swarm intelligence was put forward, it has attracted the attention of many researchers and become a research hotspot of computer science, artificial intelligence, economics, sociology, biology and other cross disciplines. Many swarm intelligence methods (or algorithms) have been proposed, such as ant colony algorithm (ACO)6, particle swarm optimization algorithm (PSO)7,8, and so on, to solve complex problems in the real world. These methods only require that the individuals involved in the collaboration have simple computing power and behavioral ability, and can efficiently, flexibly, and robustly solve or optimize complex problems without the centralized control or a global model.

However, these methods are not general (or universal) enough. They all have their specific scope of application and generally are effective for special swarms. When using a specific swarm intelligence method, people must first check whether the swarm has some of the characteristics required by the method, whether the individuals in the swarm take action by following the way specified by the method, and whether the individual’s behavior can be traced. Otherwise, the desired intelligence may not emerge from the swarm, or problems cannot be solved optimally based on the method. For example, to use the ant colony algorithm, individuals in the colony must be able to produce (or secrete) things similar to pheromones like ants. Other ants can sense these pheromones and strengthen their behavior according to the concentration of the pheromones. Therefore, when people realize swarm intelligence, they have to repeatedly explore various swarm intelligence methods to find the most appropriate one.

Then, even if the most appropriate swarm intelligence method is applied, it may not guarantee that the desired intelligence can emerge from the swarm. This is because the existing swarm intelligence methods only simulate some emergence phenomena and do not grasp the essence of emergence. So far, people cannot explain how swarm intelligence emerges and what relationship exists between individuals’ interaction and swarm intelligence. In other words, why can swarm intelligence emerge from individuals’ interaction, and whether will the expected swarm intelligence emerge inevitably from the interaction between individuals?

Most of the existing methods have three obvious assumptions: the first is that the main driving force of the evolution of swarm intelligence comes from the interaction between individuals and their environment; the second is that individuals involved in the swarm have some common pragmatic goals; the third is that the behavior of individuals is driven by some simple rules4. Although these methods emphasize cooperation between individuals and the optimization of cooperation, they do not articulate the driving force and direction of cooperation. That is to say, they do not clarify why individuals involved in the swarm cooperate, nor can they predict what kind of (optimization) effect will result from cooperation.

Essentially, the environment exists as the periphery of things (i.e., individuals here), and the environment and its interaction with individuals are only outside conditions (called external causes in philosophy) that affect individual behavior. For example, it is generally believed that the migration of wild geese is caused by climate change. In fact, the fundamental reason that determines wild geese’s migration is whether their survival and reproduction can be guaranteed, including whether they have enough food, whether their lives are threatened, whether they can find a spouse and reproduce successfully, etc. Climate change is only an external cause instead of the decisive cause that results in their migration.

Secondly, intelligence is commonly considered as the ability to solve complex problems9,10. Nevertheless, for a swarm, it has neither any endogenous objectives nor any intentions to solve problems. The intelligence emerging from the swarm is only the outcome of observation. For example, the formation of a specific flying form in the migration of wild geese is not because they planned to form the formation in advance, but because it is naturally formed so that wild geese could fly to the destination more safely and with less effort due to the impact of external environment (such as wind, temperature, etc.).

Thirdly, the complexity and uncertainty of the external environment make it impossible for individuals to have a complete perception and cognition of the environment; individuals can hardly grasp the full and accurate interaction relationships with the environment to define complete behavior rules.

Existing methods falsely consider those environmental changes and interactions between individuals and the environment as the main driving force for the emergence of swarm intelligence, which naturally cannot correctly describe and model swarm intelligence, and the established models are also difficult to apply to swarms in complex environments in the real world.

In philosophy (mainly materialistic dialectics11,12, it is believed that external causes (i.e. external environmental factors) are only conditions that affect the change and development of things whilst internal causes are the root of the change and development of things and external causes can work only through internal causes. For wild geese, food safety, life safety, and reproduction safety are internal causes whereas climate change is only an external cause. Only when climate change threatens the safety of wild geese will wild geese tend to change their behavior.

Internal cause refers to the internal contradictions of things. Contradiction is the unity of opposites, which defines the relationship between two attributes (or two aspects) of a thing. These two aspects are contradictory as well as unified13, for example, coldness and hotness constitute a contradiction, and coldness and hotness are the two aspects of the contradiction. They are mutually exclusive and interdependent. The unity of opposites of contradictions is the driving force and source of changes and development of things. On the one hand, contradictions exist in the development process of anything. The development and change of things (that is, the behavior of things) are caused by the struggles of both aspects of the contradictions. Without contradiction, the world will not change. On the other hand, all things (that is, the existence of things) are the unity of contradictions, and their properties (that is, the external performance of things) depend on the balance of strength of two aspects of contradictions13. This is just like in an organism, its properties are determined by the internal genes and each gene contains an allele. Alleles determine the properties of the organism and control the development and change of the organism just like contradictions.

Within a swarm, the existence and development of an individual (that is, the properties and behavior of an individual) depends first on the unity of opposites of its internal contradictions and then is affected by its environment (including other individuals surrounding it). Firstly, an individual can obtain resources (including matter, energy, information, etc.) from the environment by interacting with the environment to change the balance of strength of two aspects of its internal contradictions. Secondly, the overall balance of strength of internal contradictions of all individuals in the swarm will produce a certain potential (referred to as group potential in this paper), which will affect the development direction of internal contradictions of individuals in the swarm (such as convergence or minority subordination to the majority). Thirdly, the behavior of individuals will change the external environment and indirectly affect other individuals whilst the change of environment will put feedback on the behavior of individuals.

On the other side from the viewpoint of a swarm, all of the swarm (including its existence and development) is rooted in the overall performance of all individuals involved. When some recognizable and orderly structure in space, time or function is exhibited in the swarm, it indicates that swarm intelligence has emerged14. The orderly structure of the swarm indeed shows that the overall balance of strength of two aspects of contradictions of all individuals within the swarm presents a specific pattern. For example, when the safety of more and more geese is threatened, they will migrate together and form a group with a special flying formation.

Therefore, we propose a contradiction-centered model for the emergence of swarm intelligence. In this model, (1) contradictions determine the behavior, i.e., the unity of opposites of internal contradictions is the source power to promote the developments of individuals; (2) contradictions reflect the properties, i.e., the properties of an individual is defined by the balance of strength of the two aspects of the internal contradictions of the individual, while the intelligence of a swarm is embodied in the overall distribution of all internal contradictions of individuals within in the swarm. Swarm intelligence is the manifestation of a specific distribution pattern of internal contradictions of individuals; (3) Interaction affects contradictions. Interaction exists widely between individuals and the environment and individuals form a swarm because of the interaction among individuals. Interaction changes the environment and the swarm, and in turn the environment and the group potential produced by the swarm affect the development direction of the internal contradictions of individuals.

The main contributions of this paper are as follows:

  • First of all, we propose a two-layer contradiction-centered model for the emergence of swarm intelligence. In the inner layer, individuals take action driven by internal contradictions. In the outer layer, the swarm is formed from interacting individuals. Interaction and group potential will affect the internal contradictions of individuals in the swarm, and swarm intelligence is shown as a specific distribution of internal contradictions. We also formally describe the emergence model of swarm intelligence and give the dynamic equation of individual behavior and the formula quantifying swarm intelligence.

  • Secondly, according to the swarm intelligence model, we describe the implementation process of swarm intelligence through an example, and simulate two systems to verify the effectiveness of the model.

The organizational structure of the follow-up content of the paper is as follows: Sect. 2 describes the two-layer model of swarm intelligence emergence, and describes the relationship between the concepts in the model (including individuals, swarm, environment, group potential, swarm intelligence, etc.) through a conceptual model; Sect. 3 formally describes the model of swarm intelligence emergence; Sect. 4 describes the process of emergence of swarm intelligence, and shows the realization process of swarm intelligence through an example; Sect. 5 presents two example systems to verify the generality of the model of swarm intelligence emergence through experiments; Sect. 6 compares with some related work; and Sect. 7 gives a summary of the work of this paper and points out the future research directions.

Overview of the contradiction-centered emergence model

While studying swarm intelligence, people should answer key questions such as what determines the properties of an individual, what drives the behavior of an individual, how an individual decides its actions, how a swarm is formed out of individuals, and how intelligence emerges from swarms. We divide the model for the emergence of swarm intelligence into two layers, the individual layer and the swarm layer, which are interrelated through a feedback loop (as shown in Fig. 1).

  • At the micro level (or individual level), contradictions are at the center. The properties of an individual are defined by the internal contradictions; the driving force behind the behavior of an individual is the motion and changes of the contradictions; and the interaction of an individual with other individuals is determined by the opposition/unity (or competition/cooperation in other words) of the contradictions.

  • The macro level (or swarm level) is centered around interaction, where individuals are connected via interaction with the environment for competing or sharing environmental resources, the swarm is formed by interconnected individuals involved in the environment, and swarm intelligence is manifested as the overall characteristics of the collection of individuals.

  • Crossing the micro level and the macro level, individuals change their external environment through interaction and the external environment in turn affects their internal contradictions, which forms a feedback loop that begins with contradictions and ends with contradictions: contradictions → interactions → environment (and swarm) → contradictions.

Fig. 1
figure 1

Model for the emergence of swarm intelligence.

In this model, all aspects of an individual and a swarm, including the existence and development of an individual, the formation and evolution of a swarm, as well as the condition, force, direction, approach, and form of the emergence of swarm intelligence, are centered around contradictions (as shown in Fig. 2).

Basis

The existence of an individual is the result of the unity of opposites of contradictions. An individual is a unity of a collection of internal contradictions, and the fundamental reason why an individual is different from other individuals is that it has internal contradictions that distinguish it from other individuals. The existence of an individual is the result of the unceasing struggles of internal contradictions (for example, a reservoir is the product of the constant struggles between two pairs of contradictions: inflowing and outflowing, expansion and landfilling). The unity of contradictions ensures the relative stability of the properties and existence of an individual (for example, the inflow and outflow, as well as the expansion and landfilling, must remain relatively stable to keep a lasting existence of the reservoir).

Fig. 2
figure 2

Conceptual model for the emergence of swarm intelligence.

Force

The struggles between the two opposites of contradictions are the driving force behind the change and development of an individual. Both aspects of a contradiction always attempt to strengthen their strength while weakening the other’s strength, which results in the waning and waxing of the strength of the two aspects and even the rupture of the contradiction (one aspect completely defeats the other). The change in the balance of strength of the two aspects of a contradiction can alter the properties of an individual whilst the rupture of a contradiction can result in the disappearance of the contradiction and the appearance of a new contradiction, thereby causing the evolution of the individual. The goal of an individual is to maintain its existence in a constantly changing environment (i.e. to maintain the relative stability of the unity of its contradictions) and to continuously evolve (i.e. to form new unity of contradictions) to adapt to changes in the environment.

Form

The emergence of swarm intelligence is the result of the continuous accumulation of development of individuals’ internal contradictions. Swarm intelligence is manifested as a swarm having a certain special orderly structure in time, space, or function, and all contradictions of individuals in the swarm inevitably present a certain distribution. Swarm intelligence is essentially a reflection of the distribution of contradictions with a specific overall structure. For example, in foraging ant colonies, the contradiction of “exploration” (i.e., searching for new food sources) and “exploitation” (i.e., carrying food from old sources) drives ants to find or obtain food as quickly as possible. When enough ants “exploit” the already-found food sources, the shortest foraging path of the ant colony will be presented.

Condition

The external environment is a condition not only for the existence and development of individuals and the swarm but also for the emergence of swarm intelligence. The survival and development of individuals inevitably require extracting a large amount of matter, energy, or information from the environment. Only by constantly interacting with the outside world can individuals obtain resources to keep their survival and development. However, the external environment can only influence individuals’ behavior through individuals’ internal contradictions. Interaction will affect the balance of strength of two aspects of contradictions of individuals and further the distribution of contradictions in the swarm, thereby changing individuals’ behavior and the distribution pattern of contradictions in the swarm, and giving rise to different swarm intelligence.

Approach

The struggle between the two aspects of a contradiction within an individual is essentially a game15,16, where the two aspects compete or cooperate to maximize benefits (i.e. obtaining the most favorable state of survival and development of the individual). The game inside a contradiction is not only driven by the individual’s own benefits but also influenced by the external environment and surrounding individuals. On the one hand, the interaction between the individual and the environment can change the balance of strength of the two aspects of contradictions within the individual; on the other hand, the distribution of internal contradictions among surrounding individuals in the swarm can generate group potential, which in turn can affect the individual’s behavioral orientation (such as following trends or rebelling).

Process and direction

The purpose of interaction between individuals is to occupy environmental resources as many as possible, and the games inside internal contradictions pursue the best survival and development states of individuals based on occupying environmental resources. Intuitively, when individuals no longer occupy environmental resources and the struggles inside internal contradictions are resolved (i.e. the strength of one aspect of a contradiction turns to 0), individuals will enter a state of suspended animation (i.e. extreme balance or stillness), and the swarm will also fall into chaos. Conversely, when individuals compete for environmental resources and pursue the maximization of their benefits, intense competition will inevitably occur inside individuals and among individuals and thus lead individuals to move away from the equilibrium state. When a large number of individuals move away from the equilibrium state, a special overall structure may present and specific swarm intelligence may emerge. For example, in a migrating flock of birds, when a large number of birds occupy advantageous positions and fully obtain environmental resources such as information related to the flying status of the surrounding flock while ensuring flight safety and energy-saving as much as possible, the swarm may exhibit a special flight formation, which signifies the emergence of swarm intelligence.

Formalization of the emergence model

This section will formally define various entities and concepts in the contradiction-centered model for the emergence of swarm intelligence and rigorously describe the dynamic properties of individuals and swarms, including the dynamic model of survival and development of individuals and the emergence mechanism of swarm intelligence.

Contradiction

Definition 1

Contradiction. A contradiction is constituted by two mutually opposite aspects (or attributes).

$$\:\begin{array}{c}c=<\varsigma\:,\:\overline{\varsigma\:}>\end{array}$$
(1)

where \(\:\varsigma\:\) and \(\:\overline{\varsigma\:}\) respectively represent the opposite aspects, i.e. the positive aspect and the negative aspect. The positive and negative aspects of the contradiction are relative, i.e., \(\:\overline{\overline{\varsigma\:}}=\varsigma\:\).

We express the (absolute) strength of both aspects of a contradiction with \(\:\left|\varsigma\:\right|\) and \(\:\left|\overline{\varsigma\:}\right|\). \(\:\left|\varsigma\:\right|>0\) and \(\:\left|\overline{\varsigma\:}\right|>0\), which indicates that the two aspects of the contradiction are interdependent, i.e., they must exist at the same time. Once the strength of one aspect is 0, the contradiction will no longer exist. We use \(\:||\varsigma\:||\) and \(\:||\overline{\varsigma\:}||\) to denote the relative strength of the two aspects. \(\:||\varsigma\:||=\frac{\left|\varsigma\:\right|}{\:\left|\varsigma\:\right|+\left|\overline{\varsigma\:}\right|\:}\), \(\:||\overline{\varsigma\:}||=\frac{\left|\overline{\varsigma\:}\right|}{\:\left|\varsigma\:\right|+\left|\overline{\varsigma\:}\right|\:}\), and \(\:||\varsigma\:||+||\overline{\varsigma\:}||=1\), which implies that the two aspects of the contradiction struggle with each other and the strengthening of one aspect will inevitably be at the expense of the weakening of the other aspect.

In addition, \(\:{\varLambda\:}_{c}\:\)is used to represent the balance of strength of the two aspects of the contradiction. \(\:{\varLambda\:}_{c}=||\varsigma\:||-||\overline{\varsigma\:}||\) and \(\:{\varLambda\:}_{c}\in\:(-1,\:1)\), which denotes the intenseness of the struggle inside the contradiction. The larger the absolute value of \(\:{\varLambda\:}_{c}\) is, the more intense the contradiction is. When \(\:{\varLambda\:}_{c}\:\)approaches 0, it indicates that the contradiction enters a relatively balanced state.

Both aspects of a contradiction always aim to defeat each other (in other words, to strengthen one’s strength and weaken the other’s strength). Once the weaker aspect fails (i.e., the strength becomes 0), the contradiction will no longer exist, which will change the nature of the individual. How the two aspects of a contradiction adopt the attitudes of struggle (e.g., defeating the opponent or staying in peace, i.e., competing or cooperating) is conducted by a game between the two aspects. While defining an individual in the following context, we will specifically describe how the game between the two aspects of a contradiction conducts the struggle between the two aspects and further the behavior of an individual.

Individual

Definition 2

Individual. An individual is defined by a collection of contradictions. All activities of an individual revolve around these contradictions and are aimed at strengthening or weakening the strength of the two aspects of the contradictions. The properties of an individual are manifested through the states of the contradictions and their changes. An individual demands to possess the environmental resources for its survival and development; The goal of an individual is to optimize its properties and make it most beneficial to its survival and development in the current environment.

An individual can be described formally as a 6-tuple:

$$\:\begin{array}{c}\iota\:=<\varGamma\:,\succcurlyeq\:,R,A,P,\mu\:>\end{array}$$
(2)

where,

  • \(\:\varGamma\:\) is a set of contradictions, and \(\:\varGamma\:=\{{c}_{1},{c}_{2},\dots\:,{c}_{N}\}\).

  • \(\:\succcurlyeq\:\) is a partial order relation and \(\:\succcurlyeq\:\:\subseteq\:\varGamma\:\times\:\varGamma\:\), which defines the degrees of significance of contradictions in the individual. The more significant a contradiction is, the greater influence may the contradiction have on the individual’s properties. \(\:{c}_{i}\succcurlyeq\:{c}_{j}\) means that the influence of contradiction \(\:{c}_{i}\) is greater than that of \(\:{c}_{j}\). relation is dynamically changing.

  • \(\:R\) is a set of environmental resources required by the individual for its survival.

  • \(\:A\) is a set of actions. For each contradiction in \(\:\varGamma\:\), there are 4 categories of actions. Let \(\:c\in\:\varGamma\:\), there exists 4 actions \(\:\{{{\upalpha\:}}_{c.\varsigma\:}^{+},{{\upalpha\:}}_{c.\varsigma\:}^{-},{{\upalpha\:}}_{c.\overline{\varsigma\:}}^{+},{{\upalpha\:}}_{c.\overline{\varsigma\:}}^{-}\}\subseteq\:A\) as representatives, where \(\:{{\upalpha\:}}_{c.x}^{+/-}\) denotes an action of strengthening or weakening the strength of aspect \(\:x\) of contradiction \(\:c\). The behavior of the individual is a combination of these actions. The development of contradictions requires to occupy and use environmental resources. An action can be defined as the individual’s use of environmental resources to promote the development of contradictions, i.e., \(\:{\upalpha\:}\in\:A:{2}^{R}\times\:\varGamma\:\to\:\varGamma\:\).

  • \(\:P\) is a collection of properties, and each property is the result or reflection of the accumulation of continuous struggles of contradictions. Let \(\:\rho\:\in\:P\), the dynamic equation of property \(\:\rho\:\) is defined as follows:

    $$\:\begin{array}{c}{\rho\:}^{t+1}=f\left({\rho\:}^{t},{\varGamma\:}^{t},{\succcurlyeq\:}^{t},{{\Delta\:}\varGamma\:}^{t}\right) \end{array}$$
    (3)

    where superscript \(\:t\) denotes the time, \(\:{\rho\:}^{t},{\varGamma\:}^{t},{\succcurlyeq\:}^{t},{{\Delta\:}\varGamma\:}^{t}\) are the property, contradictions, the significance relation of contradictions, and the variation of the development of contradictions at time \(\:t\), respectively.

  • \(\:\mu\:\) is a utility function, which is used to evaluate the satisfaction degree of the individual with its survival and development under the premise of occupying environmental resources and \(\:\mu\::R\times\:P\to\:\left[\text{0,1}\right]\). The individual’s goal is to maximize its utility.

When defining the behavior of an individual below (see Sect. 3.4), we will specifically describe how an individual executes its actions to benefit mostly the individual’s survival and development under the drive of contradictions. The source of the driving force lies in the game between the two aspects of contradictions.

Definition 3

Game of Contradiction. Among all actions of an individual, one aspect of each contradiction (e.g., \(\:c\in\:\varGamma\:\)) is associated with two types of actions (namely \(\:{{\upalpha\:}}_{c.\varsigma\:}^{+}\) and \(\:{{\upalpha\:}}_{c.\varsigma\:}^{-}\), or \(\:{{\upalpha\:}}_{c.\overline{\varsigma\:}}^{+}\) and \(\:{{\upalpha\:}}_{c.\overline{\varsigma\:}}^{-}\) as representatives), which are used to strengthen or weaken the aspect’s strength respectively. The game of contradiction \(\:c\) can be expressed as: \(\:{g}_{c}=<N,{\left\{{A}_{i}\right\}}_{i\in\:N},{\left\{{\upsilon\:}_{i}\right\}}_{i\in\:N}>\), where \(\:N=\{c.\varsigma\:,\:c.\overline{\varsigma\:}\}\) is the set of participants, \(\:{A}_{i}\) is the set of actions (or strategies), \(\:{A}_{c.\varsigma\:}=\{{{\upalpha\:}}_{c.\varsigma\:}^{+},{{\upalpha\:}}_{c.\varsigma\:}^{-}\}\), \(\:{A}_{c.\overline{\varsigma\:}}=\{{{\upalpha\:}}_{c.\overline{\varsigma\:}}^{+},{{\upalpha\:}}_{c.\overline{\varsigma\:}}^{-}\}\), and \(\:{\upsilon\:}_{i}\) are payoffs, \(\:{\upsilon\:}_{i}:\prod\:_{i\in\:N}{A}_{i}\to\:R\).

Because the balance of strength of the two aspects of a contradiction always goes waning and waxing, trying to strengthen the strength is the equivalent of competition whilst weakening is cooperation. The game between the two aspects of a contradiction can be represented by a payoff matrix (Table 1):

Table 1 Game matrix inside a contradiction.

where \(\:{\upsilon\:}_{{\varsigma\:}_{kl}},\:{\upsilon\:}_{{\overline{\varsigma\:}}_{kl}}\:(k,l=\text{1,2})\) are the payoffs of two aspects of the contradiction, respectively.

Swarm and group potential

Definition 4

Swarm. A swarm consists of a collection of individuals interacting with each other.

$$\:\begin{array}{c}\varOmega\:=<\varSigma\:,\:X>\end{array}$$
(4)

where,

  • \(\:\varSigma\:\) is a collection of individuals, and \(\:\varSigma\:=\{{\iota\:}_{1},{\iota\:}_{2},\dots\:,{\iota\:}_{M}\}\).

  • \(\:X\) is a series of ongoing interactions between individuals, \(\:X=\{{\chi\:}_{1},{\chi\:}_{2},\dots\:,{\chi\:}_{K}\}\). Individuals are associated together while interacting with the environment to compete for environmental resources. Interaction can occur between two individuals or among multiple individuals. For the sake of simplicity, we assume that each interaction has a central individual (equivalent to viewing the interaction from the perspective of the central individual), and revolves around an internal contradiction of the central individual. The central individual is associated with the other individual(s) through the environment and competes with the other(s) for resources required for the development of the contradiction.

    $$\:\begin{array}{c}\chi\:=<{\iota\:}_{\kappa\:},\:{c}_{\kappa\:},\:I,\:e> \end{array}$$
    (5)

    where \(\:I\subseteq\:\varSigma\:\) is the set of individuals involved in the interaction, \(\:{\iota\:}_{\kappa\:}\in\:I\) is the central individual, \(\:{c}_{\kappa\:}\in\:\varGamma\:\) is the internal contradiction that will be affected by the interaction, \(\:e\) is the environmental resources competed for by \(\:I\), \(\:e\subseteq\:{\iota\:}_{\kappa\:}.R\), and individuals in \(\:I\) are associated with \(\:{\iota\:}_{\kappa\:}\) through \(\:e\).

The above definition emphasizes that the set of individuals participating in the interaction is dynamic because other individuals around the central individual may not be fixed and the central individual may compete for environmental resources with varied individuals.

Definition 5

Group Potential. The intenseness of a contradiction inside different individuals varies in the swarm. The distribution of the intenseness of a contradiction in the swarm will produce a potential energy, that is, the group potential.

Let \(\:c\in\:\varGamma\:\), the intenseness \(\:{\varLambda\:}_{c}\) of contradiction \(\:c\) take discrete values of \(\:\{{\lambda\:}_{1},{\lambda\:}_{2},{\lambda\:}_{3},\dots\:\}\) in all individuals of \(\:\varSigma\:\), respectively, and \(\:p\left({\lambda\:}_{k}\right)\) is the probability when \(\:{\varLambda\:}_{c}={\lambda\:}_{k}\), and the mathematical expectation \(\:{E}_{{\Omega\:}}\left(c\right)\) (i.e. the average intenseness) of the distribution of the intenseness of \(\:c\) in \(\:\varSigma\:\) is:

$$\:\begin{array}{c}{E}_{{\Omega\:}}\left(c\right)=\sum\:_{k=1}^{M}{\lambda\:}_{k}p\left({\lambda\:}_{k}\right) \end{array}$$
(6)

where \(\:M\) is the number of individuals in the swarm. Accordingly, the information entropy \(\:H\left({\varLambda\:}_{c}\right)\) of \(\:{\varLambda\:}_{c}\) is:

$$\:\begin{array}{c}H\left({\varLambda\:}_{c}\right)=-\frac{1}{\:\text{l}\text{n}\left(M\right)\:}\sum\:_{k=1}^{M}p\left({\lambda\:}_{k}\right)\text{ln}\left(p\left({\lambda\:}_{k}\right)\right) \end{array}$$
(7)

The group potential \(\:{P}_{{\Omega\:}}\left(c\right)\) related to contradiction \(\:c\) is defined as the product of \(\:H\left({\varLambda\:}_{c}\right)\) and the reverse of \(\:{E}_{{\Omega\:}}\left(c\right)\):

$$\:\begin{array}{c}{P}_{{\Omega\:}}\left(c\right)=\frac{{E}_{{\Omega\:}}\left(c\right)}{\:\:{H}\left({\varLambda\:}_{c}\right)\:\:} \end{array}$$
(8)

Similar to the formula of gravitational potential energy P = mgh, we use the mathematical expectation of the probability distribution of contradictions in the group to express the “weight” of contradictions whilst the reverse of the information quantity (or uncertainty of contradictions, namely entropy) contained in contradictions to denote the “height” of contradictions. The reason for using the reverse of information entropy is that the greater the entropy is, the greater the uncertainty and confusion of the distribution of contradictions are; that is, the more irregular the distribution of contradictions is, the more difficult it is for the contradictions to generate an overall impact.

The value range of \(\:{P}_{{\Omega\:}}\left(c\right)\) is \(\:[-1,\:1]\). When \(\:{P}_{{\Omega\:}}\left(c\right)>0\), the group potential will have a positive impact on individuals in the swarm (related to the positive aspect of the contradiction); contrarily, when \(\:{P}_{{\Omega\:}}\left(c\right)<0\), the group potential will have a negative impact on individuals (related to the positive aspect of the contradiction). The greater the absolute value of \(\:{P}_{{\Omega\:}}\left(c\right)\), the stronger the impact of the group potential is on individuals.

Because an individual does not always interact with all other individuals in the swarm, its behavior is often only affected by the surrounding individuals interacting with it. Therefore, it is more significant to consider the impact of group potential formed by surrounding individuals related to a certain interaction.

Definition 6

Group Potential inside Interaction. Let \(\:{{\upchi\:}}_{\iota\:}\in\:{X}\) be an interaction centering on individual \(\:\iota\:\) and use \(\:{{\upchi\:}}_{\iota\:}.{I}\) to substitute \(\:\varSigma\:\) in \(\:{E}_{{\Omega\:}}\left(c\right)\) and \(\:{P}_{{\Omega\:}}\left(c\right)\), we can get the average intenseness \(\:{E}_{{{\upchi\:}}_{\iota\:}}\left(c\right)\) of \(\:c\) of individuals involved in the interaction and further the group potential \(\:{P}_{{{\upchi\:}}_{\iota\:}}\left(c\right)\) inside the interaction.

Definition 7

Relative Group Potential. In a swarm, the impact of the group potential on different individuals is different. We call the group potential on a specific individual as relative group potential.

Let \(\:\iota\:\) be an individual in the swarm and \(\:{\varLambda\:}_{c}^{\iota\:}\) be the intenseness of contradiction \(\:c\) of \(\:\iota\:\), the relative group potential \(\:{rP}_{{\Omega\:}}\left(\iota\:,c\right)\) related to contradiction \(\:c\) of \(\:\iota\:\) is defined as a function of the contrast between \(\:{\varLambda\:}_{c}^{\iota\:}\) and \(\:{E}_{{\Omega\:}}\left(c\right)\):

$$\:\begin{array}{c}{rP}_{{\Omega\:}}\left(\iota\:,c\right)=\frac{\left|{E}_{{\Omega\:}}\left(c\right)-{\varLambda\:}_{c}^{\iota\:}\right|}{\:\:\left|{E}_{{\Omega\:}}\left(c\right)\right|+\left|{\varLambda\:}_{c}^{\iota\:}\right|\:\:}\times\:\frac{1}{\:\:{P}_{{\Omega\:}}\left(c\right)\:\:} \end{array}$$
(9)

which implies that the more obvious the contrast of the individual with the surrounding individuals, the greater the impact of the surrounding individuals (i.e. groups) on the individual.

Interactions will change individuals’ states related to the occupation of environmental resources, and further affect individuals to assess their current living status. When individuals interact, they will change their strategies for competing environmental resources due to the group potential, and also change their occupation of environmental resources. In the context below, when introducing the emergence mechanism of swarm intelligence, we will formally describe the interaction between individuals, and the impact of interaction and group potential on the behavior of individuals in detail.

Behavior models of individual

The emergence of swarm intelligence is the result of the continuous activities of individuals. This section will first describe how an individual decides its behavior, including its behavior when it is alone and the behavior when it participates in interaction (i.e., in a swarm), and then describe how swarm intelligence emerges from the behavior of individuals.

Individual’s independent behavior

When an individual behaves independently, it only needs to care whether the properties reflected by the states of its contradictions are most beneficial to its survival and development. As mentioned above, the behavior of an individual depends on the games inside contradictions. However, when the two aspects of a contradiction play games, they should not only pursue the balance of local benefits of their own, but also pursue the maximization of the overall benefit of the individual. For a contradiction, the balance between the two aspects is not only a local benefit but also a short-term benefit, whilst the survival and development of the individual is a global benefit as well as a long-term benefit. The compromise between the two aspects of a contradiction in achieving local equilibrium and pursuing the maximization of the overall benefits determines how an individual should carry out actions related to the contradiction.

Definition 8

Individual Behavior. Individual behavior is a reflection of a series of actions related to contradictions. At any moment, an individual’s behavior will involve all its internal contradictions, and the actions related to a contradiction always appear in pairs. Let \(\:{c}_{i}\in\:\varGamma\:\) (\(\:i=1..N\)), the set of an individual’s behaviors is:

$$\:\begin{array}{c}{B}=\prod\:_{i=1..N}\left\{<{{\upalpha\:}}_{{c}_{i}.\varsigma\:}^{+},{{\upalpha\:}}_{{c}_{i}.\overline{\varsigma\:}}^{+}>,<{{\upalpha\:}}_{{c}_{i}.\varsigma\:}^{+},{{\upalpha\:}}_{{c}_{i}.\overline{\varsigma\:}}^{-}>,<{{\upalpha\:}}_{{c}_{i}.\varsigma\:}^{-},{{\upalpha\:}}_{{c}_{i}.\overline{\varsigma\:}}^{+}>,<{{\upalpha\:}}_{{c}_{i}.\varsigma\:}^{-},{{\upalpha\:}}_{{c}_{i}.\overline{\varsigma\:}}^{-}>\right\} \end{array}$$
(10)

Suppose that the games between the two aspects of all contradictions \(\:\varGamma\:\) are: \(\:{g}_{{c}_{1}},{g}_{{c}_{2}},\dots\:,{g}_{{c}_{N}}\), an individual always expects to maximize its benefits on the premise of the equilibrium of games when it takes action.

$$\:\begin{array}{c}\begin{array}{c}\underset{b\in\:B}{\text{max}}\left(\mu\:\right)\\\:\begin{array}{c}s.t.\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\\\:for\:all\:{g}_{{c}_{i}}\:\left(i=1..N\right):\:the\:\text{E}\text{q}\text{u}\text{i}\text{l}\text{i}\text{b}\text{r}\text{i}\text{u}\text{m}\:\text{o}\text{f}\:{g}_{{c}_{i}}\:achieved\end{array}\end{array} \end{array}$$
(11)

The benefits of both aspects in games are not always constant and will vary dynamically due to the alternations of the individual’s state (as well as the status of environmental resources required by the individual). The games between the two aspects of contradictions will result in the alternations of the individual’s state, whilst the alternations of the individual’s state will in turn affect the benefits of both aspects. The games will form dynamic equilibriums with continuous changes of benefits, and the dynamic equilibriums should constantly promote the maximization of the individual’s benefits.

Individual’s behavior in swarm

When an individual is in a swarm and decides its behavior, it also needs to consider the interactions with other individuals and the impacts brought by the group potential of the swarm.

Through interactions, an individual obtains resources from the environment and competes with others for resources. Generally speaking, the richer the resources an individual occupies, the better its existence status will be. Interactions will change the individual’s occupation of environmental resources, and then affect the individual’s existence status. An individual always strives to occupy more resources via interactions to ensure the maximization of its benefits. However, the resources in the environment are always limited, the competition among individuals will inevitably lead to some individuals occupying more resources and others occupying less resources. Therefore, while deciding its behavior, an individual should balance the occupation of resources and its survival and development and make a compromise between occupying more resources and maximizing benefits.

Let \(\:\iota\:\) denote an individual (\(\:\iota\:\in\:\varSigma\:\)), \(\:{{X}}_{\iota\:}=\{{\chi\:}_{1},{\chi\:}_{2},\dots\:,{\chi\:}_{L}\}\) be the set of interactions centered on \(\:\iota\:\), and \(\:{e}_{\iota\:}=\bigcup\:_{\chi\:\in\:{{X}}_{\iota\:}}\chi\:.e\) be the set of environmental resources that \(\:\iota\:\) competes for in the interactions. It is also supposed that the games inside all contradictions are: \(\:{g}_{{c}_{1}},{g}_{{c}_{2}},\dots\:,{g}_{{c}_{N}}\). When the individual (i.e., \(\:\iota\:\)) takes action, it will occupy environmental resources as many as possible whilst maximizing its benefits on the premise of maintaining the equilibriums of the games.

$$\:\begin{array}{c}\begin{array}{c}\underset{b\in\:B}{\text{max}}\left(\mu\:\right)\\\:\begin{array}{c}s.t.\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\\\:\begin{array}{l}for\:all{g}_{{c}_{i}}\:\left(i=1..N\right):\:the\:\text{E}\text{q}\text{u}\text{i}\text{l}\text{i}\text{b}\text{r}\text{i}\text{u}\text{m}\:\text{o}\text{f}\:{g}_{{c}_{i}}\:achieved,\\\:for\:all\:\epsilon\in\:{e}_{\iota\:}:\:\left|\epsilon\right|\le\:{\epsilon}_{max}\:and\:\left|\epsilon\right|\to\:{\epsilon}_{max}\end{array}\end{array}\end{array} \end{array}$$
(12)

where \(\:\left|\epsilon\right|\) denotes the amount of environmental resource with type of \(\:\epsilon\) occupied by the individual, and \(\:{\epsilon}_{max}\) represents the maximum amount of environmental resource of \(\:\epsilon\).

In addition, the swarm will produce group potential, and every individual participating in interactions will also be affected by the group potential when competing and occupying resources. Under the influence of the group potential, an individual is inclined to follow the majority of individuals to take action by keeping its state consistent with the majority, that is, to make the intenseness of its contradictions converge with the average intenseness of the majority. Intuitively, when an individual follows the majority to take action, it and the majority will form a joint force and crowd out the minority so that it can obtain resources more easily. Nevertheless, because environmental resources are limited, when resources are insufficient, following the majority to take action may lead individuals to fiercer resource competition and more difficulty in accessing resources. Therefore, an individual also needs to weigh whether conforming to the group potential in the swarm is beneficial to its occupying environmental resources.

When an individual decides its actions based on the games inside contradictions, it will further take into consideration the impact of the group potential of the swarm on its resource occupation.

$$\:\begin{array}{c}\begin{array}{c}\underset{b\in\:B}{\text{max}}\left(\mu\:\right)\\\:\begin{array}{c}s.t.\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\\\:\begin{array}{l}for\:all\:{g}_{{c}_{i}}\:\left(i=1..N\right):\:the\:\text{E}\text{q}\text{u}\text{i}\text{l}\text{i}\text{b}\text{r}\text{i}\text{u}\text{m}\:\text{o}\text{f}\:{g}_{{c}_{i}}\:achieved,\\\:\begin{array}{l}for\:all\:\epsilon\in\:{e}_{\iota\:}:\:\left|\epsilon\right|\le\:{\epsilon}_{max}\:and\:\left|\epsilon\right|\to\:{\epsilon}_{max},\\\:for\:all\:{{\upchi\:}}_{i}\in\:{{\text\:X}}_{\iota\:}\:\left(i=1..L\right):\left\{\begin{array}{c}\left|{rP}_{{{\upchi\:}}_{i}}\left(\iota\:,{{\upchi\:}}_{i}.{c}_{\kappa\:}\right)\right|\to\:0\:\:\:\:\:\:\:if\:\sum\:_{\epsilon\in\:{e}_{\iota\:}}\frac{\left|\epsilon\right|}{{\epsilon}_{max}}<\theta\:\\\:\left|{rP}_{{{\upchi\:}}_{i}}\left(\iota\:,{{\upchi\:}}_{i}.{c}_{\kappa\:}\right)\right|\to\:1\:\:\:\:\:\:\:otherwise\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\end{array}\right.\end{array}\end{array}\end{array}\end{array} \end{array}$$
(13)

where, \(\:\theta\:\) is the threshold value for resource competition fierceness and \(\:\sum\:_{\epsilon\in\:{e}_{\iota\:}}\frac{\left|\epsilon\right|}{{\epsilon}_{max}}\) calculates the degree of resource competition fierceness. When the value of resource competition fierceness is greater than the threshold, it means that resources are seriously insufficient. \(\:{rP}_{{{\upchi\:}}_{i}}\left(\iota\:,{{\upchi\:}}_{i}.{c}_{\kappa\:}\right)\) is the relative group potential of the group involved in interaction \(\:{{\upchi\:}}_{i}\) centering on \(\:\iota\:\) and related to the contradiction \(\:{{\upchi\:}}_{i}.{c}_{\kappa\:}\). \(\:\left|{rP}_{{{\upchi\:}}_{i}}\left(\iota\:,{{\upchi\:}}_{i}.{c}_{\kappa\:}\right)\right|\to\:0\) implies that \(\:\iota\:\) will converge on the contradiction \(\:{{\upchi\:}}_{i}.{c}_{\kappa\:}\) with the group involved in interaction \(\:{{\upchi\:}}_{i}\), whereas \(\:\left|{rP}_{{{\upchi\:}}_{i}}\left(\iota\:,{{\upchi\:}}_{i}.{c}_{\kappa\:}\right)\right|\to\:1\) implies that \(\:\iota\:\) will deviate from the group.

Swarm intelligence

Definition 9

Swarm Intelligence. When a swarm presents an orderly structure in time, space, or function, it indicates that the swarm has some kind of intelligence.

The orderly structure of a swarm is essentially the embodiment of the orderly distribution of the properties and behaviors of individuals, such as specific modes of sequences or combinations of behaviors, and modes of the accumulated results of behaviors. Since the properties and behaviors of individuals are determined by their internal contradictions, swarm intelligence is the embodiment of the orderly distribution of internal contradictions of all individuals in the swarm.

When we investigate swarm intelligence, we do not necessarily involve all aspects of the swarm. Because of different concerns, the same swarm may be disordered in the eyes of some people but orderly in the eyes of others, and vice versa. For example, in a classroom where you can speak at will, some people feel noisy and undisciplined, but others may consider that the discussion atmosphere is active, which is a good learning state. The reason for different judgments is that they focus on different contradictions, and they will think that the swarm is orderly as long as the contradictions they focus on are orderly. Therefore, when defining the intelligence of a swarm, we should consider the size of the set of contradictions about which we are concerned.

First, the orderly distribution of any kind of contradiction in a swarm can be viewed as a micro (or local) intelligence of the swarm (i.e., swarm intelligence \(\:SI\left(c\right)\) related to contradiction \(\:c\)). Let \(\:c\in\:\varGamma\:\) and \(\:p\left({\lambda\:}_{k}\right)\) be the probability of \(\:{\varLambda\:}_{c}={\lambda\:}_{k}\), we define the order degree \(\:O\left(c\right)\) of contradiction \(\:c\) as a function of the information entropy \(\:{H}\left({\varLambda\:}_{c}\right)\) of \(\:{\varLambda\:}_{c}\) (referring to the idea in17, which uses information entropy to quantify the emergence of swarm intelligence), where \(\:-{H}\left({\varLambda\:}_{c}\right)\) is equivalent to negative entropy.

$$\:\begin{array}{c}SI\left(c\right)=O\left(c\right)=1-{H}\left({\varLambda\:}_{c}\right) \end{array}$$
(14)

Secondly, the ordered distribution of a collection (or all) of contradictions can be viewed as a kind of macro (or global) intelligence of the swarm (i.e., the swarm intelligence \(\:SI\left(\varGamma\:\right)\) related to the contradiction set \(\:\varGamma\:\)). The order degree \(\:O\left(\varGamma\:\right)\) of this collection (or all) of contradictions can be defined as a function of the joint entropy \(\:{H}\left(\varGamma\:\right)\) of the intenseness of the contradictions, where \(\:M\) is the number of individuals in the swarm, and \(\:N\) is the number of contradictions.

$$\:\begin{array}{c}{H}\left(\varGamma\:\right)=-\frac{\:\:1\:\:}{\:\text{ln}\left({M}^{N}\right)\:}\sum\:_{{\varLambda\:}_{{c}_{N}}}\dots\:\sum\:_{{\varLambda\:}_{{c}_{1}}}p\left({\varLambda\:}_{{c}_{1}},\dots\:,{\varLambda\:}_{{c}_{N}}\right)\text{ln}\left(p\left({\varLambda\:}_{{c}_{1}},\dots\:,{\varLambda\:}_{{c}_{N}}\right)\right) \end{array}$$
(15)
$$\:\begin{array}{c}SI\left(\varGamma\:\right)=O\left(\varGamma\:\right)=1-{H}\left(\varGamma\:\right) \end{array}$$
(16)

It can be observed from the above definition:

  1. 1.

    Swarm intelligence may be high or low and broad or narrow. The smaller the entropy \(\:{H}\) is, the greater the degree of order \(\:O\) is, which indicates that the more orderly the distribution of contradictions in the swarm is, the higher the swarm intelligence is. The larger the set of contradictions are concerned about, the more macro swarm intelligence is, which indicates that swarm intelligence covers a broader scope of properties of the swarm.

  2. 2.

    Focusing on different contradiction sets may lead to varied judgments (or cognition) on swarm intelligence. For example, in a classroom, if everyone is communicating and discussing freely and the concerned contradictions are about whether the discussion is concentrated on some specified topics and whether the viewpoints are diverse, the students participating in the class may be regarded as an orderly swarm though the classroom seems noisy; On the contrary, if the students are in class and the concerned contradictions are about whether the class is in order, students’ speaking loudly or talking casually may lead to a cognition that the class order is chaotic and then the swarm intelligence is not high.

Let the group potential and swarm intelligence related to contradiction \(\:c\) at any two moments be \(\:{P}_{{\Omega\:}}^{1}\left(c\right)\) and \(\:{P}_{{\Omega\:}}^{2}\left(c\right)\), and \(\:{SI}^{1}\left(c\right)\) and \(\:{SI}^{2}\left(c\right)\), respectively, the following relation can be proven satisfied when the mathematical expectation of the probability distribution of the intenseness of contradiction \(\:c\) in the swarm remains unchanged:

$$\:\begin{array}{c}\frac{\:{\Delta\:}\left|{P}_{{\Omega\:}}\left(c\right)\right|\:}{{\Delta\:}SI\left(c\right)}=\frac{\:\left|{P}_{{\Omega\:}}^{2}\left(c\right)\right|-\left|{P}_{{\Omega\:}}^{1}\left(c\right)\right|\:}{{SI}^{2}\left(c\right)-{SI}^{1}\left(c\right)}=\frac{\left|{E}_{{\Omega\:}}\left(c\right)\right|\text{ln}\left(M\right)}{\:{{H}}^{1}\left({\varLambda\:}_{c}\right){{H}}^{2}\left({\varLambda\:}_{c}\right)\:}>0 \end{array}$$
(17)

Therefore, we have the following assertion.

Assertion 1. The higher swarm intelligence is, the greater group potential is, and vice versa.

Emergence and realization of swarm intelligence

It is often thought that swarm intelligence is difficult to realize according to a specific model. In this section, we present the process of implementing a swarm via an example as the guidelines for realizing swarm intelligence.

The process of emergence of swarm intelligence

From the previous descriptions, we can discover that the emergence of swarm intelligence is synchronized on two levels.

At the individual level, an individual’s behavior is completely driven by its internal contradictions, and the individual decides its behavior according to the games inside the internal contradictions to maximize its benefits. An individual’s behavior will be affected by the resources of the environment and the group potential of the swarm as well because the environment and the swarm may impact on the difficulty and cost of the individual to obtain survival resources. An individual will constantly adjust the games inside the internal contradictions and further optimize the decision-making process of its behavior.

At the swarm level, considering a group in which individuals are interacting with each other, under the influence of the group potential, individuals with similar contradiction intenseness will form a cluster and assimilate surrounding individuals in the group to expand the scale of the cluster to gain a better advantage of competing environmental resources. A cluster with a higher group potential is a partially ordered swarm.

There may be multiple clusters in the swarm. Different clusters may be interweaving due to the expansion of the scope of their influence, which may lead to mutual erosion or fusion of clusters and even the formation of new clusters or the dissolution or expansion of existing clusters. When a certain (or some) cluster has had an impact on the global scope, it indicates that swarm intelligence has emerged in the swarm.

Realization of swarm intelligence

According to the model and process of emergence of swarm intelligence described above, to implement a swarm intelligence, we should first define individuals and their interactions, and then implement individuals. Considering that environmental resources are the pre-conditions for the existence of individuals, and competition for environmental resources is the fundamental reason for interaction between individuals, it is also necessary for us to define environmental resources before implementing individuals and their interactions.

To facilitate the description and understanding of the implementation process of swarm intelligence, we first describe an example and then the following descriptions will revolve around this example. For example, in the foraging ant colony, ants are looking for food or carrying food. Once a food source is found, they always try to carry the food to the nest as quickly as possible, and after unloading the food, they try to return to the food source as easily as possible. They also look for new food sources when they are not carrying food.

In the following context, various components related to the swarm will be described concretely according to the conceptual model proposed above.

Environmental resource

In the environment where the ant colony is located, there is a scope of activity of ants (i.e. the foraging space), which takes the nest as the center and on which there are several food sources scattered. The locations of food sources may always be unknown to the ants (assuming that the ants have no long-term memory ability). To record a path from a food source to the nest, the ants will secrete pheromones on the path. These pheromones can be perceived by themselves as well as other ants.

The resources in the environment can be characterized by the type of resources (matter, energy, or information), the quantity of resources, whether the resources are sharable or exclusive, and whether the resources are consumptive or recyclable. The list of resources in the ant colony environment is as follows (Table 2):

Table 2 List of environmental resources of the ant Colony.

Among them, the foraging space is a matrix space of N × N, and each cell of the space (i.e., a location) can only have one ant at a time. There are M food sources in the space. The total amount of food in each food source does not exceed K pieces and each piece of food can only be carried by one ant. The total amount of pheromones secreted by ants is dynamic, and pheromones are distributed in the grid of foraging space. The pheromones in a grid can be continuously superimposed, and at the same time, the pheromones will continue to volatilize until they disappear completely.

Individual

When an individual is to be implemented, it is necessary first to describe the external performance of the individual (including its behavior and properties), then analyze the internal constitution accordingly (including the internal contradictions that determine the behavior and properties of the individual, and the significance relation of the contradictions in determining the behavior and properties), and finally evaluate the achievement of the goals of the individual (i.e., defining the utility function).

Goals

In a swarm, the goals of an individual are to survive and develop better. Specifically, in the ant colony, the goals of an ant are to find rich food (source) and carry the food to the nest as quickly as possible; in addition, once a food source is found, it always expects to reach the food source easily again in the future.

Properties

The external performance of an individual is a synthesized embodiment of the observable properties of the individual. In the ant colony, an ant constantly wanders in the foraging space and its wandering will show a specific route. The status of the ant’s carrying food, the location of the ant currently, and the direction of the ant’s wandering are some things observable, from which the properties of the ant (namely, the foraging routes) are displayed. Whether an ant can better achieve its goals depends on whether it is wandering on the shortest route to food sources when it is in a no-load status, and whether it is on the shortest route back to the nest when it is in a loaded status. Assuming that the ant has found M (≥ 0) food sources (denoted by using \(\:{FS}_{M}\)) in the foraging space, the utility of the ant can be evaluated according to the extent to which the current route of the ant deviates from the shortest route between the nest and the food source (see definition 2).

$$\:\begin{array}{c}\mu\:=\underset{{fs}\in\:{{FS}}_{M}}{\text{max}}\left(sim\left(\text{L}\text{a}\text{s}\text{t}\text{R}\text{o}\text{u}\text{t}\text{e}\left(fs\right),\text{S}\text{h}\text{o}\text{r}\text{t}\text{e}\text{s}\text{t}\text{P}\text{a}\text{t}\text{h}\left(fs\right)\right)\right) \end{array}$$
(18)

where, sim(., .) is a similarity function, which calculates the similarity between the last wandering route from the nest to a food source (i.e., LastRoute(fs)) and the shortest path from the nest to the food source (i.e., ShortestPath(fs)).

Contradictions

By analyzing the routes of an ant, we can discover that the internal contradictions that determine the wandering of the ant include: whether to explore new food sources or make good use of old food sources, and whether it can safely avoid colliding with other ants or there is a risk of collision with other ants (see Table 3).

Table 3 Internal contradictions of an Ant.

The relationships between the properties of an ant and its internal contradictions are shown in Table 4, which also shows the order of significance of the internal contradictions in the contribution to the properties. As shown in the table, when the ant is carrying food, it is the most important to return to the nest safely; when it goes out to look for food, safety is the most important if some food sources have been found, or else it is more important to find new food sources.

Table 4 Relationships between the properties and the internal contradictions.

An ant is driven by the current states of its contradictions to form new foraging routes. For example, when the ant is looking for food, with the change of the intenseness (i.e., \(\:{\varLambda\:}_{{c}_{1}})\) of contradiction \(\:{c}_{1}\), ants will constantly approach or deviate from the foraging routes left by other ants. When \(\:{\varLambda\:}_{{c}_{1}}\) approaches −1 (assuming that “exploitation” is the opposite of the contradiction), it indicates that the ant is always on the path to a known food source.

Behavior (and action set)

An ant’s actions are to change (including strengthening and weakening) the strength of the two aspects of its internal contradictions and Table 5 lists the actions related to the contradictions.

Table 5 Actions related to the internal contradictions.
Game inside contradictions

How an individual decides and chooses its actions is determined by the games between the two aspects of the internal contradictions. For example, when an ant is foraging for food, how the ant takes action (including how and where it moves) is determined by the following game matrix (Table 6) related to the contradiction of “exploration vs. exploitation”.

Table 6 Game matrix of contradiction c1 when an ant is foraging.

Generally speaking, a route with higher concentration pheromones implies that it is more possible for an ant to return to a food source along the route, whilst a route with low concentration pheromones may mean that the food source on the route has been moved empty and disappeared. An ant will judge the possibility of returning to a found food source according to the concentration of pheromones. Therefore, in the game matrix of “exploration vs exploitation”, the payoffs of both aspects to the contradiction are defined as the variations of probabilities of finding a new (or returning to an old) food source after the ant enters the adjacent location, and \(\:\varDelta\:{P}_{{new}_{r}}\) and \(\:\varDelta\:{P}_{{new}_{t}}\) represent the variations of the probabilities of finding a new food source if the ant wanders randomly or traces a route, respectively, whilst \(\:\varDelta\:{P}_{{old}_{m}}\) and \(\:\varDelta\:{P}_{{old}_{l}}\) are the variations of probabilities of returning to a found food source after the ant enter an adjacent location with more (or less) pheromones. Thus, with the games between the two aspects of the contradiction, the ant will reach some equilibrium between “exploring new food sources” and “exploiting old food sources”.

Interactions and swarm

As mentioned above, in the environment of the ant colony, the locations in the foraging space are exclusive resources whilst the pheromones are shareable resources. When ants are wandering, they will have (direct) interactions because of competing for location resources and also (indirect) interactions because of secreting and perceiving pheromones in the environment (Table 7).

When an ant moves and there are many ants around, the competition for locations will be fierce. As a result, for the contradiction of “safety vs collision”, the strength of the “collision” aspect will be stronger than that of the “safety” aspect, and the group potential of the ants around will tend to -1 (assuming that “collision” is the opposite aspect of the contradiction). Subsequently, the ant will choose to move away from the ants involved in the interaction, that is, to find a more “safe” location. Because pheromones are sharable resources and they will not lead to fierce competition, the ant always takes action similar to other ants around to find food sources or return to the nest.

Table 7 Interactions between Ants.

Emergence of swarm intelligence

According to the previous description, ants will wander randomly in the foraging space before they find a food source. After reaching the food source, ants will pick up the food and move to the nest while releasing pheromones along the way. After that, if ants perceive pheromones during their foraging, they will go there and back between the nest and the food source according to the pheromone concentration of adjacent locations like other ants, while ensuring the safety of their foraging.

At the beginning when an ant finds a food source, the pheromones have not spread. When a passing ant happens to perceive the pheromone, it will probe the route with secreted pheromones to find the food source and then secrete more pheromones on its return journey. As the pheromones continue to spread from the food source to the nest, a foraging route will extend from the food source to the nest.

To avoid collisions with other ants on the way returning to the nest, an ant does not always move along the straight path from the food source to the nest, which may form multiple foraging routes. Because an ant always gives priority to the route that can return to the nest as quickly as possible when there is no danger of collision, the concentration of pheromones on this route is usually higher than that of other routes. Thus an optimal return route will be formed from the food source to the nest, which in turn will become the best foraging route for ants.

As mentioned above, the swarm intelligence of the ant colony related to the contradiction set (exploration/exploitation, safety/collision) is represented by the distribution of these contradictions in the ant colony. Thus, if a food source with enough food has been found, more and more ants will prefer “exploitation” and “safety”, which will lead to the reduction of the joint entropy of the intenseness of the internal contradictions and further the emergence of higher and higher swarm intelligence from the ant colony.

Case studies

To verify the applicability and generality of the proposed model for the emergence of swarm intelligence, we implemented two simulation systems. Through these simulation systems, we studied and discussed the following research questions:

  • R1: Can intelligence emerge from the swarms (i.e., the effectiveness of the proposed model)? In the experiments, we calculated the intenseness of contradictions of individuals in the swarms, and computed the joint entropy of contradictions and quantified the intelligence emerged from the swarms based on the definition and quantitative formula of swarm intelligence (Definition 9 and Formulas 15–16).

  • R2: Can intelligence emerge from quickly (i.e., the efficiency of the proposed model)? We also implemented the simulation systems using traditional methods, and compared the efficiency of the proposed model by statistically analyzing the time costs for intelligence emergence.

  • R3: Is the proposed model general enough to be applicable to multiple systems (i.e., the generality of the proposed model)? We analyzed the generality of the proposed model by comparing its capabilities with that of various traditional swarm intelligence models.

Emergence of migration formation of wild geese

In the migration of a wild goose (mainly referring to its flight), two factors need to be considered, one is its flight state, and the other is its state related to the group of geese. The internal contradictions that determine the behavior of a wild goose mainly include the safety and energy-saving of flight18,19,20 and the straying and gregariousness (independence and cooperation) in the group21. For itself, it can save energy by following another goose, but it should avoid collision for safety due to too close following; related to the geese flock, it should avoid falling behind because it is straying from the geese, but it should not be too crowded to affect its free flight. Therefore, for a wild goose in the flock, it is most beneficial to keep its flight safe and energy-saving and keep neither crowded nor aloof from the flock.

In the simulation system, several geese (10 ~ 20) are randomly generated and scattered in different positions at the beginning. The front goose is automatically regarded as the leading goose and other geese migrate under the leadership of the leading goose. A flying goose always tries to maintain the equilibrium of its internal contradictions to maximize its benefits. Related to the safety and energy-saving of flight, a goose maintains the flight separation distance from the goose in front of it by accelerating or decelerating; related to the independence and cooperation in the group, the goose maintains its separation distance from the leader and its position in the group by moving left and right.

Fig. 3
figure 3

The flying formation of geese and the joint entropy of internal contradictions.

In the figures (Fig. 3), the left one shows the initial state of the wild geese group, the middle one displays the formation emerging from the geese after they fly for a while, and the right one presents changing trends of the joint entropies of the internal contradictions of geese groups with different sizes. It can be discovered that at the beginning, the distribution of contradictions within the geese was random and the joint entropy of contradictions was relatively large due to the chaotic scattering of the geese. As time went on, the joint entropy of contradictions became smaller and smaller and tended to be stable, which was consistent with the phenomenon that the geese group formed a relatively stable flight formation and indicated that some swarm intelligence emerged in the geese group (that is, a specific organizational pattern was produced).

Prisoner’s dilemma and emergence of cooperation

While studying the prisoner’s dilemma, people always infer the prisoners’ behavior decisions according to a game and then utilize repeated games to simulate the emergence of cooperation. In a game, it is always assumed that the prisoners participating in the game are rational and can comprehensively reason and calculate the benefits under different behavior strategies. In repeated games, it will set some principles for participants to adjust the current game strategy according to the previous game results, such as “rendering good for evil” (i.e., always to cooperate), “returning a tooth for a tooth” (i.e., to cooperate for cooperation and to defect for defection), etc.

However, in the real world, people who participate in a game do not necessarily have rigorous and rational analyzing and reasoning abilities, nor do they necessarily carry out complex mathematical analysis and reasoning in each game. Secondly, most of the time, the game of two sides may be one-off. Therefore, the existing simulations and researches on the emergence of cooperation are not a true portrayal of the emergence process of cooperation in the real world and do not unearth the real root of the emergence of cooperation.

In fact, most people in the real world make decisions and take action by intuition. On the one hand, they make use of experiences to judge the benefits or risks that may be brought about by the next action. On the other hand, they will adjust their behavior by referring to the social atmosphere (i.e., the common behavior of the surrounding people).

In the simulation system we have implemented, there is only one contradiction within individuals, namely, willingness to cooperate and willingness to defect. Obviously, the stronger the willingness to cooperate, the more inclined they are to take cooperative behavior. In addition, individuals are randomly scattered and move in an area. When they meet other people, they will transmit information to each other, which is mainly about their cooperation attitudes.

An individual’s willingness to cooperate (or defect) is mainly affected by three factors (see to formula 18). One is the cumulative gain of an action, which cumulates the total benefit brought about by the action. The second is the potential cumulative loss of regret, which cumulates the total loss on the assumption of taking the opposite action. If the sum of the cumulative gain of cooperation and the cumulative loss of regret of defection is larger than those of defection and regret of cooperation, the individual will increase its willingness to cooperate or else decrease its willingness to cooperate. The third is the behavior tendency of the surrounding individuals. If most individuals around have a strong willingness to cooperate (or defect), it will increase its willingness to cooperate (or defect).

$$\:\begin{array}{c}{\varDelta\:I}_{c}=\left\{\begin{array}{c}1\:\:\:\:\:{g}_{c}+{l}_{\overline{d}}>{g}_{d}+{l}_{\overline{c}}\:or\:\left|{C}_{neigh}\right|>\left|{D}_{neigh}\right|\\\:-1\:\:\:\:\:otherwise\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\end{array}\right. \end{array}$$
(18)

where, \(\:{I}_{c}\) represents the strength of willingness to cooperate,\(\:\:{\varDelta\:I}_{c}\) is the variation of willingness to cooperate after each round of game, \(\:{g}_{c}\) and \(\:{g}_{d}\) denotes the cumulative gains of cooperation and defection, \(\:{l}_{\overline{c}}\) and \(\:{l}_{\overline{d}}\) are the cumulative losses that may be brought about by the actions of regretting cooperation or defection, \(\:\left|{C}_{neigh}\right|\) and \(\:\left|{D}_{neigh}\right|\) are the number of individuals with and without the willingness to cooperate among the surrounding individuals.

In the simulation system, individuals are randomly scattered in a grid of 100 × 100. To better simulate the interaction in the real world, we have set up two scenarios. One is that an individual does not move but only interacts with the neighboring individuals beside it. The other is that an individual can move randomly, and in the process of moving, interact with the neighboring individuals in its current position. When two individuals interact, they choose to confess (i.e., defection) or refuse to confess (i.e., cooperation), and the benefits gained are shown in the following matrix (Table 8).

Table 8 Payoff matrix of interaction between individuals.

In the system, whether an individual has a cooperative intention depends on whether the strength of willingness to cooperate prevails, that is, the intenseness of the contradiction (i.e., Λ) is greater than 0 (assuming willingness to cooperate is the positive aspect of the contradiction).

We separately calculated the probabilities of cooperation (i.e., the ratio of individuals who have cooperative intentions) emerging from different population sizes when individuals do not move or move. As shown in Fig. 4, it shows the proportion of individuals having cooperative intentions among populations with the size of 1000 to 5000 in the process of 100 rounds of games between individuals.

Fig. 4
figure 4

Emergence of cooperation in repeated games.

It can be seen from the figures that with the increase in the number of rounds of the games, the proportion of individuals who have cooperative intentions in the swarm increases rapidly and will reach a certain stable state. The larger the size of the swarm is, the more quickly cooperation will emerge in the swarm, and the higher the proportion of individuals with cooperative intentions will be, which shows the scalability of swarm intelligence22. When individuals can move freely in the swarm, the proportion of individuals with cooperative intentions will be higher, which shows that the more targets an individual can contact and interact with and the more frequent interactions between individuals will take place, the more quickly and popularly cooperation will emerge in the swarm. This is very consistent with the emergence of cooperation that we have observed in the real world. With the increase of the size of population and migration of population, cooperation will emerge more quickly and cooperation will become more common.

We also calculated the variation trend of the joint entropy of contradictions of the swarms with different sizes (in the case that individuals do not move) (Fig. 5). It can be seen that the changing trend of the joint entropy of contradictions is consistent with the emergence of swarm intelligence.

Fig. 5
figure 5

The joint entropy of internal contradictions of the swarm.

In addition, we also calculated the changes of group potential of the swarm during the interaction and displayed them in heat maps (Fig. 6, in the case that individuals do not move). It can be seen that individuals who have cooperative intentions gather together, while those who do not have cooperative intentions also gather together, and there are clear divisions between cooperative and non-cooperative individuals, which implies that the influence of group potential on individuals’ willingness to cooperate is basically positively correlated. This also verifies that group potential is consistent with the level of swarm intelligence (Assertion 1).

Fig. 6
figure 6

Heat maps of group potentials among individuals.

Efficiency comparison

In our model, individuals do not need complex computations to determine their behaviors. To verify this, we compared the time complexity of our model with those representative approaches (e.g., ACO (ant colony optimization) algorithm23 and PSO (particle swarm optimization) algorithm7. ACO is inspired by the behavior of foraging ants and PSO simulates the behavior of birds (i.e., particles) searching for food. We used ACO and PSO to implement the ant colony and the wild geese system, respectively, and compared the time costs for the evolution of the swarm intelligence. The implementation platform was with a configuration with an Intel ® Core™ i7-7660U CPU @ 2.50 GHz and 8.00 GB RAM. We run the systems 10 times and calculate the average time costs (Fig. 7).

Fig. 7
figure 7

Time cost comparisons between our model and existing approaches.

As shown in Fig. 7.a, when the ant colony was implemented based on the proposed model, the emergence of intelligence (i.e., forming the shortest foraging path) in the ant colony is faster than that of using the ACO algorithm. This is because when using the ACO algorithm, ants do not secrete pheromones at all times, but instead decide whether to enhance the concentration of pheromones on the path they have just passed through based on the length of the path, which delays the emergence time of the foraging path. As shown in Fig. 7.b, when the wild geese system was implemented by using the proposed model, the speed of the formation formed among the geese is much faster than that using PSO algorithm. This is because when using the PSO algorithm, geese need to perceive the position and speed of other geese and calculate their own position and speed accordingly, which requires more complex computations and thus increases more time overhead.

In our model, the computational complexity and time overhead of individuals mainly come from solving the equilibrium of the games between internal contradictions and the group potential of surrounding individuals (see to Formula 13).

Theoretically, individuals need to solve the equilibrium of the games within contradictions when deciding their optimal behaviors. Nevertheless, in the real world, individuals do not always pursue the theoretical optimal solutions. In the simulation systems we implemented, individuals adopt a mixed strategy and only try to pursue approximate optimal solutions. Thus, the time complexity of solving the equilibrium is \(\:O\left(\right|\varGamma\:|\times\:{n}^{3})\) (where \(\:\left|\varGamma\:\right|\) is the number of contradictions and \(\:n\) is the number of strategies). Meanwhile, in our model, the games are always played between two players (i.e. the two aspects of contradictions), and each participant has only two strategies (i.e., strengthening or weakening the strength of the two aspects of contradictions and \(\:n\) = 2). Therefore, the time complexity that individuals spend on the game is almost linear (i.e., \(\:\text{O}\left(\right|\varGamma\:\left|\right)\)).

In addition, the calculation of group potential (see to Formula 8) includes computing the mathematical expectation of the intenseness of contradictions and the information entropy, the time complexity of both of which depend on and are linearly related to the size of the group, i.e. the time complexity is \(\:O\left(M\right)\) (where \(\:M\) is the number of individuals in the group).

In summary, the computational complexity of an individual’s decision-making on its behavior is linearly related to the size of the surrounding individuals.

Discussions on the generality of the proposed model

Through these simulation systems, it can be found that these systems can produce relatively stable structural or organizational patterns or unified behavior modes, which means that swarm intelligence can emerge from individuals in the continuous interaction process driven by contradictions and impacted by group potential and further verifies that this model can be used to describe the emergence of different types of swarm intelligence.

Comparably, those representative existing approaches, such as ACO, PSO and so on, have their own application scopes and limitations since they are inspired by some specific natural or social phenomena. For instance, ACO requires that the search space and the state transitions can be accurately represented, the qualities of solutions can be evaluated, and there is a positive feedback mechanism for enhancing pheromones, whereas PSO does not work well if particles’ movements cannot be defined clearly and uniquely24. Table 9 displays the applicability of the representative approaches to the systems simulated previously.

Table 9 Applicability of swarm intelligence models.

In combination with the results of the above experiments, we can assert that our model is more generic to study the emergence of swarm intelligence.

Related work

In the studies of swarm intelligence, some expect to establish general theories for the emergence of swarm intelligence to explain all emergence phenomena, whilst most researches are based on the observations and inspirations of special phenomena, taking place in natural, social, physical, etc., to establish solutions for specific complex problems.

General theories for emergence of swarm intelligence

The emergence of swarm intelligence exists widely in nature, society, and artificial systems. Therefore, more and more studies focus on exploring the underlying principles of emergence of swarm intelligence. Swarm intelligence is often associated with concepts such as self-organization and collectivity3. Emergence is considered a process of (multi-agent) systems showing high-level intelligence features4, and swarms with high-level intelligence features tend to show orderly structures in space, time, or function. Since self-organization is the process of swarms moving towards the autonomous evolution of orderly structures5, most theoretical achievements related to the emergence of swarm intelligence appear in the field of self-organizing systems. The most influential achievements include Prigogine’s dissipative structure theory25, Haken’s synergetics26, Thom’s catastrophe theory27, Eigen’s hypercycle theory28, Mandelbrot’s fractal theory29, and Lorenz’s chaos theory30. Based on these theories, some complex, dynamic and multi-level swarm intelligence theories have also been established31,32,33,34. In34, the emergence mechanism of swarm intelligence was explored from the complexity perspective, and three types of mechanisms such as stimulus-response, activation-inhibition, and attraction-repulsion were investigated to explain how higher level intelligence is evolved from lower organism to higher organism.

However, these theories generally only consider or study one (or some) aspect(s) of the emergence of swarm intelligence. For example, the dissipative structure theory mainly discusses the external environmental conditions for the emergence of orderly structures and believes that the continuous exchange of energy from the external environment is a necessary condition for systems to maintain the stability and order of structures. The synergetics points out that the force of a system’s evolution (microcosmically) comes from the competition and coordination among subsystems, and the system (macroscopically) will develop towards a critical state far from equilibrium. The catastrophe theory studies the phenomena and laws of the transition (gradual changing or leaping) from one stable state to another stable state of the system. Hypercycle theory solves the problem of the form, i.e., how subsystems are combined into a compact system by the interaction of matter, energy, and information between subsystems. The fractal theory describes the evolution or generation process of the spatial structure of a system from simple to complex. Chaos theory explains the process of dynamic nonlinear variation of a system with sensitive dependence on initial conditions.

Although it is of great scientific significance to propose and establish a universal theory or model of swarm intelligence, it is still challenging. At least so far, we have not seen such a universal model as our model. The model proposed in this paper depicts the emergence of swarm intelligence from two aspects: internal driving force and external influencing conditions, which completely expounds the condition, force, approach, form and process of the emergence of swarm intelligence.

Problem-specific models of swarm intelligence

Most swarm intelligence models or algorithms do not pursue absolute universality. They are mostly based on the observations and inspirations on some specific life swarms or social activities35 and some of them can even combine multiple inspiration sources to deal with highly complex problems36.

In37, many swarm intelligence models were reviewed and divided into four categories: distance rule based models (such as Boids38, PSO7,8, models formed through pheromone interaction (such as ACO6,23, BCA39, models containing hierarchical structures40,41, and models derived from empirical studies42,43. There are also efforts to unify different types of models into one framework. For example, in44, a general algorithm structure of intelligent optimization systems was proposed. By designing a modular framework, all algorithms (or technologies) were tried to be integrated into a unified framework instead of establishing a new model. Similarly, in45, a general computing framework of swarm intelligence is proposed, which unifies several typical swarm intelligence algorithms, such as ant colony algorithm, particle swarm algorithm, etc.

In these models, some focus on the local behavior rules of individuals, whose behavior rules are restricted or influenced by the swarm. Others put particular emphasis on the interaction mode or interaction structure between individuals, which believe that the emergence of swarm intelligence mainly comes from the interaction between individuals, under which individuals participate in cooperation or competition and adjust their states to pursue the optimization of behavior. Although these models are very different, their underlying logic believes that the emergence of swarm intelligence has a fundamental driving force. For example, the authors of46 try to investigate and explain the basic features of swarm intelligence. In their view, swarm intelligence is generated from the interaction between individuals under environmental constraints. It evolves according to the dynamic changes of the environment. Swarm intelligence is rooted in the constraints and dynamics of the environment. According to the viewpoint of the authors of47, emergence originates from the fine-tuning or adaptation of constraints imposed by the logical or physical environment. In3, it is believed that the swarm intelligence system is also dominated by the first principle. It points out that the first principle of swarm intelligence is based on natural selection and the law of evolution, and the Pareto optimality with constant scale determines the evolution direction of swarm intelligence.

In our view, for the models regarding the local behavior rules of individuals as the core (we can call them endogenous or internally-driven models), they believe that the main driving force of swarm intelligence comes from the inside of individuals, that is, the local benefits or goals of individuals are the basis for driving the behavior of individuals and also the source of driving force of the emergence of swarm intelligence. For the models considering interaction modes or structures as the core (we can call them exogenous or externally-driven models), they believe that the formation of swarm intelligence is mainly constrained and driven by the external environment (including the interaction with the environment and the information about the environment). On the one hand, external constraints affect the behavior of individuals, on the other hand, they also define the form of swarm intelligence.

However, neither the internally-driven models nor the externally-driven models have accurately identified the root causes that drive the emergence of swarm intelligence because in different models, the internal driving factors and external driving factors are not the same and these factors are often priori and pre-customized according to the expected features of swarm intelligence. In our model, swarm intelligence is the reflection of the distribution of individuals’ internal contradictions. The generation and evolution of swarm intelligence is rooted in the development of individuals’ internal contradictions. The form of swarm intelligence is affected and restricted by the interaction of individuals in the environment. Our model not only integrates the internal and external driving causes but also sums up the internal and external driving causes as basis, namely internal contradictions and external competition, existing in all swarms and supporting the existence of swarms, which makes our model universal and general.

Conclusions and future work

People have conducted decades of studies in swarm intelligence, hoping to find the internal causes of emergence and establish a universal emergence model. This paper proposes a generic model for the emergence of swarm intelligence. In this model, the internal contradictions of individuals are the root of the existence and development of individuals, the internal force that drives individual behavior, and the fundamental cause that determines the properties of individuals. Meanwhile, individuals are correlated in a swarm through the environment and interact to compete for environmental resources. The relationships and interactions of individuals will form a holistic organizational structure or behavior pattern, i.e., swarm intelligence. In essence, swarm intelligence can be considered a synthesized reflection of the distribution of individual contradictions in a swarm.

Our model can not only describe and simulate the emergence of a holistic organizational structure but also the emergence of a global behavior pattern. From the experiments, it can be seen that the model in this paper is very fundamental and can be realized without needing complex calculations.

However, the model proposed in this paper still has some limitations. For example, contradictions are predetermined. Generally speaking, individuals may generate new contradictions when interacting. For simplicity, we assume that the newly generated contradictions are predictable so that we can predefine the game matrix within the contradictions. Secondly, conceptually, if there are internal contradictions, there should be external contradictions, that is there will also be contradictions between individuals and the environment as well as between individuals. However, it is difficult to regard external contradictions as contradictions in concept, because they are more concerned with the struggle between individuals for survival and the struggle is essentially the interaction caused by competition and occupation of environmental resources. Therefore, we do not deliberately emphasize external contradictions in the model, but treat interaction as a more basic concept to form a swarm. This is also because the external relationships of individuals with the environment and other individuals are dynamic, external contradictions are not as stable as internal contradictions, and the environmental resources that individuals require for survival are relatively stable, emphasizing interaction rather than external contradictions in the model can better describe individuals and swarms. Thirdly, the current model only considers the contradictions at the individual level. There may also be contradictions at the swarm level, such as social contradictions, although these contradictions also emerge from the contradictions at the individual level.

In the next stage, we will expand the model to support various dynamic properties mentioned above, such as allowing individuals to generate new contradictions, allowing new individuals to be generated in the swarm, and even allowing different levels of contradictions in the swarm.

The simulation systems are still very simple, in which individuals are homogeneous and the set of internal contradictions inside an individual is small. We will verify the effectiveness of this model in more complex and real-world systems. In our previous work48, we implemented a simulation traffic control system based on a values-driven self-organization mechanism. Next, we will apply the model proposed in this work to the traffic control system to verify its effectiveness and applicability.

In addition, the descriptions of individual behavior and interaction in the current model are still very preliminary. We will establish a mathematical calculus system for individuals and their interactions, which can rigorously promote the emergence of swarm intelligence.