covering red and blue points in the plane^{†}^{†}thanks: An extended abstract of this work has appeared at the 33rd European Workshop on Computational Geometry (EuroCG 2017).
Abstract
We say that a finite set of red and blue points in the plane in general position can be covered if the set can be partitioned into subsets of size , with points of one color and point of the other color, in such a way that, if at each subset the fourth point is connected by straightline segments to the samecolored points, then the resulting set of all segments has no crossings. We consider the following problem: Given a set of red points and a set of blue points in the plane in general position, how many points of can be covered? and we prove the following results:

If and , for some nonnegative integers and , then there are point sets , like equitable sets (i.e., or ) and linearly separable sets, that can be covered.

If , and the points in are in convex position, then at least points can be covered, and this bound is tight.

There are arbitrarily large point sets in general position, with , such that at most points can be covered.

If , then at least points of can be covered. For , there are too many red points and at least of them will remain uncovered in any covering.
Furthermore, in all the cases we provide efficient algorithms to compute the corresponding coverings.
Keywords: Noncrossing geometric graph, star, covering, red and blue points.
1 Introduction
1.1 Description of the problem
Given sets of red points and of blue points in the plane, such that is in general position (there are no three collinear points), we say that a graph covers if: (i) The vertex set of is , (ii) every edge of is a straight line segment connecting a red point and a blue point, and (iii) no two edges intersect except in their endpoints. Analogously, for a fixed graph of vertices, we say that has a covering, or can be covered, if for some integer , and the graph resulting from the union of copies of covers .
Let us consider as graph the complete bipartite graph , which we will call the star of order centered at the partition of size . It is well known that, for in general position with , a covering always exists: Using recursively the HamSandwich theorem allows to find a noncrossing geometric alternating perfect matching [30]. Furthermore, such a matching can be extended, adding edges, to a noncrossing geometric alternating spanning tree [19].
It is also known that, for in general position with and , a covering always exists. Moreover, this covering uses stars centered at a blue point and stars centered at a red point. The result follows from this theorem
Theorem 1 (Kaneko, Kano, and Suzuki [25]).
Let and be nonnegative integers. If is an even integer such that , then any set of red points and blue points in the plane in general position can be covered. If is an odd integer such that , then any set of red points and blue points in the plane in general position can be covered.
which also provides a sufficient condition for a given set of red and blue points to have a covering, being the (noncrossing alternating) path of length . These bounds are the best possible, since when or , there exist configurations of red points and blue points for which there does not exist any covering [25]. In addition, one can build point configurations with red points and blue points in convex position such that the longest noncrossing alternating path can cover at most of the points [2, 29]. Therefore, for large in relation to the total number of red and blue points, a big portion of the points could be left uncovered when trying to cover the points with paths of size .
Knowing that  and coverings do always exist, this paper goes one step further and considers the problem for coverings. It turns out that such coverings are not always possible: In Section 2 we exhibit some bicolored point sets which do not admit a covering, although we also show that there exist bicolored point sets which can always be covered. Hence, we study the problem of given a set of red points and blue points in the plane in general position, how many points of can be covered? See Figure 1. In Section 3, we prove that, for any set of red points and any set of blue points in the plane in general position such that , at least points can be covered. Furthermore, for the configurations studied in these sections, we show efficient algorithms for computing the corresponding coverings. Finally, in Section 4 we detail some concluding remarks and open problems.
1.2 Related work
Many research about discrete geometry on red and blue points in the plane has been done. Questions about how to cover the points using specific geometric structures, or how to partition the plane into convex pieces such that each piece contains roughly the same number of red and blue points, have been widely studied in the literature. The reader is referred to [24] (and the references therein) for a survey on this topic.
One of the more challenging problems on covering red and blue points, proposed by Erdős [13] in 1989 (see also [3]), is that of determining the largest number such that, for every set of red and blue points on a circle, there exists a noncrossing geometric alternating path consisting of vertices. Erdős conjectured that , but one can find point configurations for which , as described in [2, 29]. The best bounds up to date for are due to Kynčl, Pach and Tóth [29], and valid for bicolored point sets in general position. However, the conjecture that remains open, even for points in convex position.
If crossings are allowed, Kaneko et al. [26] proved that, for and in general position with , there exists a geometric Hamiltonian alternating cycle on that has at most crossings. Moreover, this bound is best possible. Claverol et al. [9] obtain the same result, but requiring the geometric Hamiltonian alternating cycle to be 1plane (that is, every edge is crossed at most once). They also give an upper bound on the number of crossings of such a cycle, which depends on the number of runs of the points of on the boundary of the convex hull of (a run is a maximal set of consecutive points of the same color). García and Tejel [16] give a polynomial algorithm to find the shortest Hamiltonian alternating cycle for a bicolored bipartite graph satisfying the quadrangle property. A bicolored point set in the plane in convex position is a particular case of such a bicolored bipartite graph.
While trying to cover a bicolored point set in the plane with a noncrossing geometric Hamiltonian alternating path or cycle is not always possible, this is not the case for noncrossing geometric alternating spanning trees. One only needs to take any red point and connect it to all the blue points. Then, extending the resulting edges from the blue endpoints to partitioning the plane into cones, the remaining red points in each cone can be connected to a suitable blue point on the boundary of that cone. One can even bound the maximum vertex degree: Abellanas et al. [1] proved that, if , then there exists a noncrossing geometric alternating spanning tree on having maximum degree at most , and Kaneko [22] proved a bound of at most 3. Recently, Biniaz et al. [6] proved the existence of a noncrossing geometric alternating spanning tree of degree at most . As a counterpart to covering problems with alternating graphs, in [11, 34] covering problems with monochromatic graphs (paths, matchings or trees) are studied. We also refer the reader to [4, 8, 14, 15, 20] for other related problems about covering red and blue points in the plane and to [28] for coverings involving points colored with more than two colors.
A related family of problems is that of balanced subdivision problems, in which one would like to partitioning the plane (or ) into convex regions in such a way that some desired properties on the number of red and blue points in each region are achieved. Perhaps, the most celebrated result in this family of problems is the HamSandwich theorem which states that, for any point sets in (in general, measures), there is a hyperplane bisecting each of these sets (measures). Apart from the intrinsic theoretical interest of these partitioning problems, the relevance of many of the results obtained for these problems relies on the fact that they have a lot of applications. For instance, some of the results given in Theorem 1 are based on particular partitions of the plane. As we explain in the forthcoming sections, we also apply some of these partitions to obtain some of our results. For a wide range of geometric partitioning results, the reader is referred to [5, 18, 21, 23, 24, 25, 27, 33] and the references therein.
1.3 Some notation and useful lemmas
Throughout this paper, we will always assume that no three points are collinear. We denote by a set of red points in the plane and by a set of blue points in the plane. The convex hull of any point set is denoted by and a finite point set in the plane is in convex position if the points of are the vertices of . Abusing of notation, when no confusion can arise we will also use to denote the boundary of the convex hull. Throughout the paper, we deal with directed lines in order to define the right side of a line and the left side of it. Thus, a line will mean a directed line. A line dissects the plane into three pieces: and two open halfplanes and , where and denote the open halfplanes to the left of and to the right of , respectively. Notice that, if denotes a line on with the opposite direction of , then and .
For a set of red and blue points in general position, if consists of exactly red points and consists of exactly blue points, we say that is an set. We define as the maximum number of points in that can be covered. For nonnegative integers and , we define as the minimum of over all sets in general position. Sometimes it is better to look at the number of points that are left uncovered. Hence, we define and . Then, is the maximum of over all sets in general position.
To finish this section, we present two lemmas which might be useful also in a more general context. They are similar to other wellknown results of this type and their proofs are based on a simple continuity argument. The first one is an intermediate value result on red and blue points.
Lemma 2.
Let be a bicolored point set in the plane. If there exist two directed lines and such that and , then:

For every integer , , there exists a directed line such that and .

There is a directed line through a blue point such that and .
Moreover, and can be found in time, where .
Proof.
For each direction , let be a directed line such that , if it exists. The line does not exist precisely when there is a line in direction through two points and in such that . Let if exists, and otherwise.
As changes continuously from to , the set changes finitely many times, precisely each time that does not exist. So every time changes, it does so only by one point. Namely, if the change happens at , then for small enough . At that point, and do not change when and have the same color; increases by one and decreases by one when is blue and is red; and decreases by one and increases by one when is red and is blue. So achieves all possible values between and .
In particular, if and at this moment is decreasing from to , then is red, is blue, and for some small enough, the line in direction passing through satisfies that and .
Observe that, in the rotation process, we are building a subset of the sets of . For denoting the number of sets of a point set , Edelsbrunner and Welzl [12] gave an algorithm to find all sets. Their algorithm is based on the dynamic algorithm by Overmars and van Leeuwen [32] that maintains a convex hull in time per update. Using the algorithm given by Brodal and Jacob in [7], that maintains a convex hull in time per update, the algorithm from Overmars and van Leeuwen can be directely improved to time. As [10], lines and can be found in time. ∎
Lemma 3.
Let be a point set in the plane (not necessarily bicolored) and let be an integer such that . If there is a directed line through a point such that , then there is a directed line, say , through such that . Moreover, can be found in time, where .
Proof.
Suppose that . A continuous rotation of through starts with and ends with . Then, at some point during the rotation . To find such a rotation of the original line , we only need to order by slope the lines passing trough and each one of the remaining points of (this requires time), and to explore these lines in order until finding (this only requires linear time because when passing from a line to the next one, only a point passes from left to right of the explored line or vice versa). ∎
2 Particular configurations
In this section, we study some particular configurations of sets. As a first observation, notice that, if an set admits a covering consisting of stars centered in red points and stars centered in blue points, then , and . But this condition on the number of red and blue points is not sufficient to assure that a covering exists, as we show in Sections 2.3 and 2.5. In Sections 2.1, 2.2 and 2.4, we study some sets admitting a covering.
2.1 Equitable sets
Let be an set such that either or . In any of both cases we say that is a equitable set. The following theorem, which is a generalization of the HamSandwich theorem, allows us to show that any equitable set can be covered.
Theorem 4 (Equitable Subdivision [5, 7, 21, 33]).
Let , and be positive integers. If red points and blue points are given in the plane in general position, then there exists a subdivision of the plane into convex regions such that each region contains precisely red points and blue points. This subdivision can be computed in time, where .
Note that, in fact, the running time stated in [5] is , because the authors used the dynamic algorithm by Overmars and van Leeuwen [32] tho maintain a convex hull in time per update. This was later improved by Brodal and Jacob [7] to time per update. Therefore, the algorithm from Bespamyatnikh et al. [5] is directly improved by a logarithmic factor to time.
Theorem 5.
If an set is equitable, then all the points of can be covered, and a covering can be computed in time where .
Proof.
W.l.o.g. we can assume that consists of red points and blue points. We apply directly Theorem 4 by taking , and , so there exists a subdivision of the plane into convex regions such that each region contains precisely red points and blue point. The points in each region can be trivially covered and the union of these coverings is a covering of without crossings. As finding an equitable subdivision requires time, then building a covering takes time. ∎
2.2 Linearly separable sets
An set is linearly separable if there exists a line that separates and , say and . For and , any linearly separable set admits a covering, as the following theorem shows.
Theorem 6.
If is a linearly separable set, then all the points of can be covered.
Proof.
W.l.o.g. assume . The proof is by induction on . If , then is a equitable set, which can be covered by Theorem 5. Assume , and suppose that and are separable by the line . Then, there are lines and parallel to such that separates blue points from the rest of and separates red points from the rest of . See Figure 2.
For these and , by Lemma 2, there is a line that separates points of , exactly of them blue, from the rest of . This set of points can clearly be covered. The rest of is a set, still linearly separable, and thus, since separates the relevant four points from , it can also be covered by induction. The two covers are separated by and, thus, they together form a cover of . ∎
Next, we show how to compute a covering for a linearly separable set in time, where . The algorithm first computes stars centered in red points and then stars centered in blue points. The algorithm computes and takes the leftmost edge which joins a red point with a blue point (see Figure 3). Then, it removes , computes , takes the new leftmost edge connecting the red point to the blue point ( can coincide with ), removes and computes . The new leftmost edge is then , being red and blue ( can coincide with ). Observe that the line supporting the edge separates and from the rest of the points, so the star centered in , connecting to and , will not cross any other star formed with the rest of the points. This step finishes by defining the star formed by , , and and removing and . Redefining , , the algorithm proceeds recursively building stars centered in red points. The stars centered in blue points are computed in a similar manner.
The algorithm runs in time. Computing requires time. Besides, in the overall process, the algorithm removes the points, updating the convex hull after each removal. This process of updating times the convex hull requires time, using the semidynamic data structure by Hershberger and Suri [17], which allows to process a sequence of deletions in amortized time per deletion. Let us see that, when building the stars centered in red points, all leftmost edges can be computed in linear time. Suppose that is the leftmost edge in a generic step and is the leftmost edge after removing . Computing can be done by exploring in order the points from to on the boundary of the convex hull of the active set, which are necessarily red. Moreover, if is the leftmost edge after removing and , then can be computed by exploring again in order the points on the boundary of the convex hull of the active set from the previous point to to . Then, computing all the leftmost edges only depends on the number of times that red points are explored by the algorithm: A red point is explored once if it appears on the boundary of the convex hull, another time if it is removed, and several times in the different steps if it belongs to the active leftmost edge or it is the red point previous to a removed red point. As the number of leftmost edges required to define the stars centered in red points is the number of removed points (), then the number of times that red points are explored is . Using a similar reasoning, all the leftmost edges to build the stars centered in blue points can be computed in time. Therefore, we have the following theorem.
Theorem 7.
If is a linearly separable set, then a covering can be computed in time, where .
2.3 Convex point sets
In the previous subsections, we have shown some sets which always admit a covering. Now we show that this is not always the case for sets in convex position.
Theorem 8.
If is a set in convex position, then at least points of can be covered and this bound is tight.
Proof.
The proof is again by induction on . If or , which includes the base case , then is a equitable set, which can be covered by Theorem 5. Thus, we assume , and the elements of are ordered clockwise along (the boundary of) .

Suppose that there exists a set of four consecutive points cyclically on such that 3 of them have the same color and the remaining one has a distinct color. Then, the four points of can be covered, and points of , which is either a set or a set, can be covered because of the induction hypothesis. Note that, by convexity, these two coverings do not cross, so the desired covering is obtained.

Suppose that such a set does not exist. By a simple counting argument, this implies one of these two cases: One red point and one blue point alternately lie on , or two red points and two blue points alternately lie on (see Figure 4). Therefore, in both cases, , , , and . Assume that the points of are numbered from to clockwise around .

If one red point and one blue point alternate on , we obtain the desired covering as follows: For , we take the points with numbers , , , and and cover them with a (see Figure 4, left). Doing this, we leave uncovered precisely the four points numbered , , , and .

If two red points and two blue points alternate on , we can obtain the desired covering as follows: For , we take the points with numbers , , , and and cover them with a (see Figure 4, right). Doing this, we leave uncovered precisely the four points numbered , , , and .

The fact that the bound is the best possible comes from the two previous particular configurations. Suppose that one red point and one blue point alternately lie on . In a covering, a star centered in a red point, say , is connected to three blue points, say . The three edges , and divide into four pieces and at least one of these four pieces necessarily contains an odd number of points. Hence, a covering is not possible. When two red points and two blue points alternately lie on , one can easily check that, among the four pieces in which is divided by the three edges of a star centered in a red point, at least one of these pieces contains either an odd number of points or red points and blue points which is not a multiple of 4. ∎
We can cover at least points in linear time as follows: Explore the points in order along (the boundary of) , looking for four consecutive points, say , and , three of one color and one of the other color. If such a set exists, then define a star with these four points, remove them, and continue the process from point , checking points , , , and . If such a set does not exist, then either one red point and one blue point alternately lie on or two red points and two blue points alternately lie on , and the covering is built as shown in Figure 4. If, during the process, (resp. ) stars centered in red (resp. blue) points are defined, then the resulting configuration after removing all the stars defined is a equitable set formed by red points and blue points ( blue points and red points). In this case, the process continues looking only for subsets consisting of four consecutive points, three of them red and the other blue (resp. three blue and one red if the equitable set is formed by blue points and red points). Such subsets always exist using the following observation that easily follows from a simple counting argument.
Observation 1.
Let be a cyclic sequence consisting of blue elements and red elements. Then, there exist four consecutive elements in the sequence such that three of them are red and the other is blue.
In addition to the two special configurations shown in Figure 4 not admitting a covering, there are many more. For instance, take the configuration where one red point and one blue point alternately lie on and add four points in the order red, blue, red, red between a blue point and a red point. The new configuration neither admits a covering, and this operation can be repeated several times.
On the other hand, given a bicolored convex point set, depending on the order in which the stars are computed using the previous algorithm, sometimes a covering is found and sometimes not. See Figure 5. This leads to the problem of deciding if a bicolored convex point set admits a covering or not. Using a standard dynamic programming algorithm, this decision problem can be solved in time. Assume that the points are numbered clockwise from 1 to . For an interval of consecutive points (mod ), define if there is a covering of the points in and otherwise. Then, is if there are three points such that points define a star and and (if defined) are . The values can be computed in increasing order of the size of the intervals and every requires time. If is , then a covering exists and can be built using the same procedure. Therefore, we have the following theorem.
Theorem 9.
If is a set in convex position, deciding if admits a covering can be done in time and space. Moreover, at least points of can be covered in linear time.
2.4 Double chain
In this section we show that, by combining two bicolored convex point sets in a special way, it becomes possible to cover all points. A double chain is formed by two (nonempty) convex chains and , facing each other, such that every edge , with and , does not cross neither nor . See Figure 6.
Points in are denoted by counterclockwise along and points in are denoted by counterclockwise along . Let us denote by , , and the circular sequences ; ; and , respectively. For a bicolored double chain, there is always a covering, as the following theorem shows.
Theorem 10.
If is a double chain, with and for some integers , then can be covered.
Proof.
We prove the theorem by induction on , so that in any inductive step we guarantee that is a double chain. If or , which includes the case , then is a equitable set, which can be covered by Theorem 5. Then, assume , , and w.l.o.g. and is red.
As , then . If has a set consisting of consecutive points, 3 of them having the same color and the remaining one having a distinct color, then can be covered and the set is a double chain with four points less (except if ) which can also be covered by the induction hypothesis. Note from the definition of double chain that any edge in the covering of is disjoint from any edge in the covering of , thus can be covered. If and has such a set , then has exactly four points, three having the same color and the fourth having the other color, and these points can be covered without crossing .
Assume, to the contrary, that does not have any such set . Then, either the colors of the points in alternate as described in the proof of Theorem 8 (see also Figure 4) or consists of points of the same color. If the colors alternate in , there are six possible ways of coloring in red and blue, namely: and , see Figure 7. Moreover, is even, implying that since is also even. In any case, it is always possible to ensure that one point set, denoted by , among , , and , can be covered and satisfies that any segment connecting points in and any edge of the covering are disjoint. Figure 7 shows the coverings for the different sets . Then, we can apply induction on to obtain a covering for .
Finally, assume that consists of points of the same color. As , then and , so because is monochromatic. Suppose first that is red, so there are at least four blue points in . If is the first blue point in , starting the clockwise exploration at , then the three points appearing in before are red, so the set consisting of these four points can be covered. Note that is a double chain and that the covering of does not cross any covering of which exists by induction. Suppose now that is blue. As is red, then can be covered without crossing a covering of the double chain that exists by induction. ∎
From an algorithmic point of view, one can design a linear algorithm to find a covering for a double chain as follows. We omit the details and give only a general idea on how the algorithm works. Let and be the sets of red and blue points forming a double chain in a generic step of the algorithm, with , , and . The algorithm controls if either or . If this is the case, then the double chain is a equitable set. By Observation 1, necessarily contains a set consisting of 4 consecutive points, three of them red (resp. blue) and the other one blue (resp. red). Therefore, the linear algorithm described in the convex case can be easily adapted to the circular sequence to find a covering for .
From the beginning, the algorithm runs twice the linear algorithm described for the convex case, once to control a possible set of 4 consecutive points, three of one color and one of the other color, in and a second time to control such a set in . One of these two algorithms is activated in each step, depending on the sizes of and . If such a set does not exist, then the algorithm has to apply two different procedures: One to define the different stars when is monochromatic (as described in the proof of Theorem 10) and the other one to define the stars when the points in alternate (looking for stars involving and as described in Figure 7).
2.5 Some sets with
In this section we give some particular configurations of sets for which and prove that, except for equitable sets, for any values of and . Recall that is the maximum of over all sets in general position, being the minimum number of points in that cannot be covered.
Theorem 11.
Let and be nonnegative integers.

if, and only if, or .

for any .
Proof.
(a) Assume that and . If , a perfect covering of any set is numerically impossible as there are too many red points (even using only stars with blue center would leave red points uncovered). If , the following set cannot completely be covered: Draw a coloralternating convex gon together with a set of almost collinear red points as illustrated in Figure 8. The set is not split by any bichromatic diagonal and its points are almost along a line through the midpoints of two antipodal sides. Note that in a perfect covering there must be at least one star with red center, since . If this center of is in , then must have at least two consecutive edges on the same side of (see Figure 9, left). But these two edges isolate an odd number of points in and, therefore, these points cannot be covered. If the red center of is not in , then the set must be either to the left or to the right of at least two edges of (see Figure 9, right). As before, two consecutive such edges isolate an odd number of points in from the rest and so they cannot be completely covered. If , then Theorem 5 guarantees .
(b) Consider the set formed by the coloralternating vertices of a regular gon and one red point near the center of the polygon. Since , it is enough to show that . Note that in a covering of leaving only one point uncovered, there must be exactly stars with red center. If there is a star whose center is , each of the sectors determined by the edges of contains an odd number of points (see Figure 10, left). Thus, each of these subsets of cannot be completely covered.
If there are two stars with red centers that are not , then two cases appear depending on whether is between the two stars (Figure 10, center) or it is in one of the regions delimited by two consecutive edges (diagonals) of one of the stars (Figure 10, right). In the first case, each star defines a region isolating an odd number of points. In the second case, one the stars defines a region with an odd number of points and the region delimited by the two stars contains points, for some , which is not a multiple of 4. In either case there are at least two points that are not covered. ∎
3 General configurations of points
Given an set , the main goal of this section is to give a lower bound on the number of points of that can always be covered. Assume that and let . Notice that, if , then and there are too many red points to be covered, even by stars centered in blue points. In this case, at least red points will necessarily remain uncovered in any covering. Moreover, the bound is tight because, by removing red points, we obtain a equitable set that can be covered by Theorem 5.
When , our first attempt to obtain a “good covering” was trying to divide the plane into disjoint convex regions such that every region contained either three red points and one blue point or vice versa. If such a partition exists, then the four points in each region can be trivially covered. Unfortunately, this is not always possible. For instance, a coloralternating convex point set does not admit this kind of partition. Using a different (but in same way similar) approach, we prove that, when , at least points can always be covered. The proof of this result is divided into two parts: Section 3.1 proves the result for and Section 3.2 for . Finally, in Section 3.3, we show an efficient algorithm for computing at least points that can be always covered.
3.1 Lower bound when
The following theorem is the main result of this section. Its proof, included in Section 3.1.1, requires the two lemmas in Section 1.3 together with a new one. Given a bicolored point set , the theorem gives an upper bound on the number of points that will remain uncovered under certain constrains on the number of red and blue points.
Theorem 12.
Let be a integer, . Then, for any integer .
Theorem 12 implies the following lower bound on for all with . We use this bound to prove the general lower bound for any as stated in Corollary 14.
Theorem 13.
Let and be positive integers. If , then
Proof.
Write for some integers and with . Let . Then, and . Also, : For , , implying , so . For , as , then , implying . Hence, and . For , the minimum of is reached at , so . Since , . Then,
because, removing red and blue points,