ITensor / ITensor/NamedGraphs.jl
Implement `next_nearest_neighbors`
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 10
- Forks
- 5
- Avg merge
- 6h 43m
- Merged PRs (30d)
- 17
Description
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:
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 https://github.com/mtfishman/ITensorNetworks.jl/pull/18#discussion_r1014849996
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the graph-neighbor algorithms and reading Graphs.neighborhood_dists, which the issue identifies as the likely basis. Implement next_nearest_neighbors(g, v) so it returns the vertices at distance 2 from v, and verify that behavior against the repository's existing graph tests or test setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100