Approximations for Two Decomposition-Based Geometric Optimization ...

2 downloads 0 Views 144KB Size Report
Minghui Jiang; Brendan Mumey; Zhongping Qin; Andrew Tomascak; Binhai Zhu ... Jacobs, G., Theunissen, F.: Functional organization of a neural map in the ...
Approximations for Two Decomposition-Based Geometric Optimization Problems Minghui Jiang, Brendan Mumey, Zhongping Qin, Andrew Tomascak, and Binhai Zhu Department of Computer Science, Montana State University, Bozeman, MT 59717-3880, USA. {jiang,mumey,qin,tomascak,bhz}@cs.montana.edu

Abstract. In this paper we present new approximation algorithms for two NP-hard geometric optimization problems: (1) decomposing a triangulation into minimum number of triangle strips (tristrips); (2) covering an n × n binary neuron image with minimum number of disjoint h × h boxes such that the total number of connected components within individual boxes is minimized. Both problems share the pattern that overlap is either disallowed or to be minimized. For the problem of decomposing a triangulation into minimum number of tristrips, we obtain a simple √ approximation with a factor of O( n log n); no approximation with o(n) factor is previously known for this problem [6]. For the problem of tiling a binary neuron image with boxes, we present a bi-criteria factor-(2, 4h−4) approximation that uses at most twice the optimal number of tiles and results in at most 4h − 4 times the optimal number of connected components. We also prove that it is NP-complete to approximate the general problem within some fixed constant.

1

Introduction

In this paper, we present efficient approximation algorithms for two geometric optimization problems arising in computer graphics and computational biology. Both problems are NP-hard. Although our techniques in designing approximation algorithms for these problems are somehow standard, we believe that some properties of these problems we prove in this paper might have applications for other problems. Decomposing a triangulation into triangle strips (tristrips) has interesting application in computer graphics and visualization. It is an open problem posed by Rossignac. Recently Estkowski et al. [6] proved that this problem is NPcomplete; they also proposed two algorithms, with no proven approximation factor, for this problem. In this paper, we first present a simple linear time algorithm to decide whether a triangulation can be encoded by a single tristrip; we then present a factor√ O( n log n) approximation algorithm for the general optimization problem. Our 

This research is partially supported by NSF CARGO grant DMS-0138065.

A. Lagan` a et al. (Eds.): ICCSA 2004, LNCS 3045, pp. 90–98, 2004. c Springer-Verlag Berlin Heidelberg 2004 

Approximations

91

approximation is achieved by first approximating the related problem of covering a triangulation with minimum number of tristrips using set cover. Tiling (decomposing) an image with fixed-size boxes has a lot of applications in data partition, image storage, and statistical analysis. Given a set of points in 2D, covering them using the minimum number of fixed-size boxes (squares) was proved be NP-complete more than two decades ago [7]. Recently, Khanna, et al. studied a slightly different problem, namely, to partition an n × n array of non-negative numbers into minimum number of tiles (fixed-size rectangles) such that the maximum weight of any tile is minimized. (Here the weight of a tile is the sum of the elements within it.) They proved that this problem is NP-complete and that no approximation can achieve a factor better than 1.25; they also proposed a factor-2.5 approximation algorithm [11]. Improved bounds are obtained later [14,3]. Some related problems are studied in [2]. In this paper, we study another related problem originated from the application of storing and manipulating neuron images in computational biology. In the study of neural maps, biologists need to divide a large 3D neuron image (represented by stacks of 2D images) into disjoint fixed-size boxes and store them separately [9,10,13]. The size of each box is much smaller and its data can be handled by a common computer, say, a PC. In the decomposition of a neuron image, we want to keep enough information within each box, which stores fragments of a neuron, while using a limited number of boxes: we want to minimize the total number of connected components with individual boxes and, at the same time, bound the number of boxes used. We formulate this problem as a more general 2D problem. Given an n × n binary image M , decide whether the 1-elements in M can be covered by B disjoint h × h (h ≥ 2) boxes such that the total number of connected components within individual boxes is bounded by W . We show that this problem is NP-complete. We also present a bi-criteria factor-(2, 4h − 3) approximation for this problem. When all the 1-elements in the image are connected, as is the actual situation in the applications since a neuron is basically a huge tree in 3D, then the approximation factor becomes (2, 4h − 4). Our approximation results can be generalized straightforwardly to 3D but with higher approximation ratios. We now define formally the problems to be studied. We first make some definitions related to our algorithms. As these problems are NP-hard, from now on we will focus on their optimization versions. We say that an approximation algorithm for a maximization (minimization) problem Π provides a performance guarantee of ρ if, for every instance I of Π, the solution value returned by the approximation algorithm is at least 1/ρ (at most ρ of) the optimal value for I. For simplicity, we also say that this is a factor-ρ approximation algorithm for Π. We first introduce the concept of a triangle strip (tristrip). A triangulation T with n triangles is a tristrip if there exists a vertex sequence v1 , v2 , ..., vn+2 , possibly with repetition, such that the n triangles of T are exactly given by the triples of the consecutive vertices of the sequence. A tristrip s1 overlaps another tristrip s2 if a triangle is encoded in both s1 and s2 ; otherwise, we say that s1 and s2 are disjoint. In Fig. 1, we show two overlapping tristrips: s1 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and s2 = 12, 11, 6, 4, 5, 3, 14, 13. Finding the minimum

92

M. Jiang et al.

Fig. 1. An example of two tristrips.

number of (disjoint) tristrips that encode T is an interesting research topic, since this can reduce the transmit and rendering time in graphics and visualization. The k-STRIPABILITY problem is defined as follows: Instance: Given a triangulation T of n triangles, a positive integer k. Problem: Does there exist k disjoint tristrips whose union is exactly T ? As this problem is NP-complete [6], we will try to find an approximation algorithm for it (approximating the smallest k). Our second problem Geometric Tiling with Fixed-size Boxes to Minimize Connected Components (BOX-TILE-#CC) is defined as follows: Instance: Given a n × n binary array M , integers B, W > 0 and 2 ≤ h ≤ n. Problem: Does there exist at most B disjoint h × h boxes that cover all the 1’s in M and the total number of connected components within individual boxes is at most W ? Note that in this problem we have two criteria for optimization: the number of boxes B and the total number of connected components W (W stands for “Weight”). Let the optimal solutions of BOX-TILE-#CC for these two criteria be OP TB and OP TW respectively. We say that a bi-criteria approximation algorithm provides a performance guarantee of (α, β) for BOX-TILE-#CC if for every instance I of BOX-TILE-#CC, the solution value returned by the approximation algorithm uses at most α × OP TB boxes and the total number of connected components within these boxes is at most β × OP TW . In the next two sections, we present details of our approximations for these two problems.

2

Approximation Algorithm for Decomposing a Triangulation into Tristrips

In this section we will present an approximation algorithm for computing the minimum number of tristrips that encode T . Recall that the k-STRIPABILITY

Approximations

93

problem is defined as deciding whether T can be partitioned to a minimum number of k tristrips. Our approximation is based on an approximate solution for a slightly different problem, namely, finding the minimum number of tristrips that cover a triangulation T . We call the latter problem Minimum Strip Covering (MSC). Clearly, in MSC two tristrips might overlap. We first discuss the special case for k-STRIPABILITY when k = 1. It is easy to have the following lemma. Lemma 1. Given any triangulation T , we can decide the 1-STRIPABILITY of T in linear time. Proof. Pick an arbitrary triangle vi vj vk from T . From the definition of tristrip, we can clearly see that, if there exists a single tristrip that encodes T , then at least one of three subsequences vi vj vk , vj vk vi , and vk vi vj , or its reversal, has to appear in the tristrip sequence. For each subsequence, we can “grow” it from both ends to recover the whole sequence. It is crucial to notice that, at each step of the growth, the next vertex to visit is automatically decided by the previous two vertices; therefore it takes linear time recover the tristrip sequence if it exists.   We now present the details of a factor-O(log n) approximation algorithm for the MSC problem. Our approximation uses the same greedy method for approximating the Set Cover problem, so we first briefly introduce the Set Cover problem, which is defined as follows: Given a set X, and a set F which is a family of subsets of X, find a subset C of F with minimum cardinality such that every member of X is contained in at least one member of C (which is a subset of X). It was proved [4,8,12] that, by using a greedy method to find each maximal subset that covers the maximum number of uncovered elements, an O(log |X|)-factor approximation algorithm can be obtained. We can look at the MSC problem from another perspective: a triangulation T is a set X of triangles, and a tristrip is a subset of X. Our goal is to find the smallest subset C from the family of all tristrips F , such that every triangle in X is contained in at least one tristrip in C. This is exactly a Set Cover problem, for which a factor-O(log |X|) approximation algorithm is already known. In order to implement the set cover algorithm, we need to decide a proper X and F . X is naturally the set of all the triangles in the triangulation. F has to contain all the possible tristrips in the triangulation and seems difficult to compute; however, since two tristrips are allowed to overlap in MSC, we only need to consider maximal tristrips (i.e., no tristrip is completely contained in another). Starting from each triangle in T , we can find at most three maximal tristrip, using the method outlined in Lemma 1; we collect these tristrips in set F . We then apply the greedy method to find an approximate minimum cover A. Let the optimal solution value for the MSC problem be C ∗ and let the optimal solution value for the k-STRIPABILITY problem be K ∗ . Our approximation for MSC has a solution value of |A|, which satisfies |A| ≤ O(log n) · C ∗ ; in other words, we can cover T using at most O(log n) · C ∗ tristrips.

94

M. Jiang et al.

To convert our approximation for MSC to an approximation for k-STRIPABILITY, first note that C ∗ ≤ K ∗ . The reason is that a decomposition solution is always a solution for the corresponding covering problem but not vice versa. Second, it is easy to see that a solution of |A| tristrips for MSC can be converted to O(|A|K ∗ ) disjoint tristrips. For any two tristrips t1 and t2 from A such that t1 overlaps t2 , we decompose them into disjoint sets of tristrips: t1 − t1 ∩ t2 , t2 − t1 ∩ t2 , and t1 ∩ t2 (t1 ∩ t2 might contain more than one intersection). For each intersection in t1 ∩t2 , we must use at least one tristrip in the optimal solution for k-STRIPABILITY, i.e., each tristrip in our approximation solution for MSC can be decomposed into at most O(K ∗ ) pieces. Therefore, this decomposition from the |A| tristrips, possibly overlapping, introduces at most O(|A|K ∗ ) disjoint tristrips, which presents a natural solution for k-STRIPABILITY. To determine the approximation factor, we check the approximation A obtained for MSC. If |A| ≥ log n·nx (x is to be determined), then log n·nx ≤ |A| ≤ O(log n)C ∗ ≤ O(log n)K ∗ , hence K ∗ ≥ C ∗ ≥ c1 nx (c1 is some constant). As the converted approximation for k-STRIPABILITY is at most O(|A|K ∗ ) = O(n), 1−x the approximation factor is at most O(n) ) in this case. Otherwise, c1 nx = O(n x ∗ x ∗ if |A| ≤ log n · n , then |A|K ≤ log n · n · K . Therefore, the approximation factor for the latter case is at most O(log n · nx ). To obtain the right x, we set log n n1−x = log n · nx , which gives us x = 12 − log . Consequently the overall √ 2 log n approximation factor of this algorithm is O( n log n). It is clear that the running time of our approximation algorithm is O(n2 ). We summarize our result in the following theorem. Theorem 1. Given any triangulation T with n triangles, there is a factor√ O( n log n) approximation that runs in O(n2 ) time for the k-STRIPABILITY problem. It is interesting to see whether this approximation factor can be further improved. The graph version of this problem (interesting enough, the next problem too!) is not approximable within a factor of O(|V |θ ), 0 < θ < 1, unless P=NP: Given a set of |V | red and blue intervals, and the corresponding intersection graph G with |V | vertices, the problem of computing the smallest number of independent red vertices that dominate all blue vertices cannot be approximated within a factor of O(|V |θ ), 0 < θ < 1, unless P=NP [5]. Of course, our problem contains extra geometric information which probably explains why this √ O( n log n) approximation factor is achievable.

3

Fixed-Size Geometric Tiling to Minimize Connected Components

Given a binary matrix, we first consider a slightly different problem called BOXTILE, namely, the problem of covering the 1-elements in M using the minimum number of disjoint fixed-size boxes. It is shown [7] that BOX-TILE is NP-complete. Let the optimal solution of BOX-TILE be OP T# . We will first present an approximation for BOX-TILE with the following lemma.

Approximations

95

Lemma 2. There is an O(M ) time, factor-2 approximation for BOX-TILE. Proof. We use a striping method. First consider the first h rows of M and use a simple linear scan to cover all the one’s in them such that no two boxes overlap. This is essentially a 1D problem and can be solved optimally by greedy method. We then repeat this process every h rows until all the one’s in M are covered. Let the minimum number of boxes used for each strip be Ni , i = 1, 2, . . . , n/h ; the total number of boxes used is i Ni . Clearly, every box in an arbitrary tiling for BOX-TILE intersects at most two strips. If we duplicate each box in the optimal solution that intersects two strips, and push one copy into the upper strip and the other copy into the lower strip, the result is a valid covering. We can then rearrange the boxes in each strip to avoid overlapping and obtain a tiling, the total number of boxes in which is at least i Ni . Therefore, we have  Ni ≤ 2OP T# . i

  Notice that if we are willing to increase the running time of our approximation, BOX-TILE can be approximated within factor (2 − h1 ) of optimal. Without loss of generality, we assume that the 1 entries are at least h cells away from the upper and lower boundaries of M . The basic idea is to use h shifted applications of the striping method. For each offset from 1 to h, we generate a shifted striping pattern: the pattern for offset 1 has strip rows [1, h], [h + 1, 2h], . . . ; the pattern for offset 2 has strip rows [2, h + 1], [h + 2, 2h + 1], . . . ; and so on. Let AP P# be the minimum total number of tiles among our approximation solutions for these patterns. We claim that AP P# ≤ (2 −

1 )OP T# . h

To prove our claim, consider the OP T# tiles in the optimum solution of BOXTILE. By the Pigeonhole principle, at least one shifted striping pattern is guaranteed to have at least OP T# /h tiles that fall exactly with its strips. Applying the doubling procedure to the remaining tiles yields a solution to the striprestricted problem using at most (2 − h1 )OP T# tiles. Since AP P# is optimal over all strip-restricted sub-problems, this finishes the proof for the following lemma. Lemma 3. There is an O(hM ) time, factor-(2 − h1 ) approximation for BOXTILE. We now describe our approximation for BOX-TILE-#CC. For simplicity, in the following we always use the simple one-round striping method (Lemma 2) as a subroutine; clearly, all the following results can be improved if the h-round striping method (Lemma 3) is used instead. Theorem 2. There is a (2, 4h − 3)-approximation for BOX-TILE-#CC.

96

M. Jiang et al.

Proof. We simply use the result in Lemma 2 as our approximation for OP TB . As OP T# ≤ OP TB , we have  Ni ≤ 2OP T# ≤ 2OP TB . i

We now consider the connected components within each box in our approximation. Since a h × h box has 4h − 4 boundary elements, we have at most 2h − 2 connected components that “touch” the boundary, i.e., every other element along the boundary is a 1-element and each belongs to a different connected component within the box. The total number of these connected components is at most  (2h − 2) Ni ≤ (4h − 4)OP T# ≤ (4h − 4)OP TB . i

As OP TW ≥ OP TB , we have (2h − 2)



Ni ≤ (4h − 4)OP TW .

i

For those connected components not touching the box boundaries, it is easy to see that their total number is at most OP TW , since each of them contributes at least one in the total number of connected components in any tiling. Therefore, the total number of connected components in our approximation is at most (4h − 3)OP TW .   In the case when the 1’s in M are connected, every connected component in any tiling must touch the box boundaries (except for the uninteresting case where all the 1’s in M can be covered by a single box, which can be found by our h-round method outlined in Lemma 3). Therefore we have the following corollary. Corollary 1. If the 1-elements in M are connected, then there is a (2, 4h − 4) approximation for BOX-TILE-#CC. We believe that for most data sets encountered in practice our algorithm actually presents a better approximation, as implied in corollary above. This has been partially verified by some empirical results [15] obtained on small-size random data (whose optimal solutions can be computed). We plan to obtain empirical results over real data actually used in practice and the details will be presented later. Finally, we summarize the hardness result for BOX-TILE-#CC. Due to the space limitation, the proof will be covered in the final version of this paper. Theorem 3. BOX-TILE-#CC is NP-complete; moreover, it is impossible to obtain a γ-approximation for OP TW , where γ > 1 is some fixed constant, unless P=NP. Note that if the boxes are allowed to have overlaps then we are again back to the weighted SET-COVER problem, and a factor-O(log h) approximation is easy

Approximations

97

to obtain [4]. We believe that, with a simple heuristic, we might obtain better approximations for both BOX-TILE and BOX-TILE-#CC. The idea is to check pairs of neighboring boxes from adjacent strips (as computed from Lemma 2 or 3), and determine whether the 1-elements in both boxes can be jointly covered by a single box (across two strips).

4

Concluding Remarks

√ In this paper we obtain a factor-O( n log n) approximation for the k-STRIPABILITY problem and a bi-criteria factor-(2, 4h − 4) approximation for the BOX-TILE-#CC problem. Several questions remain unanswered: (1) For the kSTRIPABILITY problem, whether we can have an approximation with a factor significantly better than O(n1/2 ) is still open. In fact, little is known about the topological characteristic of an optimal solution for k-STRIPABILITY. So far we only know that a tristrip is formed by making alternative left and right turns along edges of the input the triangulation. More study is necessary for this problem. Another related open problem for k-STRIPABILITY is to decompose a triangulation T with the minimum number of Hamiltonian triangulations [1]. (2) For the BOX-TILE-#CC problem, when the image stored in M is a tree, can we exploit this fact to either improve the approximation factor further or show that such an improvement is impossible? As we have mentioned at the end of Section 2, for the graph versions of the k-STRIPABILITY and BOX-TILE-#CC problems, the corresponding problem of Minimum Independent Dominating Set on Bichromatic Circle Graphs is not approximable within a factor of O(|V |θ ), 0 < θ < 1, unless P=NP [5]. So our approximation factors for k-STRIPABILITY and BOX-TILE-#CC (when h = o(n)) have already broken this barrier. Of course, our problems contain extra geometric information and are not exactly the same as the corresponding graph problems. Acknowledgment. We thank Xun He for discussion on the k-STRIPABILITY problem.

References 1. Esther M. Arkin, Martin Held, Joseph S. B. Mitchell, and Steven Skiena. Hamiltonian triangulations for fast rendering. The Visual Computer, 12(9):429–444, 1996. 2. Piotr Berman, Bhaskar DasGupta, and S. Muthukrishnan. Slice and dice: a simple, improved approximate tiling recipe. In Proc. 13th ACM-SIAM Symposium on Discrete Algorithms (SODA’02), pages 455–464, 2002. 3. Piotr Berman, Bhaskar DasGupta, S. Muthukrishnan, and Suneeta Ramaswami. Improved approximation algorithms for rectangle tiling and packing. In Proc. 12th ACM-SIAM Symposium on Discrete Algorithms (SODA’01), pages 427–436, 2001. 4. Vaˇsek Chv´ atal. A greedy heuristic for the set-covering problem. Math. Oper. Res., 4:233–235, 1979.

98

M. Jiang et al.

5. Mirela Damian-Iordache and Sriram V. Pemmaraju. Hardness of approximating independent domination in circle graphs. In Proc. 10th Annual International Symposium on Algorithms and Computation (ISAAC’99), LNCS 1741, pages 56–69, 1999. 6. Regina Estkowski, Joseph S. B. Mitchell, and Xinyu Xiang. Optimal decomposition of polygon models into triangle strips. In Proc. 18th ACM Symposium on Computational Geometry (SoCG’02), pages 254–263, 2002. 7. Robert J. Fowler, Mike Paterson, and Steven L. Tanimoto. Optimal packing and covering in the plane are NP-complete. Information Processing Letters, 12(3):133– 137, 1981. 8. David S. Johnson. Approximation algorithms for combinatorial problems. Journal of Computer and System Sciences 9(3):256–278, 1974. 9. G. Jacobs and F. Theunissen. Functional organization of a neural map in the cricket cercal sensory system. Journal of Neuroscience, 16(2):769–784, 1996. 10. G. Jacobs and F. Theunissen. Extraction of sensory parameters from a neural map by primary sensory interneurons. Journal of Neuroscience, 20(8):2934–2943, 2000. 11. Sanjeev Khanna, S. Muthukrishnan, and Mike Paterson. On approximating rectangle tiling and packing. In Proc. 9th ACM-SIAM Symposium on Discrete Algorithms (SODA’98), pages 384–393, 1998. 12. L´ aszl´ o. Lov´ asz. On the ratio of optimal integral and fractional covers, Discrete Mathematics 13:383–390, 1975. 13. S. Paydar, C. Doan, and G. Jacobs. Neural mapping of direction and frequency in the cricket cercal sensory system. Journal of Neuroscience, 19(5):1771–1781, 1999. 14. Adam Smith and Subhash Suri. Rectangular tiling in multi-dimensional arrays. In Proc. 10th ACM-SIAM Symposium on Discrete Algorithms (SODA’99), pages 786–794, 1999. 15. Andrew Tomascak. Fixed-size Geometric Covering to Minimize the Number of Connected Components. M.Sc. Thesis, Department of Computer Science, Montana State University, 2003.

Suggest Documents