Scientists have discovered how the wiring of bees' brains helps them plot the most direct route back to their hive.
Researchers have shed light on the complex navigation system that insects use to make their way home in a straight line following long, complex journeys.
They have revealed how a network of neurons integrates every detail of changes in direction and distance covered on outbound journeys, and enables bees to return directly home.
Bees use their vision to navigate, but until now little was known about what happens inside their brains - which are smaller than a grain of rice - as they perform this task.
The discovery of neurons that detect speed and direction - and a precise description of how these are wired together - has helped scientists show for the first time how a bee's brain functions to guide it home.
The neurons are located in a part of the insect brain called the central complex. Scientists found this region plays a pivotal role in controlling the navigation system - known as path integration or 'dead reckoning' - which is used by many animals, including bees, ants and humans.
These cells are used to add up all elements of the outbound journey, creating a memory that bees use to fly home by the most direct route, researchers say.
A team of scientists, including researchers at the University of Edinburgh, unravelled the complex workings of the system by studying the brains of nocturnal rainforest bees.
They monitored nerve function by attaching tiny electrodes to bees' heads as the insects were shown virtual reality simulations of what they see when flying forward or rotating.
Their results, together with microscope studies of how the nerve cells are connected, were used to develop a detailed computer model of the bee's brain. The model was tested on a simulated bee and on a robot.
The findings could lead to the development of new algorithms for navigation in autonomous robots that do not require GPS or expensive computer systems.
The study, published in the journal Current Biology, was carried out in collaboration with the University of Lund, Sweden. It was funded by Swedish, UK and European research councils.
Professor Barbara Webb, of the University of Edinburgh's School of Informatics, who was involved in the study, said: "The most exciting part of this research was when computer modelling of the 'spaghetti' of connections between nerve cells revealed the elegant principle by which bees keep track of their position and steer back home. Understanding such a complex behaviour at the level of single neurons is an important step forward for the science of brain function."