The cover tree is a type of data structure in computer science that is specifically designed to facilitate the speed-up of a nearest neighbor search. It is a refinement of the Navigating Net data structure, and related to a variety of other data structures developed for indexing intrinsically low-dimensional data.[1]
The tree can be thought of as a hierarchy of levels with the top level containing the root point and the bottom level containing every point in the metric space. Each level C is associated with an integer value i that decrements by one as the tree is descended. Each level C in the cover tree has three important properties:
Ci\subseteqCi-1
p\inCi-1
q\inCi
p
q
2i
q
p
p,q\inCi
p
q
2i
Like other metric trees the cover tree allows for nearest neighbor searches in
O(η*log{n})
η
O(n)
n
η
O(c12log{n})
c
Although cover trees provide faster searches than the naive approach, this advantage must be weighed with the additional cost of maintaining the data structure. In a naive approach adding a new point to the dataset is trivial because order does not need to be preserved, but in a cover tree it can take
O(c6log{n})
The cover tree uses implicit representation to keep track of repeated points. Thus, it only requires O(n) space.