Orthogonal Range Search

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

INTERVAL TREE & SEGMENTATION TREE
Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
I/O-Algorithms Lars Arge Fall 2014 September 25, 2014.
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
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
Balanced Search Trees. 2-3 Trees Trees Red-Black Trees AVL Trees.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Spatial Indexing I Point Access Methods. PAMs Point Access Methods Multidimensional Hashing: Grid File Exponential growth of the directory Hierarchical.
Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional.
2-dimensional indexing structure
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.
BST Data Structure A BST node contains: A BST contains
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 - Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
O RTHOGONAL R ANGE S EARCHING الهه اسلامی فروردین 92, 1.
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
Fractional Cascading and Its Applications G. S. Lueker. A data structure for orthogonal range queries. In Proc. 19 th annu. IEEE Sympos. Found. Comput.
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
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.
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)
Chapter 13 B Advanced Implementations of Tables – Balanced BSTs.
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
P ARALLEL O RTHOGONAL R ANGE S EARCHING Project Presentation by Savitha Parur Venkitachalam.
Using BSP for CD Ref: BSP in deBerg et al ’ s book (url)url.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Computational Geometry Piyush Kumar (Lecture 5: Range Searching) Welcome to CIS5930.
1 5. Abstract Data Structures & Algorithms 5.1 Data Structure Fundamentals.
R-Trees: A Dynamic Index Structure For Spatial Searching Antonin Guttman.
Binary Search Trees (BST)
1 More Trees Trees, Red-Black Trees, B Trees.
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2015.
CSE554Contouring IISlide 1 CSE 554 Lecture 3: Contouring II Fall 2011.
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2013.
CMPS 3130/6130 Computational Geometry Spring 2015
Hello Everyone!!! 1. Tree And Graphs 2 Features of Trees  Tree Nodes Each node have 0 or more children A node have must one parent  Binary tree Tree.
BSP Tree Supplement Jyun-Ming Chen. Fall Kd-Tree and BSP tree kd-tree is a special kind of bsp tree.
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.
CSE 554 Lecture 5: Contouring (faster)
AA Trees.
Geometric Data Structures
CMPS 3130/6130 Computational Geometry Spring 2017
Chapter 10.1 Binary Search Trees
Section 8.1 Trees.
Modeliranje kompleksnih modelov
CMPS 3130/6130 Computational Geometry Spring 2017
KD Tree A binary search tree where every node is a
(edited by Nadia Al-Ghreimil)
Advanced Topics in Data Management
Orthogonal Range Searching and Kd-Trees
Alyce Brady CS 470: Data Structures CS 510: Computer Algorithms
Binary Search Trees < > =
Quadtrees 1.
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
(edited by Nadia Al-Ghreimil)
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Modeliranje kompleksnih modelov
Presentation transcript:

Orthogonal Range Search deBerg et. al (Chap.5) Fall 2005

1D Range Search Data stored in balanced binary search tree T Input: range tree T and range [x,x’] Output: all points in the range Fall 2005

Idea split-node Find split node x x’ split-node Find split node From split node, find path to m, the node  x; report all right subtree along the path From split node, find path to m’, the node  x’; report all left subtree along the path Check m and m’ Fall 2005

Performance T: O(n) storage, built in O(nlogn) Query: Worst case: Q(n) … sounds bad Refined analysis (output-sensitive) Output k: ReportSubTree O(k) Traverse tree down to m or m’: O(logn) Total: O(logn + k) Fall 2005

2D Kd-tree for 2D range search Kd-tree: special case of BSP Input: [x,x’][y,y’] Output: all points in range Fall 2005

Build kd-tree Break at median n/2 nodes Left (and bottom) child stores the splitting line Fall 2005

Step-by-Step (left subtree) 4 9 1,2,3,4,5 6,7,8,9,10 5 10 2 7 1 8 3 6 Fall 2005

4 9 6,7,8,9,10 5 10 2 1,2,3 4,5 7 1 8 3 6 Fall 2005

4 9 6,7,8,9,10 5 10 2 4,5 7 1 8 3 1,2 3 6 Fall 2005

4 9 6,7,8,9,10 5 10 2 4,5 7 1 8 3 3 6 1 2 Fall 2005

4 9 6,7,8,9,10 5 10 2 7 1 8 3 3 6 4 5 1 2 Fall 2005

Range Search Kd-Tree Idea: Traverse the kd-tree; visit only nodes whose region intersected by query rectangle If region is fully contained, report the subtree If leaf is reached, query the point against the range Fall 2005

Algorithm v lc(v) rc(v) rc(v) v lc(v) Fall 2005

Example l1 l1 l2 l3 l2 l3 Fall 2005

Region Intersection & Containment Each node in kd-tree implies a region in 2D (k-d in general): [xl,xh]×[yl,yh] Each region can be derived from the defining vertex and region of parent Note: the region can be unbounded The query rectangle: [x, x’]×[y, y’] Containment: [xl,xh]  [x, x’]  [yl,yh]  [y, y’] Intersection test can be done in a similar way Fall 2005

Example (-,)×(-,) (-,0]×(-,) 4 3 1 2 1(-4,0) 2(0,3) 3(1,2) 4(3,-3) (-,0]×(-,) 4 3 1 2 Fall 2005

Example (-,)×(-,) (-,0]×(-,) 4 3 (-,0]×(-,0] 1 2 1(-4,0) 2(0,3) 3(1,2) 4(3,-3) (-,0]×(-,) 4 3 (-,0]×(-,0] 1 2 Fall 2005

Example (-,)×(-,) (0,)×(-,) 4 3 1 2 1(-4,0) 2(0,3) 3(1,2) 4(3,-3) (0,)×(-,) 4 3 1 2 Fall 2005

Example (-,)×(-,) (0,)×(-,) (0,)×(-3,) 4 3 1 2 1(-4,0) 2(0,3) 3(1,2) 4(3,-3) (0,)×(-,) (0,)×(-3,) 4 3 1 2 Fall 2005

Homework Research on linear algorithm for median finding. Write a summary. Build a kd-tree of the points on the following page. Do the range query according to the algorithm on p.13 Detail the region of each node and intersection/containment check Fall 2005

Read off coordinate from the sketching layout, e.g., a=(-4,2) b a c f e g h d Read off coordinate from the sketching layout, e.g., a=(-4,2) Query rectangle = [-2,4]×[-1,3] Fall 2005