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에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.