Removal of the the edges from the node of a graph

조회 수: 4 (최근 30일)
Szabolcs Mihály
Szabolcs Mihály 2022년 9월 27일
댓글: Szabolcs Mihály 2022년 9월 28일
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