Supply Chain Process Scheduling with Python

Author:Murphy  |  View: 20950  |  Time: 2025-03-22 21:37:52
Optimize Warehouse Process Scheduling with Python – (Image by Author)

In my experience, the major challenges faced in distribution centres for luxury brands were related to inbound logistics.

After receiving, items must undergo multiple value-added services to complete the inbound process and be returned to stock.

Example of Value-Added Services Required – (Image by Author)

For instance, a bag imported from France to China requires specific labelling in Mandarin, a set of quality checks, and an anti-theft tag.

These processes can create a bottleneck in the inbound process, which would delay distribution and cause store stock-outs.

As a Data Scientist, how can you use linear programming to reduce bottlenecks and maximize the productivity?

In this article, we will use the job-shop problem to optimize the scheduling of these processes and maximize the overall inbound productivity.

I will present an optimal process scheduling solution using Google OR tools to increase inbound capacity by up to 48%.

Summary 
I. Value-Added Services for Luxury Products
II. Problem Statement of Inbound Process Scheduling
1. Inbound Operations Optimization for Luxury Products
2. Problem Statement: The Job-Shop Problem
III. Conclusion

Value-Added Services for Luxury Products

Most of the reengineering projects I have conducted were for retail, FMCG, or automotive operations to reduce costs by minimizing the use of workforce and equipment.

Examples of reengineering projects for cost reduction [Find more: Link] – (Image by Author)

For luxury brands, the priority was different, considering the value of goods and the demand variability.

Stores teams: "The collection SS2024 needs to be delivered at the stores before the first week of June."

Logistics teams are pressured to ensure that products are received, prepared and shipped on time to meet stores' demand.

To illustrate this, I will use the real example of a French luxury brand that operates a distribution centre in Shanghai that delivers to 35 stores in China.

Distribution Center of a Luxury Brand – (Image by Author)

This distribution centre receives items (Garments, Bags and Accessories) imported from France for the local market.

Products Flows in the Warehouse – (Image by Author)

After reception and value-added services, items can go through two different flows:

  • Cross-docking flow: items are shipped the same day to the stores ⌛ KPI: the lead time between reception and shipping

  • Stock flow: items are put away to stock (for several days or weeks) before being ordered, picked and shipped to the stores ⌛ KPI: the lead time between reception and putaway

These two indicators have the common problem of depending on the warehouse's Value-Added Services (VAS) capacity.

What are these Value-Added Services?

  • Operation 1 – Anti-theft tag: operators put a **** self-alarm tag to protect your goods against theft in the store
Anti-theft tag – (Image by author)
  • Operation 2 – Labelling: operators print labels in the local language and perform label sewing
Example of label – (Image by Author)
  • Operation 3 – Kitting & Repackaging: operators put items in sales packaging and add Gift With Purchase (GWP), individual notes and Certificate of Authenticity
Example of packing with Gift with purchase and certificate – (CAD Model by Author)

After completing these three steps, the goods can be stored in the stock area or shipped to the stores.

What could go wrong?

If the capacity of the overall process (items/day) is too low, this can quickly become a bottleneck if you face peaks of inbound volumes.


Problem Statement: Warehouse VAS Scheduling

Inbound Operations Optimization for Luxury Products

You are the Data Science manager in the logistics department of this iconic luxury brand focusing on Fashion, Fragrance and Watches.

The inbound manager of this distribution centre requested your support in reducing the bottlenecks caused by inefficiencies in the VAS scheduling.

Her team receives daily several thousands of prêt-à-porter sets (Ready-to-wear), including:

  • 1 Female dress that requires Labeling and Repacking
  • A Handbag that requires Labeling, Anti-theft tags and Repacking
  • 1 Leather Belt that requires Anti-theft tags, Labeling and Repacking

As they are sold together, these items need to be ready at the same time after going through the following steps:

  • The receiving team unloads pallets from the truck and puts them in the staging area.
Unloading and transfer of the pallet to the staging area – (CAD Model by Author)
  • Machine 1 – Anti-theft tag: an operator puts an anti-theft tag on each bag and belt.
2 workstations where operators put an anti-theft tag on each Handbag and Belt – (CAD Model by Author)
  • Machine 2—Labelling: After printing in a dedicated area, labels are sewn on belts, handbags, and dresses.
4 workstations where operators perform label sewing – (CAD Model by Author)
  • Machine 3 – Kitting & Repackaging: Operators add a certificate of authenticity and perform fine packing for each item.
4 workstations where operators perform re-packaging – (CAD Model by Author)

After these steps, goods are transferred to a final staging area to wait for shipping (Flow 1) or put away in the stock area (Flow 2).

Objective: Reach maximum productivity of sets assembled per hour (sets/hour).

Problem Statement: The Job-Shop Problem

The Job Shop Scheduling Problem (JSSP) is an NP-hard problem defined by a set of jobs that machines must execute in a specific order for each job.

In our example, we have one job per item in the set, and they can (have) to be performed simultaneously.

An example with 3 jobs using 3 machines – (Image by Author)

The table above defines the execution time (min) and machine processing order for each job.

For instance, Job 2 (Handbag) starts with placing Anti-theft Tags using Machine 1 (6 min), followed by Label Sewing using Machine 2 (4 min), and finally ends with Kitting and Packing using Machine 3 (3 min).

We have constraints on how to use machines:

  • The machines can only execute one job at a time.
  • Once started, a machine cannot be interrupted until the assigned job is completed.

The objective is to minimize the makespan, i.e. the total time to complete all jobs.

What is the baseline?

The Naive Solution: 1 job cycle at a time

First Naive Approach – (Image by Author)

We assume that the VAS team leader organizes the jobs in sequence and avoids performing any job in parallel.

Results

  • Makespan: 30 min
  • Productivity: 2 sets/hour

Comments

This simple approach is the worst in terms of productivity. Because jobs are processed in sequence, machines often stay idle (unused).

Question: What would be the result if we performed jobs in parallel?

The Optimal Solution

This example fits with 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 many possible solutions.

I have been using it for several case studies.

  • Samir Saci, Design Pathfinding Algorithm using Google AI to Improve Warehouse Productivity

Improve Warehouse Productivity using Pathfinding Algorithm with Python

  • Samir Saci, Optimize Workforce Planning using Linear Programming with Python

Optimize Workforce Planning using Linear Programming with Python

Let us use this library to find the optimal sequencing to reduce the makespan for this specific set of processes.


Optimization of Process Scheduling using Linear Programming

Results: Optimized vs. Naive Solutions

First Naive Approach – (Image by Author)
Optimized Solution with Google OR-Tools – (Image by Author)

The two graphs above represent 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.

How to get these results?

Build the optimization model with Python

Initialize your linear programming model

<script src="https://gist.github.com/samirsaci/fdabecd469698c98cb45bb043dc0f9a1.js"></script>

In the list jobs_data, you define each job's operations, including the machine associated with it and the timing.

Initialize variables and create sequences

<script src="https://gist.github.com/samirsaci/ace72f88d6d70f28d344eaf6702d1026.js"></script>

Add Constraints and Set up the Solver

<script src="https://gist.github.com/samirsaci/36118af42e4a0cfb0ce334076d24acee.js"></script>

Solver Optimal Solution

<script src="https://gist.github.com/samirsaci/ace72f88d6d70f28d344eaf6702d1026.js"></script>

Output

Optimal Schedule Length: 16 min
Machine 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:

Optimized Solution with Google OR-Tools – (Image by Author)

Considering the constraints, this solution minimizes machine idle time and provides the highest productivity (sets/hour).


Conclusion

We increased productivity by +48% by implementing a smart scheduling solution that maximises the resources.

This solution was based on a simple scenario using a single assembly line (1 Machine per Type).

Can we have higher productivity by changing the conditions?

Optimized Solution with idle sequences (yellow) – (Image by Author)

In the chart above, I have highlighted the potential additional jobs we could add during the idle time:

  • Machine 1: 1 sequence of 4 min, which equals the time for Job 3
  • Machine 2: 1 sequence of 4 min, which equals the time for Job 1 & Job 2
  • Machine 3: 2 sequences of 4 min, the time for Jobs 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?

Go Beyond

What would impact the overall productivity if we had parallel workstations for label sewing?

Process definition for the Queueing Theory – (Image by Author)

This question can be answered by using the queuing theory.

Queueing theory used to design a packing station – (Image by Samir Saci)

Learn more about it in this article,

Supply Chain Process Design using the Queueing Theory


About Me

Let's connect on Linkedin and Twitter, I am a Supply Chain Engineer using data analytics to improve Logistics operations and reduce costs.

If you need consulting or advice for your supply chain transformation, please contact me via Logigreen Consulting.

If you are interested in Data Analytics and Supply Chain, have a look at my website.

Samir Saci | Data Science & Productivity

Tags: Data Science Logistics Operations Research Python Supply Chain

Comment