Professional Documents
Culture Documents
ExampleforSection9.3
Sarahhasjustgraduatedfromhighschool.Asagraduationpresent,herparentshave
givenheracarfundof$21,000tohelppurchaseandmaintainacertainthreeyearold
usedcarforcollege.Sinceoperatingandmaintenancecostsgouprapidlyasthecarages,
Sarah'sparentstellherthatshewillbewelcometotradeinhercaronanotherthreeyear
oldcaroneormoretimesduringthenextthreesummersifshedeterminesthatthiswould
minimizehertotalnetcost.Theyalsoinformherthattheywillgiveheranewcarinfour
yearsasacollegegraduationpresent,sosheshoulddefinitelyplantotradeinhercar
then.(Theseareprettyniceparents!)
ThetablegivestherelevantdataforeachtimeSarahpurchasesathreeyearold
car.Forexample,ifshetradesinhercaraftertwoyears,thenextcarwillbeinownership
year1duringherjunioryear,etc.
Sarah'sDataEachTimeShePurchasesaThreeYearOldCar
OperatingandMaintenanceCosts TradeinValueatEnd
Purchase forOwnershipYear ofOwnershipYear
Price 1 2 3 4 1 2 3 4
$12,000 $2,000 $3,000 $4,500 $6,500 $8,500 $6,500 $4,500 $3,000
WhenshouldSarahtradeinhercar(ifatall)duringthenextthreesummersto
minimizehertotalnetcostofpurchasing,operating,andmaintainingthecarsoverher
fouryearsofcollege?
(a)Formulatethisproblemasashortestpathproblem.
Thefollowingfigureshowsthenetworkformulationofthisproblemasashortest
pathproblem.Nodes1,2,3,and4aretheendofSarah'syear1,2,3,and4ofcollege,
respectively.Node0isnow,beforestartingcollege.Eacharcfromonenodetoasecond
nodecorrespondstotheactivityofpurchasingacaratthetimeindicatedbythefirstof
thesetwonodesandthentradingitinatthetimeindicatedbythesecondnode.Sarah
beginsbypurchasingacarnow,andsheendsbytradinginacarattheendofyear4,so
node0istheoriginandnode4isthedestination.
25,000
17,000
10,500
10,500
(Origin) 0 1 2 3 4 (Destination)
5,500 5,500 5,500 5,500
10,500
17,000
Thenumberofarcsonthepathchosenfromtheorigintothedestinationindicates
howmanytimesSarahwillpurchaseandtradeinacar.Forexample,considerthepath
0 1 3 4
Thiscorrespondstopurchasingacarnow,thentradingitinattheendofyear1to
purchaseasecondcar,thentradinginthesecondcarattheendofyear3topurchasea
thirdcar,andthentradinginthisthirdcarattheendofyear4.
SinceSarahwantstominimizehertotalnetcostfromnow(node0)totheendof
year4(node4),eacharclengthneedstomeasurethenetcostofthatarc'scycleof
purchasing,maintaining,andtradinginacar.Therefore,
Arclength =purchaseprice
+operatingandmaintenancecosts
tradeinvalue.
Forexample,considerthearcfromnode1tonode3.Thisarccorrespondstopurchasing
acarattheendofyear1,operatingandmaintainingitduringownershipyears1and2,
andthentradingitinattheendofownershipyear2.Consequently,
Lengthofarcfrom 1 to 3 =12,000+2,000+3,0006,500
=10,500 (indollars).
Thearclengthscalculatedinthiswayareshownnexttothearcsinthefigure.
Addingupthelengthsofthearcsonanypathfromnode0tonode4thengivesthetotal
netcostforthatparticularplanfortradingincarsoverthenextfouryears.Therefore,
findingtheshortestpathfromtheorigintothedestinationidentifiestheplanthatwill
minimizeSarah'stotalnetcost.
(b)UsethealgorithmdescribedinSec.9.3tosolvethisshortestpathproblem.
Thus,theshortestpathturnsouttobe
O 2 4 .
TradeinthefirstcarattheendofYear2.
TradeinthesecondcarattheendofYear4.
Thelengthofthispathis10,500+10,500=21,000,soSarah'stotalnetcostis$21,000.
RecallthatthisisexactlytheamountinSarah'scarfundprovidedbyherparents.(These
arereallyniceparents!)
(c)Formulateandsolveaspreadsheetmodelforthisproblem.
Thefollowingfigureshowsaspreadsheetmodelforthisproblem.Thebottomof
thefigureshowstheequationsenteredinthetargetcellTotalCost(D23)andtheother
outputcellsCost(E12:E21)andNetFlow(H12:H16).AfterapplyingtheSolver,the
valuesof1inthechangingcellsOnRoute(D12:D21)identifytheshortest(least
expensive)pathforschedulingtradeins.
A B C D E F G H I J K
1 Sarah's Car Purchasing Problem
2
3 Operating &Trade-in ValuePurchase
4 Maint. Costat End of Year Price
5 Year 1 $2,000 $8,500 $12,000
6 Year 2 $3,000 $6,500
7 Year 3 $4,500 $4,500
8 Year 4 $6,500 $3,000
9
10
11 From To On Route Cost Nodes Net Flow Supply/Demand
12 Year 0 Year 1 0 $5,500 Year 0 1 = 1
13 Year 0 Year 2 1 $10,500 Year 1 0 = 0
14 Year 0 Year 3 0 $17,000 Year 2 0 = 0
15 Year 0 Year 4 0 $25,000 Year 3 0 = 0
16 Year 1 Year 2 0 $5,500 Year 4 -1 = -1
17 Year 1 Year 3 0 $10,500
18 Year 1 Year 4 0 $17,000
19 Year 2 Year 3 0 $5,500
20 Year 2 Year 4 1 $10,500
21 Year 3 Year 4 0 $5,500
22
23 Total Cost $21,000
24
E F
11 Cost
12 =PurchasePrice+OpMaint1-TradeIn1
13 =PurchasePrice+OpMaint1+OpMaint2-TradeIn2
14 =PurchasePrice+OpMaint1+OpMaint2+OpMaint3-TradeIn3
15 =PurchasePrice+OpMaint1+OpMaint2+OpMaint3+OpMaint4-TradeIn4
16 =PurchasePrice+OpMaint1-TradeIn1
17 =PurchasePrice+OpMaint1+OpMaint2-TradeIn2
18 =PurchasePrice+OpMaint1+OpMaint2+OpMaint3-TradeIn3
19 =PurchasePrice+OpMaint1-TradeIn1
20 =PurchasePrice+OpMaint1+OpMaint2-TradeIn2
21 =PurchasePrice+OpMaint1-TradeIn1
22
Range Name Cells
Cost E12:E21 H I
From B12:B21 11 Net Flow
NetFlow H12:H16 12 =SUMIF(From,G12,OnRoute)-SUMIF(To,G12,OnRoute)
=
Nodes G12:G16 13 =SUMIF(From,G13,OnRoute)-SUMIF(To,G13,OnRoute)
=
OnRoute D12:D21 14 =SUMIF(From,G14,OnRoute)-SUMIF(To,G14,OnRoute)
=
OpMaint1 C5 15 =SUMIF(From,G15,OnRoute)-SUMIF(To,G15,OnRoute)
=
OpMaint2 C6 16 =SUMIF(From,G16,OnRoute)-SUMIF(To,G16,OnRoute)
=
OpMaint3 C7 17
OpMaint4 C8 C D E
PurchasePriceE5 23 Total Cost =SUMPRODUCT(OnRoute,Cost)
SupplyDemandJ12:J16 24
To C12:C21
TotalCost D23
TradeIn1 D5
TradeIn2 D6
TradeIn3 D7
TradeIn4 D8
ExampleforSection9.5
Forthenetworkshownbelow,usetheaugmentingpathalgorithmdescribedinSec.9.5to
findtheflowpatterngivingthemaximumflowfromthesourcetothesink,giventhatthe
arccapacityfromnodeitonodejisthenumbernearestnodeialongthearcbetween
thesenodes.
4
4
2 7
8 5
3 8
F 5 9 F
1
S o u r c e S i n k
9 3
8 7
3
Iteration0:Theinitialresidualnetworkis
04
4
73 0 07
02
2 0 7
83 0 05
58 0 09
ce19
Sour 46
0 3 0 S
ink
03
3 0 08
7
0
06
2
Iteration1:Oneoftheseveralaugmentingpathsis1389,whichhasaresidual
capacityofmin{9,6,7}=6.Anyoftheaugmentingpathscouldbechosen,butsuppose
weselectthisone.Byassigningaflowof6tothispath,theresultingresidualnetworkis
04
4
73 0 07
02
2 0 7
83 0 05
58 0 09
6 13 40
0 3 6 6
63
3 6 08
1
0
06
2
Iteration2:Assignaflowof4totheaugmentingpath12479.The
resultingresidualnetworkis
34
0
43 0047
42
2 3
43 0005
58 0 49
1013 40
3 6 10
63
3 6 08
1
0
06
2
Iteration3:Assignaflowof3totheaugmentingpath13579.The
resultingresidualnetworkis
34
0
43 0 47
42
2 3 0
43 0 05
28 7
1310 10
3 3
0 1
0 69 13
93
3 08
6
062
Iteration4:Assignaflowof2totheaugmentingpath1259.Theresulting
residualnetworkis
34
0
43 0 47
62
0 3 0
23 0 25
26 7
1510 10
3 3
0 1
2
69
15
93
3 08
6
062
Iteration5:Assignaflowof3totheaugmentingpath159.Theresultingresidual
networkis
34
0
43 0 47
62
0 3 0
20 3 25
23 7
1810 10
3 3
0 1
5
69
18
93
3 6 08
062
Iteration6:Assignaflowof2totheaugmentingpath12759.(Although
flowbetweennodes5and7canonlygointhedirectionfromnode5tonode7,this
assignmentofaflowof2to7is,inreality,simplyreducingthepreviouslyassigned
flowfromnode5tonode7by2units.)Theresultingresidualnetworkis
34
0
41 2 47
82
0 1 0
00 3 25
41 7
2010 10
3 3
0 1
7 69 20
93
3 08
6
062
Therearenomoreaugmentingpaths,sothecurrentflow(givenbythenumberattheend
34
oftherespectivearcs)inthefollowingnetworkisoptimal.Themaximumflowis20.
82
2 47
1
3 25 7 79
201 3 6 20
93
6 08
0
06
ExampleforSections9.6and9.7
Considerthetransportationproblemhavingthefollowingparametertable:
Destination
1 2 3 Supply
Source 1 6 7 4 40
2 5 8 6 60
Demand 30 40 30
Formulatethenetworkrepresentationofthisproblemasaminimumcostflow
problem.UsethenorthwestcornerruletoobtainaninitialBFsolution.Thenuse
thenetworksimplexmethodtosolvetheproblem.
Thenetworkformulationofthisproblemisshowninthefollowingfigure,wherethe
numbernexttoeachnodeisthenetflowgeneratedthereandthenumbernexttoeacharc
isthecostperunitflowthroughthatarc.
[
4 0]
1S 76 [D]30
1
4 [D
]40
5 2
[
6 0]
2S 68 [D
]30
3
Usingthenorthwestcornerrule,weobtainthefollowinginitialBFsolution,wherethe
numberinparenthesesnexttoeacharcistheflowthroughthatarc.
[40] [30]
S1 (30)
D1
(10)
[40]
D2
S2 D 3
(30)
NowweapplythenetworksimplexmethodtotheinitialBFsolutionshownabove.
Iteration1:
IncreasexS1D3:ifxS1D3=1,thecyclecreatedisS1D3S2D2S1andthe
incrementalcostaroundthiscycleisZ=46+87=1.
IncreasexS2D1:ifxS2D1=1,thecyclecreatedisS2D1S1D2S2andthe
incrementalcostaroundthiscycleisZ=56+78=2.
Hence,wechoosetoincreasexS2D1sinceitdecreasesthetotalcostZatthefastestrate.
SincexS1D1andxS2D2reachtheirlowerboundsimultaneouslywhenweincreasexS2D1,we
canchooseeitherofthemastheleavingbasicvariable.SupposewechoosexS1D1asthe
leavingbasicvariable.
[
4 0] [ ]30
TheresultingBFspanningtreeis
1S (40) D 1
[D
]40
()30 2
[
6 0] (
0 ) [
2S (30) D]30
3
Iteration2:
IncreasexS1D3:ifxS1D3=1,thecyclecreatedisS1D3S2D2S1andthe
incrementalcostaroundthiscycleisZ=46+87=1.
IncreasexS1D1:ifxS1D1=1,thecyclecreatedisS1D1S2D2S1andthe
incrementalcostaroundthiscycleisZ=65+87=2.
Hence,wechoosetoincreasexS1D3sinceitistheonlyoptionthatdecreasesthetotalcost
Z.SincexS2D3reachesitslowerboundfirst,wechoosexS2D3astheleavingbasicvariable.
TheresultingBFspanningtreeis
[
4 0] []
1S (30) D30
1
()10 [D
]40
()10 2
[
6
S 0] (
1 0)
[]30
D
2 3
OptimalityTest:
IncreasexS1D1:IfxS1D1=1,thecyclecreatedisS1D1S2D2S1andthe
incrementalcostaroundthiscycleisZ=65+87=2.
IncreasexS2D3:IfxS2D3=1,thecyclecreatedisS2D3S1D2S2andthe
incrementalcostaroundthiscycleisZ=64+78=1.
total>
byintroducingflowthrougheitherof
thenonbasicarcs.Therefore,theBFsolutionshownaboveisoptimal.
ExampleforSection9.8
SharonLowe,VicePresidentforMarketingfortheElectronicToysCompany,isabout
tobeginaprojecttodesignanadvertisingcampaignforanewlineoftoys.Shewantsthe
projectcompletedwithin47daysintimetolaunchtheadvertisingcampaignatthe
beginningoftheChristmasseason.
Sharonhasidentifiedthesixactivities(labeledA,B,...,F)neededtoexecutethis
project.Consideringtheorderinwhichtheseactivitiesneedtooccur,shealsohas
constructedthefollowingprojectnetwork.
A C E F
START F IN IS H
B D
Tomeetthedeadlineof47days,Sharonhasdecidedtocrashtheproject,using
theCPMmethodoftimecosttradeoffstodeterminehowtodothisinthemost
economicalway.Shehasgatheredthedataneededtoapplythismethod,asgivenbelow.
(a)Considerthelowerpaththroughtheprojectnetwork.Usemarginalcostanalysis
todeterminethemosteconomicalwayofreducingthelengthofthispathto47days.
ThelowerpathisBDwithapathlengthof50days.
Fromthetimecosttradeoffdata,bothactivitiesBandDhaveacrashcostperdaysaved
of$10,000,andbothcanbereducedbymorethan3days.Therefore,usingmarginalcost
analysis,wefindthatthemosteconomicalwayofreducingthelengthofthispathto47
daysistoshorteneitheractivity(itdoesntmatterwhichone)by3dayswithan
additionaltotalcostof$30,000.
TheupperpathisACEFwithapathlengthof51days.
Marginalcostanalysisisperformedinthetablebelow.Oftheactivitiesonthepath,
activityChasthesmallestcrashcostperdaysaved($10,000)andactivityEisnext
($15,000).ActivityCcanonlybereducedby3days,soactivityEalsowillneedtobe
crashedsomewhat.Therefore,wefindthatthemosteconomicalwayofreducingthe
lengthofthispathto47daysistoshortenactivityCby3daysandactivityEby1day
withanadditionaltotalcostof$45,000.
Combiningthisresultwiththeresultfrompart(a),thetotalcrashingcostforthe
optimalwayofmeetingthedeadlineof47daysis$30,000+$45,000=$75,000.
(c)Formulatealinearprogrammingmodelfortheproblemofdeterminingthemost
economicalwayofmeetingthedeadlineof47days.
Thenaturaldecisionvariablesare
xj= reductioninthedurationofactivityjduetocrashingthisactivity,
forj=A,B,...,F.
Eachofthesevariableshasbothanonnegativityconstraintandamaximumreduction
constraint,wheretheupperboundforthislatterconstraintisgivenbythecorresponding
numberinthenexttolastcolumn(labeledMaximumReductioninTime)ofthetableof
datagivenattheendoftheproblemstatement.Usingthelastcolumn(labeledCrashCost
perDaySaved)ofthissametable,theobjectivefunctiontobeminimizedis
Z=20,000xA+10,000xB+10,000xC+10,000xD+15,000xE+25,000xF.
Someadditionalvariablesalsoareneededintheformulation.Inparticular,let
yFINISH=projectduration,
yj=starttimeofactivityj(forj=C,D,E,F),giventhevaluesofxA,xB,...,xF.
(NosuchvariableisneededforactivitiesAandB,sincetheseactivitiesthat
simultaneouslystarttheprojectareautomaticallyassignedastarttimeof0.)These
variablesneedtosatisfytheconstraints,
yFINISH47,
yjyi+tixi,
whereactivityiistheimmediatepredecessorofactivityjandtiisthenormaltimeof
activityi(asgivenbythesecondcolumnofthetableofdata).
Therefore,thecompletelinearprogrammingmodelis
MinimizeZ=20,000XA+10,000xB+10,000xC+10,000xD+15,000xE+25,000xF,
subjecttothefollowingconstraints:
1.Maximumreductionconstraints:
2.Nonnegativityconstraints:
3.Starttimeconstraints:
yC0+12xA, yD0+23xB,
yEyC+15xC, yFyE+18xE.
4.Projectdurationconstraint:
yFINISH47.
(d)UseExceltosolvetheproblem.
ThefollowingspreadsheetshowshowExcelfindsanoptimalsolution:shortenactivityB
by3days,shortenactivityCby3days,andshortenactivityEby1day.Thetotalcost
(sumofthenormalcostandthecrashcost)is$1,935,000.