Optimize Workforce Planning using Linear Programming with Python.
What is the minimum number of workers you need to absorb your workload while ensuring employee retention?
In today’s dynamic business environment, optimising workforce planning is crucial to meet logistic operations’ fluctuating demands.
Managers must minimize the number of temporary workers hired while ensuring employee retention and adhering to local regulations.
As data scientists, how can we support operations managing workforce planning?
A solution to this problem is Linear Programming with Python, which can help minimize costs while meeting all the constraints.
This article will explore the optimization of workforce planning using linear programming with Python and analyze the results.
Summary
I. Introduction
II. Defining the Workforce Planning Problem Statement
1. Planning of Workforce resources for Inbound Operations
2. How to Size the Workforce using volumes and productivity
3. Linear Programming Problem to find the optimal solution
III. Linear Programming with PuLP
1. Prepare the parameters of your linear programming model
2. Initialize the model, define the objective and add constraints
3. Solve your model and analyze the results
4. Go Beyond by Increase Operators' Productivity
IV. Conclusion
1. Generative AI: GPT for Supply Chain Optimization
2. Statistical Approach: What is the impact of other parameters?
3. Next StepsIntroduction
A significant challenge that Distribution Center (DC) managers face is the workload fluctuation during the week.
The example above shows the daily variation of critical indicators that drive a warehouse’s workload (#Orders, #Lines, #SKU, …).
You can see a high variation from day to day that your teams need to absorb.
Can you size your workforce efficiently using analytics?
Considering that the average productivity of workers is stable, the only solution is to adapt your resources to meet the demands of each day.
💡 Find a YouTube version of this article with animations in the link below,
Defining the Workforce Planning Problem Statement
Planning of Workforce resources for Inbound Operations
You are working with the Inbound Manager of a Distribution Center operated by a Third Party Logistics Company (3PL) for a large retailer.
His team responsibilities include
- Unload Pallets from the Trucks
- Scan each pallet and record the received quantity in your Warehouse Management System (WMS)
- Put away these pallets in the Stock Area
The team’s global productivity is measured weekly (Pallets/Hour).
At the beginning of each month, transportation teams share a forecast of the number of pallets to be received daily for the next four weeks.
How can you use these forecasts to help the inbound manager estimate his future needs?
How to Size the Workforce using volumes and productivity
Based on these forecasts and your global productivity, you can estimate what resources would be needed each day
You will use 100% of temporary workers to build your team for more flexibility.
Constraint 1: The Supply must meet the demand
If you need 31 workers on Monday, you must secure at least 31 workers.
Constraint 2: Minimum working time by worker
To ensure employee retention, you must guarantee a minimum of 5 consecutive working days per week.
Workforce sourcing can be challenging, especially if e-commerce fulfilment centres surround your DC.
Therefore, you need to ensure minimum working time for your temporary workers to be an attractive employer.
Constraint 3: Maximum working time by week
Following the local regulations, each worker must rest for 2 days after 5 consecutive working days.
A worker from Shift 1 will start his week on Monday and get two days off on Friday.
Her colleague from Shift 6 will start the week on Saturday and get two days off on Thursday.
Objective: Minimize the number of workers hired
Following the productivity targets fixed by your manager, you must minimize the number of workers hired.
If you do not reach this target, your P&L can be impacted because this productivity has been used to calculate the price invoiced to your customer (retailer).
How can we reach this target with all these constraints?
Linear Programming Problem to find the optimal solution
We define a Linear Programming Problem by
- finding the optimal value of a linear function (objective function) of several variables (x[i])
- subject to the conditions that the variables are non-negative and satisfy a set of linear inequalities (called linear constraints).
Our problem fits perfectly!
Variables
x[i]: number of temporary workers hired for shift iConstraints
- For each day the total number of workers on-duty must be higher than the demand- Each worker needs to work a minimum of 5 consecutive days per week- Each worker needs to have 2 days off after 5 consecutive days of workObjective functions
The total number of temporary workers hired for all shifts i = 1 … 7 should be minimalLinear Programming with PuLP
PuLP is a Python modelling framework for linear (LP) and Integer Programming (IP) problems maintained by the COIN-OR Foundation.
Prepare the parameters of your linear programming model
- Create a circular list for the days (if you need to add five days to Friday, you will reach Wednesday)
- List of Working Days: if day = 0 (Monday), then working days are Monday, Tuesday, Wednesday, Thursday and Friday
- Workers off by shift for each day: if day = 0 (Monday), then workers of shift 2 (Starting Tuesday) and shift 3 (Starting Wednesday) are off
Initialize the model, define the objective and add constraints.
- Initialize the Model “Minimize Staffing” to minimize the objective
- Create variables x[i]: number of workers hired for shift i
- Define objective: sum of workers hired x[i]
- Add constraints: The sum of workers on duty (not on a day off) is higher than the minimum staff demand.
Solve your model and analyze the results
Results: Number of workers hired?
Total number of Staff = 53
Insights
0 workers hired for Thursday and Saturday shifts
Supply vs. Demand: what is the gap?
Do we have more workers than needed?
Insights
Friday: 1 extra worker
Saturday: 5 extra workers
In addition to optimizing your workforce allocation, you can also improve the productivity per worker following a process improvement methodology like the one presented in this article for picking.
You can find the full code in this Github repository👇 Link
Conclusion
Our results respect the constraints, i.e. the demand is met.
However, this sizing could be more satisfying as we have six extra man days to add to our P&L because of Friday and Saturday.
How can we improve the solution?
You can try to influence multiple parameters
- What if we have the constraint of two days off per week?
- Is the constraint of having consecutive days of work mandatory?
- Is the constraint of having at least five days worked per week mandatory?
Feel free to simulate these scenarios and share your results (or questions) in the comment section.
What about the productivity? Can we use data analytics to improve it?
Improve the productivity of operators with Python.
In this article, we took for granted that the operators’ maximum productivity cannot be increased.
However, in another series of articles, we proved that Python cannot be used to help operators become more efficient.
Reducing the walking distance of operators during picking is the most effective way to increase your DC overall productivity.
It can be achieved by grouping multiple orders in a single route that maximizes the number of items picked per meter walked.
Which analytics tools are useful for this problem?
In this series of articles, we use Python to implement spatial clustering and create a pathfinding algorithm to maximise operator outputs.
For more details, start with this article
This is not the only approach.
Indeed, external factors influencing the process may impact operators’ productivity.
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.
For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.
If interested in Data Analytics and Supply Chain, look at my website.
📘 Your complete guide for Supply Chain Analytics: Analytics Cheat Sheet
💌 New articles straight to your inbox for free: Newsletter
