rustworkx.PyDiGraph.find_adjacent_node_by_edge#

PyDiGraph.find_adjacent_node_by_edge(node, predicate, /)#

Find a target node with a specific edge

This method is used to find a target node that is a adjacent to a given node given an edge condition.

Parameters:
  • node (int) – The node to use as the source of the search

  • predicate (callable) – A python callable that will take a single parameter, the edge object, and will return a boolean if the edge matches or not

Returns:

The node object that has an edge to it from the provided node index which matches the provided condition