Polling: A Randomized Sampling Technique

Polling: A Randomized Sampling Technique for Computational Geometry

presented by Silvia Götz

March 26, 1997

J. H. Reif, S. Sen, ”Polling: A New Randomized Sampling Technique For Computational Geometry”, SIAM Journal on Computing, June 1992 S. Rajasekaran, S. Sen, ”Random Sampling Techniques and Parallel Algorithm Design”, Synthesis of Parallel Algorithms, ed. J.H. Reif, 1993

Polling: A Randomized Sampling Technique

Table of Contents

1. Little Introduction to Parallel Computing 2. Sampling Technique Polling

(applied to 2d intersection of half-spaces)

3. 3d Intersection of Half-Spaces

Polling: A Randomized Sampling Technique

Randomized Recursive Parallel Algorithms

Polling: A Randomized Sampling Technique

Running Time of a Recursive Parallel Algorithm

In general: Running time of parallel algorithm =

time between first processor starts and last processor ends

Time for one level: maximum time needed by a processor on this level

Problem: Bound the maximal (expected) time of the subproblems

Let ϵ_{0} be such that O(n^{1−ϵ} log n) = O(n^{ϵ_{0}}). Then: max. problem size at level i is bounded by O(n^{ϵ_{0}^{i}})

Theorem: If a procedure at depth i in the recursion takes time T_{i} such that

P rob[T_{i} ≥ kcα(ϵ_{0})^{i} log n] ≤ n^{−cα(1−ϵ)^{i}}

0 < ϵ < 1, then all the leaf-level procedures are finished in Õ(log n) time.

Polling: A Randomized Sampling Technique

2d Intersection of n Half-Planes

dual: 2d convex hull of n points

Polling: A Randomized Sampling Technique

2d Intersection of n Half-Planes (cont‘d)

wlog: Assume that the origin O lies in interior of intersection S: set of n half-planes

Algorithm IntersectHalfplane(S)

1. Choose random subset Sample of r = ⌊n^{ϵ}⌋ half-planes, 0 < ϵ < 1

2. Costruct intersection of half-planes of Sample

3. Number vertices of the intersection in a cyclic order: h_{0}, h_{1}, …

4. Consider triangles O, h_{i}, h_{i+1} (sectors): determine half-planes Int_{i} intersecting sector C_{i}

5. IntersectHalfplane(Int_{i})

6. Output: Union of intersections over all sectors

Polling: A Randomized Sampling Technique

Bounding the Problem Sizes

1. bound maximum number of half-planes intersecting any sector AND

2. bound sum of the subproblem sizes

LEMMA 1: The probability that the maximum number of half-planes intersecting any sector exceeds O(c · \frac{n}{r} log r) is less than n^{−c}.

LEMMA 2: The expected value of the sum taken over all the sectors of all the half-planes intersecting a sector is O(n).

LEMMA 3: For some constants k_{total}, k_{max}, and large n, the following conditions hold with probability at least \frac{1}{2}:

1. The maximum number of half-planes intersecting any sector is less than k_{max} · \frac{n}{r} log r ∈ O(n^{1−ϵ} log n)

2. The sum of half-planes taken over all the sectors of the number of half-planes intersecting a sector is less than k_{total}n ∈ O(n).

⟶ called ”good example”

Polling: A Randomized Sampling Technique

Polling: The Motivation

goal: find good example w.h.p., i.e., bound sum of subproblems to O(n) w.h.p. Repeat sampling independently m log n times \underrightarrow{Lemma 3} all samples are bad with probability less than (\frac{1}{2})^{m log n} = \frac{1}{nm} = n^{−m} Therefore: choose O(log n) independent sample sets, then one is ”good” with high probability Problem: determine if a sample is good requires O(log n) time ⇒ total O(log^{2} n) time for testing all samples Solution: determine goodness of sample by an estimation of intersections for each sector, estimation is done by taking only a fraction of the input half-planes

Polling: A Randomized Sampling Technique

Polling: What is it ?

Idea: Determine goodness of sample by taking only a fraction of the input half-planes more precisely: chose randomly c_{0} · \frac{n}{logd n}, d > 2, c_{0} a constant, of the input half-planes for each sample.

Sample_{j}: jth sample Int_{i}^{j}: number of half-planes of input intersecting sector C_{i} of sample Sample_{j} IntPoll_{i}^{j}: number of half-planes of polled input intersecting sector C_{i} of Sample_{j}

⇒ IntPoll_{i}^{j} is a binomial random variable with parameters

• ^{\frac{Int{j \atop i}}{n}} (success prob.)

• c_{0} · \frac{n}{logd n} (number of trials)

Polling: A Randomized Sampling Technique

Polling: How to choose a good sample ?

Case 1: Int_{i}^{j} ≤ c · log^{d+1} n ⟹ n^{ϵ} · c log^{d+1} n = o(n) ⟹ sum of the subproblems ≤ size of parent problem Case 2: Int_{i}^{j} > c · log^{d+1} n Chernoff bounds ⟹ Prob(IntPoll_{i}^{j} ≤ αc_{1} \frac{Int{j \atop i}}{logd n}) ≤ n^{−α} and

Prob(IntPoll_{i}^{j} ≥ c_{2}αc_{0} · \frac{Int{j \atop i}}{logd n}) < n^{−c0α} < n^{−α} (for c_{0} > 1)

⟹ With high probability for all i Int_{i}^{j} are bounded from below by LowInt^{j} := IntPoll_{i}^{j} · \frac{logdn}{c0c2α} ∈ Ω(log^{d} n · IntPoll_{i}^{j}) and from above by UpInt^{j} := IntPoll_{i}^{j} · \frac{logdn}{c1α} ∈ O(log^{d} n · IntPoll_{i}^{j})

⟹ Ω(log^{d} n · IntPoll_{i}^{j}) ≤ Int_{i}^{j} ≤ O(log^{d} n · IntPoll_{i}^{j})

Silvia Götz 10 Polling: A Randomized Sampling Technique

Choosing a Good Sample: The Algorithm

Input: Samples Sample_{1}, ..., Sample_{m}, m = O(log n) Output: A ”good” sample Sample_{j0}

/* case: clearly good */ IF k_{total} · n > UpInt^{j}n^{ϵ} THEN

accept sample Sample^{j};

/* case: clearly bad */ IF k_{total} · n < LowInt^{j}n^{ϵ} THEN

sample is bad

/* case: choose the best */ IF LowInt^{j}n ≤ k_{total} · n^{ϵ} ≤ UpInt^{j}n^{ϵ} THEN

accept sample Sample_{j0} for which ∑_{i} IntPoll_{i}^{j} is minimum

Recall: at least one of the samples satisfies case 1 or 3 w.h.p.

Polling: A Randomized Sampling Technique

Polling Lemma:

expected ”good” samples \underrightarrow{polling alg.} w.h.p. ”good” sample

Bounding the Number of Processors

Good example:

sum of sizes of subproblems = c· size of parent problem

But: with O(log log n) recursive levels ⇒ nc^{log log n} = n · log^{log c} n ∈ O(n · log^{b} n), b constant

Opportunities:

• more processors

• longer running time

• bound sum of subproblems more tightly, so that it equals c · n, c is the same for each level

Polling: A Randomized Sampling Technique

Bound the sum of the subproblems more tightly: Filtering

Filtering Procedure:

• after finding a good sample

• Input: subproblems with sum of the sizes = c · size of parent problem

• Output: subproblems, where at each level sum of size of subproblems = a fixed size (e.g. O(input + output)) c · n

• use geometric properties of the specific problem

Intersection of half-planes: output size ≤ input size ⇒ eliminate half-planes from a sector that are not part of the output

Polling: A Randomized Sampling Technique

Filtering for Intersection of Half-Planes in 2d

Case 3: Half-plane is visible in at most 1 sector ⇒ eliminated from all other sectors by case 1

Case 4: Half-plane is visible in more than 1 sector ⇒ in all but two of these sectors it eliminates all other

half-planes ⇒ for intermediate sectors no recursive call is needed ⇒ in only two sectors it can contribute to the vertices of the

intersection

Global view: at any stage at most 2 copies of a half-plane

Polling: A Randomized Sampling Technique

Processor Allocation

Case 1 and 2: no processors Case 3 and unsolved cases (fall into one sector): allocate 2 processors Case 4: allocate 1 processor at each bounding sector Global view: at any stage at most 2 copies of a half-plane

Polling: A Randomized Sampling Technique

General Strategy

1. Select O(log n) samples, each of size ⌊n^{ϵ}⌋ for some 0 < ϵ < 1.

2. Select a good sample using Polling.

3. Divide the problem into subproblems using the good sample.

4. Use a Filtering scheme to bound the sum of the subproblems more tightly (e.g. output size+input size). Purpose: bound the number of processors

5. IF subproblem is small enough (usually O(log^{k} n)) THEN

use a direct method to solve subproblem ELSE call algorithm recursively

Polling: A Randomized Sampling Technique

Time Complexity: Intersection of Half-Planes in 2d with Polling and Filtering

With high probability:

1. O(log n) coin flips on each processor: O(log n)

2. intersection of each sample (brute-force): O(log n)

intersection of ”polled” input (\frac{1}{logd n}th) with sectors built by each sample: O(log n) (Fibonacci search on bimodal sequence)

3. intersection of (whole) input with sectors built by ”good” sample: O(log n) (Fibonacci search on bimodal sequence)

4. and 5. (base case): Õ(log n)

an iteration with problem size n: Õ(log n)

\underrightarrow{Theorem} Õ(log n) with 2n processors on a CREW PRAM

Polling: A Randomized Sampling Technique

Another Application for Polling: Intersections of Half-Spaces in 3d

dual: 3d convex hull also solvable:

• Voronoi diagram

• all-points nearest neigbor

• Euclidean minimal spanning tree

Results: The above problems can be solved in Õ(log n) time on a O(n) processor CREW PRAM.

Polling: A Randomized Sampling Technique

Partitioning by the Sample: the Cones

Polling: A Randomized Sampling Technique

Conclusions and Open Problems

New Random Sampling Technique: Polling ⇒ determine a ”good” sample out of O(log n) samples by testing only a fraction of the

input ⇒ bound sum of subproblems more tightly by Filtering (problem dependent)

2d and 3d convex hull, intersection of half-spaces, 2d Veronoi diagram could be solved in Õ(log n) time on a CREW PRAM with O(n) processors.

Open Problems:

• applicabality of method to other problems

• algorithms for EREW PRAM