Borrar filtros
Borrar filtros

How can you remove all sub-graphs that are not part of the largest component of connected sub-graphs?

1 visualización (últimos 30 días)
I imagine generating equivalence relations between the sub-graphs and doing some sort of union-find operation would be the way to go about this, but how to do this? Can somebody give an example?

Respuesta aceptada

Matt J
Matt J el 16 de Mzo. de 2022
Editada: Matt J el 16 de Mzo. de 2022
Given a agraph, G,
bins=biconncomp(G);
[~,cmaj]=max(histcounts(bins,1:max(bins)+1));
ekeep=find(bins==cmaj);
[sk,tk]=findedge(G,ekeep);
G=graph(sk,tk);
  4 comentarios

Iniciar sesión para comentar.

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

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by