36
WELCOME

R-trees (data structure)

Embed Size (px)

Citation preview

Page 1: R-trees (data structure)

WELCOME

Page 2: R-trees (data structure)

R-TREES By:

Mahe Samrin FirdousM.E Software Engineering(1st Sem)

Page 3: R-trees (data structure)

“A Dynamic Index Structure For Spatial Searching”.

The B-Tree provided a foundation for R-Trees

Region-Trees (R-Trees)

What are R-Trees?

Page 4: R-trees (data structure)

What we mean by Spatial Data?

Page 5: R-trees (data structure)

R1

R2

R1 R2

R3 R4 R5

R3R4

R5

R6

R7

R6 R7

R8

R9

R10

R8 R9 R10

R13R14

R13 R14

R15R16

R15 R16

Page 6: R-trees (data structure)

Why do we need R-Trees?

B-Trees cannot store new types of data

Specifically people wanted to store geometrical data and multi-dimensional data

The R-Tree provided a way to do that (thanks to Antonin Guttman ‘84)

Allows Overlapping.

Page 7: R-trees (data structure)

Properties of R-Trees

R-Trees can organize any-dimensional data by representing the data by a minimum bounding region(MBR).

Each node bounds it’s children. The leaves point to the actual objects

(stored on disk pages) The height is always log n. It is height

balanced. Root has at least two children

Page 8: R-trees (data structure)

R-Tree of Order 4

Page 9: R-trees (data structure)

R-Tree of Order 4

Page 10: R-trees (data structure)

Example

a

b

cd

m

a b c d e f g h i j k l

m n o p

Page 11: R-trees (data structure)

a

b

cd

me fn

Examplea b c d e f g h i j k l

m n o p

Page 12: R-trees (data structure)

a

b

cd

me fn

h

g

i

o p

Examplea b c d e f g h i j k l

m n o p

j

kl

Page 13: R-trees (data structure)

R-Trees: OperationsInserts

Deletes

Search

Queries/Searches Names of all the roads in 1 sq km area?Which buildings would be encountered between JU

1st Campus and JU 2nd Campus? Give me all rectangles that are contained in the

input rectangle.Give me all rectangles intersecting this rectangle.

Page 14: R-trees (data structure)

Insert.

• Similar to insertion into B+-tree but may insert into any leaf; leaf splits in case capacity exceeded.

–Which leaf to insert into? (Choose Leaf)–How to split a node? (Node Split)

Page 15: R-trees (data structure)

mn

o p

Insert: Choose Leaf

Page 16: R-trees (data structure)

mn

o

Insert: Choose Leaf

Page 17: R-trees (data structure)

17

Node Splitting

ab

c

d

ab

c

d

Bad split

Good split

Page 18: R-trees (data structure)

Example:INSERTION

Page 19: R-trees (data structure)

Example:INSERTION

Page 20: R-trees (data structure)

Example:INSERTION

Page 21: R-trees (data structure)

Delete

• Search for the rectangle• If the rectangle is found, remove it.• Adjust the rectangles making them

smaller.• If the node is too empty (deficient): • delete the node recursively at its parent • insert all entries of the deleted node into the R-tree

Re-use of INSERT routine Incrementally refines spatial structure

Page 22: R-trees (data structure)

SEARCH

Similar to B-tree searchQuite easy & straight forward (Traverse the whole tree starting at the root node)No guarantee on good worst-case performance! (Possible overlapping of rectangles of entries within a single node!). Again, dependent on geometries.

Average case-O(logMn)

Page 23: R-trees (data structure)

R-TREE VARIATIONS

• R+ trees differ from R trees in that:– No overlapping– An object ID may be stored in more than one leaf node.

• Advantages– Search is easier.– A fewer nodes are visited than with the R-tree.

• Disadvantages– Since rectangles are duplicated, it is larger than R tree.– Construction & maintenance is more complex.

R-Tree MBRs

R+-Tree MBRs

R+-TREE:

Page 24: R-trees (data structure)

Applications of R-Trees

Page 25: R-trees (data structure)

• Data objects in the map are represented by the Minimum Bounding Rectangles (MBRs)

R-TREE in MAPS:

Page 26: R-trees (data structure)

VLSI DesignThe initial application that motivated Guttman to his pioneering research was VLSI design (i.e., how to efficiently answer whether a space is already covered by a chip or not).

A VLSI integrated-circuit

Page 27: R-trees (data structure)

Image Replica Detection The system extracts robust features from images. These features are used for indexing the images in a database using an R-tree. When a query is made about whether a test image is a replica of an image in the database, then the R-tree is traversed.

Original Fingerprint image (left side) and a fake finger (right side), almost indistinguishable.

Page 28: R-trees (data structure)

Template of the pores and search along ridges.

Fingerprint image (a) where pores can be easily noticed as small “holes” along ridges flow (as evident in the zoom (b)).

(a)

Image Replica Detection (b)

Page 29: R-trees (data structure)

Astronomical Data Indexing In astronomical data collections, there are many data that can be thought of as points in a multi-dimensional space and are then suitable to be indexed using R-trees .Coordinates on the sky can be (and often are) represented in a database as ordered couples of longitude and latitude.

Page 30: R-trees (data structure)

R-Trees in Road MapA common example of spatial data can be seen in a road map. Spatial data lets you use R-tree indexing .A road map is a two-dimensional object that contains points, lines, and polygons that can represent cities, roads, and political boundaries such as states or provinces.

Page 31: R-trees (data structure)

Commercial uses of R-Trees

Page 32: R-trees (data structure)

Biometric Attendance Machine Supplier: Divya, Affinis Technosoft, Excellex, JB Systems, Sterling Securities, Dotway Technologies, Sofgen India ,etc

Page 33: R-trees (data structure)

Virtual Sky Application Virtual Sky Astronomy for iPad, iPhones on the App Store.

Page 34: R-trees (data structure)

In many scientific applications such as Earth Observation System (EOSDIS) it is a daunting task to index ever increasing volume of complex data that are continuously added to databases. To efficiently manage multidimensional data in scientific and data warehousing environments, R-tree based index structures have been widely used

NASA’s earth observing mission

Page 35: R-trees (data structure)

thank you!!!

Page 36: R-trees (data structure)

Any questions?

??