Code covered by the BSD License  

Highlights from
Find Network Components

Be the first to rate this file! 65 Downloads (last 30 days) File Size: 2.11 KB File ID: #42040

Find Network Components

by Daniel Larremore

 

31 May 2013 (Updated 05 Jun 2013)

Find network components, sizes, and lists of member nodes.

| Watch this File

File Information
Description

Given an undirected network represented by an adjacency matrix, we may wish to find that network's
- largest component
- number of components
- list of which nodes are in which component together.

This code computes these rapidly (linear in the number of nodes) and accurately. The code is commented so that if you wish to modify it, you may do so.

INPUT:
1. Network adjacency matrix.

OUTPUTS:
1. Number of network components
2. Sizes of network components
3. Membership list of each component
4. Index of largest component in outputs 1 and 2 (since the largest component is often of interest)

Code includes a couple examples of usage at the top. I have tested this in R2013a, but it uses nothing fancy, and I believe it to be backward compatible for many years.

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File  
Everyone's Tags
component, giant component, graph theory, largest component, mathematics, network, percolation
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
05 Jun 2013

Fixed typo in description.

Contact us