Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Streaming Algorithms for Geometric Problems Piotr Indyk MIT.

Similar presentations


Presentation on theme: "1 Streaming Algorithms for Geometric Problems Piotr Indyk MIT."— Presentation transcript:

1 1 Streaming Algorithms for Geometric Problems Piotr Indyk MIT

2 2 Streaming: The Model Single pass over the data: e 1, e 2, …,e n Bounded storage Fast processing time per element

3 3 Recap: Norm estimation Norm estimation: Stream elements: (i,b), i=1…m Interpretation: x i =x i +b Want to (1+  )-approximate ||x|| p Note: the frequency moment F p is a special case Algorithms with (log n+1/  ) O(1) space: p=2: [Alon-Matias-Szegedy’96] p  (0,2]: [Indyk’00] Idea: maintain Ax

4 4 Recap: Other algorithms Compute the number of distinct elements F 0 Exactly:  (n) bits of space (1+  ) -approximation: O(1/  2 *log n) bits [Flajolet-Martin, JCSS’85],… Compute the median Exactly:  (n) (50%   ) -approximation: O(1/  *polylog n) [Paterson-Munro, TCS’80],…

5 5 Geometric Data Stream Algorithms as Data Structures Data structures that support: Insert(p) to P Possibly: Delete(p) from P Compute-Some-Property(P) Use space that is sub-linear in |P|

6 6 Dichotomy Insertions Merge and Reduce [MP’80], core-sets Deterministic Insertions + Deletions Randomized linear mappings [FM’85], [AMS’96] Randomized

7 7 Insertions and Deletions

8 8 Minimum Weight Bi-chromatic Matching Estimate the cost of MWBM

9 9 Minimum Weight Matching Estimate the cost of MWM

10 10 Minimum Spanning Tree Estimate the cost of MST

11 11 Facility Location Goal: choose a set F of facilities to minimize the sum of the distances to nearest facility plus the number of facilities times f Again, report the cost

12 12 Approach Assume P  {1…  } 2 Reduce to vector problems Impose square grids G 0 …G k, with side lengths 2 0,2 1, …, 2 k, shifted at random. For each square cell c in G i, let n P (c) be the number of points from P in c. The algorithms will maintain certain statistics over n P (.), which will allow it to approximately solve the problems 2 1 1 1 3 1 1 5

13 13 Estimators MST:∑ i 2 i ∑ c  G i [n P (c)>0] MWM:∑ i 2 i ∑ c  G i [n P (c) is odd] MWBM:∑ i 2 i ∑ c  G i |n G (c)-n B (c)| Fac. Loc.:∑ i 2 i ∑ c  G i min[n P (c), T i ] K-median:∑ i 2 i ∑ c  G i - B(Q, 2^i) n P (c) (const. factor) Maintain #non-zero entries in n P [FM’85] Maintain L 1 difference [I’00]

14 14 Results [Indyk’04] ProblemAppr. MST log  MWM log  MWBM * log  Fac.Loc. log 2  *follows from [Charikar’02,Indyk-Thaper’03] Space: (log  +log n) O(1)  1+  [Frahling-Indyk-Sohler’05]

15 15 Probabilistic embeddings into HST’s 2 1 1 1 3 1 1 Known [Bartal’96, Charikar-Chekuri-Goel-Guha-Plotkin’98]: ||p-q|| ≤ D tree (p,q) E[ D tree (p,q) ] ≤ ||p-q|| * O(log  ) T 5

16 16 MST E[Cost(MST in T)] ≤ O(log  ) Cost(MST) Cost(MST in T)  Cost(T) How to compute Cost(T) ? Sum over all levels i, of the #nodes at i, times 2 i Node c exists iff n i (c)>0 2 1 1 1 3 1 1 5

17 17 Matching Algorithm: Match what you can at the current level Odd leftovers wait for the next level Repeat Optimal on the HST Cost=∑ i 2 i ∑ c  Gi [n P (c) is odd] 0 1 1 1 1 0 0 1 1

18 18 Insertions-only

19 19 k-median/k-center k is given Goal: choose k medians/centers to minimize: k-median: the sum of the distances k-center: the max distance

20 20 Metric clustering problems k-center [Charikar-Chekuri-Feder-Motwani’97] k-median [Guha-Mishra-Motwani-O’Callaghan’00, Meyerson’01, Charikar-O’Callaghan-Panigrahy’03] Bounds: Poly(K,log n) space O(1)-approximation

21 21 Geometric Problems Diameter, Minimum Enclosing Ball [Agarwal-Har-Peled’01, Feigenbaum-Kannan-Zhang’02 (Algorithmica), Hershberger-Suri’04] K-center [AHP’01] K-median [Har-Peled-Mazumdar’04] Range searching via  -approximations: [Suri-Toth-Zhou’04] [Bagchi-Chaudhary-Eppstein-Goodrich’04]

22 22 Dominant Approach: Merge and Reduce Main ideas: Design an (off-line) algorithm that computes a “sketch” of the input Small size Sufficient to solve the problem A sketch of sketches is a sketch

23 23 Tree Computation p1p1 p2p2 p3p3 p4p4 p5p5 p7p7 p6p6 p8p8 p9p9 p 10 p 11 p 12 p 13 p 15 p 14 p 16

24 24 Algorithm Space: (sketch size)*log n Time: sketch computation time Question: Where do sketches come from ?

25 25 Idea I: solution=sketch Consider k-median [Guha-Mishra-Motwani- O’Callaghan’00] : approximate k-median of approximate weighted k-medians is an approximate k-median Result: Constant depth tree Space: kn ,  >0 O(1) -approximation Works for any metric space       k=3

26 26 Use the solution, ctd.  -Approximations: find a subset S  P, such that for any rectangle/halfspace/etc R, |R  S|/|S| = |R  P|/|P|  [Matousek] : approximation of a union of approximations is an approximation [BCEG’04] : convert it into streaming algorithm, applications  1/  2 space [STZ’04] : better/optimal bounds for rectangles and halfspaces

27 27 Idea 2: Core-Sets [AHP’01] Assume we want to minimize C P (o) S  P is an  -core-set for P, if for any o, and a set T: C P  T (o) < (1+  ) C S  T (o) Note: this must hold for all o, not just the optimal one The latter is called a “weak coreset” [Badoiu-HarPeled-Indyk’02] o

28 28 Example: Core-set for MEB Compute extremal points: Choose “densely” spaced direction v 1 …v k I.e., for any u there is v i such that u*v i ≥ ||u|| 2 / (1+  ) For each direction maintain extremal point k=O(1/  ) (d-1)/2 suffice

29 29 Stream Algorithms via Core-sets Diameter/MEB/width: O(1/  ) (d-1)/2 log n space [AHPV ’ 01+02+04] k-center: O(k/  d ) log n [HP ’ 01] k-median: O(k/  d ) log n [HPM ’ 04] (k+d+log n+1/  ) O(1) [Chen ’ 06] Faster algorithms and other results: [Chan ’ 04], [Suri-Hershberger ’ 03]

30 30 Core-sets + Randomized Maps (1+  )-approximate k-median under insertions and deletions [Frahling-Sohler’05]

31 31 Insertions and Deletions, ctd

32 32 Histograms View x as a function x:[1…n]  [1…M] Approximate it using piecewise constant function h, with B pieces (buckets) Problem can be formulated in 2D as well (buckets become rectangular tiles)

33 33 Results: 1D [Gilbert-Guha-Indyk-Kotidis-Muthukrishnan-Strauss, STOC’02] : Maintains h with B pieces such that ||x-h|| 2 ≤ (1+  )||x-h OPT || 2 Under increments/decrements of x Space: poly(B,1/ ,log n) Time: poly(B,1/ ,log n)

34 34 Results: 2D [Thaper-Guha-Indyk-Koudas, SIGMOD’02] : Maintains h with B log (nM) tiles such that ||x-h|| 2 ≤ (1+  )||x-h OPT || 2 Under increments/decrements of x Space/Update time: poly(B,1/ ,log n) Histogram reconstruction time: poly(B,1/ , n) [Muthukrishnan-Strauss, FSTTCS’03] : Maintains h with 4B tiles Time: poly(B,1/ , log(nM))

35 35 General Approach Maintain sketches Ax of x This allows us to estimate the error of any given h, via ||x-h||  ||Ax-Ah|| Construct h: Enumeration Greedy Dynamic Programming

36 36 Conclusions Algorithms for geometric data streams Insertions-only: merge and reduce Insertions and deletions: randomized linear embeddings

37 37 Open Problems High dimensions: Diameter: 2 1/2 -approx, O(d 2 n 1/2 ) space, follows from [Goel-Indyk-Varadarajan, SODA’01] c-approx, O( dn 1/(c 2 - 1) ) [Indyk, SODA’03] Conjecture:  2 1/2 -approx, O(d polylog n) space Min-width cylinder: 18-approx, O(d) space [Chan’04] Other problems ?

38 38 Open Problems Range queries: General lower bounds ? (Not just for  - approximations)  (1/  2 ) -bit bound for general queries follows from LB for dot product [Indyk-Woodruff, FOCS’03], and is tight (for randomized algorithms) What about e.g., half-space queries ? O(1/  4/3 ) is known [STZ’04] Other problems [STZ’04]

39 39 Open Problems Matchings, Facility Location, etc: Replace log  by O(1) or even 1+  Possible for MST [Frahling-Indyk-Sohler’??] Related to computing bi-chromatic matching [Agarwal-Varadarajan’04] Min-sum clustering ?


Download ppt "1 Streaming Algorithms for Geometric Problems Piotr Indyk MIT."

Similar presentations


Ads by Google