Procurement Process Optimization with Python | by Samir Saci | Towards Data Science

Procurement management is a strategic approach to acquiring goods or services from preferred vendors, within your determined budget, either on or before a specific deadline.
Your target is to balance supply and demand in a manner to ensure a minimum level of inventory to meet your store 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)
SUMMARYI. ScenarioAs a Supply Planning manager you need to optimize inventory allocation to reduce transportation costs.II. Build your Model1. Declare your decision variablesWhat are you trying to decide?2. Declare your objective functionWhat do you want to minimize?3. Define the constraintsWhat are the limits in resources?4. Solve the model and prepare the resultsWhat is the suggestion of the model?III. Conclusion & Next Steps
As a Store Manager of a mid-size retail location, you are in charge of setting the replenishment quantity in the ERP.
For each SKU, when the inventory level is below a certain threshold your ERP is sending an automatic Purchase Order (PO) to your supplier.
You need to balance with the constraints of stock capacity, transportation costs and cost of inventory to fix 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 expenseNote: we’ll not consider any lead time in this article
60 active stock-keeping units (SKU) 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-size business, we suppose that 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 taking the average value per year. We will not pay for the empty locations.
Imax= 480Rmonth= 2,000 $/Month
Question
Which Quantity per replenishment Qi should you set in the ERP to minimize the total costs?
Unlike the previous article of the series, we won’t use PuLP as we are not in a linear programming problem. We will be using the SciPy optimization functions to solve this non-linear minimization problem.
You can find the full code in this Github (Follow Me :D) repository: Link.My portfolio with other projects: Samir Saci
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 to have a replenishment case quantity that is not an integer.
What do you want to minimize?
The purchasing cost itself is not included in the objective function as it is out of the scope of our optimization targets.
Code
What are the limits in resources that will determine your feasible region?
This is where problems start as we have a non-linear constraint (1/Ri).
What are the results of your simulation?
Initial Guess
Unlike Linear Programming, we need to provide an initial vector of a potential solution to the algorithm for the first iteration to initiate it.
Here, we’ll assume that 2 replenishments per year for all SKUs could be a good candidate.
$63,206.7 total cost for initial guessingHopefully the optimal solution will be lower
Solve
Comment
I could not find any method to implement Integer Non-Linear Programming using Scipy solvers. If you have a solution, better than this quick-and-dirty rounding, using another library of python, can you please share it in the comment section?
For 100 Iterations-> Initial Solution: $28,991.9-> Integer Solution: $29,221.3 with a maximum inventory of 356 cartons
This optimized solution is 56% better than the initial guess of 2 replenishment per year for all references.
What if we have a stochastic distribution of your demand and we want to avoid stock-outs? In the article below, you can find a simple methodology to build replenishment rules assuming a stochastic distribution of your demand.
www.samirsaci.com
We can see here that our solution is mainly driven by transportation costs as we have a maximum stock of 356 boxes.
In the next article, we will perform an exploratory data analysis to understand the distribution of our decision variables and understand what drove the results for each reference.
We’ll also try to understand what is the impact of the transformation from continuous to integer decision variables.
Finally, we’ll try several scenarios to see how the model reacts:
High rental costs and low transportation costs
Non-linear purchasing costs
Higher Minimum Order Quantity
Please feel free to contact me, I am willing to share and exchange on topics related to Data Science and Supply Chain.My Portfolio: https://samirsaci.com
[1] SciPy Optimization Library, Official Documentation, Link
[2] Samir Saci, Supply Planning using Linear Programming with Python, Link