R-Trees - Advanced Data Structures - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Advanced Data Structures which includes Split Algorithm, Unbalanced Binary Search Trees, Forward Pass, Forward Pass Example, Backward Cleanup Pass, Retrace Path, Current Nodes, Roots of Respective Tries, Branch Nodes etc. Key important points are: R-Trees, Dimensional Rectangles, Trivial Rectangle, Non-Rectangular Data, Minimum Bounding Rectangles, Rectangle Collections, Data Nodes, Index Nodes, Parent Node, Possible Partitioning

Typology: Slides

2012/2013

Uploaded on 03/19/2013

dharmakeerti
dharmakeerti 🇮🇳

4.2

(27)

89 documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
R-Trees
Extension of B+-trees.
Collection of d-dimensional rectangles.
A point in d-dimensions is a trivial rectangle.
Non-rectangular Data
Non-rectangular data may be represented by
minimum bounding rectangles (MBRs).
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download R-Trees - Advanced Data Structures - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

R-Trees

  • Extension of B+-trees.

 Collection of d-dimensional rectangles.  A point in d-dimensions is a trivial rectangle.

Non-rectangular Data

• Non-rectangular data may be represented by

minimum bounding rectangles (MBRs).

Operations

• Insert

• Delete

• Find all rectangles that intersect a query

rectangle.

• Good for large rectangle collections stored

on disk.

R-Trees—Structure

• Data nodes (leaves) contain rectangles.

• Index nodes (non-leaves) contain MBRs for

data in subtrees.

• MBR for rectangles or MBRs in a non-root

node is stored in parent node.

Example

• Possible partitioning of our example data

into 12 leaves.

Example

• Possible R-tree of order 4 with 12 leaves.

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

m n o p

Leaves are data nodes that contain 4 input rectangles each.

a-p are MBRs

Example

  • Possible corresponding

grouping.

a

b

c d

m

a b cd e f g h i j k l

m n o p

Example

a

b

c d

m

e n f

  • Possible corresponding

grouping.

a b cd e f g h i j k l

m n o p

Query

  • Start at root and find all MBRs that overlap query.
  • Search corresponding subtrees recursively.

Query

m

n

o p

a

a

a

x

a b cd e f g h i j k l

m n o p

Query

• Search m.

m

n

o p

a

b

c d

a

a

x x

a b cd e f g h i j k l

m n o p

Insert

• Similar to insertion into B+-tree but may

insert into any leaf; leaf splits in case

capacity exceeded.

 Which leaf to insert into?

 How to split a node?

Insert—Leaf Selection

• Insert into n.

n

Insert—Leaf Selection

• Insert into o.

o

Insert—Leaf Selection

• Insert into p.

p

Insert—Split A Node

  • Split set of M+1 rectangles/MBRs into 2 sets A

and B.

 A and B each have at least m rectangles/MBRs.  Sum of areas of MBRs of A and B is minimum.

M = 8, m = 4

Insert—Split A Node

  • Exhaustive search for best A and B.

 Compute area(MBR(A)) + area(MBR(B)) for each possible A.  Note—for each A, the B is unique.  Select partition that minimizes this sum.

  • When |A| = m = ceil(M/2), number of choices for

A is

(M+1)!

m!(M+1-m)!

Impractical for large M.

Insert—Split A Node

• Grow A and B using a clustering strategy.

 Start with a seed rectangle a for A and b for B.

 Grow A and B one rectangle at a time.

 Stop when the M+1 rectangles have been

partitioned into A and B.

Insert—Split A Node

• Quadratic Method—seed selection.

 Let S be the set of M+1 rectangles to be

partitioned.

 Find a and b in S that maximize

area(MBR(a,b)) – area(a) – area(b) M = 8, m = 4

Insert—Split A Node

• Quadratic Method—seed selection.

 Let S be the set of M+1 rectangles to be

partitioned.

 Find a and b in S that maximize

area(MBR(a,b)) – area(a) – area(b) M = 8, m = 4

Insert—Split A Node

• Quadratic Method—assign remaining

rectangles/MBRs.

 Assign c to partition whose area increases least.

M = 8, m = 4

Insert—Split A Node

  • Quadratic Method—assign remaining

rectangles/MBRs.

 Continue assigning in this way until all remaining rectangles must necessarily be assigned to one of the two partitions for that partition to have m rectangles.

M = 8, m = 4

Insert—Split A Node

• Linear Method—seed selection.

 Choose a and b to have maximum normalized

separation.

M = 8, m = 4

Insert—Split A Node

• Linear Method—seed selection.

 Choose a and b to have maximum normalized

separation.

M = 8, m = 4

Separation in x- dimension

Insert—Split A Node

• Linear Method—seed selection.

 Choose a and b to have maximum normalized

separation.

M = 8, m = 4

Separation in y- dimension

Insert—Split A Node

• Linear Method—seed selection.

 Choose a and b to have maximum normalized

separation.

M = 8, m = 4

Rectangles with max y-separation

Insert—Split A Node

• Linear Method—seed selection.

 Choose a and b to have maximum normalized

separation.

M = 8, m = 4

Divide by y-width to normalize

Insert—Split A Node

  • Linear Method—assign remainder.

 Assign remaining rectangles in random order.  Rectangle is assigned to partition whose MBR area increases least.  Stop when all remaining rectangles must be assigned to one of the partitions so that the partition has its minimum required m rectangles. M = 8, m = 4