Removal of the the edges from the node of a graph

3 visualizaciones (últimos 30 días)
Szabolcs Mihály
Szabolcs Mihály el 27 de Sept. de 2022
Comentada: Szabolcs Mihály el 28 de Sept. de 2022
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!

Respuesta aceptada

Matt J
Matt J el 27 de Sept. de 2022
Editada: Matt J el 27 de Sept. de 2022
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)

Más respuestas (0)

Categorías

Más información sobre Graph and Network Algorithms en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by