Removal of the the edges from the node of a graph

4 次查看(过去 30 天)
Hi!
I have an undirected graph where I need to remove all the edges of a specified node. I tried to regenerate the graph without the specific node, but it was taking too much time. How can I do it without regenerating?
Thank you!

采纳的回答

Matt J
Matt J 2022-9-27
编辑:Matt J 2022-9-27
You want to remove the edges but keep the node itself? If so,
G=rmedge(G,outedges(G,nodeID))
If you want to remove the node and its edges, it should be enough to do,
G=rmnode(G,nodeID)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by