Connectivity check for undirected graphs.

Version 1.1.0.0 (2.17 KB) by Twan Burg
For an adjacency matrix it checks if the vertices are connected with each other. Also other files.
611 Downloads
Updated 1 Mar 2012

View License

There are 4 files:
Checkc:
As input it needs the nxn adjacecency matrix which shows which vertices are connected to which vertices. Then the function produces a 1 if the vertices are connected (i.e. you can reach every vertex from every other vertex in a limited number of steps) and a 0 if not. It is not 100% efficient, but the code is short and it seems to work.

Checkcc:
Input: nxn Adjacency matrix and an individual i.
Output: A vector I which shows with who individual i is connected, including i itself. So this is a 1 by n vector with ones for the vertices who can reach i in a limited number of steps.

Whoare:
Input: nxn Adjacency matrix
Output: A vector which indicates who are in the biggest connected group. Update: Takes the group with the highest value(when giving weights to each individuals with vector w).

bigcong:
Input: nxn Adjacency matrix
Output: A number which indicates the size of the biggest group

Cite As

Twan Burg (2024). Connectivity check for undirected graphs. (https://www.mathworks.com/matlabcentral/fileexchange/35347-connectivity-check-for-undirected-graphs), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Undirected Graphs in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Updated some related functions. Now it is possible to determine the biggest connected group and the size of it. Also you can see with who a certain individual is connected.

1.0.0.0