0% found this document useful (0 votes)
36 views

Paper 9

This document summarizes a presentation given at EuroCG 2016 about covering polygons with rectangles. It introduces the problem of finding the minimum number of rectangles needed to cover a set of polygons, where the rectangles can be translated or undergo general motions of translation and rotation. It defines key terms like packing and cover. It also presents some useful properties, like showing that removing a rectangle from an optimal cover results in an optimal cover for the remaining polygons. These properties help reduce the search space for finding optimal covers computationally.

Uploaded by

wongtheenguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Paper 9

This document summarizes a presentation given at EuroCG 2016 about covering polygons with rectangles. It introduces the problem of finding the minimum number of rectangles needed to cover a set of polygons, where the rectangles can be translated or undergo general motions of translation and rotation. It defines key terms like packing and cover. It also presents some useful properties, like showing that removing a rectangle from an optimal cover results in an optimal cover for the remaining polygons. These properties help reduce the search space for finding optimal covers computationally.

Uploaded by

wongtheenguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EuroCG 2016, Lugano, Switzerland, March 30–April 1, 2016

Covering Polygons with Rectangles


Roland Glück∗

Abstract

A well-known and well-investigated family of hard op-


timization problems concerns variants of the cutting
stock or nesting problem, i.e. the non-overlapping
placing of polygons to be cut from a rectangle or the
plane whilst minimizing the waste. Here we consider
an in some sense inverse problem. Concretly, given
a set of polygons in the plane, we seek the minimum Figure 1: The bottom side of the gripper
number of rectangles of a given shape such that every
polygon is covered by at least one rectangle. As mo-
tions of the given rectangle we investigate the cases the further course. A generic approach to the prob-
of translation and of translation combined with rota- lems is presented in Section 4, while Section 5 deals
tion. with some implementation issues and provides exper-
imental results. The finishing Section 6 gives a short
summary and directions of future work.
1 Introduction

In manufacturing, one often faces the problem of cut- 2 Definitions


ting a set of given polygons out of a piece of material
(e.g. sheet metal or cloth) in a way which produces as In order to formalize our task we introduce the con-
less waste as possible. In this paper we investigate the cept of a packing: a packing P = {P1 , P2 , . . . , Pn } is
subsequent step in production technology: once the a set of n possibly overlapping simple polygons P1 ,
pieces are cut out they will be picked off and trans- P2 , . . ., Pn . Clearly, |P| denotes the number of poly-
ported by a suitable device. Here we restrict ourselves gons of P, and we use the notation kPk for the overall
to a rectangular gripper and various degrees of free- number of vertices in P. We say that a packing P is
dom: The first case is a rectangular gripper which can covered by a set C = {R1 , R2 , . . . , Rm } of rectangles
be translated both in x- and y-direction; the second if each polygon of P is contained in at least one rect-
case deals with a rectangular gripper which addition- angle of C. If a rectangle R′ arises from a rectangle R
ally has the possibility of being rotated. The concrete by a translation we call R′ a translation of R, and if R′
motivation of this paper is a machine which cuts poly- arises from R by a translation and a rotation we say
gons out of a carbon fiber fabric and grasps the cut that R′ is a general motion of R (this is equivalent to
pieces with a rectangular gipper with vacuum suction the term “rigid motion” in [2]). With these namings
devices. we can define the main theme of our investigations:
Basically, this task corresponds to covering a set
of polygons by copies of a rectangle such that every Definition 1 Let P be a packing and R an axis-
polygon is contained in at least one rectangle. There aligned rectangle (the so-called gripper). We call a set
is a lot of work about covering sets of points with of rectangles C = {R1 , R2 , . . . , Rm } a translational
rectangles as in [4, 6] but none of them matches our (general) cover of P if C covers P and all rectangles
problem. Due to the NP-hardness of all these prob- of C are translations (general motions) of R.
lems (see [5] for a comprehensive list) we suspect that
the problems we consider are also NP-hard. We do Since we are interested in covering a packing with
not propose an approximation algorithm but a fam- as few as possible rectangles we call a cover of every
ily of exact algorithms which works well on practical kind optimal if it has minimal cardinality amongst all
instances. covers of the respective kind. To ease wording we refer
The paper is organized as follows: Section 2 pro- by the term cover to both a translational or general
vides definitions and states the problem in a generic cover. For a packing P and a rectangle R we denote
way. In Section 3 we prove some useful lemmata for the set of polygons of P covered by R by cov(R, P).
We extend this S notion to a set R of rectangles by
∗ German Aerospace Center [email protected] cov(R, P) := R∈R cov(R, P).

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

Figure 2: Translational Alignments

3 Basic Facts and Observations


Figure 3: General Motion Alignments
In general, the set of covers of a given packing is un-
countable so we will have to discretize the search space Note that we do not require that p1 and p2 , P1 and
in a suitable manner. As tools for reducing the num- P2 as well as Rj and Rj′ are distinct. Moreover, if p1
ber of coverings to consider for computation we state and p2 are equal then they coincide with the upper
some useful properties and lemmata. The first lemma left vertex of Rj′ .
which holds for both translational and general cov-
ers will pave the way for a recursive approach to our Proof. Let p1 be a point of P with minimal x-
problem: coordinate and P1 a polygon of P which has p1 as
a vertex. Then there is a rectangle Rj ∈ C contain-
Lemma 1 Let P be a packing, C an optimal cover of ing P1 . Now we translate Rj in positive x-direction
P and Rj an arbitrary rectangle of C. Then C\{Rj } till p1 lies on the left side of the translated rectangle
is an optimal cover of P\cov(Rj , P). R̂j . Clearly, we have cov(R̂j , P) ⊇ cov(Rj , P). Sub-
sequently, we translate R̂j in negative y-direction till
Proof. Assume there is a cover C′ of P\cov(Rj , P) a point p2 with the following properties lies on the
with |C′ | < |C| − 1. Then C′ ∪ {Rj } is a cover of upper side of the translated rectangle Rj′ :
P with a size of |C′ | + 1 < |C| which contradicts the 1. All polygons of P with p2 as a vertex contained
optimality of C.  in R̂j are contained in Rj′ , and

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

1. Rj′ contains Ppi , Now, after possibly necessary renamings, p1 , p2 and


p3 together with Rj′ meet the requirements of the
2. p1 and p2 are distinct and lie on two different lemma. 
adjacent sides of Rj′

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.

5. C\{Rj } ∪ {Rj′ } is an optimal general cover of P.


4 General Approach
Proof. Let Rj ∈ C be a rectangle containing Ppi . We
apply to Rj similar translations as in Lemma 2 but We will now introduce an exact generic algorithm for
do not translate in x- and y-direction but in directions the minimal cover problem. For the sequel we fix a
parallel to adjacent sides of Rj . Doing so, we end up rectangle R which we will use as gripper for a trans-
with a rectangle R̂j and two (not necessarily distinct!) lational or general cover of a packing P.
points p1 and p2 with the following properties: Let us assume we have an algorithm
candidate rectangles which determines for every pack-
1. R̂j contains Ppi , ing Q a finite set of translations or general motions of
R such that for every optimal cover C of Q and every
2. p1 and p2 lie on adjacent sides of R̂j , Rcov ∈ C there is an Rcand ∈ candidate rectangles
such that cov(Rcov , Q) ⊆ cov(Rcand , Q) holds.
3. cov(R̂j , P) ⊇ cov(Rj , P), and Together with a function simp cov which computes
4. there are polygons P1 , P2 ∈ P such that for i ∈ an arbitrary cover (which can be done by packing
{1, 2} pi is a vertex of Pi and Pi is contained in each polygon into a rectangle of the gripper’s shape)
R̂j . we can formulate the generic Algorithm 1 whose
correctness is ensured by Lemma 1.
Now we perform a general motion of R̂j combined of
a clockwise rotation and suitable translation which Algorithm 1 Generic Branch and Bound Algorithm
keeps p1 and p2 on their respective sides. There are Require: A Packing P and a Gripper R
two cases: 1: set<rectangle> global cover = simp cov(R, P)
2: int global depth = |global cover|
1. p1 and p2 coincide. Then the described general 3: Branch and Bound(0,∅)
motion is a simple rotation of R̂j around p1 . This Ensure: global cover is an optimal cover of P by R
rotation is continued as long as a point p3 lies on with cardinality global depth
a side of the resulting rectangle Rj′ such that the
following properties hold:
4: function Branch and Bound(int depth,
(a) Rj′ contains Ppi , set<rectangle> rectangles)
5: if rectangles covers P then
(b) there are polygons P1 , P3 ∈ P such that for 6: global depth = depth
i ∈ {1, 3} pi is a vertex of Pi and Pi is con- 7: global cover = rectangles
tained in Rj′ , and 8: else if depth < global depth then
(c) cov(Rj′ , P) ⊇ cov(R̂j , P). 9: set<rectangle> candidate rectangles =
10: candidate rectangles(P\cov(rectangles, P))
2. p1 and p2 are distinct. Here we continue the gen- 11: for all R ∈ candidate rectangles do
eral motion till one of the following two cases Branch and Bound(depth + 1,
concerning the arising rectangle Rj′ occurs: rectangles ∪ {R})
12: end for
(a) p1 or p2 coincide with a vertex of Rj′ , or 13: end if
(b) there is a point on a side of Rj′ such that 14: end function
i. Rj′ contains Ppi ,
ii. there are polygons P1 , P2 , P3 ∈ P such Depending on whether one is interested in an
that for i ∈ {1, 2, 3} pi is a vertex of Pi optimal translational or general cover the function
and Pi is contained in Rj′ , and candidate rectangles has to be implemented in differ-
ent ways. Some possibilities are described in the next
iii. cov(Rj′ , P) ⊇ cov(R̂j , P). section.
32nd European Workshop on Computational Geometry, 2016

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

You might also like