The Quad tree - PowerPoint PPT Presentation

About This Presentation
Title:

The Quad tree

Description:

The Quad tree. The index is represented as a quaternary tree ... At each node, a dimension is selected to partition the space into two ... – PowerPoint PPT presentation

Number of Views:794
Avg rating:3.0/5.0
Slides: 17
Provided by: RaghuRama84
Category:
Tags: quad | tree

less

Transcript and Presenter's Notes

Title: The Quad tree


1
The Quad tree
  • The index is represented as a quaternary tree
  • Each internal node has four children, one per
    quadrant
  • NW, NE, SW, SE
  • Each leaf is associated a disk page, which stores
    the index entries

2
The kd-tree
  • A binary tree
  • At each node, a dimension is selected to
    partition the space into two
  • Disk-based variants KDB-tree, skd

x1
Xx1
Yy1
y1
y2
3
Mapping -- Indexing using PAMs
  • Map the MBR in 2-d into a point in 4-d
  • (x1, x2), (y1, y2) ? (x1, x2, y1, y2)
  • Transform the query into the new space
  • Use a 4-d PAM to answer queries.

b
Q
Q
a
a
b
4
Space Filling Curves
  • Assumption att. values can be represented with
    some fixed of bits
  • Space domain on each dimension 2k values
  • Linearize the doman
  • Each point can be represented by a single
    dimensional value

5
Z-ordering
11
10
01
00
00
01
10
11
6
Z-ordering
  • The z-value is obtained by interleaving the bits.
  • Eg. X01, Y11
  • z-value 0111 7
  • Clustering effect on X-Y and z-values can be
    indexed using B-trees
  • Range queries problematic?

7
Z-ordering Locational Keys
11
142
144
120
140
10
143
141
100
01
110
130
00
00
01
10
11
120 140
011 110
8
Hilbert Curve
111
110
101
100
011
010
001
000
100
011
001
010
000
101
110
111
9
Grid Files
  • Based on extendible hashing
  • Design principle any point query can be answered
    in at most 2 disk accesses.
  • Two structures k-dimensional array and k
    1-dimensional array

10
Grid Files
11
Scales, Directory, Bucket
  • Data structures
  • Linear scales
  • directory an array whose elements are one-to-one
    correspondence with the grid cells each entry
    points to a data bucket
  • data buckets

12
Splitting and Merging
13
Splitting and Merging
14
Grid Files
  • One page is associated with each cell
  • When a cell overflows, it is split into two cells
    and the points are assigned to the new cell
  • Two adjacent cells (buddies) can reference the
    same page

15
Grid Files...
  • Repetitive splitting by halving
  • Merging based on buddy system
  • Regions are represented as (cx, cy, dx, dy)
  • point queries cx-dx lt qx lt cxdx,
  • cy-dy lt qy lt cydy

16
Grid Files...
dx
cy
E
A
D
F
E
F
B
C
D
B
cx
qx
dy
A
C
B
D
cx
C
E
A
F
cy
qy
Write a Comment
User Comments (0)
About PowerShow.com