Skip to main content
IBM Quantum Platform
翻訳情報

このページの追加言語翻訳は近日公開予定です。

replace_nodes_with_one_node

samplomatic.graph_utils.replace_nodes_with_one_node(graph: PyDiGraph[T, S], node_idxs: Iterable[int], new_node: T) → int

GitHub

Replace given nodes with a single node, preserving all outward/inward edges.

Parameters

  • graph – The graph to mutate.
  • node_idxs – The connected nodes to replace.
  • new_node – The node to replace them with.

Returns

The index of the new node in the graph.

このページは役に立ちましたか?
バグや誤字の報告、またはコンテンツの要求はGitHubで行ってください。