Presentation is loading. Please wait.

Presentation is loading. Please wait.

Counting and Representing Intersections Among Triangles in R 3 Esther Ezra and Micha Sharir.

Similar presentations


Presentation on theme: "Counting and Representing Intersections Among Triangles in R 3 Esther Ezra and Micha Sharir."— Presentation transcript:

1 Counting and Representing Intersections Among Triangles in R 3 Esther Ezra and Micha Sharir

2 Running time and storage independent of the number of intersections. The Problem Given a collection of triangles in R 3 1. Count efficiently their intersections. 2. Represent in a compact form the overall set of intersections, without reporting them explicitly. |A|  |B|  |C| =  (n 3 ) intersections A B C

3 Motivation 1. 3-Dimensional slope selection Select the k-th highest vertex in an arrangement of n triangles in R 3. (Reduces via parametric search to: How many vertices lie above a given plane?) 2. Draw a random element out of the entire intersection set, without constructing this set explicitly. (Used in a randomized solution of 1.)

4 Known results in R 2 Problem Running time Ref Counting intersections O*(n 4/3 ) Agarwal 91 (segments) Counting intersections O*(n 3/2 ) Agarwal et al. 93 (circular arcs) Use O*(n  ) to denote O(n  +ε ), for any ε > 0.

5 Known results in R 3 Problem Running time Ref Reporting all  pairs of O*(n 4/5  4/5 ) de Berg et al. 99 intersecting triangles intersecting triangles Counting all intersecting O*(n 8/5 ) Agarwal et al. 02 pairs (convex polyhedrons) No previous work regarding counting intersecting triples among n objects in R 3 ! Subquadratic when  << n 3/2

6 Our results 1. Algorithm that 1. Counts all intersecting triples in O*(n 2 ) time. 2. Constructs a compact representation of the set of all intersections using O*(n 2 ) time and storage. 2. The problem is 3SUM-hard. 3. Extensions: planar simple shaped objects in R 3 : O*(n 2 )

7 Preliminary stage (Good for small  ) Report all  pairs of intersecting triangles: O*(n 8/5 +  ) (using segment intersection queries in R 3 ) Count on each triangle t the number of intersections: O*(  n 1/3 ) (using planar segment-intersection counting.) Overall running time: O*(n 8/5 +  n 1/3 ) subquadratic when  << n 5/3

8 Ingredients of the algorithm: Curve-sensitive cutting Input: T = {t 1, …, t n } For any r  n, there exists a (1/r)-cutting Ξ for T of size O*(r 3 ), s.t. the number of crossings between the edges of the triangles in T and the cells of Ξ is O*(nr). Use Dobkin-Kirkpatrick hierarchical decomposition (Cannot be extended to other objects in R 3) In general, use a “curve-sensitive” cutting [Koltun-Sharir 03] O(nr 2 ) in a standard cutting.

9 The recursive decomposition Construct a “curve-sensitive” (1/r)-cutting Ξ, and count the intersecting triples in each cell of Ξ separately. Definition: Δ ΞΔ  ΞΔ ΞΔ  Ξ t  T t is long in Δ Δ ΞΔ  ΞΔ ΞΔ  Ξ t  T t is short in Δ

10 Classification of intersecting triples 1. LLL: All three triangles are long in Δ. 2. LLS: Two triangles are long, and one is short. 3. LSS: One triangle is long, and two are short. 4. SSS: All three triangles are short in Δ.

11 General idea Use recursion: 1. Compute LLL before recursing. 2. Compute LLS, LSS, SSS at the bottom of recursion. 3. Use the curve-sensitivity of the cutting to control the overall performance.

12 Counting intersections of type LLL (Agarwal-91) t q l1 p l1 l1l1 l2l2l2l2 p l2 q l2 Count all intersecting pairs on each clipped triangle t (within Δ ) in O(N L log N L ) time. Number of clipped long triangles in Δ. q l1 p l1 p l2 q l2 Interleaving

13 Overall running time O(N L 2 log N L ) Important! Each LLL intersection has to be counted only once. Count only intersections that involve at least one new long triangle. Count only intersections that involve at least one new long triangle. The running time becomes: O(N s (N s +N L ) log (N s +N L ) ) A triangle that is short in the parent cell of Δ, but long in Δ.

14 Counting intersections of type LLS Use a similar algorithm as in the LLL case. Count all intersecting pairs on each clipped short triangle t (within Δ ) in O(N L log N L ) time. Overall running time: O(N S N L log N L ) Number of clipped short triangles in Δ.

15 Counting intersections of type LSS and SSS (Agarwal-91) LSS: On each short clipped triangles t, count intersecting pairs of long- short segments. Passing to the dual plane: O(N S 2 + N L log N L ). Overall: O(N S 3 + N S N L log N L ). SSS: Brute-force algorithm: O(N S 3 ). Overall running time: O(N S 3 + N S N L log N L ). t

16 The overall recursive algorithm 1. Initially  0 = R 3 : N L =0, N S =n. 2. If N S  N L ½ (Bottom of recursion) Count all LLS, LSS and SSS. 3. Otherwise, partition  0 into smaller subcells , using (1/r)-sensitive cutting. 4. Count all new LLL intersections within each subcell  of  0. These intersections are counted only once.

17 The overall recursive algorithm 5. Continue to solve each subproblem in  recursively - with some care. Problem: There are O*(r 3 ) new subproblems, each containing N L / r long triangles and N S / r short ones. With no extra care, the running time may become cubic! The goal of the recursion is only to count efficiently LSS and SSS

18 Recursion – extra care BUT there are O*(N S r) crossings in total. The number of short triangles in most of the cells in Ξ is O*(N S / r 2 ). There are only o(r 3 ) cells that are crossed by >> N S / r 2 short triangles.

19 Overall running time O*(N S (N S +N L )). Initially, N S = n, N L = 0, The number of intersecting triples in T can be counted in time min{O*(n 2 ), O*(n 8/5 +  n 1/3 ) }. The preliminary stage The overall recursive algorithm

20 Compact representation T = {t 1, …, t n }. All intersecting triples among T can be represented by a 3-uniform hypergraph H = (T,E), E = { {t i, t j, t k } | t i, t j, t k  T, t i,  t j,  t k  } A compact representation for H is a collection  = {H i = (V i,E i )} I of subhypergraphs of H, s.t., 1. V i = A i  B i  C i, E i = A i  B i  C i (H i is a complete tripartite 3-uniform hypergraph.) 2. E =  i E i. 3. E i  E j = , for i  j.  i |A i |+|B i |+|C i | is the overall storage of this representation. The edges are now defined implicitly.

21 Compact representation: Example A B C H = (A  B  C, A  B  C) |A|+|B|+|C| is the overall storage of this representation.

22 Algorithm Use a similar recursive mechanism as in the counting problem. Modify the four simple subroutines (for the planar case), so they construct a compact representation in similar running times. Modify the preliminary stage, so that it produces the compact representation. Uses the four modified subroutines

23 Compact representation subroutines Overall size (and running time) LLL: O(N s (N s +N L ) log 2 (N s +N L ) ) LLS: O(N s N L log 2 N L ) LSS: O*(N s 3 + N s N L ) SSS: O(N s 3 )

24 Overall storage and running time Recursive algorithm: O*(N S (N S +N L ) ). Initially, N S = n, N L = 0, The overall size of the compact representation: min{O*(n 2 ), O*(  n 1/3 ) }. Running time: min{O*(n 2 ), O*(n 8/5 +  n 1/3 ) }. min{O*(n 2 ), O*(n 8/5 +  n 1/3 ) }.

25 Counting all intersecting triples is a 3SUM-hard problem 3SUM: Given 3 sets of integers A, B, and C, of total size n, are there a  A, b  B, and c  C with a+b=c ? h c : z = c h a : x = a h b : y = b H: z=x+y (a,b,c)  H iff number of intersections above/below H < |A||B||C|

26 Extensions: Planar simply shaped objects S = {s 1, …, s n }. s  S is bounded by a closed curve of constant description complexity. Algorithm: Use a similar recursive mechanism as in the case of triangles. Modify the four simple subroutines (in the triangle case), so they count all intersecting triples in similar running times. Use curve-sensitive cutting for S.

27 Further research Extend the problem to non-planar (simple) surfaces in R 3. Higher dimensions: Count intersecting k-tuples (2  k < d) among n simplices in R d. ( k=d : O*(n d-1 ). Optimal? ). Problem: Endpoints do NOT interleave LLL

28 Representing LLL (LLS) intersections Represent compactly all pairs {t i, t j }, i  j, that satisfy p i < p j < q i < q j t pipi qiqi lili ljljljlj qjqj pjpj

29 Query with p j v pjpjpjpj qjqjqjqj T 2 (v) T1T1T1T1 The first level structure T 1 stores all points p i in sorted order. T 2 (v) stores all the points q i whose matching points are stored at v. Use a 2-level tree-like structure. Overall size of the output graphs: O(N S N L log 2 N L )

30 Representing LSS intersections Idea: Construct a (1/r)-cutting  for S t * and locate the points of L t * in the cells of . Overall size of the representation of all LSS intersections: O(N S 3+ δ + N S N L 1+δ ), for any δ > 0. t The set of the double-wedges (dual to short segments within t). The set of the points (dual to long segments within t).

31 Counting all intersecting triples is a 3SUM-hard problem 3SUM’: Given 3 sets of integers A, B, and C, of total size n, are there a  A, b  B, and c  C with a+b=c ? h c : z = c h a : x = a h b : y = b x+y-1/2  z  x+y+1/2 H: z=x+y


Download ppt "Counting and Representing Intersections Among Triangles in R 3 Esther Ezra and Micha Sharir."

Similar presentations


Ads by Google