O RTHOGONAL R ANGE S EARCHING الهه اسلامی فروردین 92, 1.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

WSPD Applications.
Nearest Neighbor Search
INTERVAL TREE & SEGMENTATION TREE
Cutting trees and the cutting lemma Presented by Amir Mograbi.
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.
COSC 6114 Prof. Andy Mirzaian. References: [M. de Berge et al] chapter 5 Applications: Data Base GIS, Graphics: crop-&-zoom, windowing.
Multidimensional Indexing
Searching on Multi-Dimensional Data
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.
2-dimensional indexing structure
I/O-Algorithms Lars Arge Aarhus University February 27, 2007.
Multiple-key indexes Index on one attribute provides pointer to an index on the other. If V is a value of the first attribute, then the index we reach.
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.
C++ Programming:. Program Design Including
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.
I/O-Algorithms Lars Arge Aarhus University March 5, 2008.
Rooted Trees. More definitions parent of d child of c sibling of d ancestor of d descendants of g leaf internal vertex subtree root.
1 Geometric index structures April 15, 2004 Based on GUW Chapter , [Arge01] Sections 1, 2.1 (persistent B- trees), 3-4 (static versions.
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.
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
CSC 2300 Data Structures & Algorithms February 16, 2007 Chapter 4. Trees.
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.
Multimedia Databases Chapter 4.
Efficient Partition Trees Jiri Matousek Presented By Benny Schlesinger Omer Tavori 1.
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.
Randomized Algorithms - Treaps
Data Structures for Computer Graphics Point Based Representations and Data Structures Lectured by Vlastimil Havran.
Trees for spatial data representation and searching
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)
Multidimensional Indexes Applications: geographical databases, data cubes. Types of queries: –partial match (give only a subset of the dimensions) –range.
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.
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.
Segment Trees Basic data structure in computational geometry. Computational geometry.  Computations with geometric objects.  Points in 1-, 2-, 3-, d-space.
CMSC 341 K-D Trees. 8/3/2007 UMBC CSMC 341 KDTrees 2 K-D Tree Introduction  Multiple dimensional data Range queries in databases of multiple keys: Ex.
Multi-dimensional Search Trees CS302 Data Structures Modified from Dr George Bebis.
CMPS 3130/6130 Computational Geometry Spring 2015
Multidimensional Access Structures COMP3017 Advanced Databases Dr Nicholas Gibbins –
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.
Geometric Data Structures
Multidimensional Access Structures
CMPS 3130/6130 Computational Geometry Spring 2017
Binary search tree. Removing a node
Multidimensional Range Search
KD Tree A binary search tree where every node is a
Orthogonal Range Searching and Kd-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
Lecture 36 Section 12.2 Mon, Apr 23, 2007
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
CMSC 341 K-D Trees.
CMSC 341 K-D Trees.
Presentation transcript:

O RTHOGONAL R ANGE S EARCHING الهه اسلامی فروردین 92, 1

Motivation Many types of questions - queries - about data in a database can be interpreted geometrically To this end we transform records in a database into points in a multi-dimensional space, and we transform the queries about the records into queries on this set of points 2

Example Database for personnel administration In such database the name, address, date of birth, salary, and so on, of each employee are stored A typical query one may want to performe is to report all employees born between 1950 and 1955 who earn between $3,000 and $4,000 a month To formulate this as a geometric problem we represent each employee by a point in the plane The first coordinate of the point is the date of birth, represented by the integer the second coordinate is the monthly salary With the point we store the other information 3

Interpreting a database query gmetrically 4

Other Query If we have information about the number of children,to ask queries like“ report all employees born between 1950 and 1955 who earn between $3,000 and $4,000 a month and have between two and four children “ Represent each employee by a point in 3-dimensional space. The first coordinate represents the date of birth, the second coordinate the salary, the third coordinate the number of children 5

I nterpreting of query Such a query is called a rectangular range query or an orthogonal range query 6

1-Dimensional Range Searching is set of point on the rial line Data structure : a balanced binary search tree Leaves store a point internal nodes store splitting values to guide the search Denote the splitting value stored at a node by 7

1-Dimensional Range Searching To report the points in a query range : Search with and in and be the two leaves where the search end, respectively point in the interval are the onse stored in the leaves in between and plus, possibly the point store at and 8

A 1-dimensional range query in a binary search tree search with the interval 9

1-Dimensional Range Searching How can we find the leaves in between and ? They are the leaves of certain subtrees in between the search paths to and The subtrees that we select are rooted at nodes ν in between the two search paths whose parents are on the search path To find these nodes : search for the node where the paths to and split and denote the left and right child of 10

Find split node 11

The selected subtree 12

The selected subtree 13

Prove Correctness Of The Algorithm lemma 5.1 Algorithm 1DRANGEQUERY reports exactly those point that lie in the query range proof Any reported point lies in the query range Any point in the range is reported 14

v p x 15

v v x p q µ µ’ v x p µ 16

Summarizes the results for 1-dimensional range searching Theorem 5.2 Let be a set of n point in 1-dimensional space. The set can be stored in a balanced binery search tree, which uses storage and has construction time, such that the pionts a query range can be reported in time, where is the number of reported points. 17

Kd-Trees 2-dimensional rectangular range searching problem In this section we assume that no two points in p have the same x-coordinate, and no two points have the same y- coordinate A 2-dimensional rectangular range query on p asks for the point from p lying inside a query rectangle A point lise inside this rectangle if and only if 18

Kd-Trees How can we generalize structure for 1-dimensional ? First split on x-coordinate, next on y-coordinate, then again on x-coordinate, and so on The splitting line is stored at the root the subset of point to the left or on the slitting line, is stored in the left subtree, and, the subset to the right of it,is stored in the right subtree 19

A kd-tree A tree like this is called a kd -tree 20

Construct a kd-tree 21

Sorted list x-coordinate Sorted list y-coordinate

Storage And Building Time A kd-tree which solves to О (nlogn) lemma 5.3 A kd-tree for a set of points uses О (n) storage and can be constructed in О (nlogn) time The buiding time T(n) : 23

Corresponding Between Nodes In A KD-tree And Regions In The Plane The region corresponding to a node ν is a rectangle It is bounded by spliting lines stored at ancestors of ν which denote by We have to search the subtree rooted at ν only if the query rectangle intersects 24

Corresponding Between Nodes In A KD-tree And Regions In The Plane 25

A query on a kd-tree 26

27

28

29

30

31

32

33

 34