CH 18
CH 18
JOHN S. LOUCKS
St. Edward’s University
© 2003 Thomson/South-Western 1
Slide
Chapter 18
Dynamic Programming
© 2003 Thomson/South-Western 2
Slide
Dynamic Programming
© 2003 Thomson/South-Western 3
Slide
Dynamic Programming
© 2003 Thomson/South-Western 4
Slide
Dynamic Programming Notation
© 2003 Thomson/South-Western 5
Slide
Backwards Recursion
© 2003 Thomson/South-Western 6
Slide
Three Applications of Dynamic
Programming Problems
Shortest Route Problem
In solving a shortest route problem using
dynamic programming, one should consider the
network as a series of stages with a unique subset of
nodes corresponding to each stage. The state
variables correspond to the different nodes at each
stage.
© 2003 Thomson/South-Western 7
Slide
Three Applications of Dynamic
Programming Problems
Knapsack or Cargo Loading Problem
The knapsack problem seeks to determine the
optimal number of each of N items (which must not be
fractional) to select in order to maximize profit subject to
an overall capacity constraint. In solving a knapsack
problem using dynamic programming, the stages
correspond to the different items being placed into a
knapsack. The state variables correspond to the capacity
available at the stage.
© 2003 Thomson/South-Western 8
Slide
Three Applications of Dynamic
Programming Problems
Production and Inventory Control Problems
In production and inventory control problems, the
stages correspond to time periods and the state
variables generally will refer to the amounts of
inventory on hand at the beginning of each stage.
© 2003 Thomson/South-Western 9
Slide
Example: Dicom Corporation
© 2003 Thomson/South-Western 10
Slide
Example: Dicom Corporation
Cost of Maximum
Production Production Sales
Per Machine Level Demand
Month (in $100,000's) for Month (in Units)
August 32 4 2
September 18 3 1
October 26 4 5
November 45 5 3
© 2003 Thomson/South-Western 11
Slide
Example: Dicom Corporation
© 2003 Thomson/South-Western 12
Slide
Example: Dicom Corporation
© 2003 Thomson/South-Western 13
Slide
Example: Dicom Corporation
xn-1 = xn + dn - Dn
© 2003 Thomson/South-Western 14
Slide
Example: Dicom Corporation
Return Function
rn(xn,dn) = (Production cost) + (Holding cost) for month n
Production cost = (Production cost per unit)
x (Number of units produced in month n)
Holding cost = (Holding cost per unit)
x (Ending inventory for month n)
© 2003 Thomson/South-Western 15
Slide
Example: Dicom Corporation
© 2003 Thomson/South-Western 16
Slide
Example: Dicom Corporation
Restrictions on xn and dn
•Restriction (1)
Because backordering is not allowed, we must be
able to meet the sales demand in any month.
xn + dn > Dn
© 2003 Thomson/South-Western 17
Slide
Example: Dicom Corporation
xn + dn - Dn < Wn
or
xn + dn < Wn + Dn
© 2003 Thomson/South-Western 18
Slide
Example: Dicom Corporation
dn < Pn
© 2003 Thomson/South-Western 19
Slide
Example: Dicom Corporation
© 2003 Thomson/South-Western 20
Slide
Example: Dicom Corporation
Stage 1 (November)
Because f0(x0) = 0 is a boundary condition:
© 2003 Thomson/South-Western 21
Slide
Example: Dicom Corporation
d1
x1 0 1 2 3 4 5 d1* f1(x1)
0 135 185 235 3 135
1 90 140 190 240 2 90
2 45 95 145 195 245 1 45
3 0 50 100 150 200 250 0 0
© 2003 Thomson/South-Western 22
Slide
Example: Dicom Corporation
Stage 2 (October)
© 2003 Thomson/South-Western 23
Slide
Example: Dicom Corporation
d2
x2 0 1 2 3 4 d2* f2(x2) x2+d2*-5 = x1
1 239 4 239 0
2 213 199 4 199 1
3 187 173 159 4 159 2
4 161 147 133 119 4 119 3
5 135 121 107 93 3 93 3
6 95 81 67 2 67 3
7 55 41 1 41 3
8 15 0 15 3
Note: x2= 0 is infeasible.
© 2003 Thomson/South-Western 24
Slide
Example: Dicom Corporation
Stage 3 (September)
© 2003 Thomson/South-Western 25
Slide
Example: Dicom Corporation
© 2003 Thomson/South-Western 26
Slide
Example: Dicom Corporation
Stage 4 (August)
f4(x4) = Min 5x4 + 37d4 - 10 + f3(x3)
d4
© 2003 Thomson/South-Western 27
Slide
Example: Dicom Corporation
d4
x4 0 1 2 3 4 d4* f4 (x4 ) x4+d4*-2 = x3
© 2003 Thomson/South-Western 28
Slide
Example: Dicom Corporation
Solution Summary
Working backwards through the tables, one can
determine the optimal solution that gives the minimum
cost of $327 x 100,000 = $32,700,000.
Inventory On-
Hand Beginning
Stage Month Produce (dn*) Next Month xn-1
4 August 2 0
3 September 3 2
2 October 4 1
1 November 2 0
© 2003 Thomson/South-Western 29
Slide
End of Chapter 18
© 2003 Thomson/South-Western 30
Slide