Cutting trees and the cutting lemma Presented by Amir Mograbi.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

Shortest Vector In A Lattice is NP-Hard to approximate
Computational Geometry
WSPD Applications.
INTERVAL TREE & SEGMENTATION TREE
Knapsack Problem Section 7.6. Problem Suppose we have n items U={u 1,..u n }, that we would like to insert into a knapsack of size C. Each item u i has.
Divide and Conquer. Subject Series-Parallel Digraphs Planarity testing.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Fast Algorithms For Hierarchical Range Histogram Constructions
Heaps1 Part-D2 Heaps Heaps2 Recall Priority Queue ADT (§ 7.1.3) A priority queue stores a collection of entries Each entry is a pair (key, value)
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
Dynamic Planar Convex Hull Operations in Near- Logarithmic Amortized Time TIMOTHY M. CHAN.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Algorithms Recurrences. Definition – a recurrence is an equation or inequality that describes a function in terms of its value on smaller inputs Example.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Tirgul 2 Asymptotic Analysis. Motivation: Suppose you want to evaluate two programs according to their run-time for inputs of size n. The first has run-time.
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
DAST 2005 Week 4 – Some Helpful Material Randomized Quick Sort & Lower bound & General remarks…
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Recurrences Part 3. Recursive Algorithms Recurrences are useful for analyzing recursive algorithms Recurrence – an equation or inequality that describes.
O RTHOGONAL R ANGE S EARCHING الهه اسلامی فروردین 92, 1.
AALG, lecture 11, © Simonas Šaltenis, Range Searching in 2D Main goals of the lecture: to understand and to be able to analyze the kd-trees and.
16.Greedy algorithms Hsu, Lih-Hsing. Computer Theory Lab. Chapter 16P An activity-selection problem Suppose we have a set S = {a 1, a 2,..., a.
Efficient Partition Trees Jiri Matousek Presented By Benny Schlesinger Omer Tavori 1.
Randomized Algorithms - Treaps
Review Binary Tree Binary Tree Representation Array Representation Link List Representation Operations on Binary Trees Traversing Binary Trees Pre-Order.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
Basics Set systems: (X,F) where F is a collection of subsets of X. e.g. (R 2, set of half-planes) µ: a probability measure on X e.g. area/volume is a.
UNC Chapel Hill M. C. Lin Orthogonal Range Searching Reading: Chapter 5 of the Textbook Driving Applications –Querying a Database Related Application –Crystal.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
1 COMP3040 Tutorial 1 Analysis of algorithms. 2 Outline Motivation Analysis of algorithms Examples Practice questions.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Recursion Algorithm : Design & Analysis [3]. In the last class… Asymptotic growth rate The Sets ,  and  Complexity Class An Example: Maximum Subsequence.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Recurrences – II. Comp 122, Spring 2004.
Lecture 5 Today, how to solve recurrences We learned “guess and proved by induction” We also learned “substitution” method Today, we learn the “master.
1 Recursive algorithms Recursive solution: solve a smaller version of the problem and combine the smaller solutions. Example: to find the largest element.
Divide and Conquer Faculty Name: Ruhi Fatima Topics Covered Divide and Conquer Matrix multiplication Recurrence.
Approximation Algorithms based on linear programming.
Computational Geometry
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
A novel, low-latency algorithm for multiple group-by query optimization Duy-Hung Phan Pietro Michiardi ICDE16.
3.5 Solving systems of equations in three variables Main Ideas Solve systems of linear equations in three variables. Solve real-world problems using systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Computational Geometry
Geometric Data Structures
Divide-and-Conquer 6/30/2018 9:16 AM
Orthogonal Range Searching and Kd-Trees
Hidden Markov Models Part 2: Algorithms
Balanced-Trees This presentation shows you the potential problem of unbalanced tree and show two way to fix it This lecture introduces heaps, which are.
Divide-and-Conquer 7 2  9 4   2   4   7
Balanced-Trees This presentation shows you the potential problem of unbalanced tree and show two way to fix it This lecture introduces heaps, which are.
Dynamic Data Structures for Simplicial Thickness Queries
Graphs and Algorithms (2MMD30)
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Divide-and-Conquer 7 2  9 4   2   4   7
Continuous Density Queries for Moving Objects
Divide-and-Conquer 7 2  9 4   2   4   7
Switching Lemmas and Proof Complexity
Efficient Aggregation over Objects with Extent
Divide-and-Conquer 7 2  9 4   2   4   7
Presentation transcript:

Cutting trees and the cutting lemma Presented by Amir Mograbi

Goal: Solve the Triangular range counting problem. t contains 3 points The problem: Given a set S of n points in the plane and a triangle t, count the points in t. For now lets forget it altogether, We must perform some steps before.

Cutting Trees Definition: given a set L of n lines in the plane – A (1/r)-cutting is the partitioning of the plane into triangles (possibly unbounded) so that each triangle is intersected by at most n/r line. – The size of the cutting is defined as the number these triangles.

An example: A (1/2)-cutting of size 10 in a plane with a set of 6 lines n/r = 6/2 = 3 the maximum of lines to intersect a triangle.

The cutting lemma For any set L of n lines in the plane, and any parameter r with 1≤r≤n, a (1/r)-cutting of size O(r^2) exists.

A new problem: Given a set L of n lines in the plane. Query: given a point p, count how many lines are below p.

Solution: We solve this by building a cutting tree over the set of lines, and performing the query using it.

Structure of Cutting trees The tree structure is recursively defined as follows: Given a (1/r)-cutting of size O(r^2) of the plane, and a set L of lines. If there is only one line in L, the tree consists of a single leaf where L is explicitly stored. l

Structure of Cutting trees – cont. If L consists of more than 1 line the tree will consist of a root with r^2 children. each child corresponds to a single triangle of the cutting. each child v, contains: L-(v) number of all lines under it. L+(v) number of lines above it. τ(v) a cutting tree over lines intersecting v. … r^2 direct children of the root each refers to a triangle of the cut Note: using a new (1/r)-cutting of the triangle which corresponds to v.

Structure of Cutting trees – cont. A visual example of L-(v) L+(v) Yes, they are called “canonical subsets” but I spared you the jargon earlier.

Using cutting trees Given a point p and a set L of n lines in the plane we want to count the number of lines under p. – Algorithm:

Space and Time requirements We now prove that using the “select Below Point” algorithm takes time, and the cutting tree used by the algorithm takes Proof: Let Q(n) denote the runtime, it satisfies: Which solves to:

Finding time complexity

Space and Time requirements – cont. According to the cutting lemma: – Given r,we can construct a (1/r)-cutting for L of size,c is a constant. Let ε>0 we will prove that by wisely choosing r we could make the space complexity: Resolve to:

Since we have cr^2 children, each a cutting tree over at most 1/r lines.

This is a geometrical series and p<1, thus its bounded by the constant 1/(1-p) so its O(1) Now it boils down to this! Let p=cr^2

We promised that complexity would be proved to be: For any ε >0 c is a constant we cant change (given by the cutting lemma) On the other hand, r we can choose! So for a required ε let Now we look at this Combining the above we get:

Space Time complexity recap We saw that we can query (count and select) the number of lines under a point in: – Time: – Space: Where n is the number of lines, and ε>0 is as small as we want.

Cutting Trees – two level tree Earlier we solved the query: “find the number of lines below a point” Now we see how we solve this new query: Input: two points q1 q2, a set L of n lines Query: count the lines from L below both q1 & q2.

At first glance… Hold your horses! Can’t we just determine which point is lower and query for lines below that point like we did before?

Cutting Trees – two level tree cont. Structure of a two level cutting tree: first we construct a cutting tree as before, T for each direct child of the root of T: In addition to L-(v) the number of lines below v we store T-(v), which is a cutting tree over the lines below v. … v T(v) T-(v)

Cutting Trees – two level tree cont. Algorithm:

Two level cutting tree - Analysis We will prove that adding the extra level will: – Keep space complexity as before: – Worsen time complexity to: Which solves to Which solves to:

The only difference here is that we replace r^2 with r^2 + O(logn) After replacing:

Since we have cr^2 children, each a cutting tree over at most 1/r lines.

Three level cutting tree A three point query – Given: a set L of n lines in the plane – Query: For a triple of points, each of which has a direction attached (below/above): Find out how many lines answer the criteria of the points.

Three level cutting tree - structure Root Direct child 3-level tree over intersecting lines 2-level tree over lines below 2-level tree over lines above

Three level cutting tree γ←Ø If T is a single leaf Then – check explicitly if the line fulfills criteria Else - find the child which p3 belongs to – Vp3 γ1 ← SelectTriple(p1,p2,p3,T(Vp3)) γ2 ← SelectBelowPair(p1,p2,T+(Vp3)) γ ← γ1 U γ2 Return γ Input: three query points p1,p2,p3, with ↑↓, a 3-level cutting tree T Output: a set of all canonical subsets that fulfill criteria SelectTriple(p1,p2,p3,T) (we assume p1↓,p2↓,p3↑)

Three level cutting tree - Analysis Similarly to its two level variant: Lets look at the recurrence Time: Space: Which solves to: Which solves to

Applying to our first problem: Using the duality transform we convert the set of points P to a set of lines L. convert the three lines of the query triangle into a triple with above/below tag. perform the query, and then we can convert the lines found back to the original points.