This is where navigation should be.


GSP_NN_GRAPH - Create a nearest neighbors graph from a point cloud

Usage

:  G = gsp_nn_graph( Xin );
G = gsp_nn_graph( Xin, param );

Input parameters

Xin Input points
param Structure of optional parameters

Output parameters

G Resulting graph

Description

'gsp_nn_graph( Xin, param )' creates a graph from positional data. The points are connected to their neighbors (either belonging to the k nearest neighbors or to the epsilon-closest neighbors.

Example:

P = gsp_pointcloud('bunny');
param.type = 'knn';
G = gsp_nn_graph(double(P), param);
gsp_plot_graph(G);
gsp_nn_graph_1_1.png

Additional parameters

  • param.type : ['knn', 'radius'] the type of graph (default 'knn')
  • param.use_flann : [0, 1] use the FLANN library (default 0)
  • param.use_full : [0, 1] - Compute the full distance matrix and then sparsify it (default 0)
  • param.center : [0, 1] center the data (default 0)
  • param.rescale : [0, 1] rescale the data on a 1-ball (def 0)
  • param.sigma : float the variance of the distance kernel
  • param.k : int number of neighbors for knn (def 10)
  • param.epsilon : float the radius for the range search
  • param.use_l1 : [0, 1] use the l1 distance (def 1)
  • param.symmetrize_type: ['average','full'] symmetrization type (default 'full')
  • param.min_weight: float constant additive weight for each edge (default 0)
  • param.zero_diagonal: [0, 1] zero out the diagonal (default 1)
  • param.weight_kernel: function edge-weighting kernel (default gaussian)