network.efficiency: Calculate network efficiency

View source: R/06.2.Efficiency.R

network.efficiencyR Documentation

Calculate network efficiency

Description

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.

Usage

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

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.

Value

A numeric, the global efficiency value.

Author(s)

Telarico, Fabio Ashtar

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

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


FinNet documentation built on Oct. 31, 2024, 5:07 p.m.