Ants have excellent path-finding and -maintaining abilities. They are able to quickly find the shortest path from their nest to their current food supply, and in the process they leave behind a pheromone trail for their comrades to follow. When that trail is interrupted by an obstacle, the chain of ants following it splits in two: some ants will head in one direction around the obstacle, and some will head in the opposite direction. The ants that choose the shorter route around the obstacle bump into the old pheromone trail more quickly than those that choose the longer route, and thus they naturally find the best path. (See this site for clear diagrams illustrating this method.)
The rules that guide the movements of boids allows individuals to separate from the main group when necessary (predator or obstacle presence, for instance), and then to reintegrate themselves into the group as soon as possible. For instance, if a flock of boids approaching an obstacle breaks in two, as soon as the obstacle is past, each new group rapidly realigns itself and alters its velocity as needed to match the movement of the other group. The above illustration shows a flock of boids approaching an obstacle, splitting in half to move around it (in red), and then regrouping on the far side.
An individual that separates from the main flock performs in the same way: it will adjust its speed and direction to match the speed and direction of the flock, and eventually it will rejoin the group. The illustration to the right shows a flock of boids approaching something that they clearly do not like (a predator, perhaps). All of the boids turn away from the obstacle, although two do so separately from the rest (in red). After a brief sojourn alone, they quickly fall back in with the flock's new movement.
last updated: May 5, 2000 (chris boone, sam hillier)