A k-d tree implementation

https://github.com/travisstaloch/kd-tree

k dimensional trees

API

  • Search for single nearest neighbor
  • Search for k nearest neighbors
  • Search for all neighbors within radius
  • Visit all nodes with user provided context
  • Validate all nodes
2 Likes

stupid question
has it any relation to this?

Not sure. kd trees are good for:

Searches involving a multidimensional search key (e.g. range searches and nearest neighbor searches)

So if that graph db does similar then yes :man_shrugging: . Sorry Iā€™m not familar with that project or graph dbs.

Looks like a neat data structure - Iā€™d like to make a suggestion on presentation.

I recommend updating your README and showing how the tree is used with simple examples. When people are looking for utilities, they often would like to see a snapshot of the code being used.

4 Likes

Neither do I, itā€™s just seems to me there are some similarities in data structuring in both works.

Thanks! I just added a mostly self contained ā€œbasic usageā€ test and pasted it into the readme. Also added a link to src/root.zig where all the tests live and src/main.zig which is a raylib demo vis.

1 Like