vp-avl

Crates.iovp-avl
lib.rsvp-avl
version0.1.8
sourcesrc
created_at2024-02-17 17:41:58.018675
updated_at2024-09-30 12:50:04.337508
descriptionA combined Vantage-Point AVL tree, to make VP trees updateable.
homepage
repositoryhttps://github.com/opacous/vp-avl
max_upload_size
id1143365
size43,513
Micah McClimans (hypotrochoid)

documentation

README

VP-AVL

This provides a novel type of VP-tree that also integrates features of an AVL tree, which allows insertion into the tree without complete rebuilding. In practice building the tree in bulk is still faster (empirically by about 40% for a tree with 1000 elements up to about a factor of 2.5 for a tree of 1,000,000), but obviously still much faster than rebuilding the tree upon every insertion.

To bulk insert with the provided Euclidean Metric and some type which implements IntoIterator, simply:

        let random_points = k_random(10000);

        let avl = VpAvl::bulk_insert(EuclideanMetric::default(), random_points);

or iteratively:

        let random_points = k_random(10000);

        let avl = VpAvl::new(EuclideanMetric::default());

        for point in random_points{
            avl.insert(point)
        }

To iterate through the nearest neighbors to a points, call nn_iter:

    let query_point = vec![1.0,1.0,2.0,3.0,5.0];

    for point in avl.nn_iter(&query_point){
        ...
    }
Commit count: 16

cargo fmt