Closed
Description
It looks like we could make use of Graphs.neighborhood_dists to create a more general function for outputting the vertices that are the k-nearest neighbors of a specified vertex, for example:
function k_nearest_neighbors(g::AbstractGraph, v, d)
nds = neighborhood_dists(g, v, d)
# Filter `nds` for vertices with distances equal to `d`
end
Then next_nearest_neighbors(g, v) = k_nearest_neighbors(g, v, 2)
.
Originally posted by @mtfishman in #18 (comment)
Metadata
Metadata
Assignees
Labels
No labels