rustworkx.PyDiGraph.insert_node_on_in_edges_multiple¶
- PyDiGraph.insert_node_on_in_edges_multiple(node, ref_nodes, /)¶
Insert a node between a list of reference nodes and all their predecessors
This essentially iterates over all edges into the reference node specified in the
ref_nodesparameter removes those edges and then adds 2 edges, one from the predecessor ofref_nodetonodeand the other fromnodetoref_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