Skip to main content
IBM Quantum Platform

replace_edges_with_one_edge

samplomatic.graph_utils.replace_edges_with_one_edge(graph: PyDiGraph[T, S], parent_idx: int, child_idx: int, new_edge: S) → int

GitHub

Replace all the parallel edges between two nodes with a single edge.

Parameters

  • graph – The graph to mutate.
  • parent_idx – The index of the parent node.
  • child_idx – The index of the child node.
  • new_edge – The new edge.

Returns

The indices of the new edges.

Was this page helpful?
Report a bug, typo, or request content on GitHub.