Skip to content

LaXiS96/VantagePointTree

Repository files navigation

VantagePointTree

C# implementation of a vantage-point tree, a binary tree data structure for fast nearest-neighbor search in metric spaces (sets where the metric is the distance between points).

Details

This implementation is mostly educational, as can be seen by all the explanatory comments spread around the code. No guarantees are given.

The solution includes:

  • .NET Standard 2.0 class library implementation (VantagePointTree)
  • xUnit.net testing project (VantagePointTree.Tests)
  • .NET Core 3.1 example program (VantagePointTree.Examples)

The VantagePointTree class expects a DistanceFunction delegate which calculates the distance between two T points.

Features

  • Build tree from a list of items
  • Search tree for k nearest neighbors

TODO (by priority)

  1. Item insertion and removal (plus tree balancing if needed)
  2. Search by max distance
  3. Save and load to/from file
  • Optimization (not a priority)

References and inspirations

About

C# implementation of a vantage-point tree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages