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).
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.
- Build tree from a list of items
- Search tree for k nearest neighbors
- Item insertion and removal (plus tree balancing if needed)
- Search by max distance
- Save and load to/from file
- Optimization (not a priority)