Hacker News new | past | comments | ask | show | jobs | submit login
Groceries: which lane is the fastest? (mrmeyer.com)
64 points by bootload on Nov 4, 2010 | hide | past | favorite | 67 comments



Fastest doesn't always matter in a grocery check-out lane. Look for the cashier who appears to be a Mom. She's the one who won't crush the bread or put the big jar of spaghetti sauce on top of the egg carton at the last minute.

Besides, the better item to optimize when grocery shopping is the actual shopping experience. While you may spend five minutes in a check-out line, you may spend an hour or more shopping. Nicking a minute out of the check-out experience is irrelevant if you just wasted five minutes zig-zagging through the store for multiple items (traveling salesman problem) or if you made a couple calls back home to find out if you were out of ____ or needed ____, a time issue that is magnified if you forgot something and need to return to the store before your normal (optimized) shopping trip.


I wouldn't optimize for the mom. Instead I'd look for anybody who didn't look like a fresh-faced teenager. Since I enjoy living near a grocery store that has reasonable prices, I also tend to recognize the workers. The ones who seem the most senior usually can work the till faster.

You're right about it not really being worth it for optimizing your waiting time. If there is only one checkout and it's some lady with 50 items and she's struggling with a checkbook, other cashiers will usually open up if you make eye contact with a free employee.

You'd save the most time by planning your shopping in advance. Make a list, and categorize it by food type. If you know your store layout, some time spent thinking about the order of you visit can pay off quite well. Plus, it helps reign in impulse purchases.


From my observations, the fastest cash transaction will outpace the fastest credit transaction by a wide margin

Nearly every modern point of sale self-swipe card terminal will allow you to swipe, insert pin, and sign electronically before the cashier can finish scanning your items. The only step left once that has completed is to approve the transaction total with the push of a button. I wish more people were aware of this, and then card transactions would be faster.


I'm not sure I've ever seen one that lets you sign before the cashier is done scanning. Wouldn't that defeat the whole premise of signing "I agree to pay the amount above in full"?

You can do everything up to that point - 'what type of card is this', etc... And many places are going signature-free below a certain transaction size, so I suppose all interactions can be handled in those cases before the 'total' key is hit.


In my experience, you can get as far as needing to hit "I agree to pay" and scribbling on the touch screen.

Entering in/scanning your customer loyalty number and pulling out your credit card and scanning it (and pressing credit/debit) is what I've been able to "preload".

One other neat thing I've noticed is that at my Costco gas station, I can pull the pump out and select my gas type while simultaneously scanning my costco + credit card. I usually try to time myself with the person in front of/behind me to see if I can start my pump faster than them. I usually win :)


All the POS card readers that I've seen (UK maybe it's different in US?) don't display insert card until the cashier has finished scanning the items and pressed total. On the occasions that I have tried putting the card in before the machine asks for it, the transaction usually ends up having to be redone.


I never pay debit, even though it'd be faster, because all bank card reward programs I'm part of only apply to credit transactions. I value the discount the rebates equate to over the time saving of not having to sign for each purchase.


I think people are aware of this but many (e.g. my mom) like to watch all transactions and are wary of swiping anything before they're sure the amount is correct. They assume that swiping is a commitment to pay.


I've found that paying attention to the type people in the line matters as much as the number of items and the payment type.

It sounds silly but I learned this from Apu on the Simpsons:

“Season 5: “Homer and Apu” Original airdate in N.A.: 10-Feb-94

Apu and Marge wait at the back of the long line in the express lane.

Apu: Mrs. Simpson, the express line is the fastest line not always.

That old man up front, he is starved for attention. He will talk the cashier’s head off.

Abe: {Ah, there’s an interesting story behind this nickel. In 1957, I remember it was, I got up in the morning and made myself a piece of toast. I set the toaster to three—medium brown.}—Then he tied an onion to his belt

Apu: Let’s go to…that line.

Marge: But that’s the longest.

Apu: Yes, but look: all pathetic single men. Only cash, no chitchat.

Marge smiles approvingly as the line moves much faster.”


It's also important to size up the cashier.


I've largely given up trying to optimize my shopping time, but I do find the subject interesting. I'd be interested in seeing the effect of the (to me intuitively superior) one line, many cashiers setup, like at Fry's. I realize supermarkets make a boatload of cash from the geegaws sold in line that you hounded your parents into buying you as a kid, but I can't help but think that the many lines/many cashiers setup is less an optimal setup and more an artifact of some Lionel Hutz type who sold the cabal of Evil Grocery Barons a bag of magic beans in the 1960's.

As usual, I am too lazy to go look it up for myself. Back to hacking.


One queue minimizes the average wait time - it's the fairest and fastest system. Any CS person should know this, it's pretty basic.

Say we have 100 people and 10 servers. Everyone takes 1 minute to process, except one guy who needs 10 minutes.

With 10 queues and the long taking guy ahead of 9 other people he's blocking all those for 10 minutes. Total processing time 19 minutes. With 1 queue and the long taking guy first (blocking 1 counter for 10 minutes) total processing time is 11 Minutes.

Another way to look at it is that with one queue, everyone gets the minimum possible wait time. In the many queues case you get that only occasionally. You could optimize the many queues so they're just as efficient as the one single queue but you'd have to know everyone's processing time in advance - impossible in a real world setting.


One queue adds an overhead for the time it takes for the person at the front of the queue to notice a cashier is free and walk to that cashier. I have watched this system in action at the Post Office, Rail stations, and one supermarket and this overhead can be significant. One supermarket actually employs somebody at the head of the queue just to tell them which cashier to go to and when.

jfb - It also doesn't have any negative effect on "the geegaws sold in line" as they just put the "geegaw" displays along the side of the one queue. In fact it is better for the store in that respect as they can show more variety.

The best way I can think of to get rid of this overhead is to have a rule where each cashier has a queue depth 2 that is fed from a single queue. But how would you get people to stick to just 2 people? And it would be very annoying to be just behind a slow person.

In theory people should naturaly start moving forward when they notice that somebody is finishing up but at least in the Rail station and Post office the counter staff have a tendency to shut their counter without warning or start processing some other task before they are ready to serve the next person.


One queue adds an overhead for the time it takes for the person at the front of the queue to notice a cashier is free and walk to that cashier. I have watched this system in action at the Post Office, Rail stations, and one supermarket and this overhead can be significant. One supermarket actually employs somebody at the head of the queue just to tell them which cashier to go to and when.

Whole Foods in NYC has solved this problem by having one queue, but when you get towards the front, there are five separate, color-coded lines. At the front of the queue is a giant television that shows a bar of color for each lane. When a register opens up, the number for that register slides into the color bar for the next person in the sequence, and a voice announces "Register 12". It's fairly efficient at keeping the queue moving as well as managing people's psychological need for multiple lines. It also prevents cashiers from wasting time, because as soon as a transaction is finished, their register is automatically assigned to the next person in the queue. The only "wasted" time is the time walking from queue to register, and pleasantries.


I've seen the two level queue in use at some airports for security and immigration. But they do have a person splitting the head of the long queue into the short queues immediately in front of each x-ray machine/agent.

It works pretty well, but can still be a little frustrating when you see a person who was behind you in the main queue get through first because your sub-queue took longer.

People usually won't act to optimize for the best throughput, just minimize their relative wait times. The behaviour of drivers on congested roads tends to confirm this.


It's always the fastest, but whether or not it's the fairest depends on how you define "fair." The simplest example I can use to illustrate this is the case where there is 1 server, and 2 people. One person will take 60 minutes to process, and the other, 1 minute. The 60 minute person gets in line a millisecond before the 1 minute person. Is it fair for the person who will take 1 minute to wait for the slow 60 minute guy?

If you define fairness as the average user-wait, I think fastest first is actually optimal. This is still the case with one-queue systems: If you let the 10-minute person go first, you'll have blocked 1/10th of throughput for everyone behind him, and thus increase their wait time. Fastest job first is generally not a bad way to handle queues; it works great for things where "jobs completed per unit of time" is of importance, like chores or fixing bugs (of equal or similar priority).

Besides average user-wait, you could start inventing your own units for fairness depending on the problem. Maybe its average user-wait per processing minute, or something like that, in which case the solution might be more complicated (or might not be, I'm not too concerned with it).


The fairest and most useful thing to do then seems to be to train everyone at the checkout counter to be fast. Pass a minimum serving speed threshold before you can serve the main counters.


One queue is fairest. From your example if there is only one server then there is no difference between one queue/one queue per server.


You could optimize the many queues so they're just as efficient as the one single queue but you'd have to know everyone's processing time in advance - impossible in a real world setting.

Not quite impossible. You might not know individually, but on average for a group or segment you could get this information and optimize. Banks can do this by splitting consumer and merchant lines. Merchants typically take longer (who knows by how much), and get their own queue.

With this system, you have 2 queues, 1 for each group. There may be a lot of variation within each group, but the averages work out. Consumers wait the average minimum processing time for the consumer group, and merchant wait the average processing time for the merchant group.

This still leaves room for underutilization. What if the merchant line is backed up and the consumer line is empty? Ideally, the extra tellers would work to pick up the slack, but if this isn't possible then it's still not an ideal system.


Another common example would be airport check-in. You have economy and first-class.

Often the first-class line is empty - do you let 'the rabble' check-in there and risk a first class passenger having to (gasp) wait a couple of minutes behind them; or make the long line of economy passengers stare at the unused desk and mutter about the airline.

(Though given that airports are really just a series of queues feeding each other the different in practice is pretty minimal.)


I think you would be able to reduce the total time on your 10-queue example if you factor in/allow jockeying.


Commissaries on U.S. military bases use a one line multi-cashier setup, yet each cashier has a bunch of novelty items near their section. I seem to remember that setup be a little bit faster too, though it's not immediately apparent when standing in line.


Fry's wraps their mono-line with geegaw displays as well (usually electronics consumer geegaws, but it could be adapted to candy and trashy magazines). A cynic might wonder if they might actually want to maximize wait time, but I imagine it is, as someone points out below, a question of space limitations (carts require lots of space to navigate a rope maze). I note that the self-service stations slowly taking over the mega-grocery stores here employ a mono-line protocol. But, I find these inconvenient unless I only get a small number of items, which, of course, would require me to make more frequent trips, nulling out any possible time savings).

Grocery delivery would seem the only way out.


The problem is the limited resource of space. One line, multiple cashiers takes up more space than several cashiers, one line. The store needs to add the queue system and have a person standing at the front to make sure the line moves smoothly. Think about that large waiting area Fry's has.

Another point is that 6 people standing on a single line for 2 cashiers seems like a longer wait than 3 people standing on two lines.


I cant easily look it up myself right now (am on a mobile device) but I believe that the many cashiers many lines approach is faster from an average wait time perspective. However people tend to prefer the many cashiers one line approach because it instills a sense of fairness (first come first served).


From what I recall of queuing theory that's not actually correct. From wikipedia:

"One observational insight provided by comparing queuing models is that a single queue with multiple servers performs better than each server having their own queue and that a single large pool of servers performs better than two or more smaller pools, even though there are the same total number of servers in the system"

http://en.wikipedia.org/wiki/Queueing_model#Multiple-servers...


It seems you're correct. A quick search is giving me nothing to disagree with you.

That being said: My understanding was that the many-line system worked better primarily because of the potential for a lot of lost time between the server saying "Can I help whose next" and the order actually starting. This time is obviously hugely dependent on factors such as floor layout, space around the registers, customers familiarity with the system, etc. The idea was that if you have one line for multiple registers (a la Wendy's) than when the second register opened up the next customer in line had to notice, go to the register, probably walk around the person ordering at the first register, and then start ordering. Whereas in the multi-line system (a la McDonald's) the next customer in line will likely be focusing on the register in front of them ready to take the one step forward when their time comes. These factors can certainly be minimized but in stores that are busy/crowded/not well laid out it they can make a noticeable difference. That's my $.02 anyways.


Here's something a bit unorthodox. I worked for 7 years in the grocery industry, and still shop at the same store I worked at years ago.

At Wegmans at least, in the Northeast US, always pick the longest line. The one with the most customers.

Why? Visible long lines are bad for business. Front-end (checkout) managers hate long lines. As soon as they see them, they start bringing in more people to start running more registers, and then pull people from the back of the longest lines to these newly-opened registers.

This doesn't work so well if there aren't any long lines to begin with, but during the weekends and holidays, I always pick the longest line, and I always get moved to a line-less checkout lane. Never fails.


At the Wegmans I remember, the manager would pick people from the front of the line to move them to the newly opened registers (to keep things fair).


The slowest lane is the one you are in.


So always be in the other one... ;-)


and this also applies even if you change lanes...


Especially when driving and late for work...


According to Apu (The Simpsons) it's the line with the most single men in it. "... Only cash, no chitchat." http://www.snpp.com/episodes/1F10.html


I've thought about this a lot, too. The conclusion I've come to is that it's a lot like the stock market-- the greatest rewards go to those who focus on a currently undervalued variable. Just as buying stocks primarily based on P/E is useless in this day and age, so is counting the number of people in a line. Looking at how much is in their carts is a bit better, but far too many people do that, too.

My solution is to focus almost entirely on how competent and quick the cashier appears to be. If and when most other people do that as well, I'll look for another undervalued variable.


We have (optional) self-checkout here, and there are some weird non-linearities in that situation I've observed.

1) Around 1/3 transactions still require staff intervention of some kind. This might be credit card approval, weight overrides, or just dumb customers. If your transaction is one that needs it then the time it will take is much less predicable than in a normal check-out

2) As people become more familiar with them, they are using them for larger and larger loads. That means people are bringing shopping trolleys in, and bagging themselves, which is slow and creates traffic flow problems.


Stop and Shop in New England has a scanner gun you pickup when you enter the store for self-checkout. You scan items before you put them in your basket and when you get to the self-checkout, you've already scanned your items. Helps situation 2 not take forever.


Except all the stores I've been to no one trusts the customer so when you do self checkout not only do you have to scan each item but you have to make sure you put each item in the bag area so it can feel the weight. God forbid you want to take a bag out and put it in your cart before you pay as well.


We have that in some stores here in Sweden too, except you put the stuff you buuy straight into your shopping bag. When you're done you just put the scanner back, swipe your store- and credit cards and you're ready to leave the store - no re-packing stuff from basket to bag.


Self-checkouts could easily be both faster and friendlier than they are now. If they were treated as express lanes, and took only one form of payment—some sort of loadable store-only debit card, that would also serve as your store loyalty card—then the process would simply become "scan, scan, scan, swipe" (or alternately, "insert, scan, scan, scan, eject iff sufficient funds", in card-lock fashion.)


I just want to give a nod to the work and writing that Dan Meyer makes available on his blog. If you want to get a glimpse of the future of secondary math education, this is the place to look.


This is the calculation I use and it seems to work out more often then not:

Observe the lanes, every person is assigned 1 point, elderly (60+) +1, buggies over 70% full get +1, smokers get +1, welfare recipients +2. Add up the totals and the line with the smallest sum is usually the fastest. Obviously you can't always tell who is on welfare or who the smokers are, but the obvious ones are usually the ones that take the most time anyway.


The biggest factor for speed is the competency of the cashier. Many cashiers are tired and slow and don't care much about their jobs, you need to get in the line with the energetic smiling cashier who is moving things along.

Also, the self checkout lines can be incredibly fast or incredibly slow. If there is a problem you have to wait for a cashier to come fix it, and if the person in front of you gets confused it can take forever.


Instead of picking the fastest lane, it would in principle be faster to distribute all your items across all the lanes. That way, you minimize the time from you are first in line until you are checked out.

Consider the problem of optimizing the response time of a set of servers. Load balancing - keeping the hardware busy - will keep the request queues at roughly equal and therefore minimize the maximum queue length. That ensures that the hardware is as busy as possible, but you can improve on that.

When a new request arrives, you can either add all of that request to one queue, or you can split it into pieces and distribute those across all the queues. Distributing the request, assuming perfect load balancing, means the latency for that request will be k + 1/n instead of k + 1, where k is the length of the queue.

In other words: Parallelizing gets you a substantial improvement in response time without additional hardware, and without making the code run any faster. I didn't realize the implications of this until recently.


In the case of groceries wouldn't you only be as fast as the slowest line?

Your comment only applies if all lines are equal, which they almost never are. So you can't assume perfect load balancing under this circumstance.

I think the best store queueing system is to have one main queue that distributes customers to the first available cashier. People with larger loads take longer, but this has little effect on the main queue.


> In the case of groceries wouldn't you only be as fast as the slowest line?

That's a pretty good summary of Amdahl's law. Even a computer with an infinite number of processors can't run a program faster than it takes to run the slowest sequential part.


I don't think so,

The task you are splitting has to be sizeable enough that the setup costs of parallelization (in this case, going to every cashier to put your stuff and then going and picking it up) don't outweigh the potential benefits from parallelization.In this case, unless you are buying the whole store, it just doesn't make sense to bother splitting your shopping cart like this.

Further, if all the cashiers are busy at all the times being useful (ringing customers), you cannot possibly get a gain from splitting any further. There's no way you could improve the throughput of this system when every processing unit (cashier) is at the top of its utilization.


I also factor in age of customers in line when I pick which line to go to; as I assume older people move through checkout much slower.


In one Simpsons episode, Apu tells Marge to avoid the line with the old guy ("Grampa" Abraham Simpson) and that the fastest line is the one of the single guys.


Apu is giving Marge contradictory advice.

The old guy ("Grampa" Abraham Simpson) is in fact also a single guy.


Apu may have specified younger single depressed guys. I couldn't find the video clip anywhere still available to get the actual quote, so I'm going from memory.


The age of the cashier can be just as important, since they're usually doing most of the work.


My cousin (econ major) and I (stats major) kicked around an idea for dynamic grocery pricing based on line length. We never got any data ("kicked around" the idea, remember), so we didn't even get to the point of realizing the y-intercept wouldn't be zero.

Something will happen there, though. Lines = deadweight loss, and deadweight loss = room for improvement.


    >  Lines = deadweight loss, and deadweight loss = room for improvement.
Do you mean deadweight loss for the grocery store, or for the customer? Relatedly, does the grocery store care about deadweight loss for the customer?

If every grocery store in town has the same expected line length, then the entire cost of line length is borne by the consumer---since the line lengths are in equilibrium, none of the stores feel economic pressure to reduce their line length, and the line length is a fixed cost of food shopping (unless latency becomes comparable with the length of time a store is open during the day, in which case it's actually limiting the number of customers they can process per day, but I find this highly unlikely).

Granted, a store might try to differentiate itself by reducing its average line length, but there are many other (perhaps more important) factors that go into a consumer's choice regarding grocery stores, e.g., Wal-Mart mega-food-store competes on prices, Whole Foods competes on its customers' self-satisfaction (I kid, I love Whole Foods).

Intuitively, it feels like grocery store line length is in the noise when considering the decision process for most consumers, especially since I can get zero line length at almost any store by going during off-hours. If it's in the noise, there's no selection pressure to improve it.


I meant for the customer, and while I agree that grocery stores don't care about deadweight loss for their customers, I think they could.

I think the chief reason line length is considered noise rather than signal is because it's so unpredictable. When it's known, people do a great deal to minimize their time spent in line. They go to the store at off hours; they switch lines once they're standing in them. I know my local Taco Bell gets a lot more business from me because of their speedy response time, vs. the teriyaki place next door that I like more, but takes forever. And my college's bookstore has had a great deal of success with putting live camera feeds of their lines (or lack thereof) on their website.

But with grocery stores, I couldn't really tell you which of the two grocery stores in my area would have a longer line. They're about the same, and that's close enough.

So you'd need a pretty big delta for line length to become a differentiating factor between stores. The current system of a cashier scanning items individually probably won't see drastic efficiency improvements without drastic changes, so...drastic changes are needed.

After a certain point, changes in "line length" become "presence or absence of a line at all." As jonnathanson says below, electronic scan-as-you-buy is probably the future there(Smith's, in answer to my cousin's email inquiry, mentioned they were testing a portable bar code scanner). I'm under the impression that grocery stores have pretty cruddy margins, so maybe I shouldn't read that much into "in testing." If anyone out there is dying for a startup idea, I think this one is worth a look. (Before you say it, I'm working on another project, and my cousin left for grad school.)

Since few things are more self-satisfying than sailing out of a store without waiting in line, maybe Whole Foods will be the first? ;)


I know that target does that, they guarantee a certain line length (I think 2 people waiting, 1 in progress, at most).


I was a bit dissappointed to not see any discussion of the confidence interval on a predicted checkout time. I see so much variation in how long people take to figure out which pocket contains their wallets, how they're paying, etc. that I have trouble coming up with a good time estimate.


Here's the trick I've successfully used during peak hours. All things being equal, pick the longest line next to a closed lane, wait for the closed one to open (supermarkets will usually open additional lines when they think they are getting longer), and then quickly switch.


It's expected that you let the person who's been waiting the longest move there. That's why you'll hear the new cashier say "I can help the next person in line." I consider hopping over from the back of a line to be very rude.


I've also seen clueless managers at some stores (cough cough TARGET) take the people in the back of the lines and redirect them to the newly opening lanes. Pisses me off to no end when I'm the guy that's been waiting the longest and grandma in front of me pulls out her checkbook....


Of course, but many people will never switch. And even if they do, you will be in a line that is shorter than others.


I long for the days when grocery lines are unnecessary, self-checkout lines are unnecessary, and you can just scan-to-buy items as you go. Enforcement might be an issue, though. Heh.


Safeway experimented with that here (UK) about fifteen years ago. I used it. It worked, but I don't think it saved that much time, since shoppers are much slower at doing the scanning.

For enforcement they used sampling: at payment time, you were sometimes required to have your items scanned by a cashier anyway. The theory was that the more reliable you showed yourself to be, the less likely you were to be selected.

I haven't seen back to the store that they trialled it in recently, but I guess that it didn't work for some reason since it has not become widespread.


Interesting. I wonder if this kind of system will make a comeback as RFIDs, QR codes, digital payment systems, and smartphones get more ubiquitous.


If there's one thing I've learnt, is that once you pick a lane, stick with it (goes for driving too).


That sounds a bit like people who buy stock in a company and then, after the company deteriorates, stubbornly refuse to sell until they "get their money back".

The next line is open, but I've already invested 10 minutes waiting in this one and switching will mean it was time wasted!


See: sunk cost fallacy




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: