rustworkx.PyGraph.add_edges_from#
- PyGraph.add_edges_from(obj_list, /)#
Add new edges to the graph.
- Parameters:
obj_list (list) – A list of tuples of the form
(node_a, node_b, obj)
to attach to the graph.node_a
andnode_b
are integer indices describing where an edge should be added, andobj
is the python object for the edge data.
If
multigraph
isFalse
and an edge already exists betweennode_a
andnode_b
the weight/payload of that existing edge will be updated to beedge
. This will occur in order fromobj_list
so if there are multiple parallel edges inobj_list
the last entry will be used.- Returns:
A list of int indices of the newly created edges
- Return type:
list