Analyzing the Run-Time Behaviour of Iterated Local Search for the TSP
Total Page:16
File Type:pdf, Size:1020Kb
MIC I I I Metaheuristics International Conference Analyzing the Runtime Behaviour of Iterated Lo cal Search for the TSP Thomas Stutzle and Holger H Hoos Universite Libre de Bruxelles IRIDIA Avenue Franklin Ro osevelt CP Brussels Belgium Email tstutzleulbacbe University of British Columbia Computer Science Department Main Mall Vancouver BC VT Z Canada Email hooscsubcca Intro duction Metaheuristics strongly involve random decisions during the search pro cess Such random deci sions are for example due to random initial solutions randomized tie breaking criteria randomized sampling of neighb orho o ds probabilistic acceptance criteria and many more Because of their nonde terministic nature the runtime required bysuch an algorithm to achieve a sp ecic goal like nding an optimal solution to a given problem instance is a random variable Obviouslyknowledge on the distribution of this random variable can givevaluable information for the analysis and the character ization of an algorithms b ehavior provide a basis for the comparison of algorithms and give hints on p ossible improvements of an algorithms p erformance To obtain empirical knowledge on the runtime distribution RTD of an algorithm when applied to a sp ecic problem instance one may estimate the RTD from data collected over several runs of the algorithm and p ossibly approximate the empirically observed RTD by a distribution function known from probabilitytheory If similar b ehav iorisobserved on all tested instances from a particular problem class for example on Euclidean TSP instances the observed typ e of RTDs characterizes the runtime b ehavior on this problem class The RTDs may also give an indication under which conditions an algorithm may b e improved As wewill later explain the exp onential distribution plays a crucial role for judging an algorithms eectiveness In this work we investigate the runtime b ehavior of lo cal search algorithms for optimization problems in particular of Iterated Lo cal Search ILS algorithms for the Traveling Salesman Problem TSP Iterated lo cal search ILS isavery simple and p owerful metaheuristic which has proved to b e among the b est p erforming approximation algorithms for the well known Traveling Salesman Problem TSP ILS is based on the observation that iterativeimprovement lo cal search is easily trapp ed in lo cal minima Instead of restarting the lo cal search from a new randomly generated solution a b etter idea may b e to mo dify the current solution moving it to a p ointbeyond the neighb orho o d searched by the lo cal search algorithm ILS then continues the lo cal searchfromthe so p erturb ed solution An acceptance criterion determines to which lo cal optimum the p erturbation step is applied In fact in almost all ILS applications the solution mo dications are always applied to the b est solution found since the start of the algorithm ILS algorithms make heavily use of random decisions and in particular the solution p erturbations are randomized Therefore as argued b efore measuring RTDs is p otentially very helpful for analyzing ILS p erformance To empirically measure the RTDs werunagiven algorithm many times on the same problem instance and collect some elementary data in each run it suces to rep ort the solution quality whenever a new b est solution is found the computation time needed to obtain it and p ossibly some other statistic data for further analysis Then a p osteriori the empirical distributions for dierent bounds on the required solution quality can be easily estimated Then a p osteriori the empirical distribution runtime distribution G t to reach a solution quality b ound c can b e easily computed c c as G tjfj j rtj t f s cgj k For some problems optimal solutions or tight b ounds c j Angra dos Reis Brazil July Brazil PUCRio MIC I I I Metaheuristics International Conference on the optimal solution value may b e known In such a case it might b e preferable to x the solution qualityboundc relative to the optimal solution value that is to require the algorithm to get within a certain p ercentage of the optimal solution value The analysis of ILS runtime b ehavior rep orted in this work suggests improvements of the standard ILS algorithm we exemplify the improved p erformance by giving some exp erimental results on known b enchmark instances The pap er is structured as follows First in Section weintro duce the TSP In the next section wegive details on the ILS implementations we used in our study Then Section gives the results of the analysis of the RTDs Based on this analysis we present computational results for improved ILS variants in Section and end with some concluding remarks in Section The Travelling Salesman Problem The TSP is an NPhard optimization problem which is extensively studied in the litera ture It has b ecome a standard testb ed for new algorithmic ideas and a go o d p erformance on the TSP is often taken as a pro of for the usefulness of an algorithmic approach Intuitively the TSP is the problem of a salesman who wants to nd starting from his home town a shortest p ossible trip through a given set of customer cities and to return to its home town More formallyitcanberepre sented by a complete weighted graph G N A dwithN b eing the set of no des also called cities A b eing the set of edges fully connecting the no des and d isaweight function which assigns to each arc i j A avalue d which represents the distance b etween cities i and j The TSP is the problem of ij nding a minimal length Hamiltonian circuit of the graph where a Hamiltonian circuit is a closed tour visiting eachofthe n jN j no des of G exactly once For symmetric TSPs the distances b etween the cities are indep endent of the direction of traversing the arcs that is d d for every pair of no des In ij ji the asymmetric TSP ATSP at least for one pair of no des i j wehave d d All the TSP instances ij ji used in the empirical studies presented in this article are taken from the TSPLIB Benchmark library ac cessible at httpwwwiwruniheidelbergdeiwrcomoptsoftTSPLIBTSPLIBhtml These instances are actually Euclidean instances that is the cities are given p oints in the Euclidean space and the distance is the Euclidean distance b etween the points These instances in fact havebeen used in many other algorithmic studies and partly stem from practical applications to the TSP In Figure weshowtwo example TSPLIB instances 7000 2200 "att532" "fl1577" 2000 6000 1800 5000 1600 1400 4000 1200 1000 3000 800 2000 600 400 1000 200 0 0 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 Figure TSP instances att left side and fl right side from TSPLIB with and cities resep ctively The rst instance is based in cities in the USA while the second instance which stems from a drilling problem shows a pathological clustering of the cities PUCRio Angra dos Reis Brazil July MIC I I I Metaheuristics International Conference Iterated Lo cal Search for the TSP Algorithmic Outline Iterated Lo cal Searchis avery simple and powerful metaheuristic which has provided the basis for some of the b est p erforming approximation algorithms for the TSP ILS is based on the observation that lo cal search algorithms are easily trapp ed in lo cal minima Instead of restarting the lo cal searchfroma new randomly generated solution it is usually a b etter idea to mo dify the current solution s such that it is moved to a point s beyond the neighborhood searched by the lo cal search algorithm and to restart the lo cal searchfrom s to reach a new lo cal minimum s An acceptance criterion determines whether the searchiscontinued from s or s or p ossibly from some other solution This is captured in the algorithmic outline given in the following algorithmic outline pro cedure IteratedLocal Search s GenerateInitialSolution s Lo calSearchs rep eat s Mo difys s Lo calSearchs s AcceptanceCriterions s until termination condition met end The instantiation of the functions Lo calSearch Mo dify and AcceptanceCriterion is an imp ortant issue in the design of ILS algorithms In the following we discuss the choices for these functions for the ILS algorithms we applied to the TSP Generic Algorithm Choices for the Symmetric TSP a Choice of Lo calSearch In principle any lo cal search algorithm can b e used but the choice of the particular lo cal search algorithm mayhave a crucial inuence on the nal p erformance of the ILS algorithm In this pap er we consider three p ossible lo cal search algorithms for the TSP The most simple ones to implement are opt and opt which try to nd an improved solution byexchanging two or at most three edges resp ectively However typically the best p erformance with resp ect to solution quality is obtained with the considerably more complex LinKernighan heuristic LK For eachmove it considers a variable numb er of edges to b e exchanged Yet a disadvantage of the LK heuristic is that considerable implementation eort is required to achieve short runtimes and best p erformance with resp ect to solution quality opt and opt on the other hand are much simpler to implement and may therefore b e the preferred choice for practitioners Additionally opt and opts runtime is much more robust with resp ect to the particular instance typ e than LKs runtime In particular LKs run time grows strongly when applied to highly clustered TSP instances like instance fl plotted in Figure Therefore we did not apply the LK heuristic to such clustered instances In the following we will refer