When visiting the supermarket with a shopping list, get all the items in the fastest way?

From time to time my wife sends me to the REAL supermarket with a shopping list (she writes me a piece of paper or gives me a message).

I was wondering if there is a quick way to populate the list without repeating the whole super dozens of times until I believe I have everything.

(I found this question very useful in life: pair-socks-from-a-pile-efficiently , and hoped I could use community help in my situation)

I don't know / remember where each item in the supermarket is, and the list I give is never sorted (e.g. vegetables are listed in the entire list, not one by one). Also, I usually get continuous text messages with lots of items to buy while I'm still super.

My approach provides a path that assures me that I am going through the entire supermarket and selecting items from a list by going that path.

Two ways I was thinking:

  • foreach element in super (n)

    I pass: check if I have such an element in my list (m) , which will give me O(n*m)

    complicity that is not as efficient.
  • "dividing" the store into lines (p)

    : standing at the beginning of each line, I can read the sign or see what elements I should find there, than iterate over the list, trying to remember all the elements in the list I should find in this line. than walking this line and adding these items to your cart should bring me O(p*m)

    complicity. but it never happens. ... I can not remember more than three of the four elements of my list, which I expect to find in this line, and even if I do, I often forget the element and use the algorithm again (say q

    again)
    , who comes to: O(q*p*m)

    .

A few comments I would like to add:

  • When you, for example, get into the vegetable section, I went over this section many times because my wife is an excellent cook and adds (v)

    all kinds of vegetables to the list . Of course, I can't remember all those vegetables, and not stop next to every vegetable on the market (or should I?) To check if I have it on my list.
  • Traversing every item I put in my cart (or creating a new list with all the items I don't have yet) is very time consuming for me, so I prefer to just loop through the entire list every time I try to find if I have everything there is still an item to add to the cart.
  • Another case is the second one you get in your car before you go on family vacation. Do you remember that you forgot to take this and although, when you returned to your house, took out some of these items, forgot others and returned back. Is this a similar case?
+3


source to share


1 answer


Bringing up the permutation time here , my initial idea of ​​setting the time to match regular items to you would be useless. (they often organize walkways).



For any ideas going down this road - I'm not going to work ...

0


source







All Articles