1 / 16

The Quad tree

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. The kd-tree. A binary tree

tyson
Download Presentation

The Quad tree

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 X=x1 Y=y1 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. X=01, Y=11 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 141 143 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 010 001 000 110 111 101

  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 <= qx <= cx+dx, • & cy-dy <= qy <= cy+dy

  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

More Related