Swarming
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 through successive generations using stochastic optimization to find the best solutions. The solutions it finds are called particles. 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 of kin selection. The algorithm shows how altruism in a swarm 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 Ampyx priscus 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 or a peloton. It has been suggested they line up in this manner to migrate, much as spiny lobsters migrate in single-file queues; it has also been suggested that the formation is the precursor for mating, as with the fly Leptoconops torrens. The findings suggest animal collective behaviour has very early evolutionary origins.
Examples of biological swarming are found in bird flocks, fish schools, insect swarms, bacteria swarms, molds, molecular motors, quadruped herds and people.

Social insects: The behaviour of social insects (insects that live in colonies, 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. Researchers have found that cooperation at the colony level is largely self-organized. 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, a form of biological emergence.

Ants: Individual ants 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 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 chemical. More pheromone is laid for higher quality food sources. Thus, if two equidistant food sources of different qualities are found simultaneously, the pheromone trail to the better one will be stronger. Ants in the nest follow another simple rule, to favor stronger trails, on average. More ants then follow the stronger trail, so more ants arrive at the high quality food source, and a positive feedback cycle ensures, resulting in a collective decision for the best food source. If there are two paths from the ant nest to a food source, then the colony usually selects the shorter path. This is because the ants that first return to the nest from the food source are more likely to be those that took the shorter path. More ants then retrace the shorter path, reinforcing the pheromone trail.
Army ants, unlike most ant species, do not construct permanent nests; an army ant colony moves almost incessantly over the time it exists, remaining in an essentially perpetual state of swarming. Several lineages have independently evolved the same basic behavioural and ecological syndrome, often referred to as "legionary behaviour", and may be an example of convergent evolution.
The successful techniques used by ant colonies have been studied in computer science and robotics to produce distributed and fault-tolerant systems for solving problems. This area of biomimetics has led to studies of ant locomotion, search engines that make use of "foraging trails", fault-tolerant storage and networking algorithms.

Honey bees: In temperate climates, honey bees usually form swarms in late spring. A swarm typically contains about half the workers together with the old queen, while the new queen stays back with the remaining workers in the original hive. When honey bees emerge from a hive to form a swarm, they may gather on a branch of a tree or on a bush only a few meters from the hive. The bees cluster about the queen and send out 20–50 scouts to find suitable new nest locations. The scouts are the most experienced foragers in the cluster. If a scout finds a suitable location, she returns to the cluster and promotes it by dancing a version of the waggle dance. This dance conveys information about the quality, direction, and distance of the new site. The more excited she is about her findings, the more vigorously she dances. If she can convince others they may take off and check the site she found. If they approve they may promote it as well. In this decision-making process, scouts check several sites, often abandoning their own original site to promote the superior site of another scout. Several different sites may be promoted by different scouts at first. After some hours and sometimes days, a preferred location eventually emerges from this decision-making process. When all scouts agree on the final location, the whole cluster takes off and swarms to it. Sometimes, if no decision is reached, the swarm will separate, some bees going in one direction; others, going in another. This usually results in failure, with both groups dying. A new location is typically a kilometre or more from the original hive, though some species, e.g., Apis dorsata, may establish new colonies within as little as 500 meters from the natal nest. This collective decision-making process is remarkably successful in identifying the most suitable new nest site and keeping the swarm intact. A good hive site has to be large enough to accommodate the swarm (about 15 litres in volume), has to be well-protected from the elements, receive an optimal amount of sunshine, be some height above the ground, have a small entrance and be capable of resisting ant infestation - that is why tree cavities are often selected.

Non-social insects: Unlike social insects, swarms of non-social insects that have been studied primarily seem to function in contexts such as mating, feeding, predator avoidance, and migration.

Moths: Moths may exhibit synchronized mating, during which pheromones released by females initiate searching and swarming behavior in males. Males sense pheromones with sensitive antennae and may track females as far as several kilometers away. Swarm mating involves female choice and male competition. Only one male in the swarm—typically the first—will successfully copulate. Females maximize fitness benefits and minimize cost by governing the onset and magnitude of pheromone deployed. Too little pheromone will not attract a mate, too much allows less fit males to sense the signal. After copulation, females lay the eggs on a host plant. Quality of host plant may be a factor influencing the location of swarming and egg-laying. In one case, researchers observed pink-striped oakworm moths (Anisota virginiensis) swarming at a carrion site, where decomposition likely increased soil nutrient levels and host plant quality.

Flies: Midges, such as Tokunagayusurika akamusi, form swarms, dancing in the air. Swarming serves multiple purposes, including the facilitation of mating by attracting females to approach the swarm, a phenomenon known as lek mating. Such cloud-like swarms often form in early evening when the sun is getting low, at the tip of a bush, on a hilltop, over a pool of water, or even sometimes above a person. The forming of such swarms is not out of instinct, but an adaptive behavior – a "consensus" – between the individuals within the swarms. It is also suggested that swarming is a ritual, because there is rarely any male midge by itself and not in a swarm. This could have formed due to the benefit of lowering inbreeding by having males of various genes gathering in one spot. The genus Culicoides, also known as biting midges, have displayed swarming behavior which are believed to cause confusion in predators.

Cockroaches: Cockroaches leave chemical trails in their feces as well as emitting airborne pheromones for mating. Other cockroaches will follow these trails to discover sources of food and water, and also discover where other cockroaches are hiding.