How to divide a polygon fairly

Let P be a simple polygon with N vertices, each assigned a weight c (0<i<N) with c€{0,l}. We define the weight C of P as the added weight of its vertices, i.e., C = c 1 +... + c Ar Making the assumption that the vertices of P have been sorted along some axis -which can be done in 0(Mog AO time, we prove that it is possible, in O(N) time, to find two vertices a,b in P, such that the segment ab lies entirely inside the polygon P and partitions it into two polygons, each with a weight not exceeding 2C/3. We also give a list of problems which can be solved efficiently with a divide-and-conquer strategy based on that result


NOTICE WARNING CONCERNING COPYRIGHT RESTRICTIONS:
The copyright law of the United States (title 17, U.S. Code) governs the making of photocopies or other reproductions of copyrighted material.Any copying of this document without permission of its author may be prohibited by law.

Introduction
It is a fact that fast algorithms often owe their efficiency to a handful of mathematical truths that bring to light unsuspected specificity -or singularity about the problem under consideration.But besides recognizing their mere aptitude at serving computational purposes, one may wish to add a bit of classification into the nature of those subservient truths.
To ease the matter, let us take two examples: proving that a minimum convex decomposition of a polygon could always be found free of interior parts was a major step in deriving a polynomial algorithm for that problem [CH80].

Similarly, establishing the unimodality of the vertex-coordinate function of a convex polygon was instrumental in the setting of logarithmic intersection-algorithms for convex objects [CD80],
There is, however, a notable difference in methodology between these two cases.Whereas the first example presents us with a mathematical fact which seems inherently helpful for deriving any algorithm, the latter brings out a compelling flavor of binary search-like technique which strongly suggests the proper algorithmic treatment Another case which witnesses both phenomena is the well-known near-neighbor problem, in which all nearest neighbor pairs in a given set of points are to be computed.One of the most efficient algorithms for this problem relies on an elegant geometric construction known as the Voronoi diagram [SH77].Although the existence of this diagram was undoubtedly the keystone in the elaboration of the algorithm, it fell short of even suggesting an effective method, since there was no immediate evidence that constructing the Voronoi diagram was to be any easier than computing the neighbor pairs directly.Another mathematical fact, i.e., the decomposability of the Voronoi construction, was indeed needed to fire the final blow and crack the problem.
There we should observe that although both facts are geometric in nature, the latter is combinatorial in spirit, as it draws its motivation from the algorithmic, all-purpose, divide-and-conquer technique.

Lipton and Tarjan's planar separator theorem [LT77,LI77] is a notable example of a systematic technique
for introducing a computational tool, i.e., divide-and-conquer, into a whole class of related'problems, i.e., planar graph problems.Drawing its inspiration from this philosophy, this paper presents a theoretical result on polygon decomposition which can be applied to derive a number of efficient algorithms for geometric problems, in particular, problems of convex decompositions, triangulation, visibility, and internal distance.

The Polygon-cutting Theorem
Let P be a simple 1 polygon with vertices v r ...,v N in clockwise order.Let OXY be an orthogonal system of A polygon is said to be simple iff only adjacent edges intersect reference.Wlog, we can always assume that no two vertices have the same X-coordinate.We define a partial, so-called vertical, order as follows: We say that "edge e > edge f iff their projections onto the X-axis overlap and, restricting ourselves to the overlapping area, e lies entirely above /(fig.l).The weights of the vertices in P 1 and P 2 are the same as in P, except for v. and for which we will assume that in both P l and P 2 , these weights become 0.This assumption is made only for the sake of simplicity, and other conventions (e.g., keeping the same weights c {9 c. in both P l and P 2 ) are indeed acceptable, if we are ready to add a term +2 to 2C(P)/3 in the inequality of Theorem 1.To facilitate our task, we will first prove the theorem with slightly relaxed requirements.

An existence theorem
To begin with, we will prove the existence, not of two vertices, but of two points on the boundary of P, satisfying the inequalities of Theorem 1.
Theorem 2: Same assumptions as Theorem 1.There exists a pair of points A,B on the boundary of P, such that the segment AB is parallel to the F-axis, lies entirely in the polygon P, and partitions it into two simple polygons P V P 2 satisfying:

C(/\) < C(P 2 ) < 2C(P)/3
If A and B are not vertices of P, for consistency, we assign them a 0-weighL The underlying notion of "equal size" decomposition expressed in the polygon-cutting theorem motivates the introduction of a distance function d(A,B\ defined between two points A,B on the boundary of P as the minimum path weight between A and B.More precisely, let v.v.+1 (resp.v j v j +1 ) be the edge of P containing A (resp.B).If A (resp.B) is a vertex of P, it is assumed to be v { (resp. We introduce the function h, defined as follows 2 : h(^5) = c j+1 + c j+2 +...+c.

from which we can define d(A,B): d(A,B) = min [ h(A y B), C(P) -h(A 9 B) ]
Starting at the edge v^, we label each edge of P recursively, as follows: *(Vi+i> = X <Wi> + c i

Note that this labeling gives us an alternate way of defining the distance between two boundary points A,B:
We are now in a position first to prove the existence of the segment AB, as defined in Theorem 2, then to describe an efficient method for finding it As we will see, the first step is not superfluous; it is an essential ingredient in ensuring the correctness of the algorithm.

A relaxed version of the polygon-cutting theorem
Unfortunately, Theorem 2 falls short of providing an efficient algorithm for computing AB.We can, however, graft to it a binary search-like structure to improve the performance of a naive implementation.The purpose of this section is thus to prove the following result: Theorem 3: Same assumptions as Theorem 1.It is possible, in O(N) time, to find a pair of points A,B on the boundary of P, such that the segment AB lies entirely in the polygon P, and partitions it into two simple polygons P V P 2 satisfying: The algorithm which we will describe in order to prove Theorem 3 is recursive; it requires 0(N) time to cut down the size of the problem by half, therefore its overall performance is linear.

Recall that initially, we have available both the vertical topological order (LV) of the edges of P
and the horizontal order (LH) of its vertices.The latter list permits us to determine a median vertical line L in O(N) time, i.e., a line parallel to the 7-axis that separates the vertices of P into two sets of size fC(/ > )/2] and [C(P)/2J respectively.Once again, this is always possible since no two vertices may have the same X-coordinate (fig.3).

Compute all the intersection points of L with the boundary of?, and sort them by y-coordinates, doing all of this in O(N) time with the list LV.
Next, form the intersection segments A^B^^A^B^ in ascending order (fig.3).

Completing the proof of the polygon-cutting theorem
We may now turn our attention back to Theorem 1.Let v.v.+ 1 and be the edges of P that contain the points A and B of Theorem 3, respectively.To prove the desired result, one may be tempted to slide A and B towards the endpoints of v.v.+ 1 and VjVj+1 respectively, until one of the configurations v.Vj, v.v.+1 , v. + 1Vj, or v i+1 v j+1 ^as k een reac hed.Unfortunately, obstacles may prevent this from ever happening (fig.5), so our next step will be to take a closer look at these possible obstacles.
Since the quadrilateral v j v i+l v j v j+l v i conta * ns * e sc 8 ment AB, it is a simple polygon, and AB partitions it Let hk = h t k u , and consider the quadrilateral 5 hh^k^^kh.We will show in Lemma 5 that at least one of its diagonals, A& u+1 or kh^+ v connects # x and H 2 without intersecting these polygons outside of its endpoints, i.e., lies entirely in H .Moreover, this diagonal can be found in constant time.We may then determine that diagonal, add it to the triangulation, set hk to it, and iterate.

Since h(v i ,v i + 1 ) = C(/ > )-c. + 1 and h(Vj + rVj)=Cj + 1 , it follows that if a 1 b v a 2 b 29
.» is the sequence of interior edges visited in the traversal of the triangulation, with the points a m (resp.6 ) on H 1 (resp.H 2 ), the sequence h(a 1 ,6 1 ),h(a 2 ,Z? 2 ),... is monotonously decreasing from C(/ ) )-c + 1 to c. ^ by jumps of at most C(/ > )/3.In consequence, it must take on at least one value in the interval

[C(P)/3, 2C(P)/2>\ which can be chosen as the pair w,v. •
The proof of Theorem 1 is now complete.Computing H x and H 2 definitely constitutes the most difficult part of the algorithm to implement.We may observe, however, that this overhead will often be unnecessary since, in practice, it may be seldom the case that the segment AB of Theorem 3 is prevented from sliding towards the endpoints of its supporting edges.

Applications to polygon decomposition problems
It is intuitive that the polygon-cutting theorem should lead to efficient methods for partitioning a polygon into convex pieces.We will examine two instances of this problem: in one, what is desired is a partition of the polygon into a small number of convex pieces, while in the other, only a triangulation of the polygon is sought, without consideration of optimality 6 .

Triangulation
When all the pieces of a convex decomposition are triangles and no new vertices are introduced, the decomposition is called a triangulation of the polygon.An 0(Mog AO algorithm for computing a triangulation of a simple polygon has been given in [GJ78].The method requires the somewhat cumbersome use of AVL-trees or similar logarithmic search trees.This can be avoided by using a strategy based on the polygoncutting theorem.
We may choose to assign a weight =1 to each vertex of P and apply the polygon-cutting theorem recursively, until the polygon under consideration has fewer than 7 vertices, at which point it is straightforward to complete the triangulation.We omit the details.An alternative consists of computing a convex decomposition of P as described in the previous section, then triangulate each convex polygon.To do so, pick any vertex of the polygon and join it to every other.
In both cases, a triangulation of P can be explicitly computed in 0(Aflog AO time, which matches the performance of [GJ78].We recall that it is yet unknown whether kMog N is optimal for this problem.

Figure 1 :
Figure 1: The partial order among the edges of P.

PFigure 2 :
Figure 2: Proving the existence of a separator S.

H
* comes from the fact that it keeps only edges which lie entirely in //*, and that the pointers h and k pass a vertex only after a diagonal has been assigned to it.Thus there only remains to prove the following lemma: Lemma 5: If the segment h t k u connects H l and H 2 and lies entirely inside #*, so does one of the diagonals ^t* u+1 or kji i+y Moreover, this diagonal can be found in constant time.Proof: Consider the line passing through hk, oriented from h to k.If a point lies to the right (resp.left) of this line, we will say that it lies below (rcsp.above) hk.Since H l and H 2 are convex, at For consistency, we define /r , and A. , n as v. , and v.the vertices v. or v. , lies above hk, therefore it is impossible that both k,, and k ,.Indeed this would involve the existence of at least three intersection points between a line and a convex boundary, leading to a contradiction.If only one segment, say h i+l lies above hk, it can be easily determined in constant time, and since in that case, all of H 2 lies below hk, the diagonal \ ^k does not intersect H 2 (nor H l either) outside of its endpoints, and may thus be chosen as the next segment of the triangulation (fig.7.2).If, on the other hand, both A t+1 and k ^ lie above hk, the quadrilateral hh {+ ^ } k is a simple polygon, therefore it contains at least one of its diagonals entirely (fig.7.3), and this diagonal can be found in constant time.Note that, because of its convexity, H l (resp.H 2 ) lies totally on one side of the line passing through hh^ (resp.kk J9 therefore the whole quadrilateral, hence the chosen diagonal, lies inside the polygon H , which completes the proof.• The purpose of triangulating the polygon H* will become apparent with the following result Lemma 6: There exists an edge uv in the triangulation of H* which satisfies the relation: C(P)/3 < h(u,v) < 2C(P)/3.
a, b on (resp.# 2 ), with b following (resp.preceding) a in the list {h v ...,h } (resp.{k v ...,k}) satisfies the relation: h(b,a) < 2C(/ > )/3 On the other hand, each triangle abc of the triangulation has one side ab on the boundary of either H 1 or H v with the two others ac, be constructed by the triangulation algorithm.Wlog, let ac be the segment"of the triangle constructed first (i.e., ac lies below be).We always have h(c,a) = h(b,a) + h(c,b) Now we can show that a simple upward scan through the faces of the triangulation, i.e., starting at the triangle adjacent to v.v.+ 1 and ending at the triangle adjacent to Vj v j +1 » w iU inevitably lead to the desired segment of Theorem 1.To see that, we may obviously assume that none of the edges ab of H l or H 2 satisfies the relations: C(P)/3 < h(b,a) < 2C(P)/3, otherwise, we have achieved our goal.In that case, Relation (1) shows that for any triangle abc visited, the edge on the boundary of H , say ab, satisfies the stronger inequality h(b,a) < C(P)/3, which, combined with Relation (2), leads to h(c,Z>) > h(c,a) -C(i>)/3.

Figure 8 :
Figure 8: Completing the convex decomposition of P.

Theorem 8 :
Using the polygon-cutting theorem, it is possible to triangulate a simple Af-gon in 0(Mog AO time and O(A0 space.It is shown in [CH82] how the additional information provided by an arbitrary triangulation of a simple polygon is sufficient to derive optimal algorithms for a number of geometric problems.Using the previous result to compute a triangulation of P, it is then possible to determine the area visible from any point inside P in linear time.Also, internal path problems, i.c., problems involving the computation of the shortest path between two points inside Pcan then be solved optimally [CH82].
The decomposition principle in geometry expresses the feasibility of local treatments for the solution of general problems on arbitrary figures.The polygon-cutting theorem presented in this paper asserts the applicability of this principle in the case of simple polygons, and by doing so, leads to efficient, simple divide-and-conquer methods for solving a variety of geometric problems.The merit of this approach lies primarily in the versatility of its applications as well as inthe increased efficiency which it affords.The most immediate open question is whether sorting the vertices in preprocessing is indeed required.If not, the algorithm would automatically become linear.In this paper, we have deliberately chosen simplicity and practicality over generality by restricting the weights attached to the vertices to take on the values 0,1.This was motivated by the fact that this restriction still allowed us to apply divide-and-conquer to an arbitrarily chosen subset of vertices, while adding simplicity to the exposition.The reader will observe, however, that it is straightforward to extend the theorem to a more general weight function.The applications mentioned in this work are only a few examples among a number of other problems which can benefit from the polygon-cutting theorem.Enlarging the list of applications given here is certainly a worthwhile endeavor.