Fish in schools manage to go with the flow and not crash into each other by following simple rules.
Fish swimming in schools follow simple rules to respond to their neighbors.
Fish only respond to a single nearest neighbor at any time.
Understanding how the fish navigate within a school could help develop traffic systems.
Shoals of fish are able to move and turn in seamless formation by following simple rules that are like those used by car drivers, say researchers.
The research, which builds on earlier work showing that fish in large groups make better decisions than individuals or small groups, is reported in this week's Proceedings of the National Academy of Sciences.
"Some of the most incredible sights in nature happen when animals form into groups and move together as if choreographed," said lead author, James Herbert-Read, a PhD student in the School of Biological Sciences at the University of Sydney.
Many theories have been put forward about how animals might communicate in order to achieve this.
"But now we're finding that it's really, really simple," said Herbert-Read.
The researchers filmed groups of two, four or eight mosquitofish, Gambusia Holbrooki, in a square arena for five minutes, and studied the movements of individuals in each group.
The images of the swimming fish were fed into tracking software, which acts like many pairs of eyes to keep tabs on the direction and speed of each fish in the school and how it responds to other fish around it.
The researchers used a technique called artificial neural networks to look for patterns in the data.
"It turns out the amazing synchronized swimming that fish in shoals exhibit is actually caused by each fish using very simple rules to respond to its neighbors," said Herbert-Read.
"These rules include: 'accelerate towards a neighbor that is far away from you' and 'decelerate when a neighbor is right in front of you'.
"We also found that a fish only responds to a single nearest neighbor at any one time," said Herbert-Read.
"When we're driving, we use similar sorts of rules: we decelerate when someone's in front of us, and accelerate if there's someone about to bump into you from behind."
Herbert-Read says that because schools of fish rarely suffer from crashes or congestion, the rules they use could also potentially be applied to robotic systems to solve traffic problems.
"If you could engineer a system where each car 'knew' where each car was and they could respond to each other and communicate with each other, you would avoid traffic problems," he said.
"And we're starting to see that now, with sensors fitted in the newer cars coming out."
Herbert-Read says the next stage of the research would be to find out how long ago in fish evolution these rules evolved.