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.PyGraph.add_edges_from#
- PyGraph.add_edges_from(obj_list, /)#
Add new edges to the graph.
- Parameters:
obj_list (iterable[tuple[int, int, T]]) – An iterable of tuples of the form
(node_a, node_b, T)to attach to the graph.node_aandnode_bare integer indices describing where an edge should be added, andTis the python object for the edge data.
If
multigraphisFalseand an edge already exists betweennode_aandnode_bthe weight/payload of that existing edge will be updated to beedge. This will occur in order fromobj_listso if there are multiple parallel edges inobj_listthe last entry will be used.- Returns:
A list of indices of the newly created edges
- Return type: