0% found this document useful (0 votes)
29 views

Sublinear Geometric Algorithms

An overview of some of the sublinear geometric algorithms in 1D, 2D and 3D: the successor search problem; polygonal intersection problem; polyhedral intersection problem.

Uploaded by

Mikhail Dubov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Sublinear Geometric Algorithms

An overview of some of the sublinear geometric algorithms in 1D, 2D and 3D: the successor search problem; polygonal intersection problem; polyhedral intersection problem.

Uploaded by

Mikhail Dubov
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 108

Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Sublinear Geometric Algorithms


Successor search. Polygonal and polyhedral intersections

Mikhail Dubov

March 22, 2016

1 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Outline

1 Context

2 1D: Successor searching

3 2D: Polygonal intersection

4 3D: Polyhedral intersection

5 Applications

2 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Outline

1 Context

2 1D: Successor searching

3 2D: Polygonal intersection

4 3D: Polyhedral intersection

5 Applications

3 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Geometric algorithms

70's-90's: Classical computational geometry algorithms


→ Convex hulls
→ Voronoi diagrams
→ Delaunay trianguations
→ Linear programming

4 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Geometric algorithms

70's-90's: Classical computational geometry algorithms


→ Convex hulls
→ Voronoi diagrams
→ Delaunay trianguations
→ Linear programming

00's: Research on sublinear algorithms


Motivation: Availability of massive geometric datasets
Problem: Impossible to examine more than a fraction of the
input

4 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Sublinear geometric algorithms

Two main approaches to achieve sublinearity:

5 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Sublinear geometric algorithms

Two main approaches to achieve sublinearity:

Data preprocessing
Look at the whole data once, make
the subsequent queries fast
Example: Point location in Rk
One can build a k d-tree O(n)
in
Nearest neighbor search: O(log n)
per query on average

5 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Sublinear geometric algorithms

Two main approaches to achieve sublinearity:

Data preprocessing
Look at the whole data once, make
the subsequent queries fast
Example: Point location in Rk
One can build a k d-tree O(n)
in
Nearest neighbor search: O(log n)
per query on average

Randomization
Look only at a portion of the data
Example: Point location in
Delaunay triangulations (stay tuned)

Expected O( n) time per query
without preprocessing

5 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Randomized algorithms

Two main types of randomized algorithms:

6 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Randomized algorithms

Two main types of randomized algorithms:


Monte Carlo algorithms:
Running time is bounded
P(Results are correct) < 1

6 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Randomized algorithms

Two main types of randomized algorithms:


Monte Carlo algorithms:
Running time is bounded
P(Results are correct) < 1
Ex.: Miller-Rabin primality test

6 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Randomized algorithms

Two main types of randomized algorithms:


Monte Carlo algorithms:
Running time is bounded
P(Results are correct) < 1
Ex.: Miller-Rabin primality test

Las Vegas algorithms:


E(Running time) is bounded
Results are always correct

6 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Randomized algorithms

Two main types of randomized algorithms:


Monte Carlo algorithms:
Running time is bounded
P(Results are correct) < 1
Ex.: Miller-Rabin primality test

Las Vegas algorithms:


E(Running time) is bounded
Results are always correct
Ex.: Randomized QuickSort
3 12 31 34 38 62 97
Random pivot selection =⇒ O(n2 ) time very unlikely

6 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Context: Randomized algorithms

Two main types of randomized algorithms:


Monte Carlo algorithms:
Running time is bounded
P(Results are correct) < 1
Ex.: Miller-Rabin primality test

Las Vegas algorithms:


E(Running time) is bounded
Results are always correct
Ex.: Randomized QuickSort
3 12 31 34 38 62 97
Random pivot selection =⇒ O(n2 ) time very unlikely
→ Monte Carlo algorithms sometimes give wrong answers
→ Las Vegas algorithms sometimes run for a very long time
6 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Our focus

In what follows, we will cover several


randomized Las Vegas algorithms

7 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Our focus

In what follows, we will cover several


randomized Las Vegas algorithms
with no extra preprocessing

7 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Our focus

In what follows, we will cover several


randomized Las Vegas algorithms
with no extra preprocessing

having E(Running time) = O( n).

7 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Our focus

In what follows, we will cover several


randomized Las Vegas algorithms
with no extra preprocessing

having E(Running time) = O( n).

3 8 12

1D: Sucessor search 2D: Polygonal 3D: Polyhedral


intersection intersection

Credit for images: Chazelle et al.

7 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Outline

1 Context

2 1D: Successor searching

3 2D: Polygonal intersection

4 3D: Polyhedral intersection

5 Applications

8 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

9 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

Example:
3 8 12 31 34 38 62 97

succ(50) = 62
succ(12) = 12

9 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

10 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

Complexity depends on how the list is stored:

10 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

Complexity depends on how the list is stored:


1 The location of elements is unknown
3 12 31 34 38 62 97
→ O(n) time, o(n) impossible

10 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

Complexity depends on how the list is stored:


1 The location of elements is unknown
3 12 31 34 38 62 97
→ O(n) time, o(n) impossible

2 List elements are stored in consecutive locations


34 97 12 3 38 31 62

→ expected O( n) time (Chazelle et al. [2005])

10 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

1D: Successor searching

Problem
Given a sorted doubly-linked list of n keys and a number x , nd the
smallest key y ≥ x (the successor of x ).

Complexity depends on how the list is stored:


1 The location of elements is unknown
3 12 31 34 38 62 97
→ O(n) time, o(n) impossible

2 List elements are stored in consecutive locations


34 97 12 3 38 31 62

→ expected O( n) time (Chazelle et al. [2005])

3 Elements are consecutive and ordered


3 12 31 34 38 62 97
→ O(log n) time (binary search)

10 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Idea of an algorithm

succ(50) =?

3 8 12 31 34 38 62 97

11 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Idea of an algorithm

succ(50) =?

3 8 12 31 34 38 62 97

Sample some elements from the list:


3 8 12 31 34 38 62 97

11 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Idea of an algorithm

succ(50) =?

3 8 12 31 34 38 62 97

Sample some elements from the list:


3 8 12 31 34 38 62 97

Find the elements in the sample that surround our target:


3 8 12 31 34 38 62 97

11 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Idea of an algorithm

succ(50) =?

3 8 12 31 34 38 62 97

Sample some elements from the list:


3 8 12 31 34 38 62 97

Find the elements in the sample that surround our target:


3 8 12 31 34 38 62 97

Traverse the sublist and nd the successor:


3 8 12 31 34 38 62 97

11 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Randomized algorithm


Algorithm: Randomized successor searching in O( n) time
Input : Doubly-linked list A = A[1] . . . A[n] of n numbers stored in
an array (table); number x
Output: The smallest√number y ∈ A s.t. y ≥ x (if exists)
1 Sample S ⊂ A, |S| = n, from A uniformly at random
2 p = argmaxi=1...√n S[i] s.t. S[i] ≤ x // predecessor in S
3 q = argmini=1... n S[i] s.t. S[i] ≥ x
√ // successor in S
4 s = argmini=p...s A[i] s.t. A[i] ≥ x // traverse A from p
5 return A[s]

12 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Randomized algorithm


Algorithm: Randomized successor searching in O( n) time
Input : Doubly-linked list A = A[1] . . . A[n] of n numbers stored in
an array (table); number x
Output: The smallest√number y ∈ A s.t. y ≥ x (if exists)
1 Sample S ⊂ A, |S| = n, from A uniformly at random
2 p = argmaxi=1...√n S[i] s.t. S[i] ≤ x // predecessor in S
3 q = argmini=1... n S[i] s.t. S[i] ≥ x
√ // successor in S
4 s = argmini=p...s A[i] s.t. A[i] ≥ x // traverse A from p
5 return A[s]

Note: p and q may not exist


Elements should be:
consecutive for ecient sampling in step 1
doubly-connected for list traversal in step 4

12 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Theorem

Successor searching can be done in O( n) expected time per
query, which is optimal.

13 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Theorem

Successor searching can be done in O( n) expected time per
query, which is optimal.

Proof
Some intuition:

Our sample S is a subset of n elements from A, |A| = n

We locate p and q in our sample in O(|S|) = O( n) time
The expected distance between these two elements is
√ √
|A|/|S| = n/ n = n

So traversing A[p] . . . A[q] takes O( n) expected time

13 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Let A[s] be the desired successor

14 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Let A[s] be the desired successor
Let S[k] be the nearest element to A among those in S

14 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Let A[s] be the desired successor
Let S[k] be the nearest element to A among those in S
Event Qd : we don't hit any of A[s − d] . . . A[s + d] after

taking n random samples

14 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Let A[s] be the desired successor
Let S[k] be the nearest element to A among those in S
Event Qd : we don't hit any of A[s − d] . . . A[s + d] after

taking n random samples
P(dist(A[s], S[k]) = d) = P(Qd−1 ) − P(Qd )

14 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Let A[s] be the desired successor
Let S[k] be the nearest element to A among those in S
Event Qd : we don't hit any of A[s − d] . . . A[s + d] after

taking n random samples
P(dist(A[s], S[k]) = d) = P(Qd−1 ) − P(Qd )
X X
E(dist(A[s], S[k]) = i · (P(Qi−1 ) − P(Qi )) = P(Qi )
i≥1 i≥0
√ X √ X √ √
≤ n P(Qc √n ) ≤ n (1 − c/ n) n
c≥0 c≥0
√ X −c √
≤ n e = O( n)
c≥0

14 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Yao's minimax principle:

E(Running time of the optimal Las Vegas


randomized algorithm)

E(Running time of an optimal
deterministic algorithm
for any xed input distribution)

Study the distribution of dicult inputs


Show that no deterministic algorithm can perform well on it

15 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Our model:
Input: a permutation σ of 1 . . . n, s.t. A[σ(i)] = i
Goal: nd succ(n)

16 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Our model:
Input: a permutation σ of 1 . . . n, s.t. A[σ(i)] = i
Goal: nd succ(n)

The optimal deterministic algorithm is a sequence of two types


of operations:
Operation A:
Pick a visited location σ(i)
Visit one of its neighbours: T [σ(i − 1)] or T [σ(i + 1)]
Operation B: Visit some unvisited T [σ(i)]

16 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?

17 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?
B B A T T T

17 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?
B B A T T T

A very crude estimate: √


n+a+b a+b
P(tail item not picked after (a+b) ops.) ≥ (1 − n )

17 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?
B B A T T T

A very crude estimate: √


P(tail item not picked after (a+b) ops.) ≥ (1 − n+a+b
n )a+b
Assume the total number of operations before visiting one of the
√ √
last n elements in the tail of the list does not exceed n

17 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?
B B A T T T

A very crude estimate: √


P(tail item not picked after (a+b) ops.) ≥ (1 − n+a+b
n )a+b
Assume the total number of operations before visiting one of the
√ √
last n elements in the tail of the list does not exceed n
However, weP still
√ have: √ √
n √
E(a + b) ≥ a+b=1 (a + b + 1) nn (1 − n+a+b n )a+b = Ω( n)

17 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?
B B A T T T

A very crude estimate: √


P(tail item not picked after (a+b) ops.) ≥ (1 − n+a+bn )a+b
Assume the total number of operations before visiting one of the
√ √
last n elements in the tail of the list does not exceed n
However, weP still
√ have: √ √
n √
E(a + b) ≥ a+b=1 (a + b + 1) nn (1 − n+a+b n )a+b = Ω( n)
Once in the tail, the deterministic algorithm can get to the last

element in O( n) operations A

17 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Successor searching: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Question:

On a random input, how likely is it to discover one of
the last n items after a operations A and b operations B?
B B A T T T

A very crude estimate: √


P(tail item not picked after (a+b) ops.) ≥ (1 − n+a+bn )a+b
Assume the total number of operations before visiting one of the
√ √
last n elements in the tail of the list does not exceed n
However, weP still
√ have: √ √
n √
E(a + b) ≥ a+b=1 (a + b + 1) nn (1 − n+a+b n )a+b = Ω( n)
Once in the tail, the deterministic algorithm can get to the last

element in O( n) operations A
So the average running time of our optimal deterministic

algorithm is Ω( n)
17 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Outline

1 Context

2 1D: Successor searching

3 2D: Polygonal intersection

4 3D: Polyhedral intersection

5 Applications

18 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.

19 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.

Example:

Intersection: YES
19 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.

20 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.
Again, complexity depends on how polygons are stored:

20 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.
Again, complexity depends on how polygons are stored:
1 General case
→ O(n) time (e.g. via Linear Programming, Seidel [1990])

20 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.
Again, complexity depends on how polygons are stored:
1 General case
→ O(n) time (e.g. via Linear Programming, Seidel [1990])

2 Vertices are stored in a clockwise order in a


doubly-linked list

(allowing for random sampling)
→ expected O( n) time (Chazelle et al. [2005])

20 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

2D: Convex polygonal intersection

Problem
Given two convex polygons P and Q , with n vertices each,
determine whether they intersect or not and, if they do, report one
point in the intersection.
Again, complexity depends on how polygons are stored:
1 General case
→ O(n) time (e.g. via Linear Programming, Seidel [1990])

2 Vertices are stored in a clockwise order in a


doubly-linked list

(allowing for random sampling)
→ expected O( n) time (Chazelle et al. [2005])

3 Vertices are stored in an array in cyclic order


→ O(log n) time (Chazelle and Dobkin [1987])
20 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Detour: Classical geometric data structures

Idea: allow for quick traversal between faces, edges, and vertices
due to the explicitly linked structure of the objects.

21 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Detour: Classical geometric data structures

Idea: allow for quick traversal between faces, edges, and vertices
due to the explicitly linked structure of the objects.

Doubly connected edge list (DCEL)


Doubly-linked list of half-edges
Each half-edge bounds a single face
Standard data structure in CGAL
(www.cgal.org)

21 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Detour: Classical geometric data structures

Idea: allow for quick traversal between faces, edges, and vertices
due to the explicitly linked structure of the objects.

Doubly connected edge list (DCEL)


Doubly-linked list of half-edges
Each half-edge bounds a single face
Standard data structure in CGAL
(www.cgal.org)

Winged edge
Also edge-based
For each edge, stores its vertices, left
and right faces etc.

21 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Idea of an algorithm

Start with the


input polygons

22 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Idea of an algorithm

Start with the Simplify polygons


input polygons by sampling. Check
if they intersect

22 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Idea of an algorithm

Start with the Simplify polygons If not, test the


input polygons by sampling. Check potentially
if they intersect overlapping region

22 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm



Algorithm: Convex polygonal intersection in O( n) time
Input : Two convex polygons P and Q , |P | = |Q
vertices vertices |=n
Output: Report one point in P ∩ Q (if they intersect)√
1 Sample SP ⊂ Pvertices , SQ ⊂ Qvertices , |SP | = |SQ | = n from P and Q randomly
2 Let RP = conv (SP ) ⊂ P , RQ = conv (SQ ) ⊂ Q // convex hulls (conceptual)
// Linear Programming finds RP ∩ RQ without computing convex hulls
3 if RP ∩ RQ 6= ∅ then
4 return Intersection point of RP and RQ
5 end
6 else
7 L = bi-tangent separating line for RP and RQ
8 CP = part of P to the RQ side of L
9 CQ = part of Q to the RP side of L
10 Check RP and CQ for intersection. If they don't intersect, nd a line L0 that
separates RP and CQ , and compute CP0 , the part of P on the other side of L0 .
Test CP0 and CQ for intersection.
11 If no intersection is found, repeat step 10 for P and Q swapped.
12 end

23 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

Input: Polygons P and Q

24 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

Simplied versions of P and Q :



convex hulls RP and RQ of size O( n)
25 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

RP ∩ RQ = ∅ =⇒ compute bi-tangent separating line L

26 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

Compute CQ , the part of Q to the other side of L.


Case 1: RP ∩ CQ 6= ∅ =⇒ we are done
27 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

Case 2: RP ∩ CQ = ∅

28 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

=⇒ compute L0 , the separating line for RP and CQ

29 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

Compute CP0 , the part of P to the other side of L0 .


Test CP0 and CQ for intersection
30 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Example

Case 1: CP0 ∩ CQ 6= ∅ =⇒ we are done


Case 2: CP0 ∩ CQ = ∅ =⇒ re-run with P and Q exchanged
31 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Q. Why don't we design a recursive algorithm instead?

32 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Q. Why don't we design a recursive algorithm instead?


A. Because our model restricts us to global sampling only.

32 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Randomized algorithm

Q. Why don't we design a recursive algorithm instead?


A. Because our model restricts us to global sampling only.

We can only sample eciently in the main problem, but not in


subproblems
So we have to treat our intersection subproblems in a
classical (linear) way

32 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Theorem
To √
check whether two convex n-gons intersect can be done in
O( n) expected time, which is optimal.

33 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Theorem
To √
check whether two convex n-gons intersect can be done in
O( n) expected time, which is optimal.

Proof
Some intuition:
For intersection tests at each step we use Linear Programming,
which works in O(r ) time for inputs of size r
√ √
After sampling n vertices from each n-gon, we have r = n
If the intersection test for our simplied polygons RP and RQ
fails, then the subsequent tests involving CP , CQ etc. will still
process a sublinear number of vertices

33 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Assume we sample r vertices in the rst step

34 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Assume we sample r vertices in the rst step
Running time is O(r + |CP | + |CP0 | + |CQ | + |CQ0 |) (follows
directly from the algorithm description, assuming we use LP
for intersection tests to execute them in linear time)

34 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Assume we sample r vertices in the rst step
Running time is O(r + |CP | + |CP0 | + |CQ | + |CQ0 |) (follows
directly from the algorithm description, assuming we use LP
for intersection tests to execute them in linear time)
Key observation: one can show that E|CP | = O(n/r ); the
same is true for E|CP0 |, E|CQ | and E|CQ0 | (see the paper)

34 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Assume we sample r vertices in the rst step
Running time is O(r + |CP | + |CP0 | + |CQ | + |CQ0 |) (follows
directly from the algorithm description, assuming we use LP
for intersection tests to execute them in linear time)
Key observation: one can show that E|CP | = O(n/r ); the
same is true for E|CP0 |, E|CQ | and E|CQ0 | (see the paper)
E(Running time) becomes O(r + n/r )

34 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part I: Expected time is O( n).
Assume we sample r vertices in the rst step
Running time is O(r + |CP | + |CP0 | + |CQ | + |CQ0 |) (follows
directly from the algorithm description, assuming we use LP
for intersection tests to execute them in linear time)
Key observation: one can show that E|CP | = O(n/r ); the
same is true for E|CP0 |, E|CQ | and E|CQ0 | (see the paper)
E(Running time) becomes O(r + n/r )
√ √
Setting r = n makes it O( n)

34 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Yao's minimax principle =⇒ nd a dicult distribution:

Polygons P and Q lie to the opposite sides of the x-axis


P 's highest vertex is p = (0, 0); Q 's lowest vertex is q = (0, δ)
P ∩ Q 6= ∅ ⇐⇒ δ = 0
35 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polygonal intersection: Analysis

Proof (Cont.)

Part II: O( n) is optimal.
Any algorithm that detects intersection must have access to q
to check that it lies in the origin
The only operations allowed are:
random sampling of edges
edge-traversing via links
The same argument as for the successor search problem

yields the Ω( n) bound

36 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Outline

1 Context

2 1D: Successor searching

3 2D: Polygonal intersection

4 3D: Polyhedral intersection

5 Applications

37 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.

38 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.

Example:

Intersection: NO
38 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.

39 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.
Problem complexity depends on the underlying data structures:

39 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.
Problem complexity depends on the underlying data structures:
1 General case
→ O(n) time (via Linear Programming)

39 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.
Problem complexity depends on the underlying data structures:
1 General case
→ O(n) time (via Linear Programming)

2 Linked lists for√edges/vertices/faces, no preprocessing


→ expected O( n) time (Chazelle et al. [2005])

39 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

3D: Convex polyhedral intersection

Problem
Given two n-vertex convex polyhedra P and Q in R3 , determine
whether they intersect or not and, if they do, report one point in
the intersection.
Problem complexity depends on the underlying data structures:
1 General case
→ O(n) time (via Linear Programming)

2 Linked lists for√edges/vertices/faces, no preprocessing


→ expected O( n) time (Chazelle et al. [2005])

3 P and Q have been preprocessed in O(n)


→ O(log n) time per query (Dobkin and Kirkpatrick [1990])

39 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Idea of an algorithm

We can design an algorithm of the same structure as in 2D!

40 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Idea of an algorithm

We can design an algorithm of the same structure as in 2D!

However, as we are now in 3D:


We will compute a separating plane L instead of a separating
line in the case there is no intersection
Pieces cut o by L will be convex polyhedra, not polygons

40 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Idea of an algorithm

We can design an algorithm of the same structure as in 2D!

However, as we are now in 3D:


We will compute a separating plane L instead of a separating
line in the case there is no intersection
Pieces cut o by L will be convex polyhedra, not polygons

Implementation requires solving some additional technical issues...


(see the paper)

40 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Randomized algorithm

Example

Simplify polyhedra P and Q



using O( n) randomly sampled vertices

41 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Randomized algorithm

Example

Test intersection of samples (RP and RQ ) via LP.


If they don't intersect, compute a separating plane L
42 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Randomized algorithm

Example

Compute the part of P lying to the other side of L.


Test for intersection with RQ
43 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Randomized algorithm

Example

If again no intersection is found, update the separating plane to L0

44 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Convex polyhedral intersection: Randomized algorithm

Example

Compute the part of Q lying to the other side of L0 .


If still no intersection, swap P and Q and repeat.
45 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Outline

1 Context

2 1D: Successor searching

3 2D: Polygonal intersection

4 3D: Polyhedral intersection

5 Applications

46 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Ray shooting (casting)

Ray shooting (ray casting): the problem of ray-surface intersection


detection with. Some computer graphics applications:
Determining the rst object intersected by a ray
Hidden surface removal
Ray tracing rendering

47 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Ray shooting (casting)

Ray shooting (ray casting): the problem of ray-surface intersection


detection with. Some computer graphics applications:
Determining the rst object intersected by a ray
Hidden surface removal
Ray tracing rendering

Can reuse the same algorithm!


Rays are very skinny polyhedra
We need only one intersection point

→ Can compute ray-surface intersections in expected O( n) time

47 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Point location in Delaunay triangulations


Relationship between Delaunay triangulations and convex hulls:

Project onto paraboloid Project lower hull faces


(x, y , x 2 + y 2 ) Compute convex hull
back to the plane

48 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Point location in Delaunay triangulations


Relationship between Delaunay triangulations and convex hulls:

Project onto paraboloid Project lower hull faces


(x, y , x 2 + y 2 ) Compute convex hull
back to the plane

Point location in a Delaunay triangulation is equivalent to:


Lifting the points to the paraboloid
Shooting a ray towards their lower convex hull

→ can again be done in expected O( n) time

48 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

Point location in Delaunay triangulations


Relationship between Delaunay triangulations and convex hulls:

Project onto paraboloid Project lower hull faces


(x, y , x 2 + y 2 ) Compute convex hull
back to the plane

Point location in a Delaunay triangulation is equivalent to:


Lifting the points to the paraboloid
Shooting a ray towards their lower convex hull

→ can again be done in expected O( n) time

Similar construction works for Voronoi diagrams


48 / 50 Mikhail Dubov Sublinear Geometric Algorithms
Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

References I

B. Chazelle and D. P. Dobkin. Intersection of convex objects in two


and three dimensions. J. ACM, 34(1):127, January 1987. ISSN
0004-5411. doi: 10.1145/7531.24036. URL
http://doi.acm.org/10.1145/7531.24036.
Bernard Chazelle, Ding Liu, and Avner Magen. Sublinear geometric
algorithms. In Artur Czumaj, S. Muthu Muthukrishnan, Ronitt
Rubinfeld, and Christian Sohler, editors, Sublinear Algorithms,
volume 05291 of Dagstuhl Seminar Proceedings. Internationales
Begegnungs- und Forschungszentrum f ur Informatik (IBFI),
Schloss Dagstuhl, Germany, 2005. URL
http://dblp.uni-trier.de/db/conf/dagstuhl/P5291.
html#ChazelleLM05.

49 / 50 Mikhail Dubov Sublinear Geometric Algorithms


Context 1D: Successor searching 2D: Polygonal intersection 3D: Polyhedral intersection Applications References

References II

David P. Dobkin and David G. Kirkpatrick. Determining the


separation of preprocessed polyhedra: A unied approach. In
Proceedings of the Seventeenth International Colloquium on
Automata, Languages and Programming, pages 400413, New
York, NY, USA, 1990. Springer-Verlag New York, Inc. ISBN
0-387-52826-1. URL
http://dl.acm.org/citation.cfm?id=90397.91344.
Raimund Seidel. Linear programming and convex hulls made easy.
In Proceedings of the Sixth Annual Symposium on Computational
Geometry, SCG '90, pages 211215, New York, NY, USA, 1990.
ACM. ISBN 0-89791-362-0. doi: 10.1145/98524.98570. URL
http://doi.acm.org/10.1145/98524.98570.

50 / 50 Mikhail Dubov Sublinear Geometric Algorithms

You might also like