Tuesday 22 November 2022

Can Queuing Theory Explain the NHS Crisis?

The NHS is always in crisis. But I think with A&E waiting times pushing 12 hours, this certainly feels like crisis territory to me.

So what is happening? Well it seems to be to do with a lack of hospital beds - you can't admit someone if there isn't a free bed spare.

I had a look at the data and it turns out that bed occupancy has increased over the last 10 years, but only from 85% to 87.5%. I was a bit puzzled by this until someone mentioned these figures only capture availability of beds at midnight - occupancy rates can frequently hit 100% within a 24-hour period.

Still, I could quite seem to get my head round why we were seeing such long waiting times. That is until, I read about queuing theory.

Queuing theory is just as it sounds, it is the study of queues. This sounds extremely boring until you read some of the results...



This seems totally implausible! How can adding just one more teller reduce the waiting times to this extent?

We have all had to wait in a queue that seems to take forever. Inevitably, just as your edging closer to the counter, the person in front of you tries to return an item. To make matters worse, the employee can't find the right code and then has to call over their manager. You stand their tutting, clutching your muesli. 

With queues, there are number of things that can increase waiting time. The first, is the amount of people that arrive in a queue. Although usually there is a nice steady flow, people arriving every few minutes or so. Sometimes lots of people arrive at the same time due to random reasons (this resembles a Poisson distribution). Yes, the average may be 1 person every minute, but it is not improbably that 10 people arrive at once.

Another thing that can affect waiting time is the person queuing. Sometimes you only have one item and others you have a whole weekly shop.

Then you have the point of service. For example, adding more servers will decrease the amount of waiting time.

But why does adding another server reduce queue time dramatically in the above tweet? Well, one reason could be that if someone is taking ages to be served, adding another person at the counter allows one line to flow more quickly. As a result, people will self-select into the fast-flowing line and fix the backlog.

If, however, you don't fix the problem quickly, it is likely that queue continues to grow which creates a huge backlog and makes things more complicated. In a way, it is very similar to the game Tetris.


Tetris is very easy when you are in control. You just rotate the shapes around, complete your lines and keep things ticking over nicely. The problem comes when you make a mistake, or a difficult shape comes out, or things get a bit faster. Suddenly, you find things getting out of control fast. You are forced to make suboptimal decisions and before you know it, it's game over.

This is exactly what happens with queues. Once you let the queue get out of hand, it is difficult to put it right again. Sure, adding extra servers can help, but they are more helpful at the start when you can put things right again quickly as you can get back to normal service faster. But if you leave it too late, the queue is extremely large, then sorting out the mess is much, much harder. 

This can be the hard round. I think the reason for this is that most people think relationships are linear. It seems logical that if one bookshelf can store 50 books, then adding another one will store another 50 books. But just because a lot of relationships in life are linear, doesn't mean they all are. Linear thinking is probably why understanding how the coronavirus can suddenly get out of control was so difficult for many people.

We can actually see this non-linear relationship occurring in healthcare. Notice, how rejection rates (which you can think of as a proxy for queuing) increase exponentially when ICU wards get closer to full capacity. You should read the full paper (which is easy to read) to understand exactly why this happens as it is really interesting.



This does raise the question as to why we didn't build a vast number of spare beds? I think it boils down to my bete noire, the anti-waste mindset. Having hundreds of unused beds does not seem like efficient use taxpayer money, especially when they will be rarely used. 

The irony is we are going to have to spend a lot more money than we would have done if we never let the problem get out of hand in the first place.





The UK smoking ban: can paternalism be justified?

Every day I tell my toddler off for doing something he shouldn't. He has no idea why playing with plug sockets are bad but light switche...