rustworkx.PyGraph.extend_from_edge_list#
- PyGraph.extend_from_edge_list(edge_list, /)#
Extend graph from an edge list
This method differs from
add_edges_from_no_data()
in that it will add nodes if a node index is not present in the edge list.If
multigraph
isFalse
and an edge already exists betweennode_a
andnode_b
the weight/payload of that existing edge will be updated to beNone
.- Parameters:
edge_list (list) – A list of tuples of the form
(source, target)
where source and target are integer node indices. If the node index is not present in the graph, nodes will be added (with a node weight ofNone
) to that index.