rustworkx.PyDAG.insert_node_on_out_edges#
- PyDAG.insert_node_on_out_edges(node, ref_node, /)#
Insert a node between a reference node and all its successor nodes
This essentially iterates over all edges out of the reference node specified in the
ref_nodeparameter removes those edges and then adds 2 edges, one fromref_nodetonodeand the other fromnodeto the successor ofref_node. The edge payloads for the newly created edges are copied by reference from the original edge that gets removed.- Parameters:
node (int) – The node index to insert between
ref_node (int) – The reference node index to insert
nodebetween