Get coordinates of 3-D force-directed graph plot without plotting?

3 ビュー (過去 30 日間)
Burke Rosen
Burke Rosen 2022 年 12 月 2 日
回答済み: Christine Tobler 2023 年 7 月 26 日
I have a very large weighted undirected graph and I want to run the 3-d force directed graph algorithm without actually creating the figure. The following works for small graphs but is cumbersome for large ones.
% create sample weighted undirected graph objectwith pseudorandom weights
nN = 1e3;% # of nodes
G = graph(squareform(randi(10,[(nN^2-nN)./2 1]))));
% Perform 3-D force-directed algo with graph plotting function
pH = plot(G,'layout','force3','WeightEffect','Direct','Iterations',1e5);
% extract coordinates from plot
xyz = [pH.XData;pH.YData;pH.ZData]';
Is there are way to access lower level functions to apply the same algorithm and obtain the coordinates xyz without plotting anything (ideally more efficiently)? Thank you.

採用された回答

Christine Tobler
Christine Tobler 2023 年 7 月 26 日
There isn't currently such a function available.
For the example above, nearly all the time is being spent in computing the coordinates, so at least there isn't much time lost in plotting, although I understand that the unnecessary figure can get in the way.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by