# Difference between revisions of "R* tree"

en>Yobot m (WP:CHECKWIKI error fixes / special characters in sortkey fixed using AWB (9440)) |
en>Magioladitis m (avoid special characters in sortkey) |
||

Line 1: | Line 1: | ||

− | '''R*-trees''' are a variant of [[R-tree]]s used for indexing spatial information. R*-trees | + | '''R*-trees''' are a variant of [[R-tree]]s used for indexing spatial information. R*-trees have slightly higher construction cost than standard R-trees, as the data may need to be reinserted; but the resulting tree will usually have a better query performance. Like the standard R-tree, it can store both point and spatial data. |

It was proposed by Norbert Beckmann, [[Hans-Peter Kriegel]], Ralf Schneider, and Bernhard Seeger in 1990.<ref name="rstar">{{Cite doi | 10.1145.2F93597.98741}}</ref> | It was proposed by Norbert Beckmann, [[Hans-Peter Kriegel]], Ralf Schneider, and Bernhard Seeger in 1990.<ref name="rstar">{{Cite doi | 10.1145.2F93597.98741}}</ref> | ||

Line 48: | Line 48: | ||

==External links== | ==External links== | ||

{{commons category}} | {{commons category}} | ||

− | *[http:// | + | Libraries containing R*-trees: |

− | *[http://www.madalgo.au.dk/tpie | + | *[http://www.boost.org/doc/libs/release/libs/geometry/doc/html/geometry/reference/spatial_indexes/boost__geometry__index__rtree.html Boost.Geometry rtree documentation] (C++, maybe R-tree only) |

− | *[http://www.virtualroadside.com/blog/index.php/2008/10/04/r-tree-implementation-for-cpp/ A header-only C++ R* Tree Implementation] | + | *[http://elki.dbs.ifi.lmu.de/releases/release0.6.0/doc/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rstar/package-summary.html ELKI R*-tree package documentation] (Java) |

− | *[http:// | + | *[http://libspatialindex.github.io/ Spatial Index Library] (C++) |

− | *[http:// | + | *[http://sqlite.org/rtree.html SQLite R*-tree module] (C) |

+ | *[http://www.madalgo.au.dk/tpie TPIE Library] (C++) | ||

+ | *[https://code.google.com/p/xxl/ XXL Library] (Java, maybe R-tree only) | ||

+ | |||

+ | Demonstration and example code: | ||

+ | *[http://www.virtualroadside.com/blog/index.php/2008/10/04/r-tree-implementation-for-cpp/ A header-only C++ R* Tree Implementation] (probably buggy and it does not generate a R*-tree, but a freely defined (by the code author) variation of the original definition) | ||

+ | *[http://www.ics.uci.edu/~salsubai/rstartree.html A 2D R*-tree implementation (C/C++)] | ||

+ | *[http://github.com/davidmoten/rtree rtree] (Java, R-tree and R*-tree. Incomplete: no paged disk backend, no reinsertions) | ||

+ | *[http://donar.umiacs.umd.edu/quadtree/points/rtrees.html R-tree Demo Applet (requires Java)] | ||

{{CS trees}} | {{CS trees}} | ||

{{Data structures}} | {{Data structures}} | ||

− | {{DEFAULTSORT:R | + | {{DEFAULTSORT:R Tree}} |

[[Category:R-tree]] | [[Category:R-tree]] | ||

[[Category:Database index techniques]] | [[Category:Database index techniques]] | ||

[[de:R-Baum]] | [[de:R-Baum]] |

## Latest revision as of 07:25, 6 October 2014

**R*-trees** are a variant of R-trees used for indexing spatial information. R*-trees have slightly higher construction cost than standard R-trees, as the data may need to be reinserted; but the resulting tree will usually have a better query performance. Like the standard R-tree, it can store both point and spatial data.
It was proposed by Norbert Beckmann, Hans-Peter Kriegel, Ralf Schneider, and Bernhard Seeger in 1990.^{[1]}

## Difference between R*-trees and R-trees

Minimization of both coverage and overlap is crucial to the performance of R-trees. Overlap means that, on data query or insertion, more than one branch of the tree needs to be expanded (due to the way data is being split in regions which may overlap). A minimized coverage improves pruning performance, allowing to exclude whole pages from search more often, in particular for negative range queries.

The R*-tree attempts to reduce both, using a combination of a revised node split algorithm and the concept of forced reinsertion at node overflow. This is based on the observation that R-tree structures are highly susceptible to the order in which their entries are inserted, so an insertion-built (rather than bulk-loaded) structure is likely to be sub-optimal. Deletion and reinsertion of entries allows them to "find" a place in the tree that may be more appropriate than their original location.

When a node overflows, a portion of its entries are removed from the node and reinserted into the tree. (In order to avoid an indefinite cascade of reinsertions caused by subsequent node overflow, the reinsertion routine may be called only once in each level of the tree when inserting any one new entry.) This has the effect of producing more well-clustered groups of entries in nodes, reducing node coverage. Furthermore, actual node splits are often postponed, causing average node occupancy to rise. Re-insertion can be seen as a method of incremental tree optimization triggered on node overflow.

## Performance

- Improved split heuristic produces pages that are more rectangular and thus better for many applications.
- Reinsertion method optimizes the existing tree, but increases complexity.
- Efficiently supports point and spatial data at the same time.

{{#invoke: Gallery | gallery}}

## Algorithm and complexity

- The R*-tree uses the same algorithm as the regular R-tree for query and delete operations.
- When inserting, the R*-tree uses a combined strategy. For leaf nodes, overlap is minimized, while for inner nodes, enlargement and area are minimized.
- When splitting, the R*-tree uses a topological split that chooses a split axis based on perimeter, then minimizes overlap.
- In addition to an improved split strategy, the R*-tree also tries to avoid splits by reinserting objects and subtrees into the tree, inspired by the concept of balancing a B-tree.

Obviously, worst case query and delete complexity are thus identical to the R-Tree. The insertion strategy to the R*-tree is with more complex than the linear split strategy () of the R-tree, but less complex than the quadratic split strategy () for a page size of objects and has little impact on the total complexity. The total insert complexity is still comparable to the R-tree: reinsertions affect at most one branch of the tree and thus reinsertions, comparable to performing a split on a regular R-tree. So on overall, the complexity of the R*-tree is the same as that of a regular R-tree.

An implementation of the full algorithm must address many corner cases and tie situations not discussed here.

## References

## External links

Template:Sister Libraries containing R*-trees:

- Boost.Geometry rtree documentation (C++, maybe R-tree only)
- ELKI R*-tree package documentation (Java)
- Spatial Index Library (C++)
- SQLite R*-tree module (C)
- TPIE Library (C++)
- XXL Library (Java, maybe R-tree only)

Demonstration and example code:

- A header-only C++ R* Tree Implementation (probably buggy and it does not generate a R*-tree, but a freely defined (by the code author) variation of the original definition)
- A 2D R*-tree implementation (C/C++)
- rtree (Java, R-tree and R*-tree. Incomplete: no paged disk backend, no reinsertions)
- R-tree Demo Applet (requires Java)