Abstract
Let \(P\) and \(Q\) be two simple polygons in the plane of total complexity n, each of which can be decomposed into at most k convex parts. We present a \((1-\varepsilon )\)-approximation algorithm, for finding the translation of \(Q\), which maximizes its area of overlap with \(P\). Our algorithm runs in \(O\left( {c n}\right) \) time, where c is a constant that depends only on k and \(\varepsilon \). This suggests that for polygons that are “close” to being convex, the problem can be solved (approximately), in near linear time.
Similar content being viewed by others
References
Ahn, H.K., Cheng, S.W., Kweon, H.J., Yon, J.: Overlap of convex polytopes under rigid motion. Computat. Geom. Theory Appl. 47(1), 15–24 (2014). doi:10.1016/j.comgeo.2013.08.001
Ahn, H.K., Cheng, S.W., Reinbacher, I.: Maximum overlap of convex polytopes under translation. Computat. Geom. Theory Appl. 46(5), 552–565 (2013). doi:10.1016/j.comgeo.2011.11.003
Ahn, H.K., Cheong, O., Park, C.D., Shin, C.S., Vigneron, A.: Maximizing the overlap of two planar convex sets under rigid motions. Computat. Geom. Theory Appl. 37(1), 3–15 (2007)
Alt, H., Fuchs, U., Rote, G., Weber, G.: Matching convex shapes with respect to the symmetric difference. Algorithmica 21, 89–103 (1998). http://citeseer.nj.nec.com/267158.html
Alt, H., Guibas, L.J.: Discrete geometric shapes: matching, interpolation, and approximation. In: Sack, J.R., Urrutia, J. (eds.) Handbook of Computational Geometry, pp. 121–153. Elsevier, Amsterdam (2000)
Avis, D., Bose, P., Toussaint, G.T., Shermer, T.C., Zhu, B., Snoeyink, J.: On the sectional area of convex polytopes. In: Proceedings of the 12th Annual Symposium on Computational Geometry SoCG, pp. 411–412 (1996)
Barequet, G., Har-Peled, S.: Efficiently approximating the minimum-volume bounding box of a point set in three dimensions. J. Algorithms 38, 91–109 (2001). http://cs.uiuc.edu/~sariel/research/papers/98/bbox.html
Barequet, G., Har-Peled, S.: Polygon containment and translational min-hausdorff-distance between segment sets are 3sum-hard. Int. J. Comput. Geom. Appl. 11(4), 465–474 (2001)
Brodal, G.S., Jacob, R.: Dynamic planar convex hull. In: Proceedings of the 43th Annual IEEE Symposium on Foundations of Computer Science FOCS, pp. 617–626 (2002)
Chazelle, B., Liu, D., Magen, A.: Sublinear geometric algorithms. SIAM J. Comput. 35(3), 627–646 (2005)
Cheng, S.W., Lam, C.K.: Shape matching under rigid motion. Comput. Geom. Theory Appl. 46(6), 591–603 (2013). doi:10.1016/j.comgeo.2013.01.002
Cheong, O., Efrat, A., Har-Peled, S.: On finding a guard that sees most and a shop that sells most. Discrete Comput. Geom. 37(4), 545–563 (2007)
de Berg, M., Cabello, S., Giannopoulos, P., Knauer, C., van Oostrum, R., Veltkamp, R.C.: Maximizing the area of overlap of two unions of disks under rigid motion. In: Scandinavian Workshop on Algorithms. LNCS, vol. 3111, pp. 138–149 (2004)
de Berg, M., Cheong, O., Devillers, O., van Kreveld, M., Teillaud, M.: Computing the maximum overlap of two convex polygons under translations. Theor. Comput. Sci. 31, 613–628 (1998)
Gritzmann, P., Klee, V.: Inner and outer \(j\)-radii of convex bodies in finite-dimensional normed spaces. Discrete Comput. Geom. 7, 255–280 (1992)
Har-Peled, S.: Taking a walk in a planar arrangement. SIAM J. Comput. 30(4), 1341–1367 (2000)
Har-Peled, S.: Geometric approximation algorithms. In: Mathematical Surveys and Monographs, vol. 173. American Mathematical Society, Providence, RI (2011)
Har-Peled, S., Roy, S.: Approximating the maximum overlap of polygons under translation. In: Proceedings of the 22nd Annual European Symposium on Algorithms (ESA), pp. 542–553 (2014)
Har-Peled, S., Roy, S.: Approximating the Maximum Overlap of Polygons Under Translation. CoRR abs/1406.5778. http://arxiv.org/abs/1406.5778 (2014)
Keil, J.M., Snoeyink, J.: On the time bound for convex decomposition of simple polygons. Int. J. Comput. Geom. Appl. 12(3), 181–192 (2002)
Mount, D.M., Silverman, R., Wu, A.Y.: On the area of overlap of translated polygons. Comput. Vis. Image Underst. (CVIU) 64(1), 53–61 (1996). http://www.cs.umd.edu/~mount/Papers/overlap.ps
Sharir, M., Toledo, S.: Extremal polygon containment problems. Comput. Geom. Theory Appl. 4, 99–118 (1994)
Toussaint, G.T.: Solving geometric problems with the rotating calipers. In: Proceedings of the IEEE MELECON ’83, pp. A10.02/1–A10.02/4
Vigneron, A.: Geometric optimization and sums of algebraic functions. ACM Trans. Algorithms 10(1), 4 (2014). doi:10.1145/2532647
Acknowledgments
The authors would like to thank the anonymous referees for their insightful comments. In particular, the improved construction of Lemma 12 was suggested by an anonymous referee.
Author information
Authors and Affiliations
Corresponding author
Appendices
Appendix 1: Proof of Lemma 4
The result of Lemma 4 follows by the work of Ahn et al. [3]. For the sake of completeness we include the details here (our construction is somewhat different).
Proof of Lemma 4
The width of \(P\) is realized by two parallel lines \(\ell _0\) and \(\ell _{m+1}\) at a distance of at most \(\omega \left( {P}\right) \) from each other. These two lines can be computed in linear time using rotating caliper [23] (and one of these two lines must pass through an edge of \(P\)). Similarly, it is easy to compute the two extreme points of \(P\) in the direction of \(\ell _0\). Adding the supporting lines to \(P\) through these points, which are orthogonal to \(\ell _0\), results in a rectangle, that has five vertices of \(P\) on its boundary, and we mark these vertices. Next, we slice this rectangle by m parallel lines \(\ell _1, \ldots , \ell _m\) that are parallel to \(\ell _0\), into \(m+1\) slices of the same width. We mark all the intersections of these lines with \(P\). Next, let \(P^{\prime }\) be the polygon formed by the convex-hull of all the marked points. It is easy to verify that \(P^{\prime }\) can be computed in linear time.
Clearly, \(P^{\prime } \subseteq P\). For any point \(p\in P\), consider the two lines \(\ell _i\) and \(\ell _{i+1}\) that \(p\) is contained between them. Consider the projection of \(p\) into \(\ell _i\) and \(\ell _{i+1}\), denoted by \(p_i\) and \(p_{i+1}\) respectively. If any of these two projections are inside \(P\), then we are done, as this portion of \(P\) is inside \(P^{\prime }\), and the distance of projection is at most \(\omega \left( {P}\right) {/}m\). Thus, the only remaining possibility is that both projections are outside \(P\).
But this implies that \(P\)’s extreme point in the parallel direction to \(\ell \) (or its reverse) must be in \(p\)’s slice. In particular, the segment \(p_i p_{i+1}\) (that includes \(p\)) must intersect \(P\), and furthermore, since the aforementioned extreme point is a vertex of \(P^{\prime }\), it follows that this segments must intersect \(P'\), implying the claim. \(\square \)
Appendix 2: Counter Example for Some Natural Approaches
Here, we present a counterexample to the natural algorithm for our problem: Decompose the two polygons into their convex parts, approximate the parts, and then find the maximum overlap for the two reconstituted polygons.
So, consider the polygon P, depicted in Fig. 5a, and its arch-nemesis Q in Fig. 5b. The optimal overlap placement is depicted in Fig. 5c.
But any naive piecewise approximation of P by pieces will fail, because it creates cavities that might contain the whole overlap. For example, one possible solution for the approximate polygon \(P'\) and the maximum overlap, is depicted in Fig. 5d.
In particular, any placement that makes the approximate polygon \(P'\) cover two of the disks of Q, would fail to cover the third disk of Q. so, in this case, the best approximation suggested by the this algorithm is (roughly) 2/3. This can be made to be arbitrarily bad by enlarging k.
Another Approach That Does Not Work Another natural idea is to pick from each pair of polygons \(P_i\) and \(Q_j\) a set of directions such that if you approximate each pair with these directions than the pair overlap is approximated correctly. Note, however, that if the polygons are of completely different sizes then, inherently, you need unbounded number of directions if the maximum overlap of the original (non-convex polygons) align the pieces far from their piecewise overlap maximum.
Rights and permissions
About this article
Cite this article
Har-Peled, S., Roy, S. Approximating the Maximum Overlap of Polygons under Translation. Algorithmica 78, 147–165 (2017). https://doi.org/10.1007/s00453-016-0152-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-016-0152-9