TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Improve Warehouse Productivity using Order Batching with Python

7 min readAug 5, 2020

--

A warehouse floor layout is shown with aisles and a path marked for an order picker. The diagram illustrates a strategy for optimizing order batching by reducing the distance walked during the picking process. There are multiple aisles labeled A1 through A20, and the picker’s start point is highlighted along with a path that traverses various aisles to retrieve items. The image aims to show how different strategies can improve productivity by minimizing walking distance between picking locations
Improve Warehouse Productivity using Order Batching with Python — (Image by Author)

In a Distribution Center (DC), walking time from one location to another during the picking route can account for 60% to 70% of the operator’s working time.

As a Data Scientist, how can you help logistics operations improve this figure?

Reducing this walking time is the most effective way to increase your DC overall productivity.

A simple warehouse aisle layout for order picking. The aisles are labeled from A01 to A19, with racks on both sides. There is a start point marked at the bottom left. The image focuses on a simulation of an order picking process, demonstrating a route taken by a picker as they navigate through the aisles to complete their task. The visual aims to help analyze the effectiveness of different picking routes within a warehouse.
(1) Scenario 1: Picking routes with one order picked per wave — (Image by Author)

The objective is to simulate the impact of several picking strategies with Python, using the Single Picker Routing Problem (SPRP) for a two-dimensional warehouse model (axis-x, axis-y).

This specific application of the general Traveling Salesman Problem (TSP) finds the shortest route to prepare a specific set of orders.

Using data analytics , can we compare several routing strategies?

In this article, we will use Python to simulate several order-batching strategies to estimate their impact on the total walking distance.

I. What is Wave Picking?
E-Commerce Warehousing Operations: Improve the picking productivity
1. Assumptions
Picking locations, cart size and operational conditions
2. Initial Picking Strategy
What if the operator prepares only 1 order per wave ?
II. Test several Optimization Algorithms
1. Warehouse Layout with storage location mapping
Each location (x, y) coordinates w
2. Order lines from your Warehouse Management System (WMS)
Data source coming from the system
3. Functions for calculating Picking Route distance
A custom function to measure distances considering the alleys
4. Functions for creating order waves
How to group orders per wave?
III. Results & Next Steps
1. Results of the Initial Experiment
How much distance reduction if we group orders in the same wave?
2. Next Steps: Exploring other batching strategy
Like grouping orders per clusters of locations or using pathfinding algo
3. Statistical Approach: What is the impact of other parameters?
Lean six sigma: a statistical approach to process improvement

What is Wave Picking?

For this study, we will use the example of E-Commerce type DC, where items are stored on 4-level shelves.

These shelves are organized in multiple rows (Row#: 1 … n) and aisles (Aisle#: A1 … A_n).

Assumptions

(2) Warehouse Picking Carts — (Image by Author)
  1. Items Dimensions: Small and light dimensions items
  2. Picking Cart: lightweight picking cart with a capacity of 10 orders
  3. Picking Route: Picking Route starts and ends at the same location

Scenario 1, the worst in terms of productivity, can be easily optimized because of

  • Locations: Orders #1 and #2 have common picking locations
  • Zones: orders have picking locations in a common zone
  • Single-line Orders: items_picked/walking_distance efficiency is very low
A visual representation of a warehouse layout with aisles labeled A1 to A19 and numbered shelves ranging from 1 to 12. The layout illustrates a starting point labeled “START” and is used for demonstrating the picking strategy in a warehouse, focusing on the efficiency of picking orders.
(3) Scenario 2: Wave Picking applied to Scenario 1 — (Image by Author)

How can you organise picking routes?

The first intuitive way to optimize this process is to combine these three orders in one picking route — this strategy is commonly called Wave Picking.

We will build a model to simulate the impact of several Wave Picking strategies on the total walking distance for a specific set of orders to prepare.

This problem aims to maximize the picking productivity, i.e., the number of boxes an operator picks per hour worked.

To learn more about Picking Productivity,

Test several Optimization Algorithms

Now that we have set the objective, let us gather assumptions and operational parameters to build a model.

How do we measure the walking distance?

Warehouse Layout with storage location mapping

A visual representation of a warehouse layout with labeled aisles A01 to A19, and shelves in each aisle. The starting point is at the bottom left, and an order picker’s route starts from the ‘Start’ point and follows along a defined picking path. Coordinates are marked as (x, y) for picking locations in the aisles, showing the calculation of walking distance from the start to a specific item location.
(5) Warehouse Layout with 2D Coordinates — (Image by Author)

Based on the actual warehouse layout, storage locations are mapped with 2-D (x, y) coordinates that will be used to measure walking distance.

Every storage location is linked to a Reference using Master Data.

For instance, reference #123129 is located in coordinate (xi, yi)

You can then link every order line to a geographical location for picking.

Order lines from your Warehouse Management System (WMS)

A database schema showing relationships between four entities: MasterData, LayoutCoordinates, Orderlines, and another unnamed table. MasterData includes fields like ReferenceID, ReferenceName, and StorageLocation. LayoutCoordinates includes StorageLocation, CoordinateX, and CoordinateY. The schema illustrates how storage locations are mapped with coordinates, and order lines are linked to product references and destinations to optimize warehouse operations.
(6) Database Schema — (Image by Author)

Order lines can be extracted from your WMS Database.

This table should be joined with the Master Data table to link every order line to a storage location and its (x, y) coordinate in your warehouse.

Extra tables can be added to include more parameters in your model, like (Destination, Delivery lead time, Special Packing, ..).

Now that we have the locations of our items, we need functions to calculate the walking distance for a specific order.

What is the distance between two picking locations?

Function 1: Calculate the distance between two picking locations

Let us assume that your operator needs to pick a box in the location j and another two boxes in the location I.

A warehouse layout showing aisles A01 to A19 with shelves arranged in each aisle. Two picking locations, (xi, yi) and (xj, yj), are marked in red and blue, respectively, along with a dashed box highlighting the operator’s picking path between these two locations. The walking route is illustrated with lines, showing how the operator moves between the two points to retrieve items from the shelves. The objective is to calculate the walking distance between the two picking locations (i and j).
(5) Different routes between two storage locations in the warehouse — (Image by Author)

This function calculates the walking distance between points i (xi, yi) and j (xj, yj).

Objective: return the shortest walking distance between the two potential routes from point i to point j.

Parameters

y_low: the lowest point of your alley (y-axis)
y_high: highest point of your alley (y-axis)

Code

Now, we can calculate the distance between locations I and J.

Now that the operator picked in location I, to which location should she go?

Function 2: The Next Closest Location

We assume that your operator picked a box in the location

A warehouse layout with shelves organized in aisles A01 to A19. The image highlights several picking locations labeled with coordinates (xi, yi), (xj, yj), (xk, yk), and (xh, yh) marked in red and black. The operator’s current position is at the red location (xi, yi), and the dashed path illustrates the walking route to pick items from the next closest black location (xj, yj). The objective is to find the shortest route between multiple picking locations to improve warehouse productivity.
(6) Next Storage Location Scenario — (Image by Author)

This function will help you choose the next location among several candidates to continue your picking route.

Objective: return the closest location as the best candidate

(**) We will see later that this choice will impact overall productivity.

Code

Function 3: Create your picking route and calculate the total walking distance

This function will create your picking route from a set of orders to prepare.

  • Input: a list of (x, y) locations based on items to be picked for this route
  • Output: an ordered sequence of locations covered and total walking distance

Code

Now that we have the tools to locate the locations and measure the distances, we need to implement a strategy to group orders.

What if we prepare ten orders per picking wave?

Function 1: Create batches of n orders to be picked at the same time

Let us create a function that will group orders by batch.

For each batch, the total walking distance of the picking route will be calculated.

  • Input: order lines data frame (df_orderlines), number of orders per wave (orders_number)
  • Output: data frame mapped with wave number (Column: WaveID), the total number of waves (waves_number)

Code

We now have our waves.

We must create IDs and store their locations in lists.

Function 2: Listing picking locations of wave_ID picking route

  • Input: order lines data frame (df_orderlines) and wave number (waveID)
  • Output: list of locations i(xi, yi) included in your picking route

Code

👉You can find the complete code in my GitHub repository: Link

There are now all the Lego parts to build our simulation engine to answer the question:

What is the best number of orders per wave to minimize the total distance?

🏫 Discover 70+ case studies using data analytics for supply chain optimization 🚚and business profitability 💵 in this Cheat Sheet

Results of the simulation

Initial Experiment

After setting up all necessary functions to measure picking distance, we can test our picking route strategy with picking order lines.

Here, we first decided to start with a straightforward approach

  • Orders Waves: Orders are grouped by chronological order of receiving time from OMS ( TimeStamp)
  • Picking Route: The picking route strategy follows the Next Closest Location logic

To estimate the impact of wave picking strategy on your productivity, we will run several simulations with a gradual number of orders per wave:

  1. Measure Total Walking Distance: how much is walking distance reduced when the number of orders per route increases?
  2. Record Picking Route per Wave: recording the sequence of locations per route for further analysis

Code

A bar chart titled “Analysis Total Picking Route Distance = f(orders/wave)” showing the total routing distance in meters on the y-axis and the number of orders per wave on the x-axis (from 1 to 9). Each bar represents the total picking route distance for a corresponding number of orders in a wave. The chart shows a clear decrease in the total routing distance as the number of orders per wave increases, with the highest distance recorded for one order per wave.
(8) Results for 5,000 order lines with a ratio from 1 to 9 orders per route — (Image by Author)

We steeply decrease the distance when we move from one to two orders per wave.

From six orders per wave, the reduction of distance becomes more negligible.

What are the limits of this approach?

Exploring other batching strategies

This solution is far from being the most optimal.

Therefore, I have introduced more advanced strategies in the following articles of the series:

  • We can group orders by geographical clusters of Picking Locations to reduce pickers’ walking distance.
  • The next closest location strategy has its limits that can be easily pointed out by picking route records

The final solution can mix these three strategies to minimize the walking distance and improve productivity.

Do you want to implement this solution?

Check the source code in my GitHub repository 👇

About Me

Let’s connect on Linkedin and Twitter. I am a Supply Chain Engineer who uses 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 you are interested in Data Analytics and Supply Chain, look at my website.

💌 New articles straight in your inbox for free: Newsletter
📘 Your complete guide for Supply Chain Analytics: Analytics Cheat Sheet

--

--

TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Samir Saci

Written by Samir Saci

Top Supply Chain Analytics Writer — Case studies using Data Science for Supply Chain Sustainability 🌳 and Productivity: https://bit.ly/supply-chain-cheat