R-trees A Programmers Introduction Kent Williams-King - - PowerPoint PPT Presentation
R-trees A Programmers Introduction Kent Williams-King - - PowerPoint PPT Presentation
R-trees A Programmers Introduction Kent Williams-King kawillia@ucalgary.ca March 1, 2011 Introduction 1 What is an R-tree? 2 What are R-trees useful for? Kent Williams-King R-trees Properties 1 Balancing Root node 1 Leaf nodes 2
Introduction
1 What is an R-tree? 2 What are R-trees useful for? Kent Williams-King R-trees
Properties
1 Balancing 1
Root node
2
Leaf nodes
3
Internal nodes
2 Tightness 1
Leaf nodes
2
Internal nodes
3 Leaf depth equality Kent Williams-King R-trees
Tree depth
The branching factor of each level of an R-tree is at least m, and at most M, so: ⌈logm N⌉ − 1 ≤ depth ≤ ⌈logM N⌉ − 1 So: N m M Bound (inclusive) 4 1 2 1-3 4 2 4 0-1 32 4 8 1-2 25,000 15 50 2-3 25,000 2 15 3-4 100,000 2 4 8-16
1 Tree depth is low: why are lookups remotely expensive? Kent Williams-King R-trees
Algorithms
1 Search 2 Insert 1
AdjustTree
3 Delete 1
CondenseTree
4 SplitNode Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R1 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R1 R2 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R1 R2 R3 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R4 R2 R3 R1 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R4 R2 R3 R1 R5 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R4 R2 R6 R1 R5 R3 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R7 R4 R6 R2 R3 R1 R5 Kent Williams-King R-trees
R-tree example (m = 1, M = 3)
R7 R4 R8 R6 R2 R3 R1 R5 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
‘
Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R1 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R1 R2 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R1 R2 R3 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R1 R2 R3 R4 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R4 R3 R2 R5 R1 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R4 R3 R6 R2 R5 R1 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R4 R3 R6 R2 R5 R1 R7 Kent Williams-King R-trees
R-tree example (m = 2, M = 4)
R4 R3 R6 R5 R1 R8 R2 R7 Kent Williams-King R-trees