You are on page 1of 6

COSC480/MATH482 OperationsResearch Fall2012 AlanC.Jamieson,PhD Excel/GoogleSpreadsheetSolverWalkthrough ThisdocumentshouldgiveyouaclearwalkthroughofanexampleproblemusingExcelsSolver(both WindowsandMac)andGoogleSpreadsheetsSolver.Ateachstep,youllseestepsforExcelhighlighted ingreen,andstepsforGoogleSpreadsheetshighlightedinred.NotethatifyouareusingExcel2010or MacExcel2011,theresagoodchancethatyourwindowswilllookslightlydifferentlythanthescreen shotsIhaveinthisdocument,butthisshouldbegoodenoughforyoutofigurethingsout. ProblemStatement TheWYNDORGLASSCO.produceshighqualityglassproducts,includingwindowsandglassdoors.Ithas threeplants.AluminumframesandhardwarearemadeinPlant1,woodframesaremadeinPlant2, andPlant3producestheglassandassemblestheproducts.

Thecompanyislaunchingtwonewproducts havinglargesalespotential: Product1:8glassdoorwithaluminumframing($3000profit/batch) Product2:4x6doublehungwoodframedwindow($5000profit/batch) Product1requiressomeoftheproductioncapacityinPlants1(1hr/batch)and3(3hr/batch).Product2 requiresPlants2(2hr/batch)and3(2hr/batch).Marketinghasdeterminedthatthecompanycouldsell asmanyofeitherproductasproductionallows.Determinewhatmixofproductsnetthelargestprofit consideringthattheamountofavailabletimeforPlant1is4hours,Plant2is12hours,andPlant3is18 hoursperweek. ProblemFormulation Sinceweregoingtobemaximizingourprofit(Determinewhatmixofproductsnetthelargestprofit) Product1:8glassdoorwithaluminumframing($3000profit/batch)Product2:4x6doublehung woodframedwindow($5000profit/batch)isourtargetfunctionstatement,sincethesearethe statementsthatdealdirectlywithprofit.Ourtargetfunction:Z=3000a+5000b Product1requiressomeoftheproductioncapacityinPlants1(1hr/batch)and3(3hr/batch).Product 2requiresPlants2(2hr/batch)and3(2hr/batch).Marketinghasdeterminedthatthecompanycould sellasmanyofeitherproductasproductionallows.Determinewhatmixofproductsnetthelargest profitconsideringthattheamountofavailabletimeforPlant1is4hours,Plant2is12hours,andPlant 3is18hoursperweek.iswhereweseeourconstraints.Theconstraintsarematchedbycolorandform ourfullsetofconstraints:

a<=4 2b<=12orb<=6 3a+2b<=18

Inaddition,wecantallownegativeproduction,soaandbwillbenonnegative. Insummary: Maximize: SubjectTo: With: Z=3000a+5000b a<=4 2b<=12 3a+2b<=18 a,b>=0 UsingaSpreadsheetSolverSetup Nowthatwehaveourproblemformulation,weneedtoputallofourrelevantinformationintoa spreadsheet.Thisisequivalentacrossallthreepotentialsolvers,soweonlyputonespreadsheetfor now:

Lookingatspecificcells(notethatthehighlightsarecompletelyoptional): G7,G8,G9thesecellsarethecoefficientsofthelefthandsidesofourthreeconstraints C7:C9,D7:D9thesecellsaretherighthandsidesofourthreeconstraints C4,D4thesecellsareourprofitperunitforeachofourproducts C12,D12thesecellswestartas0andwillbeadjustedbytheSolver.Theyrepresentthenumberof unitsofeachproduct. Inaddition,wellneedsomecellsthatwilldosomecalculationsforus.UnderHoursUsed: E7=C7*C12 E8=D8*D12 E9=C9*C12+D9*D12

Eachoftheseequationsrepresentmultiplyingthehoursusedperunitforeachplant(rows79)bythe numberofunits(row12). Wellalsoneedonemorecalculation,forourtotalprofits(ourZfunction): G12=C12*C4+D12*D4 UsingaSpreadsheetSolverSolving! WenowhaveourspreadsheetsetupandwecanmoveontousingtheSolvertosolveourlinear programmingproblem.IfyoudontalreadyhaveavariantofSolverinstalled,seethesectionon installation(Googlesisbuiltin). Tostart,weneedtofireupSolverbyclickingonSolverinExcelorTools>SolverinGoogle Spreadsheets. TofindSolverinExcel:ClickonData,thenSolver.

ForMac,starttheSolverapp. Youshouldseeoneofthefollowingscreens(Windows,Mac,Google):

Thefirstthingwellsetisthecellthatwewanttooptimize,orthecellthathasourZfunction.Wellbe settingSetTargetCell/SetObjective,orCelltoOptimize.ForGoogle,youllneedtoputthecellin manuallybyadjustingtheA1portionoftheCelltoOptimizeboxorbyclickingonthetextboxthen clickingonthedesiredcell.ForOffice,youcanclickonthelittlebuttonnexttothetextboxhighlighted below,whichwillallowyoutoclickaspecificcell.

Ineithercase,youwanttomakesurethatthecellistherightone.Inourexampleabove,wewantthis celltobeG12,butitmaybedifferentdependingonhowyouhavethingsformatted. Thenextitemtoaddressistochoosewhatcellsaretobemanipulatedbythesoftwareinorderto maximize(orminimizeasthecasemaybe)ourtargetcell.InExcel,thisishandledbytheByChanging Cells:textbox,inGooglethisistakencareofbytheCellstoChangetextbox.Onespecialnotethe Googletextboxallowsyoutoputyournonnegativeconditionsinatthesametime.Justcheckthebox nexttothetextbox.Again,intheExcelversion,wehaveabuttontotherightsideofthetextboxthat allowsustochooseourcells,andintheGoogleversion,wehavetomanuallyenterthatinformationor clickonthetextboxthenclickontheappropriatecell.Thevariouspiecesarehighlightedbelow: Forourexample,wewantthecellsC12andD12becausethenumbersofunitsthatweproducearethe parameterswecandirectlycontrol.

Finally,weaddinourconstraints.ThisisdonethroughtheAddbuttononExcelvariants,andbythe appropriatetextboxonGoogleSpreadsheets.Thefirstconstrainthasalreadybeenaddedinboth examples.

WhenyouclickAddinExcel,youllgetsomeoptions:

<=,=,and>=areselfexplanatory.intandbinareconstraintsthatallowyoutoensurethataparticular cellremainanintegerorabinary(0or1)value. Googlessolveronlyallowsyou<=,>=,and=:

Now,addourconstraints:E7<=G7,E8<=G8,andE9<=G9.InExcel,youllalsoneedtoaddthe nonnegativityconstraints:C12>=0,D12>=0(thoughyoucandothisintheoptionspanelaswell). Whenfinished,yoursolvershouldlooklikeoneofthesethree:

ClickSolveandmagichappens!FeelfreetomessaroundwiththeOptionspanel(onlyavailablein Excel).Theseoptionswillallowyoutofurtherrestrictyourmodelandsolverparameters. UsingaSpreadsheetSolverInstallation MacOffice2008and2011Gotohttp://www.solver.com/mac/,downloadtheSolverapplicationand install.YouwillrunthisatthesametimeasExcel. Office2007and2010ClickontheOfficebutton(topleft),thenclickonExcelOptions.ClickonAddIns, thenintheManagebox(bottomleftish)makesurethatExcelAddinsisselectedandthenclickGo.In theAddInsavailablebox,selectSolverAddinthenhitokandfollowtheprompt.

~ Fin ~

You might also like