Robust Supply Chain Networks with Monte Carlo Simulation

Learn how Monte Carlo simulation can help design a robust supply chain network considering demand fluctuations. Get tips and code examples with Python.

Samir Saci
Towards Data Science

--

(Image by Author)

Objective

Build a simple Supply Chain Network Design methodology that considers the fluctuation of demand.

Introduction

Supply chain optimization uses data analytics to find an optimal combination of factories and distribution centres to meet your customers' demands.

The core structure of many software and solutions in the market is a Linear Programming Model.

Some of these models find the right allocation of factories to meet the demand and minimize the costs, assuming a constant demand.

What happens if the demand is fluctuating?

Your network may lose robustness, especially if you have a very high seasonality of your demand (e-commerce, cosmetics, fast fashion).

In this article, we will build a simple methodology to design a Robust Supply Chain Network using Monte Carlo simulation with Python.

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

SUMMARY
I. Supply Chain Network Design
Find the right allocation of factories to meet a global demand
II. Problem Statement
What happens if your demand is fluctuating?
1. Limits of the initial solution
Understand the robustness of the initial solution
2. Methodology of simulation
Simulate 50 scenarios based on a normal distribution of the demand
3. Analyze the results
What are the different combinations of solutions?
4. Final Solution
The most robust combination?
III. Conclusion & Next Steps
1. #GenAI: Improve the User Interface with GPT
A GPT agent that would answer questions using the simulation model
2. Move Towards a Sustainable Supply Chain
Implement objective functions aiming to reduce carbon footprint

If you prefer to watch, have a look at the video of this article

I. Methodology of Supply Chain Network Design

1. Global Supply Chain Network

As the Head of Supply Chain Management of an international manufacturing company, you want to redefine the Supply Chain Network for the next 5 years.

Supply Chain Network Problem — (Image by Author)

Demand
It starts with the demand from your customers in 5 different markets (Brazil, USA, Germany, India and Japan).

Demand in Million Units/Month — (Image by Author)

US market is driving more than half of the demand.

Supply Capacity
You can open factories in the five markets. There is a choice between low and high-capacity facilities.

(Image by Author)

Example: Low Capacity factories in the USA can produce 500,000 units/month.

Fixed Costs
If you open a facility you have fixed costs to add to your budget (Electricity, Real Estate, CAPEX, …).

(Image by Author)

High-capacity plants in India have lower fixed costs than low-capacity plants in the USA.

Variable Costs

(Image by Author)

Fixed Costs + Variable Costs = Total Costs of Production

Freight Costs
Costs to ship a container from Country XXX to Country YYY.

Freight Costs ($/Container) — (Image by Author)

Total Cost

(Image by Author)

The total cost to produce and ship products to the market.

Based on the demand of the markets, where do I need to open factories?

3. Linear Programming Model

For more details, you can find the previous reference links where I explain how to implement it using the PuLP Python library.

This is a classic problem of Linear Programming with an objective function, constraints and parameters.

(Image by Author)

Manufacturing Footprint
Where do I need to open locations?

(Image by Author)

You must open four locations in Brazil, the USA, Japan and India. Except in Brazil, all these locations are high-capacity plants.

Products Flows
How many units are produced by factory YYY for Market XXX?

(Image by Author)

Japan's factory only produces for the local market while Brazil and India are mainly driven by export demand.

💡 Follow me on Medium for more articles related to 🏭 Supply Chain Analytics, 🌳 Sustainability and 🕜 Productivity.

II. Problem Statement

You can find the source code with dummy data in my Github (Follow me :D) repository: Link
My portfolio with other projects: Samir Saci

This solution has been implemented assuming a constant demand in the markets.

1. Limits of the initial solution

What could be the impact if we have +10% in Japan and +20% in the US?

(Image by Author)

By looking at the utilization rates, you can easily guess that your current footprint will not be able to adapt to this surge of demand.

2. Methodology of Simulation

We cannot rely on a single solution and expect that our network will absorb the demand throughout the year.

Usually, these parameters are calculated based on the yearly sales average.

(Image by Author)

Let’s simulate this demand variability and see the impact on the network design.

Generate 50 scenarios

We will assume that the demand is following a normal distribution with a coefficient of variation CV = 0.5. (You can adapt the distribution to your needs)

(Image by Author)

You now have a matrix of 50 columns that represent your 50 different scenarios.

Optimal Solution for Each Scenario
What is the optimal combination for each scenario?

Boolean Plot of the results by scenario — [Create Boolean Plot with Python: Tutorial]
  • India always has at least 1 facility open
  • Scenario 16 needs all facilities to be open because of a peak in the US demand
  • Scenario 12 only needs 2 LOW capacity facilities in Brazil and India

Distribution of the optimal combinations
Do we have combinations that appear more frequently than others?

After removing duplicates, we have 16 unique combinations

Boolean Plot of the results by scenario — [Create Boolean Plot with Python: Tutorial]

Which combination seems the most robust?

Donut Plot of the occurrence by solution — [Create Donut Plot with Python: Tutorial]

The combination C2 (High/Low plants in India and Brazil + 1 High plant in Japan) appears the most. C2, C6 and C10 closely follow this combination.

4. Final Solutions

It is difficult to draft a clear conclusion, but if we choose the safe solution, we must take the C2 combination.

As it maximizes the footprint in countries with low production costs, we will surely meet the demand for most scenarios.

III. Next Steps

Follow me on Medium for more insights related to Data Science for Supply Chain.

#GenAI: Improve the User Interface with GPT

There is no perfect solution for this problem as we must balance the priority between securing the supply and reducing costs.

Using Large Language Models, we can enhance the user experience by creating an agent to interact, answer questions and challenge assumptions.

Supply Chain Control Tower Agent with LangChain SQL Agent [Article Link] — (Image by Author)

In this first article, I share my explorative journey of LLMs by showing how I designed a LangChain SQL agent connected to a database.

This automated “supply chain control tower” was able to answer basic and advanced questions by querying the database:

  • How many shipments have been delivered in the first week?
  • How many are delayed? What are the reasons?
Simple Architecture of the Solution — (Image by Author)

This solution can drive discussions around the target for stock service level and production costs.

Now that we have a set of candidates for the potential BEST solution, we can ask the agent to test them on our 50 scenarios

  • What is the total cost for each scenario?
  • What is the percentage of demand produced by our facilities?

Users can adjust assumptions and parameters using natural languages and conduct interactive brainstorming sessions with the agent.

To learn more about the prototypes of GPT-powered agents I designed, have a look at these two articles

Move Towards a Sustainable Supply Chain

As the demand for transparency in sustainable development is increasing, including environmental parameters in our model is not an option anymore.

Sustainable Supply Chain Optimization is an approach to network design combining cost-effectiveness with environmental responsibility.

Sustainable Supply Chain Optimization Problem — (Image by Author)

This topic is increasingly relevant as organizations are under pressure to reduce their carbon footprint by reshaping their supply chain networks.

💡 For more details, have a look at these articles

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 are interested in Data Analytics and Supply Chain, have a look at my website

References

--

--

Top Supply Chain Analytics Writer — Follow my journey using Data Science for Supply Chain Sustainability 🌳 and Productivity ⌛