Paper 9
Paper 9
Abstract
This is an extended abstract of a presentation given at EuroCG 2016. It has been made public for the benefit of the community and should be considered a
preprint rather than a formally reviewed paper. Thus, this work is expected to appear in a conference with formal proceedings and/or in a journal.
32nd European Workshop on Computational Geometry, 2016
In the next lemma we give a first step towards dis- 2. p2 is a point with maximal y-coordinate fulfilling
cretization of the search space in the case of a trans- the above requirements.
lational cover: Then we have cov(Rj′ , P) ⊇ cov(R̂j , P) ⊇ cov(Rj , P),
so C\{Rj } ∪ {Rj′ } is indeed an optimal translational
Lemma 2 Let P be a packing and C = cover of P. Moreover, p1 , p2 and P1 meet their re-
{R1 , R2 , . . . , Rm } an optimal translational cover of P. quirements by construction, and for P2 we can choose
Then there are points p1 and p2 of P and an index an arbitrary polygon with p2 as a vertex which is con-
j together with an axis-aligned rectangle Rj′ fulfilling tained in Rj′ .
the following properties:
The general situation is depicted in the left part of
1. p1 has minimal x-coordinate amongst all points Figure 2: Rj correponds to the dotted rectangle, R̂j
of P, to the dashed one, and the final rectangle Rj′ is drawn
with a full line. A pathological example where p1 and
2. p1 lies on the left side of Rj′ , p2 as well as P1 and P2 coincide can be seen in the
right part of the same figure.
3. p2 lies on the upper side of Rj′ , A similar property can be stated for general covers
(this and the previous lemma show some similarity to
4. there are polygons P1 , P2 ∈ P such that for i ∈ the term “stable placement” in[1]):
{1, 2} pi is a vertex of Pi and Pi is contained in
Rj′ , and Lemma 3 Let P be a packing and C an optimal gen-
eral cover of P. Then for every polygon Ppi ∈ P there
5. C\{Rj } ∪ {Rj′ } is an optimal translational cover are points p1 , p2 and p3 of P and an index j together
of P. with a rectangle Rj′ fulfilling the following properties:
EuroCG 2016, Lugano, Switzerland, March 30–April 1, 2016
3. p1 , p2 and p3 lie on sides of Rj′ , The general situation is shown in the lower left part
of Figure 3: the dotted rectangle corresponds to Rj ,
4. there are polygons P1 , P2 , P3 ∈ P such that for the dashed one to R̂j and the fully lined to Rj′ . An
i ∈ {1, 2, 3} pi is a vertex of Pi and Pi is contained extreme situation is illustrated by the upper right part
in Rj′ , of the same figure.
P P P
Algorithm 1 is an exact algorithm so we cannot ex- to contain all polygons of {Pi pi , Pj pi , Pk pi } which is
pect a polynomial running time. In the worst case, equivalent to it that it contains the convex hull of
there are O(|P|2|P| ) calls of Branch and Bound. these polygons. A crucial point is the choice of the
As we will see in the next section, the candidate rect- polygon Ppi from Lemma 3 as pivot polygon in or-
angles can be computed in O(kPk) time for the trans- der to keep the branching degree of the algorithm at
lational and in O(kPk)3 time for the general case. a low level. Experiments showed that a good choice
for the pivot polygon is a polygon which has minimal
5 Implementation Sketch and Experimental Re- distance to a vertex of an axis parallel rectangular
sults minimal bounding box of P′ .
As one would expect, our experiments indicated
A short look at Algorithm 1 reveals that a BFS in the a running time cubic in the overall number of ver-
induced search graph will lead to a faster implemen- tices and roughly exponential in the number of poly-
tation. As usual, the drawback of this approach is a gons. Our implementation in Java solved instances
greater amount of space required during the compu- from practice with 25 polygons and 1250 vertices in
tation. We implemented both versions and observed about 20 minutes on average in the same environment
that the BFS approach fits our practical problems bet- as above.
ter.
Lemmata 2 and 3 provide methods for computing 6 Conclusion and Outlook
the set canditate rectangles in Line 9 of Algorithm 1.
In the case of a translational cover we observe that Our algorithm seems to be applicable to practical in-
a translation of a rectangle is uniquely determined by stances. However, there is room for further improve-
the position of its upper left vertex. Moreover, given ments. In our setting the algorithm was run on only
two distinct points, there at most one translations one core which is clearly not optimal since it is obvi-
which make the two points lie on adjacent sides ac- ously easy to construct a parallelized version. Another
cording to Lemma 2. In the sequel we will concentrate idea is to compare other strategies than described
on the general cover problem because our gripper can above for finding the pivot polygon. From a theo-
also be rotated around the z-axis. Nevertheless, we retical point of view, it will be interesting to show the
implemented our algorithm for the translational cover conjectured NP-completeness of our problems.
and could solve instances with 25 polygons and 1250
vertices in less than a second on an Intel i7-4770 CPU Acknowledgments
with 3.4 GHz.
Similarly, each pair or triple of distinct point gives The author is grateful to Torben Hagerup, Christian
raise to only a finite number of general motions Rähtz, Lev Sorokin and the anonymous reviewers for valu-
of given rectangle meeting the requirements from able hints and remarks.
Lemma 3. So we iterate over the points or pairs or
triples of points from the packing under consideration References
(concretely P\cov(rectangles, P) in Line 9 of Algo-
rithm 1) and determine all motions of R which fulfill [1] Chazelle, B.: The polygon containment problem. Ad-
the conditions of Lemma 2 or 3, resp. Of course, it vances in Computing Research, 1–33. JAI Press (1983)
suffices to keep only those rectangles which cover a [2] Dickerson, M., Scharstein, D.: Optimal placement
maximal set of polygons. of convex polygons to maximize point containment.
We refined this approach by the following idea: Computationl Geometry 11(1), 1–16 (1998)
first, for every polygon P from the initial nesting, we [3] Dowsland, K.A.: Determining an upper bound for a
generate a list P1P , P2P , . . . , Pm
P
of compatible poly- class of rectangular packing problems. Computers &
gons which can be covered by the given gripper to- OR 12(2), 201–205 (1985)
gether with P . Second, we use these lists to com- [4] Fowler, R.J., Paterson, M., Tanimoto, S.L.: Optimal
pute the candidate rectangles for a packing P′ aris- packing and covering in the plane are np-complete. Inf.
ing during the execution as follows: we choose a Process. Lett. 12(3), 133–137 (1981)
pivot polygon Ppi from P′ and iterate over all triples [5] Garey, M.R., Johnson, D.S.: Computers and In-
P P P
(Pi pi , Pj pi , Pk pi ) of compatible polygons of Ppi with tractability: A Guide to the Theory of NP-
i ≤ j ≤ k. For every such triple we compute the con- Completeness. W. H. Freeman (1979)
vex hull and determine for every tuple respectively [6] Hochbaum, D.S., Maass, W.: Approximation schemes
triple of points of the convex hull the rectangles ac- for covering and packing problems in image processing
cording to Lemma 3. As mentioned above, we only and VLSI. J. ACM 32(1), 130–136 (1985)
keep the rectangles covering a maximal set of poly-
gons. The restriction to the points of the convex hull
is justified by the fact that the covering rectangle has