Skip to content

Commit

Permalink
Update src/lib/GraphsExtensions/src/neighbors.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman authored May 15, 2024
1 parent 29a491e commit 3c38524
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/GraphsExtensions/src/neighbors.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Graphs: AbstractGraph, neighborhood_dists

function vertices_at_distance(g::AbstractGraph, vertex, distance::Int)
n_dists = neighborhood_dists(g, vertex, distance)
return map(first, filter(==(distance) last, n_dists))
vertices_and_distances = neighborhood_dists(g, vertex, distance)
return map(first, filter(==(distance) last, vertices_and_distances))
end

next_nearest_neighbors(g::AbstractGraph, v) = vertices_at_distance(g, v, 2)

0 comments on commit 3c38524

Please sign in to comment.