You are currently viewing <span class='p-name'>Decentralized Decision-Making: A Model of How Bees Work Together to Build Hives</span>

Decentralized Decision-Making: A Model of How Bees Work Together to Build Hives

It all started with a tweet.

tweet showing intricate bee hive structure
The image has gone around so much on the internet that I'm not sure who it came from originally.

I saw this image last summer and it became a small obsession for several months. It's beautiful, intricate, and seemingly built to optimize airflow. Clearly there wasn't an architect, because a bee isn't all that good with a slide rule. How, then, do you get to something like this without a plan? Forget about the question of how bees construct hexagons! How do they build palaces?

This blog post is the story of my journey into the mind of the hive.*

*If you would like to skip the boring bit and see the result, the video of the simulation I created is towards the end of the post.


All things considered, I am the furthest thing from a melittologist (real word!). My whole relationship to honey bees is best described as intermediated by a glass jar and a spoon. So I had to do a lot of reading, from beekeeper blogs to scientific journals, before I began to fully digest the two essential facts of the problem I was trying to solve.

The first fact is that bees are only complicated together. Individually, they're just silly buggers getting high on pollen.


But where they truly get complex is in their interactions with each other. They communicate through body position, scent and little dances. They have assigned roles in their societies. And while a lone bee has only a crude decision-making apparatus, together they are capable of a group intelligence far above the sum of its parts. This leads to emergent behaviors, which means behaviors that the group displays which could not have been predicted by even a profound understanding of a single bee's cognition (not that we have even that).

The second fact is that almost nobody seems to have attempted to research the question that I was curious about: how do bees coordinate to build these complex macro structures, and according to what rules? There seems to be a lot of literature on how and why they make hexagons, but not on the bigger picture.

With this in mind, I decided to take a different approach, which is why I am writing this at all. I started an attempt to understand hive behavior on my own. And, since I didn't have access to bees, I did the next best thing: make some.

I have created a computer model of the Minimum Viable Bee, as I see it, in an attempt to get a glimpse into what the simplest possible mind would look like that could give rise to the behaviour we see. My bee doesn't eat, doesn't rest and doesn't die. It lives only to scout out a place to build a hive along with its fellows, invades and builds it. My bee is the world's tiniest Brit.

The logic of hive architecture is unexpected for a newbie(newbee?), but it becomes pretty intuitive in these two videos:

Bees do not so much build homes as storage hangars for honey. They build shelves. They're not amazing at keeping these parallel structures straight, but they seem very meticulous about keeping them at a precise and efficient distance from each other.  When there is enough room, they build first-order ramifications to the shelves, all of them roughly perpendicular and equally distanced. They seem to build to maximize shelf length and minimize shelf number, if the second video is any indication.

For a hive of thousands of teeming insects without a bureaucracy or a language fit for trigonometry, I went out on a limb and supposed that decisions about where and how exactly to build the hive are taken in a decentralized way that manages to lead to a rough consensus. Each bee communicates with those around it and takes decisions based on the features of its immediate vicinity.

Under these assumptions, I went ahead and built my (agent-based modelling) simulation. It is a two-dimensional world ("birds' eye view") that contains a sheltered space fit for building a hive. It also contains the newly arrived swarm.  Hundreds of identical bees, each of which behaves according to the following rules:

Part I: Exploration
1. The bee spawns.
2. It mills around looking for the sheltered area.
3. When it finds the sheltered area, the bee heads inside.
4. Once inside, the bee picks a direction at random and flies along it until it reaches a wall. It remembers the distance it has gone. It then repeats this behavior, exploring the sheltered space. If it finds a direction along which it can fly even longer, it remembers that instead, along with the distance. This is the exploration of the real estate.
5. If a bee encounters another bee, it performs a simple information exchange: each of the two bees signals the longest dimension of the space which it has found and it signals its "conviction"  that that's the longest dimension of the space (i.e. the longer it goes, the more sure it is that it's right). A consensus is reached between the two bees that one dimension is longer than the other and they both remember the longer one.
6. Given that the bees prefer to build longer and fewer shelves, they will overwhelmingly tend to choose to build them along the most spacious dimension. So, once a rough consensus is reached in the hive, through decentralized one-to-one negotiation, about which dimension/direction that is, the bees stop exploring and go into the second phase: building.

Part II: Building
The bee mills around looking for a wax structure to add to, or for a surface that is the furthest away from the entrance upon which to initiate the building of a new wax "shelf".
a. If the bee finds a wax structure, it is able to tell if it is the end of a shelf, or the middle of one.
a.1. If the bee has found the free end of a shelf, it attempts to extend it in the same direction, or roughly the same direction that it was going.
a.2. If the bee has found the middle of a shelf, it attempts to start building a ramification.
In both case a.1. and a.2., it will consider the distance to nearby wax structures before building. If they would be below a certain distance from each other, it does not build.
b. If the bee finds a surface suitable for iniating building a new shelf, it attempts to do so. If it would be too close to another shelf, it does not build.
*There is also an optional function in the model that allows for wax branch "pruning", making it increasingly undesirable that a branch will be continued as it becomes longer.
There are also other parameters that can be tweaked, most interesting of which is the world map.*

Them's the rules. It's not a terribly sophisticated decision model at all, and one bee by itself can't do much with it. But for a group, it's good enough to build something akin to what we see in real life. It is enough to make effective group decisions and execute them without a central authority. It is massively simplified, but it works.

The most interesting detail of the model, to me, has been just how efficiently the decision of how to build the hive is taken in this decentralized way. The number of bees who reach the "correct conclusion" over time is a logistic progression: at first, only a few; then, there is a fast increase as the scuttlebutt spreads; finally, only a few dissenters are left, and most of them are gradually converted; a consensus is reached.

Rather than the answer to bee behavior, this is an answer. It is an exercise of scientific imagination. Science of what could be, instead of exactly what is.

This is not how bees think. But it is not entirely wrong.



Further reading:

Narumi, T., Uemichi, K., Honda, H., & Osaki, K. (2018). Self-organization at the first stage of honeycomb construction: Analysis of an attachment-excavation model. PloS one, 13(10), e0205353.
A neat model of how hexagonal structure may emerge.

Benjamin P. Oldroyd, Stephen C. Pratt, Chapter Four - Comb Architecture of the Eusocial Bees Arises from Simple Rules Used During Cell Building, Editor(s): Russell Jurenka, Advances in Insect Physiology, Academic Press, Volume 49, 2015, Pages 101-121,
A very detailed text on the current ethological understanding of hive building behavior in different bee species.

V. Škarka, J.L. Deneubourg, M.R. Belić, Mathematical model of building behavior of Apis mellifera, Journal of Theoretical Biology, Volume 147, Issue 1, 1990, Pages 1-16,
A different take on modelling hives, based in differential calculus instead of agent-based modelling.

More hive videos:
High speed summary of Life inside the Beehive / Snabbspolning genom livet i bisamhället
Beehive Time Lapse

And, one more book that sounds so great but that I haven't been able to read yet: Thomas Seeley (2010). Honeybee Democracy. Princeton University Press.


I wrote the simulation in Matlab. If you're interested in using the code, give me a holler! 🙂

The Ferridge

Wry writer and profligate pixelsmith

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.