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.PyDiGraph.extend_from_weighted_edge_list#
- PyDiGraph.extend_from_weighted_edge_list(edge_list, /)#
Extend graph from a weighted edge list
This method differs from
add_edges_from()
in that it will add nodes if a node index is not present in the edge list.- Parameters:
edge_list (iterable[tuple[int, int, T]]) – An iterable of tuples in the form
(source, target, weight)
wheresource
andtarget
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.