How to achieve maximum office happiness: Turning the allocation of office seats into an integer programming problem
The allocation of office seats can be tackled with either elbows, consideration and compromise – or the skills of a Data Scientist. Naturally, at idalab, we treated finding the perfect seating order as a mathematical optimisation problem. We are quite proud of the result. May we present to you what we’re fondly calling: The Optimum Happiness Distribution Project.
My home is my castle – my chair is my throne
Roughly three months ago, we moved to a brand new, spacious and what is by now a very elegant office at Potsdamer Straße 68. When we first moved in, carefully working our way through piles of rubbish and cardboxes (the whole place was still a construction site) we soon realised: Wherever we sat down NOW, we would probably sit for THE REST OF OUR WORKING LIVES. Because that’s what people do. They’re creatures of habit. If you’ve found a desk where you have in some sense „arrived“ and feel „at home“, giving this territory up again requires strong motivation or pressure to overcome the social embarrassment. We didn’t want ourselves to start bribing or bullying each other. So we sat down as a team and thought rationally about how the problem could be solved. Here’s what we came up with.
It’s about the right priorities
An office seat can be evaluated by various parameters: Proximity to the door, proximity to the window, proximity to the printer, proximity to the snacks, proximity to whatever. Or a satisfying degree of remoteness. Long distances, short distances, a chatty place, a calmer place. Everybody has their own thoughts about what the best office seats are and this is in a way a good thing, we thought. If everybody has different priorities, there might be a way to make everybody happy. Ergo, we first needed to know what everybody’s priorities were. So we gave every seat a number and had every member of the team fill out a Google Sheet, where they could rank the seats according to their preferences.
Integer programming problems can be tricky, so we imposed two requirements on the priorities that people could give to the seats:
1. You need to fill out at least 3 fields
2. Your priorities smallest-largest ratio cannot drop below 1/5
As you can see Paul and Jonathan were guaranteed a seat at the first table by the door because they need to take phone calls more often than the rest of us and need to leave the no-talking-area quite frequently.
Getting everybody to name their priorities was actually the hardest part, because it required everyone to really think about what they wanted and how strongly they felt about it. Numerous reminders in our #general channel on Slack were needed to make everybody decide on what their favorite seats finally were. But after a few days (and after some bribes & some pressure) the data was there.
Finding everyone their throne… seat! Seat.
The task of seat allocation can be modeled as an integer programming problem. There are many available solvers for these, we opted to use GLPK, a cross-platform GNU library. If you would like to adopt our approach to this challenge, check out the code on github.
We picked the next team meeting to be the moment of truth in conducting the first mathematically optimised allocation of office seats. Because we felt we needed dramatic music for this, we listened to Also sprach Zarathustra together while we started the process.
After a little bit of engineering in R it took GLPK mere seconds to calculate the best possible seating order, a task that might have taken us months of haggling and silently coveting our coworker’s seats. And when the solver gave out its solution, there were screams of joy and surprise in the room. Actually, everybody but three team members had gotten their first choice as their newly assigned seat! The three who didn’t got their second choice, which we thought was a pretty good result. Nevertheless, right after everybody realized that they had been seated according to their first or second choice, some people started asking each other if they wanted to swap. We don’t know why that was. Maybe our preferences should have been stronger informed by actual data? Or people were too confident in the narrow selection of preferences they had assigned?
How happy are we?
In any case we felt the result was pretty good, and as a data science company we wanted to have an idea of how much better it was than randomly assigning seats across the company. So we cast lots and then used that outcome to plot it against the output of the solver:
The plot shows the happiness (=fraction of weight given by the employee to the assigned seat) for both, random seat assignment (red) and optimised seat assignment (blue).
Hannah is all red because she is as happy after the optimised assignment as she was after the random one, nicely reflecting the nearly uniform spread of seating preference she entered above. Jonathan is all blue, because he was not happy at all after the random assignment. Same goes for Kirstin, Lea, Paul, Simon and Stephan. Most of them chose a high preference for very few seats, making it nearly impossible for them to be happy with a random assignment. But also people whose happiness did not increase drastically, like Hagen’s, are better off overall. So the final question is: How much happier are we? Well, it turns out that the average happiness per employee is about five times as high with this approach as it is with random assignment. Pretty good, don’t you think?
By the way: We decided to keep the assigned seats for only a couple of months, and review when we had some time settling in. Incidentally, that appointment took place last week. It turned out that everybody is still happy and a re-allocation is not needed. We don’t know though, if this is because everybody is actually happy, or it’s because, as we established earlier, seating habits are just very hard to overcome…