def minimum_st_edge_cut(G, s, t, flow_func=None, auxiliary=None, residual=None):
 if (flow_func is None):
  flow_func = default_flow_func
 if (auxiliary is None):
  H = build_auxiliary_edge_connectivity(G)
 else:
  H = auxiliary
 kwargs = dict(capacity='capacity', flow_func=flow_func, residual=residual)
 (cut_value, partition) = nx.minimum_cut(H, s, t, **kwargs)
 (reachable, non_reachable) = partition
 cutset = set()
 for (u, nbrs) in ((n, G[n]) for n in reachable):
  cutset.update(((u, v) for v in nbrs if (v in non_reachable)))
 return cutset

def minimum_st_edge_cut ( G , s , t , flow_func = None , auxiliary = None , residual = None ) : if ( flow_func is None ) : flow_func = default_flow_func if ( auxiliary is None ) : H = build_auxiliary_edge_connectivity ( G ) else : H = auxiliary kwargs = dict ( capacity = 'capacity' , flow_func = flow_func , residual = residual ) ( cut_value , partition ) = nx . minimum_cut ( H , s , t , ** kwargs ) ( reachable , non_reachable ) = partition cutset = set ( ) for ( u , nbrs ) in ( ( n , G [ n ] ) for n in reachable ) : cutset . update ( ( ( u , v ) for v in nbrs if ( v in non_reachable ) ) ) return cutset
returns the edges of the cut-set of a minimum -cut .