All edges attached to given node in a (di)graph
1 次查看(过去 30 天)
显示 更早的评论
I have a simple and, I imagine, common question about working with graphs. Is there a built-in way to find all the edges pointing into and out of a given node. I can use this
outgoing = findedge(G,1,successors(G,1));
incoming = findedge(G,1,predecessors(G,1));
but I would think there's something built in.
1 个评论
Sindhu Priya
2017-2-14
I am not aware if there is a built in function for finding the predecessor and successor edges of a digraph.
Regards,
Sindhu
回答(1 个)
Christine Tobler
2017-2-21
There is currently no builtin for this, your lines with findedge are the simplest way to get the edge indices.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!