Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion MotionPlanningHigherDimensions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@
"source": [
"#### k-d trees\n",
"\n",
"A *$k$-d tree* data structure is a spatial hierarchy that recursively divides a Cartesian space $\\mathbb{R}^k$ into regions by splitting each region by a hyperplane. *The $k$ here refers to the number of dimensions in the space, not the $k$ in the kNN query. In the following, let us revert back to our original notation where dimensionality is denoted $d$.* Each hyperplane is aligned to one of the $d$ primary axes. An illustration of a k-d tree is shown below.\n",
"A *$k$-d tree* data structure is a spatial hierarchy that recursively divides a Cartesian space $\\mathbb{R}^k$ into regions by splitting each region by a hyperplane. *The $k$ here refers to the number of dimensions in the space, not the $k$ in the kNN query. In the following, let us revert back to our original notation where dimensionality is denoted $d$.* Each hyperplane is aligned to one of the $d$ primary axes. An illustration and explanatory video of a k-d tree is shown below.\n",
"\n",
"***************\n",
"\n",
Expand All @@ -975,6 +975,7 @@
"(a) $k$-d trees recursively divide a space into rectilinear regions. Each leaf of the tree contains a set of points contained in that region. (b) For a nearest-neighbor query (blue point), the leaf containing the point is reached first, and the closest point in the leaf is found (blue circle). This forms an upper bound on the nearest neighbor's distance, and any leaves further than this distance will be pruned. (c) Only one more leaf is visited before the nearest neighbor is found.\n",
"</div>\n",
"\n",
"<video src=\"./animations/media/motion_planning/KDTree.mp4\" width=\"500\" height=\"300\" controls></video>\n",
"***************\n",
"\n",
"More formally, the binary tree $T_{kd}$ is composed of nodes $N$. Each leaf node contains a list of contained points `pts`, and each non-leaf node contains a split dimension `dim` and split value `value`. Non-leaf nodes have exactly two children $C^-$, and $C^+$, and all points $q \\in \\mathbb{R}^d$ such that $q_{dim} < value$ belong to the _negative_ child $C^-$, while points such that $q_{dim} \\geq value$ belong to the _positive_ child $C^+$.\n",
Expand Down
Loading