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_parent#

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

Add a new parent node to the graph.

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

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

  • obj – The Python object to attach to the new node

  • edge – The python object to attach to the edge

Returns index:

The index of the newly created parent node

Return type:

int