Optimizing Supply Chain Logistics with Python: A Real-World Example
Let’s solve a realistic supply chain optimization problem using $Python$ and the $PuLP$ library.
The goal is to minimize the total cost of transporting goods from multiple warehouses to multiple stores while considering supply and demand constraints.
Problem Statement:
- We have $3$ warehouses, each with a limited supply of goods.
- We have $5$ stores, each with a specific demand for goods.
- Transportation costs between warehouses and stores are given.
- We want to determine the optimal number of goods to transport from each warehouse to each store to minimize the total transportation cost.
Python Code:
1 | import pulp as pl |
Explanation:
- The code defines a linear programming problem using $PuLP$, where the objective is to minimize the transportation costs.
- We define the decision variables, objective function, and constraints, and then solve the problem using the
solve()
method. - Finally, the code prints the optimal transportation plan and the total cost.
This example solves a supply chain optimization problem with realistic constraints, demonstrating the power of $Python$ in handling such tasks.
Explanation of Results
1 | Status: Optimal |
The result indicates that the supply chain optimization problem was successfully solved, and the solution is $optimal$.
Here’s a detailed explanation of the output:
Status: Optimal
This means that the solver found the best possible solution, minimizing the total transportation cost while satisfying all constraints (supply and demand).
Transportation Plan:
- Transport 30.0 units from W1 to S1: Warehouse W1 will send $30$ units of goods to Store S1.
- Transport 20.0 units from W1 to S4: Warehouse W1 will send $20$ units of goods to Store S4.
- Transport 50.0 units from W2 to S1: Warehouse W2 will send $50$ units of goods to Store S1.
- Transport 100.0 units from W2 to S5: Warehouse W2 will send $100$ units of goods to Store S5.
- Transport 70.0 units from W3 to S2: Warehouse W3 will send $70$ units of goods to Store S2.
- Transport 90.0 units from W3 to S3: Warehouse W3 will send $90$ units of goods to Store S3.
- Transport 40.0 units from W3 to S4: Warehouse W3 will send $40$ units of goods to Store S4.
Total Cost: $1910.0
The total transportation cost for moving the goods from all the warehouses to the stores, based on the above transportation plan, is $1910.
Interpretation:
- The solution satisfies all the supply constraints (ensuring that no warehouse ships more than its available supply) and all the demand constraints (ensuring that each store receives the exact amount it needs).
- The total transportation cost of $1910 is the minimum possible cost given the constraints and transportation costs between warehouses and stores.