computing the volume of the union of cubes in r 3 pankaj k. agarwal haim kaplan micha sharir
TRANSCRIPT
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
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
•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
π
Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-floor) +
…
Maintain the cross section of the pillars with the bottom edge
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: