def edge_expansion(G, S, T=None, weight=None):
 if (T is None):
  T = (set(G) - set(S))
 num_cut_edges = cut_size(G, S, T=T, weight=weight)
 return (num_cut_edges / min(len(S), len(T)))

def edge_expansion ( G , S , T = None , weight = None ) : if ( T is None ) : T = ( set ( G ) - set ( S ) ) num_cut_edges = cut_size ( G , S , T = T , weight = weight ) return ( num_cut_edges / min ( len ( S ) , len ( T ) ) )
returns the edge expansion between two node sets .