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 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 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 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 to the ILS algorithms using opt and opt and LK lo cal search as Iterated

opt Iopt Iterated opt Iopt and Iterated LK ILK resp ectively

In the exp eriments with ILS we used our own opt and opt implementation while the LK lo cal

search algorithm was kindly provided by Olivier Martin details on that implementation are given in

Our opt and opt implementations use standard sp eedup techniques which are describ ed

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

in In particular we p erform a xed radius nearest neighb or search within candidate lists of

the nearest neighb ors for eachcity and use dont lo ok bits Initially all dont lo ok bits are turned

o set to If for a no de no improving move can be found its dont lo ok bit is turned on set

to and the no de is not considered as a starting no de for nding an improving movein the next

iteration When an arc incident to a no de is changed byamove the no des dont lo ok bit is turned

o again These sp eedup techniques achieve that b oth algorithms runtime grows sub quadratically

with instance size

b Choice of Mo dify

For Mo dify we use the so called doublebridge movewhich is the standard choice for ILS applications

to the TSP It cuts the current tour at four appropriately chosen edges into four subtours

s s s s which are contained in the solution in the given order These subtours are then

reconnected in the order s s s s to yield a new starting solution for the lo cal search The

doublebridge moveis a sp ecic opt movedone in such away that it cannot b e reversed directly

by either of the three lo cal search algorithms applied here In preliminary exp eriments we found that

best p erformance is obtained if the edges cut by the doublebridge movearenotchosen completely

at random Instead we pro ceed as follows in Iopt and Iopt we rst randomly cho ose an edge

i j atrandom The other three cutp oints are then chosen such that they all lie within a candidate

set of the maxfn g nearest neighb ors of city i Such an approach has also b een shown to be

eective on large TSP instances Alternatively length restrictions on the newly intro duced edges

are imp osed in the original ILK co de of In particular in the exp eriments we rep ort here a newly

intro duced edge has to b e shorter than times the average edge length of the current solution

We further found that the interaction b etween the doublebridge move and the setting of the dont

lo ok bits after Mo dify is imp ortanttoachieve a go o d tradeo b etween solution quality and runtime

For ILK it was found exp erimentally was found that a very go o d tradeo is achieved by only resetting

only the dont lo ok bits of the cities directly aected by the doublebridge move to zero Yet

for Iopt and Iopt we found that the p erformance with such a resetting strategy was relatively poor

with resp ect to solution quality Here a go o d compromise was found by resetting the dont lo ok bits

of a numb er of the cities in the exp eriments chosen as preceding and following a cutp oint

c Choice of AcceptanceCriterion

Common knowledge in ILS applications to the TSP and also to other combinatorial optimization

problems app ears to b e that accepting b etter quality solutions only gives the b est p erformance

Consequentlywe will use this acceptance criterion as the basis of our analysis we

will denote it as Better s s and it returns s if tour s is shorter than s otherwise it returns s If

sidemoves are allowed that is a new solution is also accepted if it has the same cost as the current

one we will call the acceptance criterion BetterEqual s s Yet it should already b e noted here that

only o ccasionally for sp ecic instances an improved p erformance has b een rep orted with acceptance

criteria whichmay accept worse solutions with a small probability

d Initial Solution

The initial solution for all the ILS algorithms applied are generated by the nearest neighbor

heuristic Compared to random initial tours this choice reduces the runtime for the rst lo cal search

application

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

Generic Algorithm Choices for the Asymmetric TSP

When applying ILS to the ATSP the generic algorithm choices are the same as for the symmetric

TSP except that we apply a particular opt algorithm whichwe called reduced opt Note that in

opt and some opt moves subtours havetobetraversed in the opp osite direction and in this case

for the ATSP the length of that subtour would have to b e recomputed from scratch Toavoid this

reduced opt only applies one sp ecic opt move which do es not lead to a reversal of any subtour

For mo dify again the doublebridge move can b e applied since it do es not reverse any subtour The

acceptance criterion and the choice of the initial solution are the same as for the symmetric TSP

Surprisingly in the literature no results for the application of ILS to the ATSP are rep orted The

only ILS application to ATSPs is describ ed in in the context of a sp ecic co de optimization problem

whichisformulated as an ATSP But there the ATSP instances are solved via a transformation to the

symmetric TSP and by then applying an iterated opt algorithm for symmetric TSPs Consequently

the results presented here are the rst evidence that ILS can b e applied directly to the ATSP with

considerable success

RunTime Distributions for ILS Applied to the TSP

In this section we analyze the empirical runtime b ehavior of iterated lo cal search algorithms for the

TSP In particular we study RTDs for Iopt Ioptand ILK for the symmetric TSP and Iredopt

for the ATSP Since the run times needed to observe limiting b ehavior of the algorithms b ecome rather

high for large TSP instances we limited most part of the study to instances with less than cities

For each instance RTDs have b een measured using indep endent runs of each algorithm and in

the plots always on the xaxis the runtime is indicated and on the y axis the cumulative empirical

RTD is given

The runtime distributions are given with resp ect to various b ounds on the solution quality In

addition to the empirical runtime distributions we plot the cumulative distribution function of an

exp onential distribution indicated by f x in the plots adjusted towards a runtime distribution

corresp onding to high quality solutions These particular exp onential functions the distribution

x

function is given by f x e x give valuable hints on p ossible improvements of an

algorithms p erformance Recall that based on awellknown theorem from probabilitytheory if a

given algorithm has an exp onential RTD then the probabilityofnding a solution by running the

algorithm k times for time t is the same as when running the algorithm once for time k t Hence if

the RTD is in fact an exp onential in the long run such restarts will not aect the solution probability

The plotted exp onential distributions give an indication whether the algorithm can b e improved by

restarting it from a new initial solution This is the case if the empirical runtime distribution falls

below the plotted exp onential As we will see for the ILS algorithms considered here this o ccurs for

many of the instances

To obtain these runtime distributions we limited the maximally allowed computation time on

the single instances to some upp er CPUtime limit whichwas increased with increasing instance size

In each case the computation times are chosen large enough to ensure that the algorithm shows

asymptotic p erformance and that the further increase of solution quality by allowing still longer

computation times should b e negligibly small

Op eration counts

Actual runtime distributions may b e obtained by directly measuring CPUtime or by using rep

resentative op eration counts as a more machine indep endent measure of an algorithms p erformance

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

A natural choice for a highlevel op eration count for the ILS algorithms applied here is given by

the numb er of times a lo cal search is applied To establish the relation b etween CPUtime and lo cal

search iterations in Table wegive the average CPUtime measured on a single MHz Pentium

I I CPU and MB RAM under Redhat Linux when running Iopt Iopt and Iredopt for

iterations and ILK for iterations on the instances used in this study The actual times

are averaged over indep endent ILS runs on each instance When measuring the runtime based on

op eration counts we will call the resulting distributions also runlength distributions RLDs in the

following

For most of our exp eriments we rep ort actual CPUtimes measured either on a single MHz

UltraSparc I pro cessor and MB RAM or the MHz Pentium I I pro cessor on which the timings

in Table are based Comparing the computation times on the two machines we found that the

Pentium I I was roughly times faster than the UltraSparc I pro cessor

Table CPUtime taken for running Iopt Iopt and Iredopt on a MHz Pentium I I CPU for

iterations Runtimes are averaged over indep endent runs of the ILS algorithms

Iopt

eil kroA lin u d lin

pcb rat pr pcb d fl

Iopt

d lin pcb rat pr pcb

d fl pr pcb fl

ILK

lin pcb att rat pcb pr

reduced opt

ryp ft krop ftv rbg

Runtime Distributions for Symmetric TSPs with Iterated opt

Figure shows the empirically observed RTDs for the Iopt algorithm on the instances four

TSPLIB instances d lin pcb and rat Except for instance d Iopt could only

very rarely nd the optimal solutions for these instances within reasonable runtime Thus we rep ort

mainly RTDs which are obtained by imp osing some weaker b ounds on the solutions quality In the

plots the exp onential distribution is tted to the lower part of runtime distributions corresp onding to

high quality solutions where high quality is here meant as high relativeto Iopt As can b e observed

in the plots the exp onential matches the lower part of the RTDs well yet for larger runtimes the

RTDs fall strongly b elow the indicated exp onential Hence the Iopt algorithm is severely aected

by stagnation b ehavior and by using restarts the solution probability can b e signicantly improved

We will give a more detailed example of this stagnation b ehavior in the next section when examining

RTDs for Iopt

Runtime Distributions for Symmetric TSPs with Iterated opt

Figure shows the empirical runtime distributions for the four TSPLIB instances d lin

pcband rat are given in Figure Additionally exp onential distributions whichmay indi

cate stagnation b ehavior are approximated to RTDs for highquality solutions

Note that our implementation choices for opt and opt were made in sucha way that a very large number of

lo cal search runs can b e done in a given amount of CPUtime Other implementation choices may lead to a somewhat

more eective lo cal search in terms of solution quality but may compromise the sp eed of the lo cal search One example

of suchachoice is the particular resetting strategy of the dont lo ok bits in Iopt and Iopt

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

1 1

0.9

0.8 "opt" 0.8 "0.1%" "0.25%" "0.25%" f(x) "0.5%" 0.7 "2%" f(x) 0.6 0.6

0.5

0.4 0.4 solution probability solution probability 0.3

0.2 0.2

0.1

0 0 0 10 20 30 40 50 60 0 20 40 60 80 100 120 CPU-time CPU-time 1 1

0.9 0.9

0.8 0.8 "0.25%" "0.5%" "0.5%" "0.75%" 0.7 1.75% 0.7 "1.5%" f(x) f(x) 0.6 0.6

0.5 0.5

0.4 0.4 solution probability solution probability 0.3 0.3

0.2 0.2

0.1 0.1

0 0 0 50 100 150 200 250 300 0 100 200 300 400 500 600 700 800

CPU-time CPU-time

Figure Runtime distributions of iterated opt on four symmetric TSP instances RTDs are identied

by the required solution quality eg opt means optimal solution is required Given are the distributions for

d upp er left side lin upp er right side pcb lower left side and rat lower right side f x

indicates an exp onential distribution See the text for more details

From the empirical runtime distributions several conclusions can be drawn One is that on all

instances it is rather easy to get within ca or in the case of pcb of the optimum

the empirical runtime distribution corresp onding to one of these bounds are always the leftmost

ones in the plots Yet if higher accuracy is required the algorithms suer from stagnation b ehavior

Consider for example instance pcb If we require a solution quality bound of within the

global optimum after only seconds an empirical solution probability of is obtained runs were

p erformed on the UltraSparc I pro cessor Yet in of the trials the algorithm fails to reach

the required solution quality bound even after seconds A similar situation o ccurs for tighter

solution quality b ounds like when searching for optimal solutions For pcb in some runs optimal

solutions can b e found very fast reaching a solution probability of after seconds but after

additional seconds the solution probability only reaches Similar observations also apply to the

other instances This stagnation b ehavior is esp ecially striking on the instances lin pcband

rat On instance d the runtime distribution for nding the optimal solution is actually close

to an exp onential distribution although for larger runtimes it is slightly less steep Since Iopt has

shown a strong stagnation b ehavior on this latter instance wemay conclude that the more p owerful

opt lo cal search is resp onsible for the b etter b ehavior on that instance



Note that when restarting Iopt on this instance after seconds with restarts that is seconds one would

estimate to obtain a solution probability of roughly whichismuch larger than the empirically observed solution

probability of without using restart

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

1 1

0.9 0.9 "opt" "0.5%" 0.8 "opt" 0.8 f(x) "0.05%" 0.7 f(x) 0.7

0.6 0.6

0.5 0.5

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0 0 2 4 6 8 10 12 14 0 50 100 150 200 250 300 350 400 450 500

1 1

0.9 0.9 "opt" 0.8 "0.5%" 0.8 "opt" f(x) "0.1%" 0.7 0.7 "0.5%" f(x) 0.6 0.6

0.5 0.5

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0

0 100 200 300 400 500 600 700 800 0 500 1000 1500 2000 2500 3000 3500

Figure Runtime distributions of iterated opt on four symmetric TSP instances RTDs are identied

by the required solution quality eg opt means optimal solution is required Given are the distributions for

d upp er left side lin upp er rightside pcb lower left side and rat lower right side

Runtime Distributions for Symmetric TSPs with ILK

One could ob ject that the observation of a stagnation b ehavior in general may b e due to the choice

of the opt or opt lo cal search algorithms whichshows worse p erformance on the TSP than the

more sophisticated LK heuristic Totestthishyp othesis wehave ran the ILK heuristic on the same

instances used in the previous section except the smallest one whichwas easily solved The analysis

presented in this section is based on measuring runlength distributions RLDs where we use the

number of LK applications as op eration counts

Since ILK is known to b e one of the b est p erforming approximate algorithms for symmetric TSP

instances we exp ect higher quality solutions to b e obtained more frequently than with either opt or

opt This exp ectation is conrmed by the empirical runlength distributions given in Figure

For the instances pcb and rat the empirical probability of nding an optimal solution is

signicantly higher than for Iopt Instances pcb and rat are solved in every trial to optimality

bytheILK algorithm In particular the runlength distribution of pcb can b e closely tted bya

xx

mo died exp onential distribution with distribution function Gxmaxf e g where x

adjusts for the fact that a certain minimal numb er of iterations have to b e to p erformed to obtain a



Instance lin is not shown here since it was solved to optimality in all runs On instance att Iopt showed

a similar strong stagnation b ehavior as ILKyet the nal solution probabilities for reaching the optimal solution were

signicantly lower

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

1 1

"0.25%" "0.05%" "opt" "0.25%" f(x) "0.1%" 0.8 0.8 "opt" f(x)

0.6 0.6

0.4 0.4 empirical solution probability empirical solution probability

0.2 0.2

0 0 0 500 1000 1500 2000 2500 0 2000 4000 6000 8000 10000 12000 14000 LK applications LK applications 1 1 "0.25%" "0.15%" 0.9 "opt" "0.1%" f(x) "opt" f(x) 0.8 0.8

0.7

0.6 0.6

0.5

0.4 0.4

0.3 empirical solution probability empirical solution probability

0.2 0.2

0.1

0 0 0 2000 4000 6000 8000 10000 12000 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 20000

LK applications No. LK applications

Figure Runlength distributions of ILK on four symmetric TSP instances RTDs are identied bythe

required solution quality eg opt means optimal solution is required Given are the distributions for pcb

upp er left side att upp er rightsiderat lower left side and pr lower right side

reasonable chance of nding the optimal solution In general it app ears that this particular instance

is easily solved using the LK heuristic but it is relativelyhardtosolve when using opt or opt

compare the runtime distribution of ILK to that of iterated opt in Figure On instance rat

ILK again falls slightly b elow the exp onential distribution which indicates stagnation b ehavior and

suggests that the algorithms p erformance could p ossibly be further improved On the other two

instances att and pr again the stagnation b ehavior is clearly visible

Runtime Distributions for ATSPs with Iterated reduced opt

The runtime distributions for the ATSP instances shown in Figure conrm the ndings on

the symmetric instances On the ATSP instances the stagnation b ehavior of iterated reduced opt

app ears to b e even more severe Often the optimal solution is obtained very early in a run or with

a few exceptions is not found at all within the given computation time Surprisingly also on the

smallest instance ryp with only no des the algorithm shows stagnation b ehavior however with

larger runtime it app ears that all runs could b e terminated successfully

Interestingly despite its size instance rbg with cities the largest ATSP instance of



The curve in that plot has b een tted with the C Grammes implementation of the MarquartLevenb erg algorithm

available in gnuplot The tted parameters are x and

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

1 1

0.9 0.9 "0.5%" "0.1%" "opt" 0.8 "1%" 0.8 "opt" f(x) 0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4

0.3 0.3 empirical solution probability empirical solution probability

0.2 0.2

0.1 0.1

0 0 0 10 20 30 40 50 60 70 80 90 100 0 50 100 150 200 250 300 CPU-time CPU-time 1 1

"2.5%" 0.9 "2%" "2%" "0.5%" "1%" "opt" 0.8 "opt" 0.8 f(x) f(x) 0.7

0.6 0.6

0.5

0.4 0.4

0.3 empirical solution probability empirical solution probability

0.2 0.2

0.1

0 0 0 50 100 150 200 250 0 50 100 150 200 250 300

CPU-time CPU-time

Figure Runtime distributions of iterated reduced opt on four ATSP instances RTDs are identied by

the required solution quality eg opt means optimal solution is required Given are the runtime distributions

for ryp upp er left side ft upp er right side krop lower left side and ftv lower right side

TSPLIB is easily solved if the acceptance criterion BetterEqual s s isused In this case an optimal

solution is found on average in seconds or lo cal search applications with the maximally

required runtime to solve this instance being roughly seconds The same instance could only

be solved in of the runs with maximally seconds if the acceptance criterion Better s s

is used In Figure we have plotted the runtime distributions for these two acceptance criteria

Such signicant dierences b etween these two acceptance criteria could only b e observed on the four

ATSP instances rbg rbg rbg and rbg Considering this fact in the later exp erimental

investigation we used the acceptance criterion BetterEqual s s for all ATSP instances

Observations from the RunTime Distributions

A general conclusion from the RTDbased analysis of ILS algorithms is that these algorithms tend

to quickly nd go o d solutions to symmetric as well as asymmetric TSPs But if very high solution

quality is required one could observe using the RTDplots that the ILS algorithms suer from search

stagnation which severly compromises ILS p erformance The empirical RTDs are in fact in nearly all

cases less steep than an exp onential distribution whichwell approximates the runtime distribution in

the lower part and therefore the algorithm can b e improved in the simplest case byintro ducing

o ccasional restarts after a xed numb er of iterations cuto time By restarting the algorithm after

an appropriately determined cuto time one actually forces the ILS algorithms solution probabilty

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

1

0.9 "BetterEqual-opt" "Better-opt" f(x) 0.8 g(x)

0.7

0.6

0.5

0.4

0.3 empirical solution probability

0.2

0.1

0 1 10 100 1000

CPU-time

Figure Runtime distributions for instance rbg using iterated reduced opt Given are two runtime

distribution one using acceptance criterion BetterEqual s s the other using Better s s Additionally two

exp onential distributions approximate eachofthetwo empirical RTDs indicated by f xandg x

1

0.9

0.8 "ILS-standard: 0.25%" "ILS-restart: 0.25%" f(x) 0.7

0.6

0.5

0.4 solution probability 0.3

0.2

0.1

0 1 10 100 1000

CPU time

Figure Example of improvements by using restart Given is the runtime distribution for reaching a

solution within of the optimum on instance att for Iopt indicated by ILSstandard and an ILS

algorithm using restart after an appropriately chosen cuto time indicated by ILSrestart The improved ILS

algorithm is able to follow the exp onential distribution indicated by fx which approximates ILSstandards

RTD in the left part See text for more details

distribution to follow the exp onential distributions This fact is exemplied in Figure for an Iopt

algorithm applied to instance att

Our investigation of the runtime distribution also shows that the more eective is the lo cal search

algorithm the less is aected the ILS algorithm from the stagnation b ehavior For example the

Iopt algorithm showed a very strong stagnation b ehavior on instance d when trying to nd the

optimal solution while Iopts RTD followed reasonably well an exp onential distribution On the

larger pcb instance both Iopt and Iopt were severely aected by the stagnation behavior

while ILK could solve this instance rather easily Yet when applied to larger instances ILK again

shows stagnation b ehavior and could b e considerably improved Hence one p ossible conclusion from

these observations is that the ILS algorithms will when applied to nontrivial instances show

stagnation b ehavior from a sp ecic instance size This instance size dep ends on the eectiveness of

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

the lo cal search algorithm

In summary the runtime distributions arising from the application of ILS algorithms to the

TSP suggest that these algorithms can b e further improved In the following we will present several

p ossibilities howsuch improvements can b e achieved followed by an empirical investigation of these

new ILS variants

Improvements of ILS Algorithms for the TSP

In this section we will presenttwo improved ILS algorithms for the TSP and then give results from

an extensive exp erimental comparison of these algorithms

Improved ILS algorithms

One conclusion from the observed stagnation behavior of ILS is that additional diversication

features are needed to increase ILSs p erformance There are two particular ways to increase the

diversication in ILS algorithms A rst p ossibility is to use acceptance criteria which allowmoves

to worse solutions or as prop osed b efore one may restart the algorithm A second p ossibilityisto

increase the strength of the solution mo dications implemented by Mo dify for the TSP this can b e

done by cutting the current tour at more than four p oints as it is done in the doublebridge move or

vary the strenght of the solution mo dications as it is also prop osed in basic Variable Neighborhood

Search basic VNS

Here we prop ose and exp erimentally investigate two improved ILS variants based on the rst

p ossibility which is also directly motivated byourRTDbased analysis of ILS b ehavior

a Soft Restarts

As argued b efore the simplest strategy to avoid stagnation b ehavior is to restart the algorithm

from new initial solutions after some predened cuto value Yet optimal cuto values may dep end

strongly on the particular TSP instance A b etter idea app ears to be best to relate the restart to

the search progress and to apply soft cuto criteria In particular we restart the ILS algorithm if no

improved solution could b e found for i iterations where i is a parameter The soft restart criterion

r r

is based on the assumption that after i iterations without improvement the algorithm is stuckand

r

that additional diversication implemented by restarting the algorithm from a new initial solution

is needed to escap e from there The restart of the algorithm can b e easily mo deled by the acceptance

criterion called Restart s s history the history comp onent indicates that the use of soft restarts

can b e interpreted as a very simple use of the search history Let i b e the last iteration in whicha

last

b etter solution has b een found and i b e the iteration counter Then Restart s s history is dened

as

s if f s fs

Restart s s history s if f s f sandi i i

r

last

s otherwise

where s can b e a randomly generated new initial solution

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

b FitnessDistance Diversicationbased ILS

A disadvantage of restarting ILS from new initial solutions is that previously obtained high quality

solutions are lost Additionally ILS algorithms need some initialization time t which will increase

init

with increasing instance size for nding very high quality solutions Hence with each restart a CPU

time t is wasted To avoid these disadvantages a b etter choice may be to use a more directed

init

diversication when the ILS algorithm is supp osed to be stuck Consequently we prop ose a new

metho d to escap e from the current search space region Our goal will be to nd a good quality

solution beyond a certain minimal distance from the current search point without using restart In

fact there are two ob jectives to b e taken into account to nd such a solution The rst is to generate

a distant solution the second is that this solution should b e of reasonable quality

We implemented this idea as follows Let s be the solution from which wewant to escap e and

c

the distance b etween solutions is measured as the numberofdierent edges Then the following steps

are rep eated until wehave found a solution b eyond a minimal distance d from s

min c

Generate an initial p opulation of p copies of s

c

To each solution rst apply Mo dify followed by an application of Lo calSearch

Cho ose the b est q of the p solutions q p as candidate solutions

Let s b e the candidate solution with maximal distance to s

c

If the distance b etween s and s is smaller than d then rep eat at otherwise return the

c min

candidate solution at maximal distance

The single steps are motivated by the following considerations The second ob jectivenda good

quality solution is attained bykeeping only the q b est of the p candidate solutions The rst ob jective

nd a solution b eyond a minimal distance to s isachieved bycho osing a candidate solution with

c



maximal distance from s The steps are then iterated until a solution s is found for which the

c



distance requirement d is satised In fact we stop this pro cess if wehave not found a solution s

min

beyond the required minimal distance after a maximal numb er of iterations here through these

steps

Exp erimental Analysis

This section presents the results of an exp erimental comparison of three ILS algorithms the stan

dard ILS algorithm used for the runtime analysis the ILS algorithm using soft restarts referred

to as ILSrestart and the ILS algorithm with tnessdistance based diversication referred to as

ILSFDD In ILSrestart and ILSFDD a restart diversication is initiated if for i iterations no

r

improved solution is found where i n for Iopt i n for Iopt and nally i n for

r r r

ILK n is the number of cities of a TSP instance For ILSFDD weusep q parameters

were chosen in an ad ho c manner without netuning Since an appropriate value for d maybe

min

instance dep endent we estimate d by the average distance d between when applying

min avg

LK lo cally optimal solutions and then setting alternatingly d d and d d In

min avg min avg

ILSFDD diversication is always applied to the b est solution found since the start of the algorithm

only when using LK this is done every second diversication This choice is motivated by results

on the TSP search space analysis where it was shown that the b etter a solution the closer it is on

average to a global optimum

The computational results are given in Table to Table for the ILS algorithms based opt

optand LKrespectively and in Table for the ILS application to the ATSPIneach table are

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

Table Comparison of Iopt ILSrestart and ILSFDD on symmetric TSPs For each instance the

number in the instance identier is the problem size we rep ort how often the known optimal solution is

found in a given numb er of runs n no trials the average p ercentage deviation from the optimum the

opt

average CPUtime t to nd the b est solution in a run and the maximally allowed computation time t

avg max

The algorithms were run on a MHz Pentium I I CPU with MB RAM running Redhat Linux

ILS opt ILSRestart ILSFDD

Instance opt t

max

n avg t n avg t n avg t

avg avg avg

opt opt opt

eil

kroA

lin

u

d

lin

pcb

rat

pr

pcb

d

fl

given the numb er of optimal solutions found by an algorithm in a given numb er of indep endent trials

the average p ercentage deviation from the optimum and the average runtime to nd the b est solution

in each trial Additionallywe indicate the maximal runtime t allowed for an algorithm t was

max max

chosen in roughly suchaway that larger instances are also given increasing runtime

In general the exp erimental results showthat the p erformance of all ILS algorithms can signif

icantly b e improved with resp ect to solution quality With the two ILS extensions the frequency of

nding optimal solutions is strongly increased and the average solution quality improves considerably

The only exception are the results obtained with ILSrestart using opt on the instances rat and

pr Since at least instance rat has shown apparent stagnation b ehavior in Figure when

using Iopt most probably the parameter i was chosen to o low Yet notice that also for these two

r

instances ILSFDD signicantly improves over standard Iopt Similarly when applying Iopt for

rat the frequency of nding the optimum is lower with ILSrestart than with Iopt Regarding

the ATSPs all instances showing stagnation b ehavior are well solved already by using ILSrestart see

Table and therefore we did not apply ILSFDD on these instances since apparently they do not

provide a real challenge

The relative p erformance of the three ILS algorithms dep ends strongly on the instance size In

particular for small problems ILSrestart and ILSFDD p erform very similarly to standard ILS if the

latter do es not showanyoronlyvery weak stagnation b ehavior notice that Iopt shows very strong

stagnation b ehavior on instance eil which is the smallest instance we tested Yet with increasing

instance size the p erformance improvement obtained with ILSrestart and ILSFDD b ecomes very

obvious

Similarly the p erformance advantage of ILSFDD over ILSrestart b ecomes more marked for larger

instances ILSFDD shows on all instances with more than cities either b etter average p erformance

and a higher frequency of nding the optimal solution or if b oth algorithms nd the optimal solution

in all runs a much lower average runtime It should also be noted that the p erformance of ILS

FDD using opt lo cal search is particularly go o d on instances whichareknown to b e hard for other

algorithms This is the case for fl and fl which are highly clustered as shown in Figure

on the right side On such instances also ILSrestart p erforms surprisingly go o d This is probably

due to the fact that these instances contain deep lo cal minima from which the ILS algorithm has

strong problems to escap e but which are overcome by restarting the algorithm from a new initial

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

Table Comparison of Iopt ILSrestart and ILSFDD on symmetric TSPs For each instance the

number in the instance identier is the problem size we rep ort how often the known optimal solution is

found in a given numb er of runs n no trials the average p ercentage deviation from the optimum the

opt

average CPUtime t to nd the b est solution in a run and the maximally allowed computation time t

avg max

The algorithms were run on a MHz Pentium I I CPU with MB RAM running Redhat Linux

ILS opt ILSRestart ILSFDD

Instance opt t

max

n average t n average t n average t

avg avg avg

opt opt opt

d

lin

pcb

att

rat

pr

pcb

d

fl

pr

pcb

fl

Table Comparison of ILK ILSrestart and ILSFDD on symmetric TSPs For each instance we rep ort

how often the known optimal solution is found in a given number of trials n no trials the average

opt

p ercentage deviation from the optimum the average number of LK applications i to nd the b est solution

avg

in a run and the maximally allowed number of LK applications

ILSFDD ILSRestart ILK

t Instance opt

max

n average i n average i n average i

avg avg avg

opt opt opt

lin

pcb

att

rat

pcb

pr

Table Comparison of Iredopt and ILSrestart on ATSPs For each instance we rep ort how often the

known optimal solution is found in a given number of trials n no trials the average p ercentage deviation

opt

from the optimum the average CPUtime t to nd the b est solution in a run and the maximally allowed

avg

computation time t The algorithms were run on a MHz UltraSparc I CPU with MB RAM running

max

Solaris

ILS opt ILSRestart

Instance opt t

max

n average t n average t

avg avg

opt opt

ryp

ft

krop

ftv

rbg

solution Also note that on these instances it app ears preferable to run opt since the runtime of

LK increases dramatically see also the more detailed discussion in while opt is not aected

by this phenomenon

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

Recently several high p erforming new approaches and improved implementations of known ap

proaches have b een presented for the TSP Among these algorithms we nd the genetic lo cal search

approachofMerzand Freisleb en anew genetic lo cal searchapproach using a repairbased

crossover op erator and bro o d selection by Walters a sp ecialized lo cal search algorithm for the

TSP called Iterative Partial Transcription ITP by Mobius etal and the ILS approach by

Katayama and Narisha which uses a newly designed solution mo dication mechanism inspired

by genetic algorithms The improved ILS algorithms and in particular ILSFDD compare very well

to these approaches When comparing algorithms using only opt lo cal search ILSFDD compares

favorably to Walters GA that algorithm is run on a MHz Pentium I I CPU ILSFDD achieves

in general higher accuracy results at for some instances lower runtimes ILSFDD with opt

also compares well with the so far best p erformance results obtained by Merz and Freisleb en with

their genetic lo cal search approach In they rep ort average times for nding optimal solutions on

instances linpcbattrat in and seconds resp ectively on a MHz

Pentium I I CPU running Solaris averages are taken over runs We obtained the same solution

qualityexcept att on which of runs did not yield the optimum at slightly larger runtimes

on the two larger instances Yet we strongly b elieve that by using a faster LK implementation like

Johnsons Merzs or the co de by Applegate Co ok Bixby and Chvatal the p erformance of ILSFDD

can b e further strongly increased Also note that the only other approachwhichmatches the results

of ILSFDD on the strongly clustered instances fl and fl is the ITP algorithm Yet our

approach has the advantage of b eing an easy implementable extension of an Iopt algorithm When

using LK lo cal search we obtained very high accuracy results for all the instances tested comparable

or b etter than the results rep orted in other researches Still the computation times of the LK could

b e signicantly improved by using one of the previously mentioned more netuned implementations

All in all our computational results showthatILS and in particular the prop osed ILS extensions

are highly comp etitive with more complex algorithms for the TSP

Conclusions

In this pap er wepresented a novel metho d for the systematic empirical analysis of lo cal search

algorithms based on runtime distributions While this metho dology has b een previously successfully

applied to combinatorial decision problems such as SAT here we use it for investigating and

improving the behavior of Iterated Lo cal Search algorithms for the wellknown Traveling Salesman

Problem

Our RTDbased analysis revealed that ILS algorithms for the TSP often show stagnation b ehavior

such that from some p oint in the search pro cess relatively little progress is made with resp ect to nding

higher quality solutions This phenomenon is observed not only for relatively simple ILS algorithms

based on opt and opt lo cal search but also for the more complex ILK algorithm one of the b est

p erforming approximate algorithms for large symmetric TSP instances as well as for ILS algorithms

for the asymmetric TSP Based on this observation we prop osed improved variants of ILS algorithms

for the TSP In an exp erimental analysis weveried that our strategies to overcome stagnation b ehavior

are eective and that the mo died algorithms show a signicantly improved p erformance

These results demonstrate that the RTDbased approach provides a good basis for analyzing

and improving the p erformance of Iterated Lo cal Search Algorithms in particular and other meta

heuristics in general We exp ect that by systematically applying this metho dology to other algorithms

and problem domains further new insights into the b ehavior of metaheuristics for hard combinatorial

problems can b e obtained which will facilitate the development of new improved algorithms and their

successful application

PUCRio Angra dos Reis Brazil July

MIC I I I Metaheuristics International Conference

Acknowledgements

Wewould like to thank Olivier Martin for making available his ILK implementation and for helpful

comments on this work This work was in part supp orted by a Marie Curie Fellowship awarded

to Thomas Stutzle CECTMR Contract No ERBGT and a Postdo ctoral Fellowship

awarded by the University of British Columbia to Holger H Ho os

Bibliography

RK Ahuja and JB Orlin Use of Representative Op eration Counts in Computational Testing of Algo

rithms INFORMS Journal on Computing

EB Baum Iterated Descent A Better Algorithm for Lo cal Search in Combinatorial Optimization

Problems Manuscript

JL BentleyFast Algorithms for Geometric Traveling Salesman Problems ORSA Journal on Computing

KD Bo ese Models for Iterative PhD thesis University of California Computer

Science Department Los Angeles

MR Garey and DS Johnson Computers and Intractability A Guide to the Theory of NP

Completeness Freeman San Francisco CA

P Hansen and N Mladenovic Variable Neighb ourho o d Search for the pMedian Technical Rep ort Les

Cahiers du GERAD G GERAD and Ecole des Hautes Etudes Commerciales

P Hansen and N Mladenovic An Intro duction to Variable Neighb orho o d Search In S Voss S Martello

IH Osman and C Roucairol editors MetaHeuristics Advances and Trends in Local Search Paradigms

for Optimization pages Kluwer Boston

HH Ho os and T Stutzle Evaluating Las Vegas Algorithms Pitfalls and Remedies In Proceedings

of the Fourteenth Conference on Uncertainty in Articial Intel ligence UAI pages Morgan

Kaufmann Publishers San Francisco CA

HH Ho os and T Stutzle Towards a Characterisation of the Behaviour of Sto chastic Lo cal Search

Algorithms for SAT Articial Intel ligence To app ear

DS Johnson Lo cal Optimization and the Travelling Salesman Problem In Proc th Col loquium on

Automata Languages and Programmingvolume of LNCS pages Springer Verlag

DS Johnson and LA McGeo ch The Travelling Salesman Problem A Case Study in Lo cal Optimization

In EHL Aarts and JK Lenstra editors Local Search in Combinatorial Optimization pages

John Wiley Sons

K Katayama and H Narihisa Iterated Lo cal Search Approach using Genetic Transformation to the

Traveling Salesman Problem In Proceedings of GECCO pages

EL Lawler JK Lenstra AHG Rinno oy Kan and DB Shmoys The Travel ling Salesman Problem

John Wiley Sons

S Lin and BW Kernighan An Eective Heuristic Algorithm for the Travelling Salesman Problem

Operations Research

O Martin and SW Otto Partitoning of Unstructured Meshes for Load Balancing Concurrency Practice

and Experience

O Martin and SW Otto Combining with Lo cal Search Heuristics Annals of

Operations Research

O Martin SW Otto and EW Felten LargeStep Markov Chains for the Traveling Salesman Problem

Complex Systems

P Merz and B Freisleb en Genetic Lo cal Search for the TSP New Results In Proceedings of ICEC

pages IEEE Press

P Merz and B Freisleb en Fitness Landscap es and Design In D Corne M Dorigo

and F Glover editors New Ideas in Optimization McGrawHill

Angra dos Reis Brazil July Brazil PUCRio

MIC I I I Metaheuristics International Conference

N Mladenovic and P Hansen Variable Neighb orho o d Search Computers Operations Research

A Mobius B Freisleb en P Merz and M Schreib er Combinatorial Optimization by Iterative Partial

Transcription Physical Review E

G Reinelt The Traveling Salesman Computational Solutions for TSP Applications volume of

LNCS Springer Verlag

A Rohe Parallele Heuristiken fur sehr groe Traveling Salesman Probleme Masters thesis Fachb ereich

Mathematik Universitat Bonn Bonn Germany

T Stutzle Local Search Algorithms for Combinatorial Problems Analysis Improvements and New

Applications PhD thesis FB Informatik TU Darmstadt

T Walters Repair and Bro o d Selection in the Traveling Salesman Problem In AE Eib en T Back

M Scho enauer and HPSchwefel editors Proc of Paral lel Problem Solving from NaturePPSNV

volume of LNCS pages Springer Verlag

C Young DS Johnson DR Karger and MD Smith Nearoptimal Intrapro cedural Branch Alignment

In Proceedings Symp on Programming Languages Design and Implementation pages

PUCRio Angra dos Reis Brazil July