Algorithms

for

Some

Intersection

Searching

Problems

Involving

Curved

Objects

Prosenjit

Guptay

Ravi

Janardany

Michiel

Smidz

August

Abstract

Two

classes

of

geometric

intersection

searching

problems

are

considered

i.e.

problems

in

which

a

set

S

of

geometric

objects

is

to

be

preprocessed

into

a

data

structure

so

that

for

any

query

object

q

the

objects

of

S

that

are

intersected

by

q

can

be

counted

or

reported

efficiently

In

the

first

class

S

is

a

set

of

curved

objects

such

as

d-balls

d-spheres

circles

or

circular

arcs

and

q

is

also

a

curved

object

In

the

second

class

the

objects

in

S

are

curved

or

linear

and

each

is

assigned

a

color

Given

a

query

q

such

as

a

disk

or

an

annulus

the

goal

is

to

count

or

report

the

distinct

colors

in

the

set

of

objects

intersected

by

q.

Efficient

algorithms

are

presented

for

several

problems

from

these

classes

The

solution

techniques

are

based

on

geometric

transforms

on

compositions

of

known

solutions

for

simplex

range

searching

on

the

locus

approach

and

on

persistent

data

structures

Introduction

In

a

generic

instance

of

an

intersection

searching

problem

a

set

S

of

n

geometric

objects

must

be

preprocessed

so

that

the

k

objects

of

S

that

are

intersected

by

a

query

object

q

can

be

reported

-LRB-

or

counted

-RRB-

efficiently

Examples

of

S

and

q

are

points

lines

line

segments

rays

hyperplanes

and

simplices

These

problems

arise

in

many

applications

and

space

and

query-time-efficient

solutions

are

known

for

many

of

them

-LSB-

-RSB-

Most

previous

work

on

these

problems

assumes

that

the

input

objects

and

the

query

object

are

linear

or

piecewise-linear

-LRB-

as

above

-RRB-

To

our

knowledge

the

case

where

the

input

and/or

the

query

are

curved

has

been

investigated

systematically

only

in

-LSB-

-RSB-

Yao

and

Yao

-LSB-

-RSB-

were

one

of

the

first

to

consider

intersection

searching

involving

curved

objects

They

used

geometric

transforms

to

linearize

nonlinear

queries

Recently

in

-LSB-

-RSB-

Agarwal

et

A

preliminary

version

of

this

paper

appears

in

Proc

Fourth

Scandanavian

Workshop

on

Algorithm

Theory

Springer

Verlag

Lecture

Notes

on

Computer

Science

Volume

pages

-LCB-

yDepartment

of

Computer

Science

University

of

Minnesota

Minneapolis

MN

U.S.A.

Email

fpgupta

janardang@cs.umn.edu

The

research

of

these

authors

was

supported

in

part

by

NSF

grant

CCR

-LCB-

-LCB-

zMax-Planck-Institut

f?ur

Informatik

Saarbr?ucken

Germany

Email

michiel@mpi-sb.mpg.de

This

author

was

supported

by

the

ESPRIT

Basic

Research

Actions

Program

under

contract

No.

-LRB-

project

ALCOM

II

-RRB-

Input

objects

Query

object

Space

Query

time

d-balls

d-ball

n

log

log

n

-LRB-

bd

-RRB-

-LRB-

log

n

-RRB-

O

-LRB-

-RRB-

k

nbd

ffl

log

n

k

d-spheres

d-sphere

n

-LRB-

d

-RRB-

ffl

k

nd

ffl

log

n

k

Circular

arcs

Circle

n

ffl

k

ffl

log

n

k

Circles

Circular

arc

n

ffl

k

ffl

log

n

k

Table

Summary

of

results

for

intersection

reporting

on

curved

objects

with

a

curved

query

object

al.

have

considered

searching

on

curved

objects

-LRB-

e.g.

circles

disks

circular

arcs

Jordan

arcs

-RRB-

with

linear

query

objects

-LRB-

e.g.

lines

line

segments

halfspaces

rays

-RRB-

In

-LSB-

-RSB-

-LRB-

resp

-LSB-

-RSB-

-RRB-

the

problem

of

reporting

the

intersection

of

a

query

line

or

line

segment

-LRB-

resp

a

point

-RRB-

with

a

set

of

disks

is

considered

In

-LSB-

-RSB-

algorithms

are

given

for

range

searching

on

point

sets

in

IRd

with

ranges

defined

by

a

constant

number

of

bounded-degree

polynomials

Overview

of

results

In

this

paper

we

make

further

contributions

to

intersection

searching

in

the

curved

setting

by

presenting

efficient

solutions

to

two

broad

classes

of

problems

In

the

first

class

of

problems

we

wish

to

preprocess

a

set

S

of

n

curved

objects

so

that

the

ones

that

are

intersected

by

a

curved

query

object

can

be

reported

efficiently

This

problem

was

left

open

in

-LSB-

-RSB-

Table

summarizes

our

results

Our

goal

has

been

to

obtain

useful

space

and

query

time

trade-offs

and

as

can

be

seen

from

the

table

we

obtain

polylogarithmic

query

time

at

one

extreme

and

linear

or

almost-linear

space

at

the

other

extreme

We

remark

that

other

intermediate

trade-offs

are

also

easily

derived

from

our

results

-LRB-

Techniques

for

obtaining

such

intermediate

trade-offs

can

be

found

in

-LSB-

-RSB-

-RRB-

Next

we

consider

a

generalization

of

the

standard

intersection

searching

problems

involving

curved

objects

Here

S

consists

of

n

linear

or

curved

objects

and

the

objects

come

aggregated

in

disjoint

groups

If

we

assign

each

object

a

color

according

to

the

group

it

belongs

to

then

our

goal

is

to

report

the

distinct

colors

of

the

objects

intersected

by

a

query

object

-LRB-

rather

than

reporting

this

paper

the

term

curved

means

circular

or

circle-like

objects

such

as

circles

disks

circular

arcs

annuli

d-balls

and

d-spheres

-LRB-

A

d-sphere

is

the

boundary

of

a

closed

d-ball

-RRB-

Throughout

it

is

assumed

that

the

input

objects

can

have

different

radii

Moreover

the

radius

of

the

query

object

is

not

known

beforehand

it

is

specified

as

a

part

of

the

query

ffl

is

an

arbitrarily

small

constant

Whenever

ffl

appears

in

a

query

time

-LRB-

resp

space

-RRB-

bound

the

corresponding

space

-LRB-

resp

query

time

-RRB-

bound

contains

a

multiplicative

factor

which

goes

to

as

ffl

Input

objects

Query

object

Space

Query

time

Point

n

log

n

Disks

Line

n

log

n

i

n

Line

Segments

Disk

log

n

Lines

Points

Annulus

log

n

Table

Summary

of

results

for

generalized

reporting

problems

involving

curved

objects

all

the

intersected

objects

as

in

the

case

of

the

standard

problem

-RRB-

Such

generalized

intersection

searching

problems

have

been

considered

recently

in

-LSB-

-RSB-

in

the

context

of

linear

input

and

query

objects

The

challenge

in

these

problems

is

to

obtain

solutions

whose

query

times

are

sensitive

to

the

output

size

namely

the

number

i

of

distinct

colors

intersected

-LRB-

not

the

number

k

of

intersected

objects

which

can

be

much

larger

-RRB-

For

the

problems

considered

in

this

paper

we

obtain

query

times

of

the

form

O

-LRB-

f

-LRB-

n

-RRB-

i

g

-LRB-

n

-RRB-

-RRB-

where

f

-LRB-

n

-RRB-

and

g

-LRB-

n

-RRB-

are

polylogarithmic

We

also

consider

the

counting

version

where

we

obtain

polylogarithmic

query

time

Tables

and

summarize

our

results

Overview

of

techniques

Our

results

are

based

on

three

main

approaches

The

first

approach

transforms

the

curved

problem

at

hand

to

a

simplex

range

searching

problem

and

solves

the

latter

by

suitably

composing

together

known

techniques

such

as

partition

trees

cutting

trees

and

geometric

transforms

This

approach

is

not

new

per

se

for

instance

it

has

been

used

in

-LSB-

-RSB-

for

other

problems

However

what

makes

this

part

of

our

work

interesting

is

that

the

characterization

of

intersection

and

the

appropriate

transform

-LRB-

s

-RRB-

to

use

are

not

always

apparent

indeed

in

some

cases

we

need

to

apply

Input

objects

Query

object

Space

Query

time

Points

Annulus

n

n

Disk

Disk

log

n

log

n

Table

Summary

of

results

for

generalized

counting

problems

involving

curved

objects

successively

more

than

one

transform

-LRB-

moreover

in

the

correct

order

-RRB-

In

addition

to

using

known

transforms

we

also

introduce

some

new

ones

Our

second

approach

which

we

apply

to

the

generalized

reporting

problems

is

as

follows

We

start

out

by

assuming

that

all

colors

in

S

are

intersected

and

then

progressively

refine

this

estimate

by

identifying

those

colors

that

can

not

possibly

be

intersected

To

do

this

efficiently

we

store

the

distinct

colors

of

S

in

a

suitable

data

structure

and

perform

standard

intersection

detection

tests

on

appropriately-defined

subsets

of

S.

For

the

more

difficult

generalized

counting

problems

we

use

a

different

approach

We

partition

the

plane

into

suitable

regions

within

which

the

answer

to

a

query

is

invariant

order

the

regions

suitably

and

apply

the

technique

of

persistence

-LSB-

-RSB-

However

the

querying

strategy

is

quite

subtle

because

the

answer

to

the

query

is

not

available

explicitly

but

rather

is

embedded

implicitly

in

a

region-specific

total

order

on

the

input

objects

We

show

how

the

search

within

this

total

order

can

be

reduced

to

a

generalized

range

counting

problem

which

can

be

solved

efficiently

Thus

the

contribution

of

the

paper

is

a

uniform

framework

to

solve

efficiently

a

variety

of

intersection

searching

problems

involving

curved

objects

The

rest

of

the

paper

is

organized

as

follows

In

Section

we

discuss

the

standard

-LRB-

i.e.

uncolored

-RRB-

query

problems

and

in

Section

we

consider

the

generalized

problems

We

conclude

in

Section

Standard

intersection

searching

with

curved

objects

Querying

d-balls

with

a

d-ball

Let

B

Bng

be

a

collection

of

closed

d-balls

in

IRd

d

and

let

Q

be

a

query

d-ball

Our

goal

is

to

report

or

count

efficiently

the

d-balls

in

B

that

are

intersected

by

Q

We

use

the

coordinates

xd

in

IRd

Let

Ci

-LRB-

bid

-RRB-

be

the

center

of

Bi

and

ri

its

radius

i

n.

Let

CQ

-LRB-

qd

-RRB-

be

the

center

of

Q

and

rQ

its

radius

It

is

easy

to

prove

that

Q

intersects

Bi

iff

the

Euclidean

distance

between

their

centers

is

at

most

ri

rQ

i.e.

Q

intersects

Bi

iff

dX

j

-LRB-

bij

qj

-RRB-

-LRB-

ri

rQ

-RRB-

-LRB-

-RRB-

Let

us

define

a

transform

o

which

maps

Bi

to

a

point

in

IRd

as

follows

o

-LRB-

Bi

-RRB-

-LRB-

bid

ri

-RRB-

-LRB-

-RRB-

Also

let

us

define

a

transform

which

maps

Q

to

a

hyperplane

in

IRd

as

follows

-LRB-

Q

-RRB-

xd

-LRB-

-RRB-

We

claim

that

Q

intersects

Bi

iff

o

-LRB-

Bi

-RRB-

-LRB-

Q

-RRB-

where

-LRB-

Q

-RRB-

is

the

closed

halfspace

lying

below

-LRB-

Q

-RRB-

To

see

this

note

that

by

Equations

-LRB-

-RRB-

-LCB-

-LRB-

-RRB-

it

is

sufficient

to

show

that

dX

j

-LRB-

bij

qj

-RRB-

-LRB-

ri

rQ

-RRB-

iff

This

can

be

verified

by

straightforward

algebraic

manipulation

Thus

we

have

transformed

our

d-ball

problem

in

IRd

to

halfspace

searching

in

IRd

For

the

reporting

problem

we

can

use

the

halfspace

range

searching

structure

of

Matou

sek

-LSB-

-RSB-

-LRB-

resp

Clarkson

and

Shor

-LSB-

-RSB-

-RRB-

which

in

IRp

uses

O

-LRB-

n

log

log

n

-RRB-

-LRB-

resp

O

-LRB-

nbp

ffl

-RRB-

-RRB-

space

and

has

a

query

time

of

O

-LRB-

bp

-LRB-

log

n

-RRB-

O

-LRB-

-RRB-

k

-RRB-

-LRB-

resp

O

-LRB-

log

n

k

-RRB-

-RRB-

where

k

is

the

output

size

For

the

counting

problem

we

can

use

the

structure

in

-LSB-

-RSB-

-LRB-

resp

-LSB-

-RSB-

-RRB-

which

uses

O

-LRB-

n

-RRB-

-LRB-

resp

O

-LRB-

np

logp

n

-RRB-

-RRB-

space

and

has

a

query

time

of

O

-LRB-

=p

-LRB-

log

log

n

-RRB-

O

-LRB-

-RRB-

-RRB-

-LRB-

resp

O

-LRB-

log

n

-RRB-

-RRB-

Substituting

p

d

we

conclude

Theorem

Let

B

Bng

be

a

collection

of

closed

d-balls

in

IRd

d

B

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

n

log

log

n

-RRB-

-LRB-

resp

O

-LRB-

nbd

ffl

-RRB-

-RRB-

such

that

the

k

d-balls

that

are

intersected

by

a

query

d-ball

Q

can

be

reported

in

time

O

-LRB-

-LRB-

bd

-RRB-

-LRB-

log

n

-RRB-

O

-LRB-

-RRB-

k

-RRB-

-LRB-

resp

O

-LRB-

log

n

k

-RRB-

-RRB-

The

counting

problem

can

be

solved

in

O

-LRB-

n

-RRB-

-LRB-

resp

O

-LRB-

nd

logd

n

-RRB-

-RRB-

space

and

a

query

time

of

O

-LRB-

-LRB-

d

-RRB-

-LRB-

log

log

n

-RRB-

O

-LRB-

-RRB-

-RRB-

-LRB-

resp

O

-LRB-

logn

-RRB-

-RRB-

Review

of

a

query

composition

technique

In

Sections

-LCB-

below

we

will

express

intersection

conditions

as

the

conjunction

of

h

halfspace

range

queries

where

h

O

-LRB-

-RRB-

-LRB-

This

is

unlike

Section

where

we

used

just

one

halfspace

-RRB-

Towards

this

end

we

review

a

useful

query

composition

result

due

to

van

Kreveld

-LSB-

-RSB-

which

we

will

use

often

in

Sections

-LCB-

-LRB-

This

result

is

based

on

multi-level

range

searching

structures

-LSB-

-RSB-

-RRB-

Let

S

be

a

set

of

n

geometric

objects

Let

D

be

a

data

structure

for

some

query

problem

on

S

with

space

and

query

time

bounds

O

-LRB-

-LRB-

f

-LRB-

n

-RRB-

-RRB-

and

O

-LRB-

g

-LRB-

n

-RRB-

-RRB-

respectively

Suppose

that

we

now

wish

to

answer

queries

not

on

the

entire

set

S

but

on

a

subset

of

S

where

is

specified

by

putting

S

in

-LCB-

correspondence

with

a

set

P

of

points

in

IRd

and

letting

correspond

to

the

subset

P

of

P

lying

in

a

query

simplex

-LRB-

In

-LSB-

-RSB-

this

technique

is

called

simplex

composition

on

P

to

D

-RRB-

The

following

theorem

states

how

fast

the

query

problem

on

can

be

solved

Theorem

-LSB-

-RSB-

Let

S

D

and

P

be

as

above

For

an

arbitrarily

small

constant

ffl

simplex

composition

on

P

to

D

yields

a

data

structure

-LRB-

i

-RRB-

of

size

O

-LRB-

nffl

-LRB-

nd

f

-LRB-

n

-RRB-

-RRB-

-RRB-

and

query

time

O

-LRB-

log

n

g

-LRB-

n

-RRB-

-RRB-

or

-LRB-

ii

-RRB-

of

size

O

-LRB-

n

f

-LRB-

n

-RRB-

-RRB-

and

query

time

O

-LRB-

nffl

-LRB-

=d

g

-LRB-

n

-RRB-

-RRB-

-RRB-

or

-LRB-

iii

-RRB-

of

size

O

-LRB-

mffl

-LRB-

m

f

-LRB-

n

-RRB-

-RRB-

-RRB-

and

query

time

O

-LRB-

nffl

-LRB-

g

-LRB-

n

-RRB-

n

=d

-RRB-

-RRB-

for

any

n

m

nd

assuming

f

-LRB-

n

-RRB-

n

is

nondecreasing

and

g

-LRB-

n

-RRB-

n

is

nonincreasing

For

the

reporting

problem

the

output

size

k

must

be

included

in

the

query

time

as

an

additive

term

In

our

application

the

simplex

will

always

be

a

halfspace

Given

the

h

O

-LRB-

-RRB-

halfspaces

we

proceed

as

follows

We

design

an

initial

data

structure

D

Then

we

apply

Theorem

with

one

of

the

h

halfspaces

This

gives

a

new

structure

to

which

we

apply

Theorem

using

a

second

halfspace

and

so

on

Since

h

O

-LRB-

-RRB-

the

space

and

query

time

bounds

of

the

resulting

structure

are

asymptotically

the

same

as

the

ones

given

in

Theorem

We

illustrate

the

above

idea

with

the

following

simple

example

Let

S

be

a

set

of

n

vertical

line

segments

in

We

wish

to

construct

a

data

structure

for

the

following

query

problem

on

S

Given

a

query

line

count

or

report

the

segments

of

S

that

are

intersected

by

We

take

D

to

be

a

linked

list

of

the

objects

of

S

and

store

its

size

at

its

head

Clearly

D

solves

the

trivial

query

problem

count

or

report

the

segments

of

S

in

f

-LRB-

n

-RRB-

O

-LRB-

n

-RRB-

space

and

g

-LRB-

n

-RRB-

O

-LRB-

-RRB-

query

time

Since

a

segment

s

S

intersects

iff

its

upper

endpoint

is

in

and

its

lower

endpoint

is

in

we

can

cast

the

intersection

condition

as

two

halfplane

compositions

In

the

first

we

associate

S

with

the

set

P

of

upper

endpoints

and

use

in

the

second

we

associate

S

with

the

set

P

of

lower

endpoints

and

use

We

then

apply

these

two

compositions

successively

using

Theorem

This

gives

O

-LRB-

ffl

-RRB-

space

and

O

-LRB-

log

n

-RRB-

query

time

at

one

extreme

and

O

-LRB-

n

-RRB-

space

and

O

-LRB-

ffl

-RRB-

query

time

at

the

other

extreme

for

the

counting

problem

For

the

reporting

problem

the

query

times

are

O

-LRB-

log

n

k

-RRB-

and

O

-LRB-

ffl

k

-RRB-

respectively

Querying

d-spheres

with

a

d-sphere

Let

S

Sng

be

a

collection

of

d-spheres

where

Si

has

radius

ri

and

center

Ci

-LRB-

bid

-RRB-

i

n.

Let

CQ

-LRB-

qd

-RRB-

be

the

center

of

a

query

d-sphere

Q

and

rQ

its

radius

Q

intersects

Si

iff

the

Euclidean

distance

between

Ci

and

CQ

is

at

most

ri

rQ

and

at

least

jri

rQj

i.e.

Q

intersects

Si

iff

-LRB-

ri

rQ

-RRB-

dX

j

-LRB-

bij

qj

-RRB-

-LRB-

ri

rQ

-RRB-

Consider

the

following

transform

which

maps

Q

to

a

hyperplane

in

IRd

-LRB-

Q

-RRB-

xd

-LRB-

-RRB-

In

addition

consider

the

transforms

o

and

of

Section

which

can

be

extended

in

the

obvious

way

to

d-spheres

It

is

easily

verified

that

Q

intersects

Si

iff

o

-LRB-

Si

-RRB-

-LRB-

Q

-RRB-

-LRB-

Q

-RRB-

where

-LRB-

Q

-RRB-

is

the

closed

halfspace

above

-LRB-

Q

-RRB-

The

points

o

-LRB-

Si

-RRB-

satisfying

the

above

condition

-LRB-

which

is

the

conjunction

of

two

halfspace

queries

-RRB-

can

be

found

via

two

halfspace

compositions

in

IRd

We

now

apply

Theorem

taking

the

structure

D

to

be

a

linked

list

of

the

points

fo

-LRB-

Si

-RRB-

i

ng

Theorem

Let

S

Sng

be

a

collection

of

d-spheres

in

IRd

d

S

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

n

-RRB-

-LRB-

resp

O

-LRB-

nd

ffl

-RRB-

-RRB-

such

that

the

k

d-spheres

that

are

intersected

by

a

query

d-sphere

Q

can

be

reported

in

time

O

-LRB-

-LRB-

d

-RRB-

ffl

k

-RRB-

-LRB-

resp

O

-LRB-

log

n

k

-RRB-

-RRB-

For

the

counting

problem

the

query

times

are

O

-LRB-

-LRB-

d

-RRB-

ffl

-RRB-

and

O

-LRB-

logn

-RRB-

respectively

Remark

We

note

that

for

d

the

O

-LRB-

n

-RRB-

bound

of

Theorem

and

the

O

-LRB-

ffl

-RRB-

space

bound

of

Theorem

can

be

improved

to

O

-LRB-

ffl

-RRB-

without

affecting

the

respective

query

times

by

extending

a

result

of

Agarwal

and

Sharir

-LSB-

-RSB-

Querying

circular

arcs

with

a

circle

We

show

how

to

preprocess

a

set

S

of

n

circular

arcs

so

that

the

arcs

that

are

intersected

by

any

query

circle

C

can

be

reported

quickly

Let

be

a

circular

arc

Let

circ

-LRB-

-RRB-

denote

the

circle

that

is

a

part

of

and

let

center

-LRB-

-RRB-

and

radius

-LRB-

-RRB-

denote

respectively

the

center

and

the

radius

of

circ

-LRB-

-RRB-

Wlog

assume

that

the

arcs

in

S

are

x-monotone

since

any

circular

arc

can

be

decomposed

into

at

most

three

x-monotone

pieces

Let

l

-LRB-

-RRB-

and

r

-LRB-

-RRB-

be

's

left

and

right

endpoints

respectively

Let

disk

-LRB-

C

-RRB-

be

the

closed

disk

bounded

by

C.

Let

inl

-LRB-

resp

out

l

-RRB-

be

the

halfplane

bounded

by

the

line

joining

center

-LRB-

-RRB-

and

l

-LRB-

-RRB-

and

containing

-LRB-

resp

not

containing

-RRB-

Define

inr

and

out

r

similarly

The

following

lemma

follows

from

-LSB-

-RSB-

and

is

illustrated

in

Figure

Lemma

-LSB-

-RSB-

A

circle

C

and

an

x-monotone

arc

intersect

iff

one

of

the

following

is

true

-LRB-

i

-RRB-

C

separates

the

endpoints

of

or

-LRB-

ii

-RRB-

C

intersects

circ

-LRB-

-RRB-

and

either

-LRB-

a

-RRB-

l

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

and

r

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

and

center

-LRB-

C

-RRB-

inl

inr

or

-LRB-

b

-RRB-

l

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

and

r

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

and

center

-LRB-

C

-RRB-

out

l

out

r

An

arc

satisfies

condition

-LRB-

i

-RRB-

if

and

only

if

chord

-LRB-

-RRB-

has

one

endpoint

in

the

interior

of

disk

-LRB-

C

-RRB-

and

the

other

endpoint

outside

disk

-LRB-

C

-RRB-

To

report

such

arcs

we

apply

the

well-known

lifting

transform

Recall

that

this

transform

maps

a

point

p

in

to

a

point

-LRB-

p

-RRB-

in

and

a

circle

C

in

to

a

plane

-LRB-

C

-RRB-

in

such

that

-LRB-

p

-RRB-

lies

below

-LRB-

resp

on

above

-RRB-

-LRB-

C

-RRB-

iff

p

lies

inside

-LRB-

resp

on

outside

-RRB-

C.

-LRB-

See

-LSB-

p.

-RSB-

or

-LSB-

-RSB-

for

details

-RRB-

Thus

by

applying

to

the

endpoints

of

and

to

C

we

convert

the

problem

at

hand

to

one

of

reporting

those

line

segments

-LRB-

l

-LRB-

-RRB-

-RRB-

-LRB-

r

-LRB-

-RRB-

-RRB-

in

whose

endpoints

are

in

opposite

halfspaces

of

-LRB-

C

-RRB-

This

can

be

done

via

two

halfspace

compositions

in

O

-LRB-

n

-RRB-

-LRB-

resp

O

-LRB-

ffl

-RRB-

-RRB-

space

and

O

-LRB-

ffl

k

-RRB-

-LRB-

resp

O

-LRB-

log

n

k

-RRB-

-RRB-

query

time

-LRB-

Theorem

-RRB-

Let

us

now

consider

how

to

report

arcs

that

satisfy

condition

-LRB-

ii

-RRB-

First

consider

the

first

part

of

condition

-LRB-

ii

-RRB-

-LRB-

a

-RRB-

namely

l

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

and

r

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

Using

the

transforms

and

this

becomes

-LRB-

l

-LRB-

-RRB-

-RRB-

-LRB-

r

-LRB-

-RRB-

-RRB-

lies

above

-LRB-

C

-RRB-

in

This

in

turn

can

be

expressed

as

two

halfspace

compositions

in

-LRB-

i

-RRB-

-LRB-

ii

-RRB-

b

-LRB-

ii

-RRB-

a

in

in

r

r

-LRB-

-RRB-

-LRB-

-RRB-

circ

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

C

out

out

r

r

-LRB-

-RRB-

circ

-LRB-

-RRB-

circ

-LRB-

-RRB-

r

-LRB-

-RRB-

C

C

Figure

Illustrating

Lemma

To

handle

the

second

part

of

condition

-LRB-

ii

-RRB-

-LRB-

a

-RRB-

namely

center

-LRB-

C

-RRB-

inl

inr

we

use

the

wellknown

duality

transform

F

Recall

that

F

maps

a

point

p

in

-LRB-

resp

-RRB-

to

a

non-vertical

line

-LRB-

resp

plane

-RRB-

F

-LRB-

p

-RRB-

and

vice-versa

-LRB-

See

-LSB-

p.

-RSB-

for

details

-RRB-

Note

that

the

wedge

inl

inr

can

be

written

as

t

t

or

t

t

or

t

t

for

some

lines

and

Thus

by

applying

the

transform

F

to

center

-LRB-

C

-RRB-

and

the

condition

center

-LRB-

C

-RRB-

inl

inr

becomes

F

-LRB-

center

-LRB-

C

-RRB-

-RRB-

is

below

or

above

or

intersects

F

-LRB-

-RRB-

F

-LRB-

-RRB-

Each

of

these

three

cases

can

in

turn

be

expressed

as

two

halfplane

compositions

in

Similarly

condition

-LRB-

ii

-RRB-

-LRB-

b

-RRB-

can

be

expressed

as

two

halfspace

and

two

halfplane

compositions

We

are

now

ready

to

apply

Theorem

to

handle

condition

-LRB-

ii

-RRB-

As

the

structure

D

of

that

theorem

we

take

the

O

-LRB-

n

-RRB-

space

structure

of

Theorem

for

d

to

handle

the

condition

C

intersects

circ

-LRB-

-RRB-

This

structure

has

a

query

time

of

O

-LRB-

ffl

k

-RRB-

Alternatively

we

can

take

the

O

-LRB-

ffl

-RRB-

space

structure

with

query

time

O

-LRB-

log

n

k

-RRB-

mentioned

in

Remark

We

then

build

a

tree

structure

where

the

nodes

at

the

innermost

level

are

augmented

with

instances

of

D

The

two

outermost

levels

apply

halfspace

compositions

and

the

next

two

levels

apply

halfplane

compositions

To

answer

a

query

we

first

apply

the

halfspace

compositions

corresponding

to

the

first

part

of

condition

-LRB-

ii

-RRB-

-LRB-

a

-RRB-

then

in

turn

each

of

the

three

halfplane

compositions

corresponding

to

the

second

part

and

finally

query

the

structure

D

at

the

nodes

of

the

innermost

tree

that

are

visited

We

then

repeat

this

for

condition

-LRB-

ii

-RRB-

-LRB-

b

-RRB-

The

correctness

and

bounds

follow

from

the

above

discussion

and

from

Theorem

Theorem

A

set

S

of

n

circular

arcs

in

the

plane

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

n

-RRB-

-LRB-

resp

O

-LRB-

ffl

-RRB-

-RRB-

such

that

the

k

arcs

that

are

intersected

by

a

query

circle

C

can

be

reported

in

time

O

-LRB-

ffl

k

-RRB-

-LRB-

resp

O

-LRB-

log

n

k

-RRB-

-RRB-

Remark

We

note

that

the

O

-LRB-

ffl

-RRB-

space

and

O

-LRB-

log

n

k

-RRB-

query

time

result

of

Theorem

can

also

be

obtained

by

a

different

approach

using

a

result

in

-LSB-

-RSB-

Querying

circles

with

a

circular

arc

Here

we

consider

the

inverse

problem

where

S

consists

of

n

circles

and

the

query

is

a

circular

arc

Again

we

may

assume

that

is

x-monotone

Lemma

still

applies

however

the

approach

is

somewhat

different

since

the

roles

of

arcs

and

circles

is

now

reversed

To

report

the

circles

that

separate

the

endpoints

of

-LRB-

condition

-LRB-

i

-RRB-

of

Lemma

-RRB-

we

map

each

circle

C

to

the

point

F

-LRB-

-LRB-

C

-RRB-

-RRB-

in

and

the

endpoints

l

-LRB-

-RRB-

and

r

-LRB-

-RRB-

of

to

the

planes

Hl

F

-LRB-

-LRB-

l

-LRB-

-RRB-

-RRB-

-RRB-

and

Hr

F

-LRB-

-LRB-

r

-LRB-

-RRB-

-RRB-

-RRB-

respectively

It

is

then

clear

that

condition

-LRB-

i

-RRB-

has

been

transformed

to

one

of

reporting

among

a

set

of

points

in

those

that

lie

in

a

query

doublewedge

formed

by

Hl

and

Hr

This

problem

can

be

solved

by

two

applications

of

two

halfspace

compositions

in

Let

us

now

consider

condition

-LRB-

ii

-RRB-

-LRB-

a

-RRB-

of

Lemma

By

using

F

and

as

above

the

condition

l

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

and

r

-LRB-

-RRB-

disk

-LRB-

C

-RRB-

transforms

to

F

-LRB-

-LRB-

C

-RRB-

-RRB-

lies

in

H

l

H

r

This

in

turn

can

be

expressed

as

two

halfspace

compositions

in

Moreover

the

condition

center

-LRB-

C

-RRB-

inl

inr

can

be

expressed

immediately

as

two

halfplane

compositions

in

A

similar

discussion

applies

for

condition

-LRB-

ii

-RRB-

-LRB-

b

-RRB-

We

can

now

apply

Theorem

to

report

the

segments

that

satisfy

condition

-LRB-

ii

-RRB-

We

choose

the

structure

D

as

in

Section

and

build

a

tree

structure

as

before

To

query

we

first

apply

the

halfspace

compositions

then

the

halfplane

compositions

and

then

finally

query

D

at

the

nodes

of

the

innermost

tree

that

are

visited

Theorem

A

set

S

of

n

circles

in

the

plane

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

n

-RRB-

-LRB-

resp

O

-LRB-

ffl

-RRB-

-RRB-

such

that

the

k

circles

that

are

intersected

by

a

query

circular

arc

can

be

reported

in

time

O

-LRB-

ffl

k

-RRB-

-LRB-

resp

O

-LRB-

log

n

k

-RRB-

-RRB-

Generalized

intersection

searching

with

curved

objects

We

now

turn

to

the

second

class

of

problems

considered

in

this

paper

Each

object

in

the

input

set

S

is

assigned

a

color

-LRB-

The

number

of

colors

used

can

range

from

to

n

thus

several

objects

can

receive

the

same

color

Wlog

we

assume

that

the

colors

are

integers

in

the

range

-LSB-

n

-RSB-

-RRB-

The

goal

is

to

preprocess

S

so

that

the

i

distinct

colors

of

the

objects

that

are

intersected

by

a

query

object

can

be

counted

or

reported

efficiently

A

general

technique

for

reporting

problems

Let

S

be

a

set

of

n

colored

geometric

objects

and

let

q

be

any

query

object

In

preprocessing

we

store

the

distinct

colors

in

S

at

the

leaves

of

a

balanced

binary

tree

CT

-LRB-

in

no

particular

order

-RRB-

For

any

node

v

of

CT

let

C

-LRB-

v

-RRB-

be

the

colors

stored

in

the

leaves

of

v

's

subtree

and

let

S

-LRB-

v

-RRB-

be

the

objects

of

S

colored

with

the

colors

in

C

-LRB-

v

-RRB-

At

v

we

store

a

data

structure

DET

-LRB-

v

-RRB-

to

solve

the

following

standard

detection

problem

on

S

-LRB-

v

-RRB-

Decide

whether

or

not

q

intersects

any

object

of

S

-LRB-

v

-RRB-

DET

-LRB-

v

-RRB-

returns

true

iff

there

is

an

intersection

To

answer

a

generalized

reporting

query

on

S

we

do

a

depth-first

search

of

CT

and

query

DET

-LRB-

v

-RRB-

with

q

at

each

node

v

visited

If

v

is

a

non-leaf

node

then

we

continue

searching

below

v

iff

the

query

returns

true

if

v

is

a

leaf

then

we

output

the

color

stored

there

iff

the

query

returns

true

Theorem

Assume

that

a

set

of

n

geometric

objects

can

be

stored

in

a

data

structure

of

size

O

-LRB-

M

-LRB-

n

-RRB-

-RRB-

such

that

it

can

be

detected

in

O

-LRB-

f

-LRB-

n

-RRB-

-RRB-

time

whether

or

not

a

query

object

intersects

any

of

the

n

objects

Then

a

set

S

of

n

colored

geometric

objects

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

M

-LRB-

n

-RRB-

log

n

-RRB-

such

that

the

i

distinct

colors

of

the

objects

in

S

that

are

intersected

by

a

query

object

q

can

be

reported

in

time

O

-LRB-

f

-LRB-

n

-RRB-

i

f

-LRB-

n

-RRB-

log

n

-RRB-

Proof

We

argue

that

a

color

c

is

reported

iff

there

is

a

c-colored

object

in

S

intersecting

q.

Suppose

that

c

is

reported

This

implies

that

a

leaf

v

is

reached

in

the

search

such

that

v

stores

c

and

the

query

on

DET

-LRB-

v

-RRB-

returns

true

Thus

some

object

in

S

-LRB-

v

-RRB-

intersects

q

Since

v

is

a

leaf

all

objects

in

S

-LRB-

v

-RRB-

have

the

same

color

c

and

the

claim

follows

For

the

converse

suppose

that

q

intersects

a

c-colored

object

p.

Let

v

be

the

leaf

storing

c.

Thus

p

S

-LRB-

-RRB-

for

every

node

on

the

root-to-v

path

in

CT

Thus

for

each

the

query

on

DET

-LRB-

-RRB-

will

return

true

which

implies

that

v

will

be

visited

and

c

will

be

output

CT

uses

O

-LRB-

M

-LRB-

n

-RRB-

-RRB-

space

per

level

and

there

are

O

-LRB-

log

n

-RRB-

levels

Thus

the

overall

space

is

O

-LRB-

M

-LRB-

n

-RRB-

log

n

-RRB-

The

query

time

can

be

upper-bounded

as

follows

If

i

then

the

query

on

DET

-LRB-

root

-RRB-

returns

false

and

we

abandon

the

search

at

the

root

itself

in

this

case

the

query

time

is

just

O

-LRB-

f

-LRB-

n

-RRB-

-RRB-

Suppose

that

i

Call

a

visited

node

v

fruitful

if

the

query

on

DET

-LRB-

v

-RRB-

returns

true

and

fruitless

otherwise

Each

fruitful

node

can

be

charged

to

some

color

in

its

subtree

that

gets

reported

Since

the

number

of

times

any

reported

color

can

be

charged

is

O

-LRB-

log

n

-RRB-

-LRB-

the

height

of

CT

-RRB-

and

since

i

colors

are

reported

the

number

of

fruitful

nodes

is

O

-LRB-

i

log

n

-RRB-

Since

each

fruitless

node

has

a

fruitful

parent

and

CT

is

a

binary

tree

it

follows

that

there

are

only

O

-LRB-

i

log

n

-RRB-

fruitless

nodes

Hence

the

number

of

nodes

visited

by

the

search

is

O

-LRB-

i

log

n

-RRB-

which

implies

that

the

total

time

spent

at

these

nodes

is

O

-LRB-

i

f

-LRB-

n

-RRB-

log

n

-RRB-

The

claimed

query

time

follows

Theorem

generalizes

a

method

used

in

-LSB-

-RSB-

for

the

generalized

halfspace

range

searching

problem

in

d

dimensions

Some

applications

of

the

general

technique

First

we

consider

the

problem

where

the

input

is

a

set

of

colored

disks

and

the

query

is

a

point

We

need

to

solve

the

following

-LRB-

standard

-RRB-

problem

Preprocess

a

set

of

n

disks

such

that

it

can

be

detected

if

a

query

point

lies

in

the

union

of

the

disks

Using

the

transforms

and

defined

in

Section

we

map

each

disk

D

to

the

halfspace

-LRB-

D

-RRB-

and

the

query

q

to

the

point

-LRB-

q

-RRB-

in

The

complement

of

the

union

of

the

disks

maps

to

an

upper

convex

polytope

It

is

then

sufficient

to

check

if

-LRB-

q

-RRB-

lies

in

this

polytope

This

problem

can

be

reduced

to

planar

point

location

via

stereographic

projection

of

the

polytope

-LRB-

see

-LSB-

page

-RSB-

-RRB-

and

hence

can

be

solved

in

O

-LRB-

n

-RRB-

space

and

O

-LRB-

log

n

-RRB-

query

time

-LSB-

-RSB-

We

now

apply

Theorem

to

get

Theorem

A

set

S

of

n

colored

disks

in

can

be

stored

in

a

data

structure

of

size

O

-LRB-

n

log

n

-RRB-

so

that

the

i

distinct

colors

of

the

disks

stabbed

by

any

query

point

can

be

reported

in

time

O

-LRB-

log

n

i

n

-RRB-

Next

we

consider

the

problem

where

the

input

is

a

set

of

colored

disks

and

the

query

is

a

line

Here

our

standard

problem

is

Preprocess

a

set

of

n

disks

such

that

it

can

be

detected

if

a

query

line

intersects

any

disk

In

-LSB-

-RSB-

this

is

reduced

to

a

halfspace

emptiness

query

in

Using

the

data

structure

of

-LSB-

-RSB-

this

is

solvable

in

O

-LRB-

-LRB-

log

n

-RRB-

ffl

-RRB-

space

and

a

query

time

of

O

-LRB-

log

n

-RRB-

We

now

apply

Theorem

and

conclude

Theorem

A

set

S

of

n

colored

disks

in

can

be

stored

in

a

data

structure

occupying

O

-LRB-

-LRB-

logn

-RRB-

ffl

-RRB-

space

so

that

the

i

distinct

colors

of

the

disks

intersected

by

any

query

line

can

be

reported

in

time

O

-LRB-

logn

i

n

-RRB-

Suppose

that

the

input

set

S

is

a

set

of

colored

lines

-LRB-

resp

line

segments

-RRB-

and

the

query

is

a

disk

The

detection

problem

is

Preprocess

n

lines

-LRB-

resp

line

segments

-RRB-

such

that

it

can

be

decided

if

a

query

disk

intersects

any

line

-LRB-

resp

line

segment

-RRB-

To

build

the

detection

structure

we

first

compute

the

arrangement

A

of

the

input

lines

-LRB-

resp

line

segments

-RRB-

For

any

face

f

we

compute

the

Voronoi

diagram

of

the

line

segments

on

the

boundary

of

f

using

the

sweepline

algorithm

of

Fortune

-LSB-

-RSB-

We

also

preprocess

A

for

fast

planar

point

location

-LSB-

-RSB-

Given

a

query

disk

Q

with

center

CQ

and

radius

rQ

we

locate

the

face

f

of

the

arrangement

that

contains

CQ

Next

we

use

f

's

Voronoi

diagram

to

find

the

edge

of

f

that

is

closest

to

CQ

In

this

way

we

know

the

minimal

distance

of

CQ

to

any

line

-LRB-

resp

line

segment

-RRB-

of

S

The

query

disk

intersects

any

line

-LRB-

resp

line

segment

-RRB-

of

S

iff

this

distance

is

at

most

rQ

This

solution

uses

O

-LRB-

-RRB-

space

and

has

O

-LRB-

log

n

-RRB-

query

time

We

now

apply

Theorem

to

get

a

data

structure

of

size

O

-LRB-

log

n

-RRB-

and

query

time

O

-LRB-

log

n

i

n

-RRB-

If

S

is

a

set

of

colored

disks

we

follow

the

same

approach

The

edges

on

the

boundary

of

a

face

are

circular

arcs

We

use

the

algorithm

of

Yap

-LSB-

-RSB-

to

compute

the

Voronoi

diagram

in

this

case

Theorem

A

set

S

of

n

colored

lines

-LRB-

resp

line

segments

disks

-RRB-

in

can

be

stored

in

a

data

structure

of

size

O

-LRB-

log

n

-RRB-

so

that

the

i

distinct

colors

of

the

lines

-LRB-

resp

line

segments

disks

-RRB-

intersected

by

any

query

disk

can

be

reported

in

time

O

-LRB-

log

n

i

n

-RRB-

When

S

is

a

set

of

colored

points

and

the

query

is

an

annulus

using

transforms

and

in

Section

we

get

the

following

detection

problem

Given

n

points

is

there

a

point

in

between

two

parallel

query

planes

in

By

duality

this

becomes

Does

a

vertical

line

segment

in

intersect

any

of

a

set

of

n

planes

In

-LSB-

-RSB-

it

is

shown

that

a

set

of

n

hyperplanes

in

IRd

can

be

stored

in

O

-LRB-

nd

logd

n

-RRB-

space

so

that

a

vertical

ray

shooting

query

can

be

answered

in

O

-LRB-

log

n

-RRB-

time

We

can

use

this

to

solve

our

detection

problem

in

M

-LRB-

n

-RRB-

O

-LRB-

n

-RRB-

space

and

O

-LRB-

log

n

-RRB-

time

We

conclude

Theorem

A

set

S

of

n

colored

points

in

can

be

stored

in

a

data

structure

of

size

O

-LRB-

log

n

-RRB-

so

that

the

i

distinct

colors

of

the

points

intersected

by

any

query

annulus

can

be

reported

in

time

O

-LRB-

log

n

i

n

-RRB-

Generalized

intersection

counting

problems

We

briefly

review

the

technique

of

persistence

which

we

will

use

in

this

section

Persistent

data

structures

Ordinary

data

structures

are

ephemeral

in

the

sense

that

once

an

update

is

performed

the

previous

version

is

no

longer

available

In

contrast

a

persistent

data

structure

supports

operations

on

the

most

recent

version

as

well

as

on

previous

versions

A

persistent

data

structure

is

partially

persistent

if

any

version

can

be

accessed

but

only

the

most

recent

one

can

be

updated

it

is

fully

persistent

if

any

version

can

be

both

accessed

and

updated

In

-LSB-

-RSB-

Driscoll

et

al.

describe

a

general

technique

to

make

persistent

any

ephemeral

linked

data

structure

A

linked

data

structure

consists

of

a

finite

collection

of

nodes

each

with

a

fixed

number

of

fields

Each

field

can

hold

either

a

piece

of

data

such

as

say

an

integer

or

a

real

or

a

pointer

to

another

node

The

in-degree

of

a

node

is

the

number

of

other

nodes

pointing

to

it

Access

to

the

structure

is

accomplished

via

one

or

more

access

pointers

Examples

of

linked

structures

include

linked

lists

and

balanced

binary

search

trees

An

update

operation

typically

modifies

one

or

more

fields

in

the

structure

We

will

call

each

modification

a

memory

modification

Driscoll

et

al.

showed

that

any

linked

structure

whose

nodes

have

constant

in-degree

can

be

made

partially

or

fully

persistent

such

that

each

memory

modification

in

the

ephemeral

structure

adds

just

O

-LRB-

-RRB-

amortized

space

to

the

persistent

structure

and

moreover

the

query

time

of

the

persistent

structure

is

only

a

constant

factor

larger

than

that

of

the

ephemeral

structure

For

our

purposes

partial

persistence

suffices

Our

general

approach

is

to

begin

with

some

ephemeral

dynamic

linked

structure

-LRB-

e.g.

a

linked

list

or

a

binary

search

tree

-RRB-

which

has

one

access

pointer

Starting

with

an

empty

structure

we

then

perform

a

suitable

sequence

of

O

-LRB-

n

-RRB-

updates

using

the

technique

of

Driscoll

et

al

and

obtain

a

partially

persistent

structure

which

contains

all

versions

of

the

ephemeral

structure

Each

version

has

an

associated

timestamp

We

store

the

access

pointers

of

the

different

versions

in

an

array

sorted

by

timestamp

thus

any

desired

version

can

be

accessed

for

querying

by

doing

a

binary

search

in

the

array

If

m

-LRB-

n

-RRB-

is

the

total

number

of

memory

modifications

made

by

the

update

sequence

then

the

persistent

structure

uses

O

-LRB-

m

-LRB-

n

-RRB-

-RRB-

space

Generalized

annulus

range

counting

Let

S

be

a

set

of

n

colored

sites

-LRB-

points

-RRB-

in

the

plane

Let

Ann

-LRB-

q

-RRB-

be

the

query

annulus

with

radius

and

-LRB-

-RRB-

and

center

q

We

wish

to

count

the

distinct

colors

of

the

sites

contained

in

Ann

-LRB-

q

-RRB-

We

begin

by

partitioning

the

plane

into

regions

that

satisfy

a

certain

distance

invariance

property

as

specified

in

the

following

lemma

Lemma

Let

S

be

a

set

of

n

sites

in

the

plane

Let

A

be

the

arrangement

of

the

perpendicular

bisectors

of

the

line

segments

joining

pairs

of

points

in

S.

Let

f

be

any

face

of

A

and

let

and

be

any

two

points

in

f

Then

the

ordering

of

the

sites

by

non-decreasing

distance

from

is

the

same

as

the

ordering

of

the

sites

by

non-decreasing

distance

from

Proof

Let

a

and

b

be

any

two

sites

in

S.

Let

P

-LRB-

a

b

-RRB-

be

the

perpendicular

bisector

of

the

line

segment

ab

and

let

Pa

-LRB-

a

b

-RRB-

-LRB-

resp

Pb

-LRB-

a

b

-RRB-

-RRB-

be

the

closed

halfplane

of

P

-LRB-

a

b

-RRB-

which

contains

a

-LRB-

resp

b

-RRB-

For

any

point

p

in

the

plane

d

-LRB-

p

a

-RRB-

d

-LRB-

p

b

-RRB-

-LRB-

resp

d

-LRB-

p

a

-RRB-

d

-LRB-

p

b

-RRB-

-RRB-

iff

p

Pa

-LRB-

a

b

-RRB-

-LRB-

resp

Pb

-LRB-

a

b

-RRB-

-RRB-

where

d

-LRB-

-RRB-

is

the

Euclidean

distance

function

Face

f

A

is

the

intersection

of

halfplanes

Px

-LRB-

a

b

-RRB-

for

all

pairs

-LRB-

a

b

-RRB-

of

sites

in

S

where

x

is

either

a

or

b.

Suppose

that

we

sort

the

sites

of

S

by

non-decreasing

distance

from

and

independently

sort

them

by

non-decreasing

distance

from

It

is

clear

from

the

above

discussion

that

the

outcome

of

any

distance

comparison

in

the

second

sort

is

identical

to

that

in

the

first

sort

-LRB-

i.e.

d

-LRB-

a

-RRB-

d

-LRB-

b

-RRB-

iff

d

-LRB-

a

-RRB-

d

-LRB-

b

-RRB-

for

any

sites

a

and

b

-RRB-

The

claim

follows

We

preprocess

A

for

fast

planar

point

location

-LSB-

-RSB-

Given

Ann

-LRB-

q

-RRB-

we

locate

q

in

a

face

f

of

A.

Let

E

-LRB-

f

-RRB-

sn

be

the

ordering

of

the

sites

w.r.t.

f

as

given

by

Lemma

By

definition

of

E

-LRB-

f

-RRB-

the

sites

at

distance

at

least

and

at

most

from

q

-LRB-

i.e.

the

ones

in

Ann

-LRB-

q

-RRB-

-RRB-

are

contiguous

in

E

-LRB-

f

-RRB-

say

sj

sk

for

some

j

and

k

n.

Thus

our

problem

becomes

Given

a

sequence

of

colored

integers

n

on

the

real

line

-LRB-

namely

the

indices

of

the

sites

in

E

-LRB-

f

-RRB-

-RRB-

count

the

i

distinct

colors

of

the

points

lying

in

the

interval

-LSB-

j

k

-RSB-

This

is

just

an

instance

of

the

generalized

range

counting

problem

considered

in

-LSB-

-RSB-

There

a

dynamic

solution

was

given

for

this

problem

which

uses

O

-LRB-

n

log

n

-RRB-

space

has

a

query

time

of

O

-LRB-

n

-RRB-

and

undergoes

O

-LRB-

n

-RRB-

memory

modifications

per

update

Let

Df

be

the

structure

for

face

f

Thus

given

j

and

k

we

can

answer

our

problem

in

O

-LRB-

n

-RRB-

time

using

Df

But

how

do

we

find

j

and

k

efficiently

We

find

j

-LRB-

and

symmetrically

k

-RRB-

in

O

-LRB-

log

n

-RRB-

time

using

binary

search

as

follows

Note

that

sj

is

the

site

in

E

-LRB-

f

-RRB-

with

the

smallest

index

j

such

that

d

-LRB-

q

sj

-RRB-

Let

Tf

be

a

red-black

tree

storing

the

sites

according

to

the

order

given

by

E

-LRB-

f

-RRB-

Let

s

be

the

site

at

Tf

's

root

If

d

-LRB-

q

s

-RRB-

-LRB-

resp

d

-LRB-

q

s

-RRB-

-RRB-

then

we

visit

the

left

-LRB-

resp

right

-RRB-

subtree

of

the

root

recursively

Let

l

be

the

leaf

where

the

search

runs

off

T

and

let

be

the

site

stored

at

l

If

the

search

at

l

branched

left

then

j

is

simply

the

index

of

in

E

-LRB-

f

-RRB-

otherwise

j

is

the

index

of

the

site

stored

in

the

inorder

successor

of

l.

Clearly

the

total

space

is

O

-LRB-

log

n

-RRB-

We

can

reduce

this

to

O

-LRB-

n

-RRB-

by

applying

persistence

to

the

faces

of

A.

Lemma

below

provides

a

suitable

ordering

of

the

faces

for

this

purpose

based

on

an

Eulerian

walk

of

an

appropriately

defined

dual

graph

of

A.

-LRB-

Such

an

ordering

of

faces

in

an

arrangement

has

been

used

in

the

past

for

instance

in

-LSB-

-RSB-

-RRB-

Lemma

Let

P

be

any

planar

subdivision

with

m

vertices

There

exists

an

ordering

TP

of

the

faces

of

P

such

that

TP

has

length

O

-LRB-

m

-RRB-

consecutive

faces

in

TP

share

an

edge

and

TP

includes

each

face

of

P

at

least

once

For

faces

f

and

f

of

A

let

-LRB-

f

f

-RRB-

denote

the

number

of

positions

in

which

E

-LRB-

f

-RRB-

and

E

-LRB-

f

-RRB-

differ

Using

Lemma

we

can

prove

Lemma

Let

S

be

a

set

of

n

sites

in

the

plane

Let

A

be

the

arrangement

of

the

perpendicular

bisectors

of

the

line

segments

joining

pairs

of

sites

in

S

There

is

an

ordering

f

f

f

f

t

of

the

t

faces

of

A

such

that

Pt

i

-LRB-

f

i

f

i

-RRB-

O

-LRB-

-RRB-

Proof

Let

TA

fl

be

the

ordering

of

A

's

faces

as

given

by

Lemma

where

l

O

-LRB-

-RRB-

Consider

any

two

consecutive

faces

fi

and

fi

i

l

Let

the

supporting

line

of

the

edge

that

fi

and

fi

share

be

the

perpendicular

bisector

of

the

sites

a

and

b

of

S

Then

E

-LRB-

fi

-RRB-

and

E

-LRB-

fi

-RRB-

are

the

same

except

that

the

positions

of

a

and

b

are

swapped

Thus

-LRB-

fi

fi

-RRB-

and

so

Pl

i

-LRB-

fi

fi

-RRB-

O

-LRB-

-RRB-

The

desired

sequence

f

f

f

t

is

obtained

by

scanning

fl

and

taking

the

first

occurrence

of

each

face

The

lemma

follows

since

Pt

i

-LRB-

f

i

f

i

-RRB-

Pl

i

-LRB-

fi

fi

-RRB-

We

can

now

use

the

ordering

f

f

t

provided

by

Lemma

to

store

all

the

Tf

's

and

Df

's

persistently

We

build

Tf

and

Df

and

then

scan

f

f

t.

For

i

we

determine

the

elements

in

E

-LRB-

f

i

-RRB-

whose

ranks

change

in

E

-LRB-

f

i

-RRB-

delete

them

from

Tf

i

and

Df

i

and

reinsert

them

with

their

new

ranks

These

updates

are

done

in

a

persistent

way

and

yield

Tf

i

and

Df

i

By

Lemma

there

are

O

-LRB-

-RRB-

updates

Moreover

each

update

causes

O

-LRB-

n

-RRB-

memory

modifications

-LRB-

O

-LRB-

-RRB-

for

Tf

and

O

-LRB-

n

-RRB-

for

Df

-RRB-

Theorem

A

set

S

of

n

colored

points

in

the

plane

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

n

-RRB-

such

that

the

distinct

colors

of

the

points

lying

inside

any

query

annulus

can

be

counted

in

O

-LRB-

n

-RRB-

time

Generalized

intersection

counting

on

disks

Here

S

Dng

is

a

collection

of

closed

disks

in

the

plane

The

query

Q

is

a

closed

disk

Let

Ci

be

the

center

of

Di

and

ri

its

radius

i

n.

Let

CQ

and

rQ

denote

the

corresponding

quantities

for

Q.

Recall

the

intersection

condition

for

two

disks

Q

and

Di

namely

Q

intersects

Di

iff

d

-LRB-

CQ

Ci

-RRB-

rQ

ri

It

is

advantageous

to

interpret

the

above-mentioned

intersection

condition

for

Q

and

Di

as

Q

intersects

Di

iff

d

-LRB-

CQ

Ci

-RRB-

ri

rQ

For

any

Di

and

Dj

-LRB-

i

j

-RRB-

let

Lij

be

the

locus

of

the

points

p

such

that

d

-LRB-

p

Ci

-RRB-

ri

d

-LRB-

p

Cj

-RRB-

rj

It

is

well-known

-LSB-

-RSB-

that

Lij

is

a

ray

or

a

hyperbolic

arc

We

construct

the

arrangement

A

of

the

Lij

i

j

n

Since

the

Lij

's

are

of

constant

degree

any

two

can

intersect

only

O

-LRB-

-RRB-

times

Thus

A

consists

of

O

-LRB-

-RRB-

vertices

faces

and

edges

-LRB-

rays

line

segments

or

subarcs

of

hyperbolic

arcs

-RRB-

Using

a

proof

similar

to

Lemma

it

is

easy

to

show

that

within

each

face

f

of

A

for

different

points

p

f

the

ordering

of

the

Ci

's

by

nondecreasing

d

-LRB-

p

Ci

-RRB-

ri

is

invariant

Wlog

let

E

-LRB-

f

-RRB-

Cn

denote

this

ordering

for

f

Assume

that

CQ

f

Then

the

centers

Ci

of

the

disks

Di

that

are

intersected

by

Q

satisfy

d

-LRB-

CQ

Ci

-RRB-

ri

rQ

These

Ci

form

a

prefix

Ck

of

E

-LRB-

f

-RRB-

As

in

the

previous

section

k

can

be

found

in

O

-LRB-

log

n

-RRB-

time

by

doing

a

binary

search

on

E

-LRB-

f

-RRB-

using

rQ

Thus

our

generalized

counting

problem

reduces

to

doing

a

generalized

range

counting

query

on

n

with

the

query

interval

-LRB-

k

-RSB-

In

-LSB-

-RSB-

this

problem

is

solved

in

O

-LRB-

n

-RRB-

space

O

-LRB-

log

n

-RRB-

query

time

and

O

-LRB-

log

n

-RRB-

memory

modifications

per

update

Together

with

the

persistence-based

approach

for

space

reduction

this

immediately

gives

us

the

following

Theorem

A

set

S

of

n

disks

in

the

plane

can

be

preprocessed

into

a

data

structure

of

size

O

-LRB-

log

n

-RRB-

such

that

the

distinct

colors

of

the

disks

that

are

intersected

by

a

query

disk

can

be

counted

in

O

-LRB-

log

n

-RRB-

time

Conclusion

We

have

investigated

the

problem

of

intersection

searching

involving

curved

-LRB-

specifically

circular

and

circle-like

objects

-RRB-

and

have

presented

efficient

solutions

for

two

broad

classes

of

problems

namely

-LRB-

i

-RRB-

for

curved

input

objects

and

curved

query

objects

and

-LRB-

ii

-RRB-

for

a

generalized

version

where

the

input

objects

are

colored

We

close

by

mentioning

an

interesting

direction

for

further

research

Can

our

solutions

be

made

dynamic

so

that

in

addition

to

answering

queries

we

can

also

accommodate

efficiently

insertions

and

deletions

of

objects

in

the

input

set

References

-LSB-

-RSB-

P.K.

Agarwal

and

J.

Matou

sek

On

range

searching

with

semialgebraic

sets

Discrete

Computational

Geometry

-LCB-

-LSB-

-RSB-

P.K.

Agarwal

and

M.

Sharir

Counting

circular

arc

intersections

In

Proceedings

of

the

Annual

Symposium

on

Computational

Geometry

pages

-LCB-

-LSB-

-RSB-

P.K.

Agarwal

and

M.

van

Kreveld

Connected

component

and

simple

polygon

intersection

searching

In

Proceedings

WADS

Lecture

Notes

in

Computer

Science

pages

-LCB-

Springer-Verlag

-LSB-

-RSB-

P.K.

Agarwal

M.

van

Kreveld

and

M.

Overmars

Intersection

queries

for

curved

objects

Journal

of

Algorithms

-LCB-

-LSB-

-RSB-

K.L.

Clarkson

and

P.W.

Shor

Applications

of

random

sampling

in

computational

geometry

-LCB-

II

Discrete

Computational

Geometry

-LCB-

-LSB-

-RSB-

B.

Chazelle

M.

Sharir

and

E.

Welzl

Quasi-optimal

upper

bounds

for

simplex

range

searching

and

new

zone

theorems

Algorithmica

-LCB-

-LSB-

-RSB-

D.P.

Dobkin

and

H.

Edelsbrunner

Space

searching

for

intersecting

objects

Journal

of

Algorithms

-LCB-

-LSB-

-RSB-

J.R.

Driscoll

N.

Sarnak

D.D.

Sleator

and

R.E.

Tarjan

Making

data

structures

persistent

Journal

of

Computer

and

System

Sciences

-LCB-

-LSB-

-RSB-

H.

Edelsbrunner

Algorithms

in

Combinatorial

Geometry

Springer

-LCB-

Verlag

-LSB-

-RSB-

S.

Fortune

A

sweepline

algorithm

for

Voronoi

diagrams

Algorithmica

-LCB-

-LSB-

-RSB-

P.

Gupta

R.

Janardan

and

M.

Smid

Further

results

on

generalized

intersection

searching

problems

counting

reporting

and

dynamization

In

Proceedings

WADS

Lecture

Notes

in

Computer

Science

pages

-LCB-

Springer

Verlag

To

appear

in

Journal

of

Algorithms

-LSB-

-RSB-

P.

Gupta

R.

Janardan

and

M.

Smid

Efficient

algorithms

for

generalized

intersection

searching

on

non-iso-oriented

objects

In

Proceedings

of

the

Annual

ACM

Symposium

on

Computational

Geometry

pages

-LCB-

To

appear

in

Computational

Geometry

Theory

and

Applications

-LSB-

-RSB-

R.

Janardan

and

M.

Lopez

Generalized

intersection

searching

problems

International

Journal

on

Computational

Geometry

Applications

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

D.G.

Kirkpatrick

Optimal

search

in

planar

subdivisions

SIAM

Journal

on

Computing

-LCB-

-LSB-

-RSB-

D.T.

Lee

and

F.P.

Preparata

Location

of

a

point

in

a

planar

subdivision

and

its

applications

SIAM

Journal

on

Computing

-LCB-

-LSB-

-RSB-

J.

Matou

sek

Efficient

partition

trees

Discrete

Computational

Geometry

-LCB-

-LSB-

-RSB-

J.

Matou

sek

Range

searching

with

efficient

hierarchical

cuttings

In

Proceedings

of

the

Annual

ACM

Symposium

on

on

Computational

Geometry

pages

-LCB-

-LSB-

-RSB-

J.

Matou

sek

Reporting

points

in

halfspaces

Computational

Geometry

Theory

and

Applications

-LCB-

-LSB-

-RSB-

J.

Matou

sek

On

vertical

ray-shooting

in

arrangements

Computational

Geometry

Theory

and

Applications

-LCB-

-LSB-

-RSB-

J.

Matou

sek

and

O.

Schwarzkopf

On

ray

shooting

in

convex

polytopes

Discrete

Computational

Geometry

-LCB-

-LSB-

-RSB-

M.

Pellegrini

A

new

algorithm

for

counting

circular

arc

intersections

International

Computer

Science

Institute

Berkeley

-LSB-

-RSB-

F.P.

Preparata

and

M.I.

Shamos

Computational

geometry

-LCB-

an

introduction

Springer

-LCB-

Verlag

-LSB-

-RSB-

M.

Sharir

Intersection

and

closest

pair

problems

for

a

set

of

planar

disks

SIAM

Journal

on

Computing

-LCB-

-LSB-

-RSB-

M.

Sharir

The

k-set

problem

for

arrangements

of

curves

and

surfaces

Discrete

and

Computational

Geometry

-LCB-

-LSB-

-RSB-

M.

van

Kreveld

New

results

on

data

structures

in

computational

geometry

PhD

thesis

Department

of

Computer

Science

University

of

Utrecht

Utrecht

the

Netherlands

-LSB-

-RSB-

M.

van

Kreveld

M.

Overmars

and

P.K.

Agarwal

Intersection

queries

in

sets

of

disks

In

Proceedings

SWAT

Lecture

Notes

in

Computer

Science

pages

-LCB-

Springer

Verlag

-LSB-

-RSB-

C.K.

Yap

The

Voronoi

diagram

of

a

set

of

simple

curve

segments

Discrete

Computational

Geometry

-LCB-

-LSB-

-RSB-

A.C.

Yao

and

F.F.

Yao

A

general

approach

to

d-dimensional

geometric

queries

In

Proceedings

of

the

Annual

ACM

Symposium

on

Theory

of

Computing

pages

-LCB-

computational geometry
data structures
intersection searching