18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Kd-Trees<br />

Next: Numerical Problems Up: Data Structures Previous: Set Data Structures<br />

Kd-Trees<br />

Input description: A set S of n points in k dimensions.<br />

Problem description: Construct a tree that partitions the space by half-planes such that each point is<br />

contained in its own box-shaped region.<br />

Discussion: Although many different flavors of kd-trees have been devised, their purpose is always to<br />

hierarchically decompose space into a relatively small number of cells such that no cell contains too<br />

many input objects. This provides a fast way to access any input object by position. We traverse down<br />

the hierarchy until we find the cell containing the object and then scan through the few objects in the cell<br />

to identify the right one.<br />

Typical algorithms construct kd-trees by partitioning point sets. Each node in the tree is defined by a<br />

plane through one of the dimensions that partitions the set of points into left/right (or up/down) sets, each<br />

with half the points of the parent node. <strong>The</strong>se children are again partitioned into equal halves, using<br />

planes through a different dimension. Partitioning stops after levels, with each point in its own leaf<br />

cell. Alternate kd-tree construction algorithms insert points incrementally and divide the appropriate cell,<br />

although such trees can become seriously unbalanced.<br />

file:///E|/BOOK/BOOK3/NODE134.HTM (1 of 4) [19/1/2003 1:30:12]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!