All edges attached to given node in a (di)graph

조회 수: 5 (최근 30일)
Roy Goodman
Roy Goodman 2017년 2월 6일
답변: Christine Tobler 2017년 2월 21일
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
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
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.

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by