Optimal Empty Pseudo-Triangles in a Point Set∗
Total Page:16
File Type:pdf, Size:1020Kb
CCCG 2009, Vancouver, BC, August 17{19, 2009 Optimal Empty Pseudo-Triangles in a Point Set¤ Hee-Kap Ahny Sang Won Baey Iris Reinbachery Abstract empty pseudo-triangle, and (2) minimizing the longest maximal concave curve of the empty pseudo-triangle. Given n points in the plane, we study three optimiza- We ¯rst study these problems when the three convex tion problems of computing an empty pseudo-triangle: vertices are given. We will later consider optimizations we consider minimizing the perimeter, maximizing the over all possible pseudo-triangles in a point set. area, and minimizing the longest maximal concave chain. We consider two versions of the problem: First, 2 Empty Pseudo-Triangles with Given Corners we assume that the three convex vertices of the pseudo- triangle are given. Let n denote the number of points In this section, we consider ¯nding empty pseudo- that lie inside the convex hull of the three given ver- triangles in a given triangle that contains a set P of tices, we can compute the minimum perimeter or maxi- n points in its interior. mum area pseudo-triangle in O(n3) time. We can com- pute the pseudo-triangle with minimum longest con- 2.1 Preliminary Observations cave chain in O(n2 log n) time. If the convex vertices are not given, we achieve running times of O(n log n) Observation 1 Every empty pseudo-triangle parti- for minimum perimeter, O(n6) for maximum area, and tions P into three subsets. O(n2 log n) for minimum longest concave chain. In any case, we use only linear space. It follows that the convex hull of each subset is enclosed by the convex hull of each concave curve. An empty pseudo-triangle that either minimizes the perimeter or 1 Introduction maximizes the area, is a simple polygon with concave vertices taken from P such that there are no points of A pseudo-triangle is a simply connected region of 2 P in its interior. The longest maximal concave curve R with exactly three convex vertices such that the is minimized by a concave polygonal chain on vertices boundary curves connecting pairs of these convex ver- of P . Therefore, it su±ces to ¯nd an empty polygo- tices must be concave. When all three boundary curves nal pseudo-triangle for each of the three optimization are polygonal, a pseudo-triangle is a simple polygon problems, and in the remainder of the paper we only with exactly three convex vertices, that is, all the other consider such polygonal pseudo-triangles. vertices are concave (we consider a vertex with inter- nal angle ¼ to be concave). By de¯nition, any triangle Let T; L; and R be the three corners of the input tri- is a pseudo-triangle. Moreover, the convex hull of any angle. W.l.o.g. we assume that the segment connecting pseudo-triangle is a triangle. L and R is horizontal with L to the left of R, and that Pseudo-triangles were introduced in the context of T lies above the segment. Let P be a set of n points in- computing visibility relations among convex obstacles side the triangle. We let L = t0; t1; : : : ; tn; tn+1 = R in R2 [8, 7]. Later, a number of di®erent optimiza- be the sequence of points in P [ fL; Rg sorted in tion problems of pseudo-triangulations, partitionings counter-clockwise order around T . Similarly, let R = of a region into polygonal pseudo-triangles, have been l0; l1; : : : ; ln; ln+1 = T be the sorted sequence around studied [1, 2, 5, 6, 9]. For an overview of pseudo- L, and let T = r0; r1; : : : ; rn; rn+1 = L be the sorted triangulations, we refer to the survey by Rote et al. [10]. sequence around R in counter-clockwise order. Here, we are interested in an \empty" pseudo-triangle Assume that we are given an empty pseudo-triangle. in the sense that, given a ¯nite set of points in R2, it At each corner, there are two concave chains, left and contains no points from the set in its interior. In par- right. Let li; rj, and tk be the ¯rst vertices encountered ticular, we consider the following problems: (1) either when we follow the left concave chain from L; R, and minimizing the perimeter or maximizing the area of the T , respectively. Figure 1 shows these vertices and three lines, each induced by a corner and its corresponding ¤This work was supported by the Korea Research Foundation vertex. Consider the gray region bounded by the lines Grant funded by the Korean Government (MOEHRD, Basic Re- `(L; l ) and `(T; t ). All points from P inside the gray search Promotion Fund) (KRF-2007-331-D00372). i k yDepartment of Computer Science and Engineering, region must be enclosed by the concave chain connecting POSTECH, fheekap, swbae, [email protected] L and T . Therefore the polygonal chain enclosing the 21st Canadian Conference on Computational Geometry, 2009 T T tk li rj L R Figure 1: Every empty pseudo-triangle can be uniquely determined by a tuple (i; j; k) of indices. li L points in the gray region is uniquely de¯ned by li and tk, and we denote the chain by CL(i; k). Analogously, the Figure 2: CL(i) consists of a star-graph SL(i)(dotted concave chain CT (k; j) connecting T and R is uniquely segments) and a tree UL(i)(solid segments). de¯ned by tk and rj, and the concave chain CR(j; i) connecting R and L is uniquely de¯ned by rj and li. By de¯nition, li is the ¯rst vertex along CL(i; k), there- Lemma 1 Every empty pseudo-triangle is uniquely de- fore the vertices of C (i; k) must lie in a wedge (or on termined by a tuple (i; j; k). L its boundary) bounded by the lines `(L; li) and `(T; li) and lying above l as in Figure 2. Let P (i) be the Let ¿(i; j; k) be the empty pseudo-triangle determined i L set of points from P that lie in the wedge, and let by the tuple (i; j; k). Note that not every tuple deter- K (i) := fk j 1 · k · n; t 2 P (i)g. mines an empty pseudo-triangle. L k L For a polygonal chain C, let jCj be the total sum Lemma 2 CL(i) consists of 2jKL(i)j noncrossing seg- of the edge lengths in the chain. Then j¿(i; j; k)j = ments. jCL(i; k)j + jCT (k; j)j + jCR(j; i)j. So we can formulate the problem of ¯nding the minimum perimeter pseudo- For CL(i), let SL(i) denote the set of segments connect- triangle as follows. ing T and tk with k 2 KL(i), and let UL(i) denote the set of segments in CL(i) n SL(i). Then UL(i) is a tree minfj¿(i; j; k)j j 1 · i; j; k · n; ¿(i; j; k) is emptyg with root L that spans all verticesS in PL(i) n fT g. Similarly, we de¯ne CT (j) := k2[1;n+1] CT (k; j), and Note that the problem of ¯nding the maximum area the set PR(j) ½ P of all points that lie above rj and in pseudo-triangle can be formulated likewise, except that the wedge bounded by the lines `(T; rj) and `(R; rj). the area must be maximized. Then CT (j) also consists of 2jKT (j)j noncrossing seg- ments, where KT (j) := fk j 1 · k · n; tk 2 PT (j)g. 2.2 Minimizing the Perimeter or Maximizing the Area 2.2.1 Minimizing the perimeter Recently, van Kreveld and Speckmann showed that The following algorithm shows how to ¯nd for a pair given a triangle with n points inside it, there can be of indices (i; j) the index k that minimizes jCL(i; k)j + 3 £(n ) di®erent empty polygonal pseudo-triangles [11]. jCT (k; j)j. By Lemma 1, each of them is uniquely determined by a tuple (i; j; k). A brute-force (n4)-time algorithm can be Algorithm ShortestPseudo-triangle designed as follows: for every pair of indices (i; j), iter- Input: A set P of n points inside a triangle ate k from 1 to n and compute the two concave chains, Output: The empty pseudo-triangle with minimum CL(i; k) and CT (k; j). During the iteration on the in- perimeter dex k, we can compute CL(i; k + 1) from CL(i; k), and 1. Sort P in angular order around L, R, and T CT (k + 1; j) from CT (k; j) in linear time. 2. for 1 · i; j · n + 1 To reduce the time complexity, we propose a faster 3. Compute CR(j; i) way to compute the chains CL(i; k) and CT (k; j). For 4. Build CL(i) and CT (j) an index i, we de¯ne 5. for each k 2 KL(i) \ KT (j) [ 6. Traverse UL(i) and UT (j), evaluate CL(i) := CL(i; k): jCL(i; k)j and jCT (k; j)j k2[1;n+1] 7. Maintain the smallest j¿(i; j; k)j CCCG 2009, Vancouver, BC, August 17{19, 2009 8. return minimum perimeter empty pseudo-triangle Theorem 4 Given n points inside a triangle, the empty pseudo-triangle with minimum perimeter can be 3 For a ¯xed pair (i; j) of indices, CR(j; i) can be com- computed in O(n ) time using linear space.