29
Computing the Volume of the Union of Cubes in R 3 Pankaj K. Agarwal Haim Kaplan Micha Sharir

Computing the Volume of the Union of Cubes in R 3 Pankaj K. Agarwal Haim Kaplan Micha Sharir

Embed Size (px)

Citation preview

Computing the Volume of the Union of Cubes in R3

Pankaj K. AgarwalHaim KaplanMicha Sharir

Problem Statement

C: Set of n cubes in R3

U(C): Union of cubes in C

Compute Vol(U(C))

U(C) has (n2) vertices!

Cannot compute U(C) explicitly if looking for o(n2) algorithm!

Related Work

B: Set of n orthogonal boxes in Rd

Compute Vol(U(B)).

d=1: O(nlogn) [Klee, 1977] (nlogn) [Fredman-Weide, 1978]

d=2: O(nlogn) [Bentley,1977]

d≥3: O(nd-1 logn) [Bentley,1977]

O(nd/2 logn) [Overmars-Yap, 1988]

Can one do better if B is a set of cubes?

Our Result

Theorem: Volume of the union of n cubes in R3 can be computed in O(n4/3log n) time.

• Plane sweep algorithm (as Overmars-Yap algorithm)• Dynamic data structure to maintain the union of

squares– O(n1/3log n) (amortized) time per insert/delete

Conjecture: O(npolylog(n)) algorithm

Overmars-Yap Algorithm (d=3)

•Sweep a plane in +z-direction

•Maintain the area of the cross section of the union

Union of Cross-Section

R: Intersection rectangles of B & the sweep plane

Maintain Area(U(R))

Maintaining theArea

Project R on the x-y plane and bound in a box B

Insert/Delete rectangles in R

B

Partition B into slabs, n1/2 vertical edges (& vertices) in a slab

Data StructureB

Partition each slab into n1/2 cells; no vertex in a cell

Maintain the union of rectangles within each cell

B

A segment tree over each slabMaintains the union within slab

Update segment tree when a rectangle intersecting the slab is inserted or deleted

Back to cubes

n1/3 slabs, n1/3 cells in a slab, n1/3 points in a cell

A square intersects a cell in a more complicated way

Classification of Squares in a cell

x0 x1

y0

y1

Pillars (long)

Classification of Rectangles in a cell

lower rim (long)

upper rim (long)

corners (short), #corners = n1/3

floaters (short), #floaters= n1/3

•Easy to maintain the area of the union of each class•Combining the area of different classes is difficult

•Maintain the areas of disjoint regions•rims•pillars – rims•corners – pillars – rims•floaters – corners – pillars – rims

•Update these areas as squares inserted/deleted

•Insertion/deletion of a •Long square: O(log n) time•Short square: O(n1/3log n)

lower rim (long)

Maintain a list of lower rim squares sorted by increasing y coordinate of the top edge

floor

ceiling

Area = [(y1-ceil)+(floor-y0)](x1-x0) + …

π

Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-floor) +

Maintain the cross section of the pillars with the bottom edge

Corners:

Partition their union into disjoint rectangles

Combine corners wilth pillars & rims to maintain

ψ : Area(corners-pillars-rims)

Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-floor) + ψ…

# rectangles: n1/3

floor

ceiling

Maintaining Floaters

Decompose the portion of union of floaters outside corners into a set R of disjoint rectangles

|R| = n1/3

Combine R with pillars and rims to maintain

φ :Area(R– pillars – rims)

Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-floor) + ψ + φ

floor

ceiling

Updating the Area• Inserting/deleting a corner/floater

– Recompute ψ, φ

– Time: O(n1/3log n) • Inserting/deleting a pillar

– Update ψ, π, φ

– Time: O(log n)• Inserting/deleting a lower (upper) rim

– Update area of rims, ψ, π, φ– Updating ψ, φ is expensive

floor

ceiling

Recompute ψ, φ whenever flr/ceiling crosses a floater boundary

floor

ceiling

A bottom or top edge of a “floater” can be covered once

Charge the time spent in updating ψ, φ to the floater edge

Amortized time to insert/delete rim: O(log n)

Fortunately:

Summary

• lots of open questions remain:

• Improve the bound for cubes ?• Improve the bound for general boxes ?• Higher dimensions