Skip to content

Commit 368f2fa

Browse files
committed
Faster weighted_outneighbors
1 parent ac4c179 commit 368f2fa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/utils.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,11 @@ function edges(fg::FeaturedGraph)
8686
edges
8787
end
8888

89-
function has_edge(fg::FeaturedGraph, u::Int, v::Int)
90-
GraphSignals.adjacency_matrix(fg)[u,v] != 0 ? true : false
91-
end
92-
93-
outneighbors(fg::FeaturedGraph, v::Int) = GraphSignals.adjacency_matrix(fg)[v,:] |> SparseVector |> findnz |> x->x[1]
89+
Graphs.has_edge(fg::FeaturedGraph, u::Int, v::Int) = has_edge(graph(fg), u, v)
9490

91+
# Returns adjacncy matri
9592
function weighted_outneighbors(fg::FeaturedGraph, v::Int)
96-
neighbors, weights = GraphSignals.adjacency_matrix(fg)[v,:] |> SparseVector |> findnz
93+
graph(fg).S[v,:] |> findnz
9794
end
9895

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

0 commit comments

Comments
 (0)