View source: R/06.2.Efficiency.R
network.efficiency | R Documentation |
Network efficiency quantifies how efficiently information (management relations) and/or money capital (ownership relations) flow through a network. It is essential in systemic-risk identification, resilience assessment, and crisis-propagation analysis.
network.efficiency(
...,
ignore.weights = FALSE,
use.igraph = isTRUE(requireNamespace("igraph", quietly = TRUE))
)
... |
Firm-Firm network in one of the following classes:
|
ignore.weights |
Optional parameter, defaults to |
use.igraph |
Whether to use igraph to speed-up the computation. See 'Details'. |
The function is implemented both for igraph
users and in base R
using the Floyd-Warshall algorithm.
However, the latter runs in O(n^3)
, which may not be efficient for very large networks.
The distances enter into play in the formal definition of efficiency:
E = \frac{1}{N(N-1)}\sum_{i\ne j \in \mathcal{N}}\frac{1}{d_{i,\ j}}
where:
\mathcal{N}
is the set of all nodes;
N
is the number of nodes (i.e., the number of elements in \mathcal{N}
;
d_{i,\ j}
is the shortest (weighted and directed) path distance between the nodes i
and j
.
A numeric
, the global efficiency value.
Telarico, Fabio Ashtar
Latora, Vito, and Masimo Marchiori. 'Economic Small-World Behavior in Weighted Networks'. The European Physical Journal B - Condensed Matter and Complex Systems 32, no. 2 (1 March 2003): 249–63. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1140/epjb/e2003-00095-5")}.
Floyd, Robert W. 'Algorithm 97: Shortest path'. Communications of the ACM, 5, no. 6 (1962): 345.
# Load some data
data('firms_BKB')
# Create a FF matrix
mat <- FF(firms_BKB, who = 'b', ties = 'n')
# Use the built-in Floyd-Warshall algorithm
network.efficiency(mat, use.igraph = FALSE)
#' # Create a FF graph
if(!require('igraph')){
g <- FF.graph(mat, 'simple')
# Use igraph's implementation, which gives the same result
# as the built-in Floyd-Warshall algorithm, but is faster
network.efficiency(g, use.igraph = TRUE)==network.efficiency(mat, use.igraph = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.