Finding which products to deliver

Suppose that you own a store and want to find out which products you should deliver to your clients and in what amount. To do this, you want to consider a combination of factors including the items people buy most often, how profitable each product is (unit revenue – unit cost), how much place it occupies in your store, how long it can stay fresh, how hard it is to deliver it (production and transport).

These are the products currently on sale:

ProductPer-unit profitPlace neededDays freshLogistic requirements
cheese1.70.682.2
peaches1.3142.2
lettuce0.60.91.52.35
canned tuna fish1.30.41002.2
milk0.50.432
yellow cheese2.10.6102.1
washing powder3.20.81004.3
avocado2.50.883
celery0.81121.7
peanuts1.81.561.8
rice1.21152
pumpkin0.8252.6
canned sardines0.850.451002.3
water melon0.7524.52.2
oranges11.142
lentills1.51151.9
lemons1.50.7563
bread0.651.12.52.5
Coca Cola2.40.551002.5
onion0.751.221.8
potatoes0.81.342.4
olives2.21.4122.2
swiss roll0.80.9561.4
chocholate0.80.55151.8
carrots0.750.82.51.4
almonds2.81.1152.5
sunflower seeds1.61.2101.4
brussels sprouts0.90.642.12
chicken legs1.250.752.51.8
choco biscuits0.750.571.8
pea0.71.3102.5
tomatoes1.1132.35
eggs11.371.1
diapers2.11.0151.5
walnuts2.41.4152.4
cucumber0.81.432.6
grapes1.20.92.752.2
cabbage0.651.331.2
mushrooms1.91.521.9
butter0.830.45101.2
radishes0.40.3541.7
beans1.71152.2
garlic1.40.471.6

This table gives an overview of the characteristics of the products and we can see that they have different advantages and disadvantages. For instance, food that is cheaper may be sold more frequently. A product that is expensive may require a lot of space, so that we can't offer other products meanwhile. Some products are frequently bought together with others—bread and butter, salad and beer... Some products can be kept extra long time, which has been marked with 100 in the "days fresh" category, but they may be much less attractive for potential buyers. Offering some other items may be quite profitable, but may be bound with inability to deliver due to bottlenecks in production or insufficient production capacity.

You also have a log of the purchased items of your last 100 clients which looks like this:

PersonPurchased items
1onion, chocholate, yellow cheese, lettuce, rice, choco biscuits, olives, almonds
2carrots
3avocado, grapes, rice, chocholate, choco biscuits
4carrots, peanuts, almonds, walnuts, peaches, water melon, radishes
5oranges, canned tuna fish, garlic, radishes, pea, canned sardines, beans
6lettuce, garlic
7grapes, swiss roll, eggs, diapers, canned sardines, oranges, avocado
8walnuts, almonds, mushrooms
9lemons, cucumber, choco biscuits, butter
10rice, water melon, brussels sprouts, swiss roll, peaches
11olives, lettuce, milk, Coca Cola, mushrooms
12lettuce, peanuts, canned tuna fish, water melon, diapers, choco biscuits, onion, avocado
13sunflower seeds
14Coca Cola, butter, celery, water melon, lentills
15swiss roll, cabbage, tomatoes, pumpkin, brussels sprouts
16carrots, garlic, lemons, lettuce, brussels sprouts
17diapers, pumpkin, sunflower seeds
18lentills, canned sardines, butter, onion, radishes
19garlic, avocado, eggs, lentills, almonds
20lettuce, diapers, rice
21mushrooms, lettuce, chicken legs, water melon, rice, canned tuna fish, eggs, diapers
22tomatoes, almonds, canned tuna fish, olives
23olives, Coca Cola, eggs, grapes, water melon, lentills, walnuts
24chicken legs
25washing powder, butter, chocholate, peanuts
26chicken legs, almonds, yellow cheese, sunflower seeds, lettuce, celery, rice
27swiss roll, canned tuna fish, onion
28celery, peanuts, diapers, bread
29cabbage, garlic, milk, onion, rice
30onion, milk
31eggs, oranges
32water melon, cucumber
33sunflower seeds
34pumpkin, canned sardines
35garlic, sunflower seeds, diapers, beans
36canned sardines, washing powder
37sunflower seeds, water melon, celery, lentills, rice, canned tuna fish, brussels sprouts, diapers
38cucumber, garlic, chicken legs, cheese, diapers, lentills, rice
39Coca Cola, rice, diapers, oranges
40eggs, carrots, canned tuna fish, grapes, swiss roll
41garlic, chocholate, bread, cabbage, mushrooms, tomatoes, oranges
42avocado, peaches
43tomatoes
44butter, peaches, olives, onion, sunflower seeds, rice, radishes
45radishes, grapes, cucumber, walnuts, pumpkin
46carrots, canned tuna fish, radishes, lentills, yellow cheese
47grapes, avocado
48beans, butter, avocado
49canned sardines, bread, lemons, brussels sprouts, mushrooms
50peanuts, yellow cheese, chicken legs, rice, onion, beans, peaches, cheese
51washing powder, cabbage, oranges
52cabbage, walnuts, grapes, carrots, chicken legs
53cabbage, bread
54avocado, celery, butter, canned sardines, rice
55washing powder, eggs, olives, peanuts, carrots
56olives, butter, walnuts, lettuce
57choco biscuits, rice, canned sardines, garlic
58cabbage
59oranges, Coca Cola, cheese, eggs, grapes, pea, tomatoes
60garlic, lentills, bread, pumpkin, milk, avocado, rice
61cucumber, chicken legs, pea
62peaches, cabbage
63butter, lemons, sunflower seeds, Coca Cola, washing powder
64carrots, cucumber
65carrots
66potatoes, avocado, diapers, onion, pumpkin, lettuce
67choco biscuits, chicken legs
68garlic, washing powder, water melon, milk, chocholate, pumpkin
69tomatoes, pumpkin, bread, peaches, yellow cheese, washing powder, milk
70potatoes, choco biscuits, radishes
71onion, canned tuna fish, chocholate, eggs
72lentills, lettuce, sunflower seeds, canned sardines, choco biscuits, avocado, tomatoes
73beans, choco biscuits, eggs
74chicken legs, diapers, oranges, lentills
75water melon, garlic, pea, cabbage, butter, swiss roll
76swiss roll
77beans, brussels sprouts, chicken legs, carrots, bread, canned tuna fish, celery
78water melon, diapers, eggs, cucumber, radishes, pumpkin, peaches
79lettuce, Coca Cola, peanuts, diapers
80olives, tomatoes, peanuts, washing powder, potatoes, milk, pumpkin
81yellow cheese, pea, carrots, onion, pumpkin, choco biscuits, almonds
82water melon, garlic, milk, almonds, canned sardines, onion, avocado, pumpkin
83canned sardines, grapes, Coca Cola, peanuts, chicken legs, sunflower seeds
84sunflower seeds, Coca Cola, brussels sprouts, onion, rice, olives
85canned tuna fish, rice, chocholate, Coca Cola, onion, oranges, choco biscuits, peanuts
86oranges, diapers, lettuce
87choco biscuits
88peaches, canned sardines, butter, garlic, diapers, beans
89walnuts, washing powder, oranges
90yellow cheese, mushrooms
91peaches, almonds
92bread, lentills, washing powder, oranges, tomatoes, canned sardines, potatoes, eggs
93bread, washing powder, mushrooms, carrots, potatoes, Coca Cola
94walnuts, olives, avocado, pea, grapes, carrots, cucumber
95yellow cheese, water melon, bread, canned sardines, lemons, carrots, pumpkin
96oranges, Coca Cola
97olives, peanuts, walnuts
98radishes
99walnuts, eggs, brussels sprouts
100cucumber, lettuce, washing powder, pea, rice, lentills, canned sardines

Finding the number of times each item was purchased is easy:

ItemTimes purchased
cheese3
lemons5
carrots14
peaches10
lettuce14
diapers16
almonds9
sunflower seeds11
canned tuna fish11
milk8
brussels sprouts8
yellow cheese8
chicken legs11
avocado13
celery6
choco biscuits12
peanuts11
rice18
pea7
tomatoes9
pumpkin13
canned sardines15
Coca Cola12
water melon13
eggs13
olives11
oranges13
walnuts10
lentills12
garlic14
grapes10
cabbage9
bread10
butter11
mushrooms7
radishes9
onion14
potatoes5
swiss roll7
washing powder12
beans7
chocholate7
cucumber9

Now, using the data about the products from the first table, we could find the relative importance of each product to be included on the shelf based on the log of purchases:

ProductRelative value
Coca Cola20.95
canned tuna fish16.25
canned sardines12.32
washing powder11.16
diapers3.36
garlic2.14
butter1.69
rice1.62
lentills1.42
almonds1.37
yellow cheese1.33
avocado1.08
walnuts1.07
sunflower seeds1.05
olives0.94
chocholate0.85
beans0.81
choco biscuits0.70
peanuts0.44
celery0.34
cheese0.31
chicken legs0.25
swiss roll0.25
radishes0.24
peaches0.24
carrots0.23
brussels sprouts0.23
lemons0.20
grapes0.17
pea0.15
milk0.15
tomatoes0.13
cabbage0.11
pumpkin0.10
water melon0.10
onion0.10
mushrooms0.09
lettuce0.06
cucumber0.06
bread0.06
potatoes0.05
eggs0.00
oranges0.00

What we can observe is that the first couple of products receive a high score relative to the rest. They all can be kept on the shelf for a long time without concerns about their quality. This partially explains why some stores prefer to offer them compared to products that can go bad only in a couple of days or where a lot of waste can be generated. The result is that the regular buyer gets more exposed to these items and less exposed to fresh and healthy food, which may tend to be less profitable.

This approach is neither perfect nor complete as there are plenty of criteria that can integrated into the decision process. The scoring itself is subjective and we run the risk of getting biased results of we don't normalize our data in each category before using our scoring function (something which can be partially seen in the last table). Nevertheless, it can give an overview of what we could expect to see by looking more closely at our data.