• The Brief
  • Let's Complicate Things

What do salmon, bees, parrots and sheep have in common? They all flock.

Flocking is when all the animals in the group move in the same direction. It might look fancy, but each animal is following a few simple rules. A fish will try to swim in the same direction as its mates without crashing into them.

Play the role of a predator and see how the school of fish responds to you.

Delve Deeper

Shoaling behaviour is an example of self-organisation arising from local interactions between parts of an initially disordered system.

For example, a seemingly complex behaviour such as fish schooling can occur when each individual fish follows three simple rules:

  1. Swim close to your neighbours, but
  2. Avoid crowding them, and
  3. Swim in the same direction they are.

See how self-organisation relates here.

While the term flocking is used to describe collective animal behaviour in general, other terms are used when referring to specific organisms:

  • Swarming for insects;
  • Flocking or murmuration for birds;
  • Herding for tetrapods;
  • Shoaling (sticking together socially) or schooling (swimming in the same direction) for fish.


Flocking behaviour was simulated on a computer in 1987 by Craig Reynolds with his simulation program, Boids. His program simulates simple agents (boids) that are allowed to move according to a set of basic rules.

The three basic rules that govern the complex behaviour of flocking animals are:

  1. Separation: steer to avoid crowding your neighbours;

  1. Alignment: steer towards the average heading of local neighbours;

  1. Cohesion: steer to move toward the average position of neighbours.

There are many benefits to shoaling behaviour:

  • Defence against predators through better predator detection and by diluting the chance of individual capture;
  • Enhanced foraging success by the school assuming a parabolic shape, suggestive of cooperative hunting. A shoal of fish means many eyes are searching for food and fish monitor each other’s behaviour closely such that feeding behaviour in one fish quickly stimulates food-searching behaviour in others;
  • Higher success in finding a mate since shoals provide increased access to potential mates, i.e., finding a mate in a shoal does not take much energy;
  • Potential increase in hydrodynamic efficiency in the same way that bicyclists may draft one another in a peloton.

Discover more