Picking Optimisation
Written by Navdeep Singh & Thibault Daoulas
Credit to: Ståle Berg & Marie-Noel Chantavong
Intro
The meal kit business
LMK group delivers meal kits to around 30K households in Norway, Sweden & Denmark every week. Customers can choose between default meal kits where dishes are selected for them or choose their dishes from a pool of 50–80 dishes every week. This allows us to deliver tailor-made and personalised dinner experiences for Nordic households.
Let’s say we have 50 new dishes every week, varying the number of portions and number of dinners per week gives us potentially over 2 million unique combinations of meal kits. This increased flexibility for our customers naturally puts pressure on the production and purchasing that must purchase the right amount of ingredients from our suppliers and pack these meal kits.
These tailor-made meal kits are getting packed on their own production line, the “free-pick” line. On this line, the ingredients for every week are placed in certain positions. This placement was done manually by people with experience to make sure that the production went smoothly and efficiently. When the production starts, the cart boards are made by a machine and sent down the line for printing on the box and printing of menu leaflets before they reach the “free-pick” line. The cart boxes are getting filled with the right ingredients as they are moving on the line. Each box stops at every station and gets filled up with the right ingredients and then is sent to the next station.
Challenges
The main challenge, in this case, was to minimise the queue time that appeared on the line. That happened when the person at the next station was taking more time to put in the ingredients than the person behind him. That person must wait and that is how the queue appears and slows up production. This happened because it is difficult to estimate the workload on each station manually based on how many picks there are on each station after the placement.
The other challenges were to place fragile, heavy, or special ingredients in the right places at the line. We don’t want fragile ingredients to get squashed by the heavier ones, and therefore they must be placed at the end, and the heavy ones at the beginning.
This placement of ingredients was done by the line leaders, who have the most experience and domain knowledge when it comes to production. When the cutoff came, the ingredients list is generated, and they start placing the ingredients. Once a week. They did it with two aspects in mind; Fast production and protecting the ingredients. Even though it was placed by experts, some ingredients were misplaced from time to time, and the workload per station didn’t become equal either. That is very difficult to do 100% correctly when you have 200–300 ingredients that must be placed on equal amounts of slots, with several constraints.
Approach
Observation phase
To ensure we address the challenges with the greatest impact on the meal kit packing process, we observed full packing cycles on-site and interviewed stakeholders to gather information from different angles, including employees picking ingredients on the supply chain, and delivering ingredients, as well as chain supervisors and logistics managers.
This allowed us to understand and formalize performance measures and translate perceived bottlenecks into hypotheses to test on hard data. Having a data representation of the challenges would open the path to data-driven methods and maximize the targeted performance.
In the present case, the main performance measure to maximize was the number of meal kits packed over time.
Gathering feedback from stakeholders, we made an initial list of observations, hypotheses to validate, and best practice recommendations:
- Walking back and forth between ingredients is inefficient and puts a strain on workers, which leads to physical and mental fatigue over time
- Since workers wait for incoming boxes at the left side of their respective station, ingredients placed towards the left are packed faster
- Large-sized ingredients, when packed far down the line, often lead to disruption due to all ingredients not fitting; the box is then put aside, and packing must be restarted
- Fragile ingredients packed late on the line may be damaged
Data exploration
Examining the physical setup on-site and exploring the available data helped us define the scope of the solution. We started with a several week-batch of historical data containing the following information:
- Ingredient (reference, name, weight, category)
- Time when scanned
- Ingredient position on the line
- Stations setup
- Meal box the ingredient belongs to
Scanning time and order data allowed us to define several performance metrics for meal box packing, while the position on the line and station setup allowed us to test hypotheses around the relative positions of ingredients on the shelves.
Formalize hypotheses and test
While station setup, via trial and error, eventually led to equally sized stations of 16 slots for dry ingredients and 24 slots for cold ingredients, historical data required cleaning and imputation to create a common baseline to test the hypotheses.
To test hypotheses, our approach was to create features as a proxy to the assumptions to test and train a supervised model that would learn the relationships between these features and the performance metrics, allowing us to validate the impact of the features and decide on which ones to optimize.
Design setup — Transform hypotheses into features
One of the first pieces of feedback we received was that workers were walking too much back and forth between slots, affecting their physical condition over time and their efficiency. A first hypothesis to test was therefore whether ingredients near each other tended to be picked faster, both early on during a shift and later in the shift due to cumulated fatigue.
Instead of looking at the time packed per box, we used the time spent packing ingredients on one station as our performance indicator. The cleaning of this data consisted of removing periods where lunch or other breaks occurred.
Feature 1: Connectivity
We created a feature that represents how much a worker on a station must walk to fetch different ingredients for a given box. Based on the Moore Neighborhood, we defined a feature proportional to how connected ingredients are for any given order on a station. As illustrated in Figure 1, neighboring ingredients will belong to one cluster, whereas non-neighboring ingredients will belong to 2 distinct clusters. The hypothesis to test was therefore the positive correlation between the packing time and the number of clusters in one station, given the equal number of unique ingredients.
Feature 2: Leftness
To test the effect of positioning ingredients towards the beginning of a station, we created a feature “leftness” per ingredient, a linear coefficient from 0 to 1, where 1 is an ingredient placed as far left as possible on a station, and 0 is at the far right. A station is then assigned a leftness score based on the average leftness of each picked ingredient on this station.
We then built a supervised learning model to test the hypotheses that connectivity and leftness contribute to greater packing throughput per station, where the target is the time spent packing ingredients on one station based on scanning timestamps, and the features being the number of clusters, leftness, number of unique ingredients, ingredients weight, station size. Adding features such as station weight and station size allowed us to make different training sets per group of comparable stations to isolate the effect of the features we intend to control, namely connectivity and leftness.
For all clusters of training sets, using linear regression, random forest, and xgboost modeling with the SHAP framework, the number of clusters did have consistently a positive impact on packing time, while leftness had a negative correlation.
Unsurprisingly, station leftness and the number of clusters showed a strong negative correlation, as a great leftness value implies that ingredients are clustered together towards the beginning of a station. We, therefore, chose to focus on the leftness feature per station and maximize it under provided constraints. In other terms, to reach a global maximum leftness, ingredients with the highest quantities were to be stacked towards the left of each station.
List constraints (organizational & physical)
Now that we had a feature to optimize, we had to set constraints and best practices after the observation phase and suggested improvements to embed in the design of the algorithm:
- Fragile ingredients to be placed towards the end of the line
- Large-size ingredients to be placed towards the start of the line
- Heavier ingredients to be placed on the lower shelf
Get Navdeep Singh’s stories in your inbox
Join Medium for free to get updates from this writer.
- Priority groups: some ingredients must be placed last, such as pizza dough, no matter their weight, fragility, cold status, or amount, for better fit due to their shape
- If all dry ingredients do not fit in the dry area, they need to be placed at the start of the cold area
- If there are too few unique dry ingredients, therefore, leaving empty slots on the dry side, cold ingredients are imported from the cold side
- Each station has a provided capacity, allowing trainees or employees with reduced capacity to process their respective stations without affecting the overall flow on the line. This capacity per station varies over weeks, lines, and stations and is provided at the program execution time, i.e., when new orders data come into the system
- Stations may have a varying number of slots, provided at execution time
Optimize features under defined constraints
Defining constraints in the algorithmic sense means setting rules to where ingredients can be placed and reducing or filtering the domain of possibilities. While some rules can be directly applied like fragile ingredients going to the furthest down available slots, large ingredients to the first 3 stations or heavier ingredients being placed on the lower shelf, setting a constraint based on station capacity required an optimization approach. Indeed, any given set of ingredients and their quantities, given some constraints, do not guarantee that the exact desired number of picked ingredients per station can be reached.
To summarize, at this point:
What we know:
- Unique ingredients and their properties (big, fragile, heavy, etc.)
- Available slots and properties (for big ingredients, for fragile, for heavy, etc.)
- Maximum number of ingredients to fit on each station
What we want:
- Match ingredients and slots properties (fragile ingredients in fragile slots, etc.)
- Fit the number of ingredients in each station as close as possible to the maximum capacity calculated
- Place ingredients so that each station’s leftness coefficient is highest as possible
This challenge looks a lot like the bin-packing problem with conditions on ingredients properties to identify the bins to choose from. In a nutshell, the bin-packing problem is a situation where we want to use the smallest number of bins or containers with limited capacity, to pack groups of objects of varying sizes.
In our case, we opted for the First Fit Decreasing algorithm implementation, which is a great compromise between efficiency and precision to reach the targeted station capacity.
Essentially, for us this means:
- Sorting the ingredients by decreasing the amount
- Sorting the available slots by decreasing remaining station capacity and leftness
- Filtering available slots based on properties of the next ingredient to place
- Iterate until the last ingredient is placed
Execute, feedback, iterate
Once the implementation of the algorithm was in place and tested on historical data, we were able to compare the difference between the setup made and the one suggested by the algorithm. Both on historical data and for a couple of weeks, where the suggestion was only given to the line manager for review, improvements were noticed at first glance:
- The amount of ingredients is more evenly spread over the stations
- No more anomalies where large-size ingredients could be placed late on the line
- Distribution of highly demanded ingredients is a lot more organized towards the left of each station rather than seemingly random distributions
- Better division of heavy and lightweight ingredients between lower and upper shelf
- Fragile ingredients are consistently placed toward the end
After two weeks of simulation and adjustments after feedback from the warehouse, the output from our model was taken for production. On Wednesday morning, as a list of orders, ingredients and quantities entered the system, the algorithm was run to read and produce a CSV file with the assigned slot for each ingredient in under 8 seconds. Line managers then only had to distribute the ingredients to their assigned position and start the packing procedure.
Results
Productionalize
To further streamline the process, we integrated the optimization application with the picking application production used so it would require no manual intervention from the development team. All the line managers had to do was to trigger the optimization via a button on their picking platform, which executed our python application and populated their forms they could just print out and distribute in the production center. Should a trainee, employee with limited capacity, or packing crew be understaffed, they could manually adjust the station’s capacity and rerun the optimization application.
Feedback from direct stakeholders
Although data speaks the truth, the most tangible feedback comes from people’s perceptions. In our case, the two main groups of stakeholders we could gather feedback from were workers on the packing line and warehouse managers. While the latter informed us of the process of integrating our new tool into their workflow, the former could give us direct feedback on the impact of our optimization.
The Monday following the first weekend packing our optimized setup, these were some of the comments we received from the production manager and people working on the packing line:
- “Saturday (last shift) finished earlier than usual”
- “People are more stationary; they walk less back and forth”
- “On average they were packing around 10 more boxes per hour”
- “Less weight to carry from upper shelves”
While some final adjustments were needed regarding new fragile ingredients, the first data-driven setup for meal kit packing could be considered successful so far. Now hopefully the data will follow and confirm that indeed the impact was positive on the packing production.
Performance measure
One challenge with data is that there are many moving pieces, thus making it difficult to establish a baseline. For us, this meant varying scanning device systems, station sizes, or personnel. After some discussions with production managers, we took their usual performance indicator and compared two weeks in with optimization versus two weeks prior. The ultimate KPI is the speed of packing full boxes, in the first 2 weeks we went from 197 to 212 meal kits packed per hour.
Conclusion
Even though the improvement measured of around 10% increased packing productivity might not appear drastic, it does have a significant impact when a large number of employees are involved in the process. However, an immediately perceptible yet more difficult-to-measure impact has been the improved working conditions and reduced physical strain on employees, who now both work shorter hours on the line, carry lighter weights, and need to walk less back and forth through their shifts. Stressful situations related to rightly preordered ingredients, queues, and repacking have also reduced, leading to better working conditions overall.
Building the placement optimization tool took about a month from scratch to being fully integrated into existing workflows, so there is great room for improvement, but it opened the opportunity for further improvements with minimal effort across production centers.
Finally, beyond the desired improvements, the tool now gives better control over the packing flow and gives the knobs for line managers to adjust stations, for example for trainees, people with reduced capacity, or reduced staff.










