Rainbow polygons for colored point sets in the plane
David Flores-Peñaloza, Mikio Kano, Leonardo Martínez-Sandoval, David Orden, Javier Tejel, Csaba D. Tóth, Jorge Urrutia, Birgit Vogtenhuber
RRainbow polygons for colored point sets in the plane ∗ David Flores-Pe˜naloza † Mikio Kano ‡ Leonardo Mart´ınez-Sandoval § David Orden ¶ Javier Tejel (cid:107)
Csaba D. T´oth ∗∗ Jorge Urrutia †† Birgit Vogtenhuber ‡‡ Abstract
Given a colored point set in the plane, a perfect rainbow polygon is a simple polygonthat contains exactly one point of each color, either in its interior or on its boundary. Letrb-index( S ) denote the smallest size of a perfect rainbow polygon for a colored point set S ,and let rb-index( k ) be the maximum of rb-index( S ) over all k -colored point sets in generalposition; that is, every k -colored point set S has a perfect rainbow polygon with at mostrb-index( k ) vertices. In this paper, we determine the values of rb-index( k ) up to k = 7,which is the first case where rb-index( k ) (cid:54) = k , and we prove that for k ≥ (cid:98) ( k − / (cid:99) − ≤ rb-index( k ) ≤ (cid:22) k (cid:23) + 11 . Furthermore, for a k -colored set of n points in the plane in general position, a perfect rainbowpolygon with at most 10 (cid:98) k (cid:99) + 11 vertices can be computed in O ( n log n ) time. Given a colored point set in the plane, in this paper we study the problem of finding a simplepolygon containing exactly one point of each color. Formally, the problem we consider is thefollowing. Let k ≥ { , . . . , k } be k distinct colors. For every 1 ≤ i ≤ k ,let S i denote a finite set of points of color i in the plane. We always assume that S i is nonemptyand finite for all i ∈ { , . . . , k } , and that S = (cid:83) ki =1 S i is in general position (that is, no threepoints of S are collinear). ∗ A preliminary version was presented at the 18th Spanish Meeting on Computational Geometry (2019). † Departamento de Matem´aticas, Facultad de Ciencias, Universidad Nacional Aut´onoma de M´exico, Mexico.Email: [email protected] ‡ Ibaraki University, Hitachi, Ibaraki, Japan. Email: [email protected] § Institut de Math´ematiques de Jussieu - Paris Rive Gauche (UMR 7586), Sorbonne Universit´e, Paris, France.Email: [email protected] ¶ Departamento de F´ısica y Matem´aticas, Universidad de Alcal´a, Alcal´a de Henares, Spain. Email: [email protected] (cid:107)
Departamento de M´etodos Estad´ısticos, IUMA, Universidad de Zaragoza, Zaragoza, Spain. Email: [email protected] ∗∗ Department of Mathematics, California State University Northridge, Los Angeles, CA; and Department ofComputer Science, Tufts University, Medford, MA, USA. Email: [email protected] †† Instituto de Matem´aticas, Universidad Nacional Aut´onoma de M´exico, Mexico. Email: [email protected] ‡‡ Institute of Software Technology, Graz University of Technology, Graz, Austria. Email: [email protected]
This work has received funding from the European Union’s Horizon 2020 researchand innovation programme under the Marie Sk(cid:32)lodowska-Curie grant agreement No734922. a r X i v : . [ c s . C G ] J u l or a simple polygon P with m vertices (or a simple m -gon) and a point x in the plane,we say that P contains x if x lies in the interior or on the boundary of P . Given a k -coloredpoint set S = (cid:83) ki =1 S i and a simple polygon P in the plane, we call P a rainbow polygon for S if P contains at most one point of each color; and P will be called a perfect rainbow polygon ifit contains exactly one point of each color. The perfect rainbow polygon problem for a coloredpoint set S is that of finding a perfect rainbow polygon with the minimum number of vertices.One can easily check that a perfect rainbow polygon always exists for a colored point set. Away of constructing such a polygon is described below, using the following well-known propertyfor a plane tree: From a tree T embedded in the plane with straight-line edges, a simple polygoncan be built by traversing the boundary of the unbounded face of T , placing a copy of a vertexinfinitesimally close to that vertex each time it is visited, and connecting the copies accordingto the traversal order. One can imagine this simple polygon as the “thickening” of the tree.Thus, for a colored point set S , to build a perfect rainbow polygon we can choose one pointof each color, form a star connecting one of these points to the rest, and thicken the star; seeFigure 1a. Note that the simple polygon obtained in this way can be as close to the star as wewish, so that it contains no other points in S , apart from the points in S that we have chosen.However, finding a perfect rainbow polygon of minimum size for a given colored point set(where the size of a polygon is the number of its vertices) is in general much more difficult. Webelieve that this problem is NP-complete. Therefore, we focus on giving combinatorial boundsfor the size of minimum perfect rainbow polygons. Let rb-index( S ) denote the rainbow index of a colored point set S ; that is, the smallest size of a perfect rainbow polygon for S . We thendefine the rainbow index of k , denoted by rb-index( k ), to be the largest rainbow index amongall the k -colored point sets S ; that is,rb-index( k ) = max { rb-index( S ) : S is a k -colored point set } . (1)In other words, rb-index( k ) is the smallest integer such that, for every k -colored point set S ,there exists a perfect rainbow polygon of size at most rb-index( k ).The two main results in this paper are the following. First, we determine the values of therainbow index up to k = 7, which is the first case where rb-index( k ) (cid:54) = k , namely k k ) 3 4 5 6 8Second, we prove the following lower and upper bounds for the rainbow index40 (cid:98) ( k − / (cid:99) − ≤ rb-index( k ) ≤ (cid:22) k (cid:23) + 11 . Furthermore, for a k -colored set of n points in the plane, a perfect rainbow polygon of sizemeeting these upper bounds can be computed in O ( n log n ) time.The rainbow index for small values of k is analyzed in Section 3. In Sections 4 and 5, weprovide our upper and lower bounds for the rainbow index, respectively. These bounds arebased on the analysis of the complexity of noncrossing covering trees for sets of points, under anew measure defined in this paper. This measure and the relationship between perfect rainbowpolygons and noncrossing covering trees is given in Section 2. Related previous work
Starting from the celebrated Ham-Sandwich theorem, a considerable amount of research aboutdiscrete geometry on colored point sets (or mass distributions) has been done. For instance,2 a) u u u u u u u u (b) Figure 1: (a) Thickening a tree to obtain a perfect rainbow polygon. Different colors arerepresented by different geometric objects. (b) A noncrossing covering tree for the eight blackpoints that can be partitioned into five segments, s = u u , s = u u , s = u u , s = u u ,and s = u u ; and two forks, u with multiplicity 1 and u with multiplicity 2.given cg red points and dg blue points in the plane, where c , d , and g are positive integers, theEquitable Subdivision Theorem establishes that there exists a subdivision of the plane into g convex regions such that each region contains precisely c red points and d blue points [10, 34].It is also known that every d -colored set of points in general position in R d can be partitionedinto n subsets with disjoint convex hulls such that the set of points and all color classes arepartitioned as evenly as possible [12]. For a wide range of geometric partitioning results, thereader is referred to [6, 7, 8, 10, 12, 21, 24, 25, 30, 34] and the references therein.In addition to geometric partitions, for colored points in the plane some research focuseson geometric structures covering the points in some specific way. For instance, covering thecolored points with noncrossing monochromatic matchings [18], noncrossing heterochromaticmatchings [26], noncrossing alternating cycles and paths [29], noncrosing alternating spanningtrees [11, 26] or noncrossing K , stars [1]. In other papers, the main goal is selecting k pointswith k distinct colors (a rainbow subset) from a k -colored point set such that some geometricproperties of the rainbow subset are maximized or minimized. Rainbow subsets with maximumdiameter are investigated in [19, 23], with minimum diameter in [20, 33], and rainbow subsetsoptimizing matchings under several criteria are studied in [9]. In addition, several traditionalgeometric problems for uncolored point sets become NP-hard for colored point sets. For in-stance, the following problems are NP-complete [23]: Computing a rainbow subset minimizing(maximizing) the length of its minimum spanning tree, computing a rainbow subset minimizingits convex hull, or computing a rainbow subset maximizing the distance between its closest pair.Given a 3-colored point set R ∪ B ∪ G consisting of red, blue, and green points in the plane,a well-known result is that there exists an empty heterochromatic triangle, where the threevertices have distinct colors [15]. In particular, a heterochromatic triangle of minimum areacannot contain any other point from R ∪ B ∪ G in its interior, hence its interior is empty, and itsboundary contains exactly one point of each color. This implies that rb-index(3) = 3. Relatedwork [7] deals with colored lines instead of colored points, showing that in an arrangement of3-colored lines, there always exists a line segment intersecting exactly one line of each color.Aloupis et al. [4] study the problem of coloring a given point set with k colors so that everyaxis-aligned strip containing sufficiently many points contains a point from each color class. Given a set of (monochromatic) points, in this section we derive a lower bound for the size ofsimple polygons that contain the given points and have arbitrarily small area. We also providea lower bound for the size of a perfect rainbow polygon for some colored point sets.3 noncrossing covering tree for a set S of points in the plane is a noncrossing geometric tree(that is, a plane straight-line tree) such that every point of S lies at a vertex or on an edge ofthe tree; see Figure 1b. Let T be a noncrossing covering tree whose vertices can be collinear.Similarly to [16], we define a segment of T as a path of collinear edges in T . Two segments of T may cross at a vertex of degree 4 or higher; we are interested in pairwise noncrossing segments.Any vertex of degree two and incident to two collinear edges can be suppressed; consequently,we may assume that T has no such vertices.Let M be a partition of the edges of T into the minimum number of pairwise noncrossingsegments. Let s = s ( T ) denote the number of segments in M . A fork of T (with respect to M )is a vertex v that lies in the interior of a segment ab ∈ M and is an endpoint of another segmentin M . The multiplicity of a fork v is 2 if it is the endpoint of two segments that lie on oppositesides of the supporting line of ab ; otherwise its multiplicity is 1. See Figure 1b for an example.Let t = t ( T ) denote the sum of multiplicities of all forks in T with respect to M . We expressthe number of vertices in a polygon that encloses a noncrossing covering tree T in terms of theparameters s and t . If all edges of T are collinear, then s = 1 and T can be enclosed in atriangle. The following lemma addresses the case that s ≥ Lemma 1.
Let T be a noncrossing covering tree and M a partition of the edges into theminimum number of pairwise noncrossing segments. If s ≥ and t ≥ , then for every ε > ,there exists a simple polygon P with s + t vertices such that area( P ) ≤ ε and T lies in P .Proof. Let δ > v of T ,let D v be a disk of radius δ centered at v . We may assume that δ > D v , v ∈ V ( T ), are pairwise disjoint, and each D v intersects only the edges of T incidentto v . Then the edges of T incident to v partition D v into deg( v ) sectors. If deg( v ) ≥
3, at mostone of the sectors subtends a flat angle (that is, an angle equal to π ). If deg( v ) ≤
2, none ofthe sectors subtends a flat angle by assumption. Conversely, if one of the sectors subtends aflat angle, then the two incident edges are collinear; they are part of the same segment (by theminimality of M ), and hence v is a fork of multiplicity 1.In every sector that does not subtend a flat angle, choose a point in D v on the angle bisector.By connecting these points in counterclockwise order along T , we obtain a simple polygon P that contains T . Note that P lies in the δ -neighborhood of T , so area( P ) is less than the area ofthe δ -neighborhood of T . The δ -neighborhood of a line segment of length (cid:96) has area 2 (cid:96)δ + πδ .The δ -neighborhood of T is the union of the δ -neighborhoods of its segments. Consequently, if L is the addition of the lengths of all segments in M , then the area of the δ -neighborhood of T is bounded above by 2 Lδ + sπδ , which is less than ε if δ > P has 2 s + t vertices; that is, the total number of sectors whoseangle is not flat is precisely 2 s + t . We define a perfect matching between the vertices of P andthe set of segment endpoints and forks (with multiplicity) in each disk D v independently forevery vertex v of T . If v is not a fork, then D v contains deg( v ) vertices of P and deg( v ) segmentendpoints. If v is a fork of multiplicity 1, then D v contains deg( v ) − P and deg( v ) − v is a fork of multiplicity 2, then D v contains deg( v ) vertices of P and deg( v ) − P lying in D v and the segment endpoints and forks (with multiplicity) in D v .Consequently, the number of vertices in P equals the sum of the multiplicities of all forks plusthe number of segment endpoints, which is 2 s + t , as required.Next, we establish a relation between point sets and covering trees. Lemma 2.
Let S be a finite set of points in the plane, not all on a line. Then there exists an ε > such that if S is contained in a simple polygon P with m vertices and area( P ) ≤ ε , then admits a noncrossing covering tree T and a partition of the edges into pairwise noncrossingsegments such that s + t ≤ m .Proof. Let m ≥ n ∈ N , there exists a simple polygon P n with precisely m vertices such that S ⊂ int( P n ) and area( P n ) ≤ n . The real projective plane P R is a compactification of R . By compactness, the sequence ( P n ) n ≥ contains a convergentsubsequence of polygons in P R . The limit is a weakly simple polygon P with precisely m vertices (some of which may coincide) such that S ⊂ P and area( P ) = 0. The edges of P form a set of pairwise noncrossing line segments (albeit with possible overlaps) whose union is aconnected set that contains S . In particular, the union of the m edges of P forms a noncrossingcovering tree T for S . The transitive closure of the overlap relation between the edges of P is anequivalence relation; the union of each equivalence class is a line segment. These segments arepairwise noncrossing (since the edges of P are pairwise noncrossing), and yield a covering of T with a set M of pairwise nonoverlapping and noncrossing segments. Analogously to the proofof Lemma 1, at each vertex v of T , there is a one-to-one correspondence between the verticesin P located at v and the segment endpoints and forks (with multiplicity) located at v . Thisimplies 2 s + t = m with respect to M .An immediate consequence of Lemma 2 is a lower bound on the size of simple polygons witharbitrarily small area that enclose a point set S . Corollary 3.
Let S be a finite set of points in the plane, not all on a line, and let T (cid:48) be anoncrossing covering tree for S minimizing s (cid:48) + t (cid:48) = m (cid:48) . Then there exists an ε > such thatif S is contained in a simple polygon P with m vertices and area( P ) ≤ ε , then m (cid:48) ≤ m .Proof. By Lemma 2, there exists an ε > P with m vertices andarea( P ) ≤ ε contains S , then P also contains a noncrossing covering tree for S . Therefore, bythe minimality of T (cid:48) , necessarily m (cid:48) ≤ m .A similar lower bound can be established for perfect rainbow polygons. In particular, forevery set S of k points in the plane one can build a ( k + 1)-colored point set (cid:98) S , such that findinga noncrosing covering tree for S minimizing 2 s + t is equivalent to finding a minimum perfectrainbow polygon for (cid:98) S . Theorem 4.
Let S be a set of k points in general position in the plane, and let T (cid:48) be anoncrossing covering tree for S minimizing s (cid:48) + t (cid:48) = m (cid:48) . Then there exists a ( k + 1) -coloredpoint set (cid:98) S such that every perfect rainbow polygon for (cid:98) S has at least m (cid:48) vertices.Proof. Note that m (cid:48) ≤ k since a star centered at one of the points of S is a covering tree for S with k − ε > S is containedin a simple polygon P with m vertices and area( P ) ≤ ε , then S admits a noncrossing coveringtree and a partition of its edges into segments such that 2 s + t ≤ m .We construct a ( k + 1)-colored point set (cid:98) S from the points in S by adding a dense pointset S k +1 . Each point of S has a unique color and all points in S k +1 have the same color.Specifically, S k +1 is the union of two disjoint ε/ (2 k )-nets for the range space of triangles [32];that is, every triangle of area ε/ (2 k ) or more contains at least two points in S k +1 .Now suppose, for the sake of contradiction, that there exists a perfect rainbow polygon P for (cid:98) S with x vertices where x < m (cid:48) . Triangulate P arbitrarily into x − P ) / ( x − S k +1 , we have area( P ) / ( x − ≤ ε/ (2 k ), and so area( P ) ≤ ε . By the choice of ε , S admitsa noncrossing covering tree and a partition of its edges into segments such that 2 s + t ≤ x . Thiscontradicts the minimality of T (cid:48) , which completes the proof.5e conjecture that both problems, finding a noncrossing covering tree minimizing 2 s + t for a given point set and finding a minimum perfect rainbow polygon for a given colored pointset, are NP-complete. Many geometric variants of the classical set cover are known to beNP-hard. For example covering a finite set of points by the minimum number of lines is APX-hard [13, 28, 31], see also [17, 27]. The minimum-link covering problem (finding a coveringpath for a set of points with the smallest number of segments) is NP-complete [5]. However,in these problems, the covering objects (lines or edges) may cross. There are few results oncovering points with noncrossing segments. It is known, for example, that it is NP-hard to finda maximum noncrossing matching in certain geometric graph [3]. The problem of, given aneven number of points, finding a noncrossing matching that minimizes the length of the longestedge is also known to be NP-hard [2]. This section is devoted to determining the rainbow indexes rb-index( k ) up to k = 7. Thefollowing theorem is the main result of this section, and it summarizes the results proven below. Theorem 5.
The rainbow indexes of k = 3 , , , , are the following: rb-index(3) = 3 , rb-index(4) = 4 , rb-index(5) = 5 , rb-index(6) = 6 , and rb-index(7) = 8 . Furthermore, forevery k -colored set of n points, where ≤ k ≤ , a perfect rainbow polygon of size at most rb-index( k ) can be found in O ( n log n ) time. Our proof for Theorem 5 relies on the following lemma (Lemma 6), which may be of inde-pendent interest. Lemma 6 guarantees the existence of a strip containing at least one point ofeach color, with the additional property that there are at least two color classes that have onlyone point in the strip.Before proving the lemma, we introduce some notation. The line segment connecting twopoints x and y in the plane will be denoted by xy (or yx ). Further, a ray emanating from x andpassing through y is denoted by −→ xy . Given two parallel lines (cid:96) and (cid:96) , defining a strip ST , wedenote by ST the closure of the strip; that is, the set of points in the interior of the strip or onthe lines (cid:96) and (cid:96) . Lemma 6.
For every k -colored point set S = (cid:83) ki =1 S i , where k ≥ , there exist three differentcolors, i , i , and i , and two parallel lines (cid:96) and (cid:96) defining a strip ST , that satisfy thefollowing properties:i) ST contains at least one point of S i for i = 1 , . . . , k .ii) (cid:96) passes through a point x ∈ S i and a point y ∈ S i , such that x and y are the onlypoints with colors i and i in ST , respectively.iii) (cid:96) passes through a point z ∈ S i .iv) If (cid:96) passes through no other point in S , then z is the only point of color i in ST .v) If (cid:96) passes through another point w ∈ S , then either w ∈ S i and z, w are the only pointsof color i in ST , or w ∈ S − ( S i ∪ S i ∪ S i ) and z is the only point of color i in ST .Such a strip ST can be computed in O ( n log n ) time, where n = | S | .Proof. For i = 1 , . . . k , let L i be the horizontal line passing through the lowest point in S i .Without loss of generality, assume that L = L is the highest line among L i , i ∈ { , . . . , k } .For i ∈ { , . . . , k } let S − i denote the set of points in S i that lie strictly below L ; and let U i zLU (a) xx z z x (cid:96) (cid:96) (b) (cid:96) (cid:96) (c) Figure 2: Illustrating the proof of Lemma 6. The points of S and S are drawn as red squaresand blue circles, respectively.be the horizontal line that passes through the highest point in S − i . Without loss of generality,assume that U = U is the lowest line among all U i , i ∈ { , . . . , k } and that L ∩ S is to theright of U ∩ S ; see Figure 2a. Observe that by choosing i = 1, i = 3, (cid:96) = L and (cid:96) = U , allconditions (i) and (iii)–(v) are satisfied.Let A = conv( S ) and B = conv( S − ). We describe a sweepline algorithm in which wemaintain a strip ST between two parallel lines (cid:96) and (cid:96) . Initially, (cid:96) = L and (cid:96) = U arehorizontal lines. We also maintain the invariants that(I1) (cid:96) is tangent to A ,(I2) (cid:96) is a tangent to B ,(I3) | ST ∩ S i | ≥ { , . . . , k } , and(I4) ST ∩ S = ∅ .During the algorithm (cid:96) rotates clockwise about the point in (cid:96) ∩ S , and (cid:96) rotates clockwiseabout the point (cid:96) ∩ S − , which are called the pivot points of (cid:96) and (cid:96) , respectively. Using afully dynamic convex hull data structure [22], we maintain the convex hull of the points of S \ ( A ∪ B ) in ST , above (cid:96) , and below (cid:96) , respectively. By computing tangent lines from thetwo pivot points to the three convex hulls, we can maintain an event queue of when the nextpoint in S \ ( A ∪ B ) enters or exits the strip ST (it is deleted from one convex hull and insertedinto another) and when the pivot (cid:96) ∩ S or (cid:96) ∩ S − must be updated. We also maintain thenumber of points in ST ∩ S i for i = { } ∪ { , . . . , k } , in order to keep track of whether invariant(I3) is satisfied.Specifically, the rotation stops if the number of points in ST of a color in { } ∪ { , . . . , k } drops to zero, or if the line (cid:96) passes through a point of color 3. Termination is guaranteed,since when (cid:96) = (cid:96) is the common tangent of A and B , then ST = ∅ , violating invariant (I3).Each of the lines (cid:96) and (cid:96) sweeps through every point in S \ ( A ∪ B ) at most once. Sincethe dynamic convex hull data structures can be updated in O (log n ) amortized time and theysupport tangent queries in O (log n ) time [22], the sweepline algorithm runs in O ( n log n ) totaltime.Note that (I1) and (I2) are always satisfied by construction. When the sweep line algorithmterminates, we face two possible scenarios. If (I3) is violated, then there is a color i ∈ { } ∪{ , . . . , k } such that S i has exactly one point in ST ∩ S i lying on (cid:96) or (cid:96) . In this case our proofis complete with condition (ii) satisfied. Otherwise (I4) is violated; that is, (cid:96) passes througha point of color 3. In this case, we can translate (cid:96) towards (cid:96) until it passes through the lastpoint u in ST of one of the colors i ∈ { } ∪ { , . . . , k } ; see Figure 2c. Exchanging the roles ofcolors i and i = 3, the lemma follows. 7otice that if k = 3, then the strip defined by (cid:96) and (cid:96) in Lemma 6 is empty, so the triangle (cid:52) xyz is empty. As a consequence, Lemma 6 provides an alternative proof for rb-index(3) = 3. x yz (a) (cid:96) (cid:96) x yzp u (b) (cid:96) (cid:96) x yz pp (cid:48) u (c) Figure 3: Illustrating the proof of Proposition 7.In the remainder of this section, we refer to colors 1, 2, 3, 4, 5, 6, and 7 (if they exist) as red , blue , green , yellow , pink , orange , and black , respectively (e.g., a 4-colored point set will be red,blue, green, and yellow). Furthermore, when applying Lemma 6, we may assume withot loss ofgenerality that the colors i , i , and i are red, blue, and green, respectively, the lines (cid:96) and (cid:96) are horizontal, the point x is to the left of point y on (cid:96) , and if (cid:96) passes through another point w of S that is not green, then w is yellow. In addition, if p is the intersection point between aray −→ zu and a line (cid:96) , then p (cid:48) will denote a point infinitesimally close to p on the ray −→ zu towards z ; see Figure 3c.We can now show that rb-index(4) = 4. Proposition 7. rb-index(4) = 4 .Proof.
We first show that rb-index(4) ≥
4. Consider the 4-colored point set in Figure 3a, where S = { x } , S = { y } , S = { z } , and S consists of two points in the interior of the triangle (cid:52) xyz . Every triangle that contains a point of color 1, 2, and 3 must contain (cid:52) xyz , hence twopoints of S . It follows that there exists no perfect rainbow triangle.We now show that rb-index(4) ≤
4. Let S = S ∪ S ∪ S ∪ S be a point set in the planewhose points are colored red, blue, green, and yellow. By Lemma 6, there is a strip defined bytwo horizontal lines, (cid:96) and (cid:96) , where (cid:96) passes through a red point x and a blue point y , and (cid:96) passes through a green point z , such that either there are only yellow points in the interiorof the strip, or the strip is empty and (cid:96) passes through a yellow point w . In the first case, werotate the horizontal ray emanating from z clockwise until it encounters a yellow point u in theinterior of the strip; see Figure 3b. Let p be the intersection point of −→ zu and (cid:96) . By symmetry,we may assume that p is to the left of x or on the segment xy . If p is to the left of x , then py ∪ pz is a covering tree T for { x, y, z, u } , which can be thickened to a perfect rainbow quadrilateralby Lemma 1; see Figure 3b. If p is on xy , then yxzp (cid:48) is a perfect rainbow quadrilateral; seeFigure 3c. Finally, if the strip is empty and (cid:96) contains a yellow point w , then xyzw is a perfectrainbow quadrilateral.Before moving to the next proposition, let us prove the following useful lemma that in factworks for monochromatic points. Lemma 8.
Let P be a set of three points in the interior of a triangle (cid:52) xyz such that P ∪{ x, y, z } is in general position. Then one can label the points in P by a , b , and c so that a lies on the ine segment xr , for r = −→ xa ∩ −→ yb , b lies on the line segment ys , for s = −→ yb ∩ −→ zc , and c lies onthe line segment zt , for t = −→ zc ∩ −→ xa . xy za cpb (a) xy za cpb (b) xy za cp b (c) xy za c sbr t (d) Figure 4: Illustrating the proof of Lemma 8.
Proof.
We first show that we can label the three points in P by a, b, c so that (cid:52) xya , (cid:52) yzb , and (cid:52) zxc are interior-disjoint. By symmetry, we may assume that the line passing through a and c intersects edges xy and xz of (cid:52) xyz , and a is closer to xy than c . Let p = −→ ya ∩ −→ zc . Since P ∪ { x, y, z } is in general position, b lies neither on −→ ya nor on −→ zc ; see Figure 4. Three cases arise:If b is in (cid:52) yzp , then the triangles (cid:52) xya , (cid:52) yzb , and (cid:52) zxc are interior-disjoint; see Figure 4a.If b is in (cid:52) xyp , then (cid:52) xyb , (cid:52) yza , and (cid:52) zxc are interior-disjoint; see Figure 4b. Finally, if b isin (cid:52) zxp , then we can take the triangles (cid:52) xya , (cid:52) yzc , and (cid:52) zxb ; see Figure 4c.We now show that a lies on the line segment xr , for r = −→ xa ∩ −→ yb , b lies on the line segment ys , for s = −→ yb ∩ −→ zc , and c lies on the line segment zt , for t = −→ zc ∩ −→ xa ; see Figure 4d. If a werenot on the line segment xr , then a would lie below −→ yb , and so (cid:52) xya and (cid:52) yzb would intersect,a contradiction. The other cases, b lying on ys and c lying on zt , hold by symmetry.We say that the triangle (cid:52) rst described in Lemma 8 is expedient with respect to { a, b, c } .Note that an expedient triangle can be computed in O (1) time. Further, note that the labelinggiven in Lemma 8 is not unique, and thus expedient triangles are not uniquely determined.Using Lemma 8, one can find perfect rainbow hexagons for six colors in some special coloredpoint sets, as the following lemma shows. Lemma 9.
Let S be a k -colored point set, with k ≥ , such that conv ( S ) = (cid:52) xyz . Assumethat S = { x } , S = { y } , and S = { z } . Then there is a perfect rainbow hexagon for six of thecolors, which can be found in O ( n ) time, where n = | S | .Proof. Let a , b , and c be points in the interior of (cid:52) xyz with three different colors i , i , and i , respectively, and consider an expedient triangle (cid:52) rst with respect to { a, b, c } , which existsby Lemma 8. If there are points of S in the interior of (cid:52) rst , then we choose one of them, say d , we replace c by d in { a, b, c } , and we take a new expedient triangle (cid:52) r (cid:48) s (cid:48) t (cid:48) with respect tothe set { a, b, d } . Without loss of generality, we may assume that if the color of d is some of i , i , and i , then c is the point having the same color as d .We show how to construct an expedient triangle (cid:52) r (cid:48) s (cid:48) t (cid:48) such that (cid:52) r (cid:48) s (cid:48) t (cid:48) ⊂ (cid:52) rst . Assumethat a lies on xr , for r = −→ xa ∩ −→ yb , b lies on ys , for s = −→ yb ∩ −→ zc , and c lies on zt , for t = −→ zc ∩ −→ xa ;cf. Figures 5a–5c. Consider the ray −→ zb and distinguish cases based on whether d is to the leftor to the right of −→ zb . If d is to the right of −→ zb (Figure 5a), then (cid:52) rs (cid:48) t (cid:48) is an expedient triangle,where a lies on xr , b lies on ys (cid:48) , and d lies on zt (cid:48) . Suppose now that d is to the left of −→ zb . Twosubcases arise, depending on whether d is to the left or to the right of the ray −→ ya . If d is tothe right of −→ ya (Figure 5b), then (cid:52) r (cid:48) s (cid:48) t (cid:48) is an expedient triangle, where a lies on xr (cid:48) , d lies on9 y za c sb rt dt (cid:48) s (cid:48) (a) xy za c sbr tdt (cid:48) s (cid:48) r (cid:48) (b) xy za c sbr td s (cid:48) t (cid:48) r (cid:48) (c) x yzrt s (d) Figure 5: (a)–(c) Building a new expedient triangle (cid:52) r (cid:48) s (cid:48) t (cid:48) from the expedient triangle (cid:52) rst ,when replacing c by d . (d) A perfect rainbow hexagon for six of the colors. ys (cid:48) , and b lies on zt (cid:48) . Finally, if d is to the left of −→ ya (Figure 5c), then (cid:52) r (cid:48) s (cid:48) t (cid:48) is an expedienttriangle, where d lies on xr (cid:48) , a lies on ys (cid:48) , and b lies on zt (cid:48) . In all three cases, (cid:52) r (cid:48) s (cid:48) t (cid:48) ⊂ (cid:52) rst ,as required.Since (cid:52) r (cid:48) s (cid:48) t (cid:48) ⊂ (cid:52) rst , and since d ∈ (cid:52) rst and d (cid:54)∈ (cid:52) r (cid:48) s (cid:48) t (cid:48) , it follows that (cid:52) r (cid:48) s (cid:48) t (cid:48) containsfewer points of S than (cid:52) rst . Hence we can repeat this procedure until we find an expedienttriangle that is empty of points of S . From this expedient triangle, we can obtain a perfectrainbow hexagon for the six colors involved, by slightly moving the vertices of the expedienttriangle towards the vertices of (cid:52) xyz as depicted in Figure 5d. Furthermore, an empty expedienttriangle can be computed in O ( n ) time: We can start with an arbitrary expedient triangle (cid:52) rst . For each point s ∈ S , we can test whether s ∈ (cid:52) rst and update it to a smaller triangle (cid:52) r (cid:48) s (cid:48) t (cid:48) ⊂ (cid:52) rst if necessary in O (1) time. Consequently, a perfect rainbow polygon for six ofthe colors can also be found in O ( n ) time.We are now ready to prove the following result. Proposition 10. rb-index(5) = 5 , rb-index(6) = 6 , and rb-index(7) = 8 .Proof. We first show that rb-index(5) ≥
5, rb-index(6) ≥
6, and rb-index(7) ≥
8, by construct-ing a 5-colored point set S (5), a 6-colored point set S (6) and a 7-colored point set S (7), suchthat rb-index( S (5)) = 5, rb-index( S (6)) = 6, and rb-index( S (7)) = 8.The set S (5) consists of four one-element color classes S = { x } , S = { y } , S = { z } , and s = { w } , where w is in the interior of (cid:52) xyz . The set S of black points contains (cid:52) xyz in itsconvex hull, as described in the proof of Theorem 4; that is, every triangle of area ε or morecontains at least two black points; see Figure 6a. The set S (6) is obtained from S (5) by addingan one-element color class S = { u } , where u is in the interior of (cid:52) xyz ; see Figure 6b. Theset S (7) is obtained from S (6) by adding a one-element color class S = { v } , where v is inthe interior of (cid:52) xyz , and the vertices u , v , and w are positioned such that −→ xu crosses zw , −→ zw crosses yv , and −→ yv crosses xu ; see Figure 6c.It is easy to see that a noncrossing covering tree for { x, y, z, w } in S (5), minimizing 2 s + t ,requires either two segments and a fork, or at least three segments (and no fork). Hence, byTheorem 4, the size of a minimum perfect polygon for S (5) is at least 5. Figure 6a illustratesa perfect rainbow pentagon based on a covering tree that uses a segment to cover x and z andanother segment to cover y and w . Every noncrossing covering tree for { x, y, z, w, u } in S (6)requires at least three segments, so the size of any perfect rainbow polygon for S (6) is at least 6by Theorem 4. Figure 6b shows a perfect rainbow hexagon based on three segments that cover x and u , y and w , and z , respectively.Finally, consider a noncrossing covering tree for { x, y, z, w, u, v } in S (7). It has at leastthree segments, by the pigeonhole principle, since no three points are collinear. If it has four10 zx y (a) u wzx y (b) vu wzx y (c) Figure 6: 5-, 6-, and 7-colored points sets whose rainbow indices are 5, 6, and 8, respectively.or more segments, then the size of the corresponding perfect rainbow polygon for S (7) is atleast 8. Otherwise it consists of exactly three segments, and then an analysis of the possiblechoices shows that at least two forks are always required. Therefore, the size of a minimumperfect rainbow polygon for S (7) is at least 8. Figure 6c illustrates the perfect rainbow octagonfor S (7) based on the segments that cover { x, u } , { y, v } , and { z, w } , respectively.We next show that rb-index(5) ≤
5, rb-index(6) ≤
6, and rb-index(7) ≤
8. Let S be a k -colored point set in the plane, with k ∈ { , , } . By Lemma 6, there is a strip defined bytwo horizontal lines (cid:96) and (cid:96) , with (cid:96) passing through a red point x and a blue point y , and (cid:96) passing through a green point z , such that either the strip contains some points of all othercolors, or (cid:96) passes through a yellow point w and the interior of the strip does not contain anyother yellow point. We analyse these cases in detail as follows. The strip ST contains points of all k − other colors. Consider the horizontal rayemanating from z to the left and rotate it in clockwise direction, sweeping all the colored pointsin the strip until we find two consecutive points of S , say u and v , with different colors, sayyellow and pink; see Figure 7a. Let p and q be the intersection points of −→ zu and −→ zv with (cid:96) ,respectively. Assume that p is to the left of x . If q is also to the left of x or on the line segment xy , then ypzq (cid:48) is a perfect rainbow quadrilateral for five of the colors; see Figure 7a. If q isto the right of y , then (cid:52) pqz is a perfect rainbow triangle for five of the colors; see Figure 7b.If k = 5, we are done. If k = 6, then we connect an orange point to z and thicken this edge(dotted line segments in Figures 7a and 7b). In this way, we obtain a perfect rainbow hexagonin the first case and a perfect rainbow pentagon in the second case. If k = 7, we repeat thisprocess connecting a black point to z , to obtain either a perfect rainbow octagon or a perfectrainbow heptagon.Suppose now that p is to the right of x . Arguing in an analogous way when rotating thehorizontal ray emanating from z to the right counterclockwise, if u (cid:48) and v (cid:48) are two consecutivepoints with different colors, then we may assume that the intersection point p between (cid:96) and −→ zu (cid:48) is to the left of y . When this happens, p to the right of x and p to the left of y , it isstraightforward to see that (cid:52) xyz must contain at least one point of each color, and that q is on xy . If k = 5, then yxp (cid:48) zq (cid:48) is a perfect rainbow pentagon; see Figure 7c. If k = 6, aperfect rainbow hexagon exists by Lemma 9; see Figure 5d. If k = 7, we can build a perfectrainbow hexagon for six of the colors by Lemma 9, and form a perfect rainbow octagon for S by connecting a black point to z and thicken this edge. The only yellow point w in ST is on (cid:96) . When k = 5, the strip contains only pinkpoints. Thus, we rotate the horizontal ray emanating from y to the left counterclockwise untilit encounters a pink point u in the strip; see Figure 7d. Let p be the intersection point of −→ yu and (cid:96) . By symmetry, there are two cases to consider: either p is to the left of z , or on the segment11 (cid:96) x yzp q (cid:48) qu v (a) (cid:96) (cid:96) x yzp qu v (b) (cid:96) (cid:96) x yzp q (cid:48) qu vp (cid:48) (c) (cid:96) (cid:96) x yzp p (cid:48) u w (d) (cid:96) (cid:96) x yz pp (cid:48) u w (e) (cid:96) (cid:96) x yzp q (cid:48) qu v w (f) Figure 7: Illustrating the proof of Proposition 10. zw . In the first case, yxpwp (cid:48) is a perfect rainbow pentagon; see Figure 7d. In the second case yxzwp (cid:48) is a perfect rainbow pentagon; see Figure 7e.When k = 6 or k = 7, the strip contains points of at least two of the colors and we canargue as before, but now rotating clockwise about w instead of about z , to look for the firsttwo consecutive points u and v with different colors, say pink and orange. If the intersectionpoint p between −→ wu and (cid:96) is to the left of x , then we can build a perfect rainbow quadrilateralor a perfect rainbow triangle for five of the colors, as shown in Figures 7a and 7b. After that,we connect z (and a black point if k = 7) to w to form a perfect rainbow hexagon (or a perfectoctagon if k = 7) for S ; see Figure 7f.Finally, if p is to the right of x , then there are points of at least two of the colors to the left of −→ xw . Therefore, when rotating the horizontal ray emanating from x to the right clockwise untilfinding two consecutive points u and v of different colors, the intersection point between −→ xu and (cid:96) will be necessarily to the right of w , and we can carry out symmetric constructions.The following corollary is straightforward from the proofs of Propositions 7 and 10. Corollary 11.
For k = 3 , , , , , a perfect rainbow polygon with at most rb-index( k ) verticescan be found in O ( n log n ) time for any k -colored set S of n points.Proof. By Lemma 6, the strip ST used in the proofs of Propositions 7 and 10 can be found in O ( n log n ) time. In addition, the cyclic order of the points in S around any of x, y, z or w canbe computed in O ( n log n ) time. A perfect rainbow hexagon as described in Lemma 9 can beobtained in O ( n ) time. Therefore, the corollary follows.12 p i p q p b p a (a) p p i p p a = p b p c r (b) p p j p qp i p a p k (c) Figure 8: Finding two trees when the lower arc of conv( S ) has three vertices (8a–8b), and whenit has four or more vertices (8c). We show in this section that for every k -colored point set, there exists a perfect rainbow poly-gon of size at most 10 (cid:98) k (cid:99) + 11. We begin with an auxiliary lemma showing that any seven(monochromatic) points in a vertical strip can be covered by a noncrossing forest of two treesof order four and two, respectively, such that both trees are fully contained in the strip. Lemma 12.
Let S = { p , . . . , p } be a point set in general position in the plane, ordered by x -coordinate. Let B be the strip defined by the two vertical lines passing through p and p ,respectively. Then, in O (1) time, we can construct two noncrossing trees T and T , of orderfour and two, respectively, with the following properties:(i) The union of T and T covers S and is contained in B .(ii) For i ∈ { , } , the tree T i has a leaf v i such that the ray emanating from v i in the directionopposite to the edge incident to v i does not cross T i . Moreover, if the extension at v i hits T j , j (cid:54) = i , then the extension at v j does not hit T i ; that is, the two trees and the twoextensions do not create cycles.Proof. Let (cid:96) be the line passing through p and p . Without loss of generality, we may assumethat S contains at least (cid:100) / (cid:101) = 3 points below (cid:96) . Note that p and p are extremal pointsin S , hence they are vertices of the convex hull conv( S ) of S . Points p and p decompose theboundary of conv( S ) into two convex arcs, an upper arc and a lower arc . Since S contains atleast 3 points below (cid:96) , the lower arc must have at least 3 vertices (including p and p ). Wedistinguish between two cases depending on the number of vertices of the lower arc of conv( S ). The lower arc of conv( S ) has 3 vertices. Assume that the lower arc of conv( S ) is the path( p , p i , p ), where 1 < i <
7; see Figures 8a–8b. Since S contains at least 3 points below (cid:96) , atleast 2 points of S are in the interior of (cid:52) p p i p . Rotate the ray −−→ p p i counterclockwise until itencounters a point p a in the interior of (cid:52) p p i p ; rotate the ray −−→ p p i clockwise until it encountersa point p b in the interior of (cid:52) p p i p . We distinguish between two cases depending on whether p a and p b are distinct.In the first case, assume that p a (cid:54) = p b ; see Figure 8a. The rays −−→ p p a and −−→ p p b intersectin the interior of (cid:52) p p i p , at some point q . By construction, the remaining two points in S \ { p , p i , p , p a , p b } are above the path ( p , q, p ), in a wedge bounded by −→ qp and −→ qp . Thiswedge is convex, hence it contains the line segment between the two points. Let T be the star13entered at q with edges p q , p i q , and p q ; and let T be the line segment spanned by the twopoints of S above ( p , q, p ).In the second case, assume that p a = p b ; see Figure 8b. Let r be the first point along theray −−→ p i p a such that the line segment p r or p r contains a point of S in the interior of (cid:52) p p a p .Denote this point by p c ∈ S . By construction, the remaining two points in S \ { p , p i , p , p a , p c } are above the path ( p , r, p ), in a convex wedge bounded by −→ rp and −→ rp . Let T be the starcentered at r with edges p r , p i r , and p r , and let T be the line segment spanned by the twopoints of S above ( p , r, p ).In both cases, T ∪ T covers all seven points in S , is in B , and is noncrossing, as required.Moreover, the second property of the lemma is clearly satisfied by choosing v = p and v theleftmost point of T . The lower arc of conv( S ) has 4 or more vertices. Let p , p i , p j , p k be the first fourvertices of the lower arc of conv( S ) in counterclockwise order (possibly p k = p ). Let q be theintersection point of the lines passing through p and p i , and through p j and p k , respectively.Rotate the ray −−→ p k p j clockwise until it encounters a point in S \ { p , p i , p j , p k } , and denote itby p a , Let T be the union of the path ( p , q, p k , p a ), and connect the two remaining points of S to define T ; see Figure 8c. Note that T ∪ T covers all seven points in S , is in B , and isnoncrossing, as required. Moreover, the second property of the lemma is clearly satisfied bychoosing v = p and v the leftmost point of T .Using Lemma 12, the following theorem provides a method to find noncrossing coveringtrees with few segments and forks. Theorem 13.
Let S be a finite set of n = 7 j + r points in the plane in general position, with j ≥ and ≤ r ≤ . Then, in O ( n log n ) time, we can construct a noncrossing covering tree T consisting of (cid:98) n (cid:99) + 1 + (cid:100) r (cid:101) segments and (cid:98) n (cid:99) + (cid:100) r (cid:101) forks with multiplicity 1.Proof. By rotating the point set if necessary, we may assume that the points in S have distinct x -coordinates. We assume first that n = 7 j , for some integer j >
0. Figure 9 illustrates themethod to obtain a noncrossing covering tree with 4 (cid:98) n (cid:99) + 1 segments and 2 (cid:98) n (cid:99) forks withmultiplicity 1. We partition the n points from left to right into j groups G , G , . . . , G j ofseven points each; see Figure 9a. We apply Lemma 12 to every group G i to cover the pointsin G i by two trees, consisting of 4 segments in total; see Figure 9b. In this way, we obtain aforest F formed by 2 j trees with 4 j segments. In addition, by the same lemma, every tree T i of F contains a special leaf v i that can be extended to the left without crossing T i .We add a long vertical segment P (cid:48) to the left of the point set such that the extension of anytree T i of F at v i crosses P (cid:48) ; see Figure 9c. For every tree T i , we extend the edge incident toits special leaf v i to the left until the extension hits another tree, another extension, or P (cid:48) ; seeFigure 9c. This is carried out exploring, for example, the special leaves from right to left. Thus,we join the 2 j trees of F and the segment P (cid:48) to form an single component. This component isnecessarily a noncrossing covering tree T with 4 j + 1 segments and 2 j forks with multiplicity 1,since all extensions go to the left without creating cycles. Therefore, there exists a noncrossingcovering tree T consisting of 4 (cid:98) n (cid:99) + 1 segments and 2 (cid:98) n (cid:99) forks with multiplicity 1.Consider the case that n = 7 j + r , where 1 ≤ r ≤
6. Using the first 7 j points from left toright, we proceed as before, and we build a noncrossing covering tree T with 4 j + 1 segmentsand 2 j forks with multiplicity 1. If j = 0, the previous step is not required. The last r pointscan be covered by connecting the point at position 7 j + 1 to the following one, the point atposition 7 j + 3 to the following one, and so on. If the last point cannot be connected to thefollowing one, we assign an small horizontal segment to it. In this way, we are covering the14 a) (b) (c) Figure 9: Part (a): Dividing the n points into groups of size 7. Part (b): Applying Lemma 12to each group. Part (c): Joining all trees to a vertical segment.last r points with (cid:100) r (cid:101) segments. These segments can be joined to T by extending their leftmostpoints. Therefore, we can obtain a noncrossing covering tree T (cid:48) consisting of 4 (cid:98) n (cid:99) + 1 + (cid:100) r (cid:101) segments and 2 (cid:98) n (cid:99) + (cid:100) r (cid:101) forks with multiplicity 1.It remains to show that the construction above can be implemented in O ( n log n ) time. Wecan sort the points in S in increasing order by x -coordinates in O ( n log n ) time, and hencepartition S into O ( n ) groups of size seven. For each group, we can find two trees in O (1) timeby Lemma 12. Finally, we can compute the left extensions of the special leaves v i of all trees T i by a standard sweepline algorithm [14, Sec. 2.1] as follows: We sweep a vertical line L rightto left from the rightmost point to one unit left of the leftmost point in S . In the course of thealgorithm, we maintain the intersection of L with the forest F , and the left extensions of allleaves v i to the right of L . An event queue maintains the time steps when L passes througha vertex of F , when a left extension hits an edge of F (in which case the left extension ends),and when two left extensions meet (in which case one extension ends and other one continues).There are O ( n ) events, and the event queue can be updated in O (log n ) time for each event.Consequently, the sweepline algorithm runs in O ( n log n ) time. In the last step, the sweepline L is to the left of S ; we can let the vertical line segment P (cid:48) be the convex hull of the intersectionsof L with all surviving left extensions.Notice that by construction, the minimum number of pairwise noncrossing segments intowhich T (cid:48) can be decomposed is precisely 4 (cid:98) n (cid:99) + 1 + (cid:100) r (cid:101) . As a consequence of this theorem, wecan give an upper bound for the size of a perfect rainbow polygon. Theorem 14.
Let S be a k -colored set of n points in general position. Then a perfect rainbowpolygon P of size at most (cid:98) k (cid:99) + 11 can be computed in O ( n log n ) time.Proof. We choose a point of each color to define a point set S (cid:48) of cardinality k = 7 j + r , with j ≥ ≤ r ≤
6. By Theorem 13, there is a noncrossing covering tree T (cid:48) for the pointset S (cid:48) , consisting of 4 (cid:98) k (cid:99) + 1 + (cid:100) r (cid:101) segments and 2 (cid:98) k (cid:99) + (cid:100) r (cid:101) forks with multiplicity 1, and itcan be computed in O ( k log k ) time. By Lemma 1, given a noncrossing covering tree T anda partition M of the edges into the minimum number s of pairwise noncrossing segments, forevery ε >
0, there exists a simple polygon P with 2 s + t vertices such that area( P ) ≤ ε and T P , where t is the sum of the multiplicities of all forks in T . Thus, for every ε >
0, wecan construct a simple polygon P (cid:48) with 2(4 (cid:98) k (cid:99) + 1 + (cid:100) r (cid:101) ) + 2 (cid:98) k (cid:99) + (cid:100) r (cid:101) ≤ (cid:98) k (cid:99) + 11 verticessuch that area( P (cid:48) ) ≤ ε and S (cid:48) lies in P (cid:48) . By choosing ε sufficiently small so that P (cid:48) contains noother point in S except for the points in S (cid:48) , we can construct a perfect rainbow polygon for S of size at most 10 (cid:98) k (cid:99) + 11.A suitable ε > T (cid:48) andthe points in S \ S (cid:48) . To find this distance, we can compute the Voronoi diagram for a set of sites , which consists of the O ( k ) ≤ O ( n ) edges of T (cid:48) and the O ( n ) points in S \ S (cid:48) in O ( n log n )time [14, Sec. 7.3]. The Voronoi diagram is formed by O ( n ) line segments and parabolic arcs;and we can find the closest point in T (cid:48) (hence in S \ S (cid:48) ) for each of these arcs in O (1) time. For every k ≥
3, Dumitrescu et al. [16] constructed a set S of n = 2 k points in the plane (withoutcolors) such that every noncrossing covering path has at least (5 n − / S has at least (9 n − /
17 edges. Furthermore, everyset of n ≥ (cid:100) n/ (cid:101) noncrossing segments, and this bound is the best possible. We recall that a segmentis defined as a chain of collinear edges.In this section, we use the point sets constructed in [16] to derive a lower bound for thecomplexity of a covering tree as defined in Section 2. This bound, in turn, yields a lower boundon the complexity of perfect rainbow polygons for colored point sets built from such sets. Construction.
We use the point set constructed by Dumitrescu et al. [16]. We review someof its properties here. For every k ∈ N , they construct a set of n = 2 k points, S = { a i , b i : i =1 , . . . , k } . The pairs { a i , b i } ( i = 1 , . . . , k ) are called twins . The points a i ( i = 1 , . . . , k ) lie on theparabola α = { ( x, y ) : y = x } , sorted by increasing x -coordinate. The points b i ( i = 1 , . . . , k )lie on a convex curve β above α , such that dist( a i , b i ) < ε for a sufficiently small ε , and the lines a i b i are almost vertical with monotonically decreasing positive slopes (hence the supportinglines of any two twins intersect below α ). For i = 1 , . . . , k , they also define pairwise disjointdisks D i ( ε ) of radius ε centered at a i such that b i ∈ D i ( ε ), and the supporting lines of segments a i a j and b i b j meet in D i ( ε ) for every j , i < j ≤ k . Furthermore, (1) no three points in S are collinear; (2) no two lines determined by the points in S are parallel; and (3) no threelines determined by disjoint pairs of points in S are concurrent. Finally, the x -coordinates of a i ( i = 1 , . . . , k ) are chosen such that (4) for any four points c , c , c , c from S , labeled byincreasing x -coordinate, the supporting lines of c c and c c cross to the left of these points.See Figure 10 for a sketch of the construction. Analysis.
Let S be a set of n = 2 k points defined in [16] as described above, for some k > M be a set of pairwise noncrossing line segments in the plane whose union is connectedand contains S . In particular, if T is a noncrossing covering tree for S , then any partition ofthe edges of T into pairwise noncrossing segments could be taken to be M .A segment in M is called perfect if it contains two points in S ; otherwise it is imperfect . Byperturbing the endpoints of the segments in M , if necessary, we may assume that every pointin S lies in the relative interior of a segment in M . By the construction of S , no three perfectsegments are concurrent, so we can define the set Γ of maximal chains of perfect segments; wecall these perfect chains .Dumitrescu et al. [16, Lemmata 4–10] proved several properties of a covering path for S .Clearly, a covering path has precisely two leaves, while a covering tree may have arbitrarily16 a a a b b b b Figure 10: A sketch of the construction given in [16] for k = 4. The figure is not to scale.many leaves. Their results are based on local configurations, however, and hold for any setof noncrossing segments M where the endpoints of perfect chains play the same role as theendpoints of a covering path. We restate their key results for a set M of noncrossing coveringsegments. Lemma 15. [16, Lemma 7] Let pq be a perfect segment in M that contains one point from eachof the twins { a i , b i } and { a j , b j } , where i < j . Assume that p is the left endpoint of pq . Let s be the segment in M containing the other point of the twin { a i , b i } . Then one of the followingfour cases occurs. Case 1: p is the endpoint of a perfect chain; Case 2: s is imperfect; Case 3: s is perfect, one of its endpoints v lies in D i ( ε ) , and v is the endpoint of a perfectchain; Case 4: s is perfect and p is the common left endpoint of segments pq and s . Lemma 16. [16, Lemma 9] Let pq be a perfect segment in M that contains a twin { a i , b i } , andlet q be the upper (that is, right) endpoint of pq . Then q is the endpoint of a perfect chain. Let Γ x be the set of maximal x -monotone chains of perfect segments in M . Lemma 17.
The right endpoints of the chains in Γ x are distinct.Proof. Suppose, for the sake of contradiction, that γ , γ ∈ Γ x have a common right endpoint q .Let pq and rq , respectively, be the rightmost segments of γ and γ .If pq contains a twin, then pq has positive slope (by construction), and so q is the upperendpoint of pq . In this case segment rq is imperfect by Lemma 16, contradicting the assumptionthat rq is in γ . We may assume that neither pq not rq contains a twin. In this case, theirsupporting lines intersect to the left of the points in S on pq and pr by property (4), contradictingour assumption that q is the right endpoint of both segments. Corollary 18.
Every chain in Γ consists of at most two chains in Γ x . Denote by s , s and s , respectively, the number of segments in M that contain 0, 1, and 2points from S . An adaptation of a charging scheme from [16, Lemma 4] yields the followingresult, where t is the number of forks (with multiplicity) in M . Lemma 19. s ≤ s + 9 s + 4( t + 1) . roof. Let pq be a perfect segment of M , and part of a chain γ ∈ Γ. We charge pq to either anendpoint of γ or some imperfect segment.We define the charging as follows. If pq contains a twin, then charge pq to the top vertexof pq , which is the endpoint of a perfect chain by Lemma 16. Assume now that pq does notcontain a twin, its left endpoint is p , and it contains a point from each of the twins { a i , b i } and { a j , b j } , with i < j . We consider the four cases presented in Lemma 15.In Case 1, charge pq to p , which is the endpoint of a perfect chain. In Case 2, charge pq to the imperfect segment s containing a point of the twin { a i , b i } . In Case 3, charge pq to theendpoint v of a perfect chain located in D i ( ε ). Now, consider Case 4 of Lemma 15. In thiscase, pq is the leftmost segment of a maximal x -monotone chain γ x . We charge pq to the rightendpoint of γ x , which is the endpoint of a perfect chain. This completes the definition of thecharges.Note that every imperfect segment and every right endpoint of a chain in Γ is charged atmost once for perfect segments in Cases 1–3, and every left endpoint of a chain is charged atmost twice. By Corollary 18, each endpoint of a perfect chain is charged at most once for perfectsegments in Case 4. Overall, every imperfect segment containing one point of S is charged atmost once, and every endpoint of a perfect chain is charged at most twice. Consequently, s ≤ s + 4 | Γ | . (2)We bound | Γ | from above in terms of s , s , and t . Choose an arbitrary root vertex in T , anddirect all edges in T towards the root. Every perfect chain has a unique vertex v closest to theroot. As all chains in Γ are maximal and as no three prefect segments are concurrent, v mustbe a fork, the endpoint of an imperfect segment, or the root. This yields | Γ | ≤ s + s ) + t + 1.Combined with (2), this yields, s ≤ s + 4[2( s + s ) + t + 1] = 8 s + 9 s + 4( t + 1) , as claimed. Lemma 20.
Let S be a set of n = 2 k ≥ points from [16]. Then every covering tree T of S satisfies s + t ≥ (20 n − / .Proof. The combination of Lemma 19 and n = s + 2 s yields2 s + t = 2( s + s + s ) + t ≥ ( s + s + t ) + ( s + 2 s )= 2[8 s + 9 s + 4( t + 1)] + 3 s + s + 11 t −
819 + n ≥ s + s −
819 + n = n −
819 + n = 20 n − , as claimed.We are now ready to prove the main result of this section. Theorem 21.
For every integer k ≥ , there exists a finite set of k -colored points in the planesuch that every perfect rainbow polygon has at least (cid:98) ( k − / (cid:99)− vertices. roof. Assume first that k is odd, and let S be the set of k − j ≥ T is a noncrossing covering tree for S minimizing 2 s + t = m , then by Theorem 4, there exists a k -colored point set (cid:98) S built from S such that every perfect rainbow polygon for (cid:98) S has at least m vertices. By Lemma 20, every noncrossing covering tree of S satisfies 2 s + t ≥ k − − , henceevery perfect rainbow polygon for (cid:98) S has at least k − − = (cid:98) ( k − / (cid:99)− vertices.Assume now that k is even. From the ( k − (cid:98) S built previously, we canobtain a k -colored point set (cid:98) S (cid:48) by adding a new point with a different color. Since every perfectrainbow polygon for (cid:98) S has at least k − − = (cid:98) ( k − / (cid:99)− vertices, then every perfect rainbowpolygon for (cid:98) S (cid:48) also has at least (cid:98) ( k − / (cid:99)− vertices. In this paper, we studied the perfect rainbow polygon problem and we proved that the rainbowindex of k satisfies (cid:98) ( k − / (cid:99)− ≤ rb-index( k ) ≤ (cid:98) k (cid:99) + 11, for k ≥
5. We also showed that k = 7 is the first value such that rb-index( k ) (cid:54) = k . Our bounds are based on the equivalencebetween perfect rainbow polygons and noncrossing covering trees.Several open questions arise in relation to this problem. For instance, we conjecture thatgiven a colored point set S , finding a minimum perfect rainbow polygon for S is NP-complete.Another interesting question is to close the gap between the lower and upper bounds on therainbow index. Acknowledgments
David Flores, David Orden, Javier Tejel, Jorge Urrutia, and Birgit Vogtenhuber are supportedby the H2020-MSCA-RISE project 734922-CONNECT. Research by David Flores-Pe˜naloza wassupported by the grant UNAM PAPIIT IN117317. Research by Mikio Kano was supported byJSPS KAKENHI Grant Number 16K05248. Research by Leonardo Mart´ınez-Sandoval wassupported by the grant ANR-17-CE40-0018 of the French National Research Agency ANR(project CAPPS). Research by David Orden was supported by project MTM2017-83750-P ofthe Spanish Ministry of Science (AEI/FEDER, UE). Research by Javier Tejel was supported byMINECO project MTM2015-63791-R and Gobierno de Arag´on under Grant E41-17R (FEDER).Research by Csaba D. T´oth was supported by NSF awards CCF-1422311, CCF-1423615, andDMS-1800734. Research by Jorge Urrutia was supported by UNAM project PAPIIT IN102117.Research by Birgit Vogtenhuber was supported by the Austrian Science Fund within the col-laborative DACH project
Arrangements and Drawings as FWF project I 3340-N35.
References [1] Bernardo M. ´Abrego, Silvia Fern´andez-Merchant, Mikio Kano, David Orden, Pablo P´erez-Lantero, Carlos Seara, and Javier Tejel. K1,3-covering red and blue points in the plane.
Discrete Mathematics & Theoretical Computer Science , 21(3):6, 2019. doi:10.23638/DMTCS-21-3-6 .[2] A. Karim Abu-Affash, Paz Carmi, Matthew J. Katz, and Yohai Trabelsi. Bottlenecknon-crossing matching in the plane.
Computational Geometry , 47(3):447–457, 2014. doi:10.1016/j.comgeo.2013.10.005 .[3] Greg Aloupis, Jean Cardinal, S´ebastien Collette, Erik D. Demaine, Martin L. Demaine,Muriel Dulieu, Ruy Fabila Monroy, Vi Hart, Ferran Hurtado, Stefan Langerman, Maria19aumell, Carlos Seara, and Perouz Taslakian. Non-crossing matchings of points with geo-metric objects.
Comput. Geom. , 46(1):78–92, 2013. doi:10.1016/j.comgeo.2012.04.005 .[4] Greg Aloupis, Jean Cardinal, S´ebastien Collette, Shinji Imahori, Matias Korman, StefanLangerman, Oded Schwartz, Shakhar Smorodinsky, and Perouz Taslakian. Colorful strips.
Graphs and Combinatorics , 27(3):327–339, 2011. doi:10.1007/s00373-011-1014-5 .[5] Esther M. Arkin, Joseph S. B. Mitchell, and Christine D. Piatko. Minimum-link watchmantours.
Inf. Process. Lett. , 86(4):203–207, 2003. doi:10.1016/S0020-0190(02)00502-1 .[6] Luis Barba and Patrick Schnider. Sharing a pizza: Bisecting masses with two cuts. InJoachim Gudmundsson and Michiel H. M. Smid, editors,
Proc. 29th Canadian Conferenceon Computational Geometry (CCCG) , pages 174–178, 2017. URL: http://2017.cccg.ca/proceedings/CCCG2017.pdf .[7] Sergey Bereg, Ferran Hurtado, Mikio Kano, Matias Korman, Dolores Lara, Carlos Seara,Rodrigo I. Silveira, Jorge Urrutia, and Kevin Verbeek. Balanced partitions of 3-coloredgeometric sets in the plane.
Discrete Applied Mathematics , 181:21–32, 2015. doi:10.1016/j.dam.2014.10.015 .[8] Sergey Bereg and Mikio Kano. Balanced line for a 3-colored point set in the plane.
Electr. J.Comb. , 19(1):P33, 2012. URL: .[9] Sergey Bereg, Feifei Ma, Wencheng Wang, Jian Zhang, and Binhai Zhu. On some matchingproblems under the color-spanning model.
Theor. Comput. Sci. , 786:26–31, 2019. doi:10.1016/j.tcs.2018.08.008 .[10] Sergei Bespamyatnikh, David G. Kirkpatrick, and Jack Snoeyink. Generalizing ham sand-wich cuts to equitable subdivisions.
Discrete & Computational Geometry , 24(4):605–622,2000. doi:10.1007/s004540010065 .[11] Ahmad Biniaz, Prosenjit Bose, Anil Maheshwari, and Michiel H. M. Smid. Plane bichro-matic trees of low degree.
Discrete & Computational Geometry , 59(4):864–885, 2018. doi:10.1007/s00454-017-9881-z .[12] Pavle V. M. Blagojevic, G¨unter Rote, Johanna K. Steinmeyer, and G¨unter M. Ziegler. Con-vex equipartitions of colored point sets.
Discrete & Computational Geometry , 61(2):355–363, 2019. doi:10.1007/s00454-017-9959-7 .[13] Bj¨orn Brod´en, Mikael Hammar, and Bengt J. Nilsson. Guarding lines and 2-link polygonsis APX-hard. In
Proc. 13th Canadian Conference on Computational Geometry (CCCG) ,pages 45–48, 2001. URL: .[14] Mark de Berg, Otfried Cheong, Marc van Kreveld, and Mark Overmars.
ComputationalGeometry: Algorithms and Applications . Springer, Berlin, 3rd edition, 2008. doi:10.1007/978-3-540-77974-2 .[15] Olivier Devillers, Ferran Hurtado, Gyula K´arolyi, and Carlos Seara. Chromatic variants ofthe Erd˝os-Szekeres theorem on points in convex position.
Comput. Geom. , 26(3):193–208,2003. doi:10.1016/S0925-7721(03)00013-0 .[16] Adrian Dumitrescu, D´aniel Gerbner, Bal´azs Keszegh, and Csaba D. T´oth. Covering pathsfor planar point sets.
Discrete & Computational Geometry , 51(2):462–484, 2014. doi:10.1007/s00454-013-9563-4 . 2017] Adrian Dumitrescu and Minghui Jiang. On the approximability of covering points by linesand related problems.
Comput. Geom. , 48(9):703–717, 2015. doi:10.1016/j.comgeo.2015.06.006 .[18] Adrian Dumitrescu and Rick Kaye. Matching colored points in the plane: Some new results.
Comput. Geom. , 19(1):69–85, 2001. doi:10.1016/S0925-7721(01)00007-4 .[19] Chenglin Fan, Jun Luo, Wencheng Wang, Farong Zhong, and Binhai Zhu. On someproximity problems of colored sets.
J. Comput. Sci. Technol. , 29(5):879–886, 2014. doi:10.1007/s11390-014-1475-0 .[20] Rudolf Fleischer and Xiaoming Xu. Computing minimum diameter color-spanning sets ishard.
Inf. Process. Lett. , 111(21-22):1054–1056, 2011. doi:10.1016/j.ipl.2011.07.015 .[21] Andreas F. Holmsen, Jan Kynˇcl, and Claudiu Valculescu. Near equipartitions of coloredpoint sets.
Comput. Geom. , 65:35–42, 2017. doi:10.1016/j.comgeo.2017.05.001 .[22] Riko Jacob and Gerth Stølting Brodal. Dynamic planar convex hull. Manuscript, 2019. arXiv:1902.11169 .[23] Wenqi Ju, Chenglin Fan, Jun Luo, Binhai Zhu, and Ovidiu Daescu. On some geometricproblems of color-spanning sets.
J. Comb. Optim. , 26(2):266–283, 2013. doi:10.1007/s10878-012-9458-y .[24] Atsushi Kaneko and Mikio Kano. Discrete geometry on red and blue points in the plane:A survey. In Boris Aronov, Saugata Basu, J´anos Pach, and Micha Sharir, editors,
Discreteand Computational Geometry: The Goodman-Pollack Festschrift , pages 551–570. Springer,Berlin, 2003. doi:10.1007/978-3-642-55566-4_25 .[25] Mikio Kano and Jan Kynˇcl. The hamburger theorem.
Comput. Geom. , 68:167–173, 2018. doi:10.1016/j.comgeo.2017.06.012 .[26] Mikio Kano, Kazuhiro Suzuki, and Miyuki Uno. Properly colored geometric matchings and3-trees without crossings on multicolored points in the plane. In Jin Akiyama, Hiro Ito, andToshinori Sakai, editors,
Discrete and Computational Geometry and Graphs (JCDCGG) ,volume 8845 of
LNCS , pages 96–111. Springer, 2014. doi:10.1007/978-3-319-13287-7 .[27] Stefan Kratsch, Geevarghese Philip, and Saurabh Ray. Point line cover: The easy kernel isessentially tight.
ACM Trans. Algorithms , 12(3):40:1–40:16, 2016. doi:10.1145/2832912 .[28] V. S. Anil Kumar, Sunil Arya, and H. Ramesh. Hardness of set cover with intersection1. In Ugo Montanari, Jos´e D. P. Rolim, and Emo Welzl, editors,
Proc. 27th InternationalColloquium on Automata, Languages and Programming (ICALP) , volume 1853 of
LNCS ,pages 624–635. Springer, 2000. doi:10.1007/3-540-45022-X\_53 .[29] Jan Kynˇcl, J´anos Pach, and G´eza T´oth. Long alternating paths in bicolored point sets.
Discrete Mathematics , 308(19):4315–4321, 2008. doi:10.1016/j.disc.2007.08.013 .[30] Jiˇr´ı Matouˇsek.
Using the Borsuk-Ulam Theorem . Universitext. Springer-Verlag, Berlin,2003. doi:10.1007/978-3-540-76649-0 .[31] Nimrod Megiddo and Arie Tamir. On the complexity of locating linear facilities in theplane.
Oper. Res. Lett. , 1(5):194–197, 1982. doi:10.1016/0167-6377(82)90039-6 .2132] Nabil H. Mustafa and Kasturi Varadarajan. Epsilon-approximations and epsilon-nets. InCsaba D. T´oth, Joseph O’Rourke, and Jacob E. Goodman, editors,
Handbook of Discreteand Computational Geometry , chapter 47. Chapman and Hall/CRC, Boca Raton, FL, 3rdedition, 2017. doi:10.1201/9781315119601 .[33] Jonas Pruente. Minimum diameter color-spanning sets revisited.
Discrete Optimization ,34, 2019. doi:10.1016/j.disopt.2019.07.001 .[34] Toshinori Sakai. Balanced convex partitions of measures in R . Graphs and Combinatorics ,18(1):169–192, 2002. doi:10.1007/s003730200011doi:10.1007/s003730200011