def mixing_expansion(G, S, T=None, weight=None):
 num_cut_edges = cut_size(G, S, T=T, weight=weight)
 num_total_edges = G.number_of_edges()
 return (num_cut_edges / (2 * num_total_edges))

def mixing_expansion ( G , S , T = None , weight = None ) : num_cut_edges = cut_size ( G , S , T = T , weight = weight ) num_total_edges = G . number_of_edges ( ) return ( num_cut_edges / ( 2 * num_total_edges ) )
returns the mixing expansion between two node sets .