Procurement Process Optimization with Python
Use non-linear programming to find the optimal ordering policy that minimizes capital, transportation and storage costs
Procurement management is a strategic approach to acquiring goods or services from preferred vendors within your defined budget, on or before a specific deadline.
Your supply and demand require a minimum level of inventory to meet your store's demand.
In this article, we will present a simple methodology using Non-Linear Programming to design an optimal inventory replenishment strategy for a mid-size retail store, considering:
- Transportation Costs from the Supplier Warehouse to the Store Reserve ($/Carton)
- Costs to finance your inventory (% of inventory value in $)
- Reserve (Store’s Warehouse) Rental Costs for storage ($/Carton)
💌 New articles straight to your inbox for free: Newsletter
I. Scenario
As a Supply Planning manager, you need to optimize inventory allocation to reduce transportation costs.
II. Build your Model
1. Declare your decision variables
What are you trying to decide?
2. Declare your objective function
What do you want to minimize?
3. Define the constraints
What are the limits in resources?
4. Solve the model and prepare the results
What is the suggestion of the model?
III. Conclusion & Next Steps
Scenario
Problem Statement
As a Store Manager at a mid-sized retail location, you are responsible for setting replenishment quantities in the ERP.
For each SKU, when the inventory level is below a certain threshold, your ERP sends an automatic Purchase Order (PO) to your supplier.
You need to balance stock capacity, transportation costs, and inventory costs to determine the right quantity for your PO.
- 1 supplier that receives your orders via EDI connection (with your ERP) and ships them using a 3rd Party Transportation company at your expense
- 60 active stock-keeping units (SKUs) with a purchasing price ($/carton) and a yearly sales quantity (Cartons/year)
- Transportation using a 3rd party company that operates parcel delivery, invoiced per carton ($/Carton)
- Storage Location (Store’s Reserve) with a capacity of 480 boxes stored on shelves

To simplify the comprehension, let’s introduce some notations

Annual Demand per SKU
Transportation

b = 42.250 $
A = -0.3975 $/Carton
Costs of Capital

As a mid-sized business, we assume your cost of capital is quite high: 12.5%.
Storage Costs

In this model, we suppose that we have the best landlord in the world.
She invoices us by carton-occupied, using the average value per year.
We will not pay for the empty locations.
Imax= 480
Rmonth= 2,000 $/Month
Question
Which Quantity per replenishment Qi should you set in the ERP to minimize the total costs?
Build your Model
Unlike the previous article in the series, we won’t use PuLP because this isn't a linear programming problem.
We will use SciPy's optimisation functions to solve this non-linear minimisation problem.
Declare your decision variables
What are you trying to decide?
We want to set the quantity per replenishment order sent by our ERP to the supplier.

However, to simplify our calculation we will use the number of replenishment per year Ri as a decision variable.

The replenishment quantity will be calculated using the formula below.
Note: We accept a replenishment case quantity that is not an integer.
Declare your objective function
What do you want to minimise?

The purchase cost is not included in the objective function, as it falls outside the scope of our optimisation targets.
Code
Define the constraints
What are the limits on resources that will determine your feasible region?

This is where problems start, as we have a non-linear constraint (1/Ri).

Solve the model and prepare the results
What are the results of your simulation?
Initial Guess
Unlike Linear Programming, we need to provide an initial vector for a potential solution to the algorithm in the first iteration.
Here, we’ll assume 2 replenishments per year for all SKUs is a viable option.
Solve
Initial Solution: $28,991.9
Integer Solution: $29,221.3 with a maximum inventory of 356 cartons
Conclusion
This optimized solution is 56% better than the initial guess of 2 replenishment per year for all references.
We can see that our solution is primarily driven by transportation costs, with a maximum stock of 356 boxes.
Are you familiar with inventory management?
This solution can be integrated with inventory management policies to provide a comprehensive solution for purchasing and storing products.
For more details, I have a complete tutorial.
About Me
Let’s connect on LinkedIn and Twitter. I am a Supply Chain Engineer who is using data analytics to improve logistics operations and reduce costs.