All examples By author By category About

ludwigschubert

kD-tree explorations in D3.js

K-d Tree Exploration

K-d trees are space-partitioning data structures for organizing points in k-dimensional space. They are a useful data structure for finding, for example, the n nearest neighbors of a point in k-dimensional space.

This block provides a visualization of k-d tree creation which connects the intuition of binary trees with the concept of space partitioning.

Operation

Click on the left square to add points in a 2D projection of RGB space. After adding multiple points, click "Rebalance" on the right square to see how a newly constructed k-D tree would sort the given points.

Additional reading

http://pointclouds.org/documentation/tutorials/kdtree_search.php https://en.wikipedia.org/wiki/K-d_tree