I was working on a lot sizing problem today and implemented a Wagner-Whitin algorithm in Resolver One. I just want to share it with you here. Some people use a MIP solver to solve lot sizing problems while Wagner and Whitin have devised an algorithm that can be implemented quickly on a spreadsheet and there is no need to use an expensive solver. You can download the spreadsheet from this link.
In the classical lot sizing problem we have the following assumptions:
- We have a single product (with the production quantity in period t
) - Discrete Time (unlike EOQ model)
- Demand is known but varies over time (e.g., we have orders)
- No shortage is allowed
- No capacity constraints
- There is a positive setup cost that might be varying over time
- The unit production cost is constant
- The objective is to minimize the total setup cost and inventory costs
Here is the formulation for the model:
setup cost in period tinventory holding cost per unit remaining at end of period tdemand in period ta large number (will be used in the MIP model)production quantity in period tifand is 0 otherwiseinventory remaining at the end of period t
The MIP model will be:
Wagner and Whitin have solved this problem using the forward dynamic programming. In this spreadsheet we implement the forward dynamic programming for the lot sizing problem. The spreadsheet then suggests the time period than it is optimal to pay for the setup cost, in other time periods it is cheaper to carry an inventory.