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.PyDAG.update_edge#

PyDAG.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