You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement next_nearest_neighbors(g, v) which returns the next-to-nearest neighbors of a vertex v in g.
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:
functionk_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).
Implement
next_nearest_neighbors(g, v)
which returns the next-to-nearest neighbors of a vertexv
ing
.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:
Then
next_nearest_neighbors(g, v) = k_nearest_neighbors(g, v, 2)
.Originally posted by @mtfishman in ITensor/ITensorNetworks.jl#18 (comment)
The text was updated successfully, but these errors were encountered: