Download presentation

Presentation is loading. Please wait.

Published byPaxton Semar Modified over 3 years ago

1
Computing Diameter in the Streaming and Sliding-Window Models J. Feigenbaum, S. Kannan, J. Zhang

2
Introduction ● Two computational models: 1. Streaming model 2. Sliding-window model ● The problem: diameter of a point set P in R 2. The diameter is the maximum pairwise distance between points in P.

3
More about Models The streaming model ● A data stream is a sequence of data elements a 1 a 2,..., a m. ● A streaming algorithm is an algorithm that computes some function over a data stream and has the following properties: 1. The input data are accessed in a sequential order. 2. The order of the data elements in the stream is not controlled by the algorithm ● The length of the stream, m, is huge. Only space-efficient algorithms (sublinear or even polylog(m)) are considered.

4
More about Models (Continued) The sliding-window model ● The input is still a stream of data elements. ● A data element arrives at each time instant; it later expires after a number of time stamps equal to the window size n ● The current window at any time instant is the set of data elements that have not yet expired.

5
Dynamic Algorithm in Computational Geometry ● Dynamic means that the set of objects under consideration may change. There could be additions and deletions to the point set P. ● Maintain the current set of geometry objects in certain data structures. Efficient updating and query answering are emphasized. ● May use linear space ─ different from the requirement of the streaming and the sliding-window models.

6
Computing Diameter in the Streaming Model ● A well-known diameter-approximation is streaming in nature. ● Project the points onto lines. ● Requires θ ≤ such that |π(p)π(q)| ≥ |pq| cosθ ≥ (1− θ 2 /2)|pq| ≥ (1−ε)|pq| ● The algorithm goes through the input once. It needs storage for O(1/ ) points. To process each point, it performs O(1/ ) projections.

7
Diameter Approximation in the Streaming Model Theorem There is a streaming ε-approximation algorithm for diameter that needs storage for O(1/ε) points and processes each point in O(log(1/ε)) time. ● Take the first point of the stream as the “center” and divide the space into sectors of angle θ = ε/2(1-ε). ● For each sector, keep the point furthest from the center in that sector.

8
Diameter Approximation in the Streaming Model Let H be the maximum distance between the center and any other point and T i,j be the minimal distance between the boundary arcs of sector i (bb') and sector j (aa'). Approximate the diameter with max{H, max i,j T ij }

9
Maintaining Diameter in the Sliding-Window Model ● Let R be the maximum, over all windows, the ratio of the diameter over the minimal non-zero distance between any two points in that window. ● If we assume the minimal non-zero distance is 1, R is the diameter in the window. ● When the set of points P can be bounded in a box of size R, we maintain the diameter for sliding windows using polylog(R) bits of space.

10
Maintaining Diameter in the Sliding-Window Model Theorem There is an ε-approximation algorithm that maintains the diameter for a planar point set in the sliding-window model using Poly(1/ε, log n, log R) bits of space.

11
Remove Irrelevant Points ● Consider maintaining the diameter in 1-d. ● A point will never realize any diameter if it is spatially located between two newer points. ● Remove these points. The locations of the remaining points would look like: (where a 1 is newer than a 2 which is newer than a 3...) ● The newer points would be located “inside” and the older points would be located “outside”

12
The “Rounding” Method ● Take the newest point as the “center,” and “round” down other points. ● Divide the line into the following intervals such that |ct i | = ( 1+ε ) i d for some distance d (to be specified later). ● Round all points in the interval [t i, t i+1 ) down to t i. ● In what follows we call the set of pints after “rounding” a cluster. If 2 i original points are grouped into a cluster, we say the cluster is at level i.

13
Number of Points in a Cluster ● If multiple points are rounded to the same location, we can discard the older ones and only keep the newest one. ● In each interval, we have only one point. Let D be the diameter, the number of points k in a cluster is bounded by: k ≤ log 1+ε D/d = (log D/d)/log (1+ε) ≤ (2/ε )log D/d

14
When Window Starts Sliding ● Need to consider addition and deletion. ● Deletion is easy, because the oldest point must be one of the cluster's extreme points. ● Addition is complicated, because we may need to update the cluster center for each point that arrives. ● Our solution: keep multiple clusters.

15
Multiple Clusters in a Window ● The window can be divided into clusters of level 1, 2, …, log n. ● We allow at most two clusters to be at each “level”. ● When the number of clusters of “level” i exceeds 2, merge the oldest twe clusters to form a “cluster” at “level” i+1.

16
Clusters in a Window

17
Merge Clusters ● Cluster c 1 +cluster c 2 = cluster c 3 ● Make Ctr 2 the center of cluster c 3

18
Merge Clusters (Continued) ● Discard the points in c 1 that are located between the centers of c 1 and c 2. ● If point p in c 1 satisfies |pCtr 1 | ≤ (1+ε)|Ctr 1 Ctr 2 |, discard it, too.

19
Merge Clusters (Continued) ● Round the points in c 2 and those remaining in c 1 after the previous two steps using the center Ctr 2. ● The value for d is lower bounded by ε ∙ |Ctr 1 Ctr 2 |. The number of points in a cluster is then bounded by: (2/ε )(log R + log 1/ε )

20
The Algorithm in 1-d ● Update: when a new point arrives, 1. Check the age of the boundary points of the oldest cluster. If one of them has expired, remove it. 2. Make the newly arrived point a cluster of size 1. Go through the clusters and merge clusters whenever necessary according to the rules stated above. 3. While going throught the clusters, update the boundary points of any cluster changed. 4. Update the window boundary points if necessary. ● Query Answer: Report the distance between the window boundary points as the window diameter.

21
Space Requirement ● Let diam p be a diameter realized by point p. Each time we do “rounding,” we introduce a displacement for p at most ε ∙ diam p. Also p can be “rounded” at most log n times. ● Choose ε to be at most ε/(2log n) to bound the error. ● There are at most 2log n clusters and in each cluster at most O ( 1/ε log n (log R + log log n + log 1/ε ) ) points. Keeping the age may require log n space for each point. The total space required is: O ( 1/ε log 3 n (log R + log log n + log 1/ε ) )

22
Time Complexity ● Query answer time is O(1). ● Worst case update time is O ( 1/ε log 2 n (log R + log log n + log 1/ε ) ) because we may have cascading merges. ● The amortized update time is O(log n)

23
Extend the Algorithm to 2-d ● We will have a set of lines l 0, l 1,... and project the points in the plane onto the lines. ● Guarantee that any paire of points will be projected to a line with angle φ such that 1− cos φ ≤ ε/2 ● Use the diameter-maintenance algorithm in 1-d for each line. ● Everything will have a multiplicative overhead of O(1/ ).

24
Lower Bound for Maintaining Exact Diameter Theorem To maintain the exact diameter in a sliding window model requires Ω(n) bits of space. Consider 2n points {a 1, a 2,..., a 2n } with the following properties: –a n+1, a n+2,..., a 2n are located at coordinate zero. –|a 1 a n | ≥ |a 2 a n+1 | ≥ |a 3 a n+2 | ≥... ≥ |a n-1 a 2n-2 | = 1 –The coordinates of the points a j for j = 1,2,..., n-2 have the form n∙k for some k = 1,2,..., n.

25
A Family of Point Sequences a n a n+1 a n+2...... a n-1 a n-2 a2a2 a1a1 a n a n+1 a n+2...... a n-1 a n-2 a2a1a2a1...... We show below two sequences in the family:

26
Lower Bound for Maintaining Exact Diameter (Countinued) ● There are at least different sequences of 2n points satisfying the above properties. ● Need O(n) space to distinguish them. (Note here R ≤ n 2 << 2 n )

Similar presentations

OK

UMass Lowell Computer Science 91.503 Graduate Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 3 Tuesday, 2/9/10 Amortized Analysis.

UMass Lowell Computer Science 91.503 Graduate Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 3 Tuesday, 2/9/10 Amortized Analysis.

© 2018 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on pi in maths what is the range Ppt on acute and chronic diseases Maths ppt on statistics class 9 Free download ppt online shopping project Ppt on object oriented programming with c++ textbook Ppt on phonetic transcription alphabet Ppt on second law of thermodynamics explained Ppt on safety in cement industry Download ppt on turbo generator Ppt on ball mill