JuliaGraphs / MetaGraphsNext.jl

A package for graphs with vertex labels and metadata in Julia
http://juliagraphs.org/MetaGraphsNext.jl/
Other
73 stars 17 forks source link

add all_neighbor_labels function #76

Closed apriljunge closed 5 months ago

apriljunge commented 6 months ago

In Graphs.jl the all_neighbors function returns in- and outneighbors for all graphs. This is especially needed for directed graphs. (Docs).

I think it would be nice to have a corresponding function like all_neighbor_labels in this package. Implementation should be straight forward like in Graphs.jl.

What do you think?

gdalle commented 6 months ago

I think we already do have it! https://juliagraphs.org/MetaGraphsNext.jl/dev/api/#MetaGraphsNext.neighbor_labels-Tuple{MetaGraph,%20Any}

apriljunge commented 6 months ago

This only works für undirected Graphs. For directed graphs neighbor_labels just returns labels of out neighbors. This is expected behaviour, because it relies on Graphs.neighbors. From the docomentation of Graphs.jl for Graphs.neighbors:

For directed graphs, the default is equivalent to outneighbors; use all_neighbors to list inbound and outbound neighbors.

This is why I think all_neighbor_labels is still needed to get in- and outbound neighbors on directed graphs.

gdalle commented 6 months ago

Oh right, sorry I missed that. Feel free to open a PR adding it then!

gdalle commented 5 months ago

Closed by #77