efficiency(G, u, v)¶
Returns the efficiency of a pair of nodes in a graph.
The efficiency of a pair of nodes is the multiplicative inverse of the shortest path distance between the nodes 1. Returns 0 if no path between nodes.
networkx.Graph) – An undirected graph for which to compute the average local efficiency.
u, v (node) – Nodes in the graph
Multiplicative inverse of the shortest path distance between the nodes.
- Return type
Edge weights are ignored when computing the shortest path distances.