20
Computational Geometry 32 (2005) 139–158 www.elsevier.com/locate/comgeo Hausdorff approximation of convex polygons Mario A. Lopez a,,1 , Shlomo Reisner b,2 a Department of Computer Science, University of Denver, Denver, CO 80208, USA b Department of Mathematics, University of Haifa, Haifa 31905, Israel Received 29 February 2004; accepted 24 February 2005 Available online 31 May 2005 Communicated by F. Hurtado Abstract We develop algorithms for the approximation of convex polygons with n vertices by convex polygons with fewer (k) vertices. The approximating polygons either contain or are contained in the approximated ones. The distance function between convex bodies which we use to measure the quality of the approximation is the Hausdorff metric. We consider two types of problems: min-#, where the goal is to minimize the number of vertices of the output polygon, for a given distance ε, and min -ε, where the goal is to minimize the error, for a given maximum number of vertices. For min-# problems, our algorithms are guaranteed to be within one vertex of the optimal, and run in O(n log n) and O(n) time, for inner and outer approximations, respectively. For min-ε problems, the error achieved is within an arbitrary factor α> 1 from the best possible one, and our inner and outer approximation algorithms run in O(f (α, P ) · n log n) and O(f (α, P ) · n) time, respectively. Where the factor f (α, P ) has reciprocal logarithmic growth as α decreases to 1, this factor depends on the shape of the approximated polygon P . 2005 Elsevier B.V. All rights reserved. Keywords: Convex polygons; Approximation algorithms; Hausdorff distance * Corresponding author. E-mail addresses: [email protected] (M.A. Lopez), [email protected] (S. Reisner). 1 Has been supported in part by the NSF, under Grant DMS-0107628. 2 Has been supported in part by the NSF, under Grant DMS-0107628 and by NATO Collaborative Linkage Grant PST.CLG 979701. 0925-7721/$ – see front matter 2005 Elsevier B.V. All rights reserved. doi:10.1016/j.comgeo.2005.02.002

Hausdorff approximation of convex polygons

Embed Size (px)

Citation preview

o

rdistancef metric.outputber

d run inds run

c

ST.CLG

Computational Geometry 32 (2005) 139–158www.elsevier.com/locate/comge

Hausdorff approximation of convex polygons

Mario A. Lopeza,∗,1, Shlomo Reisnerb,2

a Department of Computer Science, University of Denver, Denver, CO 80208, USAb Department of Mathematics, University of Haifa, Haifa 31905, Israel

Received 29 February 2004; accepted 24 February 2005

Available online 31 May 2005

Communicated by F. Hurtado

Abstract

We develop algorithms for the approximation of convex polygons withn vertices by convex polygons with fewe(k) vertices. The approximating polygons either contain or are contained in the approximated ones. Thefunction between convex bodies which we use to measure the quality of the approximation is the HausdorfWe consider two types of problems: min -#, where the goal is to minimize the number of vertices of thepolygon, for a given distanceε, and min -ε, where the goal is to minimize the error, for a given maximum numof vertices. For min -# problems, our algorithms are guaranteed to be within one vertex of the optimal, anO(n logn) and O(n) time, for inner and outer approximations, respectively. For min -ε problems, the error achieveis within an arbitrary factorα > 1 from the best possible one, and our inner and outer approximation algorithmin O(f (α,P ) · n logn) and O(f (α,P ) · n) time, respectively. Where the factorf (α,P ) has reciprocal logarithmigrowth asα decreases to 1, this factor depends on the shape of the approximated polygonP . 2005 Elsevier B.V. All rights reserved.

Keywords:Convex polygons; Approximation algorithms; Hausdorff distance

* Corresponding author.E-mail addresses:[email protected] (M.A. Lopez), [email protected] (S. Reisner).

1 Has been supported in part by the NSF, under Grant DMS-0107628.2 Has been supported in part by the NSF, under Grant DMS-0107628 and by NATO Collaborative Linkage Grant P

979701.

0925-7721/$ – see front matter 2005 Elsevier B.V. All rights reserved.doi:10.1016/j.comgeo.2005.02.002

140 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

planewe use

[13],ic) errormin -thatrocess,these

t,

tainedconvexof the

s, layoutith the

orithmsin

,ition in

theot

on

case inrs to bean just a

1. Introduction and preliminaries

We develop in this paper algorithms for the approximation of convex polygons in the EuclideanR2 by convex polygons with fewer vertices. The distance function between convex bodies whichto measure the quality of the approximation is theHausdorff Metricwhich, for two bodiesC andD, isdefined as

dH (C,D) = inf{ε > 0;C ⊂ D + εB2 andD ⊂ C + εB2},whereB2 is the Euclidean unit ball (disc) inR2.

One tends to think of problems of the following type: given a convexn-gonP in R2, construct ak-gonQ (in most applicationsk is expected to be much smaller thann), such thatQ ⊂ P (or Q ⊃ P ) anddH (P,Q) is minimal. The analogous problems for theSymmetric Metric:

dV (C,D) = Area((C \ D) ∪ (D \ C)

)were dealt with in [6] and [1], with an improvement in [2]. Another approach, pursued in [12] andprovides simple, linear time algorithms that guarantee a best-order, worst-case (symmetric metr(instead of best possible error for the specific polygon). Problems of this type are usually calledεproblems. The nature of min -ε problems is such that there is little hope to construct finite algorithmsachieve exact solutions for them in the case of the Hausdorff metric (see [11] for a convergent pwith no time estimate, for dealing with a similar problem). Here we construct algorithms that solveproblems approximately. That is, if the best possible error for a givenk is δ, then our algorithms construcfor a givenα > 1, ak-gonQ with an error not greater thanαδ.

Another type of problems are the min -# problems: given a convexn-gon P andδ > 0, construct ak-gonQ (Q ⊂ P or Q ⊃ P ), such thatdH (P,Q) � δ andk is minimal.

Let us mention that the task of replacing given figures by simpler figures containing them (or conin them), that are close to the original figures in various ways, has received attention in the non-setting as well. See, for example [4] in the symmetric metric case, or [3,5,7,9,10] in the caseHausdorff metric or similar metrics (e.g., with replacement ofB2 by B1—the�1 disc, or byB∞—the�∞disc) as the measure of error. Such algorithms have practical applications in areas such as roboticand packing and others (see [4] for a partial list of applications). None of the above works deals wproblem as stated here.

We start here by constructing algorithms to solve the min -# problems. Then we apply these algsuccessively to solve the approximate min -ε problems. For the min -# problems our algorithms runtime O(n logn) for Q ⊂ P and in time O(n) for Q ⊃ P . This is for therootedcase in which one vertexor one normal of an edge of the approximating polygon is fixed in advance (see the formal definthe text that follows). We show later that fork reasonably large there is not much difference betweenrooted and unrooted cases. In fact, solving the rooted problem fork +1 (at any root) provides an error ngreater than the one for the unrooted case fork. The time estimates for the approximate min -ε problemsare of the same order as their min -# counterparts concerning dependence onn, but they are multipliedby a factorf (α,P ) that has reciprocal logarithmic growth asα decreases to 1. This factor dependsthe shape of then-gonP . Upper bounds forf (α,P ) are given in Sections 2.2 and 2.3.

After presenting the algorithms for the rooted cases in Section 2, we discuss the unrootedSection 3. In Section 4 we present an example which clarifies that an obstacle which appeapossible in the inner approximation case is a real obstacle that does happen in practice, rather th

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 141

e post-

s paper.proof

er, then [15]and 1.3

g a

g

x

t on

-

ay

of

t

potential, theoretic one. Taking care of this obstacle is the cause of the estimate O(n logn) in this case,compared to O(n) in the outer case.

The rest of this introduction contains some definitions and preliminary results whose proofs arponed to Section 4.

Theorems 1.1, 1.3 and their corollaries constitute the basis for the algorithms presented in thiClaims like these theorems, or similar to them, are made, without proof, in [15, pp. 337, 341]. Theis attributed there to [14], which in turn refers the reader to a general theorem of [16]. Moreovclaim in [15] which is related to Theorem 1.1 here (p. 341) is not correct in the way it appears i(see a counterexample in Section 4). Therefore we chose to develop a full proof of Theorems 1.1in Section 4.

Let C be a convex body inR2 (that is,C is a compact, convex set with non-empty interior). Fixinpointp0 on ∂C (the boundary ofC), we can define a total order on∂C by defining forp,q ∈ ∂C: p ≺ q

(with respect top0) if and only if p precedesq in the counter-clock-wise circular order that starts atp0.This relation is extended, in the obvious way, to relations�, and. When we write an increasinsequencep0 � p1 � · · · the order is always meant with respect to the first point (p0) in the sequence.

Let P be ak-gon inscribed inC, with verticesp0 � · · · � pk−1 on ∂C (a k-gonmeans here a convepolygon with at mostk vertices,k is always assumed to be at least 3). We denote bypipi+1 the edge ofP with endpointspi,pi+1. By pipi+1 we denote{p ∈ ∂C;pi � p � pi+1}. We denote byd in

i the distanced in

i = dH (pipi+1, pipi+1) (dH is the Hausdorff distance), which is the maximal distance from a poinpipi+1 to the segmentpipi+1 (in such settings we shall always considerpk to bep0).

Theorem 1.1. LetC be a convex body inR2 andp0 a fixed point on∂C. There exist pointsp1, . . . , pk−1

on ∂C such thatp0 ≺ p1 ≺ · · · ≺ pk−1 and thek-gonP with vertices{pi} satisfies

(1) d in0 = d in

1 = · · · = d ink−1 = dH (C,P ).

(2) Letδin(C,p0, k) := min{dH (C,Q);Q ⊂ C,Q a k-gon with vertex atp0}. For every sequencep1, . . . ,

pk−1 as above(without assuming(1)), we haveminj d inj � δin(C,p0, k) � maxj d in

j , hence, if the sequence satisfies(1) thendH (C,P ) = δin(C,p0, k).

Corollary 1.2. Let C be a convex body inR2 andk � 2 a positive integer. There exists ak-gonP , withverticesp0 ≺ · · · ≺ pk−1 on ∂C, such that for all0� i � k − 1

d ini = dH (C,P ) = δin(C, k) := min

{dH (C,Q);Q ⊂ C, Q a k-gon

}.

Let k � 3 ande0 ≺ e1 ≺ · · · ≺ ek−1 be unit vectors inR2, the order here is understood in a wanalogous to the one above, consideringei as points on the unit circleS1. Let P be the convexk-goncircumscribingC, each of whose edgesFi supportsC and hasei as an outer normal. Without lossgenerality we may always assume thatP is bounded. Denote byqi the vertex ofP : {qi} = Fi ∩ Fi+1.

We denote byp−i andp+

i , respectively, the first and last intersection points ofFi with C. p+i p−

i+1 is, asbefore, the arc, part of∂C from p+

i to p−i+1. qi denotes the polygonal arcp+

i qip−i+1. One can check tha

douti := dH (qi, p

+i p−

i+1) is the distanced(qi, p+i p−

i+1) from the pointqi to the arcp+i p−

i+1. See Fig. 1 foran illustration.

142 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

ors

f

e

Fig. 1. A polygonC approximated by a circumscribing polygonP with k = 4. Of the four normals, onlye3 is shown. Thedouti

scorrespond to the lengths of the dotted lines.

Theorem 1.3. LetC be a convex body inR2 and lete0 be a fixed unit vector. Then there exist unit vecte1, . . . , ek−1 such thate0 ≺ e1 ≺ · · · ≺ ek−1 and the circumscribingk-gonQ of C, whose edgesFi haveei as outer normals satisfies:

(1) dout0 = dout

1 = · · · = doutk−1 = dH (C,Q).

(2) dH (C,Q) = δout(C, e0, k) := min{dH (C,R);C ⊂ R,R a k-gon withe0 as an outer normal to one oits edges}.

(3) Thek-gonQ that satisfies(1) is unique(with the givene0) and is also the uniquek-gon that satisfies(2)). Moreover, as in Theorem1.1, even if we do not assume(1) we have: minj dout

j � δout(C, e0, k) �maxj dout

j .

Corollary 1.4. LetC be a convex body inR2 andk � 2 an integer. Then anyk-gonQ circumscribingCthat has outer normalse0 ≺ e1 ≺ · · · ≺ ek−1 and satisfies

dH (C,Q) = δout(C, k) := min{dH (C,R);C ⊂ R, R a k-gon

}must satisfydout

i = dH (C,Q) for all i = 0, . . . , k − 1.

Remark 1.5. We say that ak-gonP ⊂ C is abalanced inscribedk-gon ofC if it satisfies (1) of Theo-rem 1.1. Ak-gonQ ⊃ C is abalanced circumscribingk-gon ofC if it satisfies (1) of Theorem 1.3. Th

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 143

y 1.4,n-es as weof the

hm for

of

f

e

significant difference between Theorem 1.1 with it’s Corollary 1.2 and Theorem 1.3 with Corollaris the lack of necessity for a rooted or global minimal inscribedk-gon to be balanced, this is demostrated by an example in Section 4. This lack of necessity of balance has algorithmic consequencshall show in the sequel. One more point to notice is the importance of the root to the sufficiencybalance property. Thus, for example, the converse of Corollary 1.4 is not true.

2. The rooted case

In this section we investigate theinner rooted approximationand theouter rooted approximationproblems for a convexn-gon. Each of these problems is divided into it’s “min -#” and “min -ε” versions.We shall develop an algorithm to solve the min -# problem and then use it to construct an algoritapproximating a solution for the min -ε problem to withinαδ, whereδ is the minimal error which ispossible in approximating the givenn-gon by an inscribedk-gon, andα is any number greater than 1 (course, the time cost of the algorithm depends onα).

2.1. The inner, rooted,min-# problem

The problem is: given a convexn-gon P with verticesp0, . . . , pn−1, a pointq0 ∈ ∂P and a (smallenough to make the problem non-trivial) positive numberδ, construct a convexk-gonQ, inscribed inP ,such thatq0 is a vertex ofQ, dH (P,Q) � δ andk is minimal.

Assume, as we may, thatp0 � q0 ≺ p1. We letq be a moving point that starts fromq0 and traverses∂P in the positive (counter-clockwise) direction. The Hausdorff distancedH (q0q, q0q) between the linesegmentq0q and the arcq0q—the part of∂P from q0 to q, is non-decreasing asq advances (this is, infact, the Hausdorff distance betweenP and the convex subset ofP which is obtained by removing fromP the part which is to the right of−−→q0q), but it may be stationary at certain intervals of the motion oq:for example, if the angle�p1q0q is obtuse, and ifd(q0,p1) = dH (q0q, q0q) then there may existq1 q

for which still d(q0,p1) = dH (q0q1, q0q1) (see Fig. 2).

Lemma 2.1.

(a) LetC be a convex body inR2, q0 andr two distinct points on∂C andδ > 0. There exists at most onpointq on ∂C that satisfies the three following conditions at the same time:

Fig. 2. A case wheredH (q0q1, q0q1) is stationary.

144 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

,

w

e

eith

)

Fig. 3. Proof of Lemma 2.1, part (a).

(1) r ≺ q.(2) d(r, q) = δ.(3) �q0qr is obtuse(or a right angle).

(b) In the case that the convex bodyC of part (a) is ann-gon then, for givenq0 andr as above, one canin timeO(logn), find the unique pointq of part (a) if it exists, or determine thatq does not exist.

Proof. Part (a). Assume, for simplicity, thatq0r is horizontal andq0 is the right end-point. LetG be thecircle of radiusδ, centered atr . Let H be the circle whose diameter is the segmentq0r . Note that all thepointsq such that�q0qr is obtuse, lie inside or on the circleH . Thus, ifδ � d(q0, r), there is no pointqthat satisfies both (2) and (3) of the lemma. Ifδ < d(q0, r), thenG intersectsH once in a pointz below←→q0r . Points onG which are insideH and below←→q0r may satisfy (1)–(3) if they are on∂C. We shall seethat at most one point can satisfy this. Assume that bothq1 andq2 satisfy (1)–(3), that is, both are belothe diameterq0r of H and on the portion of the circleG which lies insideH . We may assume thatq1 islower thanq2. But then, because�q0q1r is obtuse,q2 lies insidethe triangle�rq1q0 whose vertices aron ∂C. Henceq2 is in theinterior of C and not on∂C (Fig. 3).

Part (b). Consider the setρ = {q ∈ ∂C, r � q}. In general,ρ may intersectG several times. Sinconly one such intersection can lie insideH , we are interested in finding the last one of them (last wrespect to the order defined above). The vertices ofρ can be partitioned into three sets,β1, β2 andβ3,depending on whether they are, respectively, to the left of←→zr , on or to the right of←→zr but inside or onG,or to the right of←→zr but outsideG. Notice that ifvi ∈ βi , i = 1,2,3, thenv1 ≺ v2 ≺ v3. The desiredqbelongs to an edgepjpj+1 of C such thatpj ∈ β1 ∪ β2 andpj+1 ∈ β3 (for convenience we addq0 to β3

and assumeq ≺ q0 for all q ∈ ρ). Thus, a simple binary search onρ allows us to find the desiredq inO(logn) time. �Definition. In the settings of Lemma 2.1(a), for a pointr ∈ ∂C, if a point q ∈ ∂C that satisfies (1)–(3exists, we denoteS(r) = q. OtherwiseS(r) is not defined.

The basic step in the algorithm isCapin(q, δ): a subroutine that takesq ∈ ∂P , q q0, andδ > 0 asinput and returns the last pointq1 on ∂P (with respect toq0) such thatdH (qq1, qq1) = δ. If no suchpoint q1 exists then the result ofCapin(q, δ) is q0. The full algorithm uses the code forCapin(q, δ)

as follows: performCapin(q0, δ) to produceq1, and proceed, performingCapin(qj , δ) to produceqj+1,until the result ofCapin(qk−1, δ) is q0. The k-gon Q will be the convex hull ofq0, . . . , qk−1. Clearly

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 145

tobut notd more

t

nt

Fig. 4. The three possible regions on the arcq0q.

dH (P,Q) = δ (unlessQ = {q0} in which case it is smaller). We have to show thatk is minimal. Assumethat Q is any convex polygon with verticesq0 = q0 ≺ q1 ≺ · · · ≺ ql−1 on ∂P , such thatdH (P, Q) � δ.Then, by monotonicity ofdH (q0q, q0q) and the choice ofq1 we necessarily haveq1 � q1, it now followsby the same argument thatq2 � q2 and so on. Hencel � k.

We shall now construct an algorithm forCapin(q0, δ) and analyze its complexity. First we havepay attention to a phenomenon that exists in the context of the inner approximation problemsin the external ones. This phenomenon makes the first kind of problems somewhat harder antime-consuming than the second kind.

Let C be a convex body inR2 andq0, q, q0 ≺ q, two points on∂C. As before, letq0q = {r ∈ ∂C;q0 �r � q}. Let r1 andr2 be, respectively, the intersection points ofq0q with the lines orthogonal toq0q, thatpass throughq0 andq, respectively. We denote:

α(q0, q) = {r ∈ ∂C;q0 � r ≺ r1},β(q0, q) = {r ∈ ∂C; r1 � r � r2},γ (q0, q) = {r ∈ ∂C; r2 ≺ r � q}.

There are three (non-exclusive) possibilities for the location of a pointr ∈ q0q such thatdH (q0q, q0q) =d(r, q0q):

(1) r ∈ β(q0, q); in this cased(r, q0q) is the (orthogonal) distance fromr to ←−→q0q.(2) r ∈ α(q0, q); in this cased(r, q0q) = d(r, q0).(3) r ∈ γ (q0, q); in this cased(r, q0q) = d(r, q).

(see Fig. 4).If the above convex bodyC is a polygonP with verticesp0 ≺ p1 ≺ · · · ≺ pn−1 (which will be the

default assumption from here on), thendH (q0q, q0q) is attained at a vertexpj , therefore we shall, fromnow on, consider the above three sets as consisting only of the vertices ofP contained in them. Note thaasq traverses∂P in the positive direction, we have the following:

If q0 ≺ q ≺ q ′ thenα(q0, q) ⊆ α(q0, q′). (2.1)

If for someq1, q0 ≺ q1, andpi, pj ∈ q0q1 (pi ≺ pj ) the (orthogonal) distances satisfyd(pi,

←−−→q0q1) � d(pj ,←−−→q0q1) then, for everyq such thatq1 ≺ q, we haved(pi,

←−→q0q) �d(pj ,

←−→q0q) (the angles between each edge of∂P above←−→q0q and←−→q0q increase withq).(2.2)

Given a pointq0 ∈ ∂P , we assume thatp0 � q0 ≺ p1. We define the following functions of the poiq, q0 ≺ q:

146 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

-

h is

e

,

hat

at

dα(q) = max{d(pj , q0);pj ∈ α(q0, q)

},

dβ(q) = max{d(pj ,

−−→q0q);pj ∈ β(q0, q) ∪ γ (q0, q)}

(−−→q0q is the half of the line←−→q0q that starts atq0 and containsq).

dαβ(q) = max{dα(q), dβ(q)

},

dγ (q) = max{d(pj , q);pj ∈ γ (q0, q)

},

dH (q) = dH (q0q, q0q).

From the property (2.1) and simple observations we conclude thatdαβ(q) is continuous and nondecreasing.dγ (q) is neither continuous nor monotone, since vertices may move into and out ofγ (q0, q)

asq increases.dH (q) is clearly continuous and non-decreasing. We have:

dH (q) = max{dαβ(q), dγ (q)

}.

The subroutineCap(q0, δ) goes now as follows: we first look for 1� n0 � n − 1 such thatdH (pn0) �δ < dH(pn0+1) (by monotonicity ofdH it follows that if no suchn0 is found, then the result ofCap(q0, δ)

is q0). Examinep2,p4,p8, . . . to find the smallestj such thatdH (p2j ) > δ. This requiresj = O(logn0)

iterations. Now binary search the interval[2j−1,2j ) for index n0 such thatdH (pn0) � δ < dH(pn0+1).Since 2j−1 � n0 < 2j and 2j − 2j−1 = 2j−1 � n0, the number of iterations of the second binary searcalso O(logn0). dH (pi) can be computed in O(i) time, hence the time to findn0 is O(n0 logn0).

The pointq1 is now to be found in the (order) interval[pn0,pn0+1). We have:dH (q1) = δ anddH (q) >

δ for all q1 ≺ q. Let a finite setS = {s1, . . . , s�} ⊂ [pn0,pn0+1) be defined in the following way: If therexist pointss ∈ [pn0,pn0+1) such thats = S(pi) for some 1� i � n0 we denote these points bys1 ≺ · · · ≺sk (k = � − 1 or �). By Lemma 2.1, the time needed to find these points is O(n0 logn). sk+1 is now theunique point in[pn0,pn0+1) (if such exists) that satisfies:dαβ(sk+1) = δ anddαβ(s) > δ for all sk+1 ≺ s.We show later that the time required to findsk+1, or to determine that it does not exist, is O(n0). We shallalso show that the setS can never be empty and, in fact,q1 ∈ S. Thus a binary search onS to find thelast pointsj ∈ S with dH (sj ) = δ results inq1. Since� � n0, such search requires O(logn0) steps. Foreachsj ∈ S, dH (sj ) can be computed in O(n0) time. Therefore the total time required byCap(q0, δ) isO(n0 logn). This concludes the construction of the subroutineCap(q0, δ).

To prove thatq1 ∈ S, assume first thats� is the last points ∈ [pn0,pn0+1) for whichdαβ(s) = δ. In thiscase, ifdγ (s�) � δ, thendH (s�) = δ anddH (s) > δ for all s > s�. Thus,q1 = s� ∈ S. Assume otherwisethatdγ (s�) > δ. Thenq1 ≺ s�. If dγ (q1) = δ thenq1 ∈ S. So assume otherwise, thatdγ (q1) < δ. In thiscasedαβ(q1) = δ and, by monotonicity ofdαβ , dαβ(s) = δ for all s ∈ [q1, s�]. It follows thatdγ (s) > δ

for all s ∈ (q1, s�] (otherwiseq1 would not be thelast point s with dH (s) = δ). Thusq1 is a point ofdiscontinuity ofdγ , a “jump-up” of dγ occurs, from a value belowδ at q1 to values aboveδ at everypoint s q1 close enough toq1. Such a “jump-up” ofdγ is the result of only one possible cause and tis that a vertexpi (i � n0) with d(pi, q1) � δ “moves” fromβ(q0, s) into γ (q0, s) ass crossesq1. Butthis means two things: First, sincedαβ(q1) = δ andpi ∈ β(q0, q1), it follows thatd(pi, q1) = δ. Second,sincepi crosses over fromβ to γ ass crossesq1, it follows that�q0q1pi = π/2, henceq1 ∈ S in thiscase as well. We discuss now the case thats� is not the last points ∈ [pn0,pn0+1) with dαβ(s) = δ. In thiscasedαβ(pn0+1) � δ. If dαβ(pn0+1) < δ then clearlyδ = dH (q1) = dγ (q1) andq1 ∈ S. If dαβ(pn0+1) = δ

thendγ (pn0+1) > δ and the preceding argument, withs� replaced bypn0+1, can be repeated to show thq1 ∈ S.

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 147

s

r,

1

te this

e

e-es

It is finally left to prove, as we promised to do, that the time required to find the last points (denotedbefore bysk+1) in [pn0,pn0+1), with dαβ(s) = δ, or to determine that such point does not exist, is O(n0).

Sincedαβ is continuous,s exists if and only ifdαβ(pn0+1) > δ. Thus, if dαβ(pn0+1) � δ, report thatno suchs exists. This can be done in O(n0) time. Assume now thatdαβ(pn0+1) > δ and letp(t) =(1− t)pn0 + tpn0+1. We wish to findt such thatp(t) = s. The algorithm keeps a moving pointq, initiallyset topn0+1, which slides towardss and satisfiess ≺ q. When, eventually,q � s a simple quadraticequation provides the desired answer. Examinep1,p2, . . . to find the smallestj such thatd(pj , q0) > δ.(Suchj must exist as otherwisedαβ(pn0+1) � δ.) Let qj denote the intersection of←−−−−−−→pn0pn0+1 with the linethroughq0 orthogonal toq0pj and setq to qj if qj ∈ pn0pn0+1. This step can be done in time O(n0) andallows us to ignoredα, asdαβ(s) = dβ(s) for all s ≺ q such thatdαβ(s) > δ. For any suchs, there is avertexvs ∈ q0s such thatdαβ(s) = d(vs,

−−→q0s). Conversely, for eachpi ≺ vq there is a largestt , call it ti ,such thatpi = vp(ti ). (The reader can verify thatti satisfiesq0p(ti) ‖ pipi+1.) Let ph = vq and moveq top(th−1),p(th−2), . . . until the largestk such thatd((pk,

−−−−−−→q0p(tk)) > δ andd(pk−1,

−−−−−−−−→q0p(tk−1)) � δ. Since

vs � vs′ for s ≺ s ′, this can be done in O(n0) time. The desiredt satisfiespk = vp(t) and can be found aa solution to the quadratic equation arising fromd(pk,

←−−−−→q0p(t)) = δ.

To summarize:Capin(q0, δ) takes O(n0 logn) time to complete. It follows from this that the innerooted, min -# algorithm takes O(n logn) time.

2.2. The inner, rooted,min-ε problem

The problem is: given a convexn-gonP and a pointq0 ∈ ∂P as before, and a positive integerk (< n),construct a convexk-gon Q, inscribed inP , such thatq0 is a vertex ofQ anddH (P,Q) is minimal(in the context of the min -ε problem aj -gon with j � k is considered also as ak-gon). Theorem 1.1tells us that it is enough to find suchQ which isbalanced, that is, if in the formulation of Theorem 1.we replaceC by P andP by Q, we have to findq0 ≺ q1 ≺ · · · ≺ qk−1 such that all the distancesd in

j ,0 � j � k − 1, are the same. This seems to be far fetched algorithmically, but we can approximagoal using a simple search procedure. We shall be able, for everyα > 1 to construct ak-gonQ = Qα ⊂ P

with dH (Qα,P ) � αδin(P, q0, k), while having control over the time-cost of the algorithm.Let δ = δin(P, q0, k) and let∆ be an upper bound forδ. Denoteδ0 = ∆, δj+1 = δj/α (j = 0,1,2, . . .).

Perform now the min -# algorithm of the previous subsection, starting withq0 and using the subroutinCapin(·, δj ), the result is akj -gonPkj

. Sinceδ0 � δ we havek0 � k. Proceed until we reach the firstj = j0

such thatkj0 � k andkj0+1 > k. Pkj0is ak-gon (sincekj0 � k) and satisfies, in the terminology of Th

orem 1.1, maxi d ini � δj0. Hence, by part (2) of Theorem 1.1,δ � δj0. On the other hand, let the vertic

of Pkj0+1 beq0 ≺ q1 ≺ · · · ≺ q(kj0+1−1) and let the polygonP be the convex hull ofq0, q1, . . . , q(kj0+1−(2).

P satisfies mini d ini � δj0+1. Sincekj0+1 − 1� k, we have, again by Theorem 1.1,

δj0+1 � δin(P, q0, kj0+1 − 1) � δin(P, q0, k) = δ.

Henceδj0+1 � δ � δj0. If we choose nowPkj0to be our approximatingk-gon Q, we getdH (Q,P ) =

δj0 = αδj0+1 � αδ as promised.To get an estimate of the number of steps involved in this process, that is, of the size ofj0, we need

also a positivelowerbound∆ for δ. Once we have such bounds∆ � δ � ∆, it is clear thatj0 is at most ofthe orderJ = (log∆ − log∆)/ logα. The whole algorithm thus takes O(J · n logn) time. We make herethe remark that there are other ways to achieve the goal of constructing ak-gonQ with dH (P,Q) � αδ,for example, ifα < 2 we may proceed using the search as above withα replaced by 2, reaching aj0 as

148 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

d in thishavesere

nd

e ofllows

t

case.malsuredly at aer, strictcounter

e

me

s, inee,

before and proceeding further by bisection. We leave it as an exercise to estimate the time requireway, which is not different in principle from the previous estimate. The main point, if we wish toan a-priory knowledge on the size ofJ , is to estimate∆ and∆. An easy upper bound∆ can be taken ac · R(P )/k2 whereR(P ) is the outer-radius ofP andc is an appropriate constant (see, e.g., [17] whProposition 2.5 implies, in the two-dimensional case, thatc < 25.7). We need to know the upper bou∆ for the execution of the algorithm. Now,R(P ) � D(P ) (the diameter ofP ) andD(P ) can be found inlinear time [18], thus finding∆ does not increase the complexity of the algorithm.

To get a lower bound∆ (this is not needed for the execution of the algorithm but only for the saktime estimation) we can use the following estimate from [8] (Theorem 1 and Remark 1 which foit): For Q ⊂ P let dV (P,Q) = A(P ) − A(Q) (A(C) is the area ofC). Then

dV (P,Q) � π

2(√

2− 1)D(P )dH (P,Q). (2.3)

The maximal-areak-gonQ ⊂ P can be constructed in O(kn+n logn) time ([6] with an improvemenby [2]), this is the time needed to find a lower bound with the help of (2.3).

We get the estimate

J � (logα)−1

(log

R(P )D(P )

mindV (P,Q)− 2 logk + const

),

where the minimum in the last expression is taken over allk-gonsQ ⊂ P .To summarize: the time that the min -ε algorithm takes is

O

(n

(const+ log

R(P )D(P )

k2 mindV (P,Q)

)logn

logα

).

2.3. The outer, rooted,min-# andmin-ε problems

The outer case (both min -# and min -ε problems) is treated in a manner analogous to the innerHere the role played by the verticesqj of the inner approximating polygon is taken by the outer norvectorsfj (j = 0, . . . , k − 1) of the edges of the outer approximating polygon. The distance is meato an edge of the polygonP (see Fig. 5, note that it may happen that the distance is achieved onvertex of that edge and is bigger than the distance to the line containing the edge). We have, howevmonotonicity of the distance here (see the proof of Theorem 1.3 in Section 4) and we do not enhere angle-intervals that require “special treatment”, like the setsα(q0, q) andγ (q0, q) of Section 2.1.

Let Capout(f , δ) be the subroutine, analogous toCapin(q, δ), for the outer approximation. The timrequired by it will be, as we show below, only O(n0), wheren0 is the number of edges ofP enclosedbetween the first (in counter-clockwise sense) point ofF0 ∩ P and the last point ofF ∩ P (f is theanalogue ofq in the Capin(q0, δ) subroutine andF is the edge ofP whose outer normal isf ). Since∑k−1

j=0 nj = n, we get the time estimate O(n) for the outer, rooted, min -# algorithm. In order to get a ti

estimate for the outer, rooted, min -ε algorithm, we have to compute analogues of∆ and∆. An upperbound∆ of the formc · R(P )/k2 holds here as well (see, e.g., [17] where Proposition 2.7 impliethe two-dimensional case, thatc < 33.08). A lower bound∆ can be established (for the sake of timestimation) again by the estimate (2.3), with the roles ofP andQ exchanged (note that we may assume.g.,D(Q) � 2D(P )).

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 149

he

t

e

h

ises,

Fig. 5. Distance toP from circumscribing polygon.

The minimal-area circumscribingk-gonQ ⊃ P can be constructed in O(n2 logk) time ([1] and [2]).This is the time needed to compute the lower bound∆ with the help of (2.3).

We get the estimate: the time required for the outer, rooted, min -ε algorithm is(n

logα

(const+ log

R(P )D(P )

k2 mindV (P,Q)

)), (2.4)

where the minimum is taken over allk-gonsQ ⊃ P .All that is left in order to complete this section is to define and analyze the subroutineCapout(f0, δ).For the given root vectorf0, there is a vertex ofP that admits a tangent edgeF0 normal tof0.

(Actually, F0 can be tangent to two consecutive vertices ofP , in which case we are interested in tlater one.) Without loss of generality assume thatp0 is the vertex with tangentF0 normal tof0 and letL be the supporting line ofF0. We wish to find the next vertex ofQ, i.e., the pointq ∈ L that satisfiesq = F1 ∩ F0. To this end we incrementally generate a sequenceq1, q2, . . . , qk of candidates such thaq = qk or q lies onL betweenqk−1 andqk. Candidates are produced as follows (see Fig. 6):q2i−1 (resp.q2i) is the intersection ofL with a line throughpi orthogonal topi−1pi (resp.pipi+1). All points of L in[q2i−1, q2i] havepi as their nearest point on∂P , while those in[q2i , q2i+1] are nearest to the foot of thperpendicular from that point to the segmentpipi+1. Thus, we generateq1, q2, . . . to the smallestk suchthat d = d(qk,p�k/2�) � δ. If d = δ thenq = qk . Otherwise, ifk is even, thenq is the point onqk−1qk

with distanceδ from pk/2. If k is odd,q is the unique pointq ′ ∈ qk−1qk whose distance to the line througp(k−1)/2 andp(k+1)/2 is δ. The new vertexq is incident on two edges ofQ tangent toP : F0 andF1. Westill need to findF1 and the corresponding tangency pointp′. This can clearly be done in O(n0) time, andprovides the starting point forCapout(f1, δ), with p′ andF1 playing the roles ofp0 andF0, respectively.

Remark 2.2. For cases whenk is small (k = o(n/ logn), to be precise) and provided the polygonalready available in memory, both the min -# and min -ε problems can be solved faster. In both casthe improvement comes from implementingCapout(fi, δ) to run in O(logn) time, instead of O(n0), asexplained above. The idea is that once the point of tangency ofFi is known, then bothfi+1 as wellas the point of tangency ofFi+1 can be obtained in O(logn) time using a simple binary search onP .

150 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

if we

here thetion

f conver-from the

oncern-

-

ay

adeof

Fig. 6. Illustration of the subroutineCapout(f0, δ).

Consequently, min -# can be solved in O(k logn) time, with a similar improvement for min -ε, obtainedby replacingn with k logn in (2.4).

Remark 2.3. The uniqueness part (part (3)) of Theorem 1.3, together with continuity, show thatrepeat the min -ε algorithm, in the outer rooted case, withα ↘ 1, the resulting approximatingk-gonconverges to a balancedk-gonQ with dH (P,Q) = δout(P, e0, k).

3. The unrooted case

The unrooted problems are analogous to the problems discussed in Section 2, except thatrootsq0 (inner approximation) orf0 (outer approximation) are not given a-priori and the minimizatakes place over all possible roots.

Exact solution of the unrooted problem seems to require a convergent process, whose rate ogence is hard to estimate. Yet, we show here that, up to possible deviation by at most one vertexoptimal, the solutions of the rooted problem answer also the unrooted one.

We shall discuss only the inner approximation unrooted problem. The discussion and results cing the unrooted outer approximation are analogous.

We begin with the min -# problem. Given aδ > 0, we choose any pointq0 ∈ ∂P and, using the algorithm of Section 2.1, we construct ak0-gonQk0 ⊂ P , with verticesq0 ≺ q1 ≺ · · · ≺ qk0−1, which is thesolution of the min -# problem forδ, rooted atq0.

Suppose that somek-gonPk is a solution of the unrooted min -# problem forδ. Thus,k � k0. Assumefirst, thatPk andQk0 have no vertices in common. ThenPk must have a vertex, sayr0, in the relativeinterior of the arcq0q1 of P . Otherwise, the arcq0q1 is contained in the relative interior of an arc, sr0r1, determined by consecutive vertices ofPk . We would then get (by the choice ofq1) dH (r0r1, r0r1) >

dH (q0q1, q0q1) = δ. The same argument implies that every arcqiqi+1, i = 0,1, . . . , k0 − 2, contains avertex ofPk in its interior. This shows thatk � k0 − 1. With some care, a similar argument can be mfor the case whenPk andQk0 have at least one vertex in common. In this case, relabel the verticesPk

so thatr0 is the last vertex ofPk with respect toq0. Thenri � qi , i = 1, . . . , k0 − 2, sok � k0 − 1 onceagain. Together with a similar argument for the outer case we get:

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 151

le whichhe outerbalance

tion,ratherand alsorom the.3 (such

Proposition 3.1. Independent of the chosen root, the solution of the rootedmin-# problem forδ has atmost one more vertex than the minimum for the unrooted problem for the sameδ.

Consider now the min -ε problem. Assume that we managed to solve the unrooted min -ε problemfor a givenk, and the result is a polygonPk ⊂ P , such thatdH (Pk,P ) = δin(P, k). Let δ = δin(P, k).Let us solve now the min -# problem, rooted at someq0 ∈ ∂P , with respect to the above errorδ. By thepreceding paragraph, the solution, rooted at anyq0 has at mostk + 1 vertices. That is, for anyq0 ∈ ∂P

we haveδin(P, q0, k + 1) � δin(P, k). Thus we have shown:

Proposition 3.2. The error in any solution of the rootedmin-ε problem fork + 1 (and a givenα > 0)at any root, is no greater thanαδin(P, k) in the inner case and no greater thanαδout(P, k) in the outercase.

4. Supporting proofs and an example

In this section we discuss the proof of Theorems 1.1 and 1.3. We also present here an exampdemonstrates that the kind of uniqueness (part of Theorem 1.3) persisting in the rooted case of tapproximation, does not hold in the analogous inner approximation rooted case. Moreover, theproperty is not a necessary condition in this case. We begin with the

Proof of Theorems 1.1 and 1.3. The proof is modeled on ideas from the area of spline-approximathese can be found, for example, in [16]. We chose to present here the full detail of the proofthan just refer the reader to [16] (say). This choice has been made for the sake of completenessbecause the situation here, especially in the case of inner approximation, is somewhat different fstandard one. Thus, for example, in Theorem 1.1 we do not have uniqueness like in Theorem 1uniqueness is obtained in Theorem 1.3, using the standard approach).

For the proof of Theorem 1.1 we may assume that the origin is in the interior ofC. We parametrize∂C

asp = p(θ), by the direction angleθ , 0� θ � 2π . Assume, without loss of generality, thatp0 = p(0) =p(2π). A k-gon with verticesp0 ≺ · · · ≺ pk−1 is associated with a partitionT: 0� θ1 � · · · � θk−1 � 2π

of the interval[0,2π ], this k-gon will be denoted byP(T). The numbersdi associated withP will bedi(T). We first show (part of Theorem 1.1, (2)) that for any partitionT we have

min0�i�k−1

di(T) � δin(C,p0, k) � max0�i�k−1

di(T). (4.1)

Clearly, only the lower bound needs to be proved. If two partitions

T: 0� θ1 � · · · � θk−1 � 2π,

T : 0� τ1 � · · · � τk−1 � 2π

are given, then there exists an integerj , 0� j � k − 1, such thatτj � θj andθj+1 � τj+1. Now assumethatT is a best partition, that is

δin(C,p0, k) = max0�i�k−1

di(T ),

and assume that the lemma is false for the partitionT, that is

η = min di(T) > δin(C,p0, k).

0�i�k−1

152 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

t

l

best

m 1.1,-

s in part

).nly

e

lities

Let j be as above, then, by the definition of the numbersdi , dj (T ) � dj (T), thus we get

δin(C,p0, k) � dj (T ) � dj (T) � η > δin(C,p0, k),

this contradiction proves the assertion.If there exists a partitionT such thatdi(T) = di+1(T) for i = 0, . . . , k − 1, then, by (4.1), this mus

be a best partition, that isdi = δin(C,p0, k) for all i. We show the existence of suchT. This is done byextending the scope of the claim a bit, replacing the interval[0,2π ] by [0, φ] for any 0< φ � 2π , andby using induction on the number of subintervals in the partition.

For a given angleϕ, 0< ϕ � 2π and for 2� j � k, we define

δin(C,p0, ϕ, j) = infT

max0�i�j−1

di(T ),

whereT : 0 � τ1 � · · · � τj−1 � ϕ is a partition of the interval[0, ϕ] into j parts. The induction wilshow that for everyϕ and everyj there is aj -partition T as above, that satisfiesdi(T ) = δin(C,p0, ϕ, j)

for all i = 0, . . . , j − 1. Takingj = k andϕ = 2π will complete the proof. We start withj = 2 and any0 < ϕ � 2π . ForT : 0 � τ1 � ϕ, di(T ) = di(τ1), i = 0,1, are continuous functions ofτ1. d0 is monotonenon-decreasing,d0(0) = 0, d1 is monotone non-increasing,d1(ϕ) = 0. It follows that there existsτ1 inthe interval, such thatd0(τ1) = d1(τ1). The argument of the proof of (4.1) shows that this must be apartition, that isδin(C,p0, ϕ,2) = d0(τ1) = d1(τ1) (the fact that in the setting of (4.1) we hadϕ = 2π wasof no importance in the proof).

Assume now that the claim has been proved forj = 2, . . . ,m and any 0< ϕ � 2π . For a givenϕ

andτm � ϕ we considerg(τm) = δin(C,p0, τm,m). This is a continuous function ofτm and is monotonenon-decreasing. Alsog(0) = 0. On the other hand, the functionf (τm) = dH (p(τm)p(ϕ), p(τm)p(ϕ)) iscontinuous and non-increasing inτm, andf (ϕ) = 0. Thus there exists 0� τm � ϕ such thatg(τm) =f (τm). Using the induction hypothesis we can findT : 0� τ1 � · · · � τm−1 � τm, such that

di(T ) = δin(C,p0, τm,m) = g(τm)

for all i = 0, . . . ,m − 1. The partition 0� τ1 � · · · � τm � ϕ is now an(m + 1)-partition of [0, ϕ] that,again by (4.1), satisfies the claim form + 1. This completes the proof of Theorem 1.1.

The proof of (1) and (2) in Theorem 1.3 goes along the same lines as the proof of Theorethe role of the verticespi there is taken here by the normal vectorsei . Note that the functions analogous to the functions that were continuous and monotone in the proof of Theorem 1.1, are herestrictlymonotone. This is the essential difference between the situations, which implies the uniquenes(3) of Theorem 1.3.

To prove (3) we first show that every circumscribingk-gonQ that satisfies (2) must satisfy also (1Notice that if we rotate only the vectorei a sufficiently small amount in the negative direction, or othe vectorei+1 a sufficiently small amount in the positive direction, then westrictly increasedi . Smallrotations of the same vectors in the opposite directions strictly decreasedi . We call this behaviorthe strictmonotonicity. Assume now thatQ satisfies (2) but there isj , 0� j � k − 1, such that

dj < dH(C,Q) = δout(C, e0, k).

We can now rotateej+1 (if j < k−1) a sufficiently small amount in the positive direction, and rotatej

(if j > 0) a sufficiently small amount in the negative direction, so that in the resultingk-gon we shall stillhavedj < δout(C, e0, k) but now, by the strict monotonicity property, we shall have the same inequaalso fordj+1 (if j < k − 1) and fordj−1 (if j > 0). We can now continue to rotateej+2 in the positive

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 153

ich,t. Thus,1) and

re mustis

lle one

m. Weimatingle need

n, ratheresentedcomingre weakerroduces

r

direction (if j + 2 < k) andej−1 in the negative direction (ifj − 1 > 0), continuing in this way until wegetdi < δout(C, e0, k) for all i. Sincee0 did not move throughout the process this is a contradiction whtogether with (4.1) (adapted to the situation of Theorem 1.3), proves that (1) and (2) are equivalenin order to prove (3) it is enough to prove uniqueness in (1). We look again at the proof of (4.assume that both partitionsT andT give rise tok-gonsQ(T) andQ(T ) that satisfy (1). IfT andT arenot the same partition then we can say more than what was said in the original proof, namely, theexist 0� j0 � k − 1 such thatτj0 � θj0 andθj0+1 � τj0+1 and at least one of the last two inequalitiesstrict. By the strict monotonicity property we getdj0(T) < dj0(T ). But, changing the roles ofT andT ,we see that there exists also 0� j1 � k − 1 such thatdj1(T ) < dj1(T). This is a contradiction, since adi(T) are the same and alldi(T ) are the same (we could replace the last part of the argument, thinvolving j1, by an application of (2)). �4.1. An example

We construct here examples of equilateral parallelograms with triangles enclosed inside theshow that, under restrictions on the acute angle of the parallelogram, a (Hausdorff) best approxinscribed triangle need not be unique at it’s root, nor a rooted best approximating inscribed triangto be unique or balanced.

Part of the evidence in these examples is based on data obtained by high precision computatiothan by analytic proof (this, of course, is not the case concerning the algorithms themselves, prabove in Sections 1 through 3, their correctness and complexity are proved analytically). Theexamples are presented in order to demonstrate that the fact that the assertions of Theorem 1.1 athan those of Theorem 1.3 is an inherent fact and not only an apparent one (note that this fact intan additional logarithmic-in-n factor to the complexity estimate).

Let P be the equilateral parallelogram with verticesABCD and side 1. The acute angle ofP isϕ = �ABC. If Q is a triangle inscribed inP then one side ofP does not contain in it’s relative interioa vertex ofQ. We may assume that this side isAB. Denote the vertices and sides ofQ by E,F,G and�,m,n as in Fig. 7. Letα = �BFE andβ = �DGE.

We consider a special case:Case0: E = A, |BF | = |GD| = d(C,m) = a (see Fig. 8). (We use the notation|KL| for the length

of the segmentKL.)

Fig. 7.

154 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

g

r obser-

0

,

f)

Fig. 8.

Applying repeatedly the law of sines we get

a = sin(β + ϕ)

sinβ, (4.2)

n = sinϕ

sinβand alsoa = 2sin

ϕ

2− b = 2sin

ϕ

2− sinϕ sin(ϕ

2 + β)

sinβ.

Equating the two expressions fora we get

tanβ = sinϕ(1+ sin ϕ

2)

−cosϕ − sinϕ cosϕ

2 + 2sinϕ

2

. (4.3)

tanβ is negative, that isβ is obtuse, ifϕ < ϕ0 = 1.2013. . . (= 68.832. . .◦). In this casedH (P,Q) = a

andQ is balanced inP . Thus in case 0 we have

dH (P,Q) = sin(β + ϕ)

sinβ. (4.4)

Case 0 provides examples of a non-unique best (Hausdorff) rooted triangle inscribed inP : let G bethe root. By Theorem 1.1Q is a best inner approximant rooted atG. We may moveE away fromA,a small distance alongAD towardD. So that the angleβ (now different fromα) remains obtuse. Dointhis does not changedH (P,Q), in this way we obtain infinitely many best triangles rooted atG.

For the non-necessity of the balance property in the best rooted triangle we need anothevation. Let, as in Fig. 7,GH be perpendicular toCD and leth = d(A,

←−→FH). For ϕ = ϕ0 we have

h = 0. It follows that there exists a leastϕ1, 0 < ϕ1 < ϕ0, such that forϕ1 < ϕ < ϕ0 we haveh < a.A computation, using Maple 9, givesϕ1 = 0.99838. . . . Hence, ifϕ1 < ϕ < ϕ0, we can start with case(considered as rooted inG) and moveE away fromA alongAD. AsE crossesH towardD we still haved(A,

←−→FE) < a, as long as this holds we have alsodH (BA,�) = a. But then the angleβ becomes acute

henced(D,GE) < a. So we get a triangleQ rooted atG, with dH (P,Q) = a (which is the minimumfor a triangle rooted atG) yet Q is not balanced inP . (We add the remark that forall 0 < ϕ < ϕ1 wehaveh > a.)

In fact, the non-uniqueness part of the above argument holds, ifϕ < ϕ1, also for the best (Hausdorfinner approximant and not only in the rooted case. This is due to the following

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 155

rangetrictlyee resulting.

aus-

.

on

,w

st

l

in

Computational Lemma 4.1. For 0 < ϕ � ϕ1 case0 provides a best(Hausdorff) inscribed triangleQ.This is not true forϕ1 < ϕ < ϕ0.

We use the term “Computational Lemma” in the following sense: the lemma states a claim for aof values ofϕ and there is a point in the proof which relies on numerical computations. Thus, sspeaking, the result is established only for a discrete set of values ofϕ in this range. We carried out thcomputations for a very “dense” set of values in this range and we are convinced of the truth of thfor the whole range, yet we chose to give the lemma a special name to express this special mean

Establishment of Computational Lemma 4.1. We check three, a-priori possible, cases of a best (Hdorff) inscribed triangleQ. These checks, except for the last one (case III-b), require only thatϕ < ϕ0.

CaseI. α � π/2 andβ � π/2. The case is divided into two sub-cases:CaseI-a. d(A,

←−→EF) � |BF |. We claim that in this case necessarily

dH (P,Q) = |BF | = |GD| = d(C,m). (4.5)

As a result, in this caseE can be moved all the way toA without increasingdH (P,Q). Also, sinceϕ <

ϕ0, α will remain obtuse and we shall be in case 0. To prove (4.5), assume first that|GD| < |BF |. Then,if we slideG towardC until equality is attained,dH (P,Q) is not increased, yetd(C,m) is decreasedNote that at this point we still haveβ � π/2, because if nowβ < π/2 thend(D,n) < |GD| = |BF | and,by sliding G a little more towardC, we are able to keepd(D,n) < |BF | and maked(C,m) < |BF |.Now, by slidingF a bit towardB, we getdH (P,Q) smaller than it was to begin with—a contradictito minimality. A similar argument also shows that at this point (when|GD| = |BF |) we getd(C,m) =|GD| = |BF | (hadd(C,m) been< |GD| we could slide bothF andG a small distance towardB andD, respectively, to get a contradiction).

Next on our way to prove (4.5), assume that|BF | < |GD|. Now we slideE towardA. If we reachAandα is still � π/2 then, by slidingG towardC, we reducedH (P,Q), contradicting minimality. Thusat some point, whenE did not reachA yet, we haveα < π/2 anddH (P,Q) has not been increased. Nowe are in case II, which will be ruled out later.

CaseI-b. d(A,←−→EF) > |BF |. In this case clearlyd(A, �) = d(A,

←−→EF). We claim that this case i

impossible for a best approximatingQ. In fact, in this case slidingE up toA increasesβ and does nochange|GD| = d(D,n). Once this is done, we may slideF towardC and reduced(C,m), keeping|BF |smaller than the originald(A, �), and then slideG a small enough distance towardD to reducedH (P,Q)

and get a contradiction to minimality.CaseII. α < π/2. Now d(B, �) = dH (AB,�) is not less than the distance fromB to the orthogona

projection ofA on BC. That is:dH (P,Q) � cosϕ. Let Q0 be the triangle of case 0 (with anglesα0 =β0 > π/2 sinceϕ < ϕ0). We have

dH (P,Q0) = sin(ϕ + β0)

sinβ0= cosϕ + cotβ0 · sinϕ.

Since cotβ0 < 0 we getdH (P,Q0) < cosϕ � dH (P,Q). ThusQ is not a best approximating trianglethis case.

CaseIII. α � π/2 andβ < π/2. We note first that in this case|BF | � d(A,←−→FE) = d(A, �). This is

because otherwisedH (AB,�) = |BF | and we can move, in this order,E towardD, G towardC andF

towardB, to reducedH (P,Q).

156 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

. 9.

het

es

we

Let γ = �GED (see Fig. 8).CaseIII-a. γ � π/2. Thend(D,n) = |DE|. We can then moveG toward C and reduced(C,m)

without changingd(D,n). After doing so we can move, in this order,F towardB andE towardD toreduced(A, �) andd(D,n) without increasing backd(C,m) too much, so that eventuallydH (P,Q) isdecreased.

Thus we conclude that, in fact,γ < π/2 and we remain with the last case, which is illustrated in FigCaseIII-b. α � π/2, β,γ < π/2 and|BF | � d(A,

←−→FE) = d(A, �).

Let g = d(A, �), h = d(C,m) andk = d(D,n), as in Fig. 9. A simple argument, like the one in tproof of Theorem 1.1 but using the strict monotonicity ofg, h andk, shows that ifQ is a best approximanthend(P,Q) = g = h = k. The analysis of case III-b is illustrated in Fig. 10. Forh > 0 we draw threecircular arcs of radiush and centers atA, C andD. Assume thath is small enough so that these circldo not intersect. For 0� θ � ϕ we draw a ray emanating fromD, that forms an angleθ with DA. Atthe point where this ray intersects the circular arc centered atD, we draw a tangent segmentEG to thatarc. We draw now: fromE − EF1—a tangent to the arc centered atA and fromG − GF2—a tangentto the arc centered atC; F1 andF2 being the intersection points of these tangents with the line

←−→BC. Let

Φ(h, θ) = |CF1| andΨ (h, θ) = |CF2|. From the geometry (and also from the explicit formulas that

Fig. 9.

Fig. 10.

M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158 157

at

,

.ngle,

lhede

t the

Fig. 11.

derive later) it is clear that for a fixedθ , Φ(h, θ) is decreasing andΨ (h, θ) is increasing inh. Moreover,checking the behavior ofΦ and Ψ at very small and very largeh, we see that for everyθ in [0, ϕ]there is a uniqueh(θ) = h(θ,ϕ) for which Φ(h, θ) = Ψ (h, θ). For suchh(θ) we haveF1 = F2 = F(θ).A geometric observation shows that ifh1(θ), h2(θ) are the solutions of the equationsΦ(h1, θ) = 1 andΨ (h2, θ) = 1 respectively, thenh1(θ) is decreasing andh2(θ) is increasing. This, in turn, implies th|CF(θ)| � 1 if and only ifϕ/2� θ � ϕ. Thus, forϕ/2� θ � ϕ we obtain in this way a triangle�EFG

with β,γ � π/2 (equality toπ/2 only at the end points of theθ interval) with, in the notations of Fig. 8g = h = k. That is, a candidate to be a best approximant. Now we have to optimize overθ and check.

The functionsΦ andΨ are easy to write using simple trigonometry:

Φ(h, θ) = sinϕ√

(cosθ − h)2 − h2 cos2 θ − hcosϕ cosθ + h2

hcosθ,

Ψ (h, θ) = hcos(ϕ − θ) − h2

sinϕ√

(cos(ϕ − θ))2 − h2 cos2(ϕ − θ) − hcosϕ cos(ϕ − θ).

Yet the equation

Φ(h, θ) = Ψ (h, θ) (4.6)

is hard to solve explicitly forh = h(θ), or even to analyze the behavior ofh(θ) using implicit methodsWe made the analysis numerically using the Maple 9 software. The aim was to find, for a fixed aϕ

(a fixed parallelogram), the angleθ that gives a minimalh, such that�EFG is of the type of case III-band then to compareh with h0 = dH (P,Q0) (Q0—the triangle of case 0 for thisϕ).

We computedh(θ) = h(θ,ϕ) by solving numerically Eq. (4.6) forθ ∈ [0, ϕ] and plotting the resultinggraph. This has been done for values ofϕ in [0, ϕ0] in steps ofϕ0/100. The property ofh(θ) that wediscovered in these computations is that, for all these values ofϕ, h(θ) is strictly concavein [0, ϕ] (seeexamples in Fig. 11). Since we are interested inθ ∈ [ϕ/2, ϕ], it follows from concavity that the minimavalue ofh can be attained only at the end pointsϕ/2 orϕ. These values are easily computed and grapand for allϕ ∈ [0, ϕ0] the minimumhM(ϕ) is attained ash(θ) for θ = ϕ. This is as far as we need thcomputational part. The rest is analysis.

We now distinguish between the casesϕ < ϕ1 andϕ > ϕ1. For ϕ < ϕ1 we show thathM(ϕ) > h0(ϕ)

and also|BF | < hM(ϕ). Thus the minimal triangle of case III-b is not a best approximant. Look a

158 M.A. Lopez, S. Reisner / Computational Geometry 32 (2005) 139–158

e

the

he

numer-

Algo-

om. 23

Algo-

ree and

4–147.Internat.

raph.

puta-

pacts,

) 445–

(1975)

58.

9–378., 1983,

triangleQ0 of case 0 for thisϕ (Fig. 7, witha = h0). Note that, sinceϕ < ϕ1, we haved(A,←−→FH) > h0.

Let us moveF towardB andG towardC, increasing bothd(C,m) and|GD|, in such a way that thestwo distances remain equal throughout the motion. At the same time moveH towardA, keepingGH

orthogonal toCD. During this processd(A,←−→FH) is reduced. Keep the process untild(A,

←−→FH) becomes

equal tod(C,m) and|GH |. This happens beforeF reachesB because when it happens we get exactlytriangle of the above discussion withθ = ϕ (except that it is marked now as�HFG instead of�EFG).ThushM(ϕ) = (the last)|GD| > h0(ϕ). On the other hand, clearly here (the last)|BF | < h0 < hM .

Consider now the caseϕ1 < ϕ < ϕ0. We begin again with case 0. Now we haved(A,FH) < h0.Let us slideH toward D until d(A,FH) = h0. Now d(D,GH) < h0. We can now moveG a littletowardC, reducingd(C,m) and still keepd(D,GH) < h0. If we now slideF towardB, the amountthat|BF | is reduced is bigger than the amount thatd(A,FH) is reduced (check the angles!), thus, if tamount that we slideF is small enough, we get a new triangle:�HFG with |BF | < d(A,FH) < h0,d(D,GH) < h0 andd(C,m) < h0. This shows that the best one,Q, obtained for someθ ∈ [ϕ/2, ϕ] (infact for θ such thath(θ) = |BF(θ)|) also satisfiesd(P,Q) < h0(ϕ).

We make here the remark that numerical computations verified all the above cases. In fact, theical computations led us to the above analysis.�

References

[1] A. Aggarwal, J.S. Chang, C.K. Yap, Minimum area circumscribing polygons, Visual Comput. 1 (1985) 112–117.[2] A. Aggarwal, M.M. Klawe, S. Moran, P. Shor, R. Wilber, Geometric applications of a matrix-searching algorithm,

rithmica 2 (1987) 195–208.[3] P.K. Agarwal, K.R. Varadarajan, Efficient algorithms for approximating polygonal chains, Discrete Comput. Ge

(2000) 273–291.[4] E.M. Arkin, Y.-J. Chiang, M. Held, J.S.B. Mitchell, V. Sacristan, S.S. Skiena, T.-C. Yang, On minimal-area hulls,

rithmica 21 (1998) 119–136.[5] G. Barequet, D.Z. Chen, O. Daescu, M.T. Goodrich, J. Snoeyink, Efficiently approximating polygonal paths in th

higher dimensions, Algorithmica 33 (2002) 150–167.[6] J.E. Boyce, D.P. Dobkin, R.L. Drysdale III, L.J. Guibas, Finding extremal polygons, SIAM J. Comput. 14 (1985) 13[7] D.Z. Chen, O. Daescu, Space-efficient algorithms for approximating polygonal curves in two-dimensional space,

J. Comput. Geom. Appl. 13 (2003) 95–111.[8] H. Groemer, On the symmetric difference metric for convex bodies, Beitr. Z. Algebra Geom. 41 (2000) 107–114.[9] H. Imai, M. Iri, Computational-geometric methods for polygonal approximations of a curve, Computer Vision G

Image Process. 36 (1986) 31–41.[10] H. Imai, M. Iri, Polygonal approximations of a curve—formulations and algorithms, in: G.T. Toussaint (Ed.), Com

tional Morphology, Elsevier Science, Amsterdam, 1988.[11] P.S. Kenderov, N.K. Kirov, A dynamical system approach to the polygonal approximation of plane convex com

J. Approx. Theory 74 (1993) 1–15.[12] M.A. Lopez, S. Reisner, Efficient approximation of convex polygons, Internat. J. Comput. Geom. Appl. 10 (2000

452.[13] M.A. Lopez, S. Reisner, Linear time approximation of 3D polytopes, Comput. Geom. 23 (2002) 291–301.[14] D.E. McClure, Nonlinear segmented function approximation and analysis of line patterns, Quart. Appl. Math. 33

1–37.[15] D.E. McClure, R.A. Vitale, Polygonal approximation of plane convex bodies, J. Math. Anal. Appl. 51 (1975) 326–3[16] G. Meinardus, Approximation of Functions: Theory and Numerical Methods, Springer, New York, 1967.[17] S. Reisner, C. Schütt, E. Werner, Dropping a vertex or a facet from a convex polytope, Forum Math. 13 (2001) 35[18] G.T. Toussaint, Solving geometric problems with the rotating calipers, in: Proc. IEEE MELECON, Athens, Greece

pp. 1–4.