620 likes | 786 Views
Efficient Partition Trees Jiri Matousek. Presented By Benny Schlesinger Omer Tavori. Simplex Range Searching. Simplex range searching: We preprocess a set P of n points in so that, given any query region , the points in P can be counted or reported efficiently.
E N D
Efficient Partition TreesJiriMatousek Presented By Benny Schlesinger Omer Tavori
Simplex Range Searching • Simplex range searching: We preprocess a set P of n points in so that, given any query region , the points in P can be counted or reported efficiently. • Let's assume that the query region is a simple polygon; if it is not, we can always approximate it (by triangulation).
Simplex Range Searching • We have arrived at the triangular range searching problem: given a set P of n points in the plane, count the points from P lying in a query triangle delta. • Let’s first look at a simpler version of this problem, where the query triangle degenerates into a half plane (simply a query line). • Extending the simpler version to the original problem is just looking at 3 lines.
How do we solve the simplex range searching problem? We will use Partitions Trees
Partitioning Point Sets • A simplicial partition for a set P of n points in the plane is a collection := where the Pi are disjoint subsets of P whose union is P and i is a triangle containing Pi. The subsets Pi are called classes. • We do not require the triangles to be disjoint.
Simplicial Partition • We say that a line h crosses a triangle if h intersects the interior of . • A crossing number of a line h with respect to is the number of triangles crossed by h. • In our example the crossing number of h is 2.
Simplicial Partition • The crossing number of is the maximum crossing number over all possible lines. In the last figure you can find lines that intersect four triangles, but no line intersects all five.
Fine Simplicial Partition • We say that a simplicial partition is fine if s |Pi|< 2s for a given s. In fine simplicial partitions none of the classes contains more than twice the average number of points of the classes. (If there are r classes and n points The average number of points in class is n/r = s)
Simplicial Partition • If a triangle , of the partition is not crossed by the line h, then its class p, either lies completely in h, or it is completely disjoint from h (i.e. either completely above or below the line) • In our example, if we queried with l+, the half-plane lying above l, we would have to recourse on two of the five classes.
The Partition Theorem • It is always possible to find a simplicial partition with crossing number • The partition Theorem: For a set P of n points in the plane, and a parameter r with 1 r n , a fine simplicial partition of size r and crossing number can be constructed in time O(n).
-Cutting • cutting : A cutting is a collection of closed triangles with disjoint interiors, whose union is the whole plane. The size of a cutting is the number of its triangles. • -cutting: Let H be a collection of n lines and let be a cutting. For a triangle , let denote the collection of lines of H intersecting . A cutting is an -cutting for H provided that
-cutting for weighted collection of lines • A weighted collection of lines is a pair (H, w), where H is a collection of lines and is a weight function . • A Cutting is an -cuttingfor (H,w), provided that, for every triangle :
The Partition Theorem • In order to prove the partition theorem will use two lemmas. • In the first lemma we will use the cutting theorem. Let us remind what is the cutting theorem.
Lemma 1 Let P be an n-point set in , let s be an integer parameter, 2 s < n, set r = n/s. and let H be a set of lines. Then there exists a simplicial partition for P, whose classes Pi satisfy s |Pi| < 2s for every i and that the crossing number of every line of H relative to is
Lemma 1: Building the Partition • We inductively construct the disjoint sets Pi and i. • Suppose that P1,…Pi have already been constructed and set Pi'=Pi-(P1,…, Pi) • If |Pi|' < 2s we set Pi+1 = Pi' , i+1 = R2. m = i+1 and := {(P1, 1),…,(Pm, m)} which finishes the construction. • Otherwise Let ni = |Pi'| >= 2s.
Lemma 1: Finding a cutting using weights How do we find Pi+1 and i+1? We will find them by building a cutting for weighted collection of lines. For a line hH let ki(h) denote the number of triangles among 1,…, i (the triangles that are already in the partition) that are crossed by h. For every hH let . we also define a weighted collection (H,wi).
Lemma 1: Finding a cutting using weights At the first iteration: hH Notice that if a line h intersects i-1 at the next iteration:
Lemma 1: Finding a cutting using weights The intuition: While building the cutting we will try to avoid constructing triangles that are crossed by lines with “heavy” weights. (One of these triangles will be chosen to be a triangle in the simplicial partition.)
Lemma 1: Constructing A (1/ri)-cutting W (h) = 2
Lemma 1: Constructing A (1/ri)-cutting W (h) = 2
Lemma 1: Constructing A (1/ri)-cutting W (h) = 2
Lemma 1: Constructing A (1/ri)-cutting W (h) = 2
Lemma 1: Constructing A (1/ri)-cutting W (h) = 2
Lemma 1: choosing i W (h) = 2
Lemma 1: choosing i W (h) = 2
Lemma 1: choosing i W (h) = 2
Lemma 1: Updating The Weights W (h) = 4
Lemma 1: Finding Pi+1 and i+1 We want to find a triangle i+1 which will hold the class Pi+1. Don’t forget that we want at least s points in Pi+1. Currently we have ni points left.
Lemma 1: Finding Pi+1 and i+1 According to the cutting theorem we know that we have a cutting with triangles. By the pigeonhole principle, One of the triangles in the cutting will have at least = s points. This triangle will be i+1. We choose some s points from i+1 to be Pi+1 in the partition.
Lemma 1: Finding The Crossing Number Of The Partition • We want to show that the crossing number of every line h in H relative to our partition is:
Lemma 2: The Test Set Lemma • For an n-point set P and a parameter r, there exists set H of at most r lines, s.t, for any simplicial partition for P satisfying |Pi| s for i, the following holds: if k0 is the maximum crossing number of lines of H relative to the partition, then the crossing number of the partition is bounded by:
The cutting theorem Now that we can use the two lemmas we can easily prove the cutting theorem. Given an n-point set P in the plane, an integer parameter 2 <= s < n , and r = n/s. In order to obtain the desired simplicial partition, we first use lemma 2. We get a set H of at most r lines.
The cutting theorem • Second we use lemma 1, obtaining a simplicial partition , whose classes have size between s and 2s, and such that the crossing number of any line of H is at most: • By the property of H guaranteed by the Test Set Lemma the crossing number of is at most:
Test-Set Lemma (cont.) • Why Test-Set? We will show that we can literally find a “small” set of lines as stated, that is, a test-case of lines that ensures a certain crossing number for any partition whose classes’ sizes is no less than a certain bound, s.