Collective animal behaviour

Collective animal behaviour describes and analyzes the behaviour of groups of animals. In these groups, the animals are often all of the same species. As an example, a school of fish will be made of mostly the same type of fish and a flock of birds will have the same type of bird. A herd is a large group of hoofed, herbivorous mammals.
Animals tend to behave in such a way because this behaviour offers them a benefit. The group of animals also behaves differently from a single animal. Collective animal behaviour is about finding the rules each animal follows; how it communicates with other members of the group and how a decision to do something is reached in the group.
Scope of the term.
Full-time colonial animals fall into this category in principle, but in practice the species of interest here are those who form temporary groups. Colonial animals have been researched for many years, and are usually based on some kind of family relationship. Temporary collective behavior is a well-known phenomenon, but little researched until now.
Different functions.
Different functions have been proposed, as follows:
1. "Protection from predators".
2. "Better foraging": A school of fish or a group of animals is better at foraging. 
3. "Easier movement": Groups of animals moving together (such as fish or birds) save energy. Many of the larger birds fly in flocks. Flying in flocks helps in reducing the energy needed. Many large birds fly in a V-formation, which helps individuals save 12–20 % of the energy they would need to fly alone. Red Knots "Calidris canutus" and Dunlins "Calidris alpina" were found in radar studies to fly 5 km per hour faster in flocks than when they were flying alone.
4. "Social interaction": This can be seen with fish, such as herring. If an animal is separated from the group, it will feel stressed.
5. Special factors come into play with migrating birds, or birds which gather in huge flocks, such as starlings. Bird behavior has a larger component of learning than fish. In addition to factors listed above is the possibility that migrating bird flocks are good at teaching first-year birds how to do the migration successfully. The specific routes may be genetically programmed or learned to varying degrees. The routes taken on forward and return migration are often different.
Swarms.
The usual term for insects which are not always in a fixed colony, but move in large numbers is swarm. There are many good examples: army ants for instance. The best researched is the locust.
Locust swarming.
Locusts are the swarming phase of short-horned grasshoppers of the family Acrididae. These are species that can breed rapidly under suitable conditions. Then they come together in large groups and become migratory. They form bands as nymphs and swarms as adults—both of which can travel great distances, rapidly stripping fields and greatly damaging crops.
There is no taxonomic difference between locust and grasshopper species, and in English the term "locust" is used for grasshopper species that change morphologically and behaviourally on crowding, to form swarms or hopper bands. These changes, or phase polymorphism, were first thought of as separate species. 
Research at Oxford University showed that swarming is a response to overcrowding. Increased tactile stimulation of the hind legs causes an increase in levels of serotonin. This causes the locust to change colour, eat much more, and breed much more easily. The transformation of the locust to the swarming variety is induced by several contacts per minute over a four-hour period. It is estimated that the largest swarms have covered hundreds of square miles and consisted of many billions of locusts. Plagues of locusts appear in both the Bible and the Koran, including one of the Biblical Plagues of Egypt, where locusts ate all the crops of Egypt.
Modelling large groups.
Often, animals in a herd are thought to follow simple rules, such as
Recent studies have shown that an animal only picks five to seven other animals, and aligns with them. This seems to be independent of the distance. Another approach is when all animals within a certain distance are noted for alignment.
Small social groups.
Primates are a good example of animals which almost always live in small groups. The groups are based on a family, a group of families, or females 'owned' by a dominant male, together with offspring.