On the Minimum Consistent Subset Problem
Ahmad Biniaz, Sergio Cabello, Paz Carmi, Jean-Lou De Carufel, Anil Maheshwari, Saeed Mehrabi, Michiel Smid
OOn the Minimum Consistent Subset Problem
Ahmad Biniaz ∗ Sergio Cabello † Paz Carmi ‡ Jean-Lou De Carufel § Anil Maheshwari ¶ Saeed Mehrabi ¶ Michiel Smid ¶ Abstract
Let P be a set of n colored points in the plane. Introduced by Hart (1968), a consistentsubset of P , is a set S ⊆ P such that for every point p in P \ S , the closest point of p in S has the same color as p . The consistent subset problem is to find a consistent subset of P withminimum cardinality. This problem is known to be NP-complete even for two-colored pointsets. Since the initial presentation of this problem, aside from the hardness results, there hasnot been significant progress from the algorithmic point of view. In this paper we present thefollowing algorithmic results:1. The first subexponential-time algorithm for the consistent subset problem.2. An O ( n log n )-time algorithm that finds a consistent subset of size two in two-coloredpoint sets (if such a subset exists). Towards our proof of this running time we present adeterministic O ( n log n )-time algorithm for computing a variant of the compact Voronoidiagram; this improves the previously claimed expected running time.3. An O ( n log n )-time algorithm that finds a minimum consistent subset in two-colored pointsets where one color class contains exactly one point; this improves the previous best known O ( n ) running time which is due to Wilfong (SoCG 1991).4. An O ( n )-time algorithm for the consistent subset problem on collinear points; this improvesthe previous best known O ( n ) running time.5. A non-trivial O ( n )-time dynamic programming algorithm for the consistent subset prob-lem on points arranged on two parallel lines.To obtain these results, we combine tools from planar separators, paraboloid lifting, additively-weighted Voronoi diagrams with respect to convex distance functions, point location in farthest-point Voronoi diagrams, range trees, minimum covering of a circle with arcs, and several geo-metric transformations. One of the important problems in pattern recognition is to classify new objects according to thecurrent objects using the nearest neighbor rule. Motivated by this problem, in 1968, Hart [6]introduced the notion of consistent subset as follows. For a set P of colored points in the plane, aset S ⊆ P is a consistent subset if for every point p ∈ P \ S , the closest point of p in S has the samecolor as p . The consistent subset problem asks for a consistent subset with minimum cardinality. ∗ Cheriton School of Computer Science, University of Waterloo, [email protected] † Department of Mathematics, IMFM and FMF, University of Ljubljana, [email protected] ‡ Department of Computer Science, Ben-Gurion University of the Negev, [email protected] § School of Electrical Engineering and Computer Science, University of Ottawa, [email protected] ¶ School of Computer Science, Carleton University, { anil, michiel } @scs.carleton.ca, [email protected] In some previous works the points have labels, as opposed to colors. a r X i v : . [ c s . C G ] N ov ormally, we are given a set P of n points in the plane that is partitioned into P , . . . , P k , with k (cid:62)
2, and the goal is to find an smallest set S ⊆ P such that for every i ∈ { , . . . , k } it holds thatif p ∈ P i then the nearest neighbor of p in S belongs to P i . It is implied by the definition that S should contain at least one point from every P i . To keep the terminology consistent with somerecent works on this problem we will be dealing with colored points instead of partitions, that is,we assume that the points of P i are colored i . Following this terminology, the consistent subsetproblem asks for a smallest subset S of P such that the color of every point p ∈ P \ S is the same asthe color of its closest point in S . The notion of consistent subset has a close relation with Voronoidiagrams, a well-known structure in computational geometry. Consider the Voronoi diagram of asubset S of P . Then, S is a consistent subset of P if and only if for every point s ∈ S it holds thatthe points of P , that lie in the Voronoi cell of s , have the same color as s ; see Figure 1(a).Since the initial presentation of this problem in 1968, there has not been significant progressfrom the algorithmic point of view. Although there were several attempts for developing algorithms,they either did not guarantee the optimality [4, 6, 16] or had exponential running time [15]. InSoCG 1991, Wilfong [16] proved that the consistent subset problem is NP-complete if the inputpoints are colored by at least three colors—the proof is based on the NP completeness of the disccover problem [11]. He further presented a technically-involved O ( n )-time algorithm for a specialcase of two-colored input points where one point is red and all other points are blue; his elegantalgorithm transforms the consistent subset problem to the problem of covering points with diskswhich in turn is transformed to the problem of covering a circle with arcs. It has been recentlyproved, by Khodamoradi et al. [8], that the consistent subset problem with two colors is also NP-complete—the proof is by a reduction from the planar rectilinear monotone 3-SAT [3]. Observethat the one color version of the problem is trivial because every single point is a consistent subset.More recently, Banerjee et al. [1] showed that the consistent subset problem on collinear points,i.e., points that lie on a straight line, can be solved optimally in O ( n ) time.Recently, Gottlieb et al. [5] studied a two-colored version of the consistent subset problem —referred to as the nearest neighbor condensing problem — where the points come from a metricspace. They prove a lower bound for the hardness of approximating a minimum consistent subset;this lower bound includes two parameters: the doubling dimension of the space and the ratio of theminimum distance between points of opposite colors to the diameter of the point set. Moreover, forthis two-colored version of the problem, they give an approximation algorithm whose ratio almostmatches the lower bound.In a related problem, which is called the selective subset problem, the goal is to find the smallestsubset S of P such that for every p ∈ P i the nearest neighbor of p in S ∪ ( P \ P i ) belongs to P i .Wilfong [16] showed that this problem is also NP-complete even with two colors. See [1] for somerecent progress on this problem.In this paper we study the consistent subset problem. We improve some previous resultsand present some new results. To obtain these results, we combine tools from planar separators,additively-weighted Voronoi diagrams with respect to a convex distance function, point location infarthest-point Voronoi diagrams, range trees, paraboloid lifting, minimum covering of a circle witharcs, and several geometric transformations. We present the first subexponential-time algorithmfor this problem. We also present an O ( n log n )-time algorithm that finds a consistent subset ofsize two in two-colored point sets (if such a subset exists); this is obtained by transforming theconsistent subset problem into a point-cone incidence problem in dimension three. Towards ourproof of this running time we present a deterministic O ( n log n )-time algorithm for computing avariant of the compact Voronoi diagram; this improves the O ( n log n ) expected running time of therandomized algorithm of Bhattacharya et al. [2]. We also revisit the case where one point is red andall other points are blue; we give an O ( n log n )-time algorithm for this case, thereby improving the2revious O ( n ) running time of [16]. For collinear points, we present an O ( n )-time algorithm; thisimproves the previous running time by a factor of Θ( n ). We also present a non-trivial O ( n )-timedynamic programming algorithm for points arranged on two parallel lines. The consistent subset problem can easily be solved in exponential time by simply checking allpossible subsets of P . In this section we present the first subexponential-time algorithm for thisproblem. We consider the decision version of this problem in which we are given a set P of n coloredpoints in the plane and an integer k , and we want to decide whether or not P has a consistent subsetof size k . Moreover, if the answer is positive, then we want to find such a subset. This problemcan be solved in time n O ( k ) by checking all possible subsets of size k . We show how to solve thisproblem in time n O ( √ k ) ; we use a recursive separator-based technique that was introduced in 1993by Hwang et al. [7] for the Euclidean k -center problem, and then extended by Marx and Pilipczuk[10] for planar facility location problems. Although this technique is known before, its applicationin our setting is not straightforward and requires technical details which we give in this section.Consider an optimal solution S of size k . The Voronoi diagram of S , say V , is a partition ofthe plane into convex regions. We want to convert V to a 2-connected 3-regular planar graph thathave a balanced curve separator. Then we want to use this separator to split the problem into twosubproblems that can be solved independently. To that end, first we introduce small perturbation v v v to the coordinates of points of P to ensure that no four points lie on theboundary of a circle; this ensures that every vertex of V has degree3. The Voronoi diagram V consists of finite segments and infiniterays. We want V to have at most three infinite rays. To achievethis, we introduce three new points v , v , v that lie on the verticesof a sufficiently large equilateral triangle that contains P , and thenwe color them by three new colors; see the right figure. Since thesethree points have distinct colors, they appear in any consistent subsetof P ∪ { v , v , v } . Moreover, since they are far from the originalpoints, by adding them to any consistent subset of P we obtain avalid consistent subset for P ∪ { v , v , v } . Conversely, by removingthese three points from any consistent subset of P ∪ { v , v , v } we obtain a valid consistent subsetfor P . Therefore, in the rest of our description we assume, without loss of generality, that P contains v , v , v . Consequently, the optimal solution S also contains those three points; this implies that V has three infinite rays which are introduced by v , v , v (see the above figure). We introducea new vertex at infinity and connect these three rays to that vertex. To this end we obtain a2-connected 3-regular planar graph, namely G . Marx and Pilipczuk [10] showed that such a graphhas a polygonal separator δ of size O ( √ k ) (going through O ( √ k ) faces and vertices) that is facebalanced , in the sense that there are at most 2 k/ G strictly inside δ and at most 2 k/ G strictly outside δ . The vertices of δ alternate between points of S and the vertices of G as depicted in Figure 1(a). See [14] for an alternate way of computing a balanced curve separator.We are going to use dynamic programming based on balanced curve separators of G . The mainidea is to use δ to split the problem into two smaller subproblems, one inside δ and one outside δ ,and then solve each subproblem recursively. But, we do not know G and hence we have no wayof computing δ . However, we can guess δ by trying all possible balanced curve separators of size k (cid:48) = O ( √ k ). The triangle is large in the sense that for every point p ∈ P , the closet point to p , among P ∪ { v , v , v } , is in P . D (a) (b)Figure 1: (a) A solution S (bold points), together with its Voronoi diagram V , and a balanced curveseparator δ . (b) A subproblem with input domain D (shaded region) and a set S (cid:48) (bold points)that is part of the solution.Every vertex of δ is either a point of P or a vertex of G (and consequently a vertex of V ) that isintroduced by three points of P . Therefore, every curve separator of size k (cid:48) is defined by at most3 k (cid:48) points of P , and thus, the number of such separators is at most (cid:0) n k (cid:48) (cid:1) (cid:54) n k (cid:48) = n O ( √ k ) . Tofind these curve separators, we try every subset of at most 3 k (cid:48) points of P . For every such subsetwe compute its Voronoi diagram, which has at most 6 k (cid:48) vertices. For the set that is the unionof the 3 k (cid:48) points and the 6 k (cid:48) vertices, we check all 2 (6 k (cid:48) +3 k (cid:48) ) subsets and choose every subset thatforms a balanced curve separator (that alternates between points and vertices). Therefore, in atime proportional to n k (cid:48) · k (cid:48) = n O ( √ k ) we can compute all balanced curve separators.By trying all balanced curve separators, we may assume that we have correctly guessed δ andthe subset S (cid:48) of P , with | S (cid:48) | (cid:54) k (cid:48) , that defines δ . The solution of our main problem consists of S (cid:48) and the solutions of the two separate subproblems, one inside δ and one outside δ . To solvethese two subproblems recursively, in the later steps, we get subproblems of the following form.Throughout our description, we will assume that P is fixed for all subproblems. The input of everysubproblem consists of a positive integer x ( (cid:54) k ), a subset S (cid:48) of y ( (cid:54) k ) points of P that are alreadychosen to be in the solution, and a polygonal domain D —possibly with holes—of size Θ( y ) which isa polygon its vertices alternating between the points of S (cid:48) and the vertices of the Voronoi diagramof S (cid:48) . The task is to select a subset S ⊆ ( P ∩ D ) \ S (cid:48) of size x such that:( i ) D is a polygon where its vertices alternate between the points of S (cid:48) and the vertices of theVoronoi diagram of S ∪ S (cid:48) , and( ii ) S ∪ S (cid:48) is a consistent subset for ( P ∩ D ) ∪ S (cid:48) .See Figure 1(b) for an illustration of such a subproblem. The top-level subproblem has x = k and y = 0. We stop the recursive calls as soon as we reach a subproblem with x = O ( √ k ), inwhich case, we spend O ( n x ) time to solve this subproblem; this is done by trying all subsets of( P ∩ D ) \ S (cid:48) that have size x . For every subproblem, the number of points in S (cid:48) (i.e., y ) is at mostthree times the number of vertices on the boundary of the domain D . The number of vertices onthe boundary of D —that are accumulated during recursive calls—is at most4 k + (cid:114) k + (cid:115)(cid:18) (cid:19) k + (cid:115)(cid:18) (cid:19) k + ... = O ( √ k ) . Therefore, y = | S (cid:48) | = O ( √ k ), and thus the Voronoi diagram of S ∪ S (cid:48) has a balanced curveseparator of size O ( √ x + y ) = O ( √ k ). We try all possible n O ( √ k ) such separators, and for eachof which we recursively solve the two subproblems in its interior and exterior. For these twosubproblems to be really independent we include the O ( √ k ) points, defining the separator, in theinputs of both subproblems. Therefore, the running time of our algorithm can be interpreted bythe following recursion T ( n, k ) (cid:54) n O ( √ k ) · max (cid:8) T ( n, k + y ) + T ( n, k + y ) | k + k + y = k, k , k (cid:54) k/ , y = O ( √ k ) (cid:9) , which solves to T ( n, k ) (cid:54) n O ( √ k ) . Notice that our algorithm solves the decision version of theconsistent subset problem for a fixed k .To compute the consistent subset of minimum cardinality, whose size, say k , is unknown at thestart of the algorithm, we apply the following standard technique: Start with a constant value κ ,for example κ = 1. Run the decision algorithm with the value κ . If the answer is negative, thendouble the value of κ and repeat this process until the first time the decision algorithm gives apositive answer.Consider the last value for κ . Note that κ/ < k (cid:54) κ . We perform a binary search for k in theinterval [ κ/ , κ ]. In this way, we find the value of k , as well as the consistent subset of minimumcardinality, by running the decision algorithm O (log κ ) times. Thus, the total running time is n O ( √ κ ) · O (log κ ), which is n O ( √ k ) . We have proved the following theorem. Theorem 1.
A minimum consistent subset of n colored points in the plane can be computed in n O ( √ k ) time, where k is the size of the minimum consistent subset. In this section we investigate the existence of a consistent subset of size two in a set of bichromaticpoints where every point is colored by one of the two colors, say red and blue. Before stating theproblem formally we introduce some terminology. For a set P of points in the plane, we denotethe convex hull of P by CH ( P ). For two points p and q in the plane, we denote the straight-linesegment between p and q by pq , and the perpendicular bisector of pq by β ( p, q ).Let R and B be two disjoint sets of total n points in the plane such that the points of R arecolored red and the points of B are colored blue. We want to decide whether or not R ∪ B has aconsistent subset of size two. Moreover, if the answer is positive, then we want to find such points,i.e., a red point r ∈ R and a blue point b ∈ B such that all red points are closer to r than to b , andall blue points are closer to b than to r . Alternatively, we want to find a pair of points ( r, b ) ∈ R × B such that β ( r, b ) separates CH ( R ) and CH ( B ). This problem can be solved in O ( n log n ) time bytrying all the O ( n ) pairs ( r, b ) ∈ R × B ; for each pair ( r, b ) we can verify, in O (log n ) time, whetheror not β ( r, b ) separates CH ( R ) and CH ( B ). In this section we show how to solve this problem intime O ( n log n ). To that end, we assume that CH ( R ) and CH ( B ) are disjoint, because otherwisethere is no such pair ( r, b ). In fact the 2-connected 3-regular planar graph obtained from the Voronoi diagram of S ∪ S (cid:48) has such a separator. bβ ( r, b ) It might be tempting to believe that a solution of this problem containspoints only from the boundaries of CH ( R ) and CH ( B ). However, this is notnecessarily the case; in the figure to the right, the only solution of this problemcontains r and b which are in the interiors of CH ( R ) and CH ( B ). Also, dueto the close relation between Voronoi diagrams and Delaunay triangulations,one may believe that a solution is defined by the two endpoints of an edge inthe Delaunay triangulation of R ∪ B . This is not necessarily the case either;the green edges in the figure to the right, which are the Delaunay edges between R and B , do notintroduce any solution.A separating common tangent of two disjoint convex polygons, P and P , is a line (cid:96) that istangent to both P and P such that P and P lie on different sides of (cid:96) . Every two disjoint convexpolygons have two separating common tangents; see Figure 2. Let (cid:96) and (cid:96) be the separatingcommon tangents of CH ( R ) and CH ( B ). Let R (cid:48) and B (cid:48) be the subsets of R and B on theboundaries of CH ( R ) and CH ( B ), respectively, that are between (cid:96) and (cid:96) as depicted in Figure 2.For two points p and q in the plane, let D ( p, q ) be the closed disk that is centered at p and has q on its boundary. Lemma 1.
For every two points r ∈ R and b ∈ B , the bisector β ( r, b ) separates R and B if andonly if ( i ) ∀ r (cid:48) ∈ R (cid:48) : b / ∈ D ( r (cid:48) , r ) , and ( ii ) ∀ b (cid:48) ∈ B (cid:48) : b ∈ D ( b (cid:48) , r ) .Proof. For the direct implication since β ( r, b ) separates R and B , every red point r (cid:48) (and in par-ticular every point in R (cid:48) ) is closer to r than to b ; this implies that D ( r (cid:48) , r ) does not contain b andthus (i) holds. Also, every blue point b (cid:48) (and in particular every point in B (cid:48) ) is closer to b than to r ; this implies that D ( b (cid:48) , r ) contains b and thus (ii) holds. See Figure 2.Now we prove the converse implication by contradiction. Assume that both (i) and (ii) hold forsome r ∈ R and some b ∈ B , but the bisector β ( r, b ) does not separate R and B . After a suitablerotation we may assume that β ( r, b ) is vertical, r is to the left side of β ( r, b ) and b is to the rightside of β ( r, b ). Since β ( r, b ) does not separate R and B , there exists either a point of R to the rightside of β ( r, b ), or a point of B to the left side of β ( r, b ). If there is a point of R to the right sideof β ( r, b ) then there is also a point r (cid:48) ∈ R (cid:48) to the right side of β ( r, b ). In this case r (cid:48) is closer to b than to r , and thus the disk D ( r (cid:48) , r ) contains b which contradicts (i). If there is a point of B tothe left side of β ( r, b ) then there is also a point b (cid:48) ∈ B (cid:48) to the left side of β ( r, b ). In this case b (cid:48) iscloser to r than to b and thus the disk D ( b (cid:48) , r ) does not contain b which contradicts (ii).Lemma 1 implies that for a pair ( r, b ) ∈ R × B to be a consistent subset of R ∪ B it is necessaryand sufficient that every point of R (cid:48) is closer to r than to b , and every point of B (cid:48) is closer to b than to r . This lemma does not imply that r and b are necessarily in R (cid:48) and B (cid:48) . Observe thatLemma 1 holds even if we swap the roles of r, r (cid:48) , R (cid:48) with b, b (cid:48) , B (cid:48) in (i) and (ii). Also, observe thatthis lemma holds even if we take R (cid:48) and B (cid:48) as all red and blue points on boundaries of CH ( R ) and CH ( B ).For every red point r ∈ R we define a feasible region F r as follow F r = (cid:32) (cid:92) b (cid:48) ∈ B (cid:48) D ( b (cid:48) , r ) (cid:33) \ (cid:32) (cid:91) r (cid:48) ∈ R (cid:48) D ( r (cid:48) , r ) (cid:33) . See Figure 2 for illustration of a feasible region. Lemma 1, together with this definition, imply thefollowing corollary. 6 r (cid:48) r (cid:48) r (cid:48) b (cid:48) b (cid:48) b (cid:48) b (cid:48) D ( r (cid:48) , r ) D ( b (cid:48) , r ) D ( b (cid:48) , r ) D ( b (cid:48) , r ) D ( b (cid:48) , r ) D ( r (cid:48) , r ) F r (cid:96) (cid:96) Figure 2: The lines (cid:96) and (cid:96) are the separating common tangents of CH ( R ) and CH ( B ). R (cid:48) = { r (cid:48) , r (cid:48) , r (cid:48) } and B (cid:48) = { b (cid:48) , b (cid:48) , b (cid:48) , b (cid:48) } are the subsets of R and B on boundaries of CH ( R ) and CH ( B )that lie between (cid:96) and (cid:96) . The feasible region F r for point r is shaded. Corollary 1.
For every two points r ∈ R and b ∈ B , the bisector β ( r, b ) separates R and B if andonly if b ∈ F r . Based on this corollary, our original decision problem reduces to the following question.
Question 1.
Is there a blue point b ∈ B such that b lies in the feasible region F r of some red point r ∈ R ? If the answer to Question 1 is positive then { r, b } is a consistent subset for R ∪ B , and if theanswer is negative then R ∪ B does not have a consistent subset with two points. In the rest ofthis section we show how to answer Question 1. To that end, we lift the plane onto the paraboloid z = x + y by projecting every point s = ( x, y ) in R onto the point ˆ s = ( x, y, x + y ) in R .This lift projects a circle in R onto a plane in R . Consider a disk D ( p, q ) in R and let π ( p, q )be the plane in R that contains the projection of the boundary circle of D ( p, q ). Let H − ( p, q ) bethe lower closed halfspace defined by π ( p, q ), and let H + ( p, q ) be the upper open halfspace definedby π ( p, q ). For every point s ∈ R , its projection ˆ s lies in H − ( p, q ) if and only if s ∈ D ( p, q ), andlies in H + ( p, q ) otherwise. Moreover, ˆ s lies in π ( p, q ) if and only if s is on the boundary circle of D ( p, q ). For every point r ∈ R we define a polytope C r in R as follow C r = (cid:32) (cid:92) b (cid:48) ∈ B (cid:48) H − ( b (cid:48) , r ) (cid:33) ∩ (cid:32) (cid:92) r (cid:48) ∈ R (cid:48) H + ( r (cid:48) , r ) (cid:33) . Based on the above discussion, Corollary 1 can be translated to the following corollary.
Corollary 2.
For every two points r ∈ R and b ∈ B , the bisector β ( r, b ) separates R and B if andonly if ˆ b ∈ C r . This corollary, in turn, translates Question 1 to the following question.
Question 2.
Is there a blue point b ∈ B such that its projection ˆ b lies in the polytope C r for somered point r ∈ R ? C r is the intersection of some halfs-paces, each of which has ˆ r on its boundary plane. Therefore, C r is a cone in R with apex ˆ r ; seeFigure 3. Recall that | R ∪ B | = n , however, for the purposes of worst-case running-time analysisand to simplify indexing, we will index the red points, and also the blue points, from 1 to n . Let r , r , , . . . , r n be the points of R . For every point r i ∈ R , let τ i be the translation that brings ˆ r toˆ r i . Notice that τ is the identity transformation. In the rest of this section we will write C i for C r i . Lemma 2.
For every point r i ∈ R , the cone C i is the translation of C with respect to τ i . xy z C C i r r i ˆ r ˆ r i τ i π C i π C Proof.
For a circle C in R , let π C denote the plane in R that C translates onto. For every two concentric circles C and C i in R it holds that π C and π C i are parallel; see the figure to theright. It follows that, if C passes through the point r , and C i passes through the point r i , then π C i is obtained from π C by thetranslation τ i that brings ˆ r to ˆ r i , that is τ i ( π C ) = π C i . A sim-ilar argument holds also for the halfspaces defined by π C and π C i . Since for every a ∈ R (cid:48) ∪ B (cid:48) the disks D ( a, r ) and D ( a, r i )are concentric and the boundary of D ( a, r ) passes through r and the boundary of D ( a, r i ) passes through r i , it follows that τ i ( H + ( a, r )) = H + ( a, r i ) and τ i ( H − ( a, r )) = H − ( a, r i ). Sincea translation of a polytope is obtained by translating each of the halfspaces defining it, we have τ i ( C ) = C i as depicted in Figure 3. ˆ r ˆ r ˆ r ˆ bτ τ C C C Where am I?
Figure 3: The cones C and C are the translations of C with respect to τ and τ .It follows from Lemma 2 that to answer Question 2 it suffices to solve the following problem:Given a cone C defined by n halfspaces, n translations of C , and set of n points, we want to decidewhether or not there is a point in some cone (see Figure 3). This can be verified in O ( n log n ) time,using Theorem 7 that we will prove later in Section 6. This is the end of our constructive proof.The following theorem summarizes our result in this section. Theorem 2.
Given a set of n bichromatic points in the plane, in O ( n log n ) time, we can computea consistent subset of size two ( if such a set exists ) . In this section we revisit the consistent subset problem for the case where one input point is redand all other points are blue. Let P be a set of n points in the plane consisting of a red point and8 − P contains the only red point and someblue points. In his seminal work in SoCG 1991, Wilfong [16] showed that P has a consistent subsetof size at most seven (including the red point); this implies an O ( n )-time brute force algorithmfor this problem. Wilfong showed how to solve this problem in O ( n )-time; his elegant algorithmtransforms the consistent subset problem to the problem of covering points with disks which in turnis transformed to the problem of covering a circle with arcs. The running time of his algorithmis dominated by the transformation to the circle covering problem which involves computation of n − O ( n ) time; all other transformations together with the solution of the circle coveringproblem take O ( n log n ) time ([16, Lemma 19 and Theorem 9]).We first introduce the circle covering problem, then we give a summary of Wilfong’s transfor-mation to this problem, and then we show how to perform this transformation in O ( n log n ) timewhich implies the same running time for the entire algorithm. We emphasis that the most involvedpart of the algorithm, which is the correctness proof of this transformation, is due to Wilfong. cc ( b i ) A ( b i ) D ( b i ) Cb i c ( b i ) b i +1 r ν ν ( R ) b i c ( b i ) ν ∗ b b n − (a) (b)Figure 4: (a) Transformation to the circle covering problem. (b) The range tree T on blue points.Let C be a circle and let A be a set of arcs covering the entire C . The circle covering problemasks for a subset of A , with minimum cardinality, that covers the entire C .Wilfong’s algorithm starts by mapping input points to the projective plane, and then trans-forming (in two stages) the consistent subset problem to the circle covering problem. Let P denotethe set of points after the mapping, and let r denote the only red point of P . The transformation,which is depicted in Figure 4(a), proceeds as follows. Let C be a circle centered at r that does notcontain any blue point. Let b , b , . . . , b n − be the blue points in clockwise circular order around r ( b is the first clockwise point after b n − , and b n − is the first counterclockwise point after b ).For each point b i , let D ( b i ) be the disk of radius | rb i | centered at b i . Define cc ( b i ) to be the firstcounterclockwise point (measured from b i ) that is not in D ( b i ), and similarly define c ( b i ) to be thefirst clockwise point that is not in D ( b i ). Denote by A ( b i ) the open arc of C that is contained inthe wedge with counterclockwise boundary ray from r to cc ( b i ) and the clockwise boundary rayfrom r to c ( b i ). Let A be the set of all arcs A ( b i ); since blue points are assumed to be in circularorder, A covers the entire C . Wilfong proved that our instance of the consistent subset problem is Wilfong shrinks the endpoint of A ( b i ) that corresponds to cc ( b i ) by half the clockwise angle from cc ( b i ) to thenext point, and shrinks the endpoint of A ( b i ) that corresponds to c ( b i ) by half the counterclockwise angle from c ( b i )to the previous point. C with A . The running time of his algorithm is dominatedby the computation of A in O ( n ) time. We show how to compute A in O ( n log n ) time.In order to find each arc A ( b i ) it suffices to find the points cc ( b i ) and c ( b i ). Having the clockwiseordering of points around r , one can find these points in O ( n ) time for each b i , and consequently in O ( n ) time for all b i ’s. In the rest of this section we show how to find c ( b i ) for all b i ’s in O ( n log n )time; the points cc ( b i ) can be found in a similar fashion.By the definition of c ( b i ) all points of the sequence b i +1 , . . . , c ( b i ), except c ( b i ), lie inside D ( b i ).Therefore among all points b i +1 , . . . , c ( b i ), the point c ( b i ) is the farthest from b i . This implies thatin the farthest-point Voronoi diagram of b i +1 , . . . , c ( b i ), the point b i lies in the cell of c ( b i ). Toexploit this property of c ( b i ), we construct a 1-dimensional range tree T on all blue points based ontheir clockwise order around r ; blue points are stored at the leaves of T as in Figure 4(b). At everyinternal node ν of T we store the farthest-point Voronoi diagram of the blue points that are storedat the leaves of the subtree rooted at ν ; we refer to this diagram by FVD( ν ). This data structurecan be computed in O ( n log n ) time because T has O (log n ) levels and in each level we computefarthest-point Voronoi diagrams of total n − b , . . . , b n − is a linear order. At the end of this section, in Remark 1, weshow how to deal with the circular order.We use the above data structure to find each point c ( b i ) in O (log n ) time. To that end, we walkup the tree from the leaf containing b i (first phase), and then walk down the tree (second phase) asdescribed below; also see Figure 4(b). For every internal node ν , let ν ( L ) and ν ( R ) denote its leftand right children, respectively. In the first phase, for every internal node ν in the walk, we locatethe point b i in FVD( ν ( R )) and find the point b f that is farthest from b i . If b f lies in D ( b i ) then alsodoes every point stored at the subtree of ν ( R ). In this case we continue walking up the tree andrepeat the above point location process until we find, for the first time, the node ν ∗ for which b f does not lie in D ( b i ). To this end we know that c ( b i ) is among the points stored at ν ∗ ( R ). Now westart the second phase and walk down the tree from ν ∗ ( R ). For every internal node ν in this walk,we locate b i in FVD( ν ( L )) and find the point b f that is farthest from b i . If b f lies in D ( b i ), thenalso does every point stored at ν ( L ), and hence we go to ν ( R ), otherwise we go to ν ( L ). At theend of this phase we land up in a leaf of T , which stores c ( b i ). The entire walk has O (log n ) nodesand at every node we spend O (log n ) time for locating b i . Thus the time to find c ( b i ) is O (log n ).Therefore, we can find all c ( b i )’s in O ( n log n ) total time. Theorem 3.
A minimum consistent subset of n points in the plane, where one point is red and allother points are blue, can be computed in O ( n log n ) time. Remark 1.
To deal with the circular order b , . . . , b n − , we build the range tree T with 2( n − b , . . . , b n − , b , . . . , b n − . For a given b i , the point c ( b i ) can be any of the points b i +1 , . . . , b n − ,b , . . . , b i − . To find c ( b i ), we first follow the path from the root of T to the leftmost leaf that stores b i , and then from that leaf we start looking for c ( b i ) as described above. In this section we present polynomial-time algorithms for the consistent subset problem on threerestricted classes of point sets. First we present an O ( n )-time algorithm for collinear points; thisimproves the previous quadratic-time algorithm of Banerjee et al. [1]. Then we present an involvednon-trivial O ( n )-time dynamic programming algorithm for points that are placed on two parallellines. Finally we present an O ( n )-time algorithm for two-colored points, namely red and blue,that are placed on two parallel lines such that all points on one line are red and all points on theother line are blue. 10 .1 Collinear Points Let P be a set of n colored points on the x -axis, and let p , . . . , p n be the sequence of these pointsfrom left to right. We present a dynamic programming algorithm that solves the consistent subsetproblem on P . To simplify the description of our algorithm we add a point p n +1 very far (atdistance at least | p p n | ) to the right of p n . We set the color of p n +1 to be different from that of p n . Observe that every solution for P ∪ { p n +1 } contains p n +1 . Moreover, by removing p n +1 fromany optimal solution of P ∪ { p n +1 } we obtain an optimal solution for P . Therefore, to compute anoptimal solution for P , we first compute an optimal solution for P ∪ { p n +1 } and then remove p n +1 .Our algorithm maintains a table T with n + 1 entries T (1) , . . . , T ( n + 1). Each table entry T ( k ) represents the number of points in a minimum consistent subset of P k = { p , . . . , p k } providedthat p k is in this subset. The number of points in an optimal solution for P will be T ( n + 1) − T . In the rest of this section we show how tosolve a subproblem with input P k provided that p k should be in the solution (thereby in the restof this section the phrase “solution of P k ” refers to a solution that contains p k ). In fact, we showhow to compute T ( k ), by a bottom-up dynamic programming algorithm that scans the points fromleft to right. If P k is monochromatic, then the optimal solution contains only p k , and thus, weset T ( k ) = 1. Hereafter assume that P k is not monochromatic. Consider the partition of P k intomaximal blocks of consecutive points such that the points in each block have the same color. Let B , B , . . . , B m − , B m denote these blocks from left to right, and notice that p k is in B m . Assumethat the points in B m are red and the points in B m − are blue. Let p y be the leftmost point in B m − ; see Figure 5(a). Any optimal solution for P k contains at least one point from { p y , . . . , p k − } ;let p i be the rightmost such point ( p i can be either red or blue). Then, T ( k ) = T ( i ) + 1. Since wedo not know the index i , we try all possible values in { y, . . . , k − } and select one that produces a valid solution, and that minimizes T ( k ): T ( k ) = min { T ( i ) + 1 | i ∈ { y, . . . , k − } and i produces a valid solution } . The index i produces a valid solution (or p i is valid) if one of the following conditions hold:( i ) p i is red, or( ii ) p i is blue, and for every j ∈ { i + 1 , . . . , k − } it holds that if p j is blue then p j is closer to p i than to p k , and if p j is red then p j is closer to p k than to p i .If ( i ) holds then p i and p k have the same color. In this case the validity of our solution for P k is ensured by the validity of the solution of P i . If ( ii ) holds then p i and p k have distinct colors.In this case the validity of our solution for P k depends on the colors of points p i +1 , . . . , p k − . Toverify the validity in this case, it suffices to check the colors of only two points that are to the leftand to the right of the mid-point of the segment p i p k . This can be done in O ( | B m − | ) time for allblue points in B m − while scanning them from left to right. Thus, T ( k ) can be computed in O ( k )time because | B m − | = O ( k ). Therefore, the total running time of the above algorithm is O ( n ).We are now going to show how to compute T ( k ) in constant time, which in turn improves thetotal running time to O ( n ). To that end we first prove the following lemma. Lemma 3.
Let s ∈ { , . . . , m } be an integer, p i , p i +1 , . . . , p j be a sequence of points in B s , and x ∈ { i, . . . , j } be an index for which T ( x ) is minimum. Then, T ( j ) (cid:54) T ( x ) + 1 .Proof. To verify this inequality, observe that by adding p j to the optimal solution of P x we obtaina valid solution (of size T ( x ) + 1) for P j . Therefore, any optimal solution of P j has at most T ( x ) + 1points, and thus T ( j ) (cid:54) T ( x ) + 1. 11 k p y p i T ( i ) T ( k ) B m B m − p k p a d d p b d rd l p i (a) (b)Figure 5: (a) Illustration of the computation of T ( k ) from T ( i ). (b) Any blue point in the range[ l, r ] is valid.At every point p j , in every block B s , we store the index i of the first point p i to the left of p j where p i ∈ B s and T ( i ) is strictly smaller than T ( j ); if there is no such point p i then we store j at p j . These indices can be maintained in linear time while scanning the points from left to right. Weuse these indices to compute T ( k ) in constant time as described below.Notice that if the minimum, in the above calculation of T ( k ), is obtained by a red point in B m then it always produces a valid solution, but if the minimum is obtained by a blue point then weneed to verify its validity. In the former case, it follows from Lemma 3 that the smallest T ( · ) forred points in B m \ { p k } is obtained either by p k − or by the point whose index is stored at p k − .Therefore we can find the smallest T ( · ) in constant time. Now consider the latter case where theminimum is obtained by a blue point in B m − . Let p a be the rightmost point of B m − , and let p b be the leftmost endpoint of B m . Set d = | p b p k | and d = | p a p k | as depicted in Figure 5(b). Set l = x ( p a ) − d and r = x ( p b ) − d , where x ( p a ) and x ( p b ) are the x -coordinates of p a and p b . Anypoint p i ∈ B m − that is to the right of r is invalid because otherwise p b would be closer to p i thanto p k . Any point p i ∈ B m − that is to the left of l is also invalid because otherwise p a would becloser to p k than to p i . However, every point p i ∈ B m − , that is in the range [ l, r ], is valid becauseit satisfies condition ( ii ) above. Thus, to compute T ( k ) it suffices to find a point of B m − in range[ l, r ] with the smallest T ( · ). By slightly abusing notation, let p r be the rightmost point of B m − inrange [ l, r ]. It follows from Lemma 3 that the smallest T ( · ) is obtained either by p r or by the pointwhose index is stored at p r . Thus, in this case also, we can find the smallest T ( · ) in constant time.It only remains to identify, in constant time, the index that we should store at p k (to be usedin next iterations). If p k is the leftmost point in B m , then we store k at p k . Assume that p k is notthe leftmost point in B m , and let x be the index stored at p k − . In this case, if T ( x ) is smallerthan T ( k ) then we store x at p k , otherwise we store k . This assignment ensures that p k stores acorrect index.Based on the above discussion we can compute T ( k ) and identify the index at p k in constanttime. Therefore, our algorithm computes all values of T ( · ) in O ( n ) total time. The followingtheorem summarizes our result in this section. Theorem 4.
A minimum consistent subset of n collinear colored points can be computed in O ( n ) time, provided that the points are given from left to right. In this section we study the consistent subset problem on points that are placed on two parallellines. Let P and Q be two disjoint sets of colored points of total size n , such that the points of P are on a straight line L P and points of Q are on a straight line L Q that is parallel to L P . The goalis to find a minimum consistent subset for P ∪ Q . We present a top-down dynamic programmingalgorithm that solves this problem in O ( n ) time. By a suitable rotation and reflection we may12ssume that L P and L Q are horizontal and L P lies above L Q . If any of the sets P and Q is empty,then this problem reduces to the collinear version that is discussed in Section 5.1. Assume thatnone of P and Q is empty. An optimal solution may contain points from only P , only Q , or fromboth P and Q . We consider these three cases and pick one that gives the minimum number ofpoints:1. The optimal solution contains points from only Q . Consider any solution S ⊆ Q . For everypoint p ∈ P , let p (cid:48) be the vertical projection of p on L Q . Then, a point s ∈ S is the closestpoint to p if and only if s is the closest point to p (cid:48) . This observation suggests the followingalgorithm for this case: First project all points of P vertically on L Q ; let P (cid:48) be the resulting setof points. Then, solve the consistent subset problem for points in Q ∪ P (cid:48) , which are collinearon L Q , with this invariant that the points of P (cid:48) should not be included in the solution butshould be included in the validity check. This can be done in O ( n ) time by modifying thealgorithm of Section 5.1.2. The optimal solution contains points from only P . The solution of this case is analogous tothat of previous case.3.
The optimal solution contains points from both P and Q . The description of this case ismore involved. Add two dummy points p − and p + at −∞ and + ∞ on L P , respectively.Analogously, add q − and q + on L Q . Color these four points by four new colors that aredifferent from the colors of points in P ∪ Q . See Figure 6. Set D = { p + , p − , q + , q − } . Observethat every solution for P ∪ Q ∪ D contains all points of D . Moreover, by removing D fromany optimal solution of P ∪ Q ∪ D we obtain an optimal solution for P ∪ Q . Therefore, tocompute an optimal solution for P ∪ Q , we first compute an optimal solution for P ∪ Q ∪ D and then remove D . In the rest of this section we show how to compute an optimal solutionfor P ∪ Q ∪ D . Without loss of generality, from now on, we assume that p − and p + belong to P , and q − and q + belong to Q . For a point p let (cid:96) p be the vertical line through p . p − q − p + q + p qL P L Q P P Q Q (cid:96) p (cid:96) q Figure 6: The pair ( p, q ) is the closest pair in the optimal solution where p ∈ P \ { p + , p − } and q ∈ Q \ { q + , q − } . This pair splits the problem into two independent subproblems.In the following description the term “solution” refers to an optimal solution. Consider asolution for this problem with input pair ( P, Q ), and let p and q be the closest pair in thissolution such that p ∈ P \ { p + , p − } and q ∈ Q \ { q + , q − } (for now assume that such a pairexists; later we deal with all different cases). These two points split the problem into twosubproblems ( P , Q ) and ( P , Q ) where P contains all points of P that are to the left of p (including p ), P contains all points of P that are to the right of p (including p ), and Q , Q are defined analogously. Our choice of p and q ensures that no point in the solution liesbetween the vertical lines (cid:96) p and (cid:96) q because otherwise that point would be part of the closestpair. See Figure 6. Thus, ( P , Q ) and ( P , Q ) are independent instances of the problem13n the sense that for any point in P ∪ Q (resp. P ∪ Q ) its closest point in the solutionbelongs to P ∪ Q (resp. P ∪ Q ). Therefore, if p and q are given to us, we can solve ( P, Q )as follows: First we recursively compute a solution for ( P , Q ) that contains p − , q − , p, q anddoes not contain any point between (cid:96) p and (cid:96) q . We compute an analogous solution for ( P , Q )recursively. Then, we take the union of these two solutions as our solution of ( P, Q ). We donot know p and q , and thus we try all possible choices.Let p , p , . . . , p | P | and q , q , . . . , q | Q | be the points of P and Q , respectively, from left to right,where p = p − and q = q − . In later steps in our recursive solution we get subproblems oftype S ( i, j, k, l ) where the input to this subproblem is { p i , . . . , p j } ∪ { q k , . . . , q l } and we wantto compute a minimum consistent subset that • contains p i , p j , q k , and q l , and • does not contain any point between (cid:96) p i and (cid:96) q k , nor any point between (cid:96) p j and (cid:96) q l .To simplify our following description, we may also refer to S ( · ) as a four dimensional matrixwhere each of its entries stores the size of the solution for the corresponding subproblem; thesolution itself can also be retrieved from S ( · ). The solution of the original problem will bestored in S (1 , | P | , , | Q | ). In the rest of this section we show how to solve S ( i, j, k, l ) by atop-down dynamic programming approach. Let p i (cid:48) and q k (cid:48) be the first points of P and Q ,respectively, that are to the right sides of both (cid:96) p i and (cid:96) q k , and let p j (cid:48) and q l (cid:48) be the firstpoints of P and Q , respectively, that are to the left sides of both (cid:96) p j and (cid:96) q l ; see Figure 7.Depending on whether or not the solution of S ( i, j, k, l ) contains points from { p i (cid:48) , . . . , p j (cid:48) } and { q k (cid:48) , . . . , q l (cid:48) } we consider the following three cases and pick one that minimizes S ( i, j, k, l ).(a) The solution does not contain points from any of { p i (cid:48) , . . . , p j (cid:48) } and { q k (cid:48) , . . . , q l (cid:48) } . Thus,the solution contains only p i , p j , q k , and q l . To handle this case, we verify the validityof { p i , p j , q k , q l } . If this set is a valid solution, then we assign S ( i, j, k, l ) = 4, otherwisewe assign S ( i, j, k, l ) = + ∞ .(b) The solution contains points from both { p i (cid:48) , . . . , p j (cid:48) } and { q k (cid:48) , . . . , q l (cid:48) } . Let p s ∈ { p i (cid:48) , . . . ,p j (cid:48) } and q t ∈ { q k (cid:48) , . . . , q l (cid:48) } be two such points with minimum distance. Our choice of p s and q t ensures that no point of the solution lies between (cid:96) p s and (cid:96) q t ; see Figure 7. There-fore, the solution of S ( i, j, k, l ) is the union of the solutions of subproblems S ( i, s, k, t )and S ( s, j, t, l ). Since we do not know s and t , we try all possible pairs and pick onethat minimizes S ( · ), that is S ( i, j, k, l ) = min { S ( i, s, k, t ) + S ( s, j, t, l ) − | i (cid:48) (cid:54) s (cid:54) j (cid:48) , k (cid:48) (cid:54) t (cid:54) l (cid:48) } , where “ −
2” comes from the fact that p s and q t are counted twice. The validity ofthis solution for S ( i, j, k, l ) is ensured by the validity of the solutions of S ( i, s, k, t ) and S ( s, j, t, l ), and the fact that these solutions do not contain any point between (cid:96) p s and (cid:96) q t .(c) The solution contains points from { q k (cid:48) , . . . , q l (cid:48) } but not from { p i (cid:48) , . . . , p j (cid:48) } , or vice versa. Because of symmetry, we only describe how to handle the first case. If the solutioncontains exactly one point form { q k (cid:48) , . . . , q l (cid:48) } , then we can easily solve this subproblemby trying every point q t in this set and pick one for which { p i , p j , q k , q t , q l } is validsolution, then we set S ( i, j, k, l ) = 5. Hereafter assume that the solution contains atleast two points from { q k (cid:48) , . . . , q l (cid:48) } . Let q s and q t be the leftmost and rightmost suchpoints, respectively. Consider the Voronoi diagram of p i , q k , q s and the Voronoi diagram14 ( i, s, k, t ) S ( s, j, t, l ) p i p s p j q k q t q l p i (cid:48) q k (cid:48) p j (cid:48) q l (cid:48) Figure 7: ( p s , q t ) is the closest pair in the solution where s ∈ { i (cid:48) , . . . , j (cid:48) } and t ∈ { k (cid:48) , . . . , l (cid:48) } .of p j , q l , q t . Depending on whether or not the Voronoi cells of q k and q l intersect the linesegment p i p j we consider the following two cases.i. The Voronoi cell of q k or the Voronoi cell of q l does not intersect p i p j . Becauseof symmetry we only describe how to handle the case where the Voronoi cell of q k does not intersect p i p j . See Figure 8. In this case, q k cannot be the closest point toany of the points p i +1 , . . . , p j − , and thus, the solution of S ( i, j, k, l ) consists of q k together with the solution of S ( i, j, s, l ). Since we do not know s , we try all possiblechoices. An index s ∈ { k (cid:48) , . . . , l (cid:48) − } is valid if the Voronoi cell of q k —in the Voronoidiagram of p i , q k , q s —does not intersect the line segment p i p j , and every point in { q k +1 , . . . , q s − } has the same color as its closest point among p i , q k , and q s . We tryall possible choices of s and pick one that is valid and minimizes S ( i, j, k, l ). Thus, S ( i, j, k, l ) = min { S ( i, j, s, l ) + 1 | i (cid:48) (cid:54) s (cid:54) l (cid:48) − s is valid } . q k p i p j q s q l q k (cid:48) S ( i, j, s, l ) q k p i p j q s q l S ( i, j, s, l ) q k (cid:48) Figure 8: The Voronoi cell of q k does not intersect the line segment p i p j .ii. The Voronoi cells of both q k and q l intersect p i p j . In this case the Voronoi cellsof both q t and q s also intersect p i p j ; see Figure 9. In the following description weslightly abuse the notation and refer to the input points { p i , . . . , p j } and { q k , . . . , q l } by P and Q , respectively. Let p s (cid:48) be the first point of P to the right of (cid:96) q s , andlet p t (cid:48) be the be the first point of P to the left of (cid:96) q t . Let P (cid:48) = { p s (cid:48) , . . . , p t (cid:48) } and Q (cid:48) = { q s , . . . , q t } . Consider any (not necessarily optimal) solution of S ( i, j, k, l ) thatconsists of V = { p i , p j , q k , q t , q s , q l } and some other points in { q s +1 , . . . , q t − } . Theclosest point in this solution, to any point of ( P ∪ Q ) \ ( P (cid:48) ∪ Q (cid:48) ), is in V . Thus,the (optimal) solution of S ( i, j, k, l ) consists of V and the optimal solution S (cid:48) of theconsistent subset problem on P (cid:48) ∪ Q (cid:48) provided that q s and q t are in S (cid:48) and no pointof P (cid:48) is in S (cid:48) . Let T ( s, t ) denote this new problem on P (cid:48) ∪ Q (cid:48) . We solve T ( s, t )by a similar method as in case 1: First we project points of P (cid:48) on L Q and then wesolve the problem for collinear points. Let P (cid:48)(cid:48) be the set of projected points. Tosolve T ( s, t ), we solve the consistent subset problem for Q (cid:48) ∪ P (cid:48)(cid:48) , which are collinear,with this invariant that the solution contains q s and q t , and does not contain any15oint of P (cid:48)(cid:48) ; see Figure 9. This can be done simply by modifying the algorithm ofSection 5.1. Therefore, S ( i, j, k, l ) = T ( s, t ) + 4. A pair ( s, t ) of indices is valid iffor every point x in ( P ∪ Q ) \ ( P (cid:48) ∪ Q (cid:48) ) it holds that the color of x is the same asthe color of x ’s closest point in V . Since we do not know s and t we try all possiblepairs and pick one that is valid and minimizes S ( i, j, k, l ). Therefore, S ( i, j, k, l ) = min { T ( s, t ) + 4 | k < s < t < l and ( s, t ) is valid } . q k p i p j q s q t q l p s (cid:48) p t (cid:48) T ( s, t ) P (cid:48) Q (cid:48) ∪ P (cid:48)(cid:48) Figure 9: The Voronoi cells of both q k and q l intersect the line segment p i p j . Running Time Analysis:
Cases 1 and 2 can be handled in O ( n log n ) time. Case 3 involvesfour subcases (a), (b), (c)-i, and (c)-ii. We classify the subproblems in these subcases by types 3(a),3(b), 3(c)-i, and 3(c)-ii, respectively. The number of subproblems of each type is O ( n ). For everysubproblem of type 3(a) we only need to verify the validity of { p i , p j , q k , q l } ; this can be done in O ( n ) time. Every subproblem of type 3(b) can be solved in O ( n ) time by trying all pairs ( s, t ).Every subproblem of type 3(c)-i can be solved in O ( n ) time by trying O ( n ) possible choices for s and verifying the validity of each of them in O ( n ) time. q k p i p j q s q t q l Now we show that every subproblem of type 3(c)-ii canalso be solved in O ( n ) time. To solve every such subprob-lem we try O ( n ) pairs ( s, t ) and we need to verify the valid-ity of every pair. To verify the validity of ( s, t ) we need tomake sure that every point in ( P ∪ Q ) \ ( P (cid:48) ∪ Q (cid:48) ) has the samecolor as its closest point in V = { p i , p j , q k , q s , q t , q l } . TheVoronoi diagrams of p i , q k , q s and p j , q l , q t together with thelines (cid:96) q s and (cid:96) q t partition the points of ( P ∪ Q ) \ ( P (cid:48) ∪ Q (cid:48) ) into 10 intervals, 6 intervals on L P and4 intervals on L Q ; see the figure to the right. For ( s, t ) to be feasible it is necessary and sufficientthat all points in every interval I have the same color as the point in V that has I in its Voronoicell. If we know the color of points in each of these 10 intervals, then we can verify the validity of( s, t ) in constant time. The total number of such intervals is O ( n ) and we can compute in O ( n )preprocessing time the color of all of them. Therefore, after O ( n ) preprocessing time we can solveall subproblems of type 3(c)-ii in O ( n ) time. Notice that the total number of subproblems oftype T ( s, t ) in case 3(c)-ii is O ( n ) and we can solve all of them in O ( n log n ) time before solvingsubproblems S ( i, j, k, l ). The following theorem summarizes our result in this section. Theorem 5.
A minimum consistent subset of n colored points on two parallel lines can be computedin O ( n ) time. .3 Bichromatic Points on Two Parallel Lines Let P be a set of n points on two parallel lines in the plane such that all points on one line arecolored red and all points on the other line are colored blue. We present a top-down dynamicprogramming algorithm that solves the consistent problem on P in O ( n ) time. By a suitablerotation and reflection we may assume that the lines are horizontal, and the red points lie on thetop line. Let R and B denote the set of red and blue points respectively. Let r , . . . , r | R | and b , . . . , b | B | be the sequences of red points and blue points from left to right, respectively. For each i ∈ { , . . . | R |} let R i denote the set { r , . . . , r i } , and for each j ∈ { , . . . , | B |} let B j denote the set { b , . . . , b j } . For a point p let (cid:96) p be the vertical line through p .Any optimal solution for this problem contains at least one blue point and one red point.Moreover, the two rightmost points in any optimal solution have distinct colors, because otherwisewe could remove the rightmost one and reduce the size of the optimal solution. We solve thisproblem by guessing the two rightmost points in an optimal solution; in fact we try all pairs ( r i , b j )where i ∈ { , . . . | R |} and j ∈ { , . . . , | B |} . For every pair ( r i , b j ) we solve the consistent subsetproblem on R i ∪ B j provided that r i and r j are in the solution, and no point between the verticallines (cid:96) r i and (cid:96) b j is in the solution (because r i and b j are the two rightmost points in the solution).Then, among all pairs ( r i , b j ) we choose one whose corresponding solution is a valid consistentsubset for R ∪ B and has minimum number of points. The solution corresponding to ( r i , b j ) is avalid consistent subset for R ∪ B if for every x ∈ { i + 1 , . . . , | R |} , the point r x is closer to r i thanto b j , and for every y ∈ { j + 1 , . . . , | B |} , the point b y is closer to b j than to r i . To analyze therunning time, notice that we guess O ( n ) pairs ( r i , b j ). In the rest of this section we show how tosolve the subproblem associated with each pair ( r i , b j ) in O ( n ) time. The validity of the solutioncorresponding to ( r i , b j ) can be verified in O ( | R | + | B | − i − j ) time. Therefore, the total runningtime of our algorithm is O ( n ). (cid:96) b j (cid:96) r s r i r s b j T ( i, j ) T ( s, j ) r i (cid:48) (cid:96) r i (cid:96) b j (cid:96) r s r s b j b t T ( i, j ) T ( s, t ) r i (cid:48) b j (cid:48) r i (cid:96) r i (a) (b)Figure 10: Illustration of the recursive computation of T ( i, j ), where (a) b j is the only blue pointin the solution that is to the right of (cid:96) r s , and (b) b t and b j are the only two blue points in thesolution that are to the right of (cid:96) r s . The crossed points cannot be in the solution.To solve subproblems associated with pairs ( r i , b j ), we maintain a table T with | R | · | B | entries T ( i, j ) where i ∈ { , . . . | R |} and j ∈ { , . . . , | B |} . Each entry T ( i, j ) represents the number ofpoints in a minimum consistent subset of R i ∪ B j provided that r i and b j are in this subset andno point of R i ∪ B j , that lies between (cid:96) r i and (cid:96) b j , is in this subset. We use dynamic programmingand show how to compute T ( i, j ) in a recursive fashion. By symmetry we may assume that r i isto the right of (cid:96) b j . In the following description the term “solution” refers to an optimal solutionassociated with T ( i, j ). Let r i (cid:48) be the first red point to the left of (cid:96) b j . Observe that if the solutiondoes not contain any red point other than r i , then { r i , b j } is the solution, i.e., the solution does17ot contain any other blue point (other than b j ) either. Assume that the solution contains someother red points, and let r s , with s ∈ { , . . . , i (cid:48) } , be the rightmost such point. Let b j (cid:48) be the firstblue point to the right of (cid:96) r s . Now we consider two cases depending on whether or not the solutioncontains any blue point (other than b j ) to the right of (cid:96) r s . • The solution does not contain any other blue point to the right of (cid:96) r s . In this case T ( i, j ) = T ( s, j ) + 1; see Figure 10(a). • The solution contains some other blue points to the right of (cid:96) r s . Let b t , with t ∈ { j (cid:48) , . . . , j − } ,be the rightmost such point. In this case the solution does not contain any blue point that isto the left of b t and to the right of (cid:96) r s because otherwise we could remove b t from the solution.Therefore T ( i, j ) = T ( s, t ) + 2; see Figure 10(b).Since we do not know s and t , we try all possible values and choose one that is valid and thatminimizes T ( i, j ). Therefore T ( i, j ) = min (cid:40) T ( s, j ) + 1 : s ∈ { , . . . , i (cid:48) } and s is valid T ( s, t ) + 2 : s ∈ { , . . . , i (cid:48) } , t ∈ { j (cid:48) , . . . , j − } and ( s, t ) is valid . In the first case, an index s is valid if for every x ∈ { s + 1 , . . . , i − } the point r x is closer to r s or r i than to b j . In the second case, a pair ( s, t ) is valid if for every x ∈ { s + 1 , . . . , i − } the point r x is closer to r s or r i than to b t and b j , and for every y ∈ { t + 1 , . . . , j − } the point b y is closerto b t or b j than to r s and r i .To compute T ( i, j ), we perform O ( n ) look-ups into table T , and thus, the time to compute T ( i, j ) is O ( n ). There is a final issue that we need to address, which is checking the validity of s and t within the same time bound. In the first case we have O ( n ) look-ups for finding s . We canverify the validity of each choice of s , in O ( n ) time, by simply checking the distances of all pointsin R (cid:48) = { r s +1 , . . . , r i (cid:48) } from r s , r i and b j . Now we consider the second case and describe how toverify, for a fixed t , the validity of all pairs ( s, t ) in O ( n ) time. First of all observe that in this case,any point b y with y ∈ { t + 1 , . . . , j − } , is closer to b t or b j than to r s and r i . Therefore, to checkthe validity of ( s, t ) it suffices to consider the points in R (cid:48) . Let r t be the first point of R (cid:48) that isto the left of (cid:96) b t , and let r t be the first point of R (cid:48) that is to the right of (cid:96) b t . Define r j and r j accordingly but with respect to (cid:96) b j . If there is a point in R (cid:48) that is closer to b t than to r s and r i ,then r t or r t is closer to b t than to r s and r i . A similar claim holds for r j , r j , and b j . Therefore,to check the validity of ( s, t ) it suffices to check the distances of r t , r t , r j and r j from the points r s , r i , b t and b j . This can be done in O ( n ) time for all s and a fixed t . (If any of the points r t , r t , r j and r j is undefined then we do not need to check that point.) The following theorem wraps upthis section. Theorem 6.
Let P be a set of n bichromatic points on two parallel lines, such that all points onthe same line have the same color. Then, a minimum consistent subset of P can be computed in O ( n ) time. In this section we will prove the following theorem.
Theorem 7.
Let C be a cone in R with non-empty interior that is given as the intersection of n halfspaces. Given n translations of C and a set of n points in R , we can decide in O ( n log n ) timewhether or not there is a point-cone incidence.
18e first provide an overview of the approach and its key ingredients. Let C , . . . , C n be the n cones that are translations of C , and let P denote the set of n input points that we want to checktheir incidence with these cones. Consider a direction d such that C contains an infinite ray from itsapex in direction d . After a transformation, we may assume that d is vertically upward. Considerthe lower envelope of the n cones; we want to decide whether there is a point of P above this lowerenvelope; see Figure 11(a). To that end, first we find for every point p ∈ P , the cone C i for whichthe vertical line through p intersects the lower envelope at C i . Then, we check whether or not p liesabove C i .Since all the cones are translations of a common cone, their lower envelope can be interpretedas a Voronoi diagram with respect to a distance function defined by a convex polygon obtaining byintersecting C with a horizontal plane. Furthermore, in this interpretation, the sites have additiveweights that correspond to the vertical shifts in the translations of the cones. Therefore, the lowerenvelope of the cones can be interpreted as an additively-weighted Voronoi diagram with respect toa convex distance function; the sites of such diagram are the projections of the apices of the conesinto the plane. In order to find the cone (on the lower envelope), that is intersected by the verticalline through p , it suffices to locate p in such a Voronoi diagram, i.e., to find p ’s closest site.We adapt the sweep-line approach used by McAllister, Kirkpatrick and Snoeyink [12] for com-puting compact Voronoi diagrams for disjoint convex regions with respect to a convex metric. Ina compact Voronoi diagram, one has a linear-size partition of the plane into cells, where each cellhas two possible candidates to be the closest site. Such a structure is enough to find the closestsite to every point p : first we locate p in this partition to identify the cell that contains p , and thenwe compute the distance of p to the two candidate sites of that cell to find the one that is closerto p . The complexity of such a compact Voronoi diagram, in the worst case, is smaller than thecomplexity of the traditional Voronoi diagram. Now, we describe our adaption, which involves somemodifications of the approach of McAllister et al. [12]. Here are the key differences encountered inour adaptation: • The additive weights on the sites can be interpreted as regions defined by convex polygons,but then they are not necessarily disjoint (as required in [12]). • In our case, the Voronoi vertices can be computed faster because the metric and the siteregions (encoding the weights) are defined by the same polygon. • By splitting C into two cones that have direction d on their boundaries, we can assume thatthe sweep line and the front line (also referred to as the beach line) coincide; this makes thecomputation of the Voronoi diagram easier. • Since the query points (the points of P ) are already known, we do not need to make a datastructure for point location or to construct the compact Voronoi diagram explicitly. It sufficesto make point location on the front line (which is the sweep line in our case) when it passesover a point of P .Notice that some of the cones can be contained in some other, and thus, do not appear on thelower envelope of the cones. Bhattacharya et al. [2] claimed a randomized algorithm to find, in O ( n log n ) expected time, the apices of the cones that appear in the lower envelope of the cones.They discussed a randomized incremental construction, which is also an adaptation of anotheralgorithm also presented by McAllister, Kirkpatrick and Snoeyink [12]. Nevertheless, a number ofaspects in the construction of [2] are not clear. Our approach is deterministic, and also solves theirproblem in O ( n log n ) worst-case time. 19 (cid:48) C i (0 , , pz = 1 x = 0 M (0 , , C (cid:48)(cid:48) M (0 , ,
1) ( a i , b i ) ( a i , b i ) + M ( a i , b i ) + λMH i ( x, y ) (a) (b)Figure 11: (a) The cone C that is splitted to C (cid:48) and C (cid:48)(cid:48) , and the polygon M which is the intersectionof the plane z = 1 with C (cid:48) . (b) The domain H i , and the translation of M that brings (0 ,
0) to( a i , b i ) followed by a scale with factor λ .Now we provide the details of our adapted approach. Consider the cone C and let a be its apex.Let r be a ray emanating from a in the interior of C such that the plane π , that is orthogonal to r at a , intersects C only in a . We make a rigid motion where the apex of C becomes the origin, r becomes vertical, and π becomes the horizontal plane defined by z = 0. The ray r , the plane π , and the geometric transformation can be computed in O ( n ) time using linear programmingin fixed dimension [13]. From now on, we will assume that the input is actually given after thetransformation. Let C (cid:48) be the intersection of C with the halfspace x (cid:62)
0, and let C (cid:48)(cid:48) be theintersection of C with the halfspace x (cid:54)
0. See Figure 11(a). Since we took r in the interior of C ,both C (cid:48) and C (cid:48)(cid:48) have nonempty interiors.Let C , . . . , C n be the cones after the above transformation. For each i , let ( a i , b i , c i ) be theapex of C i . Recall that, by assumption, each cone C i is the translation of C that brings (0 , ,
0) to( a i , b i , c i ). We split each cone C i into two cones, denoted C (cid:48) i and C (cid:48)(cid:48) i , using the plane x = a i . Noticethat C (cid:48) , . . . , C (cid:48) n are translations of C (cid:48) , and C (cid:48)(cid:48) , . . . , C (cid:48)(cid:48) n are translations of C (cid:48)(cid:48) . We split the probleminto two subproblems, in one of them want to find a point-cone incidence between P and C (cid:48) , . . . , C (cid:48) n ,and in the other we want to find a point-cone incidence between P and C (cid:48)(cid:48) , . . . , C (cid:48)(cid:48) n . Any point-coneincidence ( p, C (cid:48) i ) or ( p, C (cid:48)(cid:48) i ) corresponds to a point-cone incidence ( p, C i ), and vice versa. We explainhow to solve the point cone incidence for P and cones C (cid:48) i ; the incidence for cones C (cid:48)(cid:48) i is similar.Recall that the origin is the apex of C (cid:48) . We define M to be the polygon obtained by intersecting C (cid:48) with the horizontal plane z = 1. Note that M lies on the halfspace x ≥
0. Our choice of r in theinterior of C implies that M has a nonempty interior and (0 , ,
1) lies on the (relative) interior of aboundary edge of M . See Figure 11(a). Since M is a convex polygon that is the intersection of n halfplanes with the plane z = 1, it can be computed in O ( n log n ) time. In the rest of description,we consider M being in R , where we just drop the z -coordinate as in Figure 11(b).Let H i denote the projection of C (cid:48) i on the xy -plane. Note that H i is the halfplane defined by x ≥ a i because we took r in the interior of C . See Figure 11. Let H be the union of all halfplanes H i , and note that H is defined by x (cid:62) min { a , . . . , a n } .The boundary of every cone C (cid:48) i can be interpreted as a function f i : H i → R where f i ( x, y ) =20in { λ ∈ R ≥ | ( x, y, λ ) ∈ C (cid:48) i } . Alternatively, for every ( x, y ) ∈ H i \ { ( a i , b i ) } we have f i ( x, y ) = c i + min { λ (cid:62) | ( x, y ) ∈ ( a i , b i ) + λM } = c i + min { λ > | ( x, y ) − ( a i , b i ) λ ∈ M } , where λ is the smallest amount that M must be scaled, after a translation to ( a i , b i ), to include( x, y ); see Figure 11(b). Note that if C (cid:48) i contains a point ( x, y, z ), it also contains ( x, y, z (cid:48) ) for all z (cid:48) (cid:62) z . Therefore, the surface { ( x, y, f i ( x, y ) | ( x, y ) ∈ H i } precisely defines the boundary of C (cid:48) i .Based on this, to decide whether a point ( x, y, z ) lies in C (cid:48) i , it suffices to check whether ( x, y ) ∈ H i and z (cid:62) f i ( x, y ). Notice that every f i is a convex function on domain H i . We extend the domainof each f i to H by setting f ( x, y ) = ∞ for all ( x, y ) ∈ H \ H i . In this way all the functions f i aredefined in the same domain H .Let us denote by F the family of functions { f , . . . , f n } , and define the pointwise minimizationfunction f min ( x, y ) = min { f ( x, y ) , . . . , f n ( x, y ) } for every ( x, y ) ∈ R . For simplicity, we assumethat the surfaces defined by F are in general position in the sense that, before extending the domainsof the functions f i , the following conditions hold: (i) no apex of a cone lies on the boundary ofanother cone, that is, f j ( a i , b i ) (cid:54) = c i for all i (cid:54) = j , (ii) any three surfaces defined by F have a finitenumber of points in common, and (iii) no four surfaces defined by F have a common point. Suchassumptions can be enforced using infinitesimal perturbations.For each i , let R i be the subset of H where f i gives the minimum among all functions in F ,that is R i = { ( x, y ) ∈ H | f i ( x, y ) = f min ( x, y ) } . This introduces a partition the plane into regions R i ; we will refer to this partition by minimizationdiagram . We note that R i can be empty; this occurs when the apex ( a i , b i , c i ) of C i is containedin the interior of some cone C (cid:48) j , with j (cid:54) = i . We show some folklore properties of the regions {R , . . . , R n } . In our following description, [ n ] denotes the set { , , . . . , n } . Lemma 4.
For any index i ∈ [ n ] , the region R i is star-shaped with respect to the point ( a i , b i ) . Forany three distinct indices i, j, k ∈ [ n ] , the intersection R i ∩ R j ∩ R k contains at most two points.For any two distinct indices i, j ∈ [ n ] and every line (cid:96) in R where ( a i , b i ) and ( a j , b j ) lie on thesame side of (cid:96) , the intersection (cid:96) ∩ R i ∩ R j contains at most two points.Proof. To verify R i being star-shaped with respect to ( a i , b i ), the proof of [12, Corollary 2.5] applies.To verify the second claim, notice that if R i ∩R j ∩R k have three or more points, then by connectingthose points to ( a i , b i ), ( a j , b j ) and ( a k , b k ) with line segments, we would get a planar drawing ofthe graph K , , which is impossible. To verify the third claim, note that if for some line (cid:96) theintersection (cid:96) ∩ R i ∩ R j have three or more points, then again we would get an impossible planardrawing of K , as follows: we connect those points to ( a i , b i ), ( a j , b j ), and to an arbitrary point tothe side of (cid:96) that does not contain ( a i , b i ) and ( a j , b j ). Lemma 5.
After O ( n log n ) preprocessing time on M we can solve the following problems in O (log n ) time: • Given a point p and an index i ∈ [ n ] , decide whether or not p ∈ C i . • Given three distinct indices i, j, k ∈ [ n ] , compute R i ∩ R j ∩ R k . • Given two distinct indices i, j ∈ [ n ] and a vertical line (cid:96) in R , compute (cid:96) ∩ R i ∩ R j . roof. We compute M explicitly in O ( n log n ) time and store its vertices and edges cyclicallyordered in an array. Let − M denote { ( − x, − y ) | ( x, y ) ∈ M } . For each vertex v of M we choosean outer normal −→ n v vector. We also store for each vertex v of M the vertex of − M that is extremalin the direction −→ n v . Having M , this can be done in linear time by walking through the boundariesof M and − M simultaneously. This finishes the preprocessing.For the first claim, we are given an index i and a point p = ( p x , p y , p z ). By performing binarysearch on the edges of M we can find the edge that intersects the ray with direction ( p x , p y ) − ( a i , b i )in O (log n ) time. This edge determines the value min { λ ≥ | ( p x , p y ) ∈ ( a i , b i ) + λM } , which inturn gives f i ( p x , p y ). By comparing f i ( p x , p y ) with p z we can decide whether or not p ∈ C i .Now we prove the second claim. By Lemma 4, R i ∩ R j ∩ R k contains at most two points.Assume, without loss of generality, that i = 1, j = 2, k = 3 and c = max { c , c , c } . Let P be the (degenerate) polygon with a single vertex ( a , b ). Let P and P be the convex polygons( a , b ) + ( c − c ) M and ( a , b ) + ( c − c ) M , respectively. The polygons P and P might alsobe single points if c = c and c = c . A point ( x, y ) belongs to R ∩ R ∩ R if and only if forsome λ the polygon ( x, y ) + λ ( − M ) is tangent to P , P and P .If there is some containment between the polygons P , P and P , i.e., one polygon is totallycontained in other polygon, then R i ∩ R j ∩ R k is empty. Assume that there is no containmentbetween these polygons. Now we are going to find two convex polygons P (cid:48) and P (cid:48) such that P , P (cid:48) , P (cid:48) are pairwise interior disjoint. If P and P are interior disjoint, we take P (cid:48) = P and P (cid:48) = P .Otherwise, the boundaries of P and P intersect at most twice because they are convex polygons.We compute the intersections q , q between the boundary of P and P in O (log n ) time. We usethe the segment q q to cut P ∩ P so that we obtain two interior disjoint convex polygons P (cid:48) ⊂ P and P (cid:48) ⊂ P with P (cid:48) ∪ P (cid:48) = P ∪ P . The polygon P (cid:48) is described implicitly by the segment q q and the interval of indices of M that describe the portion of P between q and q . The descriptionof P (cid:48) is similar. With this description, we can perform binary search on the boundaries of P (cid:48) and P (cid:48) . Now we want to find the (at most two) scaled copies of − M that can be translated to touch P , P (cid:48) and P (cid:48) . Since the polygons are disjoint, we can use the tentative prune-and-search technique ofKirkpatrick and Snoeyink [9] as used in [12, Lemma 3.15]. The procedure makes O (log n ) steps,where in each step we locate the extreme point of − M in the direction −→ n v for some vertex v of P (cid:48) i .Since such vertices are precomputed, we spend O (1) time in each of the O (log n ) steps used by thetentative prune-and-search. The proof of the third claim is similar to that of previous claim, where we treat (cid:96) as a degeneratepolygon.Let A be the set of points { ( a , b ) , . . . ( a n , b n ) } defined by the apices of the cones. We usethe sweep-line algorithm of [12] to compute a representation of the minimization diagram. Moreprecisely, we sweep H with a vertical line (cid:96) ≡ { ( x, y ) | x = t } , where t goes from −∞ to + ∞ . Inour case, the sweep line and the sweep front (the beach line) are the same because future pointsof A do not affect the current minimization diagram. During the sweep, we maintain (in a binarysearch tree) the intersection of (cid:96) with the regions R i , sorted as they occur along the line (cid:96) , possiblywith repetitions.There are two types of events. A vertex event (or circle event ) occurs when the sweep frontgoes over a point of R i ∩ R j ∩ R k . In our case, this is when (cid:96) goes over such a point. A site event occurs when the sweep line (cid:96) (and thus the sweep front) goes over a point of A . The total numberof these events is linear. The running time in [12, Lemma 3.15] has an extra logarithmic factor because they spend O (log m ) time to findthe extremal vertex in a polygon M with m vertices. a i , b i ) in the current region R j that containsit, as R i could be empty. As shown in [12, Section 3.2], this location can be done in O (log n ) timeusing auxiliary information that is carried over during the sweep. Once we have located ( a i , b i ) in R j , we compare f j ( a i , b i ) with c i to decide whether or not ( a i , b i , c i ) is contained in C (cid:48) j . If ( a i , b i , c i )belongs to C (cid:48) j , with j (cid:54) = i , then the region R i is empty, and we can just ignore the existence of C i .Otherwise, R i is not empty, and we have to insert it into the minimization diagram and update theinformation associated to (cid:96) . Overall, we spend O (log n ) time per site event ( a i , b i ), plus the timeneeded to find future vertex events triggered by the current site event.Whenever the line (cid:96) passes through a point ( p x , p y ), where ( p x , p y , p z ) ∈ P , we can apply thesame binary search on the sweep line as for site events. This means that in time O (log n ) we locatethe region R j that contains ( p x , p y ). Then we check whether or not ( p x , p y , p z ) belongs to C (cid:48) j ; thiswould take an additional O (log n ) time by the first claim in Lemma 5. Therefore, we can decide in O (log n ) time whether or not the point ( p x , p y , p z ) ∈ P belongs to any of the cones C (cid:48) , . . . , C (cid:48) n .At any event (site or vertex event) that changes the sequence of regions R i intersected by (cid:96) , wehave to compute possible new vertex events. By Lemma 5, this computation takes O (log n ) time;the third claim in this lemma takes care of so-called vertices at infinity in [12]. We note that in [12]this step takes O (log n log m ) time because of their general setting.To summarize, we have a linear number of events each taking O (log n ) time. Therefore, wecan decide the existence of a point-cone incidence in O ( n log n ) time. This finishes the proof ofTheorem 7 Acknowledgement.
This work initiated at the
Sixth Annual Workshop on Geometry and Graphs ,March 11-16, 2018, at the Bellairs Research Institute of McGill University, Barbados. The authorsare grateful to the organizers and to the participants of this workshop. Segrio Cabello was supportedby the Slovenian Research Agency, program P1-0297 and projects J1-8130, J1-8155.Ahmad Biniaz was supported by NSERC Postdoctoral Fellowship. Sergio Cabello was supportedby the Slovenian Research Agency, program P1-0297 and projects J1-8130, J1-8155. Paz Carmi wassupported by grant 2016116 from the United States – Israel Binational Science Foundation. Jean-Lou De Carufel, Anil Maheshwari, and Michiel Smid were supported by NSERC. Saeed Mehrabiwas supported by NSERC and by Carleton-Fields Postdoctoral Fellowship.
References [1] S. Banerjee, S. Bhore, and R. Chitnis. Algorithms and hardness results for nearest neigh-bor problems in bicolored point sets. In
Proceedings of the 13th Latin American TheoreticalInformatics Symposium ( LATIN ), pages 80–93, 2018.[2] B. K. Bhattacharya, A. Bishnu, O. Cheong, S. Das, A. Karmakar, and J. Snoeyink. Compu-tation of non-dominated points using compact Voronoi diagrams. In
Proceedings of the 4thInternational Workshop on Algorithms and Computation ( WALCOM ), pages 82–93, 2010.[3] M. de Berg and A. Khosravi. Optimal binary space partitions for segments in the plane.
International Journal of Computational Geometry and Applications , 22(3):187–206, 2012.[4] G. Gates. The reduced nearest neighbor rule.
IEEE Transactions on Information Theory ,18(3):431–433, 1972. 235] L. Gottlieb, A. Kontorovich, and P. Nisnevitch. Near-optimal sample compression for nearestneighbors.
IEEE Transstions on Information Theory , 64(6):4120–4128, 2018. Also in NIPS2014.[6] P. E. Hart. The condensed nearest neighbor rule.
IEEE Transactions on Information Theory ,14(3):515–516, 1968.[7] R. Z. Hwang, R. C. T. Lee, and R. C. Chang. The slab dividing approach to solve the Euclidean p -center problem. Algorithmica , 9(1):1–22, 1993.[8] K. Khodamoradi, R. Krishnamurti, and B. Roy. Consistent subset problem with two labels.In
Proceedings of the 4th International Conference on Algorithms and Discrete Applied Math-ematics ( CALDAM ), pages 131–142, 2018.[9] D. G. Kirkpatrick and J. Snoeyink. Tentative prune-and-search for computing fixed-pointswith applications to geometric computation.
Fundamenta Informaticae , 22(4):353–370, 1995.Also in SoCG 1993.[10] D. Marx and M. Pilipczuk. Optimal parameterized algorithms for planar facility locationproblems using voronoi diagrams. In
Proceedings of the 23rd Annual European Symposium onAlgorithms ( ESA ), pages 865–877, 2015. Full version in arXiv:1504.05476.[11] S. Masuyama, T. Ibaraki, and T. Hasegawa. Computational complexity of the m -center prob-lems in the plane. Transactions of the Institute of Electronics and Communication Engineersof Japan. Section E , E64(2):57–64, 1981.[12] M. McAllister, D. G. Kirkpatrick, and J. Snoeyink. A compact piecewise-linear Voronoi dia-gram for convex sites in the plane.
Discrete & Computational Geometry , 15(1):73–105, 1996.Also in FOCS 1993.[13] N. Megiddo. Linear programming in linear time when the dimension is fixed.
Journal of theACM , 31(1):114–127, 1984.[14] G. L. Miller. Finding small simple cycle separators for 2-connected planar graphs.
Journal ofComputer and System Sciences , 32(3):265–279, 1986. Also in STOC 1984.[15] G. Ritter, H. Woodruff, S. Lowry, and T. Isenhour. An algorithm for a selective nearestneighbor decision rule.
IEEE Transactions on Information Theory , 21(6):665–669, 1975.[16] G. T. Wilfong. Nearest neighbor problems.