Compressed cover tree

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Multiple issues The compressed cover tree is a type of data structure in computer science that is specifically designed to facilitate the speed-up of a k-nearest neighbors algorithm in finite metric spaces.[1] Compressed cover tree is a simplified version of explicit representation of cover tree that was motivated by past issues in proofs of time complexity results[2] of cover tree. The compressed cover tree was specifically designed to achieve claimed time complexities of cover tree[3] in a mathematically rigorous way.

Problem statement

In the modern formulation, the k-nearest neighbor problem is to find all k1 nearest neighbors in a given reference set R for all points from another given query set Q. Both sets belong to a common ambient space X with a distance metric d satisfying all metric axioms.

Definitions

Compressed cover tree

Let (R,d) be a finite metric space. A compressed cover tree 𝒯(R) has the vertex set R with a root rR and a level function l:R satisfying the conditions below:

  • Root condition: the level of the root node r satisfies l(r)1+max\limits pR{r}l(p)
  • Covering condition: For every node qR{r}, we select a unique parent p and a level l(q) such that d(q,p)2l(q)+1 and l(q)<l(p) this parent node pp has a single link to its child node q.
  • Separation condition: For i, the cover set Ci={pRl(p)i} has dmin(Ci)=min\limits pCimin\limits qCi{p}d(p,q)>2i

Expansion constants

In a metric space, let B¯(p,t) be the closed ball with a center p and a radius t0. The notation |B¯(p,t)| denotes the number (if finite) of points in the closed ball.

The expansion constant[3] c(R) is the smallest c(R)2 such that |B¯(p,2t)|c(R)|B¯(p,t)| for any point pR and t0.

the new minimized expansion constant[1] cm is a discrete analog of the doubling dimension Navigating nets[4] cm(R)=lim\limits ξ0+inf\limits RAXsup\limits pA,t>ξ|B¯(p,2t)A||B¯(p,t)A|, where A is a locally finite set which covers R.

Note that cm(R)c(R) for any finite metric space (R,d).

Aspect ratio

For any finite set R with a metric d, the diameter is diam(R)=maxpRmaxqRd(p,q). The aspect ratio is Δ(R)=diam(R)dmin(R), where dmin(R) is the shortest distance between points of R.

Complexity

Insert

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 compressed cover tree it can be bounded:

  • using expansion constant: O(c(R)10log|R|).
  • using minimized expansion constant / doubling dimension O(cm(R)8logΔ(|R|)).

Let Q and R be finite subsets of a metric space (X,d). Once all points of R are inserted into a compressed cover tree 𝒯(R) it can be used for find-queries of the query point set Q. The following time complexities have been proven for finding the k-nearest neighbor of a query point qQ in the reference set R:

  • using expansion constant: O(c(R{q})2log2(k)((cm(R))10log2(|R|)+c(R{q})k))..
  • using minimized expansion constant / doubling dimension O((cm(R))10log2(k)log2(Δ(R))+|B¯(q,5dk(q,R))|log2(k)), where |B¯(q,5dk(q,R))| is a number of points inside a closed ball around q having a radius 5 times the distance of q to its k-nearest neighbor.

Space

The compressed cover tree constructed on finite metric space R requires O(|R|) space, during the construction and during the execution of the Find algorithm.

Compared to other similar data structures

Using doubling dimension as hidden factor

Tables below show time complexity estimates which use minimized expansion constant cm(R) or dimensionality constant 2dim [4] related to doubling dimension. Note that Δ denotes the aspect ratio.

Results for building data structures
Name of datastructure, source

Claimed time complexity Claimed space complexity Proof of result
Navigating nets[4] O(2O(dim)|R|log(Δ(R))log(log((Δ(R)))) O(2O(dim)|R|) Theorem 2.5[4]
Compressed cover tree[1] O(c(R{q})O(1)log(k)(log(|R|)+k)) O(|R|) Theorem 3.6[1]

Results for exact k-nearest neighbors of one query point qQ in reference set R assuming that all data structures are already built. Below we denote the distance between a query point q and the reference set R as d(q,R) and distance from a query point q to its k-nearest neighbor in set R as dk(q,R):

Name of datastructure, source

Claimed time complexity Claimed space complexity Proof of result
Navigating nets[4] O(2O(dim)log(Δ)+|B¯(q,O(d(q,R))|) O(2O(dim)|R|) Proof outline in Theorem 2.3[4]
Compressed cover tree[1] O(log(k)(cm(R)O(1)log(|Δ|)+|B¯(q,O(dk(q,R))|)) O(|R|) Corollary 3.7[1]

Using expansion constant as hidden factor

Tables below show time complexity estimates which use c(R) or KR-type constant 2dimKR[4] as a hidden factor. Note that the dimensionality factor 2dimKR is equivalent to c(R)O(1)

Results for building data structures
Name of datastructure, source

Claimed time complexity Claimed space complexity Proof of result
Navigating nets[4] O(2O(dimKR)|R|log(|R|)log(log|R|)) O(2O(dim)|R|)) Not available
Cover tree[3] O(c(R)O(1)|R|log|R|) O(|R|) Counterexample 4.2[2] shows that the past proof is incorrect.
Compressed cover tree[1] O(c(R)O(1)|R|log|R|) O(|R|) Corollary 3.10[1]

Results for exact k-nearest neighbors of one query point qX assuming that all data structures are already built.

Name of datastructure, source

Claimed time complexity Claimed space complexity Proof of result
Navigating nets[4] O(2O(dimKR(R{q})(k+log|R|)) O(2O(dim)|R|)) Not available
Cover tree[3] O(c(R)O(1)log|R|) for k = 1. O(|R|) Counterexample 5.2[2] shows that the past proof is incorrect.
Compressed cover tree[1] O(c(R{q})O(1)log(k)(log(|R|)+k)) O(|R|) Theorem 4.9

See also

References

Template:Reflist

  1. 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 Template:Cite arXiv
  2. 2.0 2.1 2.2 Template:Cite arXiv
  3. 3.0 3.1 3.2 3.3 Alina Beygelzimer, Sham Kakade, and John Langford. Cover Trees for Nearest Neighbor. In Proc. International Conference on Machine Learning (ICML), 2006.
  4. 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Kenneth Clarkson. Nearest-neighbor searching and metric space dimensions. In G. Shakhnarovich, T. Darrell, and P. Indyk, editors, Nearest-Neighbor Methods for Learning and Vision: Theory and Practice, pages 15–59. MIT Press, 2006.