Minkovski Ghosh1990
Minkovski Ghosh1990
This paper gives a complete solution to the polygon containment problem under translation
and other related problems for all kinds of two dimensional regions. The solution is achieved
in three steps. First, it is shown that the containment and the related problems can be directly
mapped to Minkowski decomposition and addition problems. Minkowski decomposition,
which is intrinsically a geometric problem, is then reformulated in terms of set operations and
set theoretic tools are used to reduce the computational complexity of the problem. Finally, a
new technique, termed as decomposition boundary tracing technique, is devised and employed
for the solution of the decomposition problem. This new technique brings out a unfied
algorithmic approach to solve all kinds of decomposition problems in a two dimensional space,
and thereby the containment problem in its entirety. 0 1990 Academic Press. Inc.
1. INTRODUCTION
Transformation
with the spatial planning problems. Our definition of configuration space, however,
is a more general concept that accommodates both growing as well as shrinking of
objects, since they are just the inverses of each other. Thus the concept of our
configuration space covers a wide range of problems concerning interactions among
objects and their movements in space.
2. In recent years a general method for image processing, known as mathemati-
cal morphology has become exceedingly popular and is growing rapidly as a separate
discipline. Interestingly, Minkowski operations form the kernel of all the mathemat-
ical morphological operations. In fact, two of the morphological operations, known
as dilation and erosion are nothing but Minkowski addition and Minkowski
decomposition, respectively. Although mathematical morphology is primarily con-
cerned with the processing of digital images, in morphological literatures many
results on Minkowski operations were stated for general sets of points in d-dimen-
sional real euclidean space. Therefore, the statements of some of the theorems and
equations presented in Sections 3 and 4.1 in this paper are not completely new.
However, in certain cases, results were stated in morphological literature without
any formal proof. Therefore, we decided to provide separate proofs for all of them
which are also more algebraic in nature. The interested readers may refer to
Matheron [lo], Serra 1121, or Harlick et al. [6] for alternative proofs of some of the
theorems.
3. The proof of the proposed unified theory of decomposition is presented in a
more informal way compared to the proofs of the theorems in the first part of the
paper. It has served a number of useful purposes. First, quite a few interesting
geometric properties of Minkowski decomposition have been unravelled during the
discussion which could not have been done otherwise. Second, we are able to show
how a general approach to polygon decomposition has gradually evolved as we
progressively reduce the constraints on the input polygons. Moreover, the theory of
Minkowski addition was developed rigorously by a number of researchers [4, 10, 5,
31. Since Minkowski decomposition is the inverse of Minkowski addition, it is
possible to formulate more formal proofs of the unified theory of decomposition
along the same line of addition. But we feel it is more appropriate to introduce a
different line of thought and, therefore, do not make use of any of the theorems of
Minkowski addition. The decomposition theory also becomes more self-contained in
that process.
2. BASIC NOTATIONS AND DEFINITIONS
2.1. Notations
The objects we consider in this paper are the sets of points in E = R”, i.e., in
d-dimensional real euclidean space. These sets are generally denoted by capital
letters A, B, S, T, etc. We consider only the compact sets, i.e., which are both
bounded and closed. Any point p in such a set is a vector with d-tuple (xi,. . . , xd).
Most of the results we prove will be applicable for such general sets of points. A
point is generally denoted by a small letter such as a or p or u.
To distinguish between the boundary of a positive region and a hole, the notion
of oriented boundary is introduced in Section 4.
The notations U, n, 1, and ’ are used to denote set union, intersection,
difference, and complement, respectively. The notation “ + ” is used to de-
A SOLUTION OF POLYGON CONTAINMENT 7
A simple example in 2D may clarify the idea. Let B be an elliptical region and T
be an open coplanar cubic curve. If B is considered as a brush and T as a trajectory,
then the resulting figure S is obtained by moving the brush along the trajectory (Fig.
3). This process can also be viewed as growing of the curve T to S, by means of B.
We consider that in Cspace B becomes the reference point r. Note that B @ T in
real space is equal to S @ {r} in Cspace. The same concept is true in higher
dimensions as well.
Minkowski addition of two sets can also be expressed in terms of set union
operation. If A, denotes translate of a set A by the vector p, i.e., A, = A @ ( p},
S=B@T
------
The above relation can be easily proved by using Eq. (1) and Eq. (2). One derivation
of it is given in Ghosh [3]. Readers may also consult Matheron [lo]. It is important
to note here the necessity of the condition S = X $ B for proving the relation. The
necessity arises since we have no concept of independent existence of a negative
region. Therefore, there does not always exist a set X for any B and S such that
S = X 0 B. For example, no Xexists if B is a circle and S is a triangle. Now S 8 B
is supposed to give us the X. If no such X exists, then (S 8 B) $ B cannot be equal
to s.
3. RELATIONSHIP BETWEEN MINKOWSKI OPERATIONS AND CONTAINMENT
AND OTHER RELATED PROBLEMS
We now prove the following relation to establish the connection between the
containment problem and Minkowski operations.
S0B=Feasibleregion= {t: B,cS}. (3)
Proof: Let
XES~B
0 x E VbS-,, where b E B
-Vb(x+b)ES
-B,cS
Thus,
SeB= {t:B&S}.
10 PLJUSH K. GHOSH
i. .
---.y-y---- --
.1
.I
I . ’ . I
vB
;. ’ 7
I ’ . I
I. * I
I. . i
I. . -1 r
(SC)-, = (S-J’.
x E (Q-6
-x+bES’
ox+b4S
@ x 4 S-b
* x E (S-J.
Now.
Therefore,
Proof of Equation (6). The relation can be proved directly from the definition of
Minkowski decomposition. One may also prove it by using Eq. (5).
Now applying Eq. (5) and Eq. (6) in Eq. (4) we obtain
The physical meaning of Eq. (4a) is: if the moving object B becomes a point, the
entire floor space shrinks from S to P and the obstacle grows from H to Q. Figure 6
demonstrates the same fact.
In solving spatial planning problem, researchers, in general, are more interested in
compu$ng the forbidden region around the obstacle H, i.e., in computing Q =
(H 8 B), rather than computing the entire feasible region (P \ Q). Therefore, the
spatial planning problem can be reduced to the following problem.
~OBLEM 2 (Minkowski addition). Given two sets T and B in Rd, compute the sum
set T @ B, where @ denotes Minkowski addition.
12 PIJUSH K. GHOSH
Two polygons T and B intersect if and only if the origin is inside the
sum polygon T CBg.
(See Guibas et al. [5] for more detail.) Note that the intersection problem now
reduces to the point inclusion problem.
Similarly the mirrimum distance between two polygons T and B is the distance of
the polygon (T @ B) from the origin. Therefore, these two problems are essentially
Minkowski addition problem as stated in Problem 2.
Refer to Fig. 7. The set S, shown hatched in the figure, has no hole in it. The
boundary cYBof B is drawn in bold. The topological argument says that if d3 can
be placed within a simply connected set S, it is then possible to continuously shrink
JB up to a point by keeping it always within S. During this topological-shrmking
process the different instances of 6JB covers aU the interior points of B. THUS the
above implication is correct.
A SOLUTION OF POLYGON CONTAINMENT 13
Now,
XES~JB
- (W, c S
* B, c S, provided S is simply connected
ox~S0B.
S 8 L = S 8 {b,, b,}.
Proof. Let L = {b,, b,, . . . , bi, . . . , b,}, where bj denotes any intermediate point
on the line segment. Any b, can be expressed as
Theorem 2 will be proved if we can show that any t E [(S - b,) n (S - b,)] is also
an element of (S - bi).
Let us express t as follows:
be - b, = sk - s,. 0-J)
Let us assume that, t = x - b,, where x is any arbitrary vector. If we can now show
that x E S, then (x - b,), i.e., t becomes an element of (S - bi), and that will
complete the proof of the theorem.
Since,
t=x-bi=s,-b e,
therefore,
S 8 B = S 8 conv(B),
The convex hull conv( B) is the set of all points p which can be written in the form
(known as convex combination form):
where,
Any point p of the convex huh can also be rewritten in the form
P = “lb, + (1 - dp’,
A SOLUTION OF POLYGON CONTAINMENT 15
where,
In fact, it is possible to simplify our problem further. Note the following theorem.
THEOREM 4 (theorem on reduction to vertices). If S and C are both conuex sets,
then
S 0 C = S 0 vert(C),
The rest of the proof then follows from the proof of Theorem 3.
For the purpose of concise representation, we may combine Theorems 3 and 4 by
introducing the notion of the set of extreme points of a set B, usually denoted by
ext( B). Mathematically, ext( B) is the set of vertices of conv( B). See Fig. 8 in which
ext(B) is shown in boldface..
The proposed combined theorem may be stated as follows.
THEOREM 5 (theorem on reduction to extreme points). If S is a conuex set, then
S 0 B = S 0 ext(B),
FIG. 8. The cmv( B) (shown dotted) and ext( B) (shown bold) of a set B.
Al. Conuex-Convex. Here both S and B are convex polygons. Our ap-
proach is different from the conventional ones and our technique is
discussed in detail.
A2. Convex-Simple. S is a convex polygon and B is a simple polygon. In
that case Theorem 3 suggests that first we have to determine the convex
hull of B and then algorithm Al can be used.
A3. Simple-Convex. S is a simple polygon and B is a convex polygon. In
that case an algorithm can be devised by making use of the formula,
S = conv( S ) \ (holes)
= S, \ H.
Since both S, and B are convex, the (S, 6 B) polygon can be obtained
by using the algorithm Al. The polygon (H @ 5) can be obtained using
any of the standard algorithms given in Ghosh, Guibas et al., Schwartz,
etc. [3, 5, 141.
In this paper, however, we take another approach in the line of the
algorithm Al. This algorithm together with algorithm Al finally pave
the way for a unified algorithmic approach to solve all decornp&tkm
problems, i.e., the polygon containment problems in 2-dimenkon.
A SOLUTION OF POLYGON CONTAINMENT 17
A4. Simple-Simple. Here both S and B are simple polygons. The algorithm
we present is derived from the unified approach.
A5. Smooth-Smooth. Instead of polygonal boundaries, we consider both S
and B having smooth boundary curves. This algorithm is briefly pre-
sented, primarily to demonstrate the applicability of the unified ap-
proach beyond polygonal boundaries.
2. Multiply connected polygons. No decomposition algorithm for multiply con-
nected polygons (i.e., polygons that have holes in them) is presented in this paper.
However, we must mention that some of the theorems and results we proved so far
can be effectively used for that purpose. For example, Theorem 3 states that the hole
in B polygon can be ignored during decomposition if S is convex. Similarly, Eq. (4)
can be used if S polygon has a hole in it. (Unfortunately, relationships similar to
Eq. (4) do not hold true if B has holes, since
(a) (b)
direction of its orientation, the region on its “left” is a positive region and on its
“right” is void. In our presentation, hereafter, we assume that all the edges and line
segments are directed without explicitly mentioning this (refer to Fig. 9). A region
and its oriented boundary representation are shown in Fig. 9a. On the other hand,
in Fig. 9b we take an oriented boundary curve and show the region it represents.
Note that the triangular portion at the vertex pr is discarded at the time of region
representation, since its orientation specifies it as a void region. In reality a void
region cannot exist in isolation; it must be always surrounded by a positive region
to make it a hole.
(ii) Anti-supporting line of a conuex j&e. A convex figure F can have two
supporting lines in any given direction. (A supporting line 1 of a convex figure F
passes through a point(s) on the boundary of F such that the interior of F lies
entirely on one side of 1.) If we assign an orientation to the supporting lines, then
one of the two, say I,, will follow the orientation of the boundary curve of F while
the other one, say I,, will be exactly opposite to it (Fig. 10). We call the second one
an anti-supporting line while the first one can be called simply a supporting he.
With respect to the supporting line, the figure F lies on its left, while F lies on the
right of its anti-supporting line. The intersections F n I, and F n I, can be called
supporting point and anti-supporting point, respectively.
4.2.1.2. Basic idea of the algorIt+u. We can now come back to our algorithm.
The situation is as follows. The I? polygon has iV, number of vertices. The S
polygon is placed on every one of those NB vertices. Therefore, corresponding to
every edge, say e, of S, there will be NB number of line segments-all of which are
equal, parallel, and similarly oriented to the edge e, only translated di%rently. We
p, (supporting point)
*--- ----- ----- -- I, (supporting line)
n F
+L.l!-- ----------
pL (anti-supporting point)
IsCanti-supporting line)
(a) (b)
Le, - seg
(cl (d)
may consider all these line segments as one bunch corresponding to the edge e of S.
We call it the e-bunch. For example, refer to the typical example depicted in Fig. lla.
The corresponding situation when S is placed on the vertices of B is shown in Fig.
llb. The e,-bunch corresponding to the edge e, of S consists of iVa line segments
which are shown by bold lines. Clearly, if S has N, edges, there will be N, such
e-bunches corresponding to every of its edges.
A cruci;al obseruation. The line segments in an e-bunch could be obtained by
placing B to the two end points ef the edge e and then joining the corresponding
vertices of the two instances of B. This is demonstrated separately in Fig. llc for
the e,-bunch. This observation will be used later in our algorithm.
Therefore, in order to determine the common intersection of all the instances of
S, our task boils down to:
1. Select from each of the e-bunch, the left-most line segment. We call it the
Le-seg. In general a Le-seg is an oriented line segment of length e. But since S is
convex in this case, we may safely assume that each Le-seg here is an i&rite line
and thereby describes a half plane. The final outcome of this selection step will be
N, number of L.e-segs corresponding to all the edges of S. In Fig. lld they are
shown by bold lines.
2. Find out the intersections among those L.-e-segs.In this particular case, it
will be equivalent to determining the common intersection of the N, half planes
they describe.
20 PIJUSH K. GHOSH
4.2.1.3. First step of the algorithm: Me&ion step. Selecting the Le-segyfrom an
e-bunch is not difficult. The Le-seg must be the anti-supporting line of the B polygon
(or a translated instance of B polygon as shown in Fig. 11~).
The proof of the above statement follows from the argeents given below. If a
l@e segment from the e-bunch is an anti-supporting line of B, then alI the points of
B will be on its right by definition. Therefore all other line segments of the e-bunch
will be also on its right (refer to our observation in a previous paragraph). That
means, that line segment must be the left-most line segment of the lot, i.e., the
Le-seg. On the other hand, if thz L-e-seg is not the anti-supporting line, then there
must be at least one vertex of B that will be on the left of the Le-seg. Therefore,
there will be at least one line segment in the e-bunch that will be on the left of the
L.e-seg. This is clearly a contradiction. Therefore, the Le-seg must be anti-supporting
line.
4.2.1.4. Second step of the algorithm Meme&ion step. Once we obtain these Ns
L-e-segs, the task of step 2, in this particular case, is to find out the common
intersections of the N, half planes described by these lines. This can be done in
O(N, log Ns) time [ll]. However, we can obtain a faster algorithm since these line
segments are parallel to the edges of S and are known, therefore, in slope-sorted
order. This order can be exploited to get an O(N,) algorithm.
Baker et al. [l] indicated an algorithm that indeed takes O(N,) time. We present
here a different algorithm of the same complexity with our ultimate intention of
unifying all decomposition algorithms.
The crux of our algorithm lies in describing these Le-segs through a different
representation scheme which can be termed as a decomposition boundaty tracing
scheme. (The decomposition boundary tracing of a decomposition will be denoted
by the letter D.) The scheme is, essentially, traversing or traciug the Le-segs in a
continuous manner.
The new representation of the L.e-segs through tracing is done as follows. Start
with any of the L.e-segs, say Lq-seg corresponding to the edge e, of S (see Fig. 12
as well as Fig. lld), and move along it following its orientation. According to our
previous argument we can assume that the end points of L.e,-seg lie on the
corresponding anti-supporting point at B (or at its translate), say ul. Try now to
trace the next Le-seg, say Lqseg, and let us assume that its corresponding
A SOLUTION OF POLYGON CONTAINMENT
L!.I!l
23
e2
"1
84 '4
'1
"4
"2 Q '2 ,3
"3
el E,
S
(a) (b)
T= SOB
e5
EXAMPLE I
‘x_
84
e6
23 -B
0
r2- -h
e7
e2 Le,- seg
6 !I
Le, - seg
el T=S@B
ee
S Tracing D
(a) (b) (cl
EXAMPLE II
FIG. 12. Two typical decomposition boundary tracings. (A line segment B must be considered as a
2D rectangle of zero width.)
Surely we have to resolvf a point before proceeding further. We hnd that, in any
tracing D, some edges of B, i.e., the r’-edges are also i$.tded. That happens when
we move from one of tht anti-supporting points at B to another anti-supporting
point along the edges of t. Now in which way should we have to move? Should we
follow the orientation of B or move in the opposite direction? For example, consider
the first example of Fig. 12. In mo+g from ui to u2, we may either move along u~c’~
by following the orientation of B, or we may go along u1u4u3u2, in the opposite
direction.
In the convex-convex case, it is a matter of choice, since both will result into the
same S 8 B as shown in Fig. 12~. Without explaining at this point we state that the
easy rule, as long as B is convex, is to move in the opposite direction.
The easy rule, however, may introduce inefficiency: there may be too many
self-intersections in the decomposition boundary tracing at times; also the total
number of edges in the tracing might become unnecessarily large as demonstrated in
Fig. 12.
The exact rule is as follows. Check whether the direction of turn of one Le-seg to
the next Le-seg in the tracing is clockwise or counterclockwise. Choose that path
along the edges of i where you can follow the same orientation. An explanation
behind the formation of these rules is clarified in Section 5.1. Until we reach that
section, we shall follow the easy rule.
A few immediate observations about decomposition boundary tracing could be
noted now:
(a) A decomposition boundary tracing D is a closed, oriented, nonsimple
(self-crossing) polygon.
(b) The D polygon is essentially a travel along the Le-segs in a continuous
manner. In that respect D may be regarded as a new representation of the Le-segs
as one single polygon.
(c) The positive region, say T, enclosed by the polygony D is the required
common intersection of different instances of S placed on B, i.e., the intended
decomposition S 8 B.
This particular observation is crucial for our future course and therefore may be
clarified a little further. We knew that the positive region T (i.e., the common region
left of all the Le-segs) enclosed by the Le-segs is the required S 0 B. In the <
polygon, in addition to the Le-segs, we have also added some edges of the B
polygon which are denoted as r’edges. Since all the Le-segs are the anti-supporting
lines of B, the polygon 5 (or its translates) will be always on the right of the
L,e-segs. Therefore, no edge of i can go to the left of the Le-segs, and thereby the
positive regioc enclosed by the Le-segs remains unaltered even after including a few
edges of the B polygon.
(d) For convex-convex decomposition, only the Le-segs of D corresponding to
the edges of S contribute to the boundary aT of the positive region T. The total
number of such L.e-segs is N,. In computing T, the f-edges of D appear to be
redundant.
(e) It can be argued that, in the case of convex-convex decomposition, the
polygon D consists of (N, + NB) number of edges corresponding to every of s
and B, provided we follow the exact rule for traversing the edges of i).
A SOLUTION OF POLYGON CONTAINMENT 23
According to our formulation, now the task of step 2 is to find out the
self-intersections of the edges of D, i.e., the intersections of the Le-segs. That will
define the boundary aT of T. We observe that two kinds of situations may happen.
Case I. When all the Le-segs of D are present in the boundary aT (Fig. 12c,
Example I), then step 2 of our algorithm can be accomplished in time O(N,).
Because the task is merely to determine the intersection points between the adjacent
L.e-segs which are given in slope-sorted order.
Ca.se II. When only K out of the N, L.e-segs (K < N,) are present in the
boundary aT (Fig. 12b, Example II), then first we have to identify the (N, - K)
Le-segs that are absent or redundant. To check the redundancy, we may proceed as
follows.
Let Ii-19 Ii, and li+i denote three consecutive Le-segs given in slope-sorted order.
Let the intersection points of the lines I,-, and Ii be a, and that of Zi and li+i be b.
The line ii will be redundant if the direction from a to b does not follow (i.e., is
opposite to) the direction of the line Ii. See Fig. 13.
The logic is easy to see. If the lines ab and Ii are oppositely directed, then the
intersection point c of Ii-i and li+ I must be on the left of Ii. Because if c is on the
right of Zi, then the slope of I,+, (which passes through the points b and c) must be
less than the slope of Ii, and that is a contradiction. Now if the lines liei, li, and
li+i describe respectively the half planes HPi-i, HPi, and HP+i, then the fact that
the point c is on the left of Ii means (HPi-, 17 HPi+,) c HP,. Therefore, HP, (i.e., in
turn li) becomes redundant since the common intersection is nothing but
“ . . - nHPi-, n HP, n HPi+i ... .” Hence by a constant time testing a redundant
Le-seg can be identified and removed. Therefore, the removal of all the redundant
L-e-segs can be done in O(N,) time.
Once we identify only the K number of Le-segs that all are present in the
boundary JT, their self-intersections can be determined in time O(K) by Ending
out the intersection points of the adjacent Le-segs.
Therefore, step 2 can be accomplished in O(N,) time. So the whole algorithm
takes O(N, + NB) time, which is linear.
The technique of this algorithm can be summarized in the following form:
1. Form the decomposition boundary tracing D.
2. Determine the positive region enclosed by D.
We can term this technique as the decomposition bounduly tracing technique, or
simply the D-tracing technique.
24 PIJUSH K. GHOSH
4.2.2.1. Relative supporting line. The first step involves characterization of convex
and simple polygons in terms of a supporting line. Generally a convex polygon is
distinguished from a simple polygon in the following way. For a convex polygon all
its vertices are convex, whereas for a simple polygon only some of its vertices are
convex, the others are reJIex or concave. A vertex is a concave vertex if the internal
angle at the vertex is more than 180’; otherwise it is convex.
We observe that every vertex of a convex polygon can have at least one
supporting (or anti-supporting) line, whereas a vertex, particularly the concave
vertex, of a simple polygon may not have any. Mathematicians, to remedy this
situation, extended the notion of a supporting line, known as a relative supporting
line. A line passing through a point p on the boundary of the figure F can be
considered as a relative supporting line if it is a supporting line not compared with
the whole figure F, but with F in some neighborhood of p. We shall use this general
notion of relative supporting line to tackle the problems with nonconvex figures.
(For convenience, we shall hereafter write simply supporting (or anti-supporting)
line/point to mean relative.)
(a)
(b)
intersected region in that particular direction. On the other hand, any nonconvex
edge e’ of S is a relative supporting line of S within a small neighborhood.
Therefore, unlike the convex case, only a part of the intersected region, and not the
whole, is supposed to lie at the left of the corresponding e’-bunch. And clearly the
corresponding Le’-seg “cannot” be the sole contributing edge in that direction. Fig.
14a demonstrates this situation, where we see that not only the Le’-segs, but all the
segments in each of the two e’-bunches contribute to the intersected boundary at
the vicinity of the concave vertex u. We again may look into this problem in two
parts.
Part A. When B is relative supporting line at o. Let us assume that the line
segment B in our problem is a relative supporting line at the concave vertex u. It is
a typical situation that we have chosen in our example in Fig. 14a. Certainly, in this
case too, the Le’-segs, from each of the two bunches corresponding to the two
nonconvex edges incident on u, contribute to the boundary of the common intersec-
tion. But in addition to these two segments, “some parts” of the other segments of
the two bunches also contribute. But can we characterize those “some parts”? Since
S is placed at every point of B, the vertex u is the only contributing point at any
instant. And the sum total cont+bution is the locus or instances of u as S is placed
continuously at every point of B. And that locus is nothing but the line segment B
itself. This situation is clearly demonstrated in Fig. 14a.
Now if we follow the D-tracing technique, we shall also arrive at the same result.
The resulting D for our example and the enclosed positive region T (which
conforms to S 8 B) is shown in Fig. 15.
26 PIJUSH K. GHOSH
T= SOB
Tracing D
FIG. 15. The decomposition boundary tracing for the example given in Fig. 14a
Note. One significant difference between the nature of the tracings in the previous
convex-convex case and this simple-convex case must be noted. In the former only
the edges of S were effectively contributing to the boundary of the T region, WV&rile
in the latter we find an edge, say ab in Fig. 15, which appears to be an edge of B, is
also contributing. The edge ub is, in fact, the instances or the locus of the concave
vertex u.
Part B. when B is not a relative supporting line at u. If the line segment B is
not a supporting line at the concave vertex, the situation turns out to be much
simpler. The L-e’-seg for a nonconvex edge e’ of S becomes the “sole” contributing
factor in that particular direction, and the D-tracing technique does not need any
modification. A typical such situation is shown in Fig. 16.
$0
rx /:
‘.
v” ,’ I
‘\
‘\ v’,,’ I
;,
V V
I‘
62 Le, - seg
$
1,
El f-----+.-----
et ~
1
S S place on 6
(a) (b)
T=S@B
(d)
FIG. 16. The decomposition boundary tracing D when B is not a relative supporting liue at the
concave vertex v.
A SOLUTION OF POLYGON CONTAINMENT 27
(b) (cl
FIG. 17. Decomposition of a simple polygon S by a convex polygon B.
From the above discussion we can, therefore, conclude that the D-tracing tech-
nique, described in Section 4.2.1.4, is applicable even if S is a simple polygon and B
is a line segment.
4.2.2.3. The generalization: Decomposition by a convex polygon B. Let us now
come back to our original problem. We claim, from the study of the above
subproblem, that the D-tracing technique does not need any modification even if B
is a convex polygon instead of a l@e segment. In the first place, recall the fact that
placing S on the boundary edges aB of B alone is sufficient, according to Theorem 1.
We can now argue in the following way. Since B is a convex polygon, the
technique of tracing the part of D corresponding to the convex parts (say, corre-
sponding to the edges e,, e2, etc. in Fig. 17) remains exactly similar to that of the
convex-convex case. Corresponding to the nonconvex parts (i.e., a concave vertex u
and its incident edges, say, es, e4 in fig. 17) the boundary of the common
intersection contains the Le’-segs from the nonconvex e’-bunches (i.e., Le,-seg,
L-e,-seg in Fig. 17), plus it contains the left-most part of the locus of the vertex u as
it moves along 86. The vertex u and thereby its locus comes in between those two
L.e’-segs. That essentially means that the edge(s) of i whose slope(s) in the reverse
direction falls in between the slopes of es and e4 must also be included in the
boundary of the common intersection, in addition to the Le,-seg and L.ecseg. Our
tracing technique also does exactly the same thing. (A different proof of this part is
given in Ghosh [3], by exploiting the fact that a nonconvex part of a polygon can be
described through the convex hole H. Therefore, its contribution to the boundary o,f
the common intersection can be determined from the boundary of the sum H 63 B.
To keep the paper self-complete the proof is not included since it uses the concept
of boundary tracing for Minkowski addition of polygons.) Once we form the D
polygon, we can determine the positive region T enclosed by D. T is the required
S 8 B.
4.2.2.4. Complexity analysis for the Algorithm A3. The simple-convex algorithm,
like the convex-convex case, has also two basic steps:
Step 1. Formation of D which is a self-crossing polygon.
Step 2. Determination of the positive region T enclosed by D.
28 PIJUSH K. GHOSH
I
(0 Le-seg contributed byS)
Let us first find out the maximum number of edges in D. Let that number be N.
N = number of edges contributed by S + number of edges contributed by B
= N, + (number of vertices of S x max numbers of edges
of B contributing at any vertex)
= Ns + N, x ( NB - 1)
= N, - NB.
Next we have to find out the maximum number of self-intersections between
these N edges. To do this, we consider these N edges as a collection of Ns number
of sickles: each of these sickles consists of NB number_of line segments, of wh.icb
( NB - 1) segments are contributed by the edges of the B polygon (shown dotted in
Fig. 18) and the rest, say 1, is a Le-seg contributed by one of the edges of S (shown
boldface in Fig. 18).
Note that each such sickle is a conuex chain, since B is convex and the line
segment 1 is an anti-supporting line of B. Since we have N, such sickles, therefore,
the maximum number of self-intersections among them could be of the order of Ni.
If the edges of S and B are given in slope-sorted order, step 1 can be carried out
in O(N), i.e., in O(Ns + NB) time. Step 2 can be executed by using the method
suggested by Bently and Ottman [ll] for reporting all K intersections of an
arbitrary set of N line segments that takes O((N + K)log N) time. (More recently,
Chazelle [ll] reported an 0( N log2 N/loglog N + K) algorithm for the same
problem). Therefore, step 2 takes O(( Ni + NsN,)log N,N,) time in our case (or,
0( N,N, log’ N,N,/loglog N,N, + N:), if one chooses to use Chazelle’s method).
(Note that Algorithm A3 could be made more efficient by not forming the
complete D-polygon explicitly, but computing only those parts of D that may
contribute to the positive region T. For example, in case of the convex vertices of S,
the edges of i need not be traced explicitly as is shown in Al. However, we shall
not concern ourselves with those finer details in this paper.)
5. A UNIFIED APPROACH AND ITS DEMONSTRATIONS
decompositions. For that purpose, we must analyse lirst the steps we follow in the
D-tracing technique.
First, any edge of a polygon can be characterized as the intersection of the
polygon and the supporting line of the polygon parallel to that edge. Therefore,
according to our notations, an edge of a polygon is the supporting points at the
polygon with respect to the supporting line parallel to that edge. (According to our
notion of oriented line, “parallel” means “similarly oriented” also.)
Now recall that a D polygon consists of Le-tegs corresponding to each edge e of
S, and r’-edges corresponding to the edges of B which keep continuity between two
adjacent Le-segs. Any Le-seg, we knoy, is the edge e of S translated to its
corresponding anti-supporting point at B (refer to Section 4.2.1.3). This is equiva-
lent of uecroriufb adding the edge e to its corresponding anti-supporting point at B.
In other words, this is equivale?t of vectorially adding the supporting points at S to
the anti-supporting point at B with respect to the supporting line parallel to the
edge e of S.
Second, in forming D, we move along the edges of 6 to reach from the
anti-supporting point for one edge of S to the anti-supporting point for the next
edge of S. This step is equivalent to assuming that the supporting line parallel to
one edge of S is continuously changing its direction (i.e., rotating continuously) to
finally become parallel to the next edge of S, and at every stage the supporting point
at S (it is, in fact, the vertex of S where the two edges meet) and the corresponding
anti-supporting points at B are being vectorially added. (This continuous movement
of the supporting line ensures continuity of the D polygon.) Figure 19 might clarify
the idea better. In Fig. 19a we-show how the supporting line is gradually rotating
from the direction of the edge e, to the edge e2. At all times the supporting point a,t
S remains fixed at its vertex u, but the corresponding anti-supporting point at B
(Fig. 19b) changes from c to a along the edge CLL For every direction of the
supporting line, we vecto@lly add the supporting point at S to the corresponding
anti-supporting point at B which finally forms an r’-edge (Fig. 19~);
(Our formulation of the exact rule for traversing the edges of the B polygon must
be clear to the readers at this point. The easy rule had also worked since we finally
discarded the negative regions enclosed by the D polygon,)
30 PIJUSH K. GHOSH
The above analysis could be summarized in the following form. The tracing D is
essentially the vector sum of the supporting points at S and the corresponding
anti-supporting points at i in every possible direction. But does the tracing D thus
formed ensure correct S 8 B in all situations? Yes, it does. Because for determining
S 8 B, we have to first identify, in every direction,” the left-most parts of the
instances of S when placed on the boundary points of B. The supporting point(s) at
S in any given direction is %ctually its boundary point(s) in” that direction. The
anti-supporting point(s) at B is the left-most point(s) of B in that direction.
Therefore, vector addition of the two will surely give us the left-most part of the
instances of S in that given direction.
We can now abstract out our approach to decomposition in terms of two
propositions stated below.
PROPOSITION 1 (supporting line proposition of 2D decomposition). Given two
plane $gures S and B in R2, the decomposition boundary tracing D of S 8 B is the set
of all points s + (;b) (i.e., vectorial addition of the points s and -b), such that
s E S and -b E B are the supporting point(s) and corresponding anti-supporting
point(s) respectively with respect to a supporting line in a given direction, and the
direction of the supporting line varies continuously from 0 to 360” covering all
directions in the plane.
Note that varying the direction of a supporting line from 0 to 360’ is equivalent
to varying it continuously along the boundary of S. However, varying it in the latter
way has certain computational advantages, and therefore, has been adopted by us.
PROPOSITION 2 (proposition on decomposition boundary tracing). In R2, S 8 B
is the positive region T enclosed by the decomposition bounakty tracing D of S 8 B.
(Note. Complete algebraic proofs of these two propositions can be obtained by
making use of Shephard’s theorem on Minkowski addition [4, 31 and the result
stated in Eq. (5).
We consider these two propositions as the fundamental algorithmic concepts of
2D Minkowski decomposition, since they state the underlying principle behind all
our algorithms for 2-dimensional decomposition. However, this does not mean that
the efficient algorithms for all kinds of S and B will be exactly the same. To make
an algorithm efficient, one must exploit the characteristics of the input figures.
Therefore, the actual computational procedure for decomposition varies depending
on the types of S and B. We already demonstrated, for example, that in the case of
the convex-convex decomposition, there is no need to form the decomposition
boundary tracing explicitly, although the underlying principle remains the same. In
the next section we present two more algorithms to establish this very point.
Moreover, these two algorithms will bring our study on 2-dimensional decomposi-
tion to a certain level of completion.
5.2. Two More Algorithms
5.2.1. Simple-Simple Case: Algorithm A4
Let S and B both be simple polygons as shown in Fig. 20a. the task is to compute
S 8 B by making use of the previous two propositions.
In tracing the D polygon we face no problem for the convex edges of S, where we
can assume decomposition by conv( B) instead by B (see Theorem 3). But the same
A SOLUTION OF POLYGON CONTAINMENT 31
Lx3 0
k
3 '1
*--- FTJ
d
r
---- +a--
2j
(a)
r&edge
ri-edge
Id) Tracing D2 (e) T2=SOB2
r--F- -._+i-=j
r-------’ f
L.-.-.,.-. J I
(f) SOB =tSOB,) ncsoe,) (g) SOB
assumption is not applicable for the nonconvex edges of S. Now, since B is a simple
polygon in this case, it may happen that for some nonconvex edgeJs) of S, there may
be more than one “disconnected” anti-supporting point(s) at B. See our example
figure whert, for the supporting line parallel to the edge e4 of S, both the vertices a
and d of B are the corresponding anti-supporting points. Clearly, a and d are
disconnected points. According to Proposition 1 if we add { e4} @ {d, a } to form
D, the tracing D becomes disconnected at this point. Although it can be proved that
even such a disconnected tracing will eventually generate the correct S 8 B, it is
definitely preferable for various reasons to generate a completely connected D
polygon.
32 PIJUSH K. GHOSH
S 8 B = (S 0 B,) n (S 8 B,).
This is a valid claim, since for any general sets S, B,, and B, in Rd, the following
relation holds:
B = B, u B,.
Note again that the algorithm stated above is only a conceptual model. In actual
practice, it may not be necessary to compute all the (S ~3 Bi) regions explicitly. It is
possible to determine beforehand, by examining the nature of the multiple support-
ing points, whether some of the (S 8 B;)‘s are proper subsets of the others.
However, we avoid going into those details in this paper.
-b
directed; add s vectorially with (-b), i.e., s + (- b). The method is depicted in
Fig. 21b.
We may go further. It is often possible to obtain an algebraic solution of D in this
case. Let the boundary curves of S and B be represented respectively in the
parametric forms
aB= [B,(u),B,(u)],
as= [S,(U),
S,(U)],
where u and u are two scalar quantities and are closed intervals on the u-axis and
u-axis, respectively. We assume that both B and S are oriented in the sense
corresponding to an increase in the parameters u and u, respectively. Clearly,
[2$]=[2$]
Let the solution for u be u = f(u), where “f ” denotes some function. Therefore,
the analytical expression for the D-curve is
To obtain more details in this regard readers may refer to Ghosh [2].
the set theoretic tools to reduce the computational complexity of the problem. This
set theoretic reformulation also allows us to go beyond convexity as well as beyond
2-dimensional.
3. We introduced the notion of decomposition boundary tracing that eventu-
ally helped us in proposing a unified theory for Minkowski decomposition algo-
rithms in R2.
Over and above those concepts, the paper also suggested (indirectly) a number of
new directions that seem promising for future research. We may explicitly list here a
few of them:
(a) The way we developed the theoretical framework and the 2D algorithms
clearly allows us to go beyond 2dimensional. First, the set theoretic results (Section
4.1) that simplify the geometric problem are applicable for general sets in Rd.
Second, Propositions 1 and 2, which are the basis for all the 2D algorithms can be
extended to higher dimensions simply by generalizing the concept of an oriented
supporting line. The general notion is that of a supporting hyperplane with an
orientation such that the direction of the outer normal of the supporting hyperplane
matches that of the corresponding surface of the object.
We face one problem here. The problem is in choosing the order of traversal of
the surfaces of S and B. In forming the D-polygon we traversed the edges of S and
B in such a way that at every stage of augmentation, the tracing is connected. The
choice of the traversal order was easy for us, since the vertices and the edges of a
planar polygon are intrinsically ordered. On the other hand, the vertices, edges, and
faces of a 3-dimensional polyhedron are not ordered accordingly. The problem
could be overcome by defining some order of traversal to maintain connectedness of
the tracing at each stage. Obviously, that will lead to more complex data structures
and algorithms.
(b) The problem was investigated by allowing only translation of the polygon
-but not rotation. It seems that efficient algorithms ahowing both translation and
rotation may be devised by formulating the problem completely in terms of
supporting points and decomposition boundary tracing. (Some investigations in this
direction by the author have indeed produced some encouraging results.)
(c) It also appears that the boundary tracing technique could be used effec-
tively in solving polygon union and intersection problems. We must note that some
work in this direction was once initiated by Guibas et al. [5].
(d) After living with the subject for a long time we strongly feel that the
significance of Minkowski operators is tremendous and need further investigation.
Not only their importance is being felt in solving spatial planning, containment, and
other related problems, but also in the areas like image processing, geometric
modelling, biological form description and analysis, graphic arts and typesetting,
etc. [13, 3, 7, 21. Besides their impact on classical problems, the efficient computation
of Minkowski operations give rise to theoretical and algorithmic problems of their
own and can significantly enrich the discipline of computational geometry.
ACKNOWLEDGMENTS
I would like to express my gratitude to Professor R. Narasimhan, Dr. S. Ramani, Dr. S. P. Mudur, Dr.
S. K. Ghosh, Ms. L. Parida, Mr. T. M. Vijayaraman, Mr. P. R. Chandrasekban, and particularly to Mr.
A SOLUTION OF POLYGON CONTAINMENT 35
P. Sadanandan for their help at various stages of preparation of the manuscript. And, finally, I thank the
referees of this paper for constructive suggestions.
REFERENCES
1. B. S. Baker et ul., Polygon containment under translation, J. Algorithms 7, No. 4, 1986.
2. P. K. Ghosh and S. P. Mudur, The brush-trajectory approach to figure specification: Some
algebraic-solutions, ACM Trans. Graphics 3,1984.
3. P. K. Ghosh, Computational Theoretic Framework for Shape Representation and Analysis Using
Minkowski Addition and Decomposition Operators, Ph.D. thesis, Tata Institute of Fundamental
Research, Bombay, September 1986.
4. B. Grunbaum, Convex Polytopes, Interscience, London, 1967.
5. L. J. Guibas et al., A kinetic framework for computational geometry, IEEE 24th Annual Symposium
on Foundations of Computer Science, 1983.
6. R. M. Haralick, et al., Image analysis using mathematical morphology, IEEE Pattern Anal. Mach.
Intell. PAMI-9, No. 4, 1987.
7. D. E. Knuth, Mathematical typography, Bull. Amer. Math. Sot. 1,1979.
8. D. T. Lee and F. P. Preparata, An improved algorithm for the rectangle enclosure problem,
J. Algorithms 3, No. 3, 1982.
9. T. Lozano-Perez, Spatial planning: A configuration space approach, IEEE Trans. Comput. C-32, No.
2, 1983.
10. G. Matheron, Random Sets and Integral Geometry, Wiley, New York, 1975.
11. F. P. Preparata and M. I. Shamos, Computational Geometry: An Introduction, Springer-Verlag, New
York, 1985.
12. J. Terra, Image Analysis and Mathematical Morphology, Academic Press, London, 1982.
13. J. Serra, Introduction to mathematical morphology, Comput. Vision Graphics Image Process. 35, No.
3, 1986.
14. J. T. Schwartz, Finding the minimum distance between two convex polygons, Inform. Process. L,ett.,
13, No. 4, 1981.
15. V. Vaishnavi and D. Wood, Data structures for the rectangle containment and enclosure problems,
Comput. Graphics Image Process. 13, 1980.