2.1 Mutati<strong>on</strong> by 2optThe 2opt method is <strong>on</strong>e of the most well-known localsearch algorithms am<strong>on</strong>g <str<strong>on</strong>g>TSP</str<strong>on</strong>g> solving algorithms.It improves the tour edge by edge and reverses the orderof the subtour. For example, imagine a tour asshown in the upper part of Fig. 1. Remove the twoedges ab and cd, and reverse the order of the subtour(from b to c), and add the two edges ac and bd. Thisgives us a tour as shown in the lower part of Fig. 1.The lower tour is shorter than the upper <strong>on</strong>e becauseab + cd > ac + bd.tour lengthcrossoverchildtourFigure 2: Pop-up from local minima.adcbg =(D; H; B; A; C; F; G; E) means that the salespers<strong>on</strong>visits towns D, H, B, A, ..., E, successively, andreturns to town D.adFigure 1: The 2opt methodWe check every pair of edges, for example, ab andcd. Ifab + cd > ac + bd holds, we improve them in thesame way as shown in Fig. 1. Actually, ifbothac > aband bd > cd hold, then it is not necessary to check theedges. Therefore we can skip the pairs whose edgesare far away from each other.We repeat the procedures described above until nofurther improvement can be made.2.2 Crossover in Multiplicati<strong>on</strong>When we apply the 2opt method to a soluti<strong>on</strong>, thesoluti<strong>on</strong> often falls into a local minimum. Then it cannotbe improved further by the 2opt method. C<strong>on</strong>sidertwo soluti<strong>on</strong>s that have fallen into dierent localminima. Potentially, each soluti<strong>on</strong> may have the bestsubtour for a dierent part of the tour. Then, we canmake a better soluti<strong>on</strong> if we combine those best subtoursappropriately. We cannot say, of course, whichof the subtours are good, but after many trials, we canexpect ospring soluti<strong>on</strong>s to be located in the valleyof the global minimum as shown in Fig. 2.We propose a new crossover operator that acquiresthe l<strong>on</strong>gest possible sequence of parents' subtours.We named it `Greedy Subtour Crossover (GSX)'. Weshowed[3] by experiments that using the GSX, the soluti<strong>on</strong>can pop up from local minima more eectivelythan by using simulated annealing (SA) methods.In the GSX, we use the path representati<strong>on</strong> fora genetic coding. For example, the chromosomecbParentsPick up alphabets from the parents alternately.D H B A C F G EB C D G H F E AH B A C D GChildFigure 3: Greedy Subtour CrossoverAdd the rest of alphabetsin the random order.F EAlgorithm: Greedy Subtour CrossoverInputs: Chromosomes g a = (a 0 ;a 1 ;:::;a n01) andg b =(b 0 ;b 1 ;:::;b n01).Outputs: The ospring chromosome g.procedure crossover(g a ,g b ) ff a truef b truechoose town t randomlychoose x, where a x = tchoose y, where b y = tg tdo fx x 0 1 (mod n),y y +1 (mod n).if f a = true then fif a x 62 g then fg a x 1 g,g else ff a false.ggif f b = true then fif b y 62 g then fg g 1 b y ,g else f
gf b false.ggg while f a = true or f b = trueif jgj < jg a j then fadd the rest of townsto g in the random ordergreturn gNote that \1" in\g a x 1 g" is the c<strong>on</strong>catenati<strong>on</strong>operator, and that sentence means to add a x beforethe chromosome g.An example is shown in Fig. 3. Suppose that chromosomesof parents are g a =(D;H; B; A; C; F; G; E)and g b =(B;C; D; G; H; F; E; A). First, choose <strong>on</strong>etown at random. In this example, town C is chosen.Then, x = 4 and y = 1 because a 4 = C and b 1 = Crespectively. Now the child g is (C).Next, pick up towns from the parents alternately.Begin with a 3 (town A) because x 4 0 1=3,andnext is b 2 (town D) because y 1 + 1 = 2. The childbecomes g =(A; C; D).In the same way, add a 2 (town B), b 3 (townG), a 1 (town H), and the child becomes g =(H; B; A; C; D; G). Now the next town is b 4 = H andtown H has already appeared in the child (rememberthe salespers<strong>on</strong> may not visit the same town twice), sowe can't add any more towns from parent g b .Therefore we add towns from parent g a . The nexttown is a 0 = D, but D is already used. Thus we can'tadd towns from parent g a , either.Then, we add the rest of the towns, i.e., E and F,to the child in the random order. Finally the child isg =(H; B; A;C; D; G; F; E).3 <strong>JAVA</strong> applet3.1 Applet <strong>on</strong> WWWWe developed a <strong>JAVA</strong> applet based <strong>on</strong> the proposedmethod, and put it <strong>on</strong> our WWW page:http://www.hitachi.co.jp/Div/sdl/e-naiyo/e-seika22/<str<strong>on</strong>g>TSP</str<strong>on</strong>g>.htmlIt is easy to use. First, using a mouse, put \towns"in the rectangular eld. Then, push the \start" butt<strong>on</strong>.The applet solves the problem you've just madeand displays the tour and its length (Fig. 4). Theparameters of the 2opt<str<strong>on</strong>g>GA</str<strong>on</strong>g> method, i.e., \Populati<strong>on</strong>"(M), \Selecti<strong>on</strong>" (p e ), \2opt" (p i ), are adjustable bylling out each eld <strong>on</strong> the applet.We announced the web page <strong>on</strong> the Net News inJapanese (fj.* newsgroups) <strong>on</strong>ly <strong>on</strong>ce in July 1996.Since then, the page has been accessed more than 200times a m<strong>on</strong>th.One pers<strong>on</strong> who sent us comments had mistakenlythought that <str<strong>on</strong>g>GA</str<strong>on</strong>g> was a tool <strong>on</strong>ly for experiments, andthat <str<strong>on</strong>g>GA</str<strong>on</strong>g> would be so slow that it could not be appliedto practical problems. But after accessing our webpages, he could understand why <str<strong>on</strong>g>GA</str<strong>on</strong>g> is usable.2.3 Natural Selecti<strong>on</strong>Eliminate R = M 2 p e =100 individuals. In the socalledsimple <str<strong>on</strong>g>GA</str<strong>on</strong>g>, the possibility of survival is proporti<strong>on</strong>alto the tness value, but we pay more attenti<strong>on</strong>to the diversity of the populati<strong>on</strong>. We eliminatesimilar individuals to maintain the diversity in orderto avoid the immature c<strong>on</strong>vergence that is <strong>on</strong>e of thewell-known problems in <str<strong>on</strong>g>GA</str<strong>on</strong>g>.First, sort the individuals in tness-value order.Compare the tness value of adjoining individuals. Ifthe dierence is less than " (a small positive real number),eliminate preceding individual while the numberof eliminated individuals is less than R. Let r be thenumber of eliminated individuals.Next, if r