Largest Component

Takes an adj. matrix of a network and outputs a list of the nodes in its largest connected component

You are now following this Submission

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 (2026). Largest Component (https://www.mathworks.com/matlabcentral/fileexchange/30926-largest-component), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Graph and Network Algorithms in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
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