find graph conected components

[labels roots] = graph_connected_components(connection_matrix)
718 Downloads
Aktualisiert 22. Nov 2011

Lizenz anzeigen

http://simulations.narod.ru/

Breadth-first search used.
[labels rts] = graph_connected_components(C)
C - connection matrix
labels =[1 1 1 2 2 3 3 ...] lenght(labels)=L, label for each vertex
labels(i) is order number of connected component, i is vertex number
rts - roots, numbers of started vertex in each component, root is some vertex of connected component.

run
zz_test_graph_connected_components_picture.m to test the function, it will find triangle and square separated.

Zitieren als

Maxim Vedenyov (2024). find graph conected components (https://www.mathworks.com/matlabcentral/fileexchange/33877-find-graph-conected-components), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2010b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Graph and Network Algorithms finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0