Finding and representing connectivity in pairs
2 views (last 30 days)
Show older comments
I have an Nx2 matrix with numbers that tells me about pairing. What I want to do is find a way to represent the pairs and find connected graphs using it. An example input would be:
1 2
3 4
3 5
6 7
4 7
4 5
4 8
4 9
7 5
7 8
7 10
7 9
7 11
7 12
5 13
5 8
5 11
5 12
14 15
14 16
17 18
8 10
8 9
8 11
10 11
10 12
9 2
11 12
How could I use this to represent a connected graph? I would then like to get the subgraphs and be able to compare them to others so I could see if they repeat. This has been causing me issues because I'm not even sure where to start. Thank you in advance!
EDIT: I was able to find this : https://www.mathworks.com/matlabcentral/newsreader/view_thread/168883
I could make it so that I create a matrix of 1's and 0's, would that work?
0 Comments
Answers (1)
Image Analyst
on 25 Mar 2014
Why not just use unique() to check for repeats and ismember() to check if the pairs exist in another data set?
4 Comments
See Also
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!