0% found this document useful (0 votes)
154 views

2.2-2.3 Traveling Salesman Problem

The document discusses the traveling salesman problem (TSP), which aims to find the shortest route for a salesman to visit all cities in a sales region only once before returning to the starting city. It provides examples of real-world problems that can be modeled as a TSP, such as a delivery driver planning a route. The document then introduces two algorithms for approximating the solution to a TSP: the nearest neighbor algorithm and the sorted edges algorithm.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views

2.2-2.3 Traveling Salesman Problem

The document discusses the traveling salesman problem (TSP), which aims to find the shortest route for a salesman to visit all cities in a sales region only once before returning to the starting city. It provides examples of real-world problems that can be modeled as a TSP, such as a delivery driver planning a route. The document then introduces two algorithms for approximating the solution to a TSP: the nearest neighbor algorithm and the sorted edges algorithm.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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.

You might also like