Abstract 1 Introduction 2 Preliminaries 3 Finding maximum crossing and independent families is hard 4 Finding crossing families among 𝒌 polygons 5 Finding independent families among 𝒌 holes 6 Discussion and open questions References Appendix A Omitted proofs from Section 5

Crossing and Independent Families Among Polygons

Anna Brötzner ORCID Malmö University, Sweden Robert Ganian ORCID Algorithms and Complexity Group, TU Wien, Austria Thekla Hamm ORCID TU Eindhoven, The Netherlands Fabian Klute ORCID Universitat Politècnica de Catalunya, Barcelona, Spain Irene Parada ORCID Universitat Politècnica de Catalunya, Barcelona, Spain
Abstract

Given a set A of points in the plane, a family of line segments forming a matching in A 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 A 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 algorithms
Funding:
Anna Brötzner: supported by grant 2021-03810 (Illuminate: provably good algorithms for guarding problems) from the Swedish Research Council (Vetenskapsrådet).
Robert Ganian: Projects No. 10.55776/Y1329 and 10.55776/COE12 of the Austrian Science Fund (FWF), Project No. 10.47379/ICT22029 of the Vienna Science Foundation (WWTF).
Fabian Klute: Partially supported by grant PID2023-150725NB-I00 funded by MICIU/AEI/10.13039/501100011033.
Irene Parada: Serra Húnter Fellow. Partially supported by grant PID2023-150725NB-I00 funded by MICIU/AEI/10.13039/501100011033.
Copyright and License:
[Uncaptioned image] © Anna Brötzner, Robert Ganian, Thekla Hamm, Fabian Klute, and Irene Parada; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Editors:
Pat Morin and Eunjin Oh

1 Introduction

Given n points in the plane, a crossing family is a set of straight-line segments with endpoints among these n 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 Ω(n) 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 Θ(n) [6], only recently Pach, Rubin, and Tardos [20] achieved a breakthrough result establishing an n1o(n) 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 𝒪(nlogn)-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 k simple polygons, choosing k as our parameter. For parameterized problems whose unparameterized versions are 𝖭𝖯-hard the most desirable runtime behavior of an algorithm is of the form 𝒪(f(k)nc) for some computable function f, i.e., a fixed-parameter algorithm. Allowing for more running time, we also consider so-called 𝖷𝖯-algorithms where the running time may be in 𝒪(nf(k)).

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 k of polygons on the input as the parameter. The idea is to partition a hypothetical solution into 𝒪(k2) 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 X if X is contained in the face bounded by τ. Two points a,b are visible to (or see) each other if the a-b 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 a if each point in the set is visible from a. 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 P 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 C among 𝒫.

Problem 2 (MaxIndependentFamily).

Given a set 𝒫 of polygons, find a largest independent family F among 𝒫.

Unfortunately, solving MaxIndependentFamily is known to be 𝖭𝖯-hard even if |𝒫|=1 [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., F 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 F 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 |𝒫|=1, 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 s=pq𝒮 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 𝒯p and 𝒯q are placed at the endpoints p and q of s, 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 s lies in a corresponding set of non-crossing segments in 𝒮.

An endpoint gadget 𝒯p 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 s and contains the endpoint p in its interior. At the position of p, we place the shooting triangle Tshoot. The construction can be seen in Figure 1. An analogous endpoint gadget 𝒯q is placed at q. 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 q in 𝒯q.

Figure 1: Endpoint gadget with three outer triangles, inner triangle Tint, and shooting triangle Tshoot. The original segment s is indicated in dark blue. The areas marked in gray are visible from the exterior of the gadget; the area marked in green is the interior area visible to Tshoot; the area marked in pink is the area outside the gadget visible from Tshoot. The red segments are segments of a maximum independent family within the gadget.

Finally, the three outer triangles delimit a triangular region in the interior of the convex hull of 𝒯p that is visible neither via the corridors nor from the vertices of Tshoot. 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 k pairwise non-crossing segments in 𝒮 it is straight-forward to construct an independent family of size 14|𝒮|+k among the triangles in 𝒯. Vice versa, for any independent family F of size 14|𝒮|+k among 𝒯 we find that for k segment gadgets a segment in F 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 k in 𝒮 from F.

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 7|𝒮| 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 21|𝒮|, 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 21|𝒮|+4.

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 6|𝒮|, 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 (21|𝒮|+4)k if and only if there is a set of k pairwise crossing segments in 𝒮.

Figure 2: Modification of endpoint gadget. The original segment s is indicated in dark blue. The red segments are segments of a maximum crossing family within the segment gadget.
Theorem 2.

MaxCrossingFamily is 𝖭𝖯-hard even if all polygons are triangles.

4 Finding crossing families among 𝒌 polygons

Let 𝒫={P1,,Pk} be a set of k non-intersecting polygons, possibly nesting. In this section we present a fixed-parameter algorithm to solve MaxCrossingFamily when parameterized by k. Thus, the number k of polygons is bounded, but the numbers n1,n2,,nk of vertices per polygon may be unbounded. The input size is n=i=1kni.

The k>0 polygons in 𝒫 define k+1 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 f.

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 P,Q𝒫 (not necessarily distinct) we define their class (P,Q) to be the set of segments in which the right endpoint is a vertex of P and the left endpoint is a vertex of Q. In a crossing family C, 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 C, 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 B1,B. Despite the repetitions, we can provide the following bound on :

Lemma 3.

The length of Π is at most 4k3.

Proof.

Let Πr (Πl) 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 PQPQ with polygons PQ. Indeed, two segments that cross and have one of their endpoints in P, together with the boundary of P, define a bounded region. Polygon Q can either lie inside it or outside it, but not both.

This lack of PQPQ subsequences implies that Πr and Πl are Davenport-Schinzel sequences of order 2 on the k polygons, and their length is therefore at most 2k1 [9]. In the combined sequence Π, two consecutive classes differ in at least one of the polygons. As there are at most 2k2 changes in each of the two sequences of polygons, there are at most 2(2k2)=4k4 changes in Π. Therefore, Π has length at most 4k3.

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 𝒪(n2) valid segments and they can trivially be computed in 𝒪(n3) 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 k different polygons, we have at most k2(4k3) possibilities for Π.

For a crossing family, the extreme delimiters d0 (start delimiter) and d (end delimiter) are the segments with maximum and minimum slopes, respectively. We branch on d0 in a solution. For a class Ki, let |Ki| denote the product of the number of vertices of the two polygons in class Ki. Since d0 must be in the first class K1 of Π, the number of choices is bounded by |K1|. In the worst case, this is 𝒪(n2).

Thus, we run the algorithm in the next step at most 𝒪(n2k2(4k3)) 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 C respects a sequence of classes Π if the compressed sequence of classes of the segments of C sorted by decreasing slope is Π. For a crossing family C that respects Π and for a bundle Bi, the delimiter di of Bi in C is the segment of C in Bi that has the smallest slope. For notational convenience, we preface the sequence of classes Π by class K0, which is equal to K1. We refer to the resulting extended sequence as Π+​. We say that the bundle and delimiter of K0 is the start delimiter d0.

Given two segments a and b we say that a point p lies (strictly) between them if p lies in the (open) region bounded by the supporting lines of a and b that does not contain any vertical ray, the horizontal double wedge of a and b. (We call the (open) interior of the complement of a horizontal double wedge the vertical double wedge.) We say that a segment c is between a and b if both endpoints of c are between a and b, one in each side of the horizontal double wedge. Note that then all the segments of C between two consecutive delimiters di and di+1 together with di+1 (and d0 if d0=di) form the bundle Bi+1. We also say that a polygon lies between a and b if all its vertices lie strictly between a and b, 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 d0, we aim to find a largest crossing family C among 𝒫 that respects Π and begins with delimiter d0. For this, we dynamically find an optimal sequence of bundle delimiters. Our algorithm processes the classes in the order given by Π. When processing class i[1,], we assume that we have solved the subproblems for every valid delimiter di1 in class Ki1, and that these solutions are stored in a table with one row per delimiter di1. In that row we store the maximum possible size |Ci1(d0,di1)| of a crossing family between (i.e., with extreme delimiters) d0 and di1. 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 d0,di1, for convenience of solution reconstruction.

At the beginning of the algorithm, the table only contains one row for delimiter d0, with size 1 and sequence d0. In step i this table gets updated to one that contains the maximum possible size of a crossing family between d0 and di, |Ci(d0,di)|, for each valid delimiter di in class Ki. We calculate the values |Ci(d0,t)| for each t in class Ki from the previously tabulated values |Ci1(d0,s)| with s in class Ki1. At step i we compute, for each possible pair s,t of delimiters of classes Ki1 and Ki, respectively, the best possible crossing family extension Ci(s,t) consisting of segments of class Ki between delimiters s and t, not including s. We denote its size as |Ci(s,t)|. In this computation, we take into account that the final sequence needs to respect Π. Also, not all (s,t) pairs are possible: they need to cross and be sorted by slope, but also t should cross the sequence of previous delimiters of s. Crucially, by checking certain necessary conditions, we can make this check independent of the sequence of previous delimiters of s. This restricts the sizes at each step and disallows certain delimiters (which we mark as having size ). With the above notation, for each t in class Ki,

|Ci(d0,t)|=maxs delimiter of Ki1{|Ci1(d0,s)|+|Ci(s,t)|}.

In this way, our algorithm assigns to each delimiter t in class Ki with i1 a delimiter s in the previous class Ki1. To obtain the crossing family in the row corresponding to t, we take the one corresponding to s and append Ci(s,t).

In the final step of the algorithm, we select a delimiter d that maximizes |C(d0,d)|; the corresponding crossing family is stored in the last table in the row for d.

The next lemma specifies how we compute each value |Ci(s,t)|, for s and t in classes Ki1 and Ki, respectively, and the underlying crossing family Ci(s,t). Moreover, it shows that such a crossing family is optimal if s and t 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 𝒫={P1,,Pk}, the start delimiter d0, an extended sequence of classes Π+=(K0=K1,,K), a superset 𝒬 of the contributing polygons of Π+, and the two delimiters di and di+1 of (consecutive bundles corresponding to) classes Ki and Ki+1, respectively, satisfying

()

{d0,di,di+1} form a crossing family, are sorted by decreasing slope, and there is no polygon in 𝒬 between di and di+1.

Then we can compute, in time polynomial in the total number n of polygon vertices, a largest crossing family C of 𝒫 such that

  1. (i)

    its extreme delimiters are di and di+1,

  2. (ii)

    all its segments except maybe di are in class Ki+1, and

  3. (iii)

    no polygon in 𝒬 lies in a triangle bounded by three segments of C.

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 di and di+1 for the bundles of classes Ki and Ki+1, respectively, it is always possible to replace the segments between and including di and di+1 by C 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 C whose set of contributing polygons is 𝒫, no (three) segments of C define a (triangular) region enclosing a polygon in 𝒫.

Proof of Lemma 4.

We first check whether Condition  holds in 𝒪(n) time. If Condition  does not hold and 𝒬 is the set of contributing polygons of Π, di and di+1 cannot be delimiters for classes Ki and Ki+1.

Let 𝒮 be the set of segments containing each segment sdi,di+1 such that {di,di+1,s} are a crossing family that fulfills Conditions i, ii, and iii. Whether a segment lies in 𝒮 can be tested in 𝒪(n) time per segment s and there are at most 𝒪(n2) 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 C consisting of segments in 𝒮 is a clique in this graph and can be computed in time 𝒪(|𝒮|2) [3]. Let C be the crossing family C{di,di+1}, which we computed in 𝒪(n4) time.

We now show that the algorithm above computes the crossing family C 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 di and di+1. We show that this implies that it also holds for any other triple of segments in C.

Assume for contradiction that a polygon Q𝒬 lies in a triangular region bounded by three segments in C. By Condition , Q must lie either above the supporting lines of di and di+1, or below both. Being in such a bounded region implies that it lies below or above (respectively) the supporting line of a segment x𝒮. In both cases, Q lies in the triangle bounded by x, di, and di+1, which we checked is not the case when we included x in 𝒮.

For the second part of the lemma, consider a crossing family X among 𝒫 that respects Π+, no polygon in 𝒬 lies between consecutive delimiters or in a bounded cell, and has delimiters di and di+1 for the bundles of classes Ki and Ki+1, respectively. Let C be the set of segments of X between di and di+1. For each segment yC it must hold, by definition, that {di,di+1,y} is a crossing family satisfying Conditions i, ii, and iii. Thus, C𝒮 and replacing C by C does not decrease the size of the crossing family.

We next show that all segments in XC cross all the segments in C; refer to Figure 3 (left). This is trivially true for di and di+1. Consider a different such segment z in X. By definition, z cannot lie between di and di+1. Moreover, none of its endpoints can lie between di and di+1 since z must cross both di and di+1. Thus, by construction of 𝒮, and concretely Condition iii, no endpoint of z can lie in a triangle bounded by di, di+1, and a segment in C. This implies that one endpoint of z lies below the supporting line of each segment in 𝒮 and the other above. Since z crosses di+1 and no segment in X can cross the boundary of a polygon, no endpoint of a segment in C can lie in a triangle bounded by z, di, and di+1. As the segments in C, by definition, lie between di and di+1, this means that every such segment has one endpoint on either side of z. We can therefore conclude that z crosses all segments in C.

By construction and Conditions i and ii, after replacing C by C Π+ is still respected. It remains to prove that no polygon Q𝒬 lies in a bounded cell. By Condition , Q cannot lie in the horizontal double wedge of di,di+1. Assume w.l.o.g. that it lies in the top region of the vertical double wedge of di,di+1. If Q lies below the supporting line of a segment in C, then that segment together with di and di+1 would contradict Condition iii; see Figure 3 (middle). But if it lies above the supporting lines of all segments in C then Q can only lie in a bounded cell if it already was in XC, contradicting the assumption of X.

Figure 3: Illustration of the correctness of the 𝖥𝖯𝖳-algorithm for MaxCrossingFamily. Left: Segments in red cannot be in a crossing family with the blue consecutive delimiters. The dashed segment is invalid. Middle: a violation of Condition iii. Right: Red segments do not cross all blue delimiters. It can be detected considering the previous dark blue delimiter and the relevant polygons.

In our algorithm, when computing Ci(s,t) 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 d0, our algorithm computes a valid crossing family C among 𝒫 that respects Π+ and has as start delimiter d0, or reports that no such family exists.

Proof.

Assume first that a solution exists, and let d0,d1,d be its sequence of delimiters sorted by decreasing slope. Any two consecutive delimiters (together with d0) 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 d0. We construct the extended sequence of classes Π+ from Π and d0. The computed crossing family corresponds to a sequence of delimiters d0,d1,d. If those would indeed form a crossing family sorted by decreasing slope that respects Π+ and has as start delimiter d0, 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 d0 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 di+1 be the first delimiter in the sequence that does not cross all the previous delimiters. Thus, d0,d1,,di form a crossing family. By Condition , d0, di, and di+1 are sorted by decreasing slope and there is no contributing polygon between di and di+1. In particular, the endpoints of di+1 lie in the top and bottom region of the vertical double wedge of di and d0, see Figure 3 (right). In contrast, delimiters d1,,di1 have their endpoints in the left and right region of the horizontal double wedge of di and d0. Since we only consider valid segments as delimiters and there is no contributing polygon between di and di+1, there is no endpoint of the delimiters d1,,di1 enclosed by {d0,di,di+1}. Thus, d0,d1,,di+1 form a crossing family, contradicting the assumption.

Lemma 7.

For a given set 𝒫 of polygons, a sequence of classes Π, and a segment d0, our algorithm computes a largest crossing family C among 𝒫 that respects Π and has as start delimiter d0.

Proof.

Let Πi+=(K0=K1,,K) be the extended sequence of classes of Π and let 𝒬 be the set of contributing polygons of Π. We prove by induction on i that our algorithm computes (in step i) a largest crossing family C among 𝒫 that respects the extended sequence Πi+=(K0=K1,,Ki), has as start delimiter d0, as end delimiter a given segment di (of class Ki) and the following property: () there is no polygon in 𝒬 that lies between the extreme delimiters of C or in a triangular region bounded by three segments of C. Note that condition () is necessary to obtain a crossing family fulfilling the conditions of the lemma.

The induction base trivially holds for i=0 and by Lemma 4, case i=1 also holds. Assume the induction hypothesis for step i, and assume for contradiction that in step i+1 there is a larger crossing family C that respects Πi+1+, has as start delimiter d0, as end delimiter di+1, and fulfills (). Let di be the previous delimiter in C; 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 i+1. By the induction hypothesis, until di the crossing family computed and tabulated by our algorithm cannot be smaller than the one of C until di. Moreover, by Lemma 4, between delimiters di and di+1 our algorithm computes a largest crossing family that can replace the one of C while maintaining its properties (respects Πi+1+, has as start delimiter d0, as end delimiter di+1, and fulfills ()). Thus, the crossing family that our algorithm computes for di+1 in step i+1 is at least as large as C; 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 k.

Proof.

Given a set 𝒫 of polygons, consider a crossing family C 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 d0 of C. By Lemmas 6 and 7, Step 2 in our algorithm computes a largest valid crossing family C with |C||C| respecting Π and with start delimiter d0, thus solving MaxCrossingFamily.

The algorithm runs in time f(k)n𝒪(1) where n is the number of vertices of 𝒫. The precomputation step takes 𝒪(n3) time. We run the polynomial (in n and k) algorithm in Step 2 𝒪(n2k2(4k3)) times. Without trying to optimize its running time, it comprises at most 4k3 steps corresponding to the classes, and in each step we consider at most 𝒪(n4) pairs of delimiters (assuming that we choose the 4 endpoints of the delimiters from all n points). For each such pair, the procedure in Lemma 4 takes 𝒪(n4) 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 𝒫={P1,,Pk} and a set 𝒮 of pairwise independent segments between vertices of 𝒫 that do not intersect P for any P𝒫, a bunch B is a maximal subset of 𝒮 that is enclosed by at most two elements b1,b2 of B and connected parts Q,Q of the boundaries of at most two arbitrary polygons P,P𝒫 such that the endpoints of each bB lie in QQ. b1,b2 are called the delimiters of B, and b1b2QQ is called the boundary of B.

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 𝒫={P1,,Pk} and a set of pairwise independent segments 𝒮 between vertices of 𝒫 that do not intersect P for any P𝒫, 𝒮=˙i[]Bi where each Bi is a bunch and 4k2.

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 n2𝒪(k2) (n denotes the overall number of polygon vertices) ways on the boundaries of the corresponding bunches: we branch on a set of 𝒪(k2) pairwise independent delimiting segments, on 𝒪(kk) pairings of them, and 𝒪(1) 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 k. 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 kn. 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 𝒫={P1,,Pk} and a set of pairwise independent segments 𝒮 between vertices of 𝒫 that do not intersect P for any P𝒫, 𝒮=˙i[]Bi where each Bi is a bunch and 4k2.

Proof.

We show the statement by induction on k.

For the base case, k=1 and 𝒮=B with the delimiting segment of B being given by an arbitrary segment in 𝒮 whose endpoints are consecutive in a traversal of the boundary P𝒮 along the boundary of P (if no such segment exists then 𝒮= and hence =0 is valid). The boundary of B is given by the above delimiting segment and the part of the boundary of P 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 P between the endpoints of the delimiting segment arbitrarily).

For the inductive step, assume the statement to hold for independent families on holes P1,,Pk1. Consider all elements of 𝒮 with an endpoint on Pk and an endpoint on Pi for any i[k1] and label them with i[k1] based on the containment of their other endpoint in Pi.

Along a traversal of the boundary of Pk, any distinct labels i,i do not interleave (i.e., occur in the order i,i,i,i) as this would induce a crossing between two closed curves, one formed by segments with the same label i and a part of the boundary between their endpoints on Pk and Pi and the other formed by segments with the same label i and a part of the boundary between their endpoints on Pk and Pi, contradicting that 𝒮 is independent or that Pi, Pi, and Pk 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 [k1] with at most two consecutive repetitions of each element has length at most 4k2 because without repetitions it is a Davenport-Schinzel sequence of order 2, and its length is therefore at most 2k1 [9]. Thus, the length of σ is at most 4k2.

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 Pk 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 4(k1)2+4k24k2 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].