Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

rustworkx.PyDAG.add_child#

PyDAG.add_child(parent, obj, edge, /)#

Add a new child node to the graph.

This will create a new node on the graph and add an edge from the parent to that new node.

Parameters:
  • parent (int) – The index for the parent node

  • obj – The python object to attach to the node

  • edge – The python object to attach to the edge

Returns:

The index of the newly created child node

Return type:

int