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!