ELI5: Explain Like I'm 5

Ball tree

Ball tree is a way of organizing a group of points in space (like stars in the sky or houses in a neighborhood) so that we can quickly find which points are closest to a given point.

Imagine you are playing a treasure hunt game with your friends in a park. You are trying to find a hidden treasure and your friends are scattered throughout the park. You want to find the friend who is closest to the treasure.

The ball tree works kind of like a treasure map. Each friend is represented by a point on the map, and the distance between the points is the distance between the friends in the park.

To make the map, we start by picking one point as the "root" of the tree. This point will be in the center of our map. We then take all the other points and draw a circle around the root point that just touches each point. This circle is called a "ball."

Next, we pick one of the points on the ball to be the next "root" of a new ball. We draw a bigger ball around this point that includes all the points that were previously inside the smaller ball.

We keep repeating this process, always choosing a point on the current ball to be the root of the next ball, until all the points are inside a ball.

Once we have the ball tree, we can use it to find which points are closest to a given point. We start at the root of the tree and move down the tree until we find the ball that contains the point we're looking for. Then we look at the balls closest to this ball until we find the point(s) that are closest to our point of interest.

So, in the treasure hunt example, once we have the ball tree map, we can quickly find which friend is closest to the treasure by starting at the top of the tree and moving down through the balls until we find the ball that contains the treasure.