Crossing and Independent Families Among Polygons
Abstract
Given a set of points in the plane, a family of line segments forming a matching in is called crossing (or independent) if each pair of segments in the family intersects (or is non-intersecting, respectively). In past works, these notions have been generalized to polygons by identifying the points in with the vertices of a given set of polygons and forbidding the line segments from intersecting or overlapping with polygon walls. In this work, we study the computational complexity of computing maximum crossing and independent families in this more general setting.
As our first two results, we show that both problems are -hard already when the polygons are triangles. Motivated by this, we turn to parameterized algorithms. For our main algorithmic results, we consider the number of polygons on the input as the natural parameter and under this parameterization obtain a fixed-parameter algorithm for computing a largest crossing family among these polygons, and a separate -algorithm for computing a largest independent family that lies in one of the faces of the polygonal domain.
Keywords and phrases:
crossing families, crossing-free matchings, segment intersection graphs, computational geometry, parameterized algorithmsFunding:
Anna Brötzner: supported by grant 2021-03810 (Illuminate: provably good algorithms for guarding problems) from the Swedish Research Council (Vetenskapsrådet).Copyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometryEditors:
Pat Morin and Eunjin OhSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Given points in the plane, a crossing family is a set of straight-line segments with endpoints among these points such that each pair of segments in the set cross in their interior. The natural counterpart to crossing families are sets of segments which are pairwise non-intersecting (not even at the endpoints); these are studied under the term crossing-free families, plane matchings, or independent families [19].
In 1994, Aronov et al. [4] showed that for any point set in general position there is always a crossing family of size and since then the problem of quantifying the size of the largest possible crossing family has become a prominent and challenging task in discrete geometry. While it is generally conjectured that the size is in fact [6], only recently Pach, Rubin, and Tardos [20] achieved a breakthrough result establishing an bound. Similarly, researchers have investigated crossing-free matchings that can be drawn on a point set. While all point sets admit matchings that cover all but at most one point, a large body of research has been devoted to related problems such as counting how many such matchings exist in a point set [24, 25], considering the lengths of segments in a crossing-free matching [2, 11], or finding large matchings in bicolored point sets [5, 13, 15]. Taking an algorithmic viewpoint, it is natural to ask about the complexity of computing a largest crossing or independent family. While the latter problem (IndependentFamily) is known to be solvable in -time [13], the complexity of the former (CrossingFamily) remains wide open.
In this work, we consider a more general setting in which the points are the vertices of a set of simple polygons and the segments are segments between two polygon vertices. In particular, we only allow segments which do not intersect the polygon boundary edges in their relative interior. In this perspective, these boundaries can be seen as obstacles in the plane and the segments model visibility, whereas the original problem forms a degenerate case where each polygon is a single point. However, compared to the setting of point sets, the complexity landscape of the problems changes drastically. In fact, already for one polygon the problem of computing a maximum independent family becomes intractable [21], while finding a maximum crossing family in one polygon can be solved in polynomial time [12].
A natural way of tackling these two problems is through the intersection graph of the visibility segments. In particular, one can form a graph by considering each segment as a vertex and connecting two vertices whenever their respective segments intersect. Computing largest crossing and independent families then precisely corresponds to finding a maximum clique or independent set (respectively) in this graph.
The study of these two problems on general segment intersection graphs has a long and storied history. For independent sets in this graph class, Kratochvíl and Nešetřil [14] showed -hardness in 1990 and Marx showed that the problem is even [1]-hard when parameterized by the solution size [16]. For clique, the computational complexity on segment intersection graphs was a long-standing open problem; after partial progress in 1992 [17], this was finally settled via the -hardness reduction of Cabello, Cardinal, and Langermann [7]. Unfortunately, none of these lower bounds can be directly carried over to the considered generalization of CrossingFamily and IndependentFamily.
Apart from the considerations above, the problem of finding a large independent family in our setting is closely related to the task of augmenting a given geometric structure by a plane matching. Algorithms and lower bounds for this task have also received considerable attention in the literature [1, 21, 22, 23].
Contributions.
Our first result concerns the classical complexity of finding maximum crossing and independent families. For both problems, we demonstrate that they are -hard even when all polygons are as simple as possible, namely triangles. Our reductions are from finding a maximum clique and independent set, respectively, in segment intersection graphs [7, 14]. The main idea of the reduction is to “emulate” each segment of the given segment intersection graph using the endpoints of special triangles. And while the principal logic of the reduction can be explained in a streamlined fashion, the underlying gadgets require a careful construction and the precise placement of every triangle. Especially, it is necessary to find a placement of only triangles such that the vertices responsible for the “emulation” of the segment do not interact with gadgets representing other segments.
To overcome the complexity-theoretic intractability of these problems we turn to the tools of parameterized algorithms. We consider the parameterized problems of finding a largest crossing or independent family among a set of simple polygons, choosing as our parameter. For parameterized problems whose unparameterized versions are -hard the most desirable runtime behavior of an algorithm is of the form for some computable function , i.e., a fixed-parameter algorithm. Allowing for more running time, we also consider so-called -algorithms where the running time may be in .
As our first algorithmic result, we show that under this parameterization the problem of finding a largest crossing family indeed admits a fixed-parameter algorithm. For this, we consider the segments in a solution ordered by their slopes, together with the polygons on which the segment endpoints lie. Crucially, we argue that this sequence can in fact be viewed as a sequence of what we call bundles which are sets of segments that are consecutive in the sequence and are between a pair of two (not necessarily distinct) polygons. We show that the length of this sequence of bundles is bounded in the number of polygons, which allows us to efficiently branch on the order of pairs of polygons associated with the sequence of bundles. We use the resulting sequence as basis of a dynamic programming approach in which we look at one bundle at a time and compute and tabulate a best option for each last segment (delimiter) of the bundle. We show that it is possible to do that only looking at such tabulated information of the previous bundle and the branched information. The main challenge here is that choices made for a bundle that are compatible with preceding bundles may not be compatible with later bundles or segments in them; carefully filtering our choices without missing a potential solution, we can guarantee that this does not happen.
Turning to our second algorithm, we first realize that for independent families, the above mentioned result by Pilz et al. [21] indicates that the problem is already -hard for one polygon, ruling out the existence of even an -algorithm. Crucial to their reduction is the fact that segments may appear on the outside and the inside of the polygon. Consequently, we consider the case when segments may only appear on one side of each polygon. We give an -algorithm solving this case, again with the number of polygons on the input as the parameter. The idea is to partition a hypothetical solution into independent parts, each of which is bounded by two segments of the solution. Branching over which segments act as these boundaries allows us to solve the instance by leveraging polynomial-time algorithms for finding maximum independent sets in circle graphs.
2 Preliminaries
We assume familiarity with the foundations of parameterized complexity [8] and standard terminology used in the area of computational geometry, including the notions of (simple) curves and (straight-)line segments, polygons and their vertices [10].
All of our objects are placed in the plane. We say that a simple closed curve encloses an object if is contained in the face bounded by . Two points are visible to (or see) each other if the - line segment neither touches nor crosses any other object in the plane; we call such segments visibility segments. Extending this, a set of points is visible from a point if each point in the set is visible from . We assume all polygons in this work to be simple (i.e., with no self-intersections) and pairwise non-intersecting. Moreover, we assume w.l.o.g. that the vertices of each polygon are in general position, meaning that no three vertices lie on a straight line. We explicitly note that polygons are allowed to nest each other, i.e., one may be drawn in the interior of another. We use the notation to denote the interior of a polygon.
We say that a crossing family among a set of polygons is a set of pairwise crossing visibility segments between vertices of the polygons. Similarly, an independent family (also called non-crossing matching) among a set of polygons is a set of pairwise non-intersecting visibility segments between vertices of the polygons; we explicitly remark that such segments cannot intersect even at the endpoints. We can now define our main problems of interest:
Problem 1 (MaxCrossingFamily).
Given a set of polygons, find a largest crossing family among .
Problem 2 (MaxIndependentFamily).
Given a set of polygons, find a largest independent family among .
Unfortunately, solving MaxIndependentFamily is known to be -hard even if [21], precisely because of the fact that visibility segments may occur both inside and outside of polygons. Hence, it will be useful to also consider a variant of the problem where polygons represent bounded-sized regions of the plane that are inaccessible, i.e., does not contain any segment that intersects the interior of a polygon. Formally:
Problem 3 (MaxIndependentFamilyWithHoles).
Given a set of polygons, find a largest independent family among that lies completely in the unbounded face.
We remark that – in contrast to MaxIndependentFamily– the above problem can be solved in polynomial time for , as it can be reduced to the well-studied problem of finding a maximum independent set in a circle graph [12].
3 Finding maximum crossing and independent families is hard
In this section, we prove that both MaxIndependentFamily and MaxCrossingFamily are -hard, even if the polygons on the input are triangles. We present reductions from the corresponding problems of finding a maximum independent set and maximum clique, respectively, in segment intersection graphs. Both are well known to be -hard [7, 14]. Here we give an overview of the reductions.
In either reduction, we start from a given set of segments and construct a set of triangles such that a maximum set of pairwise crossing or non-crossing segments in corresponds to a maximum crossing family and independent family, respectively, among .
We first sketch the construction for MaxIndependentFamily. The idea of the reduction is to replace each by a so-called segment gadget. Each segment gadget consists of ten triangles, divided into two groups of five triangles each, where each group forms an endpoint gadget. As the name suggests, the two endpoint gadgets which we denote by and are placed at the endpoints and of , respectively. As every endpoint gadget contains exactly 15 vertices, there is at least one vertex in any independent family among the triangles of the endpoint gadget which can never be matched to a vertex also in the same endpoint gadget. The goal is to place the triangles in such a way that a solution will match a pair of vertices in endpoint gadgets if and only if the underlying segment lies in a corresponding set of non-crossing segments in .
An endpoint gadget contains three types of triangles: three outer triangles, one inner triangle, and one shooting triangle. The outer triangles are three congruent triangles placed around the inner triangle in such a way that each of them has one side on the boundary of the gadget’s convex hull, and such that every pair of outer triangles forms a narrow rectangular corridor. One of these corridors is parallel to the supporting line of and contains the endpoint in its interior. At the position of , we place the shooting triangle . The construction can be seen in Figure 1. An analogous endpoint gadget is placed at . By carefully scaling the corridor, we achieve that the vertices of the shooting triangles only see some vertices in their own endpoint gadget, and vertices in the corridor around in .
Finally, the three outer triangles delimit a triangular region in the interior of the convex hull of that is visible neither via the corridors nor from the vertices of . Consequently, the vertices of the inner triangle only see the three vertices of outer triangles that are interior to the convex hull of the endpoint gadget. This forces the corresponding three segments between these vertices to occur in every maximum independent family among .
Given a set of pairwise non-crossing segments in it is straight-forward to construct an independent family of size among the triangles in . Vice versa, for any independent family of size among we find that for segment gadgets a segment in has to have both its endpoints among the vertices of the two shooting triangles in the segment gadget. Since two segments connecting shooting triangles in different segment gadgets cross if and only if the corresponding segments in cross we obtain a set of pairwise non-crossing segments of size in from .
Theorem 1.
MaxIndependentFamily is -hard even if all polygons are triangles.
For MaxCrossingFamily we need to modify the above construction, as vertices of the outer triangles may be matched to each other and thereby create a large crossing family independent from the shooting triangles. Therefore, we adapt the endpoint gadgets to ensure that many pairwise crossing visibility segments have to be added for each segment gadget. To this end, we replace in each endpoint gadget the shooting triangle by a set of shooting triangles such that the segments between shooting triangles of the two endpoint gadgets of each segment gadget together form a crossing family of size , see Figure 2. Additionally, four segments between vertices of the outer triangles can be added to this crossing family. Then, a maximum crossing family of segments within a segment gadget has size .
In the whole set of triangles , a maximum crossing family consists of segments between two vertices in the same segment gadget, and segments between two vertices in different segment gadgets. We can upper-bound the number of the latter ones by , since every endpoint gadget contributes at most six vertices as endpoints of these segments. Consequently, even if all segments between all vertices of outer triangles in could be added, this would not offset the contribution of just one segment gadget. Arguing as for independent families, we obtain that contains a maximum crossing family of size at least if and only if there is a set of pairwise crossing segments in .
Theorem 2.
MaxCrossingFamily is -hard even if all polygons are triangles.
4 Finding crossing families among polygons
Let be a set of non-intersecting polygons, possibly nesting. In this section we present a fixed-parameter algorithm to solve MaxCrossingFamily when parameterized by . Thus, the number of polygons is bounded, but the numbers of vertices per polygon may be unbounded. The input size is .
The polygons in define faces. Our algorithm will compute a largest crossing family among in each face independently. Since segments in different faces cannot cross, the solution to MaxCrossingFamily is the largest computed crossing family. For the remainder of this section, we therefore ask for a largest crossing family in a given face .
For purely technical reasons, we assume w.l.o.g. that there is no vertical segment connecting two polygon vertices (else we perform a slight rotation of the whole instance). This merely ensures that each segment has a well-defined slope, which we will later use to obtain an ordering of the segments. For polygons (not necessarily distinct) we define their class to be the set of segments in which the right endpoint is a vertex of and the left endpoint is a vertex of . In a crossing family , we consider the segments uniquely sorted by decreasing slope; note that segments with the same slope cannot cross. This naturally gives rise to the sequence of classes of these segments which we compress to a sequence in which consecutive occurrences of a class are merged. Note also that a class can appear more than once in ; each such appearance corresponds to a bundle of segments in , formally a maximal set of segments of the same class that is consecutive in the ordering of the crossing family by slopes. We use their corresponding order in to label the bundles . Despite the repetitions, we can provide the following bound on :
Lemma 3.
The length of is at most .
Proof.
Let () be the sequence of polygons that arises when picking only the first (resp. second) elements of the classes in . Since no two polygons intersect each other and no polygon intersects a segment in the crossing family, neither of these sequences contains a subsequence of the form with polygons . Indeed, two segments that cross and have one of their endpoints in , together with the boundary of , define a bounded region. Polygon can either lie inside it or outside it, but not both.
This lack of subsequences implies that and are Davenport-Schinzel sequences of order 2 on the polygons, and their length is therefore at most [9]. In the combined sequence , two consecutive classes differ in at least one of the polygons. As there are at most changes in each of the two sequences of polygons, there are at most changes in . Therefore, has length at most .
We now describe our algorithm, which on a high level works by dynamically computing the largest crossing family of a consecutive sequence of bundles with specific first and last segments under the condition that the crossing family is consistent with the selected .
Step 0: Precomputation.
We precompute which pairs of vertices of polygons see each other (without crossing any polygon boundary). These are the valid segments and they can trivially be computed in time.
Step 1: Branching.
In the next step of the algorithm, we guess the sequence for a solution of MaxCrossingFamily, that is, we run the algorithm for each possible sequence . This fixes the order of the bundles and also determines the subset of polygons that contribute to the solution. We call them the contributing polygons, . By Lemma 3 and the fact that there are different polygons, we have at most possibilities for .
For a crossing family, the extreme delimiters (start delimiter) and (end delimiter) are the segments with maximum and minimum slopes, respectively. We branch on in a solution. For a class , let denote the product of the number of vertices of the two polygons in class . Since must be in the first class of , the number of choices is bounded by . In the worst case, this is .
Thus, we run the algorithm in the next step at most times and select the largest crossing family computed among them.
Step 2: Optimizing delimiters.
The key information for the solution are the extreme segments for each bundle. A crossing family respects a sequence of classes if the compressed sequence of classes of the segments of sorted by decreasing slope is . For a crossing family that respects and for a bundle , the delimiter of in is the segment of in that has the smallest slope. For notational convenience, we preface the sequence of classes by class , which is equal to . We refer to the resulting extended sequence as . We say that the bundle and delimiter of is the start delimiter .
Given two segments and we say that a point lies (strictly) between them if lies in the (open) region bounded by the supporting lines of and that does not contain any vertical ray, the horizontal double wedge of and . (We call the (open) interior of the complement of a horizontal double wedge the vertical double wedge.) We say that a segment is between and if both endpoints of are between and , one in each side of the horizontal double wedge. Note that then all the segments of between two consecutive delimiters and together with (and if ) form the bundle . We also say that a polygon lies between and if all its vertices lie strictly between and , on the same side of the horizontal double wedge.
We now outline the procedure of our dynamic programming algorithm. Given a set of polygons, a sequence of classes , and a segment , we aim to find a largest crossing family among that respects and begins with delimiter . For this, we dynamically find an optimal sequence of bundle delimiters. Our algorithm processes the classes in the order given by . When processing class , we assume that we have solved the subproblems for every valid delimiter in class , and that these solutions are stored in a table with one row per delimiter . In that row we store the maximum possible size of a crossing family between (i.e., with extreme delimiters) and . With possible we here mean that at each step we already take into account that we will need to complete the crossing family to one that respects . This table also includes in each row an iteratively built crossing family with extreme delimiters , for convenience of solution reconstruction.
At the beginning of the algorithm, the table only contains one row for delimiter , with size and sequence . In step this table gets updated to one that contains the maximum possible size of a crossing family between and , , for each valid delimiter in class . We calculate the values for each in class from the previously tabulated values with in class . At step we compute, for each possible pair of delimiters of classes and , respectively, the best possible crossing family extension consisting of segments of class between delimiters and , not including . We denote its size as . In this computation, we take into account that the final sequence needs to respect . Also, not all pairs are possible: they need to cross and be sorted by slope, but also should cross the sequence of previous delimiters of . Crucially, by checking certain necessary conditions, we can make this check independent of the sequence of previous delimiters of . This restricts the sizes at each step and disallows certain delimiters (which we mark as having size ). With the above notation, for each in class ,
In this way, our algorithm assigns to each delimiter in class with a delimiter in the previous class . To obtain the crossing family in the row corresponding to , we take the one corresponding to and append .
In the final step of the algorithm, we select a delimiter that maximizes ; the corresponding crossing family is stored in the last table in the row for .
The next lemma specifies how we compute each value , for and in classes and , respectively, and the underlying crossing family . Moreover, it shows that such a crossing family is optimal if and are the delimiters of the corresponding classes. In particular, all other segments in a crossing family respecting will cross them.
Lemma 4.
Assume we are given a family of polygons , the start delimiter , an extended sequence of classes , a superset of the contributing polygons of , and the two delimiters and of (consecutive bundles corresponding to) classes and , respectively, satisfying
- ()
-
form a crossing family, are sorted by decreasing slope, and there is no polygon in between and .
Then we can compute, in time polynomial in the total number of polygon vertices, a largest crossing family of such that
-
(i)
its extreme delimiters are and ,
-
(ii)
all its segments except maybe are in class , and
-
(iii)
no polygon in lies in a triangle bounded by three segments of .
Moreover, for all crossing families among that: respect the extended sequence , no polygon in lies between two consecutive delimiters or in a bounded cell, and have as delimiters and for the bundles of classes and , respectively, it is always possible to replace the segments between and including and by without decreasing the size of the crossing family, still respecting and that no polygon in lies in a bounded cell.
In our algorithm we use Lemma 4 with equal to the contributing polygons of (same as of ). The motivation behind Condition iii and the condition involving in the second part of the statement is that no segments in a solution crossing family can define a region enclosing a contributing polygon. If such a region existed, there would be three segments defining a triangular region enclosing the polygon, which cannot be the case since any segment incident to an endpoint inside the region can only cross two of the segments.
Observation 5.
Given a crossing family whose set of contributing polygons is , no (three) segments of define a (triangular) region enclosing a polygon in .
Proof of Lemma 4.
We first check whether Condition holds in time. If Condition does not hold and is the set of contributing polygons of , and cannot be delimiters for classes and .
Let be the set of segments containing each segment such that are a crossing family that fulfills Conditions i, ii, and iii. Whether a segment lies in can be tested in time per segment and there are at most such segments. The segments in form a circle graph, since their endpoints lie either on the boundaries of two disjoint polygons, or on the boundary of one polygon. Consequently, a maximum crossing family consisting of segments in is a clique in this graph and can be computed in time [3]. Let be the crossing family , which we computed in time.
We now show that the algorithm above computes the crossing family as per the lemma statement. First, note that by definition of , Conditions i and ii hold. In the definition of , we only checked that Condition iii holds for triangular regions bounded by segments and . We show that this implies that it also holds for any other triple of segments in .
Assume for contradiction that a polygon lies in a triangular region bounded by three segments in . By Condition , must lie either above the supporting lines of and , or below both. Being in such a bounded region implies that it lies below or above (respectively) the supporting line of a segment . In both cases, lies in the triangle bounded by , , and , which we checked is not the case when we included in .
For the second part of the lemma, consider a crossing family among that respects , no polygon in lies between consecutive delimiters or in a bounded cell, and has delimiters and for the bundles of classes and , respectively. Let be the set of segments of between and . For each segment it must hold, by definition, that is a crossing family satisfying Conditions i, ii, and iii. Thus, and replacing by does not decrease the size of the crossing family.
We next show that all segments in cross all the segments in ; refer to Figure 3 (left). This is trivially true for and . Consider a different such segment in . By definition, cannot lie between and . Moreover, none of its endpoints can lie between and since must cross both and . Thus, by construction of , and concretely Condition iii, no endpoint of can lie in a triangle bounded by , , and a segment in . This implies that one endpoint of lies below the supporting line of each segment in and the other above. Since crosses and no segment in can cross the boundary of a polygon, no endpoint of a segment in can lie in a triangle bounded by , , and . As the segments in , by definition, lie between and , this means that every such segment has one endpoint on either side of . We can therefore conclude that crosses all segments in .
By construction and Conditions i and ii, after replacing by is still respected. It remains to prove that no polygon lies in a bounded cell. By Condition , cannot lie in the horizontal double wedge of . Assume w.l.o.g. that it lies in the top region of the vertical double wedge of . If lies below the supporting line of a segment in , then that segment together with and would contradict Condition iii; see Figure 3 (middle). But if it lies above the supporting lines of all segments in then can only lie in a bounded cell if it already was in , contradicting the assumption of .
In our algorithm, when computing using Lemma 4, if Condition does not hold we do not allow such a pair of delimiters (we can return an empty set and size ). The next lemma establishes the correctness of our procedure.
Lemma 6.
For a given set of polygons, a sequence of classes , and a segment , our algorithm computes a valid crossing family among that respects and has as start delimiter , or reports that no such family exists.
Proof.
Assume first that a solution exists, and let be its sequence of delimiters sorted by decreasing slope. Any two consecutive delimiters (together with ) must fulfill Condition in Lemma 4, and thus our algorithm considered them and a largest crossing family between them, since all conditions are necessary. In particular, by Observation 5 Condition iii must hold for the set of contributing polygons. It might be that our algorithm picks a different sequence of delimiters or crossing family between them than the one in the solution assumed, but it will output an at-least-as-large crossing family.
In the other direction, assume that our algorithm produced a crossing family. We want to show that it is indeed a valid crossing family that respects and has as start delimiter . We construct the extended sequence of classes from and . The computed crossing family corresponds to a sequence of delimiters . If those would indeed form a crossing family sorted by decreasing slope that respects and has as start delimiter , then by the second part of Lemma 4, the whole crossing family computed would be valid. The sequence of delimiters is sorted by decreasing slope and has as start delimiter by Condition at each step. It also respects by Condition ii.
It remains to prove that all the delimiters pairwise cross. Assume for contradiction that they do not, and let be the first delimiter in the sequence that does not cross all the previous delimiters. Thus, form a crossing family. By Condition , , , and are sorted by decreasing slope and there is no contributing polygon between and . In particular, the endpoints of lie in the top and bottom region of the vertical double wedge of and , see Figure 3 (right). In contrast, delimiters have their endpoints in the left and right region of the horizontal double wedge of and . Since we only consider valid segments as delimiters and there is no contributing polygon between and , there is no endpoint of the delimiters enclosed by . Thus, form a crossing family, contradicting the assumption.
Lemma 7.
For a given set of polygons, a sequence of classes , and a segment , our algorithm computes a largest crossing family among that respects and has as start delimiter .
Proof.
Let be the extended sequence of classes of and let be the set of contributing polygons of . We prove by induction on that our algorithm computes (in step ) a largest crossing family among that respects the extended sequence , has as start delimiter , as end delimiter a given segment (of class ) and the following property: () there is no polygon in that lies between the extreme delimiters of or in a triangular region bounded by three segments of . Note that condition () is necessary to obtain a crossing family fulfilling the conditions of the lemma.
The induction base trivially holds for and by Lemma 4, case also holds. Assume the induction hypothesis for step , and assume for contradiction that in step there is a larger crossing family that respects , has as start delimiter , as end delimiter , and fulfills (). Let be the previous delimiter in ; it might not coincide with the one chosen by our algorithm, but, for a similar argument as in Lemma 6, it is in the table at the start of step . By the induction hypothesis, until the crossing family computed and tabulated by our algorithm cannot be smaller than the one of until . Moreover, by Lemma 4, between delimiters and our algorithm computes a largest crossing family that can replace the one of while maintaining its properties (respects , has as start delimiter , as end delimiter , and fulfills ()). Thus, the crossing family that our algorithm computes for in step is at least as large as ; contradiction.
This implies that in the last step our algorithm computes a largest crossing family for each possible end delimiter. Lemma 6 ensures that we will succeed, and assuming we chose the end delimiter yielding a largest crossing family, the statement follows.
We are now ready to establish our first algorithmic result:
Theorem 8.
MaxCrossingFamily is fixed-parameter tractable with respect to the number of polygons .
Proof.
Given a set of polygons, consider a crossing family solving MaxCrossingFamily. In our branching step, we consider all possible sequences of classes and start delimiters. In particular, the sequence of classes and the start delimiter of . By Lemmas 6 and 7, Step 2 in our algorithm computes a largest valid crossing family with respecting and with start delimiter , thus solving MaxCrossingFamily.
The algorithm runs in time where is the number of vertices of . The precomputation step takes time. We run the polynomial (in and ) algorithm in Step 2 times. Without trying to optimize its running time, it comprises at most steps corresponding to the classes, and in each step we consider at most pairs of delimiters (assuming that we choose the 4 endpoints of the delimiters from all points). For each such pair, the procedure in Lemma 4 takes time.
5 Finding independent families among holes
As our final contribution, we provide an -algorithm for MaxIndependentFamilyWithHoles when parameterized by the number of holes – a result which contrasts the known -hardness of MaxIndependentFamily with a single polygon [21].
Our proof is based on decomposing sets of independent segments into what we refer to as bunches. On a high level, bunches are inclusion-maximal sets of segments that are enclosed by one segment and one connected hole boundary part, or by two segments and two connected hole boundary parts that do not enclose segments of the independent family with endpoints on other hole boundary parts. We will argue that each hypothetical solution can be decomposed into a number of bunches quadratic in the number of polygons, each of which is enclosed by at most two delimiting segments of the hypothetical solution and connected parts of at most two polygon boundaries. In -time we can branch on a choice of such delimiting segments and compute the other edges of each bunch as an independent set of a circle graph. We formalize below.
Definition 9.
Given a family of polygons and a set of pairwise independent segments between vertices of that do not intersect for any , a bunch is a maximal subset of that is enclosed by at most two elements of and connected parts of the boundaries of at most two arbitrary polygons such that the endpoints of each lie in . are called the delimiters of , and is called the boundary of .
The next lemma, whose proof uses similar ideas as that of Lemma 3, allows us to branch on boundaries of bunches that partition a hypothetical target maximum independent family.
Lemma 10.
Given a family of polygons and a set of pairwise independent segments between vertices of that do not intersect for any , where each is a bunch and .
Knowing the boundaries of bunches allows us to compute their other contained segments, or an independent family of at least as many segments in polynomial time. Note that here it is crucial that we are considering holes.
Theorem 11 ([18]).
Given a polygon, a maximal family of independent segments in its interior can be computed in polynomial time.
The proofs for Lemma 10 and Theorem 11 can be found in the appendix. Combining the above, we obtain our final algorithmic result.
Theorem 12.
MaxIndependentFamilyWithHoles is in parameterized by the number of holes.
Proof.
We can assume a partition into bunches of a maximum independent family of segments between the holes according to Lemma 10, and branch in ( denotes the overall number of polygon vertices) ways on the boundaries of the corresponding bunches: we branch on a set of pairwise independent delimiting segments, on pairings of them, and hole boundary parts to complete the boundary. Using Theorem 11, we can compute in polynomial time a maximum independent family of segments within each boundary. We return the union of all families computed in this way together with the branched delimiting segments obtained in this way with maximum size.
The described procedure obviously runs in -time parameterized by . Further, the returned family of segments is indeed independent: Segments which are in the solution of the same invocation of Theorem 11 are independent by the correctness of Theorem 11. Segments which are in a solution of an invocation of Theorem 11 are independent from all branched on delimiting segments because they are prohibited from crossing the boundary for which they are in the solution and all delimiting segments lie on or beyond that boundary. Further, the boundary for which a segment was in the solution of an invocation of Theorem 11 separates this segment from all segments in solutions of other invocations of Theorem 11. Independence of branched-on delimiting segments is ensured at branching.
A maximum independent family is returned because in some branch, the delimiting segments will coincide with those that exist in a bunch partition of a maximum independent family according to Lemma 10, and any other segments in a bunch can be replaced by an arbitrary maximum independent family of segments in its boundary.
6 Discussion and open questions
Our reductions establish the intractability of the considered problems even if the polygons are triangles. Nevertheless, the complexity of computing a maximum crossing family among a set of points remains as a prominent open question.
On the algorithmic front, we leave open whether MaxIndependentFamilyWithHoles is fixed-parameter tractable w.r.t. the number of holes. While it seems conceivable that the boundaries of bunches employed in the proof of Theorem 12 could instead be processed via dynamic programming, it is entirely unclear what processing order one should use. Another open question is whether MaxIndependentFamily is fixed-parameter tractable w.r.t. the number of polygons (as opposed to -hard) if all polygons are convex.
References
- [1] Hugo A. Akitaya, Matias Korman, Oliver Korten, Mikhail Rudoy, Diane L. Souvaine, and Csaba D. Tóth. Circumscribing polygons and polygonizations for disjoint line segments. Discrete & Computational Geometry, 68(1):218–254, 2022. doi:10.1007/S00454-021-00355-8.
- [2] Noga Alon, Sridhar Rajagopalan, and Subhash Suri. Long non-crossing configurations in the plane. Fundamenta Informaticae, 22(4):385–394, 1995. doi:10.3233/FI-1995-2245.
- [3] Alberto Apostolico, Mikhail J. Atallah, and Susanne E. Hambrusch. New clique and independent set algorithms for circle graphs. Discrete Applied Mathematics, 36(1):1–24, 1992. doi:10.1016/0166-218x(92)90200-t.
- [4] Boris Aronov, Paul Erdös, Wayne Goddard, Daniel J. Kleitman, Michael Klugerman, János Pach, and Leonard J. Schulman. Crossing families. Combinatorica, 14(2):127–134, 1994. doi:10.1007/bf01215345.
- [5] Mikhail J. Atallah. A matching problem in the plane. Journal of Computer and System Sciences, 31(1):63–70, 1985. doi:10.1016/0022-0000(85)90065-0.
- [6] Peter Brass, William OJ Moser, and János Pach. Research problems in discrete geometry, volume 18. Springer, 2005. doi:10.1007/0-387-29929-7.
- [7] Sergio Cabello, Jean Cardinal, and Stefan Langerman. The clique problem in ray intersection graphs. Discrete & Computational Geometry, 50(3):771–783, 2013. doi:10.1007/s00454-013-9538-5.
- [8] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
- [9] Harold Davenport and Andrzej Schinzel. A combinatorial problem connected with differential equations. American Journal of Mathematics, 87(3):684–694, 1965. doi:10.2307/2373068.
- [10] Mark de Berg, Otfried Cheong, Marc J. van Kreveld, and Mark H. Overmars. Computational Geometry: Algorithms and Applications, 3rd Edition. Springer, 2008. doi:10.1007/978-3-540-77974-2.
- [11] Adrian Dumitrescu and Csaba D. Tóth. Long non-crossing configurations in the plane. Discrete & Computational Geometry, 44(4):727–752, 2010. doi:10.1007/S00454-010-9277-9.
- [12] Fanica Gavril. Algorithms for a maximum clique and a maximum independent set of a circle graph. Networks, 3(3):261–273, 1973. doi:10.1002/net.3230030305.
- [13] John Hershberger and Subhash Suri. Applications of a semi-dynamic convex hull algorithm. BIT Numerical Mathematics, 32(2):249–267, 1992. doi:10.1007/BF01994880.
- [14] Jan Kratochvíl and Jaroslav Nešetřil. Independent set and clique problems in intersection-defined classes of graphs. Commentationes Mathematicae Universitatis Carolinae, 31(1):85–93, 1990. URL: http://dml.cz/dmlcz/106821.
- [15] Chi-Yuan Lo, Jirí Matousek, and William L. Steiger. Algorithms for ham-sandwich cuts. Discrete & Computational Geometry, 11:433–452, 1994. doi:10.1007/BF02574017.
- [16] Dániel Marx. Parameterized complexity of independence and domination on geometric graphs. In Proceedings of the Second International Workshop on Parameterized and Exact Computation (IWPEC’06), volume 4169 of LNCS, pages 154–165. Springer, 2006. doi:10.1007/11847250_14.
- [17] Matthias Middendorf and Frank Pfeiffer. The max clique problem in classes of string-graphs. Discrete Mathematics, 108(1-3):365–372, 1992. doi:10.1016/0012-365X(92)90688-C.
- [18] Nicholas Nash and David Gregg. An output sensitive algorithm for computing a maximum independent set of a circle graph. Information Processing Letters, 110(16):630–634, 2010. doi:10.1016/j.ipl.2010.05.016.
- [19] Monroe Newborn and William O. J. Moser. Optimal crossing-free hamiltonian circuit drawings of . Journal of Combinatorial Theory, Series B, 29(1):13–26, 1980. doi:10.1016/0095-8956(80)90041-6.
- [20] János Pach, Natan Rubin, and Gábor Tardos. Planar point sets determine many pairwise crossing segments. Advances in Mathematics, 386:107779, 2021. doi:10.1016/j.aim.2021.107779.
- [21] Alexander Pilz, Jonathan Rollin, Lena Schlipf, and André Schulz. Augmenting geometric graphs with matchings. In Proceedings of the 28th International Symposium on Graph Drawing and Network Visualization (GD’20), volume 12590 of Lecture Notes in Computer Science, pages 490–504. Springer, 2020. doi:10.1007/978-3-030-68766-3_38.
- [22] David Rappaport. Computing simple circuits from a set of line segments is np-complete. SIAM Journal on Computing, 18(6):1128–1139, 1989. doi:10.1137/0218075.
- [23] David Rappaport, Hiroshi Imai, and Godfried T. Toussaint. On computing simple circuits on a set of line segments. In Proceedings of the 2nd Annual Symposium on Computational Geometry (SCG’86), pages 52–60. ACM Press, 1986. doi:10.1145/10515.10521.
- [24] Micha Sharir, Adam Sheffer, and Emo Welzl. Counting plane graphs: Perfect matchings, spanning cycles, and kasteleyn’s technique. Journal of Combinatorial Theory, Series A, 120(4):777–794, 2013. doi:10.1016/j.jcta.2013.01.002.
- [25] Micha Sharir and Emo Welzl. On the number of crossing-free matchings, cycles, and partitions. SIAM Journal on Computing, 36(3):695–720, 2006. doi:10.1137/050636036.
Appendix A Omitted proofs from Section 5
Lemma 10. [Restated, see original statement.]
Given a family of polygons and a set of pairwise independent segments between vertices of that do not intersect for any , where each is a bunch and .
Proof.
We show the statement by induction on .
For the base case, and with the delimiting segment of being given by an arbitrary segment in whose endpoints are consecutive in a traversal of the boundary along the boundary of (if no such segment exists then and hence is valid). The boundary of is given by the above delimiting segment and the part of the boundary of between its endpoints that contains other endpoints of segments in (if there is no other segment in we can choose between the two parts of the boundary of between the endpoints of the delimiting segment arbitrarily).
For the inductive step, assume the statement to hold for independent families on holes . Consider all elements of with an endpoint on and an endpoint on for any and label them with based on the containment of their other endpoint in .
Along a traversal of the boundary of , any distinct labels do not interleave (i.e., occur in the order ) as this would induce a crossing between two closed curves, one formed by segments with the same label and a part of the boundary between their endpoints on and and the other formed by segments with the same label and a part of the boundary between their endpoints on and , contradicting that is independent or that , , and are pairwise non-intersecting. Now we remove all but the first and last segment or each subsequence of each maximal subsequence of the traversal which has one unique label. We call the resulting sequence .
A non-interleaving sequence over with at most two consecutive repetitions of each element has length at most because without repetitions it is a Davenport-Schinzel sequence of order 2, and its length is therefore at most [9]. Thus, the length of is at most .
By construction, a desired partition into bunches can be achieved by combining a desired partition of the subset of that does not contain segments with endpoints on and bunches whose delimiting segments are in ; here, delimiting segments are associated to the same bunch if they are consecutive with the same label. The former partition exists by inductive hypothesis, and by inductive hypothesis we get an overall size bound of as desired.
Theorem 11 ([18]). [Restated, see original statement.]
Given a polygon, a maximal family of independent segments in its interior can be computed in polynomial time.
Proof.
The set of segments in the interior of a polygon can be viewed as the vertex set of a circle graph in a natural way. Finding a maximum independent family among these segments then directly corresponds to finding a maximum independent set in the circle graph. The latter is known to be possible in polynomial time [18].
