rustworkx.PyDAG.find_successors_by_edge#

PyDAG.find_successors_by_edge(node, filter_fn, /)#

Return a filtered list of successors data such that each node has at least one edge data which matches the filter.

Parameters:
  • node (int) – The index for the node to get the successors for

  • filter_fn – The filter function to use for matching nodes. It takes in one argument, the edge data payload/weight object, and will return a boolean whether the edge matches the conditions or not. If any edge returns True, the node will be included.

Returns:

A list of the node data for all the child neighbor nodes whose at least one edge matches the filter

Return type:

list