
Swarm behaviour, or swarming, is a
collective behaviour
The expression collective behavior was first used by Franklin Henry Giddings and employed later by Robert Park and Ernest Burgess, Herbert Blumer, Ralph H. Turner and Lewis Killian, and Neil Smelser to refer to social processes and even ...
exhibited by entities, particularly animals, of similar size which aggregate together, perhaps milling about the same spot or perhaps moving ''en masse'' or
migrating in some direction. It is a highly interdisciplinary topic.
As a term, ''swarming'' is applied particularly to insects, but can also be applied to any other entity or animal that exhibits swarm behaviour. The term ''
flocking
A flock is a large group of animals, especially birds, sheep, or goats. Flock or flocking also may refer to:
Computing
* Flock (messaging service), a communication app for teams
* Flock (web browser), a discontinued web browser
* Flock system ca ...
'' or ''murmuration'' can refer specifically to swarm behaviour in birds, ''
herding
Herding is the act of bringing individual animals together into a group ( herd), maintaining the group, and moving the group from place to place—or any combination of those. Herding can refer either to the process of animals forming herds i ...
'' to refer to swarm behaviour in
tetrapods
Tetrapods (; ) are four-limb (anatomy), limbed vertebrate animals constituting the superclass Tetrapoda (). It includes extant taxon, extant and extinct amphibians, sauropsids (reptiles, including dinosaurs and therefore birds) and synapsids (p ...
, and
''shoaling'' or ''schooling'' to refer to swarm behaviour in fish.
Phytoplankton
Phytoplankton () are the autotrophic (self-feeding) components of the plankton community and a key part of ocean and freshwater ecosystems. The name comes from the Greek words (), meaning 'plant', and (), meaning 'wanderer' or 'drifter'.
P ...
also gather in huge swarms called
''blooms'', although these organisms are
algae
Algae ( , ; : alga ) are any of a large and diverse group of photosynthetic, eukaryotic organisms. The name is an informal term for a polyphyletic grouping that includes species from multiple distinct clades. Included organisms range from ...
and are not self-propelled the way animals are. By extension, the term "swarm" is applied also to inanimate entities which exhibit parallel behaviours, as in a
robot swarm, an
earthquake swarm
In seismology, an earthquake swarm is a sequence of seismic events occurring in a local area within a relatively short period. The time span used to define a swarm varies, but may be days, months, or years. Such an energy release is different f ...
, or a swarm of stars.
From a more abstract point of view, swarm behaviour is the collective motion of a large number of
self-propelled entities. From the perspective of the mathematical modeller, it is an
emergent
Emergent may refer to:
* ''Emergent'' (album), a 2003 album by Gordian Knot
* Emergent (software), Neural Simulation Software
* Emergent BioSolutions, a multinational biopharmaceutical company headquartered in Gaithersburg, Maryland, USA
* Emerg ...
behaviour arising from simple rules that are followed by individuals and does not involve any central coordination. Swarm behaviour is also studied by
active matter
Active matter is matter composed of large numbers of active "agents", each of which consumes energy in order to move or to exert mechanical forces. Such systems are intrinsically out of thermal equilibrium. Unlike thermal systems relaxing toward ...
physicists as a phenomenon which is not in
thermodynamic equilibrium
Thermodynamic equilibrium is an axiomatic concept of thermodynamics. It is an internal state of a single thermodynamic system, or a relation between several thermodynamic systems connected by more or less permeable or impermeable walls. In ther ...
, and as such requires the development of tools beyond those available from the
statistical physics
Statistical physics is a branch of physics that evolved from a foundation of statistical mechanics, which uses methods of probability theory and statistics, and particularly the mathematical tools for dealing with large populations and approxi ...
of systems in thermodynamic equilibrium. In this regard, swarming has been compared to the mathematics of
superfluids
Superfluidity is the characteristic property of a fluid with zero viscosity which therefore flows without any loss of kinetic energy. When stirred, a superfluid forms vortices that continue to rotate indefinitely. Superfluidity occurs in two i ...
, specifically in the context of
starling flocks (murmuration).
Swarm behaviour was first simulated on a computer in 1986 with the simulation program
boids
Boids is an artificial life program, developed by Craig Reynolds in 1986, which simulates the flocking behaviour of birds. His paper on this topic was published in 1987 in the proceedings of the ACM SIGGRAPH conference. The name "boid" corres ...
.
This program simulates simple
agents (boids) that are allowed to move according to a set of basic rules. The model was originally designed to mimic the flocking behaviour of birds, but it can be applied also to schooling fish and other swarming entities.
Models
In recent decades, scientists have turned to modeling swarm behaviour to gain a deeper understanding of the behaviour.
Mathematical models

Early studies of swarm behaviour employed mathematical models to simulate and understand the behaviour. The simplest mathematical models of animal swarms generally represent individual animals as following three rules:
* Move in the same direction as their neighbours
* Remain close to their neighbours
* Avoid collisions with their neighbours
The
boids
Boids is an artificial life program, developed by Craig Reynolds in 1986, which simulates the flocking behaviour of birds. His paper on this topic was published in 1987 in the proceedings of the ACM SIGGRAPH conference. The name "boid" corres ...
computer program, created by
Craig Reynolds in 1986, simulates swarm behaviour following the above rules.
Many subsequent and current models use variations on these rules, often implementing them by means of concentric "zones" around each animal. In the "zone of repulsion", very close to the animal, the focal animal will seek to distance itself from its neighbours to avoid collision. Slightly further away, in the "zone of alignment", the focal animal will seek to align its direction of motion with its neighbours. In the outermost "zone of attraction", which extends as far away from the focal animal as it is able to sense, the focal animal will seek to move towards a neighbour.
The shape of these zones will necessarily be affected by the sensory capabilities of a given animal. For example, the visual field of a bird does not extend behind its body. Fish rely on both vision and on
hydrodynamic
In physics and engineering, fluid dynamics is a subdiscipline of fluid mechanics that describes the flow of fluids—liquids and gases. It has several subdisciplines, including ''aerodynamics'' (the study of air and other gases in motion) and ...
perceptions relayed through their
lateral lines, while Antarctic
krill
Krill are small crustaceans of the order Euphausiacea, and are found in all the world's oceans. The name "krill" comes from the Norwegian word ', meaning "small fry of fish", which is also often attributed to species of fish.
Krill are consid ...
rely both on vision and hydrodynamic signals relayed through
antennae.
However recent studies of starling flocks have shown that each bird modifies its position, relative to the six or seven animals directly surrounding it, no matter how close or how far away those animals are.
Interactions between flocking starlings are thus based on a
topological
In mathematics, topology (from the Greek words , and ) is concerned with the properties of a geometric object that are preserved under continuous deformations, such as stretching, twisting, crumpling, and bending; that is, without closing ...
, rather than a metric, rule. It remains to be seen whether this applies to other animals. Another recent study, based on an analysis of high-speed camera footage of flocks above Rome and assuming minimal behavioural rules, has convincingly simulated a number of aspects of flock behaviour.
Evolutionary models
In order to gain insight into why animals evolve swarming behaviours, scientists have turned to evolutionary models that simulate populations of evolving animals. Typically these studies use a
genetic algorithm
In computer science and operations research, a genetic algorithm (GA) is a metaheuristic inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms (EA). Genetic algorithms are commonly used to gen ...
to simulate
evolution
Evolution is change in the heritable characteristics of biological populations over successive generations. These characteristics are the expressions of genes, which are passed on from parent to offspring during reproduction. Variation ...
over many generations. These studies have investigated a number of hypotheses attempting to explain why animals evolve swarming behaviours, such as the
selfish herd theory
The selfish herd theory states that individuals within a population attempt to reduce their predation risk by putting other conspecifics between themselves and predators. A key element in the theory is the domain of danger, the area of ground in wh ...
the predator confusion effect, the dilution effect, and the many eyes theory.
Agents
*
Self-organization
Emergence
The concept of emergence—that the properties and functions found at a hierarchical level are not present and are irrelevant at the lower levels–is often a basic principle behind
self-organizing systems
Self-organization, also called spontaneous order in the social sciences, is a process where some form of overall order arises from local interactions between parts of an initially disordered system. The process can be spontaneous when suffic ...
.
An example of
self-organization in biology leading to emergence in the natural world occurs in ant colonies. The queen does not give direct orders and does not tell the ants what to do. Instead, each ant reacts to stimuli in the form of chemical scents from larvae, other ants, intruders, food and buildup of waste, and leaves behind a chemical trail, which, in turn, provides a stimulus to other ants. Here each ant is an autonomous unit that reacts depending only on its local environment and the genetically encoded rules for its variety. Despite the lack of centralized decision making, ant colonies exhibit complex behaviours and have even been able to demonstrate the ability to solve geometric problems. For example, colonies routinely find the maximum distance from all colony entrances to dispose of dead bodies.
Stigmergy
A further key concept in the field of swarm intelligence is
stigmergy
Stigmergy ( ) is a mechanism of indirect coordination, through the environment, between agents or actions. The principle is that the trace left in the environment by an individual action stimulates the performance of a succeeding action by the sa ...
.
[Parunak, H. v D. (2003)]
"Making swarming happen"
In: Proceedings of Conference on Swarming and Network Enabled Command, Control, Communications, Computers, Intelligence, Surveillance and Reconnaissance (C4ISR), McLean, Virginia, USA, 3 January 2003. Stigmergy is a mechanism of indirect coordination between agents or actions. The principle is that the trace left in the environment by an action stimulates the performance of a next action, by the same or a different agent. In that way, subsequent actions tend to reinforce and build on each other, leading to the spontaneous emergence of coherent, apparently systematic activity. Stigmergy is a form of self-organization. It produces complex, seemingly intelligent structures, without need for any planning, control, or even direct communication between the agents. As such it supports efficient collaboration between extremely simple agents, who lack any memory, intelligence or even awareness of each other.
[
]
Swarm intelligence
Swarm intelligence
Swarm intelligence (SI) is the collective behavior of decentralized, self-organized systems, natural or artificial. The concept is employed in work on artificial intelligence. The expression was introduced by Gerardo Beni and Jing Wang in 1989, ...
is the collective behaviour
The expression collective behavior was first used by Franklin Henry Giddings and employed later by Robert Park and Ernest Burgess, Herbert Blumer, Ralph H. Turner and Lewis Killian, and Neil Smelser to refer to social processes and even ...
of decentralized
Decentralization or decentralisation is the process by which the activities of an organization, particularly those regarding planning and decision making, are distributed or delegated away from a central, authoritative location or group.
Conce ...
, self-organized
Self-organization, also called spontaneous order in the social sciences, is a process where some form of overall order arises from local interactions between parts of an initially disordered system. The process can be spontaneous when suffi ...
systems, natural or artificial. The concept is employed in work on artificial intelligence
Artificial intelligence (AI) is intelligence—perceiving, synthesizing, and inferring information—demonstrated by machines, as opposed to intelligence displayed by animals and humans. Example tasks in which this is done include speech r ...
. The expression was introduced by Gerardo Beni Gerardo Beni (born Florence, Italy 21 February 1946) is a professor of electrical engineering at University of California, Riverside who, with Jing Wang, is known as the originator of the term ''swarm intelligence'' in the context of cellular robot ...
and Jing Wang in 1989, in the context of cellular robotic systems.
Swarm intelligence systems are typically made up of a population of simple agents such as boids
Boids is an artificial life program, developed by Craig Reynolds in 1986, which simulates the flocking behaviour of birds. His paper on this topic was published in 1987 in the proceedings of the ACM SIGGRAPH conference. The name "boid" corres ...
interacting locally with one another and with their environment. The agents follow very simple rules, and although there is no centralized control structure dictating how individual agents should behave, local, and to a certain degree random, interactions between such agents lead to the emergence
In philosophy, systems theory, science, and art, emergence occurs when an entity is observed to have properties its parts do not have on their own, properties or behaviors that emerge only when the parts interact in a wider whole.
Emergen ...
of intelligent global behaviour, unknown to the individual agents.
Swarm intelligence research is multidisciplinary. It can be divided into natural swarm research studying biological systems and artificial swarm research studying human artefacts. There is also a scientific stream attempting to model the swarm systems themselves and understand their underlying mechanisms, and an engineering stream focused on applying the insights developed by the scientific stream to solve practical problems in other areas.
Algorithms
Swarm algorithms follow a Lagrangian approach or an Eulerian approach. The Eulerian approach views the swarm as a field
Field may refer to:
Expanses of open ground
* Field (agriculture), an area of land used for agricultural purposes
* Airfield, an aerodrome that lacks the infrastructure of an airport
* Battlefield
* Lawn, an area of mowed grass
* Meadow, a grass ...
, working with the density of the swarm and deriving mean field properties. It is a hydrodynamic approach, and can be useful for modelling the overall dynamics of large swarms. However, most models work with the Lagrangian approach, which is an agent-based model
An agent-based model (ABM) is a computational model for simulating the actions and interactions of autonomous agents (both individual or collective entities such as organizations or groups) in order to understand the behavior of a system and what ...
following the individual agents (points or particles) that make up the swarm. Individual particle models can follow information on heading and spacing that is lost in the Eulerian approach.
Ant colony optimization
Ant colony optimization is a widely used algorithm which was inspired by the behaviours of ants, and has been effective solving discrete optimization
Discrete optimization is a branch of optimization in applied mathematics and computer science.
Scope
As opposed to continuous optimization, some or all of the variables used in a discrete mathematical program are restricted to be discrete var ...
problems related to swarming. The algorithm was initially proposed by Marco Dorigo
Marco Dorigo (born 26 August 1961, in Milan, Italy) is a research director for the Belgian Funds for Scientific Research and a co-director of ''IRIDIA'', the artificial intelligence lab of the Université Libre de Bruxelles.
He received a PhD in ...
in 1992,[M. Dorigo, ''Optimization, Learning and Natural Algorithms'', PhD thesis, Politecnico di Milano, Italie, 1992.] and has since been diversified to solve a wider class of numerical problems. Species that have multiple queens may have a queen leaving the nest along with some workers to found a colony at a new site, a process akin to swarming in honeybees.[Hölldobler & Wilson (1990), pp. 143–179]
*Ants are behaviourally unsophisticated; collectively they perform complex tasks. Ants have highly developed sophisticated sign-based communication.
*Ants communicate using pheromones; trails are laid that can be followed by other ants.
*Routing problem ants drop different pheromones used to compute the "shortest" path from source to destination(s).
*
Self-propelled particles
The concept of self-propelled particles
Self-propelled particles (SPP), also referred to as self-driven particles, are terms used by physicists to describe autonomous agents, which convert energy from the environment into directed or persistent motion. Natural systems which have insp ...
(SPP) was introduced in 1995 by Tamás Vicsek
Tamás Vicsek (, born 10 May 1948, Budapest) is a Hungarian scientist with research interests in numerical studies of dense liquids, percolation theory, Monte Carlo simulation of cluster models, aggregation phenomena, fractal growth, pattern fo ...
''et al.'' as a special case of the boids model introduced in 1986 by Reynolds. An SPP swarm is modelled by a collection of particles that move with a constant speed and respond to random perturbations by adopting at each time increment the average direction of motion of the other particles in their local neighbourhood.
Simulations demonstrate that a suitable "nearest neighbour rule" eventually results in all the particles swarming together, or moving in the same direction. This emerges, even though there is no centralized coordination, and even though the neighbours for each particle constantly change over time. SPP models predict that swarming animals share certain properties at the group level, regardless of the type of animals in the swarm. Swarming systems give rise to emergent behaviour
In philosophy, systems theory, science, and art, emergence occurs when an entity is observed to have properties its parts do not have on their own, properties or behaviors that emerge only when the parts interact in a wider whole.
Emergence ...
s which occur at many different scales, some of which are both universal and robust. It has become a challenge in theoretical physics to find minimal statistical models that capture these behaviours.
Particle swarm optimization
Particle swarm optimization is another algorithm widely used to solve problems related to swarms. It was developed in 1995 by Kennedy
Kennedy may refer to:
People
* John F. Kennedy (1917–1963), 35th president of the United States
* John Kennedy (Louisiana politician), (born 1951), US Senator from Louisiana
* Kennedy (surname), a family name (including a list of persons with ...
and Eberhart and was first aimed at simulating
A simulation is the imitation of the operation of a real-world process or system over time. Simulations require the use of models; the model represents the key characteristics or behaviors of the selected system or process, whereas the s ...
the social behaviour and choreography of bird flocks and fish schools.[
][
] The algorithm was simplified and it was observed to be performing optimization. The system initially seeds a population with random solutions. It then searches in the problem space
Problem solving is the process of achieving a goal by overcoming obstacles, a frequent part of most activities. Problems in need of solutions range from simple personal tasks (e.g. how to turn on an appliance) to complex issues in business an ...
through successive generations using stochastic optimization
Stochastic optimization (SO) methods are optimization methods that generate and use random variables. For stochastic problems, the random variables appear in the formulation of the optimization problem itself, which involves random objective fun ...
to find the best solutions. The solutions it finds are called particles
In the physical sciences, a particle (or corpuscule in older texts) is a small localized object which can be described by several physical or chemical properties, such as volume, density, or mass.
They vary greatly in size or quantity, from ...
. Each particle stores its position as well as the best solution it has achieved so far. The particle swarm optimizer tracks the best local value obtained so far by any particle in the local neighbourhood. The remaining particles then move through the problem space following the lead of the optimum particles. At each time iteration, the particle swarm optimiser accelerates each particle toward its optimum locations according to simple mathematical rules. Particle swarm optimization has been applied in many areas. It has few parameters to adjust, and a version that works well for a specific applications can also work well with minor modifications across a range of related applications. A book by Kennedy and Eberhart describes some philosophical aspects of particle swarm optimization applications and swarm intelligence.[
] An extensive survey of applications is made by Poli.[
]
Altruism
Researchers in Switzerland have developed an algorithm based on Hamilton's rule
Kin selection is the evolutionary strategy that favours the reproductive success of an organism's relatives, even when at a cost to the organism's own survival and reproduction. Kin altruism can look like altruistic behaviour whose evolution i ...
of kin selection. The algorithm shows how altruism
Altruism is the moral principle, principle and moral courage, moral practice of concern for the welfare and/or happiness of other human kind, human beings or animals, resulting in a quality of life both material and spirituality, spiritual. It ...
in a swarm
Swarm behaviour, or swarming, is a collective behaviour exhibited by entities, particularly animals, of similar size which aggregate together, perhaps milling about the same spot or perhaps moving ''en masse'' or migrating in some direction. ...
of entities can, over time, evolve and result in more effective swarm behaviour.
Biological swarming
The earliest evidence of swarm behaviour in animals dates back about 480 million years. Fossils of the trilobite
Trilobites (; meaning "three lobes") are extinct marine arthropods that form the class Trilobita. Trilobites form one of the earliest-known groups of arthropods. The first appearance of trilobites in the fossil record defines the base of the ...
''Ampyx priscus
''Ampyx'' is an Ordovician-Silurian genus of Asaphid trilobites of the family Raphiophoridae. Species of ''Ampyx'' are characterized by three extended spines on the head-shield, one spine derived from each free cheek, and one spine emanati ...
'' have been recently described as clustered in lines along the ocean floor. The animals were all mature adults, and were all facing the same direction as though they had formed a conga line
The conga line is a novelty line dance that was derived from the Cuban carnival dance of the same name and became popular in the US in the 1930s and 1950s. In order to perform the dance, dancers form a long, processing line, which would usually ...
or a peloton
In a road bicycle race, the peloton (from French, originally meaning 'platoon') is the main group or pack of riders. Riders in a group save energy by riding close (drafting or slipstreaming) to (particularly behind) other riders. The reductio ...
. It has been suggested they line up in this manner to migrate, much as spiny lobster
Spiny lobsters, also known as langustas, langouste, or rock lobsters, are a family (Palinuridae) of about 60 species of achelate crustaceans, in the Decapoda Reptantia. Spiny lobsters are also, especially in Australia, New Zealand, Ireland, S ...
s migrate in single-file queues; it has also been suggested that the formation is the precursor for mating, as with the fly ''Leptoconops torrens
''Leptoconops torrens'' (commonly known as the biting midge fly) is a species of small biting flies in the no-see-um family Ceratopogonidae. They were first mentioned in writing by Charles Henry Tyler Townsend in 1893. The name ''Leptoconops c ...
''. The findings suggest animal collective behaviour has very early evolutionary origins.
Examples of biological swarming are found in bird flocks, fish schools, insect swarm
Swarm behaviour, or swarming, is a collective animal behaviour, collective behaviour exhibited by entities, particularly animals, of similar size which aggregate together, perhaps milling about the same spot or perhaps moving ''en masse'' or a ...
s, bacteria swarm
Swarm behaviour, or swarming, is a collective behaviour exhibited by entities, particularly animals, of similar size which aggregate together, perhaps milling about the same spot or perhaps moving ''en masse'' or migrating in some direction. ...
s, molds, molecular motor
Molecular motors are natural (biological) or artificial molecular machines that are the essential agents of movement in living organisms. In general terms, a motor is a device that consumes energy in one form and converts it into motion or mech ...
s, quadruped herds and people.
Social insects
The behaviour of social insects (insects that live in colonies
In modern parlance, a colony is a territory subject to a form of foreign rule. Though dominated by the foreign colonizers, colonies remain separate from the administration of the original country of the colonizers, the '' metropolitan state' ...
, such as ants, bees, wasps and termites) has always been a source of fascination for children, naturalists and artists. Individual insects seem to do their own thing without any central control, yet the colony as a whole behaves in a highly coordinated manner.[Bonabeau E and Theraulaz G (2008) "Swarm Smarts". In ''Your Future with Robots'' Scientific American Special Editions.] Researchers have found that cooperation at the colony level is largely self-organized
Self-organization, also called spontaneous order in the social sciences, is a process where some form of overall order arises from local interactions between parts of an initially disordered system. The process can be spontaneous when suffi ...
. The group coordination that emerges is often just a consequence of the way individuals in the colony interact. These interactions can be remarkably simple, such as one ant merely following the trail left by another ant. Yet put together, the cumulative effect of such behaviours can solve highly complex problems, such as locating the shortest route in a network of possible paths to a food source. The organised behaviour that emerges in this way is sometimes called swarm intelligence
Swarm intelligence (SI) is the collective behavior of decentralized, self-organized systems, natural or artificial. The concept is employed in work on artificial intelligence. The expression was introduced by Gerardo Beni and Jing Wang in 1989, ...
, a form of biological emergence.[
]
Ants
Individual ants
Ants are Eusociality, eusocial insects of the Family (biology), family Formicidae and, along with the related wasps and bees, belong to the Taxonomy (biology), order Hymenoptera. Ants evolved from Vespoidea, vespoid wasp ancestors in the Creta ...
do not exhibit complex behaviours, yet a colony of ants collectively achieves complex tasks such as constructing nests, taking care of their young, building bridges and foraging
Foraging is searching for wild food resources. It affects an animal's fitness because it plays an important role in an animal's ability to survive and reproduce. Foraging theory is a branch of behavioral ecology that studies the foraging behavi ...
for food. A colony of ants can collectively select (i.e. send most workers towards) the best, or closest, food source from several in the vicinity. Such collective decisions are achieved using positive feedback mechanisms. Selection of the best food source is achieved by ants following two simple rules. First, ants which find food return to the nest depositing a pheromone
A pheromone () is a secreted or excreted chemical factor that triggers a social response in members of the same species. Pheromones are chemicals capable of acting like hormones outside the body of the secreting individual, to affect the behavio ...
chemical. More pheromone is laid for higher quality food sources. Thus, if two equidistant food sources of different qua