Finding Connected Component in the graph.
3 views (last 30 days)
Clayton Gotberg on 24 Apr 2021
Have you looked at the functions available for graphs (see the 'Object Functions' section) in MATLAB? It appears that conncomp will do exactly what you're looking for.
G = graph(); % put your graph here
[bins,binsizes] = conncomp(G); % Find the connected components in G and find the number
% of nodes in each connected component
% binsizes = number of nodes in each connected component
% bins = vector explaining which bin each node goes into