@not_implemented_for('directed')
def local_efficiency(G):
 return (sum((global_efficiency(nx.ego_graph(G, v)) for v in G)) / len(G))

@ not_implemented_for ( 'directed' ) def local_efficiency ( G ) : return ( sum ( ( global_efficiency ( nx . ego_graph ( G , v ) ) for v in G ) ) / len ( G ) )
returns the average local efficiency of the graph .