Queuing theory is a subset of applied math that looks into the behavior of waiting in line and algorithms that optimize various aspects of this particular kind of resource allocation. Retailers
of all kinds are interested in this kind of math because it can improve customer satisfaction and get more products out the door. Apple reduces long cashier lines with employees who can accept payments anywhere in its stores. Fry's Electronics has the giant single line that feeds into a massive array of cashiers (aka the serpentine line). There are self-checkout lanes at the grocery store, but there's no silver bullet to eliminate waiting in lines. Here are just a few more links on this problem of civilization.
If you'd like to read more awesome and interesting stuff, check out this unrelated (but not entirely random!) Techdirt post