Graph and Network Algorithms - centrality.m

16 ビュー (過去 30 日間)
Linford Briant
Linford Briant 2017 年 1 月 13 日
コメント済み: Qiang 2017 年 4 月 3 日
I have MATLAB 9.1.0.441655 (R2016b) and want to use some of the functions in the Graph and Network Algorithm section on the MathWorks website ( https://uk.mathworks.com/help/matlab/graph-and-network-algorithms.html ) - specifically "measuring node importance" with
centrality.m
This function says that it was introduced in R2016a. However, in my version of matlab there are no such functions, and I can't find anywhere on the internet whether this is because it is a specific package/toolbox that you have to download/buy.
Can someone let me know how I get this?
Thanks, L
  1 件のコメント
Qiang
Qiang 2017 年 4 月 3 日
Has anyone ever used this built-in function? I'm using Matlab 2016a and it has this function. I tried using it to calculate betweenness centrality and it was so surprisingly FASTER than the classic algorithms I could find online (seconds versus tens of hours).
Can someone please explain why the Matlab built-in Centrality is so fast?
Thanks in advance,
Qiang

サインインしてコメントする。

採用された回答

Steven Lord
Steven Lord 2017 年 1 月 13 日
What does this command return?
which -all centrality
It should show two versions of that function, one the centrality method for graph objects and the other the method for digraph objects. Note that because this is a method, you will need to call it on an object of one of those two classes. For instance this would work:
rng default
A = sprand(100, 100, 0.1);
G = digraph(A);
C = centrality(G, 'betweenness');
This would not, even though A is the adjacency matrix of the digraph object G.
C2 = centrality(A, 'betweenness');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNetworks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by