R-tree Demo


The R-tree [Gutt84] is an object hierarchy which is applicable to arbitrary spatial objects which is formed by aggregating their minimum bounding boxes and storing the aggregates in a tree structure. The aggregation is based, in part, on proximity of the objects or bounding boxes. The number of objects or bounding boxes that are aggregated in each node is permitted to range between m <= ceil(M /2) and M , thereby leading us to use the prefix (m,M) to characterize a particular R-tree and mirroring the effect of a B-tree. The root node in an R-tree has at least two entries unless it is a leaf node in which case it has just one entry corresponding to the bounding box of an object.

The R-tree can be constructed in either a dynamic or a static manner. The dynamic methods build the R-tree as the objects are encountered while the static methods wait until all the objects have been input before building the tree. The results of the static methods are usually characterized as being packed since knowing all of the data in advance permits each R-tree node to be filled to its capacity.

There are two principal methods of determining how to fill each R-tree node. The most natural method is to take the space occupied by the objects into account when deciding which ones to aggregate. An alternative is to order the objects prior to performing the aggregation. However, in this case, once an order has been established, there isn't really a choice as to which objects (or bounding boxes) are being aggregated. The most obvious order, although not particularly interesting or useful, is one that preserves the order in which the objects were initially encountered (i.e., objects in aggregate i have been encountered before those in aggregate i+1 ). We do not use this technique in our applet.

In this applet, all objects are assumed to be rectangles. There are many R-tree variants. They differ on whether the structure is built in a static or dynamic manner. In all cases, in our applet, the R-tree is built as the data is encountered. The difference between the static and dynamic methods is that the static methods rebuild the entire R-tree as each new object is added. In contrast, the dynamic methods add the new objects to the existing R-tree.

The dynamic methods differ in the techniques used to split an overflowing node during insertion. There are two types of dynamic methods. The first type has the goal of minimizing coverage and overlap. These goals are at times contradictory and thus heuristics are often used. The second type makes use of the ordering applied to the objects (actually their bounding boxes) using their centroids in our examples. They are termed nonpacked . In this case, the result is equivalent to a B+-tree and all update algorithms are B+-tree algorithms. These update algorithms do not make use of the spatial extent of the bounding boxes to determine how to split a node. Thus the goals of minimizing overlap or coverage are not part of the node splitting process although this does not preclude these methods from having good behavior with respect to these goals.

Users have the option of trying a number of different node splitting algorithms that include:

  1. Dynamic methods based on minimizing coverage and/or overlap
    1. Exhaustive search
    2. Quadratic method
    3. Linear method
    4. R*-tree
    5. Ang/Tan method
  2. Dynamic methods based on an ordering (nonpacked)
    1. Hilbert nonpacked
    2. Morton nonpacked
  3. Static methods based on an ordering
    1. Packed
    2. Hilbert packed
    3. Morton packed
The static methods differ on the basis of the method used to order the objects. The dynamic methods that are not based on an ordering (i.e., reduction of coverage and overlap) range from being quite simple (e.g.,exhaustive search) to being fairly complicated (e.g., R*-tree [Beck90c]). Some just split the overflowing node, while others (i.e., the R*-tree) try to reinsert some of the objects and nodes from the overflowing nodes thereby striving for better overall behavior (e.g., reduction in coverage and overlap). For more details on the general topic of R-trees, see pages 270-303 and 790-794 of Samet, Foundations of Multidimensional and Metric Data Structures

Instructions

In Insert mode, click and drag the mouse to specify a new rectangle.

In Delete mode, delete the rectangle containing the mouse at position p . If p is in more than one rectangle, then delete the containing rectangle whose boundary is the closest (note that the rectangle r being deleted is not necessarily the rectangle t whose boundary is closest to p ). If p is not inside any rectangle, then delete the rectangle nearest to p . The deletion occurs when the mouse is clicked. As the mouse is moved, the rectangle that will be deleted is shown in orange.

In Window mode, click and drag the mouse to specify a rectangular query rectangle. There are three options, which may be combined via an 'OR', to indicate which rectangles are retrieved as satisfying the query:

  1. The entire rectangle is in the query window.
  2. The entire rectangle contains the query window.
  3. At least some part of the rectangle boundary intersects (i.e,, crosses) the boundary of the window.
The rectangles that have been retrieved are shown in blue.

In Nearest mode, click to specify the query point p . All rectangles are returned in the order of the distance from p .