Optimize Warehouse Value Added Services with Python | by Samir Saci | Towards Data Science

Most of the challenges faced by Distribution Centers (DC) handling Luxury Products, Garments or high-value goods are during Inbound Process.
We will take the example of a DC storing imported Luxury Bags, Garments and Shoes that need:
Machine 1 — Anti-theft tag: put a self alarm tag to protect your goods against theft in the store
Machine 2 — Labelling: print labels in the local language and perform label sewing
Machine 3 — Kitting & Repackaging: transfer your goods in the sales packaging and add Gift With Purchase (GWP), Individual Note or Certificate of Authenticity
After the completion of these 3 steps, your goods are ready to be put away in the stock area waiting to be picked for shipping to their final destinations (Store).
If your capacity of items handled by day is too low, this process can quickly become a major bottleneck.
You are an Inbound Manager of a Distribution Center (DC) for an iconic Luxury Maison focusing on Fashion, Fragrance and Watches.
You have received 600 prêt-à-porter sets (Ready-to-wear) including:
1 Female dress that requires Label Sewing and Re-packing
1 Handbag that requires Label Sewing, an Anti-theft tag and Re-packing
1 Leather Belt that requires an Anti-theft tag, Label Sewing and Re-packing
Because they are sold together, these SKU need to be ready at the same time and co-packed together to be ready for shipping to stores as soon as possible after the following steps:
Inbound Team is unloading pallets from the truck and put them in the staging area
Machine 1: Anti-theft tag — an operator put an anti-theft tag on each bag and belt
Machine 2 — Labelling: after printing in a dedicated area, labels are sewed on belts, handbags and dress
Machine 3 — Kitting & Repackaging: for each item, you need to add a certificate of authenticity, plastic protection and perform fine packing
After the re-packaging process, goods are transferred to a final staging area to wait for shipping (X-Docking Mode).
Objective: Reach maximum productivity of sets assembled per hour (sets/hour)
The Job Shop Scheduling Problem (JSSP) is an NP-hard problem defined by a set of jobs that must be executed by a set of machines in a specific order for each job.
For each of our jobs, we have defined execution time (min) and processing order of machines in the table above.
For instance, Job 2 (Handbag) is starting with Anti-theft Tags placement using Machine 1 (6 min) followed by Labels Sewing using Machine 2 (4 min), to finally end with Kitting and Packing using Machine 3 (3 min).
The machines can only execute a job at a time and once started, the machine cannot be interrupted until the completion of the assigned job.
Objective: minimize the makespan i.e the total time for completion of all jobs
i. The Naive Solution: 1 job cycle at a time
Results
Makespan: 30 min
Productivity: 2 sets/hour
Comments
This simple approach is the worst in terms of productivity. Because of the processing of job in sequence, machines stay idle (unused) quite often.
Question: What would be the result if we perform jobs in parallel?
ii. Optimal Solution: The Job Shop Scheduling Problem using Google OR-Tools
OR-Tools is an open-source collection of Google with tools for combinatorial optimization. The objective is to find the best solution out of a very large set of possible solutions.
I am a fan of this library that I have been using in several examples:
Samir Saci, Design Pathfinding Algorithm using Google AI to Improve Warehouse Productivity, Link
Samir Saci, Optimize Workforce Planning using Linear Programming with Python, Link
Let us try to use this library to find the optimal sequencing to reduce the makespan for this specific set of processes.
You can see above two graphs representing the initial solution (Naive Solution: 1 job at a time) and the Optimized Solution (Parallel Tasking).
Results
Total Makespan: 16 min (-47%)
Productivity: 3.75 sets/hour (+85%)
Idle time per cycle: 18 min (-71.4%)
The results are satisfying
I will explain now how to reach these results.
Edit: You can find a Youtube version of this article with animations in the link below.
a. Initialize your model
3 machinesTotal Time using Naive Solution: 30 min
b. Initialize variables and create sequences
c. Add Constraints and Set up the Solver
d. Solver Optimal Solution
Output -Optimal Schedule Length: 16Machine 1: job_2_1   job_3_2              [0,6]     [6,10]    Machine 2: job_3_1   job_1_1   job_2_2              [0,3]     [3,7]     [7,11]    Machine 3: job_1_2   job_3_3   job_2_3              [7,10]    [10,13]   [13,16]
Based on this output we can draw the updated schedule:
We increased the productivity by +48% by implementing a solution for smart scheduling that use the maximum potential of our resources (Machines).
This solution was based on a simple scenario using a single line of assembly (1 Machine per Type).
Question: What could be the results with several lines?
I let you test it and share your results (or questions) in the comment area.
Can we have higher productivity by changing the conditions?
In the chart above, I have highlighted the potential additional jobs we’ve could add during the idle time:
Machine 1: 1 sequence of 4 min which equals to the time for Job 3
Machine 2: 1 sequence of 4 min which equals to the time for Job 1 and Job 2
Machine 3: 2 sequences of 4 min which equals to the time for Job 1,2 and 3
Question: What would be the average productivity if we start Jobs of Cycle n+1 during these idle sequences of Cycle n?
What would be the impact on overall productivity if we have workstations for label sewing?
towardsdatascience.com
Please feel free to contact me, I am willing to share and exchange on topics related to Data Science and Supply Chain.My Portfolio: https://samirsaci.com
[1] Google AI, Google OR-Tools Library, Link