,..' MIT LIBRARIES .; 3 9080 02239 0261 • HD28 ft DEty£y .M414 89 On the Spacefilling Curve Heuristic for the Euclidean Traveling Salesman Problem Dimitris Bertsimas Sloan School of Management Massachusetts Institute of Technology Michelangelo Grigni of Mathematics Massachusetts Institute of Technology Department M.T Sloan School Working Paper No. 2105-88 MASSACHUSETTS INSTITUTE OF TECHNOLOGY NOV 1 4 2000 LIBRARIES On the Spacefilling Curve Heuristic for the Euclidean Traveling Salesman Problem Dimitris Bertsimas* Sloan School of Management, Rm. E53-359 Massachusetts Institute of Technology Cambridge, MA 02139 Michelangelo Grigm* Department of Mathematics Massachusetts Institute of Technology Cambridge, December MA 18, 02139 1988 Abstract Bartholdi and Platzman [3] proposed the spacefilling curve heuristic for the Euclidean Traveling Salesman Problem and proved that their heuristic returns a tour within an worst-case ratio O(lgn) is factor of optimal length. in fact 0(1). showing the O(lgn) upper bound "This research In this note we They conjectured that the exhibit a counterexample is tight. Foundation under grant ECS- is partially supported by the National Science is based upon work supported under a National Science Foundation Graduate 8717970. T This material Fellowship. Introduction 1 Bartholdi and Platzman proposed a heuristic [3] man Problem (ETSP) based continuous map from the unit <f> as a total linear ordering may be Their curve on a spacefilling curve. means <$ on the x if — < y points of the unit square < — x' fall in standard position with vertices same First rotate at (0.0), (1,0), denoted by an arrow). In the following we means < < 1 x' + points from the lower all subtriangle is left y') left and we apply a recursive (for this into transformation to our figures this orientation in is refer to this triangle as the 'unit triangle". <^ In figure 1(b) this (x',y'). we Now the same subtriangle. fall in similar to the original unit triangle, so we may where d this (oriented) recurse. After t iterations are considering has a hypotenuse of length n the scale of the original unit square), hence the process halt after 0(\og(l/d)) iterations, , subtriangle precede points from the upper right of taking subtriangles, the subtriangle (j 1 In figure 1(a), and enlarge the triangle and (1,1) the unit triangle, then (x,y) y' in subtriangle. Otherwise, both points 20 -0/2 define This ordering . <4> (x',y'). triangle, be uniquely defined, we have to orient the triangles; y we the order. first in then (x,y) y', the ordering on points in such a triangle. + [0, l] 2 points from the lower right triangle precede points from the upper all Otherwise, both points triangle. x a uniformly defined by a recursive procedure; for any two distinct points (x, y) and (x In the unit square, If is interval to the unit square. For our purposes the procedure will eventually decide which point comes this Euclidean Traveling Sales- for the is is guaranteed to the Euclidean distance between the two input points (x, y) and (x',y'). Now we [3]: point. As remarked in [4], this heuristic is pair of k-bit fractions, a 2fc-bit sorting key (t is S given a set of n points in the unit square, the points in the order $ defined above, and finish the tour by returning to the visit first describe the heuristic of really an inverse 4>~ l (x,y) where interval onto the unit square). and then sorted (by radix-sort input <f> is very may be computed t O(kn) all the keys bit operations, in i.e. input as a (x, y) in O(fc) bit defined as a continuous Given n such points, [1]) in Given point fast. operations map from the unit may be computed time linear in the size. Let L^(5) be the length of the tour produced by this heuristic, and the length of the optimal tour. In [5] they proved that L '(S)/L {S) further conjecture that the worst case ratio by exhibiting a simple set Sn m 4 is of n points with in fact 0(1). We = ) L'(S) be O(lgn). They refute this conjecture L '(Sn)/L"(Sn = 0(lgn). <i let A 2 0(lgn) Example Consider n points uniformly spaced along the line from (1/3,1/3) to (1,1/3). Pre the set of points cisely, define Sn = l(x it yi) = I- + This definition of Sn is 2i_- 2 for ' 3 2n -J 1 <i <n\ (1) convenient for our proof, but in fact any reasonably uniform — distribution on the line y 1/3 would points in the order of increasing i, suffice. The optimal tour on and has length L*(S„) < 4/3. It Sn now visits the suffices to show: Theorem length 2.1 = For n k traversing , Sn in the order of curve o produces a tour of L*{Sn ) > 2k 19. Proof: The basic idea visits 2 is Sn and observe , to recursively decompose the order that the that at each level there are significantly long 'jumps'. Let Ok be the length of the path produced by traversing <f> (note at < //(Sn) spacefilling curve since Sn i*(5n ) counts the extra edge used in the order of curve to close the path into a cycle). Let bk be the length of the path traversed by the heuristic on the following similar set of 7? = 2 k points: H^H3 5 + 3-^'3J (a) Figure 1: In both the square points of subtriangle 2. for ^^"l (2) (b) (a) and the triangle (b), points of subtriangle 1 precede By the recursive definition of hence in 5„; We now and let 7\, Sn of bk = the points of S'n are visited in the <p. lie in as those a k /2. derive a recursion for a k T2l same order T4 J3, . denote the subtriangles T2 subtriangles 7\, and , T In figure 2, let T3 in Hence . denote the entire unit triangle, the order visited by ak sum the is The <f>. points of the path lengths within each subtriangle, together with the lengths of the jumps between consecutive subtriangles. The n/4 ak . 4> is points of Sn form a half-scale image of S'n T\ f] Similarly the n/A points of reversible Sn f]T2 form contributing another term of b k _ 2 /2 to a k where j 12 is and j 2 3 bk _ 2 of +a fc Sn / 2 _i/2 jump , + J12 +J23 we need to same , 4 . Since as the path in T\. Finally the n/2 points of = (afc_2 + a*-i)/2 last point in know the T2 first Sn f)T3 form + .7i2 + j 2A first point in to the first point in and a Hence . the last point in T] to the jump from the lengths . the is contributing a k _i/2 to a k jump from the length of the estimate these in image the length of the is contributing b k _ 2 /2 to a reversed half-scale image of S'n points within that triangle), the length of their path aA , 4 'reversing the arrow' of a triangle exactly reverses the order of (i.e. half-scale reversed , last points of S'n T2 . T3 To . visited each subtriangle. Lemma order <f> Figure 2.2 For n is 2: (xi,yi), The = first k , and the k > 1, the first T2 and Sn (and by similarity where p = (n/2) + 1. point in last point is (x p ,y p ) set 5i 6 in the unit triangle reversed copy of S'4 in point 2 T decomposes into a copy of S'4 a reversed copy of Sg in , and the ninth point last S'n ) under T3 . Curve (marked by arrowheads). <j> visits in 7\, a the leftmost Proof: Let the points of Sn be indexed as < k For k 2. The in T\. > we again use 3, Sn points in form a half-scale image of S'n The last point of is (Z(n/2)+l,y(n/2)+l) of Now we <i< 1 and inductively the , find the Sn first point first T3 The the last point in is Sn T is inspection for the points in . = among them Sn point first T3 {x 1 ,y l ). is (~)T3 are a half- (x(n/2)+i>y(n/2)+i), 1 < < * corresponds to the 5n / 2 would be point visited in in By n/4}, with identical indices. They reversed, the last point visited in Inductively the - T ?/,), , Since the order Sn / 2 in 4 t , point of first image of Sn / 2 label them {(-r^y-) scale reversed in Sn , The figure 2. are {(z f] Ji the definition (1). in (x'1 .y[); n /2J- first point this is point . jumps distances ju and and last points of Sn in j'23- For & > 3, we may apply the lemma T]5 T2, and T3 The last point in T\ has — n/8 + 1, and the first point in T2 (since it is reversed) has index 3n/8. index = n/2, and the first point in T3 has index Similarly the last point in Ti has index 3?>/4 + 1. Hence j 12 = (n/4 - l)(2/3n) = 1/6 - 2/3??, j 23 = {n/4 + l)(2/3n) = to the find the first . i i 1/6 + 2/3n, so for k > 3 we have the simple a* From the base Finally cases a ! we have I* (5 , ri = -(«i-i +0A-2J Bertsimas [2] applies the spacefilling curve heuristic to the Euclidean Probabalistic and a probability For a tour r on S, points of X in 2fc/9+(4/27)(-l/2)*+5/27. PTSP p, for is defined as follows: each point (i„j/,) G S. then generated by including each point (x Pi. g- ) Traveling Salesman Problem which points + = 1/3, a 2 = 2/3 follows that a k = = a k + 1/3 > 2fc/9 as claimed. Application to the 3 recurrence: let T to choose tour r to get r was chosen by the we may show that in ?/,) L (X) be the length the order followed in is t , T E[L (X)] r. in X we are given A random a set instance X 5 of n C S is independently with probability of the tour generated by visiting the Suppose tour a minimizes E[L"(X)}\ the goal close to spacefilling heuristic. E[L° (X)). Let L*{X) be the length when Then by a similar analysis as in section 2 the worst case, E[L+(X)]/E[L"(X)] = 0(lgn). 4 Concluding Remarks Similar examples hold for other curves in the unit square, in particular the Hilbert curve (figure 3(a)) and 'zig-zag' curve (figure 3(b)) mentioned in curve, take n points along the diagonal line x points uniformly along the horizontal line y curve <f> + = y = 1/2. [4]. For the Hilbert 2/3. For the zig-zag curve, take Numerical experiments with the strongly suggest that n points uniformly spaced on a 'random' line across the unit square have expected tour length £'[£'*] (a) (b) = 0(lgn). rithms. Addison- Wesley, 1974. [2] D. Bertsimas. Probabilistic Combinatorial Optimization Problems. Ph.D thesis, Technical report 194 (1988), Operations Research Center, Massachusetts Insti- tute of Technology, Cambridge, Mass. [3] J. J. Bartholdi. L. K. Platzman. An 0(N log N) Planar Traveling Salesman Heuristic Based on Spacefilling Curves. Operations Research Letters, 1 (1982), 121-125. [4] J. J. Bartholdi, L. K. Platzman. Heuristics Based on Spacefilling Curves for Combinatorial Problems in Euclidean Space. Management Science, 34. no. 3, (19S8), 291-305. [5] L. K. Platzman, J. J. Bartholdi. Spacefilling Curves and Planar Traveling Sales- man Problem. PDRC technical 19S3 (to appear in JACM). report 83-02, Georgia Institute of Technology. Mar Date Due ?nor '•' '"'"'' ' 3 9080 02239 0261 DUPL , .v : ;; .:.',; ; «..';