







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Samet; Class: Data Structures; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Study notes
1 / 47
This page cannot be seen from the preview
Don't miss anything!








































nn
Copyright © 1998 Hanan Samet
These notes may not be reproduced by any means (mechanical or elec- tronic or any other) without the express written permission of Hanan Samet
nn
RANKING PROBLEM
Copyright © 1998 by Hanan Samet
nn
SPATIAL DATABASES
whether there are one, two, three, ... (or even more)
Copyright © 1998 by Hanan Samet
nn
ORDERING DATA
Copyright © 1998 by Hanan Samet
nn R-TREES
Objects grouped into hierarchies, stored in another structure such as a B-tree
Object has single bounding rectangle, yet area that it spans may be included in several bounding rectangles
Does not result in disjoint decomposition of space
a
b
c
d
e
f
g
h
i
1 b
except root
Copyright © 1998 by Hanan Samet
nn R-TREES
Objects grouped into hierarchies, stored in another structure such as a B-tree
Object has single bounding rectangle, yet area that it spans may be included in several bounding rectangles
Does not result in disjoint decomposition of space
a
b
c
d
e
f
g
h
i
1 b
except root
Copyright © 1998 by Hanan Samet
(^2) nn r
R
R
R R
R3: a b R4: d g h R5: c i R6: e f Copyright © 1998 by Hanan Samet
nn R-TREES
Objects grouped into hierarchies, stored in another structure such as a B-tree
Object has single bounding rectangle, yet area that it spans may be included in several bounding rectangles
Does not result in disjoint decomposition of space
a
b
c
d
e
f
g
h
i
1 b
except root
Copyright © 1998 by Hanan Samet
(^2) nn r
R
R
R R
R3: a b R4: d g h R5: c i R6: e f Copyright © 1998 by Hanan Samet
(^3) nn z
R3 R4 R5 R
R
R
R1: R2:
Copyright © 1998 by Hanan Samet
(^4) nn g
R0: R1 R
R
Copyright © 1998 by Hanan Samet
nn SEARCHING FOR A POINT OR LINE SEGMENT IN AN R-TREE
1 b
a b d g h c i e f
R1 R
R3 R4 R5 R
a
b
c
d
e
f
g
h
i
R
R R
R2 R
R
Q
May have to examine many nodes since a line segment can be contained in the covering rectangles of many nodes yet its record is contained in only one leaf node (e.g., i in R2, R3, R4, and R5)
Ex: Search for a line segment containing point Q
R3: R4: R5: R6:
R1: R2:
R0:
R
Copyright © 1998 by Hanan Samet
nn SEARCHING FOR A POINT OR LINE SEGMENT IN AN R-TREE
1 b
a b d g h c i e f
R1 R
R3 R4 R5 R
a
b
c
d
e
f
g
h
i
R
R R
R2 R
R
Q
May have to examine many nodes since a line segment can be contained in the covering rectangles of many nodes yet its record is contained in only one leaf node (e.g., i in R2, R3, R4, and R5)
Ex: Search for a line segment containing point Q
R3: R4: R5: R6:
R1: R2:
R0:
R
Copyright © 1998 by Hanan Samet
nn
Q is in R
2 v
Copyright © 1998 by Hanan Samet
nn
Q can be in both R1 and R
3 r
Copyright © 1998 by Hanan Samet
nn SEARCHING FOR A POINT OR LINE SEGMENT IN AN R-TREE
1 b
a b d g h c i e f
R1 R
R3 R4 R5 R
a
b
c
d
e
f
g
h
i
R
R R
R2 R
R
Q
May have to examine many nodes since a line segment can be contained in the covering rectangles of many nodes yet its record is contained in only one leaf node (e.g., i in R2, R3, R4, and R5)
Ex: Search for a line segment containing point Q
R3: R4: R5: R6:
R1: R2:
R0:
R
Copyright © 1998 by Hanan Samet
nn
Q is in R
2 v
Copyright © 1998 by Hanan Samet
nn
Q can be in both R1 and R
3 r
Copyright © 1998 by Hanan Samet
(^4) nn z
Searching R1 first means that R4 is searched but this leads to failure even though Q is part of i which is in R
Copyright © 1998 by Hanan Samet
nn DISJOINT CELLS
Objects decomposed into disjoint subobjects; each subobject in different cell
Drawback: in order to determine area covered by object, must retrieve all cells that it occupies
Techniques differ in degree of regularity
R+-tree (also k-d-B-tree) and cell tree are examples of this technique
a
b
c
d
e
f
g
h
i
1 b
Q
Copyright © 1998 by Hanan Samet
nn DISJOINT CELLS
Objects decomposed into disjoint subobjects; each subobject in different cell
Drawback: in order to determine area covered by object, must retrieve all cells that it occupies
Techniques differ in degree of regularity
R+-tree (also k-d-B-tree) and cell tree are examples of this technique
a
b
c
d
e
f
g
h
i
1 b
Q
Copyright © 1998 by Hanan Samet
(^2) nn r
R R
R
R
R3: d g h R4: c h i R5: c f i R6: a b e i
Copyright © 1998 by Hanan Samet
nn DISJOINT CELLS
Objects decomposed into disjoint subobjects; each subobject in different cell
Drawback: in order to determine area covered by object, must retrieve all cells that it occupies
Techniques differ in degree of regularity
R+-tree (also k-d-B-tree) and cell tree are examples of this technique
a
b
c
d
e
f
g
h
i
1 b
Q
Copyright © 1998 by Hanan Samet
(^2) nn r
R R
R
R
R3: d g h R4: c h i R5: c f i R6: a b e i
Copyright © 1998 by Hanan Samet
(^3) nn z
R3 R4 R5 R
R
R
R1: R2:
Copyright © 1998 by Hanan Samet
(^4) nn g
R0: R1 R
R
Copyright © 1998 by Hanan Samet
nn
UNIFORM GRID
Copyright © 1998 by Hanan Samet