Connectivity check for undirected graphs.
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
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.