Anda di halaman 1dari 8

2.

2TravelingSalesmanProblem
Theproblemoffindingtheminimumcosthasapplicationsnotonlyforvacation
planning,butalsoinoperationsresearch,thebranchofmathematicsconcerned
withgettinggovernmentsandbusinessestooperatemoreefficiently.This
problemisusuallycalledthetravelingsalesmanproblem(TSP).
Thetravelingsalesmanproblem(TSP)involvesfindingthetripofminimum
costthatasalesmancanmaketovisitthecitiesinasalesterritoryonceandonly
once(representedbyacompletegraphwithweightsontheedges),startingand
endingthetripinthesamecity.
OthersituationsthatrequirethesolutionofaTSPareasfollows:
1)alobsterfishermancheckinghistraps
2)atelephonecompanycheckingitspayphones(kindofanoutdatedexample)
3)gasorelectriccompanymeterreader
4)ruralschoolbusdriver
5)shuttleservicefromdifferenthotelstotheairport
6)pizzadelivery
7)armoredcarpickingupmoneyfromstoresorbanks

TSPproblemsarealsosolvedinthedesignofcomputerchips.Thecomponent
mustbelocatedsothatthemachinesinvolvedintheassemblycaninsertthem
onthechipsasefficientlyaspossible.
Themeaningofcostcanvaryfromproblemtoproblem.Itcanbemeasuredin
termsofdistance,time,airplaneticketprices,oranyotherfactorthatistobe
optimized.SomeproblemsmayinvolvemultipleTSP'swithinonelarger
situation,suchasmultipletrucksservicingalargenumberofstoresormultiple
schoolbusesservingalargecity.

2.3HelpingTravelingSalesmen
BecausetheTSPproblemarisesofteninsituationswherethenumberofverticesislarge,
weneedothermethodswhicharefasterthanthebruteforcemethodtofindourminimum
costHamiltoniancircuit.Oneintuitiveideaistotrytovisitnearbylocationssooner.This
givesrisetotheNearestNeighborAlgorithm.
Startingfromthehomecity,firstvisitthenearestcity,thenvisitthenearestcitythathasnot
alreadybeenvisited.Wereturntothestartcitywhennootherchoiceisavailable.This
approachiscalledthenearestneighboralgorithm.
Considertheexamplefrombefore.
3)YouaretravelingfromChicago(C)toMinneapolis(M),Cleveland(L),andSt.Louis(S)andbackto
Chicago.Youcanvisitthecitiesinanyorderandwanttominimizeyourcost.
Usingthenearestneighboralgorithm,findaminimumcostHamiltoniancircuitthatstartsatChicago.

Usingthenearestneighboralgorithm,findaminimumcostHamiltonian
circuitforthegraphbelow,startingatvertexA.

Thenearestneighboralgorithmisanexampleofagreedyalgorithmbecauseateachstageabest
(greedy)choice,basedonanappropriatecriterion,ismade.Unfortunately,thisisnotalwaysthe
optimaltour.Makingthebestchoiceateachstagemaynotyieldthebest"global"solution.
However,evenforalargeTSP,onecanalwaysfindanearestneighborroutequickly.
AnotherapproachtotheTSPthatfindsagoodsolutionquicklyistheSortedEdgesAlgorithm.
Startbysortingorarrangingtheedgesofthecompletegraphinorderofincreasingcost(or,
equivalently,arrangingtheintercitydistancesinorderofincreasingdistance).Thenateachstage
selectanedgethathasnotbeenpreviouslychosenofleastcostthat(1)neverrequiresthatthreeused
edgesmeetatavertex(becauseaHamiltoniancircuitusesupexactlytwoedgesateachvertex)and
that(2)neverclosesupacirculartourthatdoesn'tincludeallthevertices.Thisalgorithmiscalled
thesortededgesalgorithm.
Tryusingthisalgorithmforthepreviousexample.
1)

2)Usingthesortededgesalgorithm,findaminimumcostHamiltoniancircuit.

3)Usingthesortededgesalgorithm,findaminimumcostHamiltoniancircuit.

4)Usingthesortededgesalgorithm,findaminimumcostHamiltoniancircuit
forthegraphbelow.

Anda mungkin juga menyukai