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.PyDiGraph.add_parent#

PyDiGraph.add_parent(child, obj, edge, /)#

Add a new parent node to the dag.

This create a new node on the dag and add an edge to the child from that new node

Parameters:
  • child (int) – The index of the child node

  • obj – The python object to attach to the node

  • edge – The python object to attach to the edge

Returns index:

The index of the newly created parent node

Return type:

int