15-11 Inventory planning
The Rinky Dink Company makes machines that resurface ice rinks. The demand for such products varies from month to month, and so the company needs to develop a strategy to plan its manufacturing given the fluctuating, but predictable, demand. The company wishes to design a plan for the next months. For each month , the company knows the demand , that is, the number of machines that it will sell. Let be the total demand over the next months. The company keeps a full-time staff who provide labor to manufacture up to machines per month. If the company needs to make more than machines in a given month, it can hire additional, part-time labor, at a cost that works out to dollars per machine. Furthermore, if, at the end of a month, the company is holding any unsold machines, it must pay inventory costs. The cost for holding machines is given as a function for , where for and for .
Give an algorithm that calculates a plan for the company that minimizes its costs while fulfilling all the demand. The running time should be polyomial in and .
Our subproblems will be indexed by and integer and another integer . will indicate how many months have passed, that is, we will restrict ourselves to only caring about . will indicate how many machines we have in stock initially. Then, the recurrence we will use will try producing all possible numbers of machines from to . Since the index space has size and we are only running through and taking the minimum cost from many options when computing a particular subproblem, the total runtime will be .