Construct a kNN-graph from an input adjacency matrix - either binary or distances between NNs.
An n X n
(optional) Scalar value that represents the number of nearest neighbours in the original graph. This
can also be inferred directly from the adjacency matrix
Logical scalar indicating if the input matrix is binary or not.
Milo with the graph slot populated.
This function will take a matrix as input and construct the kNN graph that it describes. If the matrix is not symmetric then the graph is assumed to be directed, whereas if the matrix is not binary, i.e. all 0's and 1's then the input values are taken to be distances between graph vertices; 0 values are assumed to represent a lack of edge between vertices.