Fatih Pense's Blog

Recursive Dynamic Programming Example (Operations Research)

Wednesday, December 21st, 2022


ItΔ±r Co. has announced the introduction of an exciting new perfume. The product manager wants to plan for the next 𝑇 months. The productivity rate of each worker is 𝑝 bottles of perfume per month. Perfume can be stored from one month to the next, but due to spoilage and pilferage, there is π‘š% loss. (So, for each 100 bottles stored in month 𝑑, only (100 βˆ’ π‘š) βˆ™ 100% bottles are available in month 𝑑 + 1.) Initially, there are 𝑛 workers; each month, additional workers may be hired if needed, fired if not needed, or kept on the payroll but left idle. Workers left idle have a tendency to quit, and the attrition rate is π‘ž%. (Hence, for each 100 workers left idle in month 𝑑, only (100 βˆ’ π‘ž) βˆ™ 100% of them choose to remain on the work force at month 𝑑 + 1.) For each month 𝑑, unit costs are for workers engaged in production, for workers left idle, for hiring workers, for firing workers, and for the inventory of bottles at the end of the month. The expected sales of this new perfume in month 𝑑 is bottles. Formulate a dynamic programming recursion that will identify a minimum-cost employment and production plan.


The last stage:


  • : workers remaining from previous stage
  • : bottles of inventory remaining from previous stage

Decisions for each stage

  • : how many workers to produce perfume
  • : how many workers to hire
  • : how many workers to fire


  • : workers engaged in production
  • : workers left idle
  • : hiring cost
  • : firing cost
  • : inventory cost

Next state

Worker count

: workers engaged in production and percentage of idle workers

Inventory for perfumes

: percentage of perfumes, previous inventory + produced - sales