def minimum_st_node_cut(G, s, t, flow_func=None, auxiliary=None, residual=None):
 if (auxiliary is None):
  H = build_auxiliary_node_connectivity(G)
 else:
  H = auxiliary
 mapping = H.graph.get('mapping', None)
 if (mapping is None):
  raise nx.NetworkXError('Invalid auxiliary digraph.')
 if (G.has_edge(s, t) or G.has_edge(t, s)):
  return []
 kwargs = dict(flow_func=flow_func, residual=residual, auxiliary=H)
 edge_cut = minimum_st_edge_cut(H, ('%sB' % mapping[s]), ('%sA' % mapping[t]), **kwargs)
 node_cut = set((H.node[node]['id'] for edge in edge_cut for node in edge))
 return (node_cut - set([s, t]))

def minimum_st_node_cut ( G , s , t , flow_func = None , auxiliary = None , residual = None ) : if ( auxiliary is None ) : H = build_auxiliary_node_connectivity ( G ) else : H = auxiliary mapping = H . graph . get ( 'mapping' , None ) if ( mapping is None ) : raise nx . NetworkXError ( 'Invalid auxiliary digraph.' ) if ( G . has_edge ( s , t ) or G . has_edge ( t , s ) ) : return [ ] kwargs = dict ( flow_func = flow_func , residual = residual , auxiliary = H ) edge_cut = minimum_st_edge_cut ( H , ( '%sB' % mapping [ s ] ) , ( '%sA' % mapping [ t ] ) , ** kwargs ) node_cut = set ( ( H . node [ node ] [ 'id' ] for edge in edge_cut for node in edge ) ) return ( node_cut - set ( [ s , t ] ) )
returns a set of nodes of minimum cardinality that disconnect source from target in g .