@not_implemented_for('directed')
def efficiency(G, u, v):
 return (1 / nx.shortest_path_length(G, u, v))

@ not_implemented_for ( 'directed' ) def efficiency ( G , u , v ) : return ( 1 / nx . shortest_path_length ( G , u , v ) )
returns the efficiency of a pair of nodes in a graph .