Containers Loading Optimization with Python 📦
How can we use heuristic algorithms to find the right strategy to load a maximum number of pallets in a sea container?
Youtube Video
Find in the link below a short animated explained video to understand the concept behind this solution
Article
In this Article, we will build a container loading optimization model using a heuristic method from a Python library.
Experiment
Scenario
You need to load in a 40' Container
- 20 European Pallets 80 x 120 (cm)
- 4 North American Pallets 100 x 120 (cm)
Tentative 1: The Intuitive solution

Results: 20/20 Euro Pallets loaded, 2/4 American pallets loaded. You need another container for the two remaining pallets.
Tentative 2: The Optimization Algorithm Result
Results: 20/20 Euro Pallets loaded, 4/4 American pallets loaded. You don’t need another container.
Code
This repository code you will find all the code used to explain the concepts presented in the article.
About me 🤓
Senior Supply Chain and Data Science consultant with international experience working on Logistics and Transportation operations. \ For consulting or advising on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting. \ For more case studies, have a look at my personal blog: Personal Website