Flocking is the behaviour exhibited when a group of birds, called a flock, are foraging or in flight.

Two flocks of common cranes
A swarm-like flock of starlings

Computer simulations and mathematical models that have been developed to emulate the flocking behaviours of birds can also generally be applied to the "flocking" behaviour of other species. As a result, the term "flocking" is sometimes applied, in computer science, to species other than birds.

This article is about the modelling of flocking behaviour. From the perspective of the mathematical modeller, "flocking" is the collective motion by a group of self-propelled entities and is a collective animal behaviour exhibited by many living beings such as birds, fish, bacteria, and insects.[1] It is considered an emergent behaviour arising from simple rules that are followed by individuals and does not involve any central coordination.