Covering oriented points in the plane with ... - Semantic Scholar

Report 2 Downloads 47 Views
Electronic Notes in Discrete Mathematics 36 (2010) 303–310 www.elsevier.com/locate/endm

Covering oriented points in the plane with orthogonal polygons is NP-complete Cem Evrendilek 1 Dept. of Comp. Eng., Izmir University of Economics, Izmir, Turkey

Burkay Gen¸c 2 Dept. of Soft. Eng., Izmir University of Economics, Izmir, Turkey

Brahim Hnich 3 Dept. of Comp. Eng., Izmir University of Economics, Izmir, Turkey

Abstract We address the problem of covering points with orthogonal polygons. Specifically, given a set of n grid-points in the plane each designated in advance with either a horizontal or vertical reading, we investigate the existence of an orthogonal polygon covering these n points in such a way that each edge of the polygon covers exactly one point and each point is covered by exactly one edge with the additional requirement that the reading associated with each point dictates whether the edge covering it is to be horizontal or vertical. We show that this problem is NP-complete. Keywords: Computational geometry, Covering, Orthogonal polygon, NP-complete

1 2 3

Email: [email protected] Email: [email protected] Email: [email protected]

1571-0653/$ – see front matter © 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.endm.2010.05.039

304

1

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

Introduction

Constructing orthogonal shapes and objects from limited geometric and topological information is a frequently visited problem in computational geometry. One particular problem is reconstructing a 2D orthogonal shape from point data [4,5,6,7]. In existing works, points are either assumed to be anywhere within the polygon boundary or exactly required to be the vertices of the polygon. In this study, we require them to be exactly on polygon edges. Let an edge cover a point, if the point can be written as the convex combination of the two endpoints of the edge. A polygon covers a point set, if each polygon edge covers exactly one point and each point is covered exactly by one polygon edge. In [1], we show that in polynomial time we can compute an orthogonally convex polygon which covers a given point set, if and only if such a polygon exists. In this paper, we address a closely related problem where we relax the convexity condition, but whether each point is to be covered by a horizontal or vertical edge is specified in advance. Specifically, given a set of n points in the plane each designated in advance with either a horizontal or vertical reading, does there exist a covering orthogonal polygon, such that the reading associated with each point matches the alignment of the covering edge. We refer to this problem as COGOP. Our main result, in this paper, is that COGOP is NP-complete. The rest of the paper is organized as follows: Some background information and required preliminaries are introduced in the next section. Section 3 defines the problem formally and presents the NP-completeness proof. Finally, the paper is concluded by pointing out the future research directions.

2

Preliminaries

A polygon is a region on the plane enclosed by a closed polygonal chain. The edges of a polygon are the maximal line segments on the boundary of the polygon. The vertices of a polygon are the intersection points of its edges. A line segment is orthogonal if it is parallel to one of the coordinate axis. An orthogonal polygon is a polygon whose edges are orthogonal. An orthogonal line segment is horizontal (resp. vertical ) if it is parallel to x-axis (y-axis). A line segment covers a point, if it can be written as the convex combination of the endpoints of the line segment. If a horizontal (resp. vertical) line segment covers a point, then we say that the point is a horizontal point (resp. vertical point). The orientation of a point is defined to have the values horizontal

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

305

or vertical in referring to the state of the line segment covering it. Points with integer coordinates in the plane are called grid-points. Two points in the plane that have the same y-coordinate (x-coordinate) value are said to be horizontally (vertically) aligned. We will make use of the following NP-complete problem (CFST ) in our reduction: Given a set p of n grid-points in the plane, deciding whether p possesses a crossing-free spanning tree with only axes-parallel edges is shown to be NP-complete in [3].

3

Covering oriented points

Any given solution to COGOP can quickly be verified in polynomial time simply by checking that intersections do not exist between the polygonal edges and that there is a one-to-one mapping between points and edges. COGOP ∈ N P is, thus, easily established. 3.1

Transformation

We are now in a position to describe the transformation from a given instance of CFST to the corresponding instance of the COGOP. First, in linear time we translate all points to the positive quadrant. Next, we scale the coordinates of the points with a certain integer factor α which we soon explain in detail. The scaling is so, when we replace each scaled point with the gadget in Figure 1, the x and y ranges spanned by each gadget overlaps with another gadget if and only if the points corresponding to the gadgets before scaling had the same x or y coordinates. After scaling, each point, ti (xi , yi ), is replaced by a gadget gi composed of eight gadget points (See Figure 1). Each gadget point is identified by a two-letter label. The first letter is used to specify the associated orientation (horizontal, H, or vertical, V ) of ti the second is used to specify one of top (T ), right (R), bottom (B), and left (L). Any one point with a label L of a gadget gi will be denoted by gi L . All eight points of a gadget gi can then be listed by their relative coordinates to ti as: gVi T (xi + 2, yi + 4), gHT i (xi + 4, VR HR VB yi + 5), gi (xi + 5, yi + 4), gi (xi + 4, yi + 2), gi (xi + 3, yi + 1), gHB (xi i + 1, yi ), gVi L (xi , yi + 1), and gHL (x + 1, y + 3). These transformed points, i i i by construction, are all at integer coordinates. According to [1], the polygon (given in red) in Figure 1 is unique, even if the orientations of edges are not enforced. We call this the gadget polygon. The gadget points spread a square area whose sides have a length of five

306

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

Fig. 1. The gadget used for transforming CFSST into COGOP. Each ti is replaced with 8 new points: VL, HL, VT, HT, VR, HR, VB and HB.

units. This observation, accordingly, leads to the derivation of the smallest possible value of α as six. The total time spent in reducing an instance of CFST to the corresponding instance of COGOP is, certainly, O(n), and hence, polynomial. 3.2

Theoretical Properties

Some observations are now made below to facilitate the remaining steps of the NP-completeness proof. Two gadgets are said to be horizontally (vertically) aligned if the same labeled points in the gadgets have the same y-coordinate (x-coordinate) values. The x-range of a gadget gi is the range defined by the x-coordinates of giV L and giV R . Similarly, y-range is the range defined by the y-coordinates of giHB and giHT Lemma 3.1 After an instance of CFST is transformed as described above to a corresponding instance of COGOP problem, for any two given gadgets gi and gj , one and only one of the following three parts holds: i they are horizontally aligned and their x-ranges do not overlap, ii they are vertically aligned and their y-ranges do not overlap, iii they are not aligned and both their x-ranges and y-ranges do not overlap. A vertex, v, of a gadget polygon is said to be implied by a pair of gadget points (p, q) if v is formed by an intersection of two edges of the gadget polygon covering p and q respectively. Each of the vertices of a gadget polygon implied

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

307

Fig. 2. Possible connections among gadget points.

Fig. 3. gi − gj pathway.

by one of these pairs of gadget points (gi HT , gi V T ), (gi HR , gi V R ), (gi HB , gi V B ), and (gi HL , gi V L ) (see Figure 2) is unique in that they are the only vertices that suggest the possibility of alternative vertices to form connections to other gadget polygons. As illustrated in Figure 2, given two gadgets gi and gk which are horizontally aligned, we may have either the vertex implied by (gi HR , gi V R ) or the two vertices implied respectively by (gi HR , gk V L ) and (gi V R , gk HL ) in a covering. Such a structure between aligned gadgets is called a pathway. An example of a horizontal gi -gj pathway is shown in Figure 3. Each bidirectional gi -gj pathway, where gi and gj are horizontally (resp. vertically) aligned, is identified by two vertices implied by the pairs (gi HR , gj V L ) and (gi V R , gj HL ) (resp. (gi HT , gj V B ) and (gi V T , gj HB )). The discussion is summarized in the following lemma.

308

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

Lemma 3.2 If C is any orthogonal polygon covering (solution) of the corresponding COGOP instance obtained from a given CFST instance, then the following two hold for all gi : i Vertices implied by the gadget points (gi HT , gi V R ), (gi HR , gi V B ), (gi HB , gi V L ), and (gi HL , gi V T ), always belong to the vertex set of C. ii For every remaining vertex implied by the pair of gadget points (gi HT , gi V T ), (gi HR , gi V R ), (gi HB , gi V B ), and (gi HL , gi V L ), either it belongs to the vertex set of C or there exists a gadget gk aligned with gi such that they form a pathway whose two identifying vertices belong to the vertex set of C. Proof. i. Consider a gadget gi . The vertices implied are all 1 unit away from each gadget point in the pairing. As a result, the corresponding gadget edges must always intersect and form the said vertices. ii There are, four different cases and all are symmetrical with respect to the gadget polygon. Let us assume without loss of generality that the vertex implied by (gi V R , gi HR ) is picked. The edge, after passing all the way down through gi V R , can either turn left or right (see the dotted line below gi V R in Figure 2), thus suggesting two cases to consider. •

Case I. There are simply four possible configurations as to the next point visited by the horizontal path taken towards left after passing all the way HR HB down through gVi R . These points are gHL , and gHσ for some i , gi , gi j gadget gj where j = i, and σ ∈ [T, R, B, L]. Let us analyze each possibility one at a time: (i) The vertex implied by (gi V R , gi HL ) cannot be a vertex of C, since (gi V T , gi HL ) is already known to be a vertex of C according to part i of Lemma 3.2. (ii) This is possible. (iii) If the vertex, v, implied by (gi V R , gi HB ) is a vertex of C, gi HR cannot be covered since the horizontal edge passing through it is blocked to the right by the vertical edge passing through giHR . So, v cannot be a vertex of C. (iv) If the vertical edge passing through gi V R intersects an edge going through a horizontally oriented point of some gadget gj to the bottom and left of gi , we are left with the same configuration as above and this case is analogously deduced to be also impossible. •

Case II. In this case where a right turn is taken, the next point to be covered to the right and bottom of giV R must be a horizontal point of a gadget gk either horizontally aligned with gi or not aligned with gi at all. When gk is horizontally aligned with gi , there are three alternatives, gkHL , gkHR , and

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

309

Fig. 4. Removing a pathway.

gkHB . In case of non-alignment, a horizontally oriented point of some gadget gk to the bottom and right of gi is covered next. All cases but one where the next point visited is gkHL of a horizontally aligned gadget gk , simply correspond to Case I.(iii ) above. If the vertex implied by (giV R , gkHL ), when gi and gk are aligned, is a vertex of C, then it is the case that the vertex implied by (giHR , gkV L ) is also a vertex of C. It is straightforward to note that gkV B needs to be left uncovered once the only other alternative grid-point gkHR is used with gkV L to form a vertex. 2 An example of the type of connections described by Lemma 3.2 part (ii) is shown in Figure 3. Lemma 3.3 In any solution to a corresponding instance of COGOP with n > 0 gadgets, there are exactly n − 1 pathways. 4 3.3

Equivalence

We are, now, just a single step away from concluding the proof. The following Lemma is to take this last step. Lemma 3.4 An instance of CFST has a solution if and only if the corresponding COGOP instance has a solution. 5 4 5

Proof is omitted due to space considerations. Proof is omitted due to space considerations.

310

C. Evrendilek et al. / Electronic Notes in Discrete Mathematics 36 (2010) 303–310

It follows immediately from the previous results that COGOP is NPcomplete. Theorem 3.5 COGOP is NP-complete.

4

Conclusions

In this paper, we show that the problem of covering points with orthogonal polygons is NP-complete in general. There remains an interesting question to be considered in the future of whether the problem remains intractable even when edge orientations are not given.

References [1] B. Gen¸c, B. Hnich, C. Evrendilek, Covering points with orthogonally convex polygons, Computational Geometry: Theory and Applications (2009) (submitted). [2] M.R. Garey, D.S. Johnson, Computers and intractability: A guide to the theory of NP-completeness (Series of Books in the Mathematical Sciences), W. H. Freeman, NY, 1979. [3] K. Jansen, G.J. Woeginger, The complexity of detecting crossingfree configurations in the plane, BIT Numerical Mathematics 33 (4) (1993) 580595. [4] J. F. O’Callaghan. Computing the perceptual boundaries of dot patterns. Computer Graphics Image Processing, 3:141-162, 1974. [5] N. Ahuja. Dot pattern processing using Voronoi polygons as neighborhoods. In International Conference on Pattern Recognition, pages 1122-1127, 1980. [6] M. Alexa, J. Behr, D. Cohen-Or, S. Fleishman, D. Levin, and C.T. Silva. Point set surfaces. In VIS ’01: Proceedings of the conference on Visualization ’01, pages 21-28, Washington, DC, USA, 2001. IEEE Computer Society. [7] T. Biedl, B. Genc. Reconstructing Orthogonal Polyhedra from Putative Vertex Sets. Computational Geometry: Theory and Applications (2008) (submitted).