Adding an element to a VP tree (VP tree maintenance)

450 views Asked by At

I have read few sources on VP-tree for similarity knn. No one wrote about adding an element to exists tree, which is required for maintenance. Explanation of adding element will be just great.

1

There are 1 answers

0
gsamaras On
add

public boolean add(E point)

Adds a single point to this vp-tree. Addition of a point executes in O(log n) time in the best case (where n is the number of points in the tree), but may also trigger a node partition that takes additional time.

Specified by:
    add in interface Collection<E extends GeospatialPoint>
Parameters:
    point - the point to add to this tree
Returns:
    true if the tree was modified by the addition of this point; vp-trees are always modified by adding points, so this method always returns true

addAll

public boolean addAll(Collection<? extends E> points)

Adds all of the points in the given collection to this vp-tree.

Specified by:
    addAll in interface Collection<E extends GeospatialPoint>
Parameters:
    points - the points to add to this tree
Returns:
    true if the tree was modified by the addition of the points; vp-trees are always modified by adding points, so this method always returns true

The interface comes from VPTree (jeospatial).

So, the best you could do is to contact the authors and/or search for the algorithm somewhere here.


You understand I hope that this is too broad for SO, thus the answer is mostly a linked-one.