Output-Sensitive Construction Output-Sensitive Construction of the Union of Trianglesof the Union of Triangles
Esther Ezra and Micha SharirEsther Ezra and Micha Sharir
Definition: UnionDefinition: Union
T ={T ={11,…, ,…, nn}} - collection of - collection of nn
triangles in the plane.triangles in the plane.
The union The union U=U=ii II is defined is defined
as all regions in the plane as all regions in the plane that are covered by the that are covered by the triangles of triangles of TT..
Constructing the Union: Constructing the Union: MotivationMotivation
Robot motion planningRobot motion planning
Construct the forbidden Construct the forbidden portion of the portion of the configuration space.configuration space.
Ray shooting amid semi-Ray shooting amid semi-algebraic sets in algebraic sets in RR33
Construct the union of 4-Construct the union of 4-dimensional regions.dimensional regions.
Computing the unionComputing the unionConstructing the arrangement of the triangles – too slow! Constructing the arrangement of the triangles – too slow!
O(nO(n22))
Output-sensitive algorithm Output-sensitive algorithm (in terms of the number of edges (in terms of the number of edges
on the boundary)? on the boundary)? unlikely to exist!unlikely to exist!
3SUM === HOLE-IN-UNION3SUM === HOLE-IN-UNION
The best known solutions to problems from the 3SUM-hard The best known solutions to problems from the 3SUM-hard family require family require (n(n22)) time in the worst case. time in the worst case.
Union of triangles in RUnion of triangles in R22
Known resultsKnown resultsSpecial cases Union size Ref Special cases Union size Ref
Fat triangles Fat triangles O(n loglog n)O(n loglog n) MPSSW-94 MPSSW-94
Pseudodiscs Pseudodiscs O(n)O(n) KLPS-86 KLPS-86
General triangles:General triangles:
Algorithm Running time RefAlgorithm Running time Ref
RIC RIC O(n log n + O(n log n + ΘΘ11)) AH-01 AH-01
DC DC O(nO(n22)) EHS-02 EHS-02
Performs well in Performs well in practicepractice
ii |V |Vii| / i| / i
VVii – the set of – the set of
vertices in vertices in depthdepth ii
““Output-sensitive” union Output-sensitive” union constructionconstruction
Given a collection Given a collection T ={T ={11,…, ,…, nn}} of of nn
triangles in the plane, such that there triangles in the plane, such that there exists a subset exists a subset S S TT (unknown to us), (unknown to us),
of of << n << n triangles with triangles with
SS = = TT ,,
construct construct efficientlyefficiently the union of the triangles the union of the triangles in in TT..
Output Sensitivity: Example IOutput Sensitivity: Example I
= 2= 2
= 6= 6
Only 4 triangles Only 4 triangles determine the determine the
boundary of the boundary of the unionunion
Output Sensitivity: Example IIOutput Sensitivity: Example II
Our ResultOur Result
We show that when there exists a subset We show that when there exists a subset S S TT of of << n << n triangles, such that triangles, such that
SS = = TT , ,
the union can be constructed in the union can be constructed in O*(nO*(n4/34/3 + + nn)) time. time.
Subquadratic whenSubquadratic when = o*(n) = o*(n)
A Set Cover in a Set SystemA Set Cover in a Set System
Use a variant of the method of Bronnimann Use a variant of the method of Bronnimann and Goodrich for finding a and Goodrich for finding a set coverset cover in a in a set system of set system of finite VC-dimensionfinite VC-dimension
Our set system :Our set system : (V(V++, T), T)
The set of The set of vertices of vertices of A(T)A(T)
that lie inside the that lie inside the unionunion
Hitting Set in a Set SystemHitting Set in a Set System
Dual set system:Dual set system: (T, V*) (T, V*)V* = { TV* = { Tvv : v : v V V++ } }
TTvv consists of all the triangles in consists of all the triangles in TT that contain that contain vv in in their interior.their interior.
A hitting set: A hitting set: a subset a subset HH T T , s.t. , s.t. HH has a non empty has a non empty intersection with every subset member of intersection with every subset member of V*V*..
A hitting set H for A hitting set H for (T,V*)(T,V*) is a set cover for is a set cover for (V(V++,T).,T). H = H = T T
Finding a Hitting Set – general schemeFinding a Hitting Set – general scheme(Bronnimann and Goodrich)(Bronnimann and Goodrich)
1.1. Assign weights to the triangles in Assign weights to the triangles in TT..Initially, all weights are Initially, all weights are 11..
2.2. Net finder:Net finder: Construct a Construct a (1 / 2(1 / 2)-net)-net NN for for (T,V*) (T,V*) ..( guess of a hitting set for ( guess of a hitting set for (T, V*) (T, V*) with with |N| = O(|N| = O( log log ) ) ). ).
3.3. Verifier:Verifier: If there exists a subset If there exists a subset TTvv that is not hit by that is not hit by N N (there exists a vertex (there exists a vertex vvVV++ outside outside NN) ,) ,
doubledouble the weights of the triangles in the weights of the triangles in TTvv..Goto 2.Goto 2.
Else Else NN is a hitting set for is a hitting set for (T,V*) (T,V*)
Performance of the algorithmPerformance of the algorithm
A hitting set of size A hitting set of size O(O( log log )) is found after is found after O(O( log (n/ log (n/)))) iterations. iterations.
Ideal SettingIdeal Setting
ProblemProblem:: The algorithm requires the knowledge of The algorithm requires the knowledge of VV++..(But we cannot afford to compute(But we cannot afford to compute VV++ explicitly).explicitly).
Solution: Variant of the algorithmSolution: Variant of the algorithm Use a random subsetUse a random subset RR V V++ instead.instead.
|R| = r = |R| = r = (t log n)(t log n)
Lemma:Lemma: A subset A subset HH that covers that covers RR, covers most of the , covers most of the vertices of vertices of VV++ , with high probability:, with high probability:
The number of remaining uncovered verticesThe number of remaining uncovered vertices /t /t
HH and and RR are are independent!independent!
= |V|V++||
The The residual costresidual cost of the B-G of the B-G algorithmalgorithm
How many vertices at How many vertices at positive-depthpositive-depth (in V(in V++) are constructed by the B-G ) are constructed by the B-G algorithm?algorithm?
O(O(22 log log22 + + /t /t ), ), with high probability.with high probability.
The The O(O( log log )) triangles in triangles in HH(over pessimistic)(over pessimistic)
All remaining uncovered All remaining uncovered verticesvertices
ImplementationImplementation
Net finderNet finder Drawing a sample R Drawing a sample R VerifierVerifier
The actual construction of the unionThe actual construction of the union
O(O( log (n/ log (n/)))) timestimes
Simple ImplementationSimple Implementation
Sampling Sampling RR: : O*(r nO*(r n22 / / ) ) pairs of triangle pairs of triangle edgesedges O(r) O(r) real vertices.real vertices.
Net-finder: Net-finder: O(n)O(n)
Verifier: (brute-force) Verifier: (brute-force) O*(rO*(r + n) + n)
IfIf = O(n = O(n4/34/3), construct the ), construct the entire arrangement, and report entire arrangement, and report
the unionthe union
The actual construction of the The actual construction of the unionunion
Divide the process into two stages:Divide the process into two stages:
1.1. Construct the union of all the triangles in Construct the union of all the triangles in HH..
2.2. Insert all the remaining triangles (covering Insert all the remaining triangles (covering /t /t positive-depthpositive-depth vertices).vertices).
U is the union of the triangles in
H.
t1, t2, t3 are the remaining triangles.
The actual construction of the The actual construction of the unionunion
Divide the set of the remaining triangles into Divide the set of the remaining triangles into n/(n/( log log )) subsets, each of size subsets, each of size O(O( log log ) . ) .
Construct Construct H H in in O(O(22 log log22)) time. time.For each such subset For each such subset SS, construct , construct A(S).A(S).Report all intersections between Report all intersections between SS and and
H H in an output-sensitive manner. in an output-sensitive manner.
O*(nO*(n + + / t) / t)
Overall running timeOverall running time
O*(nO*(n4/34/3 + + r nr n22 / / + r + r22 + n + n + + / t) / t)
r = r = ΩΩ(t log n)(t log n)
ChooseChoose t = k t = k1/21/2 / /
O*(nO*(n4/34/3 + + nn))
Extensions: Simple objects in Extensions: Simple objects in RR22
Implementation: generic and simple.Implementation: generic and simple.
The algorithm can be easily extended to other The algorithm can be easily extended to other simple geometric objects in simple geometric objects in RR22: : O*(nO*(n4/34/3 + n + n))
Extensions: Simple objects Extensions: Simple objects inin RR33
Sampling Sampling RR: : O*(r nO*(r n33 / / ))
Net-finder: Net-finder: O(n)O(n)
Verifier: (brute-force) Verifier: (brute-force) O*(rO*(r + n) + n)
Actual construction of the union: construct the union, in an Actual construction of the union: construct the union, in an output-sensitive manner, on every facet of the input output-sensitive manner, on every facet of the input objects separately. objects separately. O*(nO*(n22 + + / t / t).).
Overall running time: Overall running time: O*(n O*(n22 ).).
IfIf = O(n = O(n22), construct the entire ), construct the entire arrangement, and report the unionarrangement, and report the union
Similar routines Similar routines as beforeas before
Extensions: Simple objects Extensions: Simple objects inin RRdd
Apply the Apply the (d-1)(d-1)-approach on each facet of the input -approach on each facet of the input objects, using induction on objects, using induction on dd..
Overall running time: Overall running time: O*(n O*(nd-1d-1 ).).
Earlier variantEarlier variant
We used the Disjoint-Cover (DC) algorithmWe used the Disjoint-Cover (DC) algorithm[Ezra, Halperin, Sharir 2002][Ezra, Halperin, Sharir 2002]
1.1. Implementation: Implementation: 1.1. more complex.more complex.
2.2. heavily relies on the geometry of the input objects heavily relies on the geometry of the input objects Less generic. Less generic.
2.2. Less efficient (subquadratic only for a Less efficient (subquadratic only for a smallersmaller range of range of ))..
Further researchFurther research
Simpler efficient alternative approaches?Simpler efficient alternative approaches?
RIC : fails!RIC : fails!