Solving the Lot Sizing Problem in Resolver One (Wagner-Whitin Algorithm)

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:

  1. We have a single product (with the production quantity in period tX_t)
  2. Discrete Time (unlike EOQ model)
  3. Demand is known but varies over time (e.g., we have orders) d_t
  4. No shortage is allowed
  5. No capacity constraints
  6. There is a positive setup cost that might be varying over time K_t
  7. The unit production cost is constant
  8. The objective is to minimize the total setup cost and inventory costs

Here is the formulation for the model:

  1. K_t setup cost in period t
  2. h_t inventory holding cost per unit remaining at end of period t
  3. d_t demand in period t
  4. M a large number (will be used in the MIP model)
  5. X_t production quantity in period t
  6. Y_t=1 if X_t> 0 and is 0 otherwise
  7. l_t inventory remaining at the end of period t

The MIP model will be:
Minimize \sum_t K_tY_t + \sum_t h_tI_t

Subject\: to:

  1. I_t=I_{t-1}+X_t-D_t
  2. MY_t\geq X_t, \forall t
  3. I_t\geq0, \forall t
  4. Y_t \:is\: binary
  5. X_t\geq0, \forall t

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.

Update: Please see this post for an updated version and more information

~ by marksalen on September 3, 2009.

8 Responses to “Solving the Lot Sizing Problem in Resolver One (Wagner-Whitin Algorithm)”

  1. i need your help Mr, for my Thesis,,cause my Thesis Title also likes your scribd in this can i call u or always chat with you.i really dont know about my problem. plez,,help me Mr.
    this is my title :
    Integer Program Model for Resolving Issues Lot Size
    Coordinated with deterministic Dynamic Demand

    can you give me some books that relation with my title ,,Mr???ples yaaaaaaaa



  4. Hi there:

    I am an undergraduate student at SUNY Buffalo. I wanted to open the sample spreadsheet file you have posted, but it is an .RSL file, and I can’t find information about that extension online. Which program can I use to open it?


    Please email me at:

  5. Sir, how can i able to access your journals freely. As i am a Ph. D. scholar in Assam University Silchar, India.
    Thank you
    Please e-mail me at:

  6. hi,
    May I know how to open the .RSL file? Which program should I use to open these extensive file? Thanks for sharing this information.

  7. May I suggest as an alternative the SCperf package for R where the WW() function implements the Wagner-Within algorithm (forward and backward methods). Here is the link

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: