@not_implemented_for('undirected', 'multigraph')
def overall_reciprocity(G):
 n_all_edge = G.number_of_edges()
 n_overlap_edge = ((n_all_edge - G.to_undirected().number_of_edges()) * 2)
 if (n_all_edge == 0):
  raise NetworkXError('Not defined for empty graphs')
 return (float(n_overlap_edge) / float(n_all_edge))

@ not_implemented_for ( 'undirected' , 'multigraph' ) def overall_reciprocity ( G ) : n_all_edge = G . number_of_edges ( ) n_overlap_edge = ( ( n_all_edge - G . to_undirected ( ) . number_of_edges ( ) ) * 2 ) if ( n_all_edge == 0 ) : raise NetworkXError ( 'Not defined for empty graphs' ) return ( float ( n_overlap_edge ) / float ( n_all_edge ) )
compute the reciprocity for the whole graph .