Professional Documents
Culture Documents
Worked Examples For Chapter 10
Worked Examples For Chapter 10
Example1forSection10.3
TheBuildEmFastCompanyhasagreedtosupplyitsbestcustomerwiththreewidgits
duringeachofthenext3weeks,eventhoughproducingthemwillrequiresomeovertime
work.Therelevantproductiondataareasfollows:
Thecostperunitproducedwithovertimeforeachweekis$100morethanforregular
time.Thecostofstorageis$50perunitforeachweekitisstored.Thereisalreadyan
inventoryoftwowidgetsonhandcurrently,butthecompanydoesnotwanttoretainany
widgetsininventoryafterthe3weeks.
Managementwantstoknowhowmanyunitsshouldbeproducedineach
weektominimizethetotalcostofmeetingthedeliveryschedule.
Letussolvethisbyusingdynamicprogramming.
ApplicationofDynamicProgramming
Thedecisionsthatneedtobemadearethenumberofunitstoproduceeachweek,
sothedecisionvariablesare
xn=numberofwidgetstoproduceinweekn,forn=1,2,3.
Tochoosethevalueofxn,itisnecessarytoknowthenumberofwidgetsalreadyonhand
atthebeginningofweekn.Therefore,thestateofthesystemthenis
sn=numberofwidgetsonhandatthebeginningofweekn,forn=1,2,3.
Becauseoftheshipmentofthreewidgetstothecustomereachweek,notethat
sn+1=sn+xn3.
Alsonotethattwowidgetsareonhandatthebeginningofweek1,so
s1=2.
Tointroducesymbolsforthedatagivenintheabovetableforeachweekn,let
cn =unitproductioncostinregulartime,
rn =maximumregulartimeproduction,
mn =maximumtotalproduction.
Thecorrespondingdataaregiveninthefollowingtable.
n rn mn cn
1 2 4 300
2 3 5 500
3 1 3 400
Wewishtominimizethetotalcostofmeetingthedeliveryschedule,soour
measureofperformanceistotalcost.Forn=1,2,3,let
pn(sn,xn)=costincurredinweeknwhenthestateissnandthedecisionisxn.
Thus,
UsingthenotationinSec.10.2,let
fn* (sn)=optimalcostforweeknonward(throughtheendofweek3)when
startingweekninstatesn,forn=1,2,3.
Givensn,thefeasiblevaluesofxnaretheintegerssuchthatxnmnandxn3sn
(assumingsn3)inordertoprovidethecustomerwith3widgetsinweekn.Thus,
becausesn+1=sn+xn3,theoptimalvalueofxn(denotedby x*n )isobtainedfromthe
followingrecursiverelationship.
where
f 4* (s4)=0 fors4=0.
Recallthatthecompanydoesnotwanttoretainanywidgetsininventoryafterthe
threeweeks,sos4=0.Therefore,theoptimalpolicyforweek3obviouslyistoproduce
justenoughwidgetstohaveatotalofthreetoshiptothecustomer,so
x*3 =3s3.
Given x*3 and f3* (s3),wecanusetherecursiverelationshiptosolvefortheoptimalpolicy
forweek2andthenforweek1.Thesecalculationsareshownbelow.
Forn=3:
s3 f3*(s3) x3*
0 1,400 3
1 900 2
2 400 1
3s3 0 0
Forn=2:
Forn=1:
Hence,theoptimalplanistoproducefourwidgetsinperiod1,storethreeofthemuntil
period2,andproducethreeinperiod3,withatotalcostof$2,950.
Example2forSection10.3
Considerthefollowingnonlinearprogrammingproblem:
Maximize Z= x12 x2 ,
subjectto
2 3
x1 + x2 2.
(Therearenononnegativityconstraints.)Letususedynamicprogrammingtosolvethis
problem.
ApplicationofDynamicProgramming
Letx1bethedecisionvariableatstage1andx2bethedecisionvariableatstage2.
Thekeytoapplyingdynamicprogrammingtothisproblemistointerpretthe
righthandsideoftheconstraintastheamountofaresourcebeingmadeavailableto
activities1and2(whoselevelsarex1andx2).Thenthestateofthesystementeringstage
1(beforechoosingx1andx2)andenteringstage2(beforechoosingx2)istheamountof
theresourcestillavailableforallocationtotheremainingactivities.Consequently,letting
sndenotethestateofthesystementeringstagen,wehave
s1=2ands2=2 x12 .
Forn=2:
Atstage2,wesolvethefollowingproblemwithvariablex2:
Maximizef2(s2,x2)=x2,
subjectto
x2s2.
Theoptimalsolutionis x 2* = s 2 ,with f 2* ( s 2 ) = s 2 .
Forn=1:
f1(2,x1 )
= 4x13 + 4x1 = 0 x1=1,1 arelocalmaxima.
x1
2 f 1 ( 2, x1 )
= 4(1 3x12 ) <0forx1=1,1.
x1 2
Hence, f 1 ( 2, x1 ) islocallyconcavearoundx1=1andx1=1.