CMPS 3130/6130 Computational Geometry Spring 2017

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

1 Computational Geometry Chapter Range queries How do you efficiently find points that are inside of a rectangle? –Orthogonal range query ([x 1,
Orthogonal range searching. The problem (1-D) Given a set of points S on the line, preprocess them to build structure that allows efficient queries of.
INTERVAL TREE & SEGMENTATION TREE
Lecture 3: Parallel Algorithm Design
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
COSC 6114 Prof. Andy Mirzaian. References: [M. de Berge et al] chapter 5 Applications: Data Base GIS, Graphics: crop-&-zoom, windowing.
Searching on Multi-Dimensional Data
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
Orthogonal Range Searching-1Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional.
Computational Geometry, WS 2007/08 Lecture 15 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften.
Lecture 5: Orthogonal Range Searching Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 - Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
O RTHOGONAL R ANGE S EARCHING الهه اسلامی فروردین 92, 1.
Fractional Cascading and Its Applications G. S. Lueker. A data structure for orthogonal range queries. In Proc. 19 th annu. IEEE Sympos. Found. Comput.
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.
Orthogonal Range Searching I Range Trees. Range Searching S = set of geometric objects Q = query object Report/Count objects in S that intersect Q Query.
4/21/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Motion Planning Carola Wenk.
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.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
B-trees and kd-trees Piotr Indyk (slides partially by Lars Arge from Duke U)
Bin Yao Spring 2014 (Slides were made available by Feifei Li) Advanced Topics in Data Management.
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
Multi-dimensional Search Trees
P ARALLEL O RTHOGONAL R ANGE S EARCHING Project Presentation by Savitha Parur Venkitachalam.
Lars Arge Presented by Or Ozery. I/O Model Previously defined: N = # of elements in input M = # of elements that fit into memory B = # of elements per.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Orthogonal Range Search
Lecture 2: External Memory Indexing Structures CS6931 Database Seminar.
Computational Geometry Piyush Kumar (Lecture 5: Range Searching) Welcome to CIS5930.
CMPS 3130/6130 Computational Geometry Spring 2015
Multi-dimensional Search Trees CS302 Data Structures Modified from Dr George Bebis.
CMPS 3130/6130 Computational Geometry Spring 2015
Problem Definition I/O-efficient Rectangular Segment Search Gautam K. Das and Bradford G. Nickerson Faculty of Computer science, University of New Brunswick,
1/20/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Plane Sweep Algorithms I Carola Wenk.
4/9/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Motion Planning Carola Wenk.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
May 2012Range Search Algorithms1 Shmuel Wimer Bar Ilan Univ. Eng. Faculty Technion, EE Faculty.
School of Computing Clemson University Fall, 2012
CMPS 3130/6130 Computational Geometry Spring 2017
The Coordinate Plane What You'll Learn
CSE 554 Lecture 5: Contouring (faster)
Computational Geometry
Geometric Data Structures
CMPS 3130/6130 Computational Geometry Spring 2017
Multidimensional Range Search
CMPS 3130/6130 Computational Geometry Spring 2017
Intro to Functions.
CMPS 3130/6130 Computational Geometry Spring 2017
KD Tree A binary search tree where every node is a
Advanced Topics in Data Management
Orthogonal Range Searching and Kd-Trees
Reporting (1-D) Given a set of points S on the line, preprocess them to build structure that allows efficient queries of the from: Given an interval I=[x1,x2]
Orthogonal Range Searching Querying a Database
Shmuel Wimer Bar Ilan Univ., School of Engineering
CMPS 3130/6130: Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3120: Computational Geometry Spring 2013
Presentation transcript:

CMPS 3130/6130 Computational Geometry Spring 2017 Orthogonal Range Searching II Carola Wenk CMPS 3130/6130 Computational Geometry

Orthogonal range searching Input: A set P of n points in d dimensions Task: Process P into a data structure that allows fast orthogonal range queries. Given an axis-aligned box (in 2D, a rectangle) Report on the points inside the box: Are there any points? How many are there? List the points. CMPS 3130/6130 Computational Geometry

Orthogonal range searching: KD-trees Let us start in 2D: Input: A set P of n points in 2 dimensions Task: Process P into a data structure that allows fast 2D orthogonal range queries: Report all points in P that lie in the query rectangle [x,x’]  [y,y’] y' y x x' CMPS 3130/6130 Computational Geometry

CMPS 3130/6130 Computational Geometry KD trees Idea: Recursively split P into two sets of the same size, alternatingly along a vertical or horizontal line through the median in x- or y-coordinates. l1   l5 l1 l7 {p1, p2, p3, p4,p5} {p6, p7, p8, p9,p10} l2 l3 p4 p5 p9     {p1, p2, p3} {p4,p5} {p6, p7, p8} {p9,p10} p10 l4 l5 l6 l7 l2     p2 l3   {p1, p2} {p6, p7}   l8 p7 p1 l8 p8 p3 p4 p5 l9 p8 p9 p10   p3   l9 p1 p2 p6 p7 p6 l4 l6 CMPS 3130/6130 Computational Geometry

CMPS 3130/6130 Computational Geometry BuildKDTree Idea: Recursively split P into two sets of the same size, alternatingly along a vertical or horizontal line through the median in x- or y-coordinates. l1 p5 p4 p2 p7 l2 l3 l4 l5 l6 p6 p9 l7 p10 p8 l8 p1 p3 l9 l1 l2 l3 l6 l7 l4 l5 l9 l8 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10     CMPS 3130/6130 Computational Geometry

CMPS 3130/6130 Computational Geometry BuildKDTree Analysis Sort P separately by x- and y-coordinate in advance Use these two sorted lists to find the median Pass sorted lists into the recursive calls Runtime: 𝑇 𝑛 = 𝑂 1 ,𝑛=1 𝑂 𝑛 +2𝑇 𝑛 2 , 𝑛>1 =𝑂(𝑛 log 𝑛) Storage: O(n), because binary tree on n leaves, and each internal node has two children. CMPS 3130/6130 Computational Geometry

CMPS 3130/6130 Computational Geometry Regions l1 l2 l3 l6 l7 l4 l5 l9 l8 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10   l1 p5 p4 p2 p7 l2 l3 l4 l5 l6 p6 p9 l7 p10 p8 l8 p1 p3 l9             =v     region(v) lc(v)=left_child(v) region(lc(v)) = region(v)l(v)left  Can be computed on the fly in constant time CMPS 3130/6130 Computational Geometry

CMPS 3130/6130 Computational Geometry SearchKDTree l1   l2 l3     l4 l5 l6 l7         l8 p3 p4 p5 l9 p8 p9 p10     p1 p2 p6 l10   l11 l12     l5 l1 l7 p11 p7 p12 p13 p4 p5 p9 p10 l2 p2 p7 l3 How many nodes does a search touch? l8 p13 p1 l11 l12 p8 p11 p12 p3 l10 p6 l9 l4 l6 CMPS 3130/6130 Computational Geometry

SearchKDTree Analysis Theorem: A kd-tree for a set of n points in the plane can be constructed in O(n log n) time and uses O(n) space. A rectangular range query can be answered in 𝑂 𝑛 +𝑘 time, where k = # reported points. (Generalization to d dimensions: Also O(n log n) construction time and O(n) space, but 𝑂( 𝑛 1− 1 𝑑 +𝑘) query time.) CMPS 3130/6130 Computational Geometry

SearchKDTree Analysis Proof Sketch: Sum of # visited vertices in ReportSubtree is O(k) # visited vertices that are not in one of the reported subtrees = O(# regions(v) intersected by a query line) Consider intersections with a vertical line only. Let Q(n) = # intersected regions in kd-tree of n points whose root contains a vertical splitting line Q(n) = 2 + 2Q(n/4), for n>1 Q(n) = O( 𝑛 ) l3 l1 l1   l2 l2     l3 l4 l4 CMPS 3130/6130 Computational Geometry

Summary Orthogonal Range Searching Range trees Query time: O(k + logd-1 n) to report k points (uses fractional cascading in the last dimension) Space: O(n logd – 1 n) Preprocessing time: O(n logd – 1 n) KD-trees Query time: 𝑂( 𝑛 1− 1 𝑑 +𝑘) to report k points Space: O(n) Preprocessing time: O(n log n) CMPS 3130/6130 Computational Geometry