Stalling the pipeline in the checkout queue

grinder on 2002-08-25T22:07:37

I was in the supermarket the other day after work. I had a number of essentials in my basket and I was itching to get home.

Big problem: which queue to choose? Having learnt about Queuing Theory at school, and knowing that single queue-multiple consumer is as efficient as it gets, it's always an agonizing decision. You have to balance a number of factors: how many people in the queue, how many items do people want to buy, do they look impatient or vagued out. It's better to be behind a person buying 10 of one thing, than one item of ten different things. And, although it pains me to admit it, old people are Bad News. Statistically, you'll waste 30 seconds to five minutes with them in front of you.

So I was pondering this the other day, and reflecting on my worldview, how I tend to algorithmatise things (figuring out the shortest path between the four shops I need to go to, establishing contigency plans in case a shop doesn't have a product I need, that sort of stuff. When house-cleaning I try to keep my hands full. I hate going into room A to fetch something for room B, and realising there was something in room B which should be tidied away in room A). Geeking out, basically.

And as I stood there ruminating on this, I was idly watching the woman at the front of the line, and became more and more alarmed. She was just stacking up the products that the cashier swiped...but not putting them into bags. I couldn't figure out what she was doing, but figured it was bad news for me. And on and on it went, until the cashier had checked out every last item. Then she handed over her credit card, had it swiped, punched in her pin, and only once she had received her docket did she begin to bag up the stuff she'd bought. And I thought "You f5cking moron: can't you deal with asynchronous events?" Because the cashier couldn't start checking out the items of the next person until she'd cleared the decks. Which took a non-trivial amount of time, during which no other work could be done.

Meantime I note that the people who were at the ends of the other queues are now close to being served, and I've still got two people in front of me. But I'm in too deep at this point to bear the cost of cutting my losses and requeuing on another line.

The next person went through without a hitch: a few items, had cash ready, out straight away.

Then the person in front of me went through. Seemed to be okay: started bagging up the goods as soon as they came through, but she had a fair number of things to buy. Then it turns out that she has a Method. All the fruit goes together, the stuff that requires Refrigeration goes together, tins kept apart from packets and so on. And the cashier is done quickly and announces the price. But does she do anything? Noooooooooo! She just keeps putting stuff in bags. And the cashier, who is polite (the Customer is always Right and all that) says nothing.

At this point I just take a deep breath and resign myself. The people who were at the ends of the other queues are all long since gone. At times like this I can't help thinking that a lot of what we learn in Computer Science is applicable to the Real World. And one of the cardinal sins is stalling the pipeline. When you have people queued up to do something, you want to get in and get out as fast as possible, just like an instruction on a CPU. Because wait states are just time lost. Gone, never to come back.

I really, really hate when that happens.


Check(out)mated

chaoticset on 2002-08-26T02:25:37

The thing that truly irritates me is the way that most people think that life's better if you just kind of doddle along, letting things happen to you, and how dare you try to get on with your life at the expense of moving around them.

I can't live like that, and I can't really understand how people even try. Every once in a while someone will say, "Stop doing things, just relax." I have a tendency to come back with the Erdos answer "There will be time to rest in the grave."

I don't know. Maybe some people don't value their time or their life. I'm not one of them, I know that.

How to Pick the Right Queue

Mr. Muskrat on 2003-09-25T20:53:18

Let me start by saying that it is never easy!

View each queue and make mental notes as to the following:

  1. How many people are in each queue?
  2. What are their ages?
    • Older people are slower*. As the body (and mind) get older, people slow down.
  3. What are their sexes?
    • Women are slower*. Why? Most women are more cost conscience and therefore watching the price as each item is rung up (and correcting the cashier when there are mistakes).
  4. Are they married or single?
    • Check for a ring**. Married people are slower*. Why? Wives make sure that their husbands are more cost conscience. (See #3.)
  5. How many items does each person have?
    • More items does not necessarily mean slower.
  6. What types of items does each person have?
    • Big items are heavier and therefore take longer to scan.
    • Can goods are the fastest items for someone to have*.
    • A guy with feminine hygiene items should be considered married for queue choosing purposes.

There are many more rules that I use but I have doing this for quite a while now. (Having worked in a grocery store helped considerably.) You will develop your own set of rules as time goes on. It takes years and years of practice. Even then, it is not an exact science. You will still get stuck in slow queue from time to time.

* Generally speaking.

** I know that it is not a perfect solution but the items that they have will help as well.

Re:How to Pick the Right Queue

runrig on 2007-09-29T15:21:14

Check for a ring**. Married people are slower*. Why? Wives make sure that their husbands are more cost conscience. (See #3.)
I'm usually cost conscience before getting to the checkout. After which I can't remember what the price of something is. If I think it should've been cheaper (and I think it's worthwhile), I'll go check the price myself after checkout, and if I'm right, I'll bring it to customer service where you get a FULL REFUND for the item(s) (that's the policy :-). My favorite was when several pounds of meat were on sale but rang up a full price, and I wasn't sure at first if I bought the right cut. Hmm, maybe you are right though...I think on that one I did say during checkout, "Hey, if that's not on sale, I think I'll put it back".

SIMD

ChrisDolan on 2007-09-29T01:38:12

That was a very amusing and interesting read. Your mind works a lot like mine, apparently. My solution is SIMD -- amortize the time spent in line by buying more food at once. I go grocery shopping as infrequently as I can bear and fill my cart as much as it can bear, or sometime two carts if the whole family comes along.

Time of day matters too. At night, the ratio of customers to cashiers is much higher. Although the total number of customers is smaller so the shopping is easier, the longer time spent in line dominates and makes the experience less pleasant.