Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

WorkedExamplesforChapter10

Example1forSection10.3
TheBuildEmFastCompanyhasagreedtosupplyitsbestcustomerwiththreewidgits
duringeachofthenext3weeks,eventhoughproducingthemwillrequiresomeovertime
work.Therelevantproductiondataareasfollows:

MaximumProduction, MaximumProduction, ProductionCostperUnit


Week RegularTime Overtime RegularTime
1 2 2 $300
2 3 2 $500
3 1 2 $400

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,

pn ( sn , xn ) = cn xn + 100 max(0, xn rn ) + 50 max(0, sn + xn 3) .

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.

fn ( sn ) = 3smin [ pn ( sn , xn ) + fn*+1 ( sn + xn 3)] ,


*
n x m
n n

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:

x2 f2(s2,x2)=p2(s2,x2)+f3*(s2+x23) f2*(s2) x2*


s2 0 1 2 3 4 5
0 2,900 3,050 3,200 2,900 3
1 2,400 2,450 2,600 2,850 2,400 2
2 1,900 1,950 2,000 2,250 2,900 1,900 1
3 1,400 1,450 1,500 1,650 2,300 2,950 1,400 0

Forn=1:

x1 f1(s1,x1)=p1(s1,x1)+f2*(s1+x13) f1*(s1) x1*


s1 0 1 2 3 4
2 3,200 3,050 3,000 2,950 2,950 4

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:

Atstage1,wemaximizef1(2,x1)= x12 ( f 2* (2 x12 )) = x12 (2 x12 ) ,


subjectto
x 21 2.

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.

Since f 1 (2,1) = f1 (2,1) =1,whereasf(2, 2 )=0attheendpointsofthefeasible


region,wehaveboth x1* =1and x1* =1asglobalmaximizersand f1* ( 2) = 1.
Hence,theoptimalsolutionsare ( x1* , x 2* ) =(1,1),and ( x1* , x 2* ) =(1,1)withanoptimal
objectivefunctionvalueofZ=1.

You might also like