Largest Component

Takes an adj. matrix of a network and outputs a list of the nodes in its largest connected component
1.4K Downloads
Updated 6 Jun 2011

View License

B=largestcomponent(A)

This function find the largest connected component of a networks.

Input A is the adjacency matrix of the network.

Output B is a list of the nodes that are in the largest component.

A(B,B) will give the adj. matrix of the largest component.

Cite As

Puck Rombach (2024). Largest Component (https://www.mathworks.com/matlabcentral/fileexchange/30926-largest-component), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Graph and Network Algorithms in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.4.0.0

Fixed bug about multiple largest components.

1.1.0.0

Made the code faster by not using the 'find' function.

1.0.0.0