bbTreeGen
BB (branch-and-Bound) tree generation for nearest neighbor search
Contents
Syntax
- bbTree=bbTreeGen(data, clusterNum, levelNum, plotOpt);
Description
bbTree=bbTreeGen(data, clusterNum, levelNum) returns a BB (branch and bound) tree for efficient search of nearest neighbors, where
- data: Data matrix with each column being an observation vector
- clusterNum: No. of clusters (or children) for each node
- levelNum: No. of level of the BB tree
- bbTree: the returned BB tree with the following fields:
- bbTree(i).mean: mean vector of a tree node i
- bbTree(i).radius: radius vector of a tree node i
- bbTree(i).child: indices of children for a non-terminal node i
- bbTree(i).dataIndex: indices of data for a terminal node i
- bbTree(i).dist2mean: distance to mean of a terminal node i
Example
data=rand(2,1000); clusterNum=3; level=4; plotOpt=1; bbTree=bbTreeGen(data, clusterNum, level, plotOpt);
![](bbTreeGen_help_01.png)