Collective intelligence is one of the most striking phenomena in nature. Simple animals that individually exhibit only a handful of simple behaviors are capable of impressive collective behaviors. Bees, for instance, can build complex colonies with very efficient labor distribution among its members, while schools of fish can perform impressive maneuvers when trying to escape predators. Those collective behaviors allow simpler animals, such as ants, to achieve formidable results in extraordinarily complex and unstructured optimization problems. Researchers have been studying those collective behaviors, and some results have been used to conceive evolutionary algorithms that are intended to mimic those behaviors to at least some extent.

This chapter introduces the reader to swarm intelligence algorithms, providing the background needed for their implementation and application to practical optimization problems. The presentation is complemented with examples and Python code.