Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Introduction to Algorithms Quicksort
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.
COSC 6114 Prof. Andy Mirzaian. References: [M. de Berge et al] chapter 5 Applications: Data Base GIS, Graphics: crop-&-zoom, windowing.
1 Theory I Algorithm Design and Analysis (2 - Trees: traversal and analysis of standard search trees) Prof. Th. Ottmann.
Klee’s Measure Problem Computational Geometry, WS 2007/08 Group Work Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
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.
Parallel Prefix Computation Advanced Algorithms & Data Structures Lecture Theme 14 Prof. Dr. Th. Ottmann Summer Semester 2006.
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.
1 Trees. 2 Outline –Tree Structures –Tree Node Level and Path Length –Binary Tree Definition –Binary Tree Nodes –Binary Search Trees.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Persistent Data Structures Computational Geometry, WS 2007/08 Lecture 12 Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
I/O-Algorithms Lars Arge University of Aarhus March 1, 2005.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
1 Geometric Solutions for the IP-Lookup and Packet Classification Problem (Lecture 12: The IP-LookUp & Packet Classification Problem, Part II) Advanced.
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 - Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part II Prof. Dr. Th. Ottmann Summer Semester 2006.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
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.
 This lecture introduces multi-dimensional queries in databases, as well as addresses how we can query and represent multi- dimensional data.
Well Separated Pair Decomposition 16 GigaYears and 3.3 Million Light Years Playing.
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.
Data Structures for Computer Graphics Point Based Representations and Data Structures Lectured by Vlastimil Havran.
Chapter Tow Search Trees BY HUSSEIN SALIM QASIM WESAM HRBI FADHEEL CS 6310 ADVANCE DATA STRUCTURE AND ALGORITHM DR. ELISE DE DONCKER 1.
Trees for spatial data representation and searching
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.
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)
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
Mehdi Mohammadi March Western Michigan University Department of Computer Science CS Advanced Data Structure.
2IL50 Data Structures Fall 2015 Lecture 9: Range Searching.
Orthogonal Range Search
Outline Binary Trees Binary Search Tree Treaps. Binary Trees The empty set (null) is a binary tree A single node is a binary tree A node has a left child.
WEEK 3 Leftist Heaps CE222 Dr. Senem Kumova Metin CE222_Dr. Senem Kumova Metin.
Computational Geometry Piyush Kumar (Lecture 5: Range Searching) Welcome to CIS5930.
B-trees Eduardo Laber David Sotelo. What are B-trees? Balanced search trees designed for secondary storage devices Similar to AVL-trees but better at.
Data Structures and Algorithms in Parallel Computing Lecture 2.
Review for Exam 2 Topics covered (since exam 1): –Splay Tree –K-D Trees –RB Tree –Priority Queue and Binary Heap –B-Tree For each of these data structures.
Multi-dimensional Search Trees CS302 Data Structures Modified from Dr George Bebis.
CIS 068 Welcome to CIS 068 ! Lesson 12: Data Structures 3 Trees.
CMPS 3130/6130 Computational Geometry Spring 2015
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.
Computational Geometry
Geometric Data Structures
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Orthogonal Range Searching and Kd-Trees
Search Sorted Array: Binary Search Linked List: Linear Search
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
Tree Structures for Set of Intervals
Presentation transcript:

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees 2.2-dimensional Range Search : kd-trees 3.2-dimensional Range Search : 2-dim Range Trees 4.Range Search in Higher Dimensions

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 2 Range Trees Two Dimensional Range Search y x Assumption: no two points have the same x or y coordinates

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 3 Canonical subset of a node V V split P(v) = set of points of the subtree with root v.

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 4 Associated tree X Y

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 5 Range tree for a set P 1.The main tree (1st level tree) is a balanced binary search tree T built on the x – coordiante of the points in P. 2.For any internal or leaf node v in T, the canonical subset P(v) is stored in a balanced binary search tree T assoc (v) on the y – coordinate of the points. The node v stores a pointer to the root of T assoc (v) which is called the associated structure of v.

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 6 Constructing range trees V p T (x – sorted) T´(v) (y – sorted) For all nodes in T store entire point information. All nodes y - presorted Build2DRangeTree(P) 1.Construct associated tree T´ for the points in P (based on y-coordinates) 2.If (  P  = 1) then return leaf(P), T´(leaf(P)) else split P into P1, P2 via median x v1 = Build2DRangeTree(P1) v2 = Build2DRangeTree(P2) create node v, store x in v, left-child(v) =v1,right-child(v) = v2 associate T´ with v

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 7 Lemma Statement : A range tree on a set of n points in the plane requires O(n log n) storage. Proof : A point p in P is stored only in the associated structure of nodes on the path in T towards the leaf containing p. Hence, for all nodes at a given depth of T, the point p is stored in exactly one associated structure. We know that 1 – dimensional range trees use linear storage, so associated structures of all nodes at any depth of T together use O(n) storage. The depth of T is O(log n). Hence total amount of storage required is O(n log n).

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 8 Search in 2-dim-range trees Algorithm 2DRangeQuery(T,[x : x´]  [y : y´]) v split = FindSplitNode(T,x,x´) if (leaf(v split ) & v split is in R) then report v, return elsev = left-child(v split ) while not (leaf(v)) do if (x  x v ) then 1DRangeQuery(T assoc ( right-child(v)),[ y : y’]) v = left-child(v) else v = right-child(v) if (v is in R) then report v v = right-child(v split )... Similarly …

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 9 Analysis Lemma: A query with an axis – parallel rectangle in a range tree storing n points takes O(log²n + k) time, where k is the number of reported points. Proof : At each node v in the main tree T we spend constant time to decide where the search path continues and evt. call 1DRangeQuery. The time we spend in this recursive call is O(log n + k v ) where is k v the number of points reported in this call. Hence the total time we spend is Furthermore the search paths of x and x´in the main tree T have length O(log n). Hence we have

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 10 Higher-dimensional range trees Time required for construction: T 2 (n) = O( n log n) T d (n) = O( n log n) + O( log n) * T d-1 (n)  T d (n) = O( n log d-1 n) Time required for range query (without time to report points): Q 2 (n) = O( log 2 n) Q d (n) = O( log n) + O( log n) *Q d-1 (n)  Q d (n) = O( log d n)

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 11 Search in Subsets Given : Two ordered arrays A1 and A2. key(A2)  key(A1) query[x, x´] Search : All elements e in A1 and A2 with x  key(e)  x´. Idea : pointers between A1 and A2 Example query : [20 : 65] Run time : O(log n + k) Run time : O(1 + k)

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 12 Fractional Cascading Idea : P1  P, P2  P

Orthogonal Range Searching 3Computational Geometry Prof. Dr. Th. Ottmann 13 Fractional Cascading x-value y-value Theorem : query time can be reduced to O(log n + k). Proof : In d dimension a saving of one log n factor is possible.