how to determine efficiency centrality of a node in Matlab

Antworten (2)

Steven Lord
Steven Lord am 12 Jun. 2021

0 Stimmen

Build a graph or digraph representation of your network and call centrality on it. Depending on how you define "efficiency" you may want to specify one of the types of centrality. See the description of the type input argument on the documentation page for more information.
Christine Tobler
Christine Tobler am 14 Jun. 2021
Bearbeitet: Christine Tobler am 14 Jun. 2021
There isn't an efficiency centrality implemented in MATLAB. Based on the paper I quickly read, it seems you would best compute this using
G = graph(1, 2:5);
n = numnodes(G);
D = 1./distances(G);
D(1:n+1:end) = 0; % Set diagonal to zero
P = sum(D, 'all') / n / (n-1);
c = zeros(n, 1);
for i=1:n
Gi = rmnode(G, i);
D = 1./distances(Gi);
D(1:n:end) = 0; % Set diagonal to zero
Pi = sum(D, 'all') / (n-1) / (n-2);
c(i) = (P - Pi) / P;
end
c
c = 5×1
1.0000 -0.0714 -0.0714 -0.0714 -0.0714
Please verify this matches the definition of efficiency centrality you're looking for, since there seem to be modified versions described.
There might be more efficient implementations than this, but I didn't find any paper mentioning a specific algorithm to be used - and this matches the definitions in the paper.

4 Kommentare

Can you please mention the paper that you have read? I wrote one code for the computation of this centrality. We both are getting the same result expect for the last node in the network.
The paper was "A measure of centrality based on network efficiency", V. Latora and M. Marchiori 2007 New J. Phys.9 188.
In the example graph I posted above, nodes 2-5 should all have the same centrality, since the graph is symmetric. Are you getting different results there, or for some other graph?
Christine Tobler
Christine Tobler am 14 Jun. 2021
Bearbeitet: Christine Tobler am 14 Jun. 2021
If the difference is just in the last node, it might have something to do with how the number of nodes is computed for the scaling (the "/ n / (n-1)" part in my code above).
Easiest thing to check that might be to reorder the nodes in the graph using the reordernodes method, and checking if you get the same values (reordered of course).
No Sir not for the same graph I tried for the network in this paper

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 12 Jun. 2021

Kommentiert:

am 14 Jun. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by