Remove edges in a subgraph SG using nodes IDs (numbers) from the graph G
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi, I have a graph defined by node pairs (node IDs): s = [1 1 2 4 7 ...] t = [2 5 3 5 6 ...] Since the graph is huge and I would need to work only on a portion of it, I extracted a subgraph.
If I am not wrong, it looks like that subgraph is reordering the node IDs (right?), therefore, when I try to remove edges (and nodes) from the subgraph, by using the same node IDs of my graph contained in s = [...] and in t = [...], I get an error.. Any idea to fix this small issue? (I also tried to assign and employ "nodenames"..but without success)
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 11월 7일
편집: Walter Roberson
2019년 11월 7일
Use node names instead of node numbers when you create the graph. Then in the sub-graph you can use findnode(). Or just give the node names directly in the rmedge() call.
댓글 수: 4
참고 항목
카테고리
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!