You are on page 1of 11

Swarm Intelligence

Jonas Pfeil

Communication and Operating Systems Group


Berlin University of Technology
pfeil@cs.tu-berlin.de

Abstract. Swarms have fascinating properties. Their individual mem-


bers follow simple rules – yet the swarm accomplishes complex tasks.
No single member controls the swarm, making it extremely robust. This
simplicity and robustness make them an interesting model for solving
problems in computer science. In this paper the term swarm intelligence
is explained and the motivation behind the approach is discussed. Proper-
ties of swarms and social insects are described and the process of building
a metaheuristic after an example in nature is looked at. Different uses
of swarm intelligence are introduced and the usefulness of the field is
evaluated.

1 Introduction and Definition

Swarm intelligence (SI) as defined by Bonabeau, Dorigo and Theraulaz is “any


attempt to design algorithms or distributed problem-solving devices inspired by
the collective behavior of social insect colonies and other animal societies” [1,
p. 7]. So every time something is inspired by swarms – it is swarm intelligence.
But why imitate swarms in the first place?
Swarms have fascinated scientist for a long time. Insect colonies for example
seem to work in a coordinated manner – yet no single member of the swarm is in
control. What is accomplished is an emergent phenomenon. Termites build giant
structures, ants manage to find food sources quickly and efficiently and flocks of
birds and schools of fish fend off predators and move as one body. But how does
nature create this coordination?
This question is discussed in the next section. In Sect. 3 the two existing
metaheuristics inspired by swarms are introduced, while in Sect. 4 other uses of
the research on swarms are described. The last section evaluates the usefulness
of the approach and summarizes this paper.

2 Swarm Intelligence in Nature

Swarm behavior in nature is divided into two categories: Species whose individ-
uals form a swarm because they benefit in some way and social insects – which
live in colonies whose members cannot survive on their own.
2.1 Social Insects
Compared to the complexity of the buildings and actions of the colony the
relative simplicity of an individual is a striking feature of social insects. Termites
for example build giant mounds with ventilation shafts and grow fungus for
nourishment. Ants manage to efficiently search an area for food – whether it
is evenly distributed or scattered in patches (see Fig. 1), an example for the
robustness of the insect colony. Social insects also efficiently divide tasks like
finding food, feeding the brood and defending the nest.

Fig. 1. Foraging patterns of three army ant species: Eciton hamatum, E. rapax
and E. burchelli. The different patterns are a result of the distribution of food
sources. The food of E. burchelli is evenly distributed while for E. hamatum it is
distributed in patches. E. rapax has an intermediary distribution. After Burton
and Franks [2]. Image taken from [1, p. 37]. Kansas Science Bulletin.

All this is not achieved by central control but by stigmergy 1 and very seldom
by one to one communication. Stigmergy describes an indirect communication
by leaving marks in the environment. These marks can be the structures that are
built or markers meant especially for the purpose of communication (typically
1
Grassé introduces stigmergy as follows: “The coordination of tasks and the regulation
of constructions does not depend directly on the workers, but on the constructions
themselves. The worker does not direct his work, but is guided by it. It is to this spe-
cial form of stimulation that we give the name STIGMERGY (stigma, wound from
a pointed object; ergon, work, product of labor D stimulating product of labor).” [3,
p. 65]
pheromones which can be smelled by the individuals). The marks left by the
colony act as stimuli for the individuals and can trigger certain actions.
While constructing a nest termites for example will start by randomly placing
pellets of mud. When there is an aggregation of pellets they will more likely drop
pellets at that location than elsewhere. In addition the termites are guided by
pheromone concentration forming for example the pattern for the royal chamber
around the queen [3].
Ants use pheromones to find shortest paths to food sources. They lay out
pheromone trails behind them and prefer regions with higher pheromone con-
centration when deciding where to go. Some species deposit different amounts
of pheromone depending whether they are on the way to or back from the food
source and depending on its size. As ants taking the shorter path will reinforce
the trail more often the pheromone concentration rises and the path will be pre-
ferred by following individuals (see Fig. 2). This self-energizing effect leads to the
development of a shortest path used by the individuals. Pheromone evaporation
prevents stagnation, allowing for dynamic changes in the environment. It also
avoids premature convergence on a not optimal path.

(a) (b)

Fig. 2. Ants find the shorter path in an experimental setup. A bridge leads from
a nest to a foraging area. (a) 4 minutes after bridge placement. (b) 8 minutes
after bridge placement. After Goss et al. [4].

2.2 Flocks, Herds and Schools


Social insects do not have a choice whether or not to live in swarms – but what
are the advantages for herd animals, flocks of birds and schools of fish that
cause the formation of swarms? Defense against predators is thought to be the
most important reason for animals to join a swarm. As Kenward [5] showed the
success of hawk attacks on pigeons decreases greatly with the size of the swarm.
Also the disadvantage of sharing food sources can be outweighed by the reduced
chances of finding no food at all, whenever the food is unpredictably distributed
in patches [6, p. 209]. Individuals may also increase their chances of finding a
mate [7] and for animals that travel great distances – like migratory birds and
certain fish species – there is a decrease in energy consumption when moving in
a tight formation.
As flocks, herds and schools can become very large and the individuals are
both limited in their mental capacity and their perception, it can be assumed
that only simple, local rules control the movements of a single animal. “Local”
means that only objects in a certain neighborhood – depending on the perception
of the individual – are taken into account. The most basic behaviors seem to be
an urge to stay close to the swarm and one to avoid collisions [7].
The perception is of course not the same for different species resulting in a
different range of possible swarm behaviors. Fish for example cannot see as far
as birds especially in murky water but can feel the pressure waves of neighbors
with their lateral line organ [8]. Birds on the other hand have long-range vision
enabling them to see the movements of far away flock mates. This enables them
to prepare for the change of direction, which explains the quick propagation
of “maneuver waves” going through a flock that is much faster than can be
explained by strictly local rules and the reaction times of the birds [9].
Computer simulations have been created after these findings. Reynolds [10]
created a computer graphics simulation of swarms which he called the boids2
model using three simple local rules for the movement of an individual: Colli-
sion avoidance, velocity matching (heading and speed) and flock centering (see
Fig. 3). Heppner and Grenander [11] independently developed a similar model
using stochastic nonlinear differential equations [12].

(a) (b) (c)

Fig. 3. Rules for the boids simulation: (a) Collision avoidance. (b) Velocity
matching. (c) Flock centering. After Reynolds [10].

Swarms in nature could be said to “run in constant time” because every


individual interacts only with its neighbors and therefore its mental capacity
2
Boid means “bird-oid” object. Not necessarily a bird [10].
does not limit the size of the swarm3 . In the simulation the relations to all
other indiviuals have to be taken into account – at least to determine if they are
in the neighborhood. Without further measures like spatial data structures the
complexity will be O(n2 ).

3 Metaheuristics
An SI-metaheuristic is an arbitrary problem solving strategy which falls under
the SI-definition. That is, it is inspired by the “behavior of social insect colonies
and other animal societies”. Currently there exist two different metaheuristics –
ant colony optimization (ACO) and particle swarm optimization (PSO).
Stochastic diffusion search (SDS) is an optimization technique introduced by
Bishop in 1989 [14]. His original paper included no reference to nature and it has
not been included in any of the books about SI [1,15,16]. The only work claiming
that SDS is an SI-algorithm is a paper published in 2006 by Meyer, Nasuto and
Mark [17]. They see “many similarities with ant and evolutionary algorithms”.
As SDS was not inspired by swarms it is doubtful if it can be said to belong to
the SI-field. It is therefore not further discussed in this paper.

3.1 Ant Colony Optimization


Ant colony optimization [18] is a metaheuristic for difficult combinatorial opti-
mization problems modeled after the stigmergetic communication of ants finding
shortest paths to food sources. The first ACO-algorithm was Ant System (AS),
introduced by Dorigo [19] in 1992. He later generalized it into the ACO meta-
heuristic. Ant colony optimization uses virtual ants laying out virtual pheromone
in the problem states they visit. As in nature the virtual ants communicate indi-
rectly and the solution to the problem emerges by the cooperation of the colony.
As an example a simple implementation for the traveling salesman problem
(TSP) could work as follows: Ants start at a random city and choose the next
city stochastically but prefer the road with more pheromone. When they cannot
choose another city or have completed a tour, they die. If they managed to
complete a tour they deposit pheromone on all the visited edges. The shorter
the tour, the more pheromone is placed. Ants work simultaneously and new ants
are created as needed to keep the population on a desired level. The search is
finished when a short enough tour is found, or a maximum number of iterations
were done.
Algorithm 1 shows the metaheuristic in pseudocode. It searches for a short-
est path through a problem graph. Ants are created on random problem states
and move around the graph. When selecting a neighbor state the ants make a
stochastic decision guided by the pheromone concentration on the edge, their
private information (that is, the previous states) and problem-specific local in-
formation. Ants die if they have found a solution or there are no more feasible
3
In nature schools of fish for example can span multiple miles and contain millions of
fish [13, p. 64].
states to move to. Depending on the implementation they can deposit pheromone
on the edges while they are moving, when they die or both. When depositing
pheromone after a solution is found, the amount can depend on the quality of
the solution. The algorithm terminates when a satisfying solution was found or
another termination criterion is reached (e.g., a time constraint). Algorithm 1 is
a nonparallel version of ACO but generally the ants – like in nature – can work
simultaneously allowing a parallel implementation.

Algorithm 1 Ant Colony Optimization


1: repeat
2: if antCount < maxAnts then
3: create a new ant
4: set initial state
5: end if
6: for all ants do
7: determine all feasible neighbor states {considering the ant’s visited states}
8: if solution found ∨ no feasible neighbor state then
9: kill ant
10: if we use delayed pheromone update then
11: evaluate solution
12: deposit pheromone on all used edges
13: end if
14: else
15: stochastically select a feasible neighbor state {directed by the ants memory,
the pheromone concentration on the edges and local heuristics}
16: if we use step-by-step pheromone update then
17: deposit pheromone on the used edge
18: end if
19: end if
20: end for
21: evaporate pheromone
22: until termination criterion satisfied {e.g., found a satisfying solution}

Dorigo used the TSP as a benchmark problem for Ant System (AS). The re-
sults were comparable or even better than those of genetic algorithms and some
general purpose heuristics for small problems but degraded for larger problems.
A number of improved versions of AS and other algorithms after the ACO meta-
heuristic have been created since then [18]. Applications range from sequential
ordering problems over vehicle routing and scheduling problems to telecommu-
nications networks.

3.2 Particle Swarm Optimization

Particle swarm optimization is a metaheuristic for the optimization of contin-


uous functions. It was created by Kennedy and Eberhart [20] in 1995 and was
inspired by bird flocking behavior. Kennedy and Eberhart originally wanted to
simulate a social system and therefore used the models created by Reynolds
[10] and Heppner [11]. Somewhere in the process they realized that a flock of
birds searching for food could be a good model for the optimization of arbitrary
functions.
In the algorithm virtual birds fly around the problem space and evaluate the
function. Each bird remembers its personal best position xpbest (that is, where
the function was fittest) and of all these, the globally best personal value xgbest
is determined. As shown in (1) birds are attracted by xpbest and xgbest . At each
iteration the birds velocity vectors v are modified. An acceleration towards xpbest
and xgbest is stochastically calculated. The factor 2 was empirically determined.
Each force is given equal measure to ensure a balance between exploration and
convergence. Like with ACO the algorithm terminates when a position with
satisfying fitness was found or another termination criterion is reached.

v = v + 2 ∗ rand() ∗ (xpbest − xpresent ) + 2 ∗ rand() ∗ (xgbest − xpresent ) (1)

Kennedy and Eberhart called the algorithm particle swarm optimization be-
cause it had no longer any features of a flock and the birds where now particles
(points with a velocity). It has moved quite far from the natural counterpart but
still resembles the information exchange between individuals in a swarm. In this
case birds alerting each other to food sources.
Since the introduction of PSO several improvements have been made to the
algorithm, like friction of the particles and adjustments for optimizing dynamic
systems. Applications include human tremor analysis, power system load stabi-
lization and product mix optimization [21].

3.3 Comparison to Evolutionary Computation

Swarm intelligence algorithms have strong similarities to evolutionary computa-


tion (EC). Both paradigms use agents which are initialized with random values.
While in EC and PSO the knowledge about the problem is contained in the
current population, in ACO it exists in the form of the virtual pheromone trails.
Also in PSO the population is not replaced by a new one generated by recom-
bination and mutation but by flying through the problem space and constantly
changing the velocity.

4 Other Uses

4.1 Swarm Robotics

Swarm robotics is the study of robotic systems build by a swarm of robots


interacting and cooperating to accomplish a set task. Self-organization and self-
assembly – properties of social insects – are tried to be achieved for swarm robots.
One of the most interesting research projects in the field has been the Swarm-
bots project [22]. Its aim was to construct small robots called s-bots which can
join to form a swarm-bot. A swarm-bot is a loose or rigid formation of s-bots
that can pass rough terrain, overcome obstacles like huge gaps (see Fig. 4) and
transport large objects. Actions a single s-bot could not perform.

Fig. 4. Swarm-bot passing over a large gap. Image taken from [23].

Each s-bot has a gripper for connecting to another s-bot. For interaction
they are equipped with sensors like an omnidirectional camera, torque and fric-
tion sensors and microphones as well as with lightsources and sound emitters.
The neuronal networks for the control of the s-bots were designed by artificial
evolution and can manage tasks like the coordinated motion of the swarm-bot,
self-assembly, cooperative transport and exploration.
Self-assembly for example works as follows: An s-bot requiring help switches
on red lights alerting s-bots in the proximity, which try to connect to it and
switch on red lights in turn when they succeeded.
Navigation to a target is accomplished by cooperated exploration. When a
path is found s-bots will have formed a chain from the start to the target zone
which can be used as orientation for other s-bots.
4.2 Art and Simulations

Apart from algorithms and swarm robotics the knowledge about the underly-
ing rules of swarm behavior is used to write computer simulations of swarms.
Applications are simulations of realistic animal swarms or even human crowd
behavior. An example is the evaluation of the impact of hydraulic structures on
fish populations [24] where fish swarming behavior has to be taken into account.
In computer graphics swarm simulations have also become widely used. For
the Lord of the Rings trilogy [25] Massive [26] has been developed, a software
which animated thousands of agents for the giant battle scenes. Each agent
has an artificial intelligence brain that can select from a collection of possible
movements depending on external stimuli. Massive has since then been used for a
lot of projects including motion pictures and commercials [27]. Apart from these
realistic simulations, art projects like SwarmArt [28] use swarm simulations just
because of their beauty.

5 Conclusion and Outlook

The complexity of an ant colony or the beautiful sight of a large swarm of birds
surprise with the simplicity of the underlying rules.
With ant colony optimization and particle swarm optimization two algo-
rithms have been created which can solve difficult computational problems ef-
ficiently, while still beeing easy to understand. As there is a wide variety of
swarm behaviors in nature, there is a great chance we will see more algorithms
and systems modeled after social insects and other social animals.
The challenge in designing such systems will be to define the correct rules for
the interaction of the individuals, as it is not immediately evident which rules
lead to the desired behavior of the swarm.
Swarm intelligence is a very active and exciting research field. As our techni-
cal systems become increasingly complex, swarm intelligence algorithms – which
consist of many simple parts – become more and more useful as a solution to
difficult computational problems.
As the algorithms are parallel in nature, they are well adapted for the use
on parallel hardware. On coming processor generations – which will feature a
growing number of parallel processing units – this may lead to very efficient
implementations of these algorithms.

References

1. Bonabeau, E., Dorigo, M., Theraulaz, G.: Swarm Intelligence: From Natural to
Artificial Systems. Santa Fe Institute Studies in the Sciences of Complexity. Oxford
University Press, New York, NY (1999)
2. Burton, J.L., Franks, N.R.: The foraging ecology of the army ant eciton rapax: An
ergonomic enigma? Ecol. Entomol 10 (1985) 131–141
3. Grassé, P.P.: La reconstruction du nid et les coordinations inter-individuelles
chez bellicositermes natalensis et cubitermes sp. la théorie de la stigmergie: es-
sai dinterprétation du comportement des termites constructeurs. Insectes Sociaux
6 (1959) 41–80
4. Goss, S., Aron, S., Deneubourg, J.L., Pasteels, J.M.: Self-organized shortcuts in
the argentine ant. Naturwissenschaften 76 (1989) 579–581
5. Kenward, R.E.: Hawks and doves: Factors affecting success and selection in
goshawk attacks on woodpigeons. Journal of Animal Ecology 47(2) (1978) 449–460
6. Wilson, E.O.: Sociobiology: The New Synthesis. Belknap Press (1975)
7. Shaw, E.: Schooling in fishes: Critique and review. In: Development and Evolution
of Behavior. W. H. Freeman and Company, San Francisco (1970) 452–480
8. Pitcher, T.J., Partridge, B.L., Wardle, C.S.: A blind fish can school. Science
194(4268) (1976) 963–965. Available from: http://www.sciencemag.org/cgi/
content/abstract/194/4268/963
9. Potts, W.: The chorus line hypothesis of manoeuvre coordination in avian
flocks. Nature 309 (1984) 344–345. Available from: http://dx.doi.org/10.1038/
309344a0
10. Reynolds, C.W.: Flocks, herds and schools: A distributed behavioral model. In:
SIGGRAPH ’87: Proceedings of the 14th annual conference on Computer graph-
ics and interactive techniques, New York, NY, USA, ACM Press (1987) 25–34.
Available from: http://doi.acm.org/10.1145/37401.37406
11. Heppner, F., Grenander, U.: A stochastic nonlinear model for coordinated bird
flocks. In Krasner, S., ed.: Ubiquity of Chaos. AAAS, Washington, DC (1990)
12. Lebar Bajec, I., Zimic, N., Mraz, M.: Simulating flocks on the wing: The fuzzy
approach. Journal of Theoretical Biology 233(2) (2005) 199–220
13. Scheffer, V.B.: Spires of Form: Glimpses of Evolution. Harcourt Brace Jovanovich,
San Diego (1985)
14. Bishop, J.M.: Stochastic searching networks. In: Proc. 1st IEE Conf. on Artificial
Neural Networks, London (1989) 329–331. Available from: http://ieeexplore.
ieee.org/iel3/1151/1872/00051986.pdf?arnumber=51986 [cited 2006-08-14]
15. Kennedy, J., Eberhart, R.C.: Swarm Intelligence. Morgan Kaufmann Publishers
(2001)
16. Engelbrecht, A.P.: Fundamentals of Computational Swarm Intelligence. John
Wiley & Sons (2006)
17. Meyer, K.D., Nasut, S.J., Bishop, M.: Stochastic diffusion search: Partial function
evaluation in swarm intelligence dynamic optimisation. In Abraham, A., Grosan,
C., Ramos, V., eds.: Studies in Computational Intelligence. Volume 31. Springer
Verlag, Germany (2006). Available from: http://www.doc.gold.ac.uk/seminars/
Paper/2006%20Swarm%20Intelligence.pdf [cited 2006-08-15]
18. Dorigo, M., Caro, G.D., Gambardella, L.: Ant algorithms for discrete optimization.
Artificial Life 5(2) (1999) 137–172. Available from: http://citeseer.ist.psu.
edu/dorigo98ant.html [cited 2006-08-10]
19. Dorigo, M.: Optimization, Learning and Natural Algorithms. Dip. elettronica,
Politecnico di Milano, Milano, Italy (1992)
20. Kennedy, J., Eberhart, R.C.: Particle swarm optimization. In: Proceedings of
IEEE International Conference on Neural Networks. Volume 4., Piscataway, NJ,
IEEE Service Center (1995) 1942–1948. Available from: http://www.engr.iupui.
edu/~shi/Coference/psopap4.html [cited 2006-08-09]
21. Eberhart, R.C., Shi, Y.: Particle swarm optimization: Developments, applications
and resources. In: Proceedings of the 2001 Congress on Evolutionary Computation.
Volume 1., Seoul, South Korea (2001) 81–86. Available from: http://ieeexplore.
ieee.org/iel5/7440/20223/00934374.pdf?arnumber=934374 [cited 2006-08-10]
22. Dorigo, M.: SWARM-BOT: An experiment in swarm robotics. (2005) 192–
200. Available from: http://www.swarm-bots.org/dllink.php?id=707&type=
documents [cited 2006-08-13]
23. IRIDIA: (Swarm-bots project). Available from: http://www.swarm-bots.org
24. Goodwin, R.A., Nestler, J.M., Anderson, J.J., Weber, L.J.: Virtual fish to evaluate
bypass structures for endangered species. In: Proceedings of the 5th International
Symposium on Ecohydraulics, Madrid, Spain (2004)
25. Jackson, P.: Lord of the rings. New Line Cinema (2003). Available from: http:
//www.lordoftherings.net/ [cited 2006-08-15]
26. Massive Software: (Massive). Available from: http://www.massivesoftware.com
[cited 2006-08-09]
27. Animal Logic: Big ad (2005). Available from: http://www.animallogic.com/
commercials/cub/ [cited 2006-08-09]
28. Boyd, J.E., Hushlak, G., Jacob, C.J.: SwarmArt: Interactive art from swarm in-
telligence. In: MULTIMEDIA ’04: Proceedings of the 12th annual ACM interna-
tional conference on Multimedia, New York, NY, USA, ACM Press (2004) 628–635.
Available from: http://doi.acm.org/10.1145/1027527.1027674

You might also like