rustworkx.PyDiGraph.update_edge#

PyDiGraph.update_edge(source, target, edge, /)#

Update an edge’s weight/payload inplace

If there are parallel edges in the graph only one edge will be updated. if you need to update a specific edge or need to ensure all parallel edges get updated you should use update_edge_by_index() instead.

Parameters:
  • source (int) – The index for the first node

  • target (int) – The index for the second node

Raises:

NoEdgeBetweenNodes – When there is no edge between nodes