Constructs a symmetric KNN graph from a given feature space.
ConstructKnnGraph(
knn = 5,
feature_space,
adjust_disconnection = TRUE,
self_loop = 1
)
integer; the number of nearest neighbors to consider for constructing the graph. Default is 5.
matrix; a cell-by-coordinate matrix (e.g., 20 principal components).
boolean; TRUE for fully connecting disconnected components. Default is TRUE.
integer; weight for self connections (default is 1).
A list containing the following elements:
matrix; symmetric KNN graph W, computed as pmax(1, (A + A^T) / 2)
.
matrix; adjacency matrix A.
list; disconnected components in the graph, each component is represented as a subgraph.