View source: R/graph_efficiency.R
graph_efficiency | R Documentation |
Computation of the efficiency of a network
graph_efficiency(g, diag = FALSE)
g |
|
diag |
|
This is a helper function to be able to calculate the
efficiency of a network of class igraph
.
The function that does the calculation is
efficiency
, which would require the conversion
of the igraph
object into a network
object
or a non-sparse adjacency matrix.
This current function does the conversion to a non-sparse
adjacency matrix under the hood and then feeds that to
efficiency
for the actual calculation.
From the sna
help:
Let G= G_1 U ... U G_n be a digraph with weak components G_1,G_2,...,G_n. For convenience, we denote the cardinalities of these components' vertex sets by |V(G)|=N and |V(G_i)|=N_i, for i in 1,...,n. Then the Krackhardt efficiency of G is given by 1 - ( |E(G)| - Sum(N_i-1,i=1,..,n) )/( Sum(N_i(N_i-1) - (N_i-1),i=1,..,n) ) which can be interpreted as 1 minus the proportion of possible 'extra' edges (above those needed to weakly connect the existing components) actually present in the graph. A graph which an efficiency of 1 has precisely as many edges as are needed to connect its components; as additional edges are added, efficiency gradually falls towards 0.
A single numeric value between 0 (completely inefficient graph) and 1 (maximally efficient graph). The value 0 can occur when the network is disconnected.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.