get adjacent matrix from horizontal visibility Graph code.
1 view (last 30 days)
Show older comments
i want to get adjacency matrix from horizontal visibility graph code. i know that reshaping dvd as 1xnumel(dvd) would get adjancency matrix 12x12 but i have to run graph code for each column by using for loop columnwise on smaller data (dvd) and get a single adjacent matrix, i am trying this so that i can also run this for large data,which gives me adjancency matrix of 1048560x1048560.
0 Comments
Answers (1)
SAI SRUJAN
on 11 Oct 2023
Hi Vedant Chauhan,
I understand that you are trying to find the adjacency matrix of a graph.
In MATLAB,you have the ability to get the adjacency matrix of a graph using "adjacency" function.You can follow the below given example to resolve the issue.
A = [0 5 3 0;0 0 1 2; 0 0 0 11; 0 0 0 0];
G = graph(A,'upper');
B = adjacency(G);
For a comprehensive understanding of the "adjacency" function in MATLAB, please refer to the provided documentation below.
0 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!