Safekipedia

R*-tree

Discoverer · ages 10+Adapted from Wikipedia
R*-Tree built by repeated insertion (in ELKI). There is little overlap in this tree, resulting in good query performance. Red and blue MBRs are index pages, green MBRs are leaf nodes.

In data processing, R*-trees are a version of R-trees used for indexing spatial information. Indexing spatial information means organizing data about locations and shapes so that it can be searched quickly.

Building an R*-tree costs slightly more than building a standard R-tree, because data may need to be reinserted. However, the finished tree will usually have better query performance, which means it is often faster to search.

Like the standard R-tree, an R*-tree can store both point data and spatial data.

The R*-tree was proposed in 1990 by Norbert Beckmann, Hans-Peter Kriegel, Ralf Schneider, and Bernhard Seeger.

Difference between R*-trees and R-trees

R*-Tree built by repeated insertion (in ELKI). There is little overlap in this tree, resulting in good query performance. Red and blue MBRs are index pages, green MBRs are leaf nodes.

R-trees work best when their groups of data overlap less and cover less space. The R*-tree tries to reduce both. It does this by splitting groups in a revised way and by sometimes taking items out of a full group and placing them back into the tree. This matters because R-tree structures depend a lot on the order in which items are added, so a tree built one item at a time is likely not the best. Removing and reinserting items lets them find a better place in the tree.

When a group becomes too full, some of its items are removed and put back into the tree. This creates tidier groups that take up less space. Splitting groups is often delayed, so each group holds more items on average. The R*-tree also measures how good a split is using three values: overlap, the total area of the boxes, and margin, the total of their edges.

Performance

The R*-tree has a few strengths. Its improved way of splitting data creates pages that are more rectangular, which works well for many uses. Its reinsertion method improves the existing tree, but it makes the tree more complicated. It can also handle point and spatial data at the same time.

Effect of different splitting heuristics on a database with Germany postal districts

R-Tree with Guttman quadratic split.There are many pages that extend from east to west all over Germany, and pages overlap a lot. This is not beneficial for most applications, that often only need a small rectangular area that intersects with many slices.

Algorithm and complexity

The R*-tree uses the same method as the regular R-tree for searching and deleting. When adding new data, it uses a mix of rules. For leaf nodes, it tries to keep the areas that overlap as small as possible. For inner nodes, it tries to keep growth and size small. When a node is split, it picks a direction based on the edge length of the shape, then tries to reduce overlap. It also tries to avoid splits by reinserting some objects and subtrees, an idea inspired by how a B-tree is kept balanced.

Searching and deleting take the same amount of work as in a regular R-tree. Adding data takes a little more work than the simpler split method of the R-tree, but this has little effect on the total. Overall, the R*-tree works about as efficiently as a regular R-tree. Building a full version of the algorithm also requires handling many special cases that are not covered here.

Quiz time!

5 questions about R*-tree

Question 1 of 5

What does 'indexing spatial information' mean?

This article is a child-friendly adaptation of the Wikipedia article on R*-tree, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.