Sei sulla pagina 1di 34

Robotics Research

lischnical Report

^"4,..,'"'^C/7,

r)^

j^
"-"-1

"'""il'W^
ii""']*V''-*"ni%f'?.\'^

Computing

the Geodesic

Center

of

Simple Polygon

by
R.
M.

Pollack
Sharir

Report No. 231


Report No. 74

Technical
Robotics

July,1986

New
^

2""

to

University

of Mathematical
It Institute

(0

ox;
-H

York

j^

"M

Computer Science

Division

251 Mercer Street NewYork,N.Y

10012

Sciences

Computing

the

Geodesic

Center

of

Simple

Polygon

by

R.

Pollack

Sharir

M.

Technical

Robotics

Report

No.

231

Report

No.

74

1986

July,

York

New

of

Dept.
Courant

Institute

of

251

New

Work

on

Grant

DMS-8501947.

of

Naval

this

Work

Research

and

Part

Movable

Barbados,

Separability
Feb.

1986.

by
of

first

on

Mercer

York,

author

this

has

the

of

work

Sets

on

at

York

been

10012

supported

the

by

Sciences

Street

New

paper

second

the

this

the

Digital
paper

Billairs

National

by
author

National

from

grants

Science

Mathematical

N00014-82-K-0381,

Grant

DCR-83-20085,

Corporation.

the

by

paper

University

Computer

has

Science

has

Research

been

supported

Institute

out

at

of

the

McCiill

Office

No.

and

Corporation,
carried

by

Grant

Foundation

Equipment

Foundation

Science

been

the

Workshop
University.

NSF-

IBM

on

and

Simple Polygon

(^'^^

Sharir

M.

York

New

of

of Mathematical

Institute

Courant

'

(^)

Pollack

R.

Center

Geodesic

the

Computing

Sciences

University
and

'

of Mathematical

School
Tel

Aviv

Sciences

University

ABSTRACT

The

geodesic

polygon which
in the

point
the

1.

geodesic

of

center

present

point inside

the

distance

any

internal

which

algorithm

an

simple polygon with

point

inside

to

calculates
in time

vertices

the

furthest

served

is

consider

the

the

from

to

problem

standard

See

Fig.

([Me], [Dy]), but

its extension

simple polygon

Work

this

on

Work

Research

Grant

by grants

from

has

Institute

paper

of

by
on

the

first

this

author

paper

N(X)014-82-K-0381,

by

has
the

National

be

always

or

the

problem

geodesic
be

can

of

on

the

finding

locate

supported

second

author

Science

Foundation
the

by

has

IBM

National
been
Grant

Science

supported

time

geodesic

No.

Corporation.
Separabihty of Sets

Office

Grant
of

Naval
and

NSF-DCR-83-20085,
Part
at

of

the

the

work

Bellairs

an

problem.

in

Foundation

by

of

polygonal

center

solved

be
can

kind

to

e.g.

the

to

We

another

as

far

the

of

vertex

station

nurses

of

since

community

want

any

points (the

problem.

center

simple

is least

of

set

the

from

difficult.

more

been

P)

facilitylocation

finite

of

we

problem

Corporation, and
Digital Equipment
Movable
carried
the Workshop
been
at
on
out
McGill
University, Barbados, February 1986.
the

where

island

the

to

to

appears

hull

illustration

an

is

geodesic

problem

1 for

Euclidean

facilitylocation

facilitylocation

Euclidean

of

convex

the

polygonal

inside

inside

route

the

polygon

the

finding

point

serve) [Me], [Dy]. Indeed,

to

standard

the

the

which
point (facility)

the

furthest

the

of

center

of

on

of

point inside

solution

service

hospitalfloor.

DMS-8501947,

from

facility location

emergency

location

the

(by

generalization of

facilityis

the

geodesic

the

constrained

for

metric)

which

point

polygon,

The

asks

Euclidean

community

is

minimal,

locate

to

distance

internal

maximal

is

which

problem

(in

whose

in this paper,

addressed

problem

polygon

paper

We

polygon.

maximum

the

minimizes

is

simple polygon

Introduction

The

of

of

center

on

this

Research

0{n)
center

-2-

problem of computing the geodesiccenter of a simplepolygon has


and G. Toussaint
been considered
[AT]. They show that the
by T. Asano
geodesic center is unique and present an algorithm to compute it in time
0{nHog n), where n is the number of vertices in the given polygon. The
The

idea

main

Voronoi

algorithm is

their

of

of

diagram

geodesiccenter
of a geodesic diameter
vertices

which

will also

use

There

has

been

(ie.

diameter"
"geodesic

to

to denote

algorithmsto find the

many

polygon.
space algorithmdue

then
to locate the
polygon
the midpoint
at
diagram or
path inside the polygon joiningtwo
all choices of pairsof vertices).
We

length over

best result at the

The

the

shortest

geodesic furthest-point
and

of the Voronoi

a vertex

maximal

the term

have

vertices of

the

at either

the

construct

to

present time

the

lengthof

geodesicdiameter
is

an

0(n log n)

that

of

time and

path.
simple

0(n)

[Su].

S. Suri

related

problem is to compute the link diameter and the link center of


the link distance between
two pointsis the minimum
a simplepolygon, where
number
of edges in a polygonaa path joiningthem
inside the polygon and
where
the link center and diametei
defined in an analogous manner
to the
are
definition of geodesiccenter drid diameter.
In this case
the link center is no
but
consists
of
wliich
be
a
longer unique
as large as the entire
polygon
may
time and
given polygon. Suri [Su2]has an 0(n iog^/i)
0{n) space algorithm
which
computes the hnk diameter of a simple polygon and [Lea]presents an
O(n^)algorithmfor computing the link center of a simple polygon. Suri and
El-Gindy (private communication)also report similarlyefficient algorithms
for computing the link center.
A

Our

algorithmproceeds as

polygon P,
diagonalsof

then
the

follows.

We

start with

perform something like a


triangulation,
determiningat

of
triangulation
binary
through
each tested diagonal,via
a

search

the
the
the

to be describe in Section 3 below, on which


algorithmRELCEN
side of that
the
diagonal
geodesic center lies. In this way we locate a trianglewhich

contains

the

geodesiccenter.

the combinatorial
We

next

use

modification

in linear time

programming

the structure

where
remains

constant,

of the
and

words,

in

the j-th vertex


1

1,2,

smallest

our

of P

,n.

The

circle that

circle is centered

at

[Me]

to

path from
followed

around

in this

triangle
path to a given vertex can change.
for
Megiddo's method
doing linear
find a polygon R within this triangle
each pointx ^ R to each vertex
of P
v

the

by
subregionR,

final
has

of

consists of

possiblydifferent,vertex
other

However,

as

we

move

of the shortest

structure

fixed

straight
segment
fixed

path

of known

the internal distance

from

to

some,

lengthto v.
from
a pointx

In
to

for
analyticexpressionof the form [xw,|+c,,
problem that remains is equivalentto that of finding a
contains a given collection of n circles (where the z-th
u, and has radius c,).This final task is accomplished by
a

-3-

technique of Megiddo [Me2] for deriving efficient sequential


algorithms.
algorithmsfrom parallel
optimization
another

The

total time

complexity of

(thatof findingthe

our

The final stage


algorithmis 0{n log^n).

spanning circle

smallest

independentinterest in location

theory,runs

which
be
circles),
may
0{n log n log log n).

of

of

in time

organized as follows. In section 2 we present the geometric


which is presentedin
the algorithmRELCEN
needed to justify
preliminaries
the
section 3. In section 4 we
complete algorithm,and concluding
present
remarks
are
given in Section 5.
The

paper

is

i
2.

Geometric

Preliminaries

P is a
simple polygon with n vertices (more precisely
closed
boundary is a given simple
simply-connectedplanar region whose
polygon). For x,y in P, g(x,y)is the shortest path inside P between x and y,
the straight
let xy denote
d{x,y) is the length of this path. Furthermore
its length.Finally,we
let u{x,y)
segment with endpoints x and y and \xy\
in the direction that the path gix,y)starts at from x,
denote the unit vector
and define the angle Ucyz as the smallest of the two
angles between u(y,x)
Definitions.

Let P

be

and

u(y,z).A subset
g(x,y)is a subset of
sets is

convex

is called P

of P

It

C.

if whenever

-convex

are

in C,

that the intersection of P-

immediately follows

P-convex, and that P-convex

x,y

sets are

connected.

Preparata [LP],g{x,y)is a polygonal path whose


vertices of P. For a fixed pointx in P, the union of g{x,v)over
corners
are
call the
all vertices v of P is a planar tree Q{x) (rootedat x), which
we
shortest path tree of P (withrespect to x). This tree has n nodes, namely the
vertices of P, and its edges are straight
segments connectingthese nodes. It
has been shown
by Guibas et al. [Gea] that this tree can be computed in
As

shown

in Lee

and

linear time.

geodesic paths g{a,b),


g{b,c)and g(c,a).There exist pointsa' b' and c' such that the paths g{a,b)
the paths g{b,c)and g{b,a)intersect
and g{a,c)intersect in the path g(a,a'),
in g{b,b') and
finallythe paths gic,a) and gic,b) intersect in g{c,c').
has only reflex angles
that the geodesictriangleAa'b'c'
Moreover
we
see
along its boundary with the exceptionof the anglesat a' b' and c' (seeFig.
Given

points a,b,c in P, Consider

three

the

2).
Lemma
which
Proof.

As

a;

varies

has its maximum


Without

loss of

i.e. g(a,b),g{b,c)and

openly along g(b,c),d(a^)


at fc or

at c,

i.e. d(a,x)"

max

is

unimodal

function

d{a,c)}.
{d(a,b),

that ^.abc is a geodesictriangle,


assume
we
generality
and that g{a,x)and g{a,b)
g{a,c)are openly disjoint,

-4-

Let
openly disjoint.

also

are

Let x' and

common.

x'

'

q be the last

g{a,c)have in
respectively

and

pointthat g{a^)

be the intersection of qx with

and

ab

be

have d{a^) " |ax'|


+
we
\k'x"\.
d{a,q)"\ax'\+ \x:'q\,
the
Otherwise
is
"
"
"
then
d(a,b).
angleLqx"c
\ab\
d{a^)
[x'a;"|[x'^l,

(seeFig. 2). Since


If

Hence
"
\qc\.
\qx"\

"
tt/I,whence
certainly

dia^)

d(a,q)+ \qx"\"d{a,q)^ \qc\" d{a,q)+ d(q,c)

"

d(a,c)

Q.E.D.
The

Corollary 1.

closed

ball of radius

B(r^)

at x,

{y ^

\d{x,y)

"

r},

at a'

is

is P-convex.

Corollary

or

It is obvious

that

Let

the notation

2. With

greater than

of P.

also

proof of the lemma

The

F{x)

is continuous

of P

and

is the intersection of the closed

geocen{P)contained

g{x,y)and
along

the

each

geocen{P)
[AT]).

{vi,V2,
.

from

be
.

diagonalD
v; then

,v^}

For

c.

Suppose

a
=

of

segment

any

of P

that

{x ?

g{x,v)must

gr{P) centered

from

vertex

is

the

that

line

would

they

If the set

through c

then

Remark.

If two

the

and

has

Given

vertices

to contain

be

constant

Lemma

1.

(cf.also

from

be

geodesic distance

a
orthogonalto u(c,v) determines
two
(the"sides" of D).
components

since the

V(c)}does

not

which

does

angleLjc'cv

F{c),

lie in

is tt/Z

whence

an

not

open

contain
we

see,

is not

half-plane

geocen(P).

geodesiccenter

Definition.
P

{u(c,v)[v

of

vertices

all have

2.

to

center

furthest

by Corollary 2, that d{x,v)" d{x',v)" d{c,v)


geocen{P)(seeFig.3). As a consequence we have
Lemma

have

geodesic

the side of D

at x' and

at the

have

clearlyimpossible by

let the

lyingon

D, say

cross

points

pointsx,y it would

separates P into
P

called the

singletoncalled

point of

value

distinct

point of P and
V(c) and suppose
in V(c), the
v
a

set of

the vertices

over

minimum

\F{x) gr{P)}

g{x,y),which

which

is

j:

is

is taken

bells of radius

two

of P.

vertex

thercfoi'e has

geodesic distance

Hence

Let

for

gr(P). The

denoted

angle Lb'a'c'

d(a,b),d{a,c).

ihe maximum

and

geocen{P)
If

d{b,c)

d{x,v),where

if the

lemma,
"

d{a,x)is maxiraired
max

geodesic radius

of P.

of the

equal to 7t/2 then

Qearly

implies

directions
and
a

u{c,v{)and u(c,V2)are opposite,then again c is


is a geodesicdiameter
g(vi,v2)
(whose midpoint is c).

cut

endpoints on

of P, i.e.
the

segment

boundary

of

which

P, thus

openly contained in
separatingP into two
is

-5-

the relative center

components,

F{x) for

minimizes

V(c) lie in
unit vector
side

the

an

open

d{c,v)

Let

Proof.
has

that all directions

suppose

r' "

c' to any

V(c),while

in

from

in V(c) 'isat

not

vertex

min

of
of

segments

boundary
from

of

single circular
the boundary of

P).

to py,

5(8,c), and

most

r.

that the

B{r"r',c) the
Choose
a positive
initial

V(c)
for all vertices

P.

intersection which

by

3.

of P, since for

in

V(c),

algorithm

Let

be

d(p,v)"

of the closed

Since

the

r
,

for the other vertices of P.

balls of

some

geodesic center

of

radius
P

r"

must

"

also

Hence

at each

of

lie in this

(sinceP-convex)and disjointfrom C (since,


RELCEN{C), F " r " r" on C), we see that the geodesic

of P lies on

The

two

is connected

definition of

center

that

alreadyseen

lies in the intersection

vertices of

most

the

B(8,c)

d(p,v)" d{p,py)+ d(py,v)" d{c,py)-H d(py,v)


have

at

of

"

we

oi B

boundary

possiblya portionof

and

segment

for c' in

each

where

satisfies d(p,v)"

so

from

is on the
in case
c
(thelatter might occur
let
be
the
distance
6 V{c)
v
peri^endicular
/z(v)
p^ is the intersection of g{c,v) and the boundary of
min
C
h(v). The point c + hu*
p in 5(8,c)

For

let h

arc

furthest vertex

length of the smallest

p is the

consists

u* be

Let

the next
that

Note

c.

{r" r',p},where
for
small
in V(c), sufficiently
V
g{c,v)

and

u(c,v)for

the line H

and in this

for each

geodesic distance

distance from
8 "

which

through c.
by
Then
half-plane.
geocen(P)lies on
u* points (seeFig. 4; the proof will imply that u*

which

to

of C

is the

uniquepointc
c.
RELCEN{C)

half -planebounded

orthogonalto H

of C

on

and

RELCEN{C),

of P

is denoted

and

pointalong C).

cannot

Let

3.

Lemma
in

in C

cut

the

same

side of C

as

Q.E.D.

p.

RELCEN
of P, i.e. C

is

openly contained

in P

and

has

endpointsa

boundary of P. We construct, in linear time by [Gea],the tree


Q{a) of shortest paths from a to the vertices of P and the tree Q{b) of
shortest paths from b to the vertices of P. For each edge e of either of these
find the intersection (e,C) of the line determined
trees we
by e and the line
and

on

the

by C. If (e,C)lies in C and the segment


(the algorithms in [Gea] provide this information

determined
P

Q(a)

in overall linear time), then

Q{b)
Fig. 5). These
U

0(n) points are

critical

we

mark

from

the

points where

for

(e,C)to
all

lies in

edges

point (e,C)on
the

structure

in

(see

of

the

of P and the analytic


vertex
v
path from a point x on C to some
expressionfor d{x,v)change; i.e. for j: in a subinterval determined by these
by v.
0(n) points, the analyticform of d(x,v) is uniquely determined
shortest

-6-

+
[xu^j

The

functions

F{x)

Cy, where

d{x,v) for

of

vertex

Given

is also unimodal.
d{x,\")

max

determined

of P
Uy is a vertex
of
in
which
C
locate the subinterval

Namely, d{x,v)
objectis next to

RELCEN{C)

are

unimodal

on

pointc

of C,

can

by

we

v.

Our
lie.

must

hence

C,

determine

the side of

Q{c)

time)the tree

is located

RELCEN{C)

which

on

paths from

of shortest

by again calculating
(in0{n)
and then by

to the vertices of P

d{c,v),and the side of c


findingthe furthest vertex v from c. Then F{c)
where
is
the
on
F{x) is minimized
point
C) is
containingRELCEN{C) (which
c
determined
(a similar rule
by the sign of ttie derivative of d{x,v)at or
than one
vertex
when
v).
japplies
F{c) is simultaneouslyattained by more
Hence, performing a binary search over the 0{n) critical points(e,C)on C,
=

we

find

can

time

interval C

4oss

of

d^x)
I,

envelopeF{x) of
This

final

di;

runs

as

c,

locate the

to

di of

now

the

on

the form

[0,1]

x^

are

we

of the upper

unique minimum

and

note

be

can

also

simpler than the


algorithm is substantially
of
implemented in time linear in the number
the goal of this step is stated in a manner

the

that

The

of P.

structure

techniqueof Megiddo

method

for linear

we

is

use

programming

variant of the

in R^

[Me], and

follows.

We

n/2

at most

in each

side of C.
one

di in

the functions

group

functions

most

want

functions

given n

are

that

assume

may

i-

we

every

v.

[{x-xiy
yf]

step of

independent of the
linear time

we

which

these functions.

preceding steps,
functions

solelyby

which

and

,n,

the

generalitywe

over
[0,1],

in
of C
[a',fc']
analyticform of d{x,v),for

subinterval

which

over

of P, is determined

Without

for i

0{n\ogn)

lies,and

RELCEN{C)
vertex

in

of P

pair correspond to two


Let di, dj be such a pair. We
claim that
intersection
point on C. Indeed, suppose

di{x) dj{x)and diiy) dj(y)for


have
Then
we
{xi,yi),
v/
(xj,yj).
vj
=

that lie

these

distinct

two

that the two

pairs,so
disjoint

vertices

to

the

on

functions
the

points

same

have

at

contrary that
x,y

i C.

Let

[xvj+

Ci

+ c,
\yv,\

+
\xVj\
Cj
+
\yvj\
Cj

or

+
+
\yvi\ [xv^I
\xvj\
\yvj\
=

Since

v,,

segments

Vj

are

vertices

of P

xvi, xvj, yvj, yvj are

lying on

all contained

the

same

side

of

in P, it follows

C, and

the

four

that either xvj and

or
intersect,

yvi

xv, and

overlap. In
(cf Fig. 6)
inequality
segments

yvt,

the segments

yvj intersect,or

first

the

yvj

case

overlap, or the

xv,, xvj

have, using the

we

triangle

"
+
+
\yvt\
\xvi\
\kvj\
\yvj\
,

which

of the

each

We

0(n)

remaining

cases,

thus

0{n)

critical

collect these

time.

then

We

and

at Xq,

Similar contradictions
previous equality.

the

contradicts

find,

that xq is the relative minimum

either determine

this relative minimum

find which

side of xq contains
pairs of functions whose

n/4
know

which

discard

the

remaining functions
c

further

consideration.

in constant

and

at

in linear

runs

we

therefore

can

step for the

same

number

0{\og n) iterations,the

most

else

or

Thus, in 0(n) time

d,, and then repeat the

the entire step

Thus

time.

at

small to allow
sufficiently

becomes

C,

on

side of xq,

other

the

the other

from

After

functions.

remaining 3n/4

on

of F

in

xq

Thus, for each of the

c.

dominates

quarter of the functions

lies

intersection

functions

function

smaller

discard

we

of the two

claim.

establishingour

points,and calculate their median


attain the maximum
above, which function(s)

as

in

obtained

are

of

explicitcalculation

time

(see[Me]

for

of

more

detail).
Let
the

be

paths Q{c)

of shortest

tree

allow

us

which

side of C

that

It is clear that

RELCEN

is used

below, with

The
We

are

calculation

as

of

P,

2 and

Lemmas
of

time

or

else

on

0(n log n). The

algorithm

complete algorithm GEOCEN

given

produced by RELCEN

algorithm halts

and

is the

outputs this

center.

GEOCEN.
in

now

is

RELCEN

that if the output

then the entire

center

0{n)

lie.

must

in the

subroutine

geodesic

in

construct

we

the vertices of P.

to

is the

complexityof

the

of P

algorithm

that

Again

C.

on

from

geodesic center

the convention

geodesic center

4.

either

determine

to

of P

relative center

the

describe

position to

geocen{P).It

consists

of the

the

complete procedure

for

the

following steps.

TriangulateP (intime 0{n log n) using the algorithm in [GJPT], or more


using the algorithm of Tarjan and Van Wyk [TV]), and place the
efficiently
in a balanced
internal edges of the triangulation
binary tree T [Ch] such that

I.

for

subtree

each

collection
such
and

the

of

right children
of

of

trianglesthat

the number

that

number
tree

of

edges
can

be

in the

edges stored

7, the

of

edges

of

cover

in each

node

subtree

constructed

connected

of

of the
T

rooted
in

linear

at

are
e.

time

at

nodes

the

of

simple subpolygon
two

subtrees

both

Such

at
a

rooted

least

[Gea], or, by

of P,

and

at the

left

third of the

one

balanced

bound

decomposition
an

alternative

-8-

in 0{n log n) time [Ch].


technique,
We

search the tree T to locate the

next

correspondingdiagonale of

to the

apply RELCEN

path, we

along the search

of T

each node

At

of P.

geodesiccenter

contains the

which

of P
triangulation

of the

triangleAabc

to determine

at the
geocen{P), and then continue
of RELCEN,
appropriatechild of that node. Hence in 0(log n) applications
the
Thus
obtain the desired triangle.
takes 0(n log n) time, we
each of which
total time requiredby this step is 0{n log^/i).

side of

which

the

contains

search

region within the triangleAabc in which, for


of
form
of the path g(x,v)and the analytic
of F, the structure
each vertex
v
by the vertex
the correspondingfunction d{x,v)sre both uniquely determined
n.

Next

locate

to

want

we

V.

this end

To

the trees

construct

we

Q{a), Q{b), Q(c) of shortest paths from


ihe k
0(c) "tangents",i.e. extensions

and record
respectively,
that
that actuallyenter
the triangleAabc
of shortest
path edges toward
triangle(see Fig. 7). (As a matter of fact, we only need to calculate the
the
of shortest paths that do not cross
portion of the tree Q(a) ccrxsisting
for Q(b), Q{c).) Within
and sirnil"jly
any
opposite side be of our triangle,
region determined
by these tangents ihe structure of g(x,v)and the analytic
and

a,

d(x,v)are

of

form

both

uniquelydetermined

the vertex

by

v.

Our

task is thus

geocen(P).
this end, we
and
To
use
adapt a technique used by Megiddo [Me] in his
find the
linear-time algorithmfor linear programming in R-'. Specifically,
we
have
median
slope and
positive
slope of these tangents and let T-^,
,T^f2
to

determine

the side of each

of these

one

Tkn+\"
axes

"

"

have

'Tk

"

where

the x-axis

intersections of
median

Cj

x^

j: -coordinates

by

Cjc to determine
intersection

and

apply

is in the

the line
which

side

points lying

"'i. Take

RELCEN

geodesiccenter.

Now

to

1,

orientation of the

new

slope. Form
.

.k/2. Next

points. Take

k/2 intersection

the k/2
find

of

triangleAabc and apply RELCEN


C^ contains the geodesic center. For the

k/4

their median

y-

the

Cy

Cy

for each

other

determined

to

the

the cut

j^i in the

on

the cut

respect to

7^/2+1 for

of these

direction of the median

the lines T, and

of the

determined

coordinate

negativeslope with

contains

tangents which

determine

of the it/8

side

by

of

C^

find

the line y

which

side

of

to

ji in this triangle
Cy contains the

pairsof tangents whose

intersection

quadrant determined by C^ and Cy and oppositeto the quadrant


containingthe center, we can discard one of the two tangents (sincethe side
of it containinggeocen{P) is now
known). In addition, we add the two halfby the cuts C^ and Cy and containing geocen{P) to a
planes bounded
in C"(logn)
Thus
collection of half-planesthat the algorithm constructs.
of RELCEN
find the side of each tangent containing
we
can
applications

lies in the

-9-

geocen{P),

and

the

at

time

same

obtain

half -planes whose

0(log n)

to contain geocen{P).We

intersection is known

then

find

point
arbitrary

an

that can
be
half-planes,
accomplished in 0(logn) time, using Megiddo's technique for twodimensional
linear programming [Me], and then calculate the shortest-path
in
tree Q{w)
0{n) time. By the precedingdiscussion,the structure of Q{w)
form
of each function
and of Q{geocen{P))are the same,
so that the analytic
d{x,v) throughout the intersection of those half-planescan be readily
in

lying

the

intersection

these

of

task

determined.
In the

Remark.

interior
in the

"

region

:' tic

form

must

be

cut

of P.

But

found

terminated
assume

in.

The

that

1,

ignore P

F{x)

Note

max

that

on

in

that

2, that

geocen(P)is an
if geocen{P)lies

procedure sketched above will


properly obtain the fixed
in that region. Finally,if
x

the

which

to

c) then

it

is also

that cut

would

have
consequently would
in the suc-ceeding
step lU, we

of P.

finding the

+
ixv^(/)|
C/,

minmax

where

precedingremark

regard each

plane,because

RELCEN

or

cut, and

vertex
to

side of Aabc

step EI,and

reduced

now

completely and

the entire

over

of

,n.

lie

d{x,Vi)

to

geocen{P)is not

di{x)

center,

that

will

and

be incident to

so

algorithm.Hence

is

of P, the

of
preceding application

problem

functions
i

then

assumed

d(x,v) for
(which is to say, geocen{P)is a, b,

of P

vertex

geocen{P)
our

edge

functions

the

reflex vertex, and

can

an

have

we

check, using Lemma

to

containingthe

of

geycen{P)is

have

It is easy

P.

relative interior of

locate
'

pointof

precedingarguments

C/

be the

family

of

for
^(Vit(/),v,),

discussion

and

of the functions

geocen{P)must

of

allow

us

to

di{x)as being
unique globalminimum

defined

di{x).

This final task

can

be

accomplishedby

techniquedue

to

Megiddo [Me2]

parallel algorithms in the design of efficient sequential


first consider
a
optimization algorithms. To apply this technique we

which

uses

restricted version of the

problem,in

which

we

want

to determine

the relative

c=RELCEN{C), and also


given
of F lies. This problem
which
side of C the globalminimum
determine
on
in fact be solved by a similar procedure to the last step of the RELCEN
can
of functions (and is
algorithm,which runs in time proportionalto the number
of
For
of
vertices
P!).
expositionsake we sketch
independent of the number
denoted
here by RELCEN*,
here the variant of the last step of RELCEN,
in each of which
needed
a fixed
in this case.
It consists of 0(logn) substages,
fraction of the functions di(x)stillpresent is being discarded
(becauseJ,(c)is
with
left
until
are
we
determined
to be less than F(c)),
only 0{1) functions,
of
side
the
C
well
C
as
whose
relative minmax
on
containingthe global
(as
minimum

F{c)

of

F{x)

on

Hne

C, where

-10-

minimum

F(x))

of

the remaining k functions in

combines

two) pointson

di, dj the (atmost


k

critical

C.

points on

0{k) time
F(xo)
by calculating
in

calculate

at Xq. Next

and

containingc,
determine, for

di

least

xi

find

U4

The

side

the

of

Thus

containing c.

x-^

pairs of functions, which

of c
small to allow direct calci.ilation
sufficiently
performing two median calculations at e-ach step
[Ze].)Qearly the time complexityof RE-LCEN*
find

To
execution
of

the side of xq

of the critical pointslyingon

the

of

median

of

we

can

the

two

in the

continue

value

dj,thus

pair dominates the other at c, and thus discard the smaller


remaining 3/:/4 functions are then passed to the next substage. We
is
of remaining fimctions
imtil the
number
in this manner

functions
one.

at which

xq of these points,and
minmax
the
relative
the side of xq containing
on
c
C,
of
the
derivative
and
F
along C
max
evaluating
di{xo)

again

at

substage
pair
obtainingat most
for each

determines
disjoint
pairs,

find the

then

We

find the median

we

such

Each

time.

in constant

found

be

can

RELCEN*

of

y*.

desired

the

this

Denote

first step of

The

in

0(1) time.

of RELCEN*
is

(The idea
is taken

of

from

0{n).

simulate
the
z*
{x*,y*),we
glob.ilminmax
the
the line y~y*, without
on
knowing explicitly
line by C.
=

REI.CErs'"

is to

group

the

di{x)in

functions

n/2

curve
a
simple unbounded
pair d^, dj determines
7,^
of a hyperbola or a straight
which is either a branch
line,on which di
dj.
coincides
with C; we
Each ytj intersects C in at most
two
points,unless "y,j
be handled
will assume
does not arise;it can
that this latter case
by minor
Before
have
modifications of the algorithmdescribed below.
we
proceeding,
determine
to
exactly at how
points each 7^ intersects (the still
many

disjointpairs. Each

unknown)
horizontal

This

is done

tangency, then
the

Otherwise
the

C.

positionof

number
C

as

If 7,^ does
in
intersect C

follows.

it must

of intersection

pointsis

relative to the horizontal

either

point of
precisely one
point.
0 or 2, depending on
have

not

tangent of 7^.

We

thus collect the

them
y* among
by a binary
is performed by applying RELCEN*
to the
search, each step of which
horizontal
time
determine
line.
Thus
in
total 0(n log n)
can
we
appropriate
intersections
branches
how
has
with
all
the
C
hyperbolic
many
7/y.

0{n) y -coordinates

The

next

of these

step of RELCEN*

tangents, and

locate

is to calculate

the median

of those

(atmost

critical

fast parallelmedian-finding
execute
a
n)
points. To do this we
The
this kind is that by Ajtai,
b
est
of
algorithm.
asymptotically
algorithm
Komlos, Steigerand Szemeredi
[AKSS] which runs in C"(loglog n) parallel
time and uses
0(n) processors.

Continuing our algorithm,we consider one parallel


step of the medianfinding algorithm.It performs 0{n) comparisons between
pairs of critical

-11-

For

points.

each

such

corresponding pair of hyperbolic


of
four points,and the outcome

the

comparison,

intersects in the

branches

plane in at most
of these
the comparison depends on the positionof y* relative to the "'-levels
the collection of ^-coordinates of these 0(n) intersection
sort
points. We
them.
It
and
points,
perform as above a binary search to locate y* among
follows

thus

in

that

0{n log n)

time

we

of the

each

resolve

can

[AKSS] algorithm, so
present
of this algorithm (atthe still unknown
sequentialsimulation
done
in time 0(n log n log log n).
in

the

We
we

do

which

have

thus

have

not

the

of

also

in

runs

fast

numbers;

on

can

of

this

(actually

time

for

on

is to

this

To

finding

and

0{n)

uses

processors.

At

of

the

perform 0{n) comparisons

we

-y^

the side of xq

which

this

be

can

the

algorithm of Valiant p/a]which

e.g. the

use

algorithm

y*)

easilydetermined.

parallelalgorithm,

we

level

step of RELCEN*

next

be

can

entire

hyperbolic branch

the

only

from
dt{xQ,y*),

0(log log n) paralleltime,

parallelstep

^tC^oJ*)

second

values
of F

relative minmax

run

maximum

but

of xq,

the

xq calculated in RELCEN*

{xQ,y*)lies).The

of the

maximimi

containingthe
we

explicitvalue

an

comparisons

that

the

first median

foipd the

(unknown) point

calculate the

end

of

parallelstep

form

on

the

hyperbola 7^^,calculated by the preceding median-finding step. It follows


each such comparison determines
four critical j-levelsin which
at most

that

result

of

the

levels,and
the

and

unknown
At

comparison

thus

y*)
this

the

be done

can

in

which

is achieved

comparison

of the

next

described

most

sign can

this

those

at

points on

lie

each

critical

four

critical

the

critical

points on

C,

all of

Next

have

we

of

can

be

such
can

RELCEN*

as

median

second
and

to

of xq.

its outcome

calculation
which

critical

two

appropriate side
xq. Again, each

consist

of F

of
applications

two

at most

j -levels.
on

at most

j-levelsat which

second

complete

can

A:-derivative
partial

point with

maximum

above.

the

those

search

by

critical y-

algorithm (at the

entire

change in

sign by

RELCEN*

of

the

sign of

steps of the simulated

calculation, followed
classification

at

we

0(n) j-levels,using
through
all necessary
comparisons in 0(n log n) time.

binary

above, will resolve


The

critical

by comparing

determines

and

before,

as

0{n)

those

the

finding algorithm in 0{n log n)


of

the

this

lines

horizontal

the

to

that

0(n log n log log n) time.

to calculate

have

point we

RELCEN*

change,

them

sequentialsimulation

{xQ,y*).It is easilychecked that


determine
can
J -levels,so again we

This

constraint

change. Collectingall

can

at

determine

the

performing a binary search over


parallelstep of the maximum

current

time,

di{xQ,y*),subject to

vs.

{xQ,y*)lies

each

second

simulated

as

12-

Thus

0{n log n log log /j)we can complete the present stage of
n/4 of the functions di. It
RELCEN*,
thereby eliminating

in time

simulated

the

therefore

easilyfollows that

accomplishedin time

also be

can

terminates,we
be

0{n log n log log n).

0(1) functions di,whose

left with

time.

in the

noted

As

Remark:

algorithmcan

our

the

at y

globalminmax

Thus

this

problem (inwhich

as

contains

circle which

smallest

introduction,the problem

be restated

instead

of

0{n) time ([Me],[Dy]),we

follows:

them.

all of

circles

Given

are

we

y*

this simulation

When

can

final

in constant
stage
explicitly
in
be
n
accomplished 0{n log log log n) time.
algorithmcan

determined

GEOCEN

of

are

of RELCEN*

entire simulation

the

solved

now

of

the

in this last

phase
plane,find
simpler 1-center

circles in the

While

the

givenn points)has

been

solved

of

efficient solutions for


similarly
involved
in the complexity
the case
of circles. Note
also that the constants
bounds
have used are fairlylarge.We
of the algorithm of [AKSvS]that we
could alternatively
use
simplerparallel
techniques,
e.g. the algorithmof Cole
and
in paralleltime
0((loglog n)^)and uses 0{n)
Yap [CY] that runs
or
even
a simplersortingscheme, such
as that of Preparata [Pr]
processors,
its
Use
of
these
will
recent
or
improvement by Cole [Co].
simpler schemes
lead to more
efficient algorithmsin practice;
entire algorithm
our
moreover,
has already consumed
time so far, and, as will follow
from
the
0(n log^/i)
schemes
will still yieldan
analysisgiven below, use of any of these parallel
0(n log^n)algorithm for the final phase at hand.
Nevertheless, since this
final phase may
be of independentinterest in facility
location theory,we
have
used the algorithm of [AKSS] to obtain a solution to that minmax
problem
with the best asymptoticcomplexity.)
in

5.

do not

know

Discussion
We

have

presented

rather

involved

algorithm

for

computing

the

While
this
geodesiccenter of an /i-sided simple polygon in time 0{n log^n).
constitutes a significant
in
the
improvement over
[AT],
previous algorithm
have no
non-linear
lower
bound
the complexity of the problem. An
we
on
obvious
be calculated in
the geodesic center
can
problem is whether
open
linear time, or at least in time 0(n \ogn). In attempting to enhance
the
of
this
three
efficiency our techniqueto achieve
major subproblems
goal,
need

to

I. Is it
new

when

to
possible

ideas,such

II. The
the

be addressed.

second

polygon
the

center

as

calculate the relative center


those

in

[Aea],may

subproblem
has

to

of P

process
is

be

is that each

on

0(n)

Several

time?

here.
applicable
of
application

the entire collection

alreadyknown

cut in

to

lie in

RELCEN

of the vertices
a

smaller

to

cut

of P,

subpolygon

of

even

of P.

-14-

[Dy]

variable

linear

[GJPT] Garey,

M.R.,

time

Linear

(1984).

M.E.

Dyer

SIAM

programs,

for

13,

pp.

Computing

J.

D.S., Preparata,

Johnson,

(1978). Triangulating

algorithms

simple polygon. Inf.

three

31-45.

and

F.P.

and

two

Tarjan,
Letters

Proc.

R.E.

7, pp.

175-180.

[Gea]

inside

problems

[LP]

Lee, D.T.
the

[Lea]

[Me]

[Me2]

and

Preparata,

shortest

(1984). Euchdean

F.P.

14

shortest

(3),pp.

G.T., Yap, C.,

and

link center

simple polygon.

of

N.

in R^

related

the

problems,

of

serial

in

Toussaint,
the

algorithms for linear programming

time
SIAM

J.

Computing

12,

pp.

759-776.

(19S3). Applying parallelcomputation algorithms

N.

design

Linear

paths

(inpreparation).Computing

S.

Whitesides,

(1983).

Megiddo,

Megiddo,

Sci.

393-410.

Lenhart, W., Pollack, R., Sack, J., Seidel, R., Sharir, M.

and

path

Report 218, Comp.

barriers.Networks

of rectilinear

presence

Tech.

simple polygon.

Tarjan,

Institute,April 1986.

Courant

Dept.,

and
algorithmsfor visibility

time

Linear

(1986).

R.E.

and

D., Sharir, M.,

J., Leven,

L., Hershberger,

Guibas,

algorithms, J.

Assoc.

30,

Mach.

Comput.

in

pp.

852-866.

[Pr]

Preparata,

C-27,

Comput.

[Su]

Suri,

[Su2]

Suri,

polygon.
Comp.

[TV]

Tarjan,
for

[Ze]

Tech.

Dept.

R.E.

and

pp.

Valiant, L.G.

E.

Elec.

of

simple polygon,
and

Eng.

Comp.

4,

of

of

Elec.

linear

time

Dept.

simple

Eng.

and

Hopkins University.
Van

Wyk,

C.J.

(1986).
Proc.

18th

Symp.

on

algorithm
Theory

of

SIAM

J.

380-388.

(1975).
pp.

Parallelism

in

comparison problems,

348-355.

(1984).

knapsack problem
123-128.

of

geodesic diameter

the

triangulatingsimple polygons,

Zemel,

diameter

Report JHU/EECS-86/08,

Sci.,Johns

Computing

Trans.

Hopkins University.

Computing,

[Va]

link

the

(1986). Computing

S.

IEEE

669-673.

pp.

JHU/EECS-86/09

Report

Sci.,Johns

parallelsorting schemes,

New

(1986). Computing

S.

Tech.

(1978).

F.P.

An

0{n) algorithm

and

related

for

the

problems, Inf.

linear

multiple

Proc.

Letters

choice

18,

pp.

Figure

rnrr

Figure

Figure

V(c)

^^1

Figure

{v,,v,}
=

(e.C)

Figure

Figure

book

This

may

be

kept

^ggg

d"^^
'

FOURTEEN

Bne

win

be

ch^.ed

fo.

e.cU

.av

.be

book

kep._ove^

NYU

COMPSCI

TR-231

Pollack,

Richard

Computing

the

Renter

of

geodesic

simple

polygoi
c.l

LIBRARY
N.Y.U.

Courant

Institute

Mathematical
251

New

York,

Sciences
Mercer

N.

St.

Y.

10012

of

Potrebbero piacerti anche