Monitor Transportation Networks with Python Visualizations
Create visualisations to monitor logistics network performance with KPIs including deliveries/routes, cost per ton, and truck size.
Given the current economic environment, reducing road transportation is critical to supply chain operations and represents a high cost to the company.
Moreover, the pressure to reduce CO2 emissions pushes companies to optimise their transportation networks.
Before optimizing, how can we use python to build descriptive analytics tools to assess the performance?
We can use Python to process data from Logistics systems (WMS, TMS) and build visuals with key performance indicators.
In this article, we will explore how to use Python to build visualisations that we use in the Logistics industry to assess the efficiency of road transportation operations.
This will include:
- Process and analyse transactional data
- Improve visibility into current routing and truck loading rates
- Simulate multiple routing scenarios to estimate the impact on the average cost per ton
Summary
I. Build a Transport Plan with Python
1. Problem Statement
2. Objective: Reduce the Cost per Ton
II. Understand the Situation with Python Visualization
1. Import Datasets
2. Listing of stores delivered by each route
3. Add cities covered by each route
III. Automate the visualization of Transport Plans
1. Transportation Plan Visualisation
2. Geographical Visualization of Store Deliveries
IV. Next Steps
1. Generative AI - Transportation Control Tower Powered by GPT
2. Measure the Environmental Impact
3. Routing Optimization: Graph Theory
4. Do you want to generate animated graphs?Visualize your Transport Plan with Python
To assess the efficiency of our transportation operations, we will follow this approach:
- Processing Data: Extracting and structuring transportation records to create an optimisation model.
- Improving Visibility: Leveraging Python visualisation libraries to clarify routing and truck loading rates.
- Simulating Scenarios: Developing a model to test various routing scenarios and assess their impact on average cost per ton.”
Imagine that you are working for a distribution center delivering 60 hypermarkets in your region.
What do we want to achieve? Minimize the cost per ton.
Problem Statement
Let us put ourselves in my shoes: in 2017, when I was a Supply Chain Solutions manager in charge of reengineering a warehouse for a retailer in Shanghai.
Retailer’s Logistics Director: “Samir, we need to reduce transportation costs by 20%.”
My customer, the retail company’s logistic director, is not happy about the overall cost to distribute his stores.
For that, we need optimise the routing of Full Truck Load (FTL) operations to deliver to stores:
- 1 Warehouse delivering stores by using three types of Trucks
(3.5T, 5T, 8T) - 49 Stores delivered
- 12 Months of Historical Data with 10,000 Deliveries
- 7 days a week of Operations
- 23 Cities
- 84 Trucks in your fleet
The objective is to use fewer trucks by increasing the cargo per route.
How can we achieve this? Shipment consolidation.
To understand why, you can check the pricing of our 3rd party carriers that charge full trucks per destination:
If we increase the number of stores covered per route, we can fully utilize larger trucks and lower the cost per ton.
This is the only way to do that without impacting our margin.
The table below proves my point as it shows the rates applied by carriers for each city delivered for each type of truck.
Observing that costs per ton are lower for larger trucks, we want to cover the maximum number of stores per route.
Assess the performance with Python Visualizations
Now that we know what we want to do, let’s have a look at the data.
What data is available for us?
Import Transactional Data From Systems
We have on hand unstructured data from several sources.
Our job is to process these data frames to calculate the performance indicators of our network.
Dataset 1: Deliveries per Store
Dataset 2: Store Address
Dataset 3: Transportation Costs
Transformation 1: Listing of stores delivered by each route
We will use the initial data frame to list all stores delivered for each route.
1 Route = 1 Truck ID + 1 Date
Transformation 2: Add cities covered by each route.
We can now add the cities covered by each route to calculate the transportation costs invoiced by our carriers:
Great, now we have enough data to build our first visualisation of the percentage of deliveries per truck size.
What can we learn from these visuals?
- Average Truck Size: We have a large majority of small trucks in the past shipments, which can explain the high costs
- Cost per ton: the inverse proportion of cost per ton and average truck size
It is now clear that the high costs are linked to a low efficiency of our transportation planning.
Thanks to the visual, we found our levers of optimisation.
Find more inspiration for smart visualizations in this tutorial,
Visualize Transportation Plans with Python
These indicators show, at a macro level, that the planning is inefficient.
However, it does not provide any detail about the root cause and which plans are “not optimal”.
For that, we can create additional visuals.
Transportation Plan Visualisation
We want a simple visualisation of all deliveries per day with a focus on the number of different routes.
Solution: Python’s Matplotlib grid function
- Columns: 1 Column = 1 Store
- Rows: 1 Row = 1 Day
- Colour = White: 0 Delivery
- Colours: 1 Color = 1 Route (1 Truck)
What can we learn from this visual?
Visual Insights
- Delivery Frequency: n deliveries per week
- Number of Routes: How many different colours do you have daily?
- Colour = White: no delivery
- Routes: Do we have the same stores grouped from one day to another?
To simplify.
If we have too many colours and not enough squares per colour, that means we don’t do a good job.
12 Months Overview
After optimisation, this chart can help us to visualise the impact of the new routing easily.
A better routing means fewer daily routes, so you’ll have fewer colours per line.
Can we have something more concrete?
Geographical Visualisation of Store Deliveries
To link each colour or square to a geographical location, we can use maps.
Let us generate a visualisation of geographical locations delivered on the same route.
Visualisation of the different routes covered per day
Next Steps
Transportation management teams can use these visualisations to pilot their operations and challenge the status quo.
Can we develop prescriptive solutions to support the transportation operational teams?
As we have extracted and formatted data from multiple systems, we can exploit this source of insights using advanced analytics solutions.
For example, have you heard about Graph Theory?
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.
📘 Your complete guide for Supply Chain Analytics: Analytics Cheat Sheet
💌 New articles straight to your inbox for free: Newsletter
