def find_induced_nodes(G, s, t, treewidth_bound=sys.maxsize):
 if (not is_chordal(G)):
  raise nx.NetworkXError('Input graph is not chordal.')
 H = nx.Graph(G)
 H.add_edge(s, t)
 I = set()
 triplet = _find_chordality_breaker(H, s, treewidth_bound)
 while triplet:
  (u, v, w) = triplet
  I.update(triplet)
  for n in triplet:
   if (n != s):
    H.add_edge(s, n)
  triplet = _find_chordality_breaker(H, s, treewidth_bound)
 if I:
  I.add(t)
  for u in G[s]:
   if (len((I & set(G[u]))) == 2):
    I.add(u)
    break
 return I

def find_induced_nodes ( G , s , t , treewidth_bound = sys . maxsize ) : if ( not is_chordal ( G ) ) : raise nx . NetworkXError ( 'Input graph is not chordal.' ) H = nx . Graph ( G ) H . add_edge ( s , t ) I = set ( ) triplet = _find_chordality_breaker ( H , s , treewidth_bound ) while triplet : ( u , v , w ) = triplet I . update ( triplet ) for n in triplet : if ( n != s ) : H . add_edge ( s , n ) triplet = _find_chordality_breaker ( H , s , treewidth_bound ) if I : I . add ( t ) for u in G [ s ] : if ( len ( ( I & set ( G [ u ] ) ) ) == 2 ) : I . add ( u ) break return I
returns the set of induced nodes in the path from s to t .