randomized techniques in geometry

66
Randomized Techniques in Geometry Yogish Sabharwal IBM India Research Lab Workshop on Introduction to Geometric Algorithms, IIT Kharagpur, 2008

Upload: others

Post on 28-Apr-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Randomized Techniques in Geometry

Randomized Techniques in

Geometry

Yogish Sabharwal

IBM India Research Lab

Workshop on Introduction to Geometric Algorithms, IIT Kharagpur, 2008

Page 2: Randomized Techniques in Geometry

Contents

� Introduction

� Randomized Incremental Construction� Quick-sort

� Linear programming

� Random Sampling� Skip lists

� Trapezoidal decompositions

� Clustering Framework

Page 3: Randomized Techniques in Geometry

Primary Sources (for this talk)

� Randomized Techniques in Computational Geometry, A Survey Talk

Sandeep Senhttp://www.cse.iitd.ernet.in/~ssen/cs852/Rand.pdf

� Computational Geometry: An Introduction through Randomized Algorithms

K. Mulmuley

Page 4: Randomized Techniques in Geometry

Kinds of Problems

� Range Searching

� Ray Shooting/ Point location

� Planar Partitioning

� Convex hulls

� Linear programming

� Nearest Neighbor

� Triangulation

� Hidden Surface

� Levels of arrangement

� Diameter/Width

� Euclidean minimum spanning tree

Page 5: Randomized Techniques in Geometry

Randomization in Computational Geometry

� Improved complexities

� Range searching

� Simpler Algorithms

� Convex hulls, triangulation, LP

� Dynamic Algorithms

� With minimal modifications

Page 6: Randomized Techniques in Geometry

Trapezoidal decomposition

Page 7: Randomized Techniques in Geometry

Arrangement Searching

12

3

5

4

6 7

8 910

11

12

13

14

15

1617 18 19

20

21

Page 8: Randomized Techniques in Geometry

Voronoi DecompositionsNearest Neighbor Searching

Page 9: Randomized Techniques in Geometry

Randomized Algorithms

� RNG in constant time

� Assumes no input distribution

� Halts with correct output

� Running time is bounded by some probability distribution

� Expectation[T]

� Tail Estimates: Prob[ Tn > f(n) ≤ � ]

Running Time (T)

Probability

distribution

Page 10: Randomized Techniques in Geometry

Randomized Incremental Construction (R.I.C.)

Page 11: Randomized Techniques in Geometry

� Algorithm

1. Start with an empty set

2. Insert next object (one at a time)

3. Update the partial construction (data structures)

� Total time = �i (Time to insert the ith object)

� Ts(N) = Total time to insert a sequence s

� s is good if total time is less

� Expected total time

� Expected time for a Random Insertion Sequence

Randomized Incremental Construction

Page 12: Randomized Techniques in Geometry

Quick-sort as R.I.C.(Conflict graph)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x2 x3 x4 x5 x6 x7 x8

-inf +inf

Conflict list (unordered)

Page 13: Randomized Techniques in Geometry

Quick-sort as R.I.C.(Conflict graph)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x2 x3 x5 x6 x7 x8

-inf +inf

Conflict lists (unordered)

x4 x4

Page 14: Randomized Techniques in Geometry

Quick-sort as R.I.C.(Conflict graph)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x2 x3 x5 x7 x8

-inf +inf

Conflict lists (unordered)

x4 x4 x6 x6

Page 15: Randomized Techniques in Geometry

Quick-sort as R.I.C.(Conflict graph)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x3 x5 x7 x8

-inf +inf

Conflict lists (unordered)

x4 x4 x6 x6x2x2

Page 16: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Notation

� Ni = Set of selected objects at stage i

� H(Ni) = complex (partitions/intervals/faces) induced by Ni

� l(�) = Conflict list for a configuration � ���� H(Ni)

Page 17: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Notation

� Ni = Set of selected objects at stage i

� H(Ni) = complex (partitions/intervals/faces) induced by Ni

� l(�) = Conflict list for a configuration � ���� H(Ni)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x3 x5 x7 x8

-inf +infx4 x4 x6 x6x2x2

Page 18: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Notation

� Ni = Set of selected objects at stage i

� H(Ni) = complex (partitions/intervals/faces) induced by Ni

� l(�) = Conflict list for a configuration � ���� H(Ni)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x3 x5 x7 x8

-inf +infx4 x4 x6 x6x2x2

Ni

Page 19: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Notation

� Ni = Set of selected objects at stage i

� H(Ni) = complex (partitions/intervals/faces) induced by Ni

� l(�) = Conflict list for a configuration � ���� H(Ni)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x3 x5 x7 x8

-inf +infx4 x4 x6 x6x2x2

NiH(Ni)

Page 20: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Notation

� Ni = Set of selected objects at stage i

� H(Ni) = complex (partitions/intervals/faces) induced by Ni

� l(�) = Conflict list for a configuration � ���� H(Ni)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x3 x5 x7 x8

-inf +infx4 x4 x6 x6x2x2

NiH(Ni)

l(����1) l(����2) l(����3) l(����4)

Page 21: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Cost of R.I.C.

� ci = expected cost of adding ith object

� Total expected cost = �i ci

� Consider a fixed Ni+1

� Every object is equally likely to be the (i+1)th insertion

∑+∈

+++

=1

]1))(())(([1

121

iNS

i SIlSIli

c

Page 22: Randomized Techniques in Geometry

Quick-sort as R.I.C.(Conflict graph)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x2 x3 x5 x6 x7 x8

-inf +inf

Conflict lists (unordered)

x4 x4

Page 23: Randomized Techniques in Geometry

Quick-sort as R.I.C.(Conflict graph)

x1 x2 x3 x4 x5 x6 x7 x8

x1 x2 x3 x5 x7 x8

-inf +inf

Conflict lists (unordered)

x4 x4 x6 x6

Page 24: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Cost of R.I.C.

� ci = expected cost of adding ith object

� Total expected cost = �i ci

� Consider a fixed Ni+1

� Every object is equally likely to be the (i+1)th insertion

∑+∈

+++

=1

]1))(())(([1

121

iNS

i SIlSIli

c

Page 25: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Cost of R.I.C.

� ci = expected cost of adding ith object

� Total expected cost = �i ci

� Consider a fixed Ni+1

� Every object is equally likely to be the (i+1)th insertion

∑+∈

+++

=1

]1))(())(([1

121

iNS

i SIlSIli

c

+=+

+≤ ∑

+∈ 1]1)([

1

2

)( 1i

nOJl

iiNHJ

Page 26: Randomized Techniques in Geometry

Quick-sort as R.I.C. (Analysis)

� Cost of R.I.C.� ci = expected cost of adding ith object

� Total expected cost = �i ci

� Consider a fixed Ni+1

� Every object is equally likely to be the (i+1)th insertion

�i ci = O ( n log n )

∑+∈

+++

=1

]1))(())(([1

121

iNS

i SIlSIli

c

+=+

+≤ ∑

+∈ 1]1)([

1

2

)( 1i

nOJl

iiNHJ

Page 27: Randomized Techniques in Geometry

Backward Analysis

� For a fixed set of i+1 objects, what is the probability that the (i+1)st insertion affects � ?

� Because of random insertion sequence, any one of the fixed (i+1)objects is equally likely to be the last inserted object (by symmetry)

What is the probability that a random deletion from (i+1) objects defines � ? (pretending to run backwards)

� Since conditional expected cost depends only on i(independent of the actual set of objects)

Conditional Expected cost = (Unconditional) Expected cost

1

)(

+i

d σ

Page 28: Randomized Techniques in Geometry

R.I.C. – Some results

� Trapezoidal Decompositions

� E[T] = O( n + k log n )

� Voronoi Diagrams

� E[T] = O( n log n )

Page 29: Randomized Techniques in Geometry

Linear Programming (Fixed dimensions)

Max Xd

Constraints

� Non-degenerate : Exactly d constraints define the optimum

Page 30: Randomized Techniques in Geometry

Linear Programming

Page 31: Randomized Techniques in Geometry

Linear Programming

Page 32: Randomized Techniques in Geometry

Linear Programming

Page 33: Randomized Techniques in Geometry

Linear ProgrammingExpected Running Time Analysis

� Td(n) = Expected running time in d dimensions for n constraints

� From backward analysis, probability that ith insertion changes

optimum is d/i (d constraints define optimum)

� By induction [Seidel]

Td(n) = O( d! n )

)()1()1()( 1 dOi

diTiTiT ddd +⋅−+−= −

Page 34: Randomized Techniques in Geometry

Random Sampling

Page 35: Randomized Techniques in Geometry

Skip Lists

H(M1)=H(M)

� Start with complete set of points = M

Page 36: Randomized Techniques in Geometry

Skip Lists

H(M1)=H(M)

H(M2)

� Start with complete set of points = M

� Promote each point with prob. ½ to the next level

Page 37: Randomized Techniques in Geometry

Skip Lists

H(M1)=H(M)

H(M2)

Descent pointers

� Start with complete set of points = M

� Promote each point with prob. ½ to the next level

� Create descent pointers

Page 38: Randomized Techniques in Geometry

Skip Lists

H(M1)=H(M)

H(M2)

� Start with complete set of points = M

� Promote each point with prob. ½ to the next level

� Create descent pointers

����3 ����4 ����5

l(����3) l(����4) l(����5)

Page 39: Randomized Techniques in Geometry

Skip Lists

H(M1)=H(M)

H(M2)

H(M3)

H(M4)

� Start with complete set of points = M

� Promote each point with prob. ½ to the next level

� Create descent pointers

� Repeat

Page 40: Randomized Techniques in Geometry

Skip Lists

H(M1)=H(M)

H(M2)

H(M3)

H(M4)

� Search - recursively

� Follow descent pointers

� Traverse conflict list to locate interval containing query

Page 41: Randomized Techniques in Geometry

Skip Lists

� Analysis

� # Levels = O(log m) w.h.p.

� P[level > k] < 1/2k for any element

� P[level > k] < m/2k for every element

� Space = O(m)

� Exp[levels] = �i (i/2i) = O(1)for each element

� Construction Time = O(m log m)

Page 42: Randomized Techniques in Geometry

Skip Lists

� Analysis

� Search Cost = O(log m)

� O( �i 1+l(ßi) ) summing over all intervals in search path

� Exp[l(ßi)] = 2 x �t t/2t = O(1)

H(Mi)

H(Mi+1)

1/21/4 1/21/8 1/4S

Page 43: Randomized Techniques in Geometry

� Algorithm for constructing the complex

1. Start with set M

2. Obtain a sequence of sets M = M1 ` M2 `… ` Mr = �Mi+1 is obtained from Mi by selecting each object with probability ½

3. Build the complex for each set Mi

4. Build a descent structure to descend from Mi+1 to Mi

� Algorithm for searching the complex

1. Search query point recursively from Mr down to M1

2. In stage r-i locate point in Mi from Mi+1 using descent structure

3. In stage r-1, the point is located in M

Bottom-up Sampling

Page 44: Randomized Techniques in Geometry

Trapezoidal decomposition

Page 45: Randomized Techniques in Geometry

Trapezoidal decomposition

Page 46: Randomized Techniques in Geometry

Trapezoidal decompositionRandom Sampling

H(Mi+1) H(Mi)

Page 47: Randomized Techniques in Geometry

Trapezoidal decompositionPoint Location

H(Mi+1) H(Mi)

Page 48: Randomized Techniques in Geometry

Trapezoidal decompositionDescent Structure

H(Mi+1) H(Mi)

Page 49: Randomized Techniques in Geometry

Trapezoidal decompositionDescent Structure

H(Mi+1) H(Mi)

Page 50: Randomized Techniques in Geometry

Bounding the conflict sizes

Claim:

Pr { max��H(R) l(�) ≥ c (n/r) log r } ≤ ½

|R| = r by Bernoulli sampling

p(�,r): conditional prob. that none of the k conflicting elements are selected given � is feasible

≤ (1-r/n)k

≤ e–c log r for k ≥ cn/r ln r

= 1/ rc

BAD ����

Page 51: Randomized Techniques in Geometry

Bounding the conflict sizes

q(�,r): prob. that D(� ) _ R

Prob. that � � H(R) = p(�,r) x q(�,r)

Prob. that some � � H(R) is BAD (l(�) ≥ c(n/r) log r)

≤ 1/rc �� q(�,r)

= 1/rc E( H(R) )

usually H(R) = rO(1)

≤ ½ for appropriate c

Page 52: Randomized Techniques in Geometry

Trapezoidal DecompositionPoint Location

Claim:

Pr { max��H(R) l(�) ≥ c (n/r) log r } ≤ ½

|R| = r by Bernoulli sampling

r = n/2 (bottom-up sampling) �

Pr { max��H(R) l(�) ≥ c log n } ≤ ½

Point location in Trapezoidal decomposition:

O( log2 n ) w.h.p.

Page 53: Randomized Techniques in Geometry

Randomized Framework for Clustering problems

Page 54: Randomized Techniques in Geometry

Clustering Problems

� Select X = k points in Rd, that minimize� K-Medians

2|||| XpPp

−∑∈

� Each point is assigned to closest

center in X

� Cluster : Set of points assigned to

a center

� K-Means

|||| XpPp

−∑∈

Page 55: Randomized Techniques in Geometry

Class of Clustering Problems

� Conditions

� Any clustering problem satisfying these 2 conditions will

have a linear time algorithm

� k-means, k-median and discrete k-means clustering

problems satisfy these properties

� Existence of Random Sampling

Procedure

� Tightness Property

Page 56: Randomized Techniques in Geometry

Results : k-means

Sabharwal, Sen, CGTA (2-means)

Har-Peled, Mazumdar

(Discrete also)

Kumar, Sabharwal, Sen,

FOCS 2004

(Discrete also)

de la Vega, Karpinski, Kenyon, Rabani

Matousek

( )nOd)/1( ε

( )nnOkdk log

22−ε

( )nndO kOOkO )()1()/( log2

)1(ε

( )ndOO

k)1()/(2 ε

( ))/1(loglog 1)12(2 εε kkkdknknO

++−++

Page 57: Randomized Techniques in Geometry

Results : k-medians

Har-Peled, Mazumdar

(Discrete also)

Kumar, Sabharwal, Sen, ICALP 2005

(non-discrete only)

Badoiu, Har-Peled, Indyk

Kolliopoulos, Rao

(Discrete only)

Arora, Raghavan, Rao ( ) dfixedfornOO )/1( ε

( )nndOkOOk O )()1()/( log2

)1(ε

( )knnO loglog∂

( )ndOO

k)1(

)/(2 ε

( )nknOOO )1()1( log∂+

)])/)/1log1(((exp[ 1−+=∂ dO εε

Page 58: Randomized Techniques in Geometry

� Random Sampling Procedure

� Generates candidates, C, that approximate

the 1-center of a set of points P with constant probability

� Size of sample must be independent of |P| & d.

� Size of C must be independent of |P| & d.

Class of Clustering Problems

Page 59: Randomized Techniques in Geometry

k-Means: Random Sampling Procedure

� Optimal 1-Mean is

� Approximation of Centroid (Inaba et al)

� T = random sample of size m=O(1/����)

� Centroid of T is a (1+����)-approx centroid of S with constant probability

∑∈

=Sp

pS

Sx||

1)(

Page 60: Randomized Techniques in Geometry

k-Means: Random Sampling Procedure

( )

( )

=+=

+<−∴

−⋅+=−

<

>−

−=

=−=

εε

2)(||1)(||

||

21||)(||

||)()(||||)(||||)(||,

2/1)(||

2||)()(||Pr

||)(||||

1)(

)(||

1||)()(||))(())((

2

22

2

2

2

TSVarSSVarST

Txx

SxTxSSVarSTxxAlso

SVarT

SxTx

SxxS

SVar

SVarT

SxTxESxETxE

Sx

i

Sx

i

Sx

i

i

i

i

Page 61: Randomized Techniques in Geometry

Discrete K-Means: Random Sampling Procedure

� The closest discrete point, c’, to the non-discrete 1-mean, c, is the discrete 1-mean.

� Randomly Sample O(1/����) points to obtain approximate non-discrete 1-mean, a.

� Is the closest discrete point, a’, of a (1+����)-approx. non-discrete 1-mean a good approx to the discrete 1-mean?

� May be far away from the actual discrete 1-mean

� dist(c,a’) is comparable to dist(c,c’)

� a’ is a (1+ª����) approximation to the discrete 1-mean

c

c’

a

a’

2||||.||),(),( xcPcPxP −+∆=∆

Page 62: Randomized Techniques in Geometry

K-Median: Random Sampling Procedure

� Sample a set of 1/���� + 1 points from P

� Let Q = first 1/���� points, p = last point

� Let T = Avg. 1-Median cost of P, c=1-Median

� Let B1 = B(c,T/����2), B2 = B(p, ����T)

� Let P’ = points in B1

p

c

B1

B2

T/����2

���� T||

||||

P

cx

T Px

=∑∈

Page 63: Randomized Techniques in Geometry

K-Median: Random Sampling Procedure

� If there are >= 2����|P’| points of P’ outside B2

� With const prob., Q contains one of these points

� is an O(1/����O(1))-approximation of T

� Use techniques of Badoiu et al to generate candidate center set. Since we have approximation to T, size can be limited to

∑ ∈Qqqpd ),(

)2()1(/1 O

p

c

B1

B2

Page 64: Randomized Techniques in Geometry

K-Median: Random Sampling Procedure

� If there are < 2����|P’| points of P’ outside B2

� Most points are concentrated around p

� Infact, p is itself a good approximation to the center

� Add the random sample to the candidate center set

p

c

B1

B2

Page 65: Randomized Techniques in Geometry

Other Results

� 1-Median [Kumar, Sabharwal, Sen, ICALP 2005]

� With constant probability we can determine a

(1+����)-approximate 1-median in time

� Running time independent of n

� Weighted Cases

� Algorithm extends for weighted point sets

� Running time

� n = no. of distinct points, W = total weight

).2()1(/1dO

).log.2()1()/(

dWnOkk Oε

Page 66: Randomized Techniques in Geometry

Thank You