Convex partial transversals of planar regions

09/26/2018
by   Vahideh Keikha, et al.
Utrecht University
TU Eindhoven
0

We consider the problem of testing, for a given set of planar regions R and an integer k, whether there exists a convex shape whose boundary intersects at least k regions of R. We provide a polynomial time algorithm for the case where the regions are disjoint line segments with a constant number of orientations. On the other hand, we show that the problem is NP-hard when the regions are intersecting axis-aligned rectangles or 3-oriented line segments. For several natural intermediate classes of shapes (arbitrary disjoint segments, intersecting 2-oriented segments) the problem remains open.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

09/05/2021

Linking disjoint axis-parallel segments into a simple polygon is hard too

Deciding whether a family of disjoint axis-parallel line segments in the...
09/06/2021

Disjoint axis-parallel segments without a circumscribing polygon

We construct a family of 17 disjoint axis-parallel line segments in the ...
05/20/2020

Further Questions on Oriented Convex Containers of Convex Planar Regions

We define an 'oriented convex region' as a convex region with a directio...
02/19/2020

Optimally Guarding Perimeters and Regions with Mobile Range Sensors

We investigate the problem of using mobile robots equipped with 2D range...
04/16/2020

Framework for ∃ℝ-Completeness of Two-Dimensional Packing Problems

We show that many natural two-dimensional packing problems are algorithm...
08/29/2021

Linking disjoint segments into a simple polygon is hard

Deciding whether a family of disjoint line segments in the plane can be ...
05/20/2020

Oriented Convex Containers of Polygons – II

We define an 'oriented convex region' as a convex region with a directio...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

A set of points in the plane is said to be in convex position if for every point there is a halfplane containing that has on its boundary. Now, let be a set of regions in the plane. We say that is a partial transversal of if there exists an injective map such that for all ; if is a bijection we call a full transversal. In this paper, we are concerned with the question whether a given set of regions admits a convex partial transversal of a given cardinality . Figure 1 shows an example.

Figure 1: (a) A set of 12 regions. (b, c) A convex partial transversal of size .

The study of convex transversals was initiated by Arik Tamir at the Fourth NYU Computational Geometry Day in 1987, who asked “Given a collection of compact sets, can one decide in polynomial time whether there exists a convex body whose boundary intersects every set in the collection?” Note that this is equivalent to the question of whether a convex full transversal of the sets exists: given the convex body, we can place a point of its boundary in every intersected region; conversely, the convex hull of a convex transversal forms a convex body whose boundary intersects every set. In 2010, Arkin et al. [2] answered Tamir’s original question in the negative (assuming P NP): they prove that the problem is NP-hard, even when the regions are (potentially intersecting) line segments in the plane, regular polygons in the plane, or balls in . On the other hand, they show that Tamir’s problem can be solved in polynomial time when the regions are disjoint segments in the plane and the convex body is restricted to be a polygon whose vertices are chosen from a given discrete set of (polynomially many) candidate locations. Goodrich and Snoeyink [6] show that for a set of parallel line segments, the existence of a convex transversal can be tested in time. Schlipf [12] further proves that the problem of finding a convex stabber for a set of disjoint bends (that is, shapes consisting of two segments joined at one endpoint) is also NP-hard. She also studies the optimisation version of maximising the number of regions stabbed by a convex shape; we may re-interpret this question as finding the largest such that a convex partial transversal of cardinality exists. She shows that this problem is also NP-hard for a set of (potentially intersecting) line segments in the plane.

Related work.

Computing a partial transversal of maximum size arises in wire layout applications [13]. When each region in is a single point, our problem reduces to determining whether a point set has a subset of cardinality in convex position. Eppstein et al. [4] solve this in time and space using dynamic programming; the total number of convex -gons can also be tabulated in time [11, 9].

If we allow reusing elements, our problem becomes equivalent to so-called covering color classes introduced by Arkin et al. [1]. Arkin et al. show that for a set of regions where each region is a set of two or three points, computing a convex partial transversal of of maximum cardinality is NP-hard. Conflict-free coloring has been studied extensively, and has applications in, for instance, cellular networks [5, 7, 8].

disjoint intersecting
line segments: parallel (upper hull only: ) N/A
2-oriented open
3-oriented NP-hard
-oriented polynomial
arbitrary open NP-hard [2]
rectangles: squares open open
rectangles open NP-hard
other: bends NP-hard [12]
Table 1: New and known results.
Results.

Despite the large body of work on convex transversals and natural extensions of partial transversals that are often mentioned in the literature, surprisingly, no positive results were known. We present the first positive results: in Section 2 we show how to test whether a set of parallel line segments admits a convex transversal of size in polynomial time; we extend this result to disjoint segments of a fixed number of orientations in Section 3. Although the hardness proofs of Arkin et al. and Schlipf do extend to partial convex transversals, we strengthen these results by showing that the problem is already hard when the regions are -oriented segments or axis-aligned rectangles (Section 4). Our results are summarized in Table 1. The arrows in the table indicate that one result is implied by another.

For ease of terminology, in the remainder of this paper, we will drop the qualifier “partial” and simply use “convex transversal” to mean “partial convex transversal”. Also, for ease of argument, in all our results we test for weakly convex transversals. This means that the transversal may contain three or more colinear points.

2 Parallel disjoint line segments

Let be a set of vertical line segments in . We assume that no three endpoints are aligned. Let and denote the sets of upper and lower endpoints of the regions in , respectively, and let . In Section 2.1 we focus on computing an upper convex transversal –a convex transversal in which all points appear on the upper hull of – that maximizes the number of regions visited. We show that there is an optimal transversal whose strictly convex vertices lie only on bottom endpoints in . In Section 2.2 we prove that there exists an optimal convex transversal whose strictly convex vertices are taken from the set of all endpoints , and whose leftmost and rightmost vertices are taken from a discrete set of points. This leads to an time dynamic programming algorithm to compute such a transversal.

2.1 Computing an upper convex transversal

Let be the maximum number of regions visitable by a upper convex transversal of .

Let be an upper convex transversal of that visits regions. There exists an upper convex transversal of , that visits the same regions as , and such that the leftmost vertex, the rightmost vertex, and all strictly convex vertices of lie on the bottom endpoints of the regions in .

Proof.

Let be the set of all upper convex transversals with vertices. Let be a upper convex transversal such that the sum of the -coordinates of its vertices is minimal. Assume, by contradiction, that has a vertex that is neither on the lower endpoint of its respective segment nor aligned with its adjacent vertices. Then we can move down without making the upper hull non-convex. This is a contradiction. Therefore, all vertices in are either aligned with their neighbors (and thus not strictly convex), or at the bottom endpoint of a region. ∎

Let denote the set of bottom endpoints of regions in that lie left of and below the line through and . See Figure 2(a). Let denote the slope of the supporting line of , and observe that .

By Lemma 2.1 there is an optimal upper convex transversal of in which all strictly convex vertices lie on bottom endpoints of the segments. Let be the maximum number of regions visitable by a upper convex transversal that ends at a bottom endpoint , and has an incoming slope at of at least . It is important to note that the second argument is used only to specify the slope, and may be left or right of . We have that

where denotes the number of regions in intersected by the segment (in which we treat the endpoint at as open, and the endpoint at as closed). See Figure 2(a) for an illustration.

Figure 2: (a) The definition of . The region is indicated in purple. The segments counted in are shown in red. (b) The case that , where corresponds to the predecessor slope of . (c) The case that .
Observation .

Let , , and be bottom endpoints of segments in with . We have that .

Fix a bottom endpoint , and order the other bottom endpoints in decreasing order of slope . Let denote the resulting order. We denote the -coordinate of a point by .

Let and be bottom endpoints of regions in , and let be the predecessor of in , if it exists (otherwise let ). We have that

Proof.

If does not have any predecessor in then can be the only endpoint in . In particular, if lies right of then is empty, and thus , i.e. our transversal starts and ends at . If lies left of we can either visit only or arrive from , provided the incoming angle at is at least . In that case it follows that the maximum number of regions visited is .

If does have a predecessor in , we have , where is either empty or the singleton . By Observation 2.1 (and the definition of ) we have that . Analogous to the base case we have . The lemma follows. ∎

Lemma 2.1 now suggests a dynamic programming approach to compute the values for all pairs of bottom endpoints : we process the endpoints on increasing -coordinate, and for each , we compute all values in the order of . To this end, we need to compute (i) the (radial) orders , for all bottom endpoints , and (ii) the number of regions intersected by a line segment , for all pairs of bottom endpoints , . We show that we can solve both these problems in time. We then also obtain an time algorithm to compute .

Computing predecessor slopes.

For each bottom endpoint , we simply sort the other bottom endpoints around . This can be done in time in total [10]111Alternatively, we can dualize the points into lines and use the dual arrangement to obtain all radial orders in time.. We can now obtain by splitting the resulting list into two lists, one with all endpoints left of and one with the endpoints right of , and merging these lists appropriately. In total this takes time.

Computing the number of intersections.

We use the standard duality transform [3] to map every point to a line , and every non-vertical line to a point . Consider the arrangement formed by the lines dual to all endpoints (both top and bottom) of all regions in . Observe that in this dual space, a vertical line segment corresponds to a strip bounded by two parallel lines and . Let denote this set of strips corresponding to . It follows that if we want to count the number of regions of intersected by a query line we have to count the number of strips in containing the point .

All our query segments are defined by two bottom endpoints and , so the supporting line of such a segment corresponds to a vertex of the arrangement . It is fairly easy to count, for every vertex of , the number of strips that contain , in a total of time; simply traverse each line of while maintaining the number of strips that contain the current point.

Since in our case we wish to count only the regions intersected by a line segment (rather than a line ), we need two more observations. Assume without loss of generality that . This means we wish to count only the strips that contain and whose slope lies in the range .

Observation .

Let be a line, oriented from left to right, and let be a strip. The line intersects the bottom boundary of before the top boundary of if and only if .

Figure 3: A line intersects the bottom of the strip if and only if ,

Again consider traversing a line of (from left to right), and let be the number of strips that contain the point and that we enter through the top boundary of the strip.

Let , with , be a vertex of at which the lines and intersect. The number of strips from with slope in the range containing is .

Proof.
Figure 4: The strip with a slope in the range containing contributes one to and zero to .

A strip that does not contain contributes zero to both and . A strip that contains but has slope larger than (and thus also larger than ) contributes one to both and (Observation 2.1). Symmetrically, a strip that contains but has slope smaller than contributes zero to both and . Finally, a strip whose slope is in the range is intersected by from the top, and by from the bottom (Observation 2.1), and thus contributes one to and zero to . See Figure 4 for an illustration. The lemma follows. ∎

Let be bottom endpoints. The number of regions of intersected by is .

We can easily compute the counts for every vertex on by traversing the line . We therefore obtain the following result.

For all pairs of bottom endpoints , we can compute the number of regions in intersected by , in a total of time.

Applying this in our dynamic programming approach for computing we get:

Given a set of vertical line segments , we can compute the maximum number of regions visitable by an upper convex transversal in time.

2.2 Computing a convex transversal

We now consider computing a convex partial transversal that maximizes the number of regions visited. We first prove some properties of convex transversals. We then use these properties to compute the maximum number of regions visitable by such a transversal using dynamic programming.

2.2.1 Canonical Transversals

Let be a convex partial transversal of . There exists a convex partial transversal of such that

  • the transversals have the same leftmost vertex and the same rightmost vertex ,

  • the upper hull of intersects the same regions as the upper hull of ,

  • all strictly convex vertices on the upper hull of lie on bottom endpoints of ,

  • the lower hull of intersects the same regions as the lower hull of , and

  • all strictly convex vertices on the lower hull of lie on top endpoints of regions in .

Proof.

Clip the segments containing and such that and are the bottom endpoints, and apply Lemma 2.1 to get an upper convex transversal of whose strictly convex vertices lie on bottom endpoints and that visits the same regions as the upper hull of . So we can replace the upper hull of by . Symmetrically, we can replace the lower hull of by a transversal that visits the same regions and whose strictly convex vertices use only top endpoints. ∎

A partial convex transversal of is a lower canonical transversal if and only if

  • [nosep]

  • the strictly convex vertices on the upper hull of lie on bottom endpoints in ,

  • the strictly convex vertices on the lower hull of lie on bottom or top endpoints of regions in ,

  • the leftmost vertex of lies on a line through , where is the leftmost strictly convex vertex of the lower hull of , and another endpoint.

  • the rightmost vertex of lies on a line through , where is the rightmost strictly convex vertex of the lower hull of , and another endpoint.

An upper canonical transversal is defined analogously, but now and lie on lines through an endpoint and the leftmost and rightmost strictly convex vertices on the upper hull.

Let be a convex partial transversal of for which all strictly convex vertices in the lower hull lie on endpoints of regions in . There exists a lower canonical transversal of , that visits the same regions as .

Proof.
Figure 5: We move and the vertices on downwards, bending at and until contains a bottom endpoint or becomes colinear with .

Let be the leftmost point of , let be the vertex of adjacent to on the upper hull, let be the leftmost strictly convex vertex on the lower hull of , and let be the strictly convex vertex of adjacent to . We move and all other vertices of on downwards, bending at and , while remains convex and visits the same -regions until: (i) lies on the bottom endpoint of its segment, (ii) the segment contains the bottom endpoint of a region, or (iii) the segment has become collinear with . See Figure 5. Observe that in all cases lies on a line through the leftmost strictly convex vertex and another endpoint (either itself, , or ). Symmetrically, we move downwards until it lies on an endpoint or on a line through the rightmost strictly convex vertex on the lower hull of and another endpoint. Let be the resulting convex transversal we obtain.

Let be the regions intersected by the upper hull of (setting the bottom endpoint of the regions containing and to be and ). We now appeal to Lemma 2.1 to get that there is an upper hull that also visits all regions in and in which all strictly convex vertices lie on bottom endpoints. So, we can replace the upper hull of by this upper hull and obtain the transversal stated in the lemma. ∎

Let be a convex partial transversal of , whose lower hull intersects at least one region (other than the regions containing the leftmost and rightmost vertices) but contains no endpoints of regions in . There exists a convex partial transversal intersecting the same regions as that does visit one endpoint of a region in .

Proof.

Consider the region intersected by whose bottom endpoint minimizes the distance between and , and observe that is a vertex of . Shift down (and the vertices on and ) until lies on . ∎

Let be a quadrilateral whose leftmost vertex is , whose top vertex is , whose rightmost vertex is , and whose bottom vertex is . The quadrilateral is a lower canonical quadrilateral if and only if

  • [nosep]

  • and lie on endpoints in ,

  • lies on a line through and another endpoint, and

  • lies on a line through and another endpoint.

We define upper canonical quadrilateral analogously (i.e. by requiring that and lie on lines through rather than ).

Let be a convex quadrilateral with as leftmost vertex, as rightmost vertex, a bottom endpoint on the upper hull of , and an endpoint of a region in .

  • There exists an upper or lower canonical quadrilateral intersecting the same regions as , or

  • there exists a convex partial transversal whose upper hull contains exactly two strictly convex vertices, both on endpoints, or whose lower hull contains exactly two strictly convex vertices, both on endpoints.

Proof.
Figure 6: We can transform a quadrilateral transversal into a transversal with two strictly convex vertices on the lower hull or on the upper hull (cases (a) and (d)), or into a quadrilateral in which the leftmost vertex and rightmost vertex lie on a line through an endpoint and either or (cases (b) and (c)). The bottom row shows how we can shift to lie on a line through and another endpoint when we already have that lies on a line through and an endpoint .

Shift downward and upward with the same speed, bending at and until one of the edges of the quadrilateral will stop to intersect the regions only intersected by that edge. It follows that at such a time this edge contains an endpoint of a region in . We now distinguish between four cases, depending on the edge containing . See Figure 6.

  1. Case . It follows is a bottom endpoint. We continue shifting and , now bending in , , and . We now have a convex partial transversal that visits the same regions as and whose upper hull contains at least two strictly convex vertices, both bottom endpoints of regions.

  2. Case . It follows that is a bottom endpoint. We now shift downwards until: (b.i) contains a bottom endpoint , (b.ii) contains a bottom endpoint or (b.iii) is collinear with . In the case (b.i) we get an upper hull with two strictly convex vertices, both bottom endpoints of regions. In cases (b.ii) and (b.iii) we now have that both and lie on lines through and another endpoint.

  3. Case . Similar to the case we now shift back upwards until the lower hull contains at least two strictly convex endpoints, or until lies on a line through and some other endpoint .

  4. Case . Similar to the case . We continue shifting downward and upward, bending in , thus giving two strictly convex vertices in the lower hull, both on endpoints.

Let be the maximal number of regions of visitable by an upper convex transversal, let be the maximal number of regions of visitable by a canonical upper quadrilateral, and let denote the maximal number of regions of visitable by a canonical upper transversal. We define , , and , for the maximal number of regions of , visitable by a lower convex transversal, canonical lower quadrilateral, and canonical lower transversal, respectively.

Let be the maximal number of regions in visitable by a convex partial transversal of . We have that .

Proof.

Clearly . We now argue that we can transform an optimal convex partial transversal of visiting regions into a canonical transversal. The lemma then follows.

By Lemma 2.2.1 there is an optimal convex partial transversal of , visiting regions, whose strictly convex vertices lie on endpoints of the regions in .

If either the lower or upper hull of does not intersect any regions, we use Lemma 2.1 (or its analog for the bottom hull) to get . Otherwise, if the lower hull of contains at least two strictly convex vertices, we apply Lemma 2.2.1, and obtain that there is a convex lower transversal. Similarly, if the upper hull contains at least two strictly convex vertices we apply a lemma analogous to Lemma 2.2.1, and obtain that there is a canonical upper transversal visiting the same regions as .

If has at most one strictly convex vertex on both the lower hull and upper hull we use Lemma 2.2.1 and get that there exists a convex quadrilateral that visits the same regions as . We now apply Lemma 2.2.1 to get that there either is an optimal transversal that contains two strictly convex vertices on its upper or lower hull, or there is a canonical quadrilateral that intersects the same regions as . In the former case we can again apply Lemma 2.2.1 to get a canonical convex partial transversal that visits regions. In the latter case we have . ∎

By Lemma 2.2.1 we can restrict our attention to upper and lower convex transversals, canonical quadrilaterals, and canonical transversals. We can compute an optimal upper (lower) convex transversal in time using the algorithm from the previous section. Next, we argue that we can compute an optimal canonical quadrilateral in time, and an optimal canonical transversal in time. Arkin et al. [2] describe an algorithm that given a discrete set of vertex locations can find a convex polygon (on these locations) that maximizes the number of regions stabbed. Note, however, that since a region contains multiple vertex locations —and we may use only one of them— we cannot directly apply their algorithm.

Observe that if we fix the leftmost strictly convex vertex in the lower hull, there are only candidate points for the leftmost vertex in the transversal. Namely, the intersection points of the (linearly many) segments with the linearly many lines through and an endpoint. Let be this set of candidate points. Analogously, let be the candidate points for the rightmost vertex defined by the rightmost strictly convex vertex in the lower hull.

2.3 Computing the maximal number of regions intersected by a canonical quadrilateral

Let be a canonical lower quadrilateral with , let be the regions intersected by , and let be the number of such regions. We then define to be the remaining regions, and as the number of regions from intersected by . Observe that those are the regions from that are not intersected by . Note that we exclude the two regions that have or as its endpoint from . Hence, the number of regions intersected by is , See Figure 7, and the maximum number of regions all canonical lower quadrilaterals with is

We show that we can compute this in time. If , we use a symmetric procedure in which we count all regions intersected by first, and then the remaining regions intersected by . Since is the maximum of these two results, computing takes time as well.

Since there are choices for and , and for , we can naively compute and in time. For each , we then radially sort around . Next, we describe how we can then compute all , with , for a given set , and how to compute .

Figure 7: The green vertical segments are , while the gray and black ones are . The number of black vertical segments is .
Computing the number of Intersections

Given a set of regions , the points , , and the candidate endpoints , sorted radially around , we now show how to compute for all in time.

Figure 8: (a) The red crosses are possible candidate points in . Gray crosses above or below or left to the vertical line through is not part of . (b) The orange line segment and green line segment move upwards along . An events occurs when either or sweeps through the endpoint of a vertical segment in . When sweeps through the top endpoint of , we check whether intersects with or not. We increase the number of intersected segment when sweeps through the bottom endpoint of and decrease it when sweeps through the top endpoint of .

We sort the endpoints of radially around and around , and partition the points in based on which segment (region) they lie. Let be a region that has as its bottom endpoint, and let . We explicitly compute the number of regions intersected by in linear time, and set to . We shift up , while maintaining the number of regions intersected by . See Figure 8(b) As moves upwards, the segments and , sweep through endpoints of the regions in . We can decide which event should be processed first from the two ordered lists of endpoints in constant time.

If an event occurs, the value of changes depending on the type of endpoint and which line segment ( or ) responsible for that particular event. If sweeps through a point in , we increase the value of by one. Conversely, we decrease the value of by one if sweeps a top endpoint of some region if does not intersect with . Otherwise, we do nothing. We treat events caused by in a similar way. See Figure 8(b) for an illustration. When passes through a candidate point we set to . Computing all values for all then takes time, and thus time over all regions .

Maximizing over .

To find the point that maximizes we now just filter to exclude all points above the line through and and below the line through and , and report the maximum value among the remaining points.

Improving the running time to .

Directly applying the above approach yields an time algorithm, as there are a total of triples to consider. We now improve this to time as follows.

First observe that since , cannot intersect any regions of the regions left of . Let be this set of regions. Since lies left of (by definition) we thus have that .

Second, consider all points that lie on the line through and some endpoint . Observe that they all have the same set . This means that there are only different sets for which we have to compute values.

Finally, again consider all points that lie on the line through and some point . For all these points we discard the same points from because they are below . We can then compute for all these points in time in total, by rotating the line through and around in counter clockwise order, while maintaining the valid candidate points in (i.e. above and below ), and the maximum value among those points, see Figure 9. Since there are combination of , and , then in total we spent time to compute all values of , over all , , and , and thus we obtain the following result.

Figure 9: is shown in green vertical segments. The red crosses below (that has one of its endpoint at ’), above and to the left of vertical line through are candidates for the rightmost point. The orange crosses become candidates for the rightmost point after we rotate in counter-clockwise order and consider as the leftmost point.

Given a set of vertical line segments , we can compute the maximum number of regions visitable by a canonical quadrilateral in time.

2.3.1 Computing the maximal number of regions intersected by a canonical transversal

Next, we describe an algorithm to compute the maximal number of regions visitable by a lower canonical convex transversal. Our algorithm consists of three dynamic programming phases, in which we consider (partial) convex hulls of a particular “shape”.

In the first phase we compute (and memorize) : the maximal number of regions visitable by a partial transversal that has as a segment in the lower hull, and a convex chain as upper hull. See Figure 10(a).

In the second phase we compute : the maximal number of regions visitable by the canonical partial convex transversal whose rightmost top edge is and whose rightmost bottom edge is .

In the third phase we compute the maximal number of regions visitable when we “close” the transversal using the rightmost vertex . To this end, we define as the number of regions visitable by the canonical transversal whose rightmost upper segment is and whose rightmost bottom segment is and is defined by the strictly convex vertex .

Computing .

Given a set of regions let be the maximal number of regions in visitable by an upper convex transversal that starts in a fixed point and ends with the segment .

We can compute all values in time.

Proof.

Analogous to the algorithm in Section 2.1. ∎

Let be the maximal number of regions visitable by a transversal that starts at , back to , and then an upper hull from ending with the segment . See Figure 10(a).

Figure 10: (a) indicates the number of regions visited by a partial convex transversal that has as bottom hull and the upper hull from to . We can compute the values for all by explicitly setting aside the segments intersected by and then using the upper hull algorithm. (b) The base case of the recurrence when . The regions counted by are shown in red, whereas the regions counted by are shown in black. (c) The inductive step when .

For each combination of and , explicitly construct the regions not intersected by . We then have that . So, we can compute all , for , and , in time in total.

Computing .

Let be the maximum number of regions left of visitable by a partial transversal that

  • [nosep]

  • has as its leftmost strictly convex vertex in the bottom hull,

  • has as its leftmost vertex,

  • has as rightmost edge in the bottom hull, and

  • has as its (partial) upper hull.

We can compute using an approach similar to the one we used to compute : we fix , and , and explicitly compute the segments intersected by . We set those we count them, and set them aside. On the remaining segments we compute an optimal bottom hull from to whose incoming slope at is at least . This takes time, using an analogous approach to that used in Section 2.1. Since we have choices for the triple this takes a total of time.

Computing .

Let denote the subset of the points left of , below the line through and , and above the line through and .

Let be a maximal number of regions visitable by the minimum area canonical partial convex transversal that has as its rightmost segment in the upper hull and as its rightmost segment in the lower hull.

If we have that

where is the number of segments intersected by but not by . See Figure 10(b) and (c) for an illustration. We rewrite this to

Figure 11: The two cases in the dynamic program when . (a) The segments counted by in black, in green, in red, and in purple. (b) The case where there is another segment in the lower hull as well. The segments counted by are again shown in red, whereas the segments counted by are shown in black.

If we get a more complicated expression. Let be the number of regions intersected by but not by , and let be the number of regions right of intersected by . See Figure 11 for an illustration. We then have

which we rewrite to

We can naively compute all and all values in time. Since there are only choices for computing all values for all cells takes only time in total. The same holds for computing all .

As we describe next, we can compute the values in time as well. Fix , compute all candidate points in and sort them radially around . For each : remove the candidate points above the line through and . This takes time in total.

For each maximal subset that lies below the line through and , we now do the following. We rotate a line around in counterclockwise order, starting with the vertical line. We maintain the subset of that lies above this line, and . Thus, when this line sweeps through a point , we know the value . There are sets , each of size . So, while rotating the line we process events. Since we can look up the value values in constant time, processing each event takes only time. It follows that we spend time in total.

Similarly, computing all values requires time: we fix , and , and compute all values in time. We group these values based on the slope of , and sort the groups on this slope. This again takes in total. Similarly, we sort the vertices around , and simultaneously scan the list of values and the vertices , while maintaining the maximum value that has slope at least . This takes time.

It follows that we can compute all values in time in total.

Closing the hull.

We now consider adding the rightmost point to finish the convex transversal. Given vertices , and , let be the segments intersected by the partial transversal corresponding to . We explicitly compute , and then compute the maximum number of regions from this set intersected by , over all choices of rightmost vertex . This takes time using the exact same approach we used in the canonical quadrilateral section. It follows that we can compute the maximum number of regions visitable by a canonical bottom convex transversal in time. Therefore we conclude:

Given a set of vertical line segments , we can compute the maximum number of regions visitable by a convex partial transversal in time.

3 2-oriented disjoint line segments

In this section we consider the case when consists of vertical and horizontal disjoint segments. We will show how to apply similar ideas presented in previous sections to compute an optimal convex transversal of . As in the previous section, we will mostly restrict our search to canonical transversals. However, unlike in the one-oriented case, we will have one special case to consider when an optimal partial convex transversal has bends not necessarily belonging to a discrete set of points.

We call the left-, right-, top- and bottommost vertices , , and of a convex partial transversal the extreme vertices. Consider a convex hull of a partial transversal , and consider the four convex chains between the extreme vertices. Let us call the chain between vertices and the upper-left hull, and the other chains upper-right, lower-right and lower-left. Similar to Lemma 2.1 we can show the following:

Let be a convex partial transversal of with extreme vertices , , , and . There exists a convex partial transversal of such that

  • the two transversals have the same extreme vertices,

  • all segments that are intersected by the upper-left, upper-right, lower-right, and lower-left hulls of are also intersected by the corresponding hulls of ,

  • all strictly convex vertices on the upper-left hull of lie on bottom endpoints of vertical segments or on the right endpoints of horizontal segments of ,

  • the convex vertices on the other hulls of lie on analogous endpoints.

One condition for a transversal to be canonical will be that all its strictly convex vertices, except for the extreme ones, satisfy the conditions of Lemma 3. Another condition will be that its extreme vertices belong to a discrete set of fixed points. This set of fixed points will contain all the endpoints of the segments in ; we will call these points th-order fixed points. Furthermore, the set of fixed points will contain intersections of the segments of of certain lines, that we will describe below, with the segments of .

Now, consider a convex partial transversal for which all the strictly convex vertices, except for the four extreme ones, lie on endpoints of segments in . We will describe how to slide the extreme vertices of along their respective segments to obtain a canonical transversal. Note, that for simplicity of exposition in the description below we assume that no new intersections of the convex hull of with segments of appear. Otherwise, we can restart the process with higher value of . Let , , , and be the four segments containing the four extreme points, and denote as , , , and the four subsets of of segments intersected by the upper-left, upper-right, bottom-left, and bottom-right hulls respectively.

First, consider the case when (or ) lies on a vertical segment. Then it can be safely moved down (or up) until it hits an endpoint of its segment (i.e., a th-order fixed point), or is no longer an extreme vertex. If it is no longer an extreme vertex, we restore the conditions of Lemma 3 and continue with the new topmost (or bottommost) vertex of the transversal. Similarly, in the case when or lie on horizontal segments, we can slide them until they reach th-order fixed points.

Assume then that and lie on horizontal segments, and and lie on vertical segments. We further assume that the non-extreme vertices have been moved according to Lemma 3. We observe that either (1) there exists a chain of the convex hull of containing at least two endpoints of segments, (2) there exists a chain of the convex hull of containing no endpoints, or (3) all four convex chains contain at most one endpoint.

In case (1), w.l.o.g., let the upper-left hull contain at least endpoints. Then we can slide left along its segment until it reaches its endpoint or an intersection with a line through two endpoints of segment in . Note that sliding left does not create problems on the top-right hull. We can also slide up along its segment until it reaches its endpoint or an intersection with a line through two endpoints of segments in . Thus, we also need to consider the intersections of segments in with lines through pairs of endpoints; we will call these st-order fixed points. Now, vertices and are fixed, and we will proceed with sliding and .

For vertex , we further distinguish two cases: (1.a) the upper-right convex hull contains at least two endpoints, or (1.b) it contains at most one endpoint.

In case (1.a), similarly to the case (1), we slide up until it reaches an endpoint of or an intersection with a line through two endpoints of segments in .

In case (1.b), we slide up, while unbending the strictly convex angle if it exists, until reaches an endpoint of , or until the upper-right hull (which will be a straight-line segment at this point) contains a topmost or a rightmost endpoint of some segment in . In this case, will end up in an intersection point of a line passing through and an endpoint of a segment in . We will call such points nd-order fixed points, defined as an intersection of a segment in with a line passing through a st-order fixed point and an endpoint of a segment in .

Similarly, for we distinguish two cases on the size of the lower-left hull, and slide until a fixed point (of th-, st-, or nd-order). Thus, in case (1) we get a canonical convex transversal representation with strictly convex bends in the endpoints of segments in , and extreme vertices in