Skip to content

Commit d87c0bf

Browse files
committed
Better weighted_outneighbors function
1 parent c81c6c1 commit d87c0bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ end
8888

8989
Graphs.has_edge(fg::FeaturedGraph, u::Int, v::Int) = has_edge(graph(fg), u, v)
9090

91-
# Returns adjacncy matri
91+
# Returns (neighbors::Vector{Int}, weights::Vector{Float64})
9292
function weighted_outneighbors(fg::FeaturedGraph, v::Int)
93-
graph(fg).S[v,:] |> findnz
93+
nbrs = neighbors(fg,v; dir=:out)
94+
nbrs, graph(fg).S[v, nbrs]
9495
end
9596

9697
function check_num_nodes(fg::FeaturedGraph, x::AbstractArray)

0 commit comments

Comments
 (0)