network.efficiency function

Calculate network efficiency

Calculate network efficiency

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)) )

Arguments

  • ...: Firm-Firm network in one of the following classes:

    • financial_matrix produced by FF and family;
    • network_financial or network if the relevant package is installed;
    • igraph_financial or igraph if the relevant package is installed.
  • ignore.weights: Optional parameter, defaults to FALSE. If TRUE, ignore ties weights in the computation.

  • use.igraph: Whether to use igraph to speed-up the computation. See 'Details'.

Returns

A numeric, the global efficiency value.

Details

The function is implemented both for igraph users and in base R using the Floyd-Warshall algorithm. However, the latter runs in O(n3)O(n^3), which may not be efficient for very large networks.

The distances enter into play in the formal definition of efficiency:

E=1N(N1)ijN1di, j E = \frac{1}{N(N-1)}\sum_{i\ne j \in \mathcal{N}}\frac{1}{d_{i,\ j}}

where:

  • N\mathcal{N} is the set of all nodes;
  • NN is the number of nodes (i.e., the number of elements in N\mathcal{N};
  • di, jd_{i,\ j} is the shortest (weighted and directed) path distance between the nodes ii and jj.

Examples

# 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) }

References

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. 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.

Author(s)

  • Maintainer: Fabio Ashtar Telarico
  • License: GPL (>= 3)
  • Last published: 2024-10-31