Title: Counting and Representing Intersections Among Triangles in R3
1Counting and Representing Intersections Among
Triangles in R3
- Esther Ezra and Micha Sharir
2The Problem
C
- Given a collection of triangles in R3
- Count efficiently their intersections.
- Represent in a compact form the overall set of
intersections, without reporting them explicitly.
A
B
Running time and storage independent of the
number of intersections.
A?B?C ?(n3) intersections
3Motivation
- 3-Dimensional slope selectionSelect the k-th
highest vertex in an arrangement of n triangles
in R3.(Reduces via parametric search toHow
many vertices lie above a given plane?) - Draw a random element out of the entire
intersection set, without constructing this set
explicitly.(Used in a randomized solution of 1.)
4Known results in R2
- Problem Running
time Ref - Counting intersections O(n4/3)
Agarwal 91 - (segments)
- Counting intersections O(n3/2)
Agarwal et al. 93 - (circular arcs)
Use O(n?) to denote O(n?e), for any e gt 0.
5Known results in R3
- Problem Running
time Ref - Reporting all ? pairs of O(n4/5 ?4/5)
de Berg et al. 99 - intersecting triangles
- Counting all intersecting O(n8/5)
Agarwal et al. 02 - pairs (convex polyhedrons)
- No previous work regarding counting intersecting
triples among n objects in R3 !
Subquadratic when ? ltlt n3/2
6Our results
- Algorithm that
- Counts all intersecting triples in O(n2) time.
- Constructs a compact representation of the set of
all intersections using O(n2) time and storage. - The problem is 3SUM-hard.
- Extensions planar simple shaped objects in R3
O(n2)
7Preliminary stage(Good for small ?)
- Report all ? pairs of intersecting triangles
O(n8/5 ?) (using segment intersection queries
in R3) - Count on each triangle t the number of
intersections O(? n1/3) (using planar
segment-intersection counting.) - Overall running time O(n8/5 ? n1/3)
- subquadratic when ? ltlt n5/3
8Ingredients of the algorithmCurve-sensitive
cutting
- Input T t1, , tn
- For any r?n, there exists a (1/r)-cutting ? for T
of size O(r3), 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 R3)
- In general, use a curve-sensitive cutting
Koltun-Sharir 03
O(nr2) in a standard cutting.
9The recursive decomposition
- Construct a curve-sensitive (1/r)-cutting ? ,
and count the intersecting triples in each cell
of ? separately. - Definition
-
t ? T
t ? T
? ? ?
? ? ?
t is short in ?
t is long in ?
10Classification of intersecting triples
- LLL All three triangles are long in ?.
- LLS Two triangles are long, and one is short.
- LSS One triangle is long, and two are short.
- SSS All three triangles are short in ?.
11General idea
- Use recursion
- Compute LLL before recursing.
- Compute LLS, LSS, SSS at the bottom of recursion.
- Use the curve-sensitivity of the cutting to
control the overall performance.
12Counting intersections of type LLL (Agarwal-91)
ql1
ql1
l2
pl2
ql2
pl2
Interleaving
ql2
pl1
t
pl1
l1
Count all intersecting pairs on each clipped
triangle t (within ? ) in O(NLlog NL) time.
Number of clipped long triangles in ? .
13Overall running time
- O(NL2 log NL)
- Important!
- Each LLL intersection has to be counted only
once. - Count only intersections that involve at
least one new long triangle. - The running time becomes
- O(Ns (NsNL) log (NsNL) )
A triangle that is short in the parent cell of ?,
but long in ? .
14Counting 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(NLlog NL) time. - Overall running time O(NSNL log NL)
Number of clipped short triangles in ? .
15Counting 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(NS2 NL log NL).
- Overall O(NS3 NSNL log NL).
- SSS Brute-force algorithm O(NS3).
- Overall running time O(NS3 NS NL log NL).
t
16The overall recursive algorithm
- Initially ?0 R3 NL0, NSn.
- If NS ? NL½ (Bottom of recursion)Count all LLS,
LSS and SSS. - Otherwise, partition ?0 into smaller subcells ?,
using (1/r)-sensitive cutting. - Count all new LLL intersections within each
subcell ? of ?0 .
These intersections are counted only once.
17The overall recursive algorithm
- Continue to solve each subproblem in ?
recursively - with some care. - Problem
- There are O(r3) new subproblems, each containing
NL / r long triangles and NS / 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
18Recursion extra care
- BUT there are O(NS r) crossings in total.
- The number of short triangles in most of the
cells in ? is O(NS / r2) . - There are only o(r3) cells that are crossed by
gtgt NS / r2 short triangles.
19Overall running time
- O(NS (NSNL)) .
- Initially, NS n, NL 0 ,
- The number of intersecting triples in T can be
counted in time minO(n2) , O(n8/5 ? n1/3) .
The preliminary stage
The overall recursive algorithm
20Compact representation
- T t1, , tn . All intersecting triples among
T can be represented by a 3-uniform hypergraph H
(T,E) , - E ti, tj, tk ti, tj, tk ? T , ti,? tj, ?
tk ?? - A compact representation for H is a collection H
Hi (Vi,Ei)I of subhypergraphs of H, s.t., - Vi Ai?Bi?Ci , Ei Ai?Bi?Ci (Hi is a complete
tripartite 3-uniform hypergraph.) - E ?i Ei .
- Ei ? Ej ? , for i?j .
- ?i AiBiCi is the overall storage of this
representation.
The edges are now defined implicitly.
21Compact representation Example
C
H (A?B?C, A?B?C)
A
B
ABC is the overall storage of this
representation.
22Algorithm
- 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
23Compact representation subroutines
- Overall size (and running time)
- LLL O(Ns (NsNL) log2(NsNL) )
- LLS O(Ns NL log2 NL )
- LSS O(Ns3 NsNL)
- SSS O(Ns3)
24Overall storage and running time
- Recursive algorithm O(NS (NSNL) ) .
- Initially, NS n, NL 0 ,
- The overall size of the compact
representationminO(n2) , O(? n1/3) . - Running time
- minO(n2) , O(n8/5 ? n1/3) .
25Counting 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 abc ?
hc z c
hb y b
H zxy
(a,b,c)?H iff number of intersections above/below
H lt ABC
ha x a
26Extensions Planar simply shaped objects
- S s1, , sn .
- 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.
27Further research
- Extend the problem to non-planar (simple)
surfaces in R3. - Higher dimensionsCount intersecting k-tuples (2
? k lt d) among n simplices in Rd. ( kd
O(nd-1). Optimal? ).
LLL
Problem Endpoints do NOT interleave
28Representing LLL (LLS) intersections
pi
lj
qj
pj
t
qi
li
- Represent compactly all pairs ti, tj, i?j, that
satisfy pi lt pj lt qi lt qj
29T2(v)
T1
Use a 2-level tree-like structure.
The first level structure T1 stores all points pi
in sorted order.
v
pj
qj
Overall size of the output graphs O(NSNL
log2NL)
T2(v) stores all the points qi whose matching
points are stored at v.
Query with pj
30Representing LSS intersections
Idea Construct a (1/r)-cutting ? for St and
locate the points of Lt in the cells of ?
. Overall size of the representation of all
LSS intersectionsO(NS3 d NSNL1d) , for any
d gt 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).
31Counting 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 abc ?
hc z c
hb y b
H zxy
ha x a