290 likes | 437 Views
Computing the Volume of the Union of Cubes in R 3. Pankaj K. Agarwal Haim Kaplan Micha Sharir. Problem Statement. C : Set of n cubes in R 3 U ( C ): Union of cubes in C Compute Vol( U ( C )) U ( C ) has W ( n 2 ) vertices !.
E N D
Computing the Volume of the Union of Cubes in R3 Pankaj K. Agarwal Haim Kaplan Micha Sharir
Problem Statement C: Set of n cubes in R3 U(C):Union of cubes inC Compute Vol(U(C)) U(C) hasW(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] W(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 inO(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))
B Maintaining theArea Project R on the x-y plane and bound in a box B Insert/Delete rectangles in R
Data Structure B Partition B into slabs, n1/2vertical edges (& vertices) in a slab
B Partition each slab into n1/2 cells; no vertex in a cell Maintain the union of rectangles within each cell
A segment tree over each slab Maintains the union within slab Update segment tree when a rectangle intersecting the slab is inserted or deleted
Back to cubes n1/3 slabs, n1/3cells in a slab, n1/3 points in a cell
Classification of Squares in a cell y1 y0 x1 x0
Classification of Rectangles in a cell Pillars (long)
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)
Maintain a list of lower rim squares sorted by increasing y coordinate of the top edge floor lower rim (long)
ceiling Area = [(y1-ceil)+(floor-y0)](x1-x0) + …
Maintain the cross section of the pillars with the bottom edge π Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-floor) + …
Corners: Partition their union into disjoint rectangles
ceiling floor # rectangles: n1/3 Combine corners wilth pillars & rims to maintain ψ : Area(corners-pillars-rims) Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-floor) + ψ…
Maintaining Floaters Decompose the portion of union of floaters outside corners into a set R of disjoint rectangles |R| = n1/3
ceiling floor Combine R with pillars and rims to maintain φ:Area(R– pillars – rims) Area = [(y1-ceil)+(floor-y0)](x1-x0) + π(ceil-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 Recompute ψ, φwhenever flr/ceiling crosses a floater boundary
Fortunately: ceiling floor 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)
Summary • lots of open questions remain: • Improve the bound for cubes ? • Improve the bound for general boxes ? • Higher dimensions