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)
  1 件のコメント
Szabolcs Mihály
Szabolcs Mihály 2022 年 9 月 28 日
Thanks for your help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph 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