graph_efficiency: Compute Graph Efficiency

View source: R/graph_efficiency.R

graph_efficiencyR Documentation

Compute Graph Efficiency

Description

Computation of the efficiency of a network

Usage

graph_efficiency(g, diag = FALSE)

Arguments

g

igraph object or an adjacency matrix

diag

TRUE if the diagonal contains valid data; by default, diag==FALSE.

Details

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.

Value

A single numeric value between 0 (completely inefficient graph) and 1 (maximally efficient graph). The value 0 can occur when the network is disconnected.


SNAnalyst/DF21 documentation built on March 21, 2022, 12:02 a.m.