This function calculates the global efficiency of a graph or the local or nodal efficiency of each vertex of a graph. The global efficiency is equal to the mean of all nodal efficiencies.

1 2 |

`g` |
The graph on which to calculate efficiency |

`type` |
A character string; either 'local', 'nodal', or 'global' |

`weights` |
A numeric vector of edge weights; if 'NULL', and if the graph has edge attribute 'weight', then that will be used. To avoid using weights, this should be 'NA' |

`use.parallel` |
Logical indicating whether or not to use |

Global efficiency for graph *G* with *N* vertices is:

*E_{global}(G) = \frac{1}{N(N-1)} ∑_{i \ne j \in G} \frac{1}{d_{ij}}*

where *d_{ij}* is the shortest path length between vertices *i* and
*j*.

Local efficiency for vertex *i* is:

*E_{local}(i) = \frac{1}{N} ∑_{i \in G} E_{global}(G_i)*

where *G_i* is the subgraph of neighbors of *i*, and *N* is the
number of vertices in that subgraph.

Nodal efficiency for vertex *i* is:

*E_{nodal}(i) = \frac{1}{N-1} ∑_{j \in G} \frac{1}{d_{ij}}*

A vector of the local efficiencies for each vertex of the graph (if
*type* is 'local|nodal') or a number (if *type* is 'global').

Christopher G. Watson, cgwatson@bu.edu

Latora V., Marchiori M. (2001) *Efficient behavior of
small-world networks*. Phys Rev Lett, 87.19:198701.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.