USING L-SYSTEMS TO GENERATE ARBITRARILY LARGE INSTANCES OF THE EUCLIDEAN TRAVELING SALESMAN PROBLEM WITH KNOWN OPTIMAL TOURS Adrian Mariano Center for Applied Mathematics, Rhodes Hall Cornell University, Ithaca, NY 14853, USA
Pablo Moscato 1
CeTAD, Universidad Nacional de La Plata, C.C. 75, 1900 La Plata, Argentina email:
[email protected]
Michael G. Norman 2
Department of Computer Science, University of Edinburgh, Edinburgh, 3H9 3JZ, Scotland, United Kingdom
ABSTRACT: Very recently, four dierent types of instances of the Euclidean Traveling Salesman Problem (ETSP) on the plane have been introduced. The coordinates of the cities have been de ned with the aid of geometric iterative constructive processes. For each one of these instances, a unique optimal tour through the cities has been provided. Due to the nature of the constructive processes and the induction proofs of optimality, they provide us with a remarkable set of instances of the ETSP with arbitarily many cities, and with known optimal tours of dierent fractal dimensions. In this paper we show how Lindenmayer's parallel rewriting systems , also known as L-Systems , can be used to encode the instances and the optimal tours. We present a general framework for the practical issues of the automatic generation of ETSP instance in TSPLIB format from L-Systems. KEYWORDS: Traveling Salesman Problem, Heuristics, Lindenmayer's L-Systems, Space-Filling Curves. RESUMO: Recentemente, quatro tipos de inst^ancias do Problema do Caixeiro Viajante Euclidiano (ETSP) no plano foram apresentadas. As coordenadas das cidades s~ao de nidas com ajuda de processos iterativos construtivos geometricos. Para cada uma dessas inst^ancias, existe uma unica rota otima entre as cidades. Devido ao mecanismo dos processos construtivos e as provas de induca~o de otimalidade, eles nos fornecem um notavel conjunto de inst^ancias para o ETSP, com um numero arbitrariamente alto de cidades, com as rotas otimas conhecidas e de diferentes dimens~oes fractais. Neste artigo, nos mostramos como \Lindenmayer's parallel rewriting systems", tambem conhecidos como L-Systems, podem ser usados para codi car as inst^ancias e as rotas otimas. Nos apresentamos uma ferramenta geral para a geraca~o automatica destas inst^ancias com o proposito de produzir arquivos no formato TSPLIB. PALABRAS-CHAVE: Problema do Caixeiro Viajante, Heursticas, \L-Systems", \Space-Filling Curves".
Introduction, Motivation and Previous Work The Euclidean Traveling Salesman Problem (ETSP) is one of the most studied combinatorial optimization problems and its associated decision problem is among the most interesting members of the NP-complete class. The optimization version can be de ned as Find the shortest Hamiltonian cycle through a complete graph on a set of cities, with edges weighted by Euclidean inter-city distance. The ETSP on the plane has provided much of the motivation for the development of Complexity Theory. It plays the role of a test-bed for many general heuristics for other optimization problems in Operations Research like Vehicle Routing, Job Sequencing, etc. It is one of the test-problems for general metaheuristics like Tabu Search, Genetic Algorithms, Simulated Annealing, Memetic Algorithms, etc. [1]. In addition to its signi cance for evaluating approximation algorithms and heuristics, there are other researchers who use ETSP instances to help them develop exact methods based on Branch-and-Bound and, more recently, on Branch-and-Cut techniques. 1 2
Prof. de Apoyo a la Inv., C.I.C.P.B.A. Current address: Makespan Limited, 8 Gay eld Square, Edinburgh, EH1 3NT, Scotland, United Kingdom
A common test suite of instances of the TSP is of tremendous importance for comparing results. Such a public domain database was set up ve years ago. It is named TSPLIB and it is widely accesible from Internet using ftp 3 . TSPLIB contains many large TSP instances solved to optimality. There is a clear need to develop a suplementary test suite of ETSP instances with known optimal solutions. Exact methods often require state-of-the-art Branch-and-Cut codes, which are laborious to implement, and the use of the most powerful supercomputers. The most striking need stems from the fact that some heuristics for the problem have low complexity so huge test cases well beyond today's best algorithms and supercomputers are needed. For example, D.S. Johnson reported some computational studies using O(N log N ) heuristics using TSP instances with more than 1,000,000 cities [2]. To test heuristics with instances of that size, Johnson was constrained to rely on asymptotic expected formulae for the length of the optimal tour. Asymptotic formulae exist only under the assumption that the cities' coordinates are generated with some given probability distribution for which an analytical result can be derived. We will rst present two ETSP instances which have fractal dimension two. Then we will show how the L-systems allow us to code four instances studied in [3] and [4] along with their optimal tours. A computer program which produces instances in TSPLIB format from L-Systems will be available from the authors 4 .
MNPeano In 1959, Beardwood, Halton and Hammersley derived the formula p Lopt(N; A) = K NA (1) for the optimal tour length (Lopt ) of N cities randomly, uniformly distributed over a rectangular area of A units (see Ref. [7] in [1]). Since then, many researchers have tried to bound the constant K (see [4] for an account of those attempts). For uniform point sets of size 104 inside a unit square D.S. Johnson has observed a lower bound on Lopt of 71:5 (which implies an eective lower bound of Keff = 0:715 for that size) and he conjectures that for a set of that cardinality Lopt has the value 72:5 [5]. Recently, a self-avoiding space- lling curve was shown to be an optimal tour through a corresponding set of an arbitrarily large number of cities contained in the unit square. This curve was called MNPeano to honour Giuseppe Peano's construction of the rst space- lling curve (1890). In addition, the length of the optimal tour presents the same scaling behavior as the instances generated with a random, uniform p distribution inside a unit square. For an optimal tour through 1,485,484 cites, the ratio Lopt = NA 0:7152453 is in close agreement with Johnson's bound (with the square being de ned as the smallest square containing the set of cities). Johnson has reported computational studies with TSP instances with those large numbers of cities. The asymptotic value of K for MNPeano has been calculated exactly [4] and it is
p p (4 + KMNPeano = Lopt= NA = p 2) 0:71478270: 459=8
(2)
MPeano
Another interesting ETSP instance with known optimal solution was named MPeano [4]. It is very similar to MNPeano: at the same order, the optimal tours of MPeano and MNPeano follow the same path, but the set of cities of the latter is a proper subset of the cities of MPeano. One dierence between the two instances is that for MPeano the classic greedy O(N log N ) procedure yields the unique optimal tour for all choices of the initial city. The procedure Nearest-Neighbor Heuristic: Starting at an arbitrarily chosen initial city, repeatedly choose for the next city the unvisited city closest to the current one, breaking ties randomly. Once all cities have been chosen, close the tour by returning to the initial city. 3 TSPLIB is compiled and maintained by Gerhard Reinelt of the \Institut fur Angewandte Mathematik, Universitat Heidelberg", E-Mail
[email protected]. 4 This paper and related materials can be obtained from http://cam.cornell.edu/adrian/tsp.html.
gives as output the unique optimal tour regardless of the selection of the initial city [3]. However, MPeano can be used to test other algorithms and is particularly suited to those based on iterative improvement as well as the other metaheuristics mentioned before.
KochTour's L-System code and basic commands To understand how we have coded the two previous TSP instances and their associated optimal tours with L-Systems ( rst introduced by Aristid Lindenmayer as a theoretical framework for studying the development of simple multicellular organisms, see [6] and [7]), we rst start with another TSP instance called KochTour. The optimal solution of the instance KochTour (at a given order) is Koch's curve, originally introduced by Koch in 1904 (see Fig. 1.1 in [7]). This is a well-known example of self-similarity and it is included in any popular account on fractal and pattern formation. An intuitive way to visualize the ETSP instance is just to think that there is one city located at the vertex of each angle of the curve. The L-Systems's code is very compact: KochTour f Angle 6 ; All turns will be 360/6 degrees Axiom F??F??F ; an equilateral triangle F=F+F??F+F g This is a short recursive program in which the Axiom, also known as the initiator [7] is an expresion in which each character F is replaced according to the production rule or generator F=F+F??F+F. The number of times that the replacements are performed is called the order. Figure 2 shows KochTour at order 2. We have decided that the L-System codes for ETSPs must comply with the notation of a widely-disseminated freeware software package called FRACTINT 5 , which contains an L-System code to generate fractals curves developed by one of the authors of this paper (A.M). Interpreting each F as a step in a forward direction and the subsequent creation of a city at the end of that step, the whole expression (after replacement of all characters) can be understood as a program to create the ETSP instance le. The + and ? signs indicate a change of direction, in this case 60 degrees to the left or right respectively. Our program takes as input this L-System's code and outputs a le in TSPLIB's format. For KochTour we have used the following basic commands: F Draw forward + Increase angle G Move forward ? Decrease angle The following commands provide more exibility for coding changes in direction. (For more information, please refer to FRACTINT's documentation.)
nnn Increase angle nn degrees M Move forward /nn Decrease angle nn degrees D Draw forward Other characters are perfectly legal in command strings. They are ignored for drawing purposes (as in FRACTINT), but can be used to achieve complex translations.
MPeano and MNPeano L-System code To create MPeano and MNPeano instances we use some other commands from the \advanced command set" which includes j Try to turn 180 degrees. (If Angle is odd, the turn will be the largest possible turn less than 180 degrees.) @nnn Multiply line segment size by nnn. nnn may be a plain number, or may p be preceded by I for inverse, or Q for square root. (e.g. @IQ2 divides size by 2.) ! Reverse directions. (Switch the meanings of + and ?.) [ Push. Store the current angle and position on a stack. ] Pop. Return to the location of the last push. 5 FRACTINT is available by anonymous FTP from wuarchive.wustl.edu in the le /mirrors/msdos/graphics for DOS or /mirrors/msdos/window3 for Windows. A Unix version is available from sprite.berkeley.edu in xfract203.shar.Z.
With the commands introduced above we can code both the MPeano and the MNPeano instances. Their codes are: MNPeano f Angle 8 Axiom FFZA++FF++BZ@
[email protected]++FF A=@
[email protected] B=FF Z=ZA-@Q2F@IQ2-BZ@
[email protected]++FF++FFZA-@Q2F@IQ2-BZ g MPeano f Angle 8 Axiom FFA++FF++FFA++FF A=A?@Q2F@IQ2?FFA++FF++FFA?@Q2F@IQ2?FFA g Figure 1 shows MNPeano order 3. MPeano order 3 is exactly like MNPeano at the same order but with extra cities at the mid-point of each long edge in MNPeano.
DavidTour The last L-System code we will present in this paper can create the odd orders of the ETSP instance named DavidTour and was rst introduced in [3]. The initiator is a hexagon, and the production rules draw a curve known as the Sierpinski arrowhead. We have used the same production rules used by A. Mariano in FRACTINT (see also Fig. 1.10.b in [7]). DavidTour f ; this code is only valid for odd orders Angle 6 Axiom F+F+F+F+F+F F=!F!?F?!F! g DavidTour order 3 is displayed in Figure 3. At present, there is no general heuristic for the ETSP which outputs the optimal tour for this instance (see [3]). This is an interesting issue for future research.
Acknowledgments: The basis for this work was done while M.N. was in Argentina and his visit was funded under an agreement between the Royal Society (U.K) and CONICET (Argentina). P.M. wants to thank R.E. Berretta for her help during the preparation of this paper. This work was done while A.M. was supported by a National Science Foundation Graduate Research Fellowship.
REFERENCES [1] P. Moscato. An introduction to population approaches for optimization and hierarchical objective functions: The role of tabu search. Annals of Operations Research, 41(1-4):85{121, 1993. [2] D.S. Johnson. Local optimization and the traveling salesman problem. In Proceedings of the 17th Colloquium on Automata, Languages and Programming, volume 443, pages 446{461, Berlin, 1990. Springer-Verlag. Lecture Notes in Computer Science. [3] P. Moscato and M.G. Norman. An analysis of the performance of traveling salesman heuristics on in nite-size fractal instances in the euclidean plane. Technical report, CeTAD - Universidad Nacional de La Plata, 1994. submitted - Oct. 1994. [4] M.G. Norman and P. Moscato. The euclidean traveling salesman problem and a space- lling curve. Chaos, Solitons and Fractals, 1995. to appear. [5] J.L. Bentley. Experiments on traveling salesman heuristics. In First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 91{90, San Francisco, CA, January 1990. [6] G. Rozenberg and A. Salomaa. The Mathematical Theory of L-Systems. Academic Press, 1980. [7] P. Prusinkiewicz and A. Lindenmayer. The Algorithmic Beauty of Plants. Springer-Verlag, New York, 1990.
Figure 1: MNPeano at order 3.
Figure 2: KochTour at order 2.
Figure 3: DavidTour at order 3.